- _dom Create an HTMLElement
- _dom.addService (beta) adds a module service
- _dom.append (deprecated,system) adds elements to target
- _dom.catchMethod (beta) Hacks target native methods
- _dom.cssStatus (beta) Use with model declaration to handle status binded css
- _dom.defaultCss Get browser native element default css values.
- _dom.export (beta) clone _dom module and obfuscate unreferenced models
- _dom.findParent Finds dom parent if the condition is fullfilled
- _dom.has Checks if a model is available in this module.
- _dom.import (beta) import other modules
- _dom.instance Instanciates a declared model. …
- _dom.model Add a custom element to this module. …
- _dom.modelShadow renders your model intanciable via html by using dom shadow
- _dom.modelShadowed check if a model has allready been shadowed.
- _dom.module (beta) returns an empty module. …
- _dom.rule Create a new js cssRule object;
- _dom.rules Create a collection of cssRule objects;
- _dom.scrollTo scroll container to target element
- _dom.models
- _dom.moduleName
- _dom.services
- _dom.sheet
- _dom.uid
Create an HTMLElement
- parameter {string} tagName the element tagname
- parameter {object} [datas] element attributes.
- parameter {Array} [childs] element childs. can contain strings an html elements.
- parameter {string} [nameSpace] element namesapace if any.
- returns {HTMLElement} a new html element
(beta) adds a module service
- param {string} name
- param {Class(proxy:DomServiceConstructorProxy)} constructor : service constructor
- param {array|function():array} args arguments for instanciation
- returns {any} service
(deprecated,system) adds elements to target
- param {*} target
- param {html||text[]} childs
(beta) Hacks target native methods
- param {object} target
- param {string} method
- param {function} callback
- returns {CatchMethod}
(beta) Use with model declaration to handle status binded css
- param {string|object(prefix?:string,defaultValue?:string,initValue?:string)} options
css prefix or options :
- prefix?: the css prefixing status className
- defaultValue?: the default status when unidentified
- initValue?: the status when attaching dom. - returns {DomCssStatus}
Get browser native element default css values.
- parameter {string} tagName : tag name of the native element to test
- returns {Map} the default css values.
(beta) clone _dom module and obfuscate unreferenced models
- param {string[]|string} models : reference public models.
- returns {_dom}
Finds dom parent if the condition is fullfilled
- param {Htmlelement} dom : the starting element
- param {function():boolean} condition : checks if the element fullfills your conditions
- param {number>1} maxDeep : how deep in the parent pile you will search
- returns {Htmlelement}
Checks if a model is available in this module.
- parameter {string} tagName : the name of the model
- return {boolean} true if tagName exists.
(beta) import other modules
- param {Array<_dom|DomModule>} domModules
Instanciates a declared model.
Useful if you dont want of the __dom property in your html element.
If not, you should instead use _dom and refer to the result __dom attribute.
- parameter {string} tagName
- parameter {...} ___ whatever arguments the model constructor uses
- returns {DomModelInstance} an object with the 'dom' property as the root HTMLElement.
Add a custom element to this module.
NB: the __dom property will be added to the element, pointing to it's interface (model instance).
interface['dom'] : dom element;
interface[tagName] : element tagName;
- parameter {string} tagName the custom element name. Should contain at least one "-" to avoid conflict with natives HTMLElements.
- parameter {function} constructor receive the arguments of _dom(...args) but the dont have to respect the nomenclature excepted 'tagName'.
Must return an HTMLElement.
NB : constructor Must be a function and NOT a lambda expression because it is scoped to its interface. - parameter {object|function} [cssRules] is or returns an object describing rules like _dom.rules,
but the created collection will be instancied only once and shared among interfaces.
Adds the 'rules' property to the interface. - parameter {boolean|object} [shadowed] If true or object, your model is instanciable via html.
See _dom.modelShadow.
if object, shadowed is the arguments types by their name.
renders your model intanciable via html by using dom shadow
- parameter {string} tagName the model name.
- parameter {object} [argTypes] argument types by their name.
check if a model has allready been shadowed.
- parameter {string} tagName the model name.
- returns {boolean}
(beta) returns an empty module.
Use with export and import to modularise applications
- param {string} [name]
- returns {_dom}
Create a new js cssRule object;
- parameter {string} selector the new rule css query.
- parameter {object} [datas] style datas.
- returns {CSSStyleRule}
Create a collection of cssRule objects;
- parameter {object} datas sass like structured object
- parameter {CSSStyleSheet} [sheet] target stylesheet
- parameter {string} [uniquePrefix] if set, will encapsulate datas with a unique className.
an object {className:string,rules:object([ruleName]:CSSStyleRule} will be returned. - returns {object([ruleName]:CSSStyleRule)}
scroll container to target element
- param {HtmlElement} container
- param {HtmlElement} target
- param {[number,number]} [offset] : position offset
- property {string[]} _dom.models a list of available models in this module.
- property {string} _dom.moduleName return the handling module name.
- property {Proxy} _dom.services A proxy to the module services by their name.
- property {CSSStyleSheet} _dom.sheet The last available CSSStyleSheet.
- property {uid} _dom.uid a different unique id each time it is read.