@twobirds/microcomponents 0.0.57 → 0.0.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +3 -0
- package/README.md +6 -2
- package/assets/documentation/observables.md +105 -0
- package/assets/test.html +2 -2
- package/dist/MC.d.ts +1 -1
- package/dist/MC.d.ts.map +1 -1
- package/dist/MC.min.js +65 -27
- package/dist/MC.ts +132 -39
- package/dist/elements.min.js +1 -1
- package/dist/formValues.d.ts +1 -3
- package/dist/formValues.d.ts.map +1 -1
- package/dist/formValues.ts +23 -24
- package/dist/formvValues.min.js +1 -1
- package/dist/microcomponents.min.js +1 -1
- package/dist/observables.d.ts.map +1 -1
- package/dist/observables.min.js +1 -1
- package/dist/observables.ts +5 -6
- package/dist/selectors.min.js +1 -1
- package/dist/test.ts +18 -2
- package/package.json +3 -3
- package/public/MC.js +65 -27
- package/public/MC.js.map +1 -1
- package/public/MC.min.js +65 -27
- package/public/documentation/observables.md +105 -0
- package/public/elements.min.js +1 -1
- package/public/formValues.js +15 -17
- package/public/formValues.js.map +1 -1
- package/public/formvValues.min.js +1 -1
- package/public/microcomponents.min.js +1 -1
- package/public/observables.js +1 -2
- package/public/observables.js.map +1 -1
- package/public/observables.min.js +1 -1
- package/public/selectors.min.js +1 -1
- package/public/src/MC.ts +132 -39
- package/public/src/autoloader.ts +55 -55
- package/public/src/formValues.ts +23 -24
- package/public/src/observables.ts +5 -6
- package/public/src/test.ts +18 -2
- package/public/test/child.js +15 -0
- package/public/test/child.js.map +1 -0
- package/public/test/grandchild.js +15 -0
- package/public/test/grandchild.js.map +1 -0
- package/public/test/grandparent.js +15 -0
- package/public/test/grandparent.js.map +1 -0
- package/public/test/greatgrandchild.js +29 -0
- package/public/test/greatgrandchild.js.map +1 -0
- package/public/test/parent.js +15 -0
- package/public/test/parent.js.map +1 -0
- package/public/test/testform.js +141 -0
- package/public/test/testform.js.map +1 -0
- package/public/test/testmc.js +10 -0
- package/public/test/testmc.js.map +1 -0
- package/public/test.html +2 -2
- package/public/test.js +5 -2
- package/public/test.js.map +1 -1
- package/src/MC.ts +132 -39
- package/src/formValues.ts +23 -24
- package/src/observables.ts +5 -6
- package/src/test/{Child.ts → child.ts} +3 -3
- package/src/test/{Grandchild.ts → grandchild.ts} +3 -3
- package/src/test/{Grandparent.ts → grandparent.ts} +3 -3
- package/src/test/{Greatgrandchild.ts → greatgrandchild.ts} +1 -1
- package/src/test/{Parent.ts → parent.ts} +4 -4
- package/src/test/{Testform.ts → testform.ts} +3 -9
- package/src/test/testmc.ts +11 -0
- package/src/test.ts +18 -2
- package/webpack.config.js +44 -5
- package/dist/autoloader.d.ts +0 -2
- package/dist/autoloader.d.ts.map +0 -1
- package/dist/autoloader.ts +0 -98
- package/public/assets/highlight.css +0 -99
- package/public/assets/main.js +0 -58
- package/public/assets/search.js +0 -1
- package/public/assets/style.css +0 -1280
- package/public/autoloader.js +0 -53
- package/public/autoloader.js.map +0 -1
- package/public/classes/MC.DC.html +0 -228
- package/public/classes/MC.MC.html +0 -171
- package/public/classes/MC.McBase.html +0 -117
- package/public/classes/MC.McEvent.html +0 -187
- package/public/classes/formValues.FormValues.html +0 -86
- package/public/functions/MC.addListener.html +0 -77
- package/public/functions/MC.autoload.html +0 -69
- package/public/functions/MC.removeListener.html +0 -73
- package/public/functions/elements.defineCE.html +0 -78
- package/public/functions/elements.getCE.html +0 -63
- package/public/functions/observables.observe.html +0 -65
- package/public/functions/selectors._d.html +0 -69
- package/public/functions/selectors._t.html +0 -69
- package/public/index.html +0 -126
- package/public/interfaces/MC.HTMLMcElement.html +0 -3608
- package/public/interfaces/selectors.DSelector.html +0 -1013
- package/public/interfaces/selectors.TSelector.html +0 -712
- package/public/modules/MC.html +0 -80
- package/public/modules/elements.html +0 -62
- package/public/modules/formValues.html +0 -60
- package/public/modules/observables.html +0 -65
- package/public/modules/selectors.html +0 -76
- package/public/modules.html +0 -54
- package/public/test/Grandparent.js +0 -1
- package/public/test/Testform.js +0 -1
- package/public/types/observables.Observable.html +0 -91
- package/public/types/selectors.selection.html +0 -58
- package/public/types/selectors.singleSelector.html +0 -58
- package/src/autoloader.ts +0 -98
- /package/assets/{Grandparent.css → grandparent.css} +0 -0
- /package/public/{Grandparent.css → grandparent.css} +0 -0
- /package/src/test/{Grandparent.css → grandparent.css} +0 -0
- /package/src/test/{Testform.css → testform.css} +0 -0
- /package/src/test/{Testform.html → testform.html} +0 -0
- /package/src/test/{Testform.json → testform.json} +0 -0
package/public/test/Testform.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.TestTestform=t():e.TestTestform=t()}(self,(()=>(()=>{"use strict";var e=new Function("try {return this===window;}catch(e){ return false;}");let t=new Set;e()&&Object.keys(HTMLElement.prototype).filter((e=>/^on/.test(e))).forEach((e=>t.add(e)));class n{#e;#t=!1;#n=!1;constructor(e,t={},n="l"){this.#e=e,this.data=t,this.bubble=n}get type(){return this.#e}get stopped(){return this.#t}get immediateStopped(){return this.#n}stopPropagation(){this.#t=!0}stopImmediatePropagation(){this.stopPropagation(),this.#n=!0}}var a=new Function("try {return this===window;}catch(e){ return false;}");let r=new Set;function l(e,t){let n=[];return e.forEach((e=>{if(e&&e instanceof HTMLElement){const a=e?._mc;!t&&a?n=n.concat(Object.values(e._mc)):t&&a&&a[t]&&n.push(a[t])}})),n}function o(e,t,n=!0){let a=[];for(;e;){if(e._mc&&(t?t&&e._mc[t]&&a.push(e._mc[t]):a=a.concat(Object.values(e._mc)),n))return a;e=e.parentNode}return a}function i(e){return e&&e instanceof HTMLElement}function s(e,t,n,a=!1,r=!1){let l={once:!1};a&&(l.capture=a),r&&(l.once=r),e.addEventListener(t,n,l)}function c(e,t,n={}){let a=e;if(!a._mc){let t=m?.debug;m.debug=!1,a._mc=new m(e),m.debug=t,delete a._mc._mc}const r=a._mc;return t.length&&!r[t]&&(r[t]=n,e instanceof HTMLElement&&e.setAttribute("_mc","")),n}function u(e,t){if(!t)return;const n=e?._mc||{};n&&n[t]&&delete n[t],!Object.keys(n).length&&e instanceof HTMLElement&&e.hasAttribute("_mc")&&e.removeAttribute("_mc")}function p(e,t,a={},r="l"){let l=e?._mc;if(!l)return;let o=t instanceof n?new n(t.type,t.data,"l"):new n(t,a,"l"),i="string"!=typeof t?t:new n(t,a,r);[...Object.values(l)].forEach((e=>{e?.trigger&&"function"==typeof e?.trigger&&e?.trigger(o)})),/[ud]/.test(i.bubble)&&d(e,i)}function d(e,t){/[ud]/.test(t.bubble)&&setTimeout((()=>{if(-1===t.bubble.indexOf("l")&&(t.bubble+="l"),t.bubble.indexOf("u")>-1){let n=o(e,"",!0)?.[0].target;n&&m.trigger(n,t)}t.bubble.indexOf("d")>-1&&new Set(e._mc.children().map((e=>e?.target))).forEach((e=>{e&&m.trigger(e,t)}))}),0)}a()&&Object.keys(HTMLElement.prototype).filter((e=>/^on/.test(e))).forEach((e=>r.add(e)));class b{#a;constructor(e,t=!1){var n;this.#a=new WeakRef(e||{}),(n=this).constructor!==m&&setTimeout((()=>{n.trigger("Init")}),0),function(e){if(!a()||e.constructor===m)return;const t=e.target;if(t instanceof HTMLElement){let n=e;Object.getOwnPropertyNames(n.constructor.prototype).filter((e=>/^on[A-Z]|one[A-Z]/.test(e)&&"function"==typeof n.constructor.prototype[e])).forEach((a=>{let l=/^one/.test(a),o=a.replace(/^on[e]{0,1}/,""),i=o.toLowerCase();l&&Object.defineProperty(e,"on"+o,{configurable:!0,enumerable:!1,writable:!0,value:e=>{n.constructor.prototype[a].bind(n)(e)}}),r.has("on"+i)&&s(t,i,(e=>{n.trigger(o,e)}),!1,l)}))}}(this)}get target(){return this.#a.deref()}}class f extends b{_mc={};constructor(e){super(e)}static trigger=p;trigger(e,t={},a="l"){let r=this;if(r.constructor===f||r.constructor===m){let l=e instanceof n?new n(e.type,e.data,"l"):new n(e,t,"l"),o="string"!=typeof e?e:new n(e,t,a);return[...Object.getOwnPropertyNames(r)].forEach((e=>{r[e]?.trigger&&"function"==typeof r[e]?.trigger&&r[e]?.trigger(l)})),void(/[ud]/.test(o.bubble)&&d(r.target,o))}if(r instanceof f||r instanceof m){const r=this,l="string"!=typeof e?e:new n(e,t,a),o="on"+l.type[0].toUpperCase()+l.type.slice(1);if(l.bubble.indexOf("l")>-1&&(l.immediateStopped||"function"!=typeof r[o]||(r[o](l),r.hasOwnProperty(o)&&delete r[o])),l.stopped||"l"===l.bubble)return r;/[ud]/.test(l.bubble)&&d(r.target,l)}}}class m extends b{_mc={};constructor(e,t=!1){super(e)}static add=c;static remove=u;static trigger=p;trigger(e,t={},n){f.prototype.trigger.call(this,e,t,n)}parent(e=""){let t=this.target;return i(t)?o(t.parentNode,e,!0):[]}ancestors(e=""){let t=this?.target;return i(t)?o(this.target.parentNode,e,!1):[]}children(e=""){let t=this?.target;if(!i(t))return[];const n=Math.random().toString().replace(".",""),a='[_mc]:not([temp_id="'+n+'"] [_mc] [_mc])';t.setAttribute("temp_id",n);const r=l([...t.querySelectorAll(a)],e);return t.removeAttribute("temp_id"),r}descendants(e=""){let t=this?.target;return i(t)?l([...t.querySelectorAll("*[_mc]")],e):[]}}function g(e){let t={};return[...Object.keys(e)].sort().forEach((n=>{var a;(a=e[n])&&a.constructor&&a.constructor===Object?t[n]=g(e[n]):t[n]=e[n]})),t}function h(e,t=!0){let n={};return[...Object.getOwnPropertyNames(e)].forEach((t=>{if(e[t]&&e[t].constructor&&e[t].constructor===Object){const a=h(e[t],!1);for(const e in a)n[t+"."+e]=a[e]}else n[t]=e[t]})),t?g(n):n}function y(e,t){return JSON.stringify(h(e))===JSON.stringify(h(t))}function v(e,t){let n;return()=>{clearTimeout(n),n=setTimeout((function(){e(...arguments)}),t)}}function O(e,t){const n=Object.getOwnPropertyDescriptors(e);for(const[e,a]of Object.entries(n))("get"in a||"set"in a)&&Object.defineProperty(t,e,a)}new Map;class w extends HTMLElement{constructor(){super()}connectedCallback(){m.trigger(this,"Connected")}disconnectedCallback(){m.trigger(this,"Disconnected")}adoptedCallback(){m.trigger(this,"Adopted")}attributeChangedCallback(e,t,n){m.trigger(this,"AttributeChanged",{name:e,oldValue:t,newValue:n})}}function x(e){return null!=e&&"object"==typeof e}function E(e){let t=new Set,n=/\{[^\{\}]*\}/g;return e.getAttributeNames().filter((t=>e.getAttribute(t)?.match(n))).forEach((a=>{new Set(e.getAttribute(a)?.match(n)).forEach((e=>t.add(e.replace(/[\{\}]/g,""))))})),[...e.childNodes].filter((e=>3===e.nodeType&&(e.nodeValue||"").match(n))).forEach((e=>{(e.nodeValue||"").match(n).forEach((e=>{t.add(e.replace(/[\{\}]/g,""))}))})),[...t].map((e=>e.replace(/[\{\}]/g,""))),[...t]}const k=[HTMLInputElement,HTMLSelectElement,HTMLTextAreaElement];class A extends m{data={};oldDisplay="";constructor(e){super(e);let t=this;E(e).forEach((e=>t.data[e]="")),j(t),t.#r(),delete t._mc}#r(){let e=this,t=e.target,n=!1;t.getAttributeNames().filter((e=>t.getAttribute(e)?.match(/\{[^\{\}]*\}/g))).forEach((n=>{let a=new Set(t.getAttribute(n)?.match(/\{[^\{\}]*\}/g));var r;e.data.observe((r=t.getAttribute(n),e=>{let l=r;a.forEach((t=>{l=l.replace(t,e[t.replace(/[\{\}]/g,"")])})),t.setAttribute(n,l)}))})),[...t.childNodes].filter((e=>3===e.nodeType&&(e.nodeValue||"").match(/\{[^\{\}]*\}/g))).forEach((a=>{n=!0;let r=new Set(a.nodeValue.match(/\{[^\{\}]*\}/g));var l;e.data.observe((l=a.nodeValue,n=>{let o=l;r.forEach((e=>{o=o.replace(e,n[e.replace(/[\{\}]/g,"")])})),Object.keys(n).some((e=>!!n[e]))&&(e.oldDisplay?t.style=e.oldDisplay:t.removeAttribute("style"),delete e.oldDisplay),a.nodeValue=o})),e.oldDisplay=t.getAttribute("style)")||"",n&&!k.includes(t.constructor)&&"FIELDSET"!==t.tagName&&(t.style.display="none")}))}onData(e){let t=this,n={};Object.keys(e.data).forEach((a=>{t.data.hasOwnProperty(a)&&(n[a]=e.data[a])})),JSON.stringify(n)!==JSON.stringify(t.data)&&Object.assign(t.data,n)}}const j=(e,t)=>((t?[t]:[...Object.getOwnPropertyNames(e)]).forEach((t=>{if("_"===t[0]||void 0===e?.[t])return e;let n,a=e[t];if(!a.prototype)switch(typeof a){case"string":n=String;break;case"number":n=Number;break;case"boolean":n=Boolean;break;case"object":n=a instanceof Array?Array:Object;break;default:return}let r=class extends n{#l=!0;constructor(e){super(e),this.constructor.callbacks=[],x(e)&&Object.getOwnPropertyNames(e).forEach((t=>{this[t]=e[t]}))}observe(e){return this.constructor.callbacks.push(e),this}bind(e){const t=this;if(x(t.valueOf())){!function(e){var t;(t=e,(t instanceof HTMLElement?[t]:[]).concat([...t.querySelectorAll("*")]).filter((e=>!!E(e).length)).filter((e=>"STYLE"!==e.tagName))).forEach((e=>{e?._mc?._placeholders||m.add(e,"_placeholders",new A(e))}))}(e);const n=[...e.querySelectorAll("[_mc]")].filter((e=>!!e?._mc?._placeholders)),a=function(e){let t=h(e);n.forEach((e=>{e&&e._mc.trigger("data",t)}))};t.constructor.callbacks.push(a),t.notify()}else console.warn("IGNORED - cannot bind a non-Object to the dom, IS:",typeof t.valueOf(),t);return this}notify(e){let t=this,n=x(t.valueOf())&&t.valueOf()instanceof Array==0?structuredClone(Object.assign({},t)):t.valueOf();return void 0!==e&&(t.#l=e),t.constructor.callbacks.forEach((e=>{e(n)})),t}},l=new r(a);Object.defineProperty(e,t,{enumerable:!0,get(){if(x(l.valueOf())){let e=structuredClone(Object.assign({},l));setTimeout(v((function(){y(structuredClone(Object.assign({},l)),e)||l.notify()}),0),0)}return l},set(e){if(typeof e==typeof l.valueOf())if(x(l.valueOf())&&l.valueOf()instanceof Array==0){let t=structuredClone(Object.assign({},l));l instanceof r==0&&(l=new r(structuredClone(Object.assign({},e))),O(e,l),l.seal()),Object.assign(l,e),setTimeout(v((function(){y(structuredClone(Object.assign({},l)),t)||l.notify()}),0),0)}else{let t=l.valueOf(),n=l.constructor.callbacks;l=new r(e),l.constructor.callbacks=n,e!==t&&l.notify()}else console.warn("IGNORED - cannot change observable types, IS:",typeof l.valueOf(),l,"- CANNOT BECOME:",typeof e)}}),e[t]=a})),e);class S{constructor(e){}}class _ extends S{#o;constructor(e){super(e),this.#o=e}get val(){return new FormData(this.#o.form).get(this.#o.name)}set val(e){[...this.#o.form.querySelectorAll(`input[type="radio"][name="${this.#o.name}"]`)].filter((t=>t.getAttribute("value")===e)).shift().checked=!0}}class T extends S{#o;constructor(e){super(e),this.#o=e}get val(){return this.#o.checked}set val(e){this.#o.checked=e}}class N extends S{#o;constructor(e){super(e),this.#o=e}get val(){return this.#o.value}set val(e){this.#o.value=e}}class C extends S{#o;#i=!1;constructor(e){super(e),this.#o=e,this.#i=e.multiple}get val(){const e=[];return[...this.#o.querySelectorAll("option")].filter((e=>e.selected)).forEach((t=>{e.push(t.value)})),this.#i?e:e.length?e[0]:""}set val(e){e="string"==typeof e?[e]:e,[...this.#o.querySelectorAll("option")].forEach((t=>{e.indexOf(t.value)>-1?t.selected=!0:t.selected=!1}))}}class I extends S{#o;constructor(e){super(e),this.#o=e}get val(){return this.#o.value||""}set val(e){this.#o.value=e}}class L{constructor(e,t,n){let a=(e=>{let t=[...(e||document).querySelectorAll("input,select,textarea")],n={};return t.forEach((e=>{const t=e.getAttribute("name");if(t){let a=!1;switch((e=>e.tagName.toLowerCase())(e)){case"input":switch(e.type){case"radio":a=new _(e);break;case"checkbox":a=new T(e);break;default:a=new N(e)}break;case"select":a=new C(e);break;case"textarea":a=new I(e);break;default:console.warn("handler missing:",t,"for",e.tagName.toLowerCase(),e)}a&&(m.add(e,t,a),Object.defineProperty(n,t,{enumerable:!0,configurable:!0,get:()=>a.val,set:e=>{a.val!==e&&(a.val=e)}}))}})),n})(n);e[t]=Object.assign({},a),j(e,t),O(a,e[t]),[...n.querySelectorAll("input, textarea, select")].forEach((n=>{s(n,"keyup",(n=>{e[t].notify()})),s(n,"change",(n=>{e[t].notify()})),s(n,"select",(n=>{e[t].notify()}))}))}}return function(e,t,n=[]){if(customElements.get(e))return void console.warn(`IGNORED: Custom element "${e}" is already defined!`);if(!e.includes("-"))throw new Error('createCustomElement: tagName must contain at least one hyphen ("-").');let a=e.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join("");customElements.define(e,function(e,t){return Object.defineProperty(t,"name",{value:e})}(a,class extends w{instance;constructor(e){super();let n=new t(this,e);m.add(this,a,n)}static get observedAttributes(){return n}}))}("test-testform",class extends m{data;constructor(e){super(e);const t=this;delete t._mc;let n=t.target.attachShadow({mode:"open"});n.innerHTML=`<style>${t.css}</style>${t.template}`,new L(t,"data",n),t.data.bind(n)}onConnected(){}oneInit(){}get template(){return'\n <form>\n \x3c!-- sample form to start with --\x3e\n <fieldset>\n <legend>Inputs</legend>\n <label>text</label><input type="text" name="textInput" value="Hallo" /> <strong>2wB: </strong>{textInput}\n <label>color</label><input type="color" name="colorInput" value="" />\n <label>date</label><input type="date" name="dateInput" value="" />\n <label>datetime-local</label><input type="datetime-local" name="dtlInput" value="" />\n <label>email</label><input type="email" name="email" value="" />\n <label>file</label><input type="file" name="fileInput" value="" />\n <label>hidden</label><input type="hidden" name="hiddenInput" value="hiddenVal" />\n <label>month</label><input type="month" name="month" value="" />\n <label>number</label><input type="number" name="number" value="" />\n <label>password</label><input type="password" name="passInput" value="" />\n <label>range</label><input type="range" name="rangeInput" value="" />\n <label>search</label><input type="search" name="searchInput" value="" />\n <label>tel</label><input type="tel" name="telInput" value="" />\n <label>time</label><input type="time" name="timeInput" value="" />\n <label>url</label><input type="url" name="urlInput" value="" />\n <label>week</label><input type="week" name="weekInput" value="" />\n </fieldset>\n\n <fieldset>\n <legend>Selects</legend>\n\n <label>singleSelect</label>\n <select name="singleSelect">\n <option disabled selected value> -- select -- </option>\n <option value="1">Option 1</option>\n <option value="2">Option 2</option>\n <option value="3">Option 3</option>\n <option value="4">Option 4</option>\n </select>\n\n <label>multiSelect</label>\n <select name="multiSelect" multiple="multiple" type="select-multiple">\n <option value="1">Option 1</option>\n <option value="2" selected=true>Option 2</option>\n <option value="3">Option 3</option>\n <option value="4" selected=true>Option 4</option>\n </select>\n\n </fieldset>\n\n <fieldset>\n <legend>Radiobuttons <strong>2wB: </strong><span>{myRadio}</span></legend>\n\n <label>radio1</label><input type="radio" name="myRadio" value="radio1">\n <label>radio2</label><input type="radio" name="myRadio" value="radio2">\n <label>radio3</label><input type="radio" name="myRadio" value="radio3">\n\n </fieldset>\n\n <fieldset>\n <legend>Checkboxes</legend>\n <label>cb1</label><input type="checkbox" name="cb1">\n <label>cb2</label><input type="checkbox" name="cb2">\n <label>cb3</label><input type="checkbox" name="cb3">\n <label>cb4</label><input type="checkbox" name="cb4">\n <label>cb5</label><input type="checkbox" name="cb5">\n\n </fieldset>\n\n <fieldset>\n <legend>TextArea</legend>\n <label>textArea</label>\n <textarea name="textArea">abc</textarea>\n </fieldset>\n\n </form>\n '}get css(){return"\nlegend {\n display: inherit;\n margin: inherit;\n vertical-align: inherit;\n}\n\nlabel {\n display: inline;\n margin-top: 5px;\n margin-left: 5px;\n vertical-align: top;\n width: 10em;\n text-align: right;\n}\n\nlabel::before {\n content: ' ';\n display: block;\n}\n\nform input,\nform select,\nform textarea {\n margin-left: 5px;\n margin-top: 0px;\n display: inline;\n}\n\nform label + textarea {\n display: inline-block;\n margin-top: 3px;\n}\n\nform input + label {\n width: inherit;\n margin-top: 3px;\n text-align: left;\n}\n\nbody > form {\n display: block;\n}\n\nform fieldset {\n border: 1px solid darkslategrey;\n border-radius: 3px;\n margin: 0.5em 0;\n}\n "}}),{}})()));
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>Observable | Micro Components</title><meta name="description" content="Documentation for Micro Components"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
|
-
<div class="tsd-toolbar-contents container">
|
|
3
|
-
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
|
-
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
5
|
-
<div class="field">
|
|
6
|
-
<div id="tsd-toolbar-links"></div></div>
|
|
7
|
-
<ul class="results">
|
|
8
|
-
<li class="state loading">Preparing search index...</li>
|
|
9
|
-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Micro Components</a></div>
|
|
10
|
-
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
|
-
<div class="container container-main">
|
|
12
|
-
<div class="col-8 col-content">
|
|
13
|
-
<div class="tsd-page-title">
|
|
14
|
-
<ul class="tsd-breadcrumb">
|
|
15
|
-
<li><a href="../modules.html">Micro Components</a></li>
|
|
16
|
-
<li><a href="../modules/observables.html">observables</a></li>
|
|
17
|
-
<li><a href="observables.Observable.html">Observable</a></li></ul>
|
|
18
|
-
<h1>Type alias Observable</h1></div>
|
|
19
|
-
<div class="tsd-signature">Observable<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-symbol">{ </span><br/><span> </span>bind<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HTMLElement</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">DocumentFragment</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ShadowRoot</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span>notify<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span> </span>observe<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>cb<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Callback</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">; </span><br/><span class="tsd-signature-symbol">}</span></div>
|
|
20
|
-
<div class="tsd-type-declaration">
|
|
21
|
-
<h4>Type declaration</h4>
|
|
22
|
-
<ul class="tsd-parameters">
|
|
23
|
-
<li class="tsd-parameter">
|
|
24
|
-
<h5>bind<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HTMLElement</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">DocumentFragment</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ShadowRoot</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></h5>
|
|
25
|
-
<ul class="tsd-parameters">
|
|
26
|
-
<li class="tsd-parameter-signature">
|
|
27
|
-
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property">
|
|
28
|
-
<li class="tsd-signature" id="__type.bind.__type-1.__type-2"><span class="tsd-signature-symbol">(</span>target<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">HTMLElement</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">DocumentFragment</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ShadowRoot</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
|
29
|
-
<li class="tsd-description">
|
|
30
|
-
<div class="tsd-parameters">
|
|
31
|
-
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
32
|
-
<ul class="tsd-parameter-list">
|
|
33
|
-
<li>
|
|
34
|
-
<h5>target: <span class="tsd-signature-type">HTMLElement</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">DocumentFragment</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ShadowRoot</span></h5></li></ul></div>
|
|
35
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li>
|
|
36
|
-
<li class="tsd-parameter">
|
|
37
|
-
<h5>notify<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></h5>
|
|
38
|
-
<ul class="tsd-parameters">
|
|
39
|
-
<li class="tsd-parameter-signature">
|
|
40
|
-
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property">
|
|
41
|
-
<li class="tsd-signature" id="__type.notify.__type-3.__type-4"><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
|
42
|
-
<li class="tsd-description">
|
|
43
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li>
|
|
44
|
-
<li class="tsd-parameter">
|
|
45
|
-
<h5>observe<span class="tsd-signature-symbol">: </span><span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">(</span>cb<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Callback</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol"> => </span><span class="tsd-signature-type">void</span><span class="tsd-signature-symbol">)</span></h5>
|
|
46
|
-
<ul class="tsd-parameters">
|
|
47
|
-
<li class="tsd-parameter-signature">
|
|
48
|
-
<ul class="tsd-signatures tsd-kind-type-literal tsd-parent-kind-property">
|
|
49
|
-
<li class="tsd-signature" id="__type.observe.__type-5.__type-6"><span class="tsd-signature-symbol">(</span>cb<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Callback</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
|
50
|
-
<li class="tsd-description">
|
|
51
|
-
<div class="tsd-parameters">
|
|
52
|
-
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
53
|
-
<ul class="tsd-parameter-list">
|
|
54
|
-
<li>
|
|
55
|
-
<h5>cb: <span class="tsd-signature-type">Callback</span></h5></li></ul></div>
|
|
56
|
-
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4></li></ul></li></ul></li></ul></div><aside class="tsd-sources">
|
|
57
|
-
<ul>
|
|
58
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/2ce7f9b/src/observables.ts#L198">src/observables.ts:198</a></li></ul></aside></div>
|
|
59
|
-
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
60
|
-
<div class="tsd-navigation settings">
|
|
61
|
-
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
62
|
-
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Settings</h3></summary>
|
|
63
|
-
<div class="tsd-accordion-details">
|
|
64
|
-
<div class="tsd-filter-visibility">
|
|
65
|
-
<h4 class="uppercase">Member Visibility</h4><form>
|
|
66
|
-
<ul id="tsd-filter-options">
|
|
67
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
|
|
68
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
|
|
69
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
|
|
70
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
|
|
71
|
-
<div class="tsd-theme-toggle">
|
|
72
|
-
<h4 class="uppercase">Theme</h4><select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
|
|
73
|
-
<nav class="tsd-navigation primary">
|
|
74
|
-
<details class="tsd-index-accordion" open><summary class="tsd-accordion-summary">
|
|
75
|
-
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
|
|
76
|
-
<div class="tsd-accordion-details">
|
|
77
|
-
<ul>
|
|
78
|
-
<li class="current"><a href="../modules.html">Micro <wbr/>Components</a>
|
|
79
|
-
<ul>
|
|
80
|
-
<li class="tsd-kind-module"><a href="../modules/MC.html">MC</a></li>
|
|
81
|
-
<li class="tsd-kind-module"><a href="../modules/elements.html">elements</a></li>
|
|
82
|
-
<li class="tsd-kind-module"><a href="../modules/formValues.html">form<wbr/>Values</a></li>
|
|
83
|
-
<li class="current tsd-kind-module"><a href="../modules/observables.html">observables</a></li>
|
|
84
|
-
<li class="tsd-kind-module"><a href="../modules/selectors.html">selectors</a></li></ul></li></ul></div></details></nav>
|
|
85
|
-
<nav class="tsd-navigation secondary menu-sticky">
|
|
86
|
-
<ul>
|
|
87
|
-
<li class="current tsd-kind-type-alias tsd-parent-kind-module"><a href="observables.Observable.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-4194304-path"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)" id="icon-4194304-text"></path></svg>Observable</a></li>
|
|
88
|
-
<li class="tsd-kind-function tsd-parent-kind-module"><a href="../functions/observables.observe.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-64-path"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)" id="icon-64-text"></path></svg>observe</a></li></ul></nav></div></div>
|
|
89
|
-
<div class="container tsd-generator">
|
|
90
|
-
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
91
|
-
<div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>selection | Micro Components</title><meta name="description" content="Documentation for Micro Components"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
|
-
<div class="tsd-toolbar-contents container">
|
|
3
|
-
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
|
-
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
5
|
-
<div class="field">
|
|
6
|
-
<div id="tsd-toolbar-links"></div></div>
|
|
7
|
-
<ul class="results">
|
|
8
|
-
<li class="state loading">Preparing search index...</li>
|
|
9
|
-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Micro Components</a></div>
|
|
10
|
-
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
|
-
<div class="container container-main">
|
|
12
|
-
<div class="col-8 col-content">
|
|
13
|
-
<div class="tsd-page-title">
|
|
14
|
-
<ul class="tsd-breadcrumb">
|
|
15
|
-
<li><a href="../modules.html">Micro Components</a></li>
|
|
16
|
-
<li><a href="../modules/selectors.html">selectors</a></li>
|
|
17
|
-
<li><a href="selectors.selection.html">selection</a></li></ul>
|
|
18
|
-
<h1>Type alias selection</h1></div>
|
|
19
|
-
<div class="tsd-signature">selection<span class="tsd-signature-symbol">:</span> <a href="selectors.singleSelector.html" class="tsd-signature-type" data-tsd-kind="Type alias">singleSelector</a><span class="tsd-signature-symbol"> | </span><a href="selectors.singleSelector.html" class="tsd-signature-type" data-tsd-kind="Type alias">singleSelector</a><span class="tsd-signature-symbol">[]</span></div><aside class="tsd-sources">
|
|
20
|
-
<ul>
|
|
21
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/2ce7f9b/src/selectors.ts#L1634">src/selectors.ts:1634</a></li></ul></aside></div>
|
|
22
|
-
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
23
|
-
<div class="tsd-navigation settings">
|
|
24
|
-
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
25
|
-
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Settings</h3></summary>
|
|
26
|
-
<div class="tsd-accordion-details">
|
|
27
|
-
<div class="tsd-filter-visibility">
|
|
28
|
-
<h4 class="uppercase">Member Visibility</h4><form>
|
|
29
|
-
<ul id="tsd-filter-options">
|
|
30
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
|
|
31
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
|
|
32
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
|
|
33
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
|
|
34
|
-
<div class="tsd-theme-toggle">
|
|
35
|
-
<h4 class="uppercase">Theme</h4><select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
|
|
36
|
-
<nav class="tsd-navigation primary">
|
|
37
|
-
<details class="tsd-index-accordion" open><summary class="tsd-accordion-summary">
|
|
38
|
-
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
|
|
39
|
-
<div class="tsd-accordion-details">
|
|
40
|
-
<ul>
|
|
41
|
-
<li class="current"><a href="../modules.html">Micro <wbr/>Components</a>
|
|
42
|
-
<ul>
|
|
43
|
-
<li class="tsd-kind-module"><a href="../modules/MC.html">MC</a></li>
|
|
44
|
-
<li class="tsd-kind-module"><a href="../modules/elements.html">elements</a></li>
|
|
45
|
-
<li class="tsd-kind-module"><a href="../modules/formValues.html">form<wbr/>Values</a></li>
|
|
46
|
-
<li class="tsd-kind-module"><a href="../modules/observables.html">observables</a></li>
|
|
47
|
-
<li class="current tsd-kind-module"><a href="../modules/selectors.html">selectors</a></li></ul></li></ul></div></details></nav>
|
|
48
|
-
<nav class="tsd-navigation secondary menu-sticky">
|
|
49
|
-
<ul>
|
|
50
|
-
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/selectors.DSelector.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-256-path"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)" id="icon-256-text"></path></svg>DSelector</a></li>
|
|
51
|
-
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/selectors.TSelector.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>TSelector</a></li>
|
|
52
|
-
<li class="current tsd-kind-type-alias tsd-parent-kind-module"><a href="selectors.selection.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-4194304-path"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)" id="icon-4194304-text"></path></svg>selection</a></li>
|
|
53
|
-
<li class="tsd-kind-type-alias tsd-parent-kind-module"><a href="selectors.singleSelector.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>single<wbr/>Selector</a></li>
|
|
54
|
-
<li class="tsd-kind-function tsd-parent-kind-module"><a href="../functions/selectors._d.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-64-path"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)" id="icon-64-text"></path></svg>$d</a></li>
|
|
55
|
-
<li class="tsd-kind-function tsd-parent-kind-module"><a href="../functions/selectors._t.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>$t</a></li></ul></nav></div></div>
|
|
56
|
-
<div class="container tsd-generator">
|
|
57
|
-
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
58
|
-
<div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html><html class="default" lang="en"><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="IE=edge"/><title>singleSelector | Micro Components</title><meta name="description" content="Documentation for Micro Components"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="../assets/style.css"/><link rel="stylesheet" href="../assets/highlight.css"/><script async src="../assets/search.js" id="search-script"></script></head><body><script>document.documentElement.dataset.theme = localStorage.getItem("tsd-theme") || "os"</script><header class="tsd-page-toolbar">
|
|
2
|
-
<div class="tsd-toolbar-contents container">
|
|
3
|
-
<div class="table-cell" id="tsd-search" data-base="..">
|
|
4
|
-
<div class="field"><label for="tsd-search-field" class="tsd-widget tsd-toolbar-icon search no-caption"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-text)"></path></svg></label><input type="text" id="tsd-search-field" aria-label="Search"/></div>
|
|
5
|
-
<div class="field">
|
|
6
|
-
<div id="tsd-toolbar-links"></div></div>
|
|
7
|
-
<ul class="results">
|
|
8
|
-
<li class="state loading">Preparing search index...</li>
|
|
9
|
-
<li class="state failure">The search index is not available</li></ul><a href="../index.html" class="title">Micro Components</a></div>
|
|
10
|
-
<div class="table-cell" id="tsd-widgets"><a href="#" class="tsd-widget tsd-toolbar-icon menu no-caption" data-toggle="menu" aria-label="Menu"><svg width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="3" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-text)"></rect></svg></a></div></div></header>
|
|
11
|
-
<div class="container container-main">
|
|
12
|
-
<div class="col-8 col-content">
|
|
13
|
-
<div class="tsd-page-title">
|
|
14
|
-
<ul class="tsd-breadcrumb">
|
|
15
|
-
<li><a href="../modules.html">Micro Components</a></li>
|
|
16
|
-
<li><a href="../modules/selectors.html">selectors</a></li>
|
|
17
|
-
<li><a href="selectors.singleSelector.html">singleSelector</a></li></ul>
|
|
18
|
-
<h1>Type alias singleSelector</h1></div>
|
|
19
|
-
<div class="tsd-signature">single<wbr/>Selector<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">ShadowRoot</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLElement</span><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">HTMLCollection</span><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">NodeList</span><span class="tsd-signature-symbol"> | </span><a href="../interfaces/selectors.DSelector.html" class="tsd-signature-type" data-tsd-kind="Interface">DSelector</a><span class="tsd-signature-symbol"> | </span><a href="../classes/MC.MC.html" class="tsd-signature-type" data-tsd-kind="Class">MC</a><span class="tsd-signature-symbol"> | </span><a href="../classes/MC.DC.html" class="tsd-signature-type" data-tsd-kind="Class">DC</a><span class="tsd-signature-symbol"> | </span><a href="../interfaces/selectors.TSelector.html" class="tsd-signature-type" data-tsd-kind="Interface">TSelector</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">undefined</span></div><aside class="tsd-sources">
|
|
20
|
-
<ul>
|
|
21
|
-
<li>Defined in <a href="https://gitlab.com/twoBirds/microcomponents/-/blob/2ce7f9b/src/selectors.ts#L1632">src/selectors.ts:1632</a></li></ul></aside></div>
|
|
22
|
-
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
23
|
-
<div class="tsd-navigation settings">
|
|
24
|
-
<details class="tsd-index-accordion"><summary class="tsd-accordion-summary">
|
|
25
|
-
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Settings</h3></summary>
|
|
26
|
-
<div class="tsd-accordion-details">
|
|
27
|
-
<div class="tsd-filter-visibility">
|
|
28
|
-
<h4 class="uppercase">Member Visibility</h4><form>
|
|
29
|
-
<ul id="tsd-filter-options">
|
|
30
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-protected" name="protected"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Protected</span></label></li>
|
|
31
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-private" name="private"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Private</span></label></li>
|
|
32
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-inherited" name="inherited" checked/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>Inherited</span></label></li>
|
|
33
|
-
<li class="tsd-filter-item"><label class="tsd-filter-input"><input type="checkbox" id="tsd-filter-external" name="external"/><svg width="32" height="32" viewBox="0 0 32 32" aria-hidden="true"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></svg><span>External</span></label></li></ul></form></div>
|
|
34
|
-
<div class="tsd-theme-toggle">
|
|
35
|
-
<h4 class="uppercase">Theme</h4><select id="theme"><option value="os">OS</option><option value="light">Light</option><option value="dark">Dark</option></select></div></div></details></div>
|
|
36
|
-
<nav class="tsd-navigation primary">
|
|
37
|
-
<details class="tsd-index-accordion" open><summary class="tsd-accordion-summary">
|
|
38
|
-
<h3><svg width="20" height="20" viewBox="0 0 24 24" fill="none"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-text)"></path></svg> Modules</h3></summary>
|
|
39
|
-
<div class="tsd-accordion-details">
|
|
40
|
-
<ul>
|
|
41
|
-
<li class="current"><a href="../modules.html">Micro <wbr/>Components</a>
|
|
42
|
-
<ul>
|
|
43
|
-
<li class="tsd-kind-module"><a href="../modules/MC.html">MC</a></li>
|
|
44
|
-
<li class="tsd-kind-module"><a href="../modules/elements.html">elements</a></li>
|
|
45
|
-
<li class="tsd-kind-module"><a href="../modules/formValues.html">form<wbr/>Values</a></li>
|
|
46
|
-
<li class="tsd-kind-module"><a href="../modules/observables.html">observables</a></li>
|
|
47
|
-
<li class="current tsd-kind-module"><a href="../modules/selectors.html">selectors</a></li></ul></li></ul></div></details></nav>
|
|
48
|
-
<nav class="tsd-navigation secondary menu-sticky">
|
|
49
|
-
<ul>
|
|
50
|
-
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/selectors.DSelector.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-256-path"></rect><path d="M9.51 16V15.016H11.298V8.224H9.51V7.24H14.19V8.224H12.402V15.016H14.19V16H9.51Z" fill="var(--color-text)" id="icon-256-text"></path></svg>DSelector</a></li>
|
|
51
|
-
<li class="tsd-kind-interface tsd-parent-kind-module"><a href="../interfaces/selectors.TSelector.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-256-path"></use><use href="#icon-256-text"></use></svg>TSelector</a></li>
|
|
52
|
-
<li class="tsd-kind-type-alias tsd-parent-kind-module"><a href="selectors.selection.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-4194304-path"></rect><path d="M11.31 16V8.224H8.91V7.24H14.79V8.224H12.39V16H11.31Z" fill="var(--color-text)" id="icon-4194304-text"></path></svg>selection</a></li>
|
|
53
|
-
<li class="current tsd-kind-type-alias tsd-parent-kind-module"><a href="selectors.singleSelector.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-4194304-path"></use><use href="#icon-4194304-text"></use></svg>single<wbr/>Selector</a></li>
|
|
54
|
-
<li class="tsd-kind-function tsd-parent-kind-module"><a href="../functions/selectors._d.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6" id="icon-64-path"></rect><path d="M9.39 16V7.24H14.55V8.224H10.446V11.128H14.238V12.112H10.47V16H9.39Z" fill="var(--color-text)" id="icon-64-text"></path></svg>$d</a></li>
|
|
55
|
-
<li class="tsd-kind-function tsd-parent-kind-module"><a href="../functions/selectors._t.html" class="tsd-index-link"><svg class="tsd-kind-icon" width="24" height="24" viewBox="0 0 24 24"><use href="#icon-64-path"></use><use href="#icon-64-text"></use></svg>$t</a></li></ul></nav></div></div>
|
|
56
|
-
<div class="container tsd-generator">
|
|
57
|
-
<p>Generated using <a href="https://typedoc.org/" target="_blank">TypeDoc</a></p></div>
|
|
58
|
-
<div class="overlay"></div><script src="../assets/main.js"></script></body></html>
|
package/src/autoloader.ts
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { getCE } from './elements.js'
|
|
4
|
-
|
|
5
|
-
// set of currently loading scripts
|
|
6
|
-
const loadingScripts: Set<string> = new Set();
|
|
7
|
-
|
|
8
|
-
const _makeLoadData = ( e: HTMLElement ): Array<any> | false => {
|
|
9
|
-
|
|
10
|
-
let
|
|
11
|
-
tagName = e?.localName ?? '',
|
|
12
|
-
isAttribute = e.getAttribute?.('is') || '',
|
|
13
|
-
isUBE = isAttribute ? true : false,
|
|
14
|
-
isCE = tagName.indexOf('-') !== -1 ? true : false,
|
|
15
|
-
ubeSelector = isUBE ? `${tagName}[is=\"${isAttribute}\"]:defined` : '',
|
|
16
|
-
ceSelector = isCE ? tagName + ':defined' : '',
|
|
17
|
-
fileBaseName = isUBE
|
|
18
|
-
? isAttribute
|
|
19
|
-
: isCE
|
|
20
|
-
? tagName
|
|
21
|
-
: '',
|
|
22
|
-
fileName = fileBaseName.length ? '/' + fileBaseName.split('-').join('/') + '.js' : '',
|
|
23
|
-
selector = isUBE
|
|
24
|
-
? ubeSelector
|
|
25
|
-
: isCE
|
|
26
|
-
? ceSelector
|
|
27
|
-
: ''
|
|
28
|
-
;
|
|
29
|
-
|
|
30
|
-
//console.log( 'makeLoadData()', tagName, isUBE, isCE, ubeSelector, ceSelector, fileBaseName, ' => ', (isUBE || isCE) ? [ e, selector, fileName ] : false );
|
|
31
|
-
return (isUBE || isCE) ? [ e, selector, fileName, fileBaseName ] : false;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const _loadRequirements = ( node: HTMLTemplateElement | HTMLElement ): Promise<any> => {
|
|
35
|
-
|
|
36
|
-
let
|
|
37
|
-
undefinedSet: Set<any> = new Set(),
|
|
38
|
-
element: any = node instanceof HTMLTemplateElement ? (node as HTMLTemplateElement).content : node,
|
|
39
|
-
head = document.head,
|
|
40
|
-
allPromises: Array<any> = [],
|
|
41
|
-
e: HTMLElement;
|
|
42
|
-
;
|
|
43
|
-
|
|
44
|
-
if ( element instanceof HTMLTemplateElement === false ){
|
|
45
|
-
// if node itself is undefined
|
|
46
|
-
let data: any = _makeLoadData(element);
|
|
47
|
-
|
|
48
|
-
if ( data && !data[0].matches( data[1] ) ){
|
|
49
|
-
undefinedSet.add( data );
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// if some of the childNodes are undefined
|
|
54
|
-
Array.from( element.childNodes ).forEach(( node )=>{
|
|
55
|
-
let data: any = _makeLoadData(node as HTMLElement);
|
|
56
|
-
|
|
57
|
-
if ( data && !data[0].matches( data[1] ) ){
|
|
58
|
-
undefinedSet.add( data );
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
if ( !!undefinedSet.size ){ // there are requirements
|
|
63
|
-
|
|
64
|
-
undefinedSet.forEach( (data) => {
|
|
65
|
-
if ( !getCE( data[3] ) && !loadingScripts.has( data[2]) ){
|
|
66
|
-
|
|
67
|
-
loadingScripts.add( data[2] );
|
|
68
|
-
|
|
69
|
-
const se: HTMLScriptElement = document.createElement('script');
|
|
70
|
-
|
|
71
|
-
se.setAttribute( 'src', data[2] );
|
|
72
|
-
se.setAttribute( 'blocking', 'render' );
|
|
73
|
-
se.setAttribute( 'type', 'module' );
|
|
74
|
-
let s = (data as any)[2];
|
|
75
|
-
se.onload = () => {
|
|
76
|
-
// console.info('loaded', s);
|
|
77
|
-
loadingScripts.delete( s );
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
head.append( se );
|
|
81
|
-
|
|
82
|
-
let e = (data as Array<any>)[0];
|
|
83
|
-
} else {
|
|
84
|
-
return ;
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
return Promise.all( allPromises );
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
/*
|
|
94
|
-
TBD
|
|
95
|
-
if ( template.content.childNodes.length ){
|
|
96
|
-
_loadRequirements(template);
|
|
97
|
-
}
|
|
98
|
-
*/
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|