UNPKG

24.2 kBSource Map (JSON)View Raw
1{"version":3,"file":"component.cjs","sources":["../component.js"],"sourcesContent":["/* eslint-env browser */\n\n/**\n * Web components.\n *\n * @module component\n */\n\nimport * as dom from './dom.js'\nimport * as diff from './diff.js'\nimport * as object from './object.js'\nimport * as json from './json.js'\nimport * as string from './string.js'\nimport * as array from './array.js'\nimport * as number from './number.js'\nimport * as func from './function.js'\n\n/**\n * @type {CustomElementRegistry}\n */\nexport const registry = customElements\n\n/**\n * @param {string} name\n * @param {any} constr\n * @param {ElementDefinitionOptions} [opts]\n */\nexport const define = (name, constr, opts) => registry.define(name, constr, opts)\n\n/**\n * @param {string} name\n * @return {Promise<CustomElementConstructor>}\n */\nexport const whenDefined = name => registry.whenDefined(name)\n\nconst upgradedEventName = 'upgraded'\nconst connectedEventName = 'connected'\nconst disconnectedEventName = 'disconnected'\n\n/**\n * @template S\n */\nexport class Lib0Component extends HTMLElement {\n /**\n * @param {S} [state]\n */\n constructor (state) {\n super()\n /**\n * @type {S|null}\n */\n this.state = /** @type {any} */ (state)\n /**\n * @type {any}\n */\n this._internal = {}\n }\n\n /**\n * @param {S} _state\n * @param {boolean} [_forceStateUpdate] Force that the state is rerendered even if state didn't change\n */\n setState (_state, _forceStateUpdate = true) {}\n\n /**\n * @param {any} _stateUpdate\n */\n updateState (_stateUpdate) { }\n}\n\n/**\n * @param {any} val\n * @param {\"json\"|\"string\"|\"number\"} type\n * @return {string}\n */\nconst encodeAttrVal = (val, type) => {\n if (type === 'json') {\n val = json.stringify(val)\n }\n return val + ''\n}\n\n/**\n * @param {any} val\n * @param {\"json\"|\"string\"|\"number\"|\"bool\"} type\n * @return {any}\n */\nconst parseAttrVal = (val, type) => {\n switch (type) {\n case 'json':\n return json.parse(val)\n case 'number':\n return Number.parseFloat(val)\n case 'string':\n return val\n case 'bool':\n return val != null\n default:\n return null\n }\n}\n\n/**\n * @typedef {Object} CONF\n * @property {string?} [CONF.template] Template for the shadow dom.\n * @property {string} [CONF.style] shadow dom style. Is only used when\n * `CONF.template` is defined\n * @property {S} [CONF.state] Initial component state.\n * @property {function(S,S|null,Lib0Component<S>):void} [CONF.onStateChange] Called when\n * the state changes.\n * @property {Object<string,function(any, any):Object>} [CONF.childStates] maps from\n * CSS-selector to transformer function. The first element that matches the\n * CSS-selector receives state updates via the transformer function.\n * @property {Object<string,\"json\"|\"number\"|\"string\"|\"bool\">} [CONF.attrs]\n * attrs-keys and state-keys should be camelCase, but the DOM uses kebap-case. I.e.\n * `attrs = { myAttr: 4 }` is represeted as `<my-elem my-attr=\"4\" />` in the DOM\n * @property {Object<string, function(CustomEvent, Lib0Component<any>):boolean|void>} [CONF.listeners] Maps from dom-event-name\n * to event listener.\n * @property {function(S, S, Lib0Component<S>):Object<string,string>} [CONF.slots] Fill slots\n * automatically when state changes. Maps from slot-name to slot-html.\n * @template S\n */\n\n/**\n * @template T\n * @param {string} name\n * @param {CONF<T>} cnf\n * @return {typeof Lib0Component}\n */\nexport const createComponent = (name, { template, style = '', state: defaultState, onStateChange = () => {}, childStates = { }, attrs = {}, listeners = {}, slots = () => ({}) }) => {\n /**\n * Maps from camelCase attribute name to kebap-case attribute name.\n * @type {Object<string,string>}\n */\n const normalizedAttrs = {}\n for (const key in attrs) {\n normalizedAttrs[string.fromCamelCase(key, '-')] = key\n }\n const templateElement = template\n ? /** @type {HTMLTemplateElement} */ (dom.parseElement(`\n <template>\n <style>${style}</style>\n ${template}\n </template>\n `))\n : null\n\n class _Lib0Component extends HTMLElement {\n /**\n * @param {T} [state]\n */\n constructor (state) {\n super()\n /**\n * @type {Array<{d:Lib0Component<T>, s:function(any, any):Object}>}\n */\n this._childStates = []\n /**\n * @type {Object<string,string>}\n */\n this._slots = {}\n this._init = false\n /**\n * @type {any}\n */\n this._internal = {}\n /**\n * @type {any}\n */\n this.state = state || null\n this.connected = false\n // init shadow dom\n if (templateElement) {\n const shadow = /** @type {ShadowRoot} */ (this.attachShadow({ mode: 'open' }))\n shadow.appendChild(templateElement.content.cloneNode(true))\n // fill child states\n for (const key in childStates) {\n this._childStates.push({\n d: /** @type {Lib0Component<T>} */ (dom.querySelector(/** @type {any} */ (shadow), key)),\n s: childStates[key]\n })\n }\n }\n dom.emitCustomEvent(this, upgradedEventName, { bubbles: true })\n }\n\n connectedCallback () {\n this.connected = true\n if (!this._init) {\n this._init = true\n const shadow = this.shadowRoot\n if (shadow) {\n dom.addEventListener(shadow, upgradedEventName, event => {\n this.setState(this.state, true)\n event.stopPropagation()\n })\n }\n /**\n * @type {Object<string, any>}\n */\n const startState = this.state || object.assign({}, defaultState)\n if (attrs) {\n for (const key in attrs) {\n const normalizedKey = string.fromCamelCase(key, '-')\n const val = parseAttrVal(this.getAttribute(normalizedKey), attrs[key])\n if (val) {\n startState[key] = val\n }\n }\n }\n // add event listeners\n for (const key in listeners) {\n dom.addEventListener(shadow || this, key, event => {\n if (listeners[key](/** @type {CustomEvent} */ (event), this) !== false) {\n event.stopPropagation()\n event.preventDefault()\n return false\n }\n })\n }\n // first setState call\n this.state = null\n this.setState(startState)\n }\n dom.emitCustomEvent(/** @type {any} */ (this.shadowRoot || this), connectedEventName, { bubbles: true })\n }\n\n disconnectedCallback () {\n this.connected = false\n dom.emitCustomEvent(/** @type {any} */ (this.shadowRoot || this), disconnectedEventName, { bubbles: true })\n this.setState(null)\n }\n\n static get observedAttributes () {\n return object.keys(normalizedAttrs)\n }\n\n /**\n * @param {string} name\n * @param {string} oldVal\n * @param {string} newVal\n *\n * @private\n */\n attributeChangedCallback (name, oldVal, newVal) {\n const curState = /** @type {any} */ (this.state)\n const camelAttrName = normalizedAttrs[name]\n const type = attrs[camelAttrName]\n const parsedVal = parseAttrVal(newVal, type)\n if (curState && (type !== 'json' || json.stringify(curState[camelAttrName]) !== newVal) && curState[camelAttrName] !== parsedVal && !number.isNaN(parsedVal)) {\n this.updateState({ [camelAttrName]: parsedVal })\n }\n }\n\n /**\n * @param {any} stateUpdate\n */\n updateState (stateUpdate) {\n this.setState(object.assign({}, this.state, stateUpdate))\n }\n\n /**\n * @param {any} state\n */\n setState (state, forceStateUpdates = false) {\n const prevState = this.state\n this.state = state\n if (this._init && (!func.equalityFlat(state, prevState) || forceStateUpdates)) {\n // fill slots\n if (state) {\n const slotElems = slots(state, prevState, this)\n for (const key in slotElems) {\n const slotContent = slotElems[key]\n if (this._slots[key] !== slotContent) {\n this._slots[key] = slotContent\n const currentSlots = /** @type {Array<any>} */ (key !== 'default' ? array.from(dom.querySelectorAll(this, `[slot=\"${key}\"]`)) : array.from(this.childNodes).filter(/** @param {any} child */ child => !dom.checkNodeType(child, dom.ELEMENT_NODE) || !child.hasAttribute('slot')))\n currentSlots.slice(1).map(dom.remove)\n const nextSlot = dom.parseFragment(slotContent)\n if (key !== 'default') {\n array.from(nextSlot.children).forEach(c => c.setAttribute('slot', key))\n }\n if (currentSlots.length > 0) {\n dom.replaceWith(currentSlots[0], nextSlot)\n } else {\n dom.appendChild(this, nextSlot)\n }\n }\n }\n }\n onStateChange(state, prevState, this)\n if (state != null) {\n this._childStates.forEach(cnf => {\n const d = cnf.d\n if (d.updateState) {\n d.updateState(cnf.s(state, this))\n }\n })\n }\n for (const key in attrs) {\n const normalizedKey = string.fromCamelCase(key, '-')\n if (state == null) {\n this.removeAttribute(normalizedKey)\n } else {\n const stateVal = state[key]\n const attrsType = attrs[key]\n if (!prevState || prevState[key] !== stateVal) {\n if (attrsType === 'bool') {\n if (stateVal) {\n this.setAttribute(normalizedKey, '')\n } else {\n this.removeAttribute(normalizedKey)\n }\n } else if (stateVal == null && (attrsType === 'string' || attrsType === 'number')) {\n this.removeAttribute(normalizedKey)\n } else {\n this.setAttribute(normalizedKey, encodeAttrVal(stateVal, attrsType))\n }\n }\n }\n }\n }\n }\n }\n define(name, _Lib0Component)\n // @ts-ignore\n return _Lib0Component\n}\n\n/**\n * @param {function} definer function that defines a component when executed\n */\nexport const createComponentDefiner = definer => {\n /**\n * @type {any}\n */\n let defined = null\n return () => {\n if (!defined) {\n defined = definer()\n }\n return defined\n }\n}\n\nexport const defineListComponent = createComponentDefiner(() => {\n const ListItem = createComponent('lib0-list-item', {\n template: '<slot name=\"content\"></slot>',\n slots: state => ({\n content: `<div>${state}</div>`\n })\n })\n return createComponent('lib0-list', {\n state: { list: /** @type {Array<string>} */ ([]), Item: ListItem },\n onStateChange: (state, prevState, component) => {\n if (state == null) {\n return\n }\n const { list = /** @type {Array<any>} */ ([]), Item = ListItem } = state\n // @todo deep compare here by providing another parameter to simpleDiffArray\n let { index, remove, insert } = diff.simpleDiffArray(prevState ? prevState.list : [], list, func.equalityFlat)\n if (remove === 0 && insert.length === 0) {\n return\n }\n let child = /** @type {Lib0Component<any>} */ (component.firstChild)\n while (index-- > 0) {\n child = /** @type {Lib0Component<any>} */ (child.nextElementSibling)\n }\n let insertStart = 0\n while (insertStart < insert.length && remove-- > 0) {\n // update existing state\n child.setState(insert[insertStart++])\n child = /** @type {Lib0Component<any>} */ (child.nextElementSibling)\n }\n while (remove-- > 0) {\n // remove remaining\n const prevChild = child\n child = /** @type {Lib0Component<any>} */ (child.nextElementSibling)\n component.removeChild(prevChild)\n }\n // insert remaining\n component.insertBefore(dom.fragment(insert.slice(insertStart).map(insState => {\n const el = new Item()\n el.setState(insState)\n return el\n })), child)\n }\n })\n})\n\nexport const defineLazyLoadingComponent = createComponentDefiner(() => createComponent('lib0-lazy', {\n state: /** @type {{component:null|String,import:null|function():Promise<any>,state:null|object}} */ ({\n component: null, import: null, state: null\n }),\n attrs: {\n component: 'string'\n },\n onStateChange: ({ component, state, import: getImport }, prevState, componentEl) => {\n if (component !== null) {\n if (getImport) {\n getImport()\n }\n if (!prevState || component !== prevState.component) {\n const el = /** @type {any} */ (dom.createElement(component))\n componentEl.innerHTML = ''\n componentEl.insertBefore(el, null)\n }\n const el = /** @type {any} */ (componentEl.firstElementChild)\n // @todo generalize setting state and check if setState is defined\n if (el.setState) {\n el.setState(state)\n }\n }\n }\n}))\n"],"names":["json.stringify","json.parse","string.fromCamelCase","dom.parseElement","dom.querySelector","dom.emitCustomEvent","dom.addEventListener","object.assign","object.keys","number.isNaN","func.equalityFlat","array.from","dom.querySelectorAll","dom.checkNodeType","dom.ELEMENT_NODE","dom.remove","dom.parseFragment","dom.replaceWith","dom.appendChild","diff.simpleDiffArray","dom.fragment","dom.createElement"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAgBA;AACA;AACA;AACA;AACY,MAAC,QAAQ,GAAG,eAAc;AACtC;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,KAAK,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAC;AACjF;AACA;AACA;AACA;AACA;AACY,MAAC,WAAW,GAAG,IAAI,IAAI,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAC;AAC7D;AACA,MAAM,iBAAiB,GAAG,WAAU;AACpC,MAAM,kBAAkB,GAAG,YAAW;AACtC,MAAM,qBAAqB,GAAG,eAAc;AAC5C;AACA;AACA;AACA;AACO,MAAM,aAAa,SAAS,WAAW,CAAC;AAC/C;AACA;AACA;AACA,EAAE,WAAW,CAAC,CAAC,KAAK,EAAE;AACtB,IAAI,KAAK,GAAE;AACX;AACA;AACA;AACA,IAAI,IAAI,CAAC,KAAK,uBAAuB,KAAK,EAAC;AAC3C;AACA;AACA;AACA,IAAI,IAAI,CAAC,SAAS,GAAG,GAAE;AACvB,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,EAAE,QAAQ,CAAC,CAAC,MAAM,EAAE,iBAAiB,GAAG,IAAI,EAAE,EAAE;AAChD;AACA;AACA;AACA;AACA,EAAE,WAAW,CAAC,CAAC,YAAY,EAAE,GAAG;AAChC,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,IAAI,KAAK;AACrC,EAAE,IAAI,IAAI,KAAK,MAAM,EAAE;AACvB,IAAI,GAAG,GAAGA,cAAc,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