@fluid-topics/ft-wc-utils 0.3.20 → 0.3.21
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/build/globals.min.js +1 -1
- package/build/redux.d.ts +3 -3
- package/build/silent-define.js +1 -1
- package/build/silent-define.min.js +1 -1
- package/package.json +2 -2
package/build/globals.min.js
CHANGED
|
@@ -117,7 +117,7 @@ var vt;const pt=null!=(null===(vt=window.HTMLSlotElement)||void 0===vt?void 0:vt
|
|
|
117
117
|
* http://polymer.github.io/PATENTS.txt
|
|
118
118
|
*
|
|
119
119
|
* @see https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry
|
|
120
|
-
*/if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,n=window.customElements.get,r=window.customElements,i=new WeakMap,o=new WeakMap,s=new WeakMap,c=new WeakMap;let u;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,i){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(i))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const c=i.prototype.attributeChangedCallback,u=new Set(i.observedAttributes||[]);h(i,u,c);const a={elementClass:i,connectedCallback:i.prototype.connectedCallback,disconnectedCallback:i.prototype.disconnectedCallback,adoptedCallback:i.prototype.adoptedCallback,attributeChangedCallback:c,formAssociated:i.formAssociated,formAssociatedCallback:i.prototype.formAssociatedCallback,formDisabledCallback:i.prototype.formDisabledCallback,formResetCallback:i.prototype.formResetCallback,formStateRestoreCallback:i.prototype.formStateRestoreCallback,observedAttributes:u};this._definitionsByTag.set(t,a),this._definitionsByClass.set(i,a);let l=n.call(r,t);l||(l=f(t),e.call(r,t,l)),this===window.customElements&&(s.set(i,a),a.standInClass=l);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)o.delete(t),v(t,a,!0)}const p=this._whenDefinedPromises.get(t);return void 0!==p&&(p.resolve(i),this._whenDefinedPromises.delete(t)),i}upgrade(){b.push(this),r.upgrade.apply(r,arguments),b.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const e=this._getDefinition(t);if(void 0!==e)return Promise.resolve(e.elementClass);let n=this._whenDefinedPromises.get(t);return void 0===n&&(n={},n.promise=new Promise((t=>n.resolve=t)),this._whenDefinedPromises.set(t,n)),n.promise}_upgradeWhenDefined(t,e,n){let r=this._awaitingUpgrade.get(e);r||this._awaitingUpgrade.set(e,r=new Set),n?r.add(t):r.delete(t)}},window.HTMLElement=function(){let e=u;if(e)return u=void 0,e;const n=s.get(this.constructor);if(!n)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return e=Reflect.construct(t,[],n.standInClass),Object.setPrototypeOf(e,this.constructor.prototype),i.set(e,n),e},window.HTMLElement.prototype=t.prototype;const a=t=>t===document||t instanceof ShadowRoot,l=t=>{let e=t.getRootNode();if(!a(e)){const t=b[b.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),a(e)||(e=c.get(e)?.getRootNode()||document)}return e.customElements},f=e=>class{static get formAssociated(){return!0}constructor(){const n=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(n,HTMLElement.prototype);const r=l(n)||window.customElements,i=r._getDefinition(e);return i?v(n,i):o.set(n,r),n}connectedCallback(){const t=i.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):o.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=i.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):o.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){i.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=i.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=i.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=i.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=i.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},h=(t,e,n)=>{if(0===e.size||void 0===n)return;const r=t.prototype.setAttribute;r&&(t.prototype.setAttribute=function(t,i){const o=t.toLowerCase();if(e.has(o)){const t=this.getAttribute(o);r.call(this,o,i),n.call(this,o,t,i)}else r.call(this,o,i)});const i=t.prototype.removeAttribute;i&&(t.prototype.removeAttribute=function(t){const r=t.toLowerCase();if(e.has(r)){const t=this.getAttribute(r);i.call(this,r),n.call(this,r,t,null)}else i.call(this,r)})},d=e=>{const n=Object.getPrototypeOf(e);if(n!==window.HTMLElement)return n===t||"HTMLElement"===n?.prototype?.constructor?.name?Object.setPrototypeOf(e,window.HTMLElement):d(n)},v=(t,e,n=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),i.set(t,e),u=t;try{new e.elementClass}catch(t){d(e.elementClass),new e.elementClass}e.observedAttributes.forEach((n=>{t.hasAttribute(n)&&e.attributeChangedCallback.call(t,n,null,t.getAttribute(n))})),n&&e.connectedCallback&&t.isConnected&&e.connectedCallback.call(t)},p=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=p.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let b=[document];const y=(t,e,n)=>{const r=(n?Object.getPrototypeOf(n):t.prototype)[e];t.prototype[e]=function(){b.push(this);const t=r.apply(n||this,arguments);return void 0!==t&&c.set(t,this),b.pop(),t}};y(ShadowRoot,"createElement",document),y(ShadowRoot,"importNode",document),y(Element,"insertAdjacentHTML");const m=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...n,set(t){b.push(this),n.set.call(this,t),b.pop()}})};if(m(Element,"innerHTML"),m(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,e=HTMLElement.prototype.attachInternals,n=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...n){const r=e.call(this,...n);return t.set(r,this),r},n.forEach((e=>{const n=window.ElementInternals.prototype,r=n[e];n[e]=function(...e){const n=t.get(this);if(!0!==i.get(n).formAssociated)throw new DOMException(`Failed to execute ${r} on 'ElementInternals': The target element is not a form-associated custom element.`);r?.call(this,...e)}}));class r extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class o{constructor(t){const e=new Map;t.forEach(((t,n)=>{const r=t.getAttribute("name"),i=e.get(r)||[];this[+n]=t,i.push(t),e.set(r,i)})),this.length=t.length,e.forEach(((t,e)=>{t&&(1===t.length?this[e]=t[0]:this[e]=new r(t))}))}namedItem(t){return this[t]}}const s=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=s.get.call(this,[]),e=[];for(const n of t){const t=i.get(n);t&&!0!==t.formAssociated||e.push(n)}return new o(e)}})}}try{window.customElements.define("custom-element",null)}catch(t){const e=window.customElements.define;window.customElements.define=(t,n,r)=>{try{e.bind(window.customElements)(t,n,r)}catch(e){console.warn(t,n,r,e)}}}function Tt(t,e){const n=()=>JSON.parse(JSON.stringify(t));return ht({type:Object,converter:{fromAttribute:t=>{if(null==t)return n();try{return JSON.parse(t)}catch{return n()}},toAttribute:t=>JSON.stringify(t)},...null!=e?e:{}})}function Bt(t,e){try{return function(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if((n=t.length)!=e.length)return!1;for(r=n;0!=r--;)if(!Bt(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!Bt(r[1],e.get(r[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if((n=(i=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=n;0!=r--;){var o=i[r];if(!Bt(t[o],e[o]))return!1}return!0}return t!=t&&e!=e}(t,e)}catch(t){return!1}}class Dt{static create(t,e,n){let r=t=>s(null!=t?t:n),i=c`var(${s(t)}, ${r(n)})`;return i.name=t,i.category=e,i.defaultValue=n,i.defaultCssValue=r,i.get=e=>c`var(${s(t)}, ${r(e)})`,i.breadcrumb=()=>[],i.lastResortDefaultValue=()=>n,i}static extend(t,e,n){let r=t=>e.get(null!=t?t:n),i=c`var(${s(t)}, ${r(n)})`;return i.name=t,i.category=e.category,i.fallbackVariable=e,i.defaultValue=n,i.defaultCssValue=r,i.get=e=>c`var(${s(t)}, ${r(e)})`,i.breadcrumb=()=>[e.name,...e.breadcrumb()],i.lastResortDefaultValue=()=>n,i}static external(t,e){let n=e=>t.fallbackVariable?t.fallbackVariable.get(null!=e?e:t.defaultValue):s(null!=e?e:t.defaultValue),r=c`var(${s(t.name)}, ${n(t.defaultValue)})`;return r.name=t.name,r.category=t.category,r.fallbackVariable=t.fallbackVariable,r.defaultValue=t.defaultValue,r.context=e,r.defaultCssValue=n,r.get=e=>c`var(${s(t.name)}, ${n(e)})`,r.breadcrumb=()=>t.fallbackVariable?[t.fallbackVariable.name,...t.fallbackVariable.breadcrumb()]:[],r.lastResortDefaultValue=()=>{var e,n;return null!==(e=t.defaultValue)&&void 0!==e?e:null===(n=t.fallbackVariable)||void 0===n?void 0:n.lastResortDefaultValue()},r}}const Wt={colorPrimary:Dt.create("--ft-color-primary","COLOR","#2196F3"),colorPrimaryVariant:Dt.create("--ft-color-primary-variant","COLOR","#1976D2"),colorSecondary:Dt.create("--ft-color-secondary","COLOR","#FFCC80"),colorSecondaryVariant:Dt.create("--ft-color-secondary-variant","COLOR","#F57C00"),colorSurface:Dt.create("--ft-color-surface","COLOR","#FFFFFF"),colorContent:Dt.create("--ft-color-content","COLOR","rgba(0, 0, 0, 0.87)"),colorError:Dt.create("--ft-color-error","COLOR","#B00020"),colorOutline:Dt.create("--ft-color-outline","COLOR","rgba(0, 0, 0, 0.14)"),colorOpacityHigh:Dt.create("--ft-color-opacity-high","NUMBER","1"),colorOpacityMedium:Dt.create("--ft-color-opacity-medium","NUMBER","0.74"),colorOpacityDisabled:Dt.create("--ft-color-opacity-disabled","NUMBER","0.38"),colorOnPrimary:Dt.create("--ft-color-on-primary","COLOR","#FFFFFF"),colorOnPrimaryHigh:Dt.create("--ft-color-on-primary-high","COLOR","#FFFFFF"),colorOnPrimaryMedium:Dt.create("--ft-color-on-primary-medium","COLOR","rgba(255, 255, 255, 0.74)"),colorOnPrimaryDisabled:Dt.create("--ft-color-on-primary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),colorOnSecondary:Dt.create("--ft-color-on-secondary","COLOR","#FFFFFF"),colorOnSecondaryHigh:Dt.create("--ft-color-on-secondary-high","COLOR","#FFFFFF"),colorOnSecondaryMedium:Dt.create("--ft-color-on-secondary-medium","COLOR","rgba(255, 255, 255, 0.74)"),colorOnSecondaryDisabled:Dt.create("--ft-color-on-secondary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),colorOnSurface:Dt.create("--ft-color-on-surface","COLOR","rgba(0, 0, 0, 0.87)"),colorOnSurfaceHigh:Dt.create("--ft-color-on-surface-high","COLOR","rgba(0, 0, 0, 0.87)"),colorOnSurfaceMedium:Dt.create("--ft-color-on-surface-medium","COLOR","rgba(0, 0, 0, 0.60)"),colorOnSurfaceDisabled:Dt.create("--ft-color-on-surface-disabled","COLOR","rgba(0, 0, 0, 0.38)"),opacityContentOnSurfaceDisabled:Dt.create("--ft-opacity-content-on-surface-disabled","NUMBER","0"),opacityContentOnSurfaceEnable:Dt.create("--ft-opacity-content-on-surface-enable","NUMBER","0"),opacityContentOnSurfaceHover:Dt.create("--ft-opacity-content-on-surface-hover","NUMBER","0.04"),opacityContentOnSurfaceFocused:Dt.create("--ft-opacity-content-on-surface-focused","NUMBER","0.12"),opacityContentOnSurfacePressed:Dt.create("--ft-opacity-content-on-surface-pressed","NUMBER","0.10"),opacityContentOnSurfaceSelected:Dt.create("--ft-opacity-content-on-surface-selected","NUMBER","0.08"),opacityContentOnSurfaceDragged:Dt.create("--ft-opacity-content-on-surface-dragged","NUMBER","0.08"),opacityPrimaryOnSurfaceDisabled:Dt.create("--ft-opacity-primary-on-surface-disabled","NUMBER","0"),opacityPrimaryOnSurfaceEnable:Dt.create("--ft-opacity-primary-on-surface-enable","NUMBER","0"),opacityPrimaryOnSurfaceHover:Dt.create("--ft-opacity-primary-on-surface-hover","NUMBER","0.04"),opacityPrimaryOnSurfaceFocused:Dt.create("--ft-opacity-primary-on-surface-focused","NUMBER","0.12"),opacityPrimaryOnSurfacePressed:Dt.create("--ft-opacity-primary-on-surface-pressed","NUMBER","0.10"),opacityPrimaryOnSurfaceSelected:Dt.create("--ft-opacity-primary-on-surface-selected","NUMBER","0.08"),opacityPrimaryOnSurfaceDragged:Dt.create("--ft-opacity-primary-on-surface-dragged","NUMBER","0.08"),opacitySurfaceOnPrimaryDisabled:Dt.create("--ft-opacity-surface-on-primary-disabled","NUMBER","0"),opacitySurfaceOnPrimaryEnable:Dt.create("--ft-opacity-surface-on-primary-enable","NUMBER","0"),opacitySurfaceOnPrimaryHover:Dt.create("--ft-opacity-surface-on-primary-hover","NUMBER","0.04"),opacitySurfaceOnPrimaryFocused:Dt.create("--ft-opacity-surface-on-primary-focused","NUMBER","0.12"),opacitySurfaceOnPrimaryPressed:Dt.create("--ft-opacity-surface-on-primary-pressed","NUMBER","0.10"),opacitySurfaceOnPrimarySelected:Dt.create("--ft-opacity-surface-on-primary-selected","NUMBER","0.08"),opacitySurfaceOnPrimaryDragged:Dt.create("--ft-opacity-surface-on-primary-dragged","NUMBER","0.08"),elevation00:Dt.create("--ft-elevation-00","UNKNOWN","0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0)"),elevation01:Dt.create("--ft-elevation-01","UNKNOWN","0px 1px 4px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),elevation02:Dt.create("--ft-elevation-02","UNKNOWN","0px 4px 10px 0px rgba(0, 0, 0, 0.06), 0px 2px 5px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),elevation03:Dt.create("--ft-elevation-03","UNKNOWN","0px 6px 13px 0px rgba(0, 0, 0, 0.06), 0px 3px 7px 0px rgba(0, 0, 0, 0.14), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)"),elevation04:Dt.create("--ft-elevation-04","UNKNOWN","0px 8px 16px 0px rgba(0, 0, 0, 0.06), 0px 4px 9px 0px rgba(0, 0, 0, 0.14), 0px 2px 3px 0px rgba(0, 0, 0, 0.06)"),elevation06:Dt.create("--ft-elevation-06","UNKNOWN","0px 12px 22px 0px rgba(0, 0, 0, 0.06), 0px 6px 13px 0px rgba(0, 0, 0, 0.14), 0px 4px 5px 0px rgba(0, 0, 0, 0.06)"),elevation08:Dt.create("--ft-elevation-08","UNKNOWN","0px 16px 28px 0px rgba(0, 0, 0, 0.06), 0px 8px 17px 0px rgba(0, 0, 0, 0.14), 0px 6px 7px 0px rgba(0, 0, 0, 0.06)"),elevation12:Dt.create("--ft-elevation-12","UNKNOWN","0px 22px 40px 0px rgba(0, 0, 0, 0.06), 0px 12px 23px 0px rgba(0, 0, 0, 0.14), 0px 10px 11px 0px rgba(0, 0, 0, 0.06)"),elevation16:Dt.create("--ft-elevation-16","UNKNOWN","0px 28px 52px 0px rgba(0, 0, 0, 0.06), 0px 16px 29px 0px rgba(0, 0, 0, 0.14), 0px 14px 15px 0px rgba(0, 0, 0, 0.06)"),elevation24:Dt.create("--ft-elevation-24","UNKNOWN","0px 40px 76px 0px rgba(0, 0, 0, 0.06), 0px 24px 41px 0px rgba(0, 0, 0, 0.14), 0px 22px 23px 0px rgba(0, 0, 0, 0.06)"),borderRadiusS:Dt.create("--ft-border-radius-S","SIZE","4px"),borderRadiusM:Dt.create("--ft-border-radius-M","SIZE","8px"),borderRadiusL:Dt.create("--ft-border-radius-L","SIZE","12px"),borderRadiusXL:Dt.create("--ft-border-radius-XL","SIZE","16px"),titleFont:Dt.create("--ft-title-font","UNKNOWN","Ubuntu, system-ui, sans-serif"),contentFont:Dt.create("--ft-content-font","UNKNOWN","'Open Sans', system-ui, sans-serif"),transitionDuration:Dt.create("--ft-transition-duration","UNKNOWN","250ms"),transitionTimingFunction:Dt.create("--ft-transition-timing-function","UNKNOWN","ease-in-out")};
|
|
120
|
+
*/if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,n=window.customElements.get,r=window.customElements,i=new WeakMap,o=new WeakMap,s=new WeakMap,c=new WeakMap;let u;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,i){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(i))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const c=i.prototype.attributeChangedCallback,u=new Set(i.observedAttributes||[]);h(i,u,c);const a={elementClass:i,connectedCallback:i.prototype.connectedCallback,disconnectedCallback:i.prototype.disconnectedCallback,adoptedCallback:i.prototype.adoptedCallback,attributeChangedCallback:c,formAssociated:i.formAssociated,formAssociatedCallback:i.prototype.formAssociatedCallback,formDisabledCallback:i.prototype.formDisabledCallback,formResetCallback:i.prototype.formResetCallback,formStateRestoreCallback:i.prototype.formStateRestoreCallback,observedAttributes:u};this._definitionsByTag.set(t,a),this._definitionsByClass.set(i,a);let l=n.call(r,t);l||(l=f(t),e.call(r,t,l)),this===window.customElements&&(s.set(i,a),a.standInClass=l);const d=this._awaitingUpgrade.get(t);if(d){this._awaitingUpgrade.delete(t);for(const t of d)o.delete(t),v(t,a,!0)}const p=this._whenDefinedPromises.get(t);return void 0!==p&&(p.resolve(i),this._whenDefinedPromises.delete(t)),i}upgrade(){b.push(this),r.upgrade.apply(r,arguments),b.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const e=this._getDefinition(t);if(void 0!==e)return Promise.resolve(e.elementClass);let n=this._whenDefinedPromises.get(t);return void 0===n&&(n={},n.promise=new Promise((t=>n.resolve=t)),this._whenDefinedPromises.set(t,n)),n.promise}_upgradeWhenDefined(t,e,n){let r=this._awaitingUpgrade.get(e);r||this._awaitingUpgrade.set(e,r=new Set),n?r.add(t):r.delete(t)}},window.HTMLElement=function(){let e=u;if(e)return u=void 0,e;const n=s.get(this.constructor);if(!n)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return e=Reflect.construct(t,[],n.standInClass),Object.setPrototypeOf(e,this.constructor.prototype),i.set(e,n),e},window.HTMLElement.prototype=t.prototype;const a=t=>t===document||t instanceof ShadowRoot,l=t=>{let e=t.getRootNode();if(!a(e)){const t=b[b.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),a(e)||(e=c.get(e)?.getRootNode()||document)}return e.customElements},f=e=>class{static get formAssociated(){return!0}constructor(){const n=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(n,HTMLElement.prototype);const r=l(n)||window.customElements,i=r._getDefinition(e);return i?v(n,i):o.set(n,r),n}connectedCallback(){const t=i.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):o.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=i.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):o.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){i.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=i.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=i.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=i.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=i.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},h=(t,e,n)=>{if(0===e.size||void 0===n)return;const r=t.prototype.setAttribute;r&&(t.prototype.setAttribute=function(t,i){const o=t.toLowerCase();if(e.has(o)){const t=this.getAttribute(o);r.call(this,o,i),n.call(this,o,t,i)}else r.call(this,o,i)});const i=t.prototype.removeAttribute;i&&(t.prototype.removeAttribute=function(t){const r=t.toLowerCase();if(e.has(r)){const t=this.getAttribute(r);i.call(this,r),n.call(this,r,t,null)}else i.call(this,r)})},d=e=>{const n=Object.getPrototypeOf(e);if(n!==window.HTMLElement)return n===t||"HTMLElement"===n?.prototype?.constructor?.name?Object.setPrototypeOf(e,window.HTMLElement):d(n)},v=(t,e,n=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),i.set(t,e),u=t;try{new e.elementClass}catch(t){d(e.elementClass),new e.elementClass}e.observedAttributes.forEach((n=>{t.hasAttribute(n)&&e.attributeChangedCallback.call(t,n,null,t.getAttribute(n))})),n&&e.connectedCallback&&t.isConnected&&e.connectedCallback.call(t)},p=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=p.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let b=[document];const y=(t,e,n)=>{const r=(n?Object.getPrototypeOf(n):t.prototype)[e];t.prototype[e]=function(){b.push(this);const t=r.apply(n||this,arguments);return void 0!==t&&c.set(t,this),b.pop(),t}};y(ShadowRoot,"createElement",document),y(ShadowRoot,"importNode",document),y(Element,"insertAdjacentHTML");const m=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...n,set(t){b.push(this),n.set.call(this,t),b.pop()}})};if(m(Element,"innerHTML"),m(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,e=HTMLElement.prototype.attachInternals,n=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...n){const r=e.call(this,...n);return t.set(r,this),r},n.forEach((e=>{const n=window.ElementInternals.prototype,r=n[e];n[e]=function(...e){const n=t.get(this);if(!0!==i.get(n).formAssociated)throw new DOMException(`Failed to execute ${r} on 'ElementInternals': The target element is not a form-associated custom element.`);r?.call(this,...e)}}));class r extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class o{constructor(t){const e=new Map;t.forEach(((t,n)=>{const r=t.getAttribute("name"),i=e.get(r)||[];this[+n]=t,i.push(t),e.set(r,i)})),this.length=t.length,e.forEach(((t,e)=>{t&&(1===t.length?this[e]=t[0]:this[e]=new r(t))}))}namedItem(t){return this[t]}}const s=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=s.get.call(this,[]),e=[];for(const n of t){const t=i.get(n);t&&!0!==t.formAssociated||e.push(n)}return new o(e)}})}}try{window.customElements.define("custom-element",null)}catch(t){const e=window.customElements.define;window.customElements.define=(t,n,r)=>{try{e.bind(window.customElements)(t,n,r)}catch(e){console.info(t,n,r,e)}}}function Tt(t,e){const n=()=>JSON.parse(JSON.stringify(t));return ht({type:Object,converter:{fromAttribute:t=>{if(null==t)return n();try{return JSON.parse(t)}catch{return n()}},toAttribute:t=>JSON.stringify(t)},...null!=e?e:{}})}function Bt(t,e){try{return function(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(t.constructor!==e.constructor)return!1;var n,r,i;if(Array.isArray(t)){if((n=t.length)!=e.length)return!1;for(r=n;0!=r--;)if(!Bt(t[r],e[r]))return!1;return!0}if(t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;for(r of t.entries())if(!Bt(r[1],e.get(r[0])))return!1;return!0}if(t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(r of t.entries())if(!e.has(r[0]))return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===e.valueOf();if((n=(i=Object.keys(t)).length)!==Object.keys(e).length)return!1;for(r=n;0!=r--;)if(!Object.prototype.hasOwnProperty.call(e,i[r]))return!1;for(r=n;0!=r--;){var o=i[r];if(!Bt(t[o],e[o]))return!1}return!0}return t!=t&&e!=e}(t,e)}catch(t){return!1}}class Dt{static create(t,e,n){let r=t=>s(null!=t?t:n),i=c`var(${s(t)}, ${r(n)})`;return i.name=t,i.category=e,i.defaultValue=n,i.defaultCssValue=r,i.get=e=>c`var(${s(t)}, ${r(e)})`,i.breadcrumb=()=>[],i.lastResortDefaultValue=()=>n,i}static extend(t,e,n){let r=t=>e.get(null!=t?t:n),i=c`var(${s(t)}, ${r(n)})`;return i.name=t,i.category=e.category,i.fallbackVariable=e,i.defaultValue=n,i.defaultCssValue=r,i.get=e=>c`var(${s(t)}, ${r(e)})`,i.breadcrumb=()=>[e.name,...e.breadcrumb()],i.lastResortDefaultValue=()=>n,i}static external(t,e){let n=e=>t.fallbackVariable?t.fallbackVariable.get(null!=e?e:t.defaultValue):s(null!=e?e:t.defaultValue),r=c`var(${s(t.name)}, ${n(t.defaultValue)})`;return r.name=t.name,r.category=t.category,r.fallbackVariable=t.fallbackVariable,r.defaultValue=t.defaultValue,r.context=e,r.defaultCssValue=n,r.get=e=>c`var(${s(t.name)}, ${n(e)})`,r.breadcrumb=()=>t.fallbackVariable?[t.fallbackVariable.name,...t.fallbackVariable.breadcrumb()]:[],r.lastResortDefaultValue=()=>{var e,n;return null!==(e=t.defaultValue)&&void 0!==e?e:null===(n=t.fallbackVariable)||void 0===n?void 0:n.lastResortDefaultValue()},r}}const Wt={colorPrimary:Dt.create("--ft-color-primary","COLOR","#2196F3"),colorPrimaryVariant:Dt.create("--ft-color-primary-variant","COLOR","#1976D2"),colorSecondary:Dt.create("--ft-color-secondary","COLOR","#FFCC80"),colorSecondaryVariant:Dt.create("--ft-color-secondary-variant","COLOR","#F57C00"),colorSurface:Dt.create("--ft-color-surface","COLOR","#FFFFFF"),colorContent:Dt.create("--ft-color-content","COLOR","rgba(0, 0, 0, 0.87)"),colorError:Dt.create("--ft-color-error","COLOR","#B00020"),colorOutline:Dt.create("--ft-color-outline","COLOR","rgba(0, 0, 0, 0.14)"),colorOpacityHigh:Dt.create("--ft-color-opacity-high","NUMBER","1"),colorOpacityMedium:Dt.create("--ft-color-opacity-medium","NUMBER","0.74"),colorOpacityDisabled:Dt.create("--ft-color-opacity-disabled","NUMBER","0.38"),colorOnPrimary:Dt.create("--ft-color-on-primary","COLOR","#FFFFFF"),colorOnPrimaryHigh:Dt.create("--ft-color-on-primary-high","COLOR","#FFFFFF"),colorOnPrimaryMedium:Dt.create("--ft-color-on-primary-medium","COLOR","rgba(255, 255, 255, 0.74)"),colorOnPrimaryDisabled:Dt.create("--ft-color-on-primary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),colorOnSecondary:Dt.create("--ft-color-on-secondary","COLOR","#FFFFFF"),colorOnSecondaryHigh:Dt.create("--ft-color-on-secondary-high","COLOR","#FFFFFF"),colorOnSecondaryMedium:Dt.create("--ft-color-on-secondary-medium","COLOR","rgba(255, 255, 255, 0.74)"),colorOnSecondaryDisabled:Dt.create("--ft-color-on-secondary-disabled","COLOR","rgba(255, 255, 255, 0.38)"),colorOnSurface:Dt.create("--ft-color-on-surface","COLOR","rgba(0, 0, 0, 0.87)"),colorOnSurfaceHigh:Dt.create("--ft-color-on-surface-high","COLOR","rgba(0, 0, 0, 0.87)"),colorOnSurfaceMedium:Dt.create("--ft-color-on-surface-medium","COLOR","rgba(0, 0, 0, 0.60)"),colorOnSurfaceDisabled:Dt.create("--ft-color-on-surface-disabled","COLOR","rgba(0, 0, 0, 0.38)"),opacityContentOnSurfaceDisabled:Dt.create("--ft-opacity-content-on-surface-disabled","NUMBER","0"),opacityContentOnSurfaceEnable:Dt.create("--ft-opacity-content-on-surface-enable","NUMBER","0"),opacityContentOnSurfaceHover:Dt.create("--ft-opacity-content-on-surface-hover","NUMBER","0.04"),opacityContentOnSurfaceFocused:Dt.create("--ft-opacity-content-on-surface-focused","NUMBER","0.12"),opacityContentOnSurfacePressed:Dt.create("--ft-opacity-content-on-surface-pressed","NUMBER","0.10"),opacityContentOnSurfaceSelected:Dt.create("--ft-opacity-content-on-surface-selected","NUMBER","0.08"),opacityContentOnSurfaceDragged:Dt.create("--ft-opacity-content-on-surface-dragged","NUMBER","0.08"),opacityPrimaryOnSurfaceDisabled:Dt.create("--ft-opacity-primary-on-surface-disabled","NUMBER","0"),opacityPrimaryOnSurfaceEnable:Dt.create("--ft-opacity-primary-on-surface-enable","NUMBER","0"),opacityPrimaryOnSurfaceHover:Dt.create("--ft-opacity-primary-on-surface-hover","NUMBER","0.04"),opacityPrimaryOnSurfaceFocused:Dt.create("--ft-opacity-primary-on-surface-focused","NUMBER","0.12"),opacityPrimaryOnSurfacePressed:Dt.create("--ft-opacity-primary-on-surface-pressed","NUMBER","0.10"),opacityPrimaryOnSurfaceSelected:Dt.create("--ft-opacity-primary-on-surface-selected","NUMBER","0.08"),opacityPrimaryOnSurfaceDragged:Dt.create("--ft-opacity-primary-on-surface-dragged","NUMBER","0.08"),opacitySurfaceOnPrimaryDisabled:Dt.create("--ft-opacity-surface-on-primary-disabled","NUMBER","0"),opacitySurfaceOnPrimaryEnable:Dt.create("--ft-opacity-surface-on-primary-enable","NUMBER","0"),opacitySurfaceOnPrimaryHover:Dt.create("--ft-opacity-surface-on-primary-hover","NUMBER","0.04"),opacitySurfaceOnPrimaryFocused:Dt.create("--ft-opacity-surface-on-primary-focused","NUMBER","0.12"),opacitySurfaceOnPrimaryPressed:Dt.create("--ft-opacity-surface-on-primary-pressed","NUMBER","0.10"),opacitySurfaceOnPrimarySelected:Dt.create("--ft-opacity-surface-on-primary-selected","NUMBER","0.08"),opacitySurfaceOnPrimaryDragged:Dt.create("--ft-opacity-surface-on-primary-dragged","NUMBER","0.08"),elevation00:Dt.create("--ft-elevation-00","UNKNOWN","0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0), 0px 0px 0px 0px rgba(0, 0, 0, 0)"),elevation01:Dt.create("--ft-elevation-01","UNKNOWN","0px 1px 4px 0px rgba(0, 0, 0, 0.06), 0px 1px 2px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),elevation02:Dt.create("--ft-elevation-02","UNKNOWN","0px 4px 10px 0px rgba(0, 0, 0, 0.06), 0px 2px 5px 0px rgba(0, 0, 0, 0.14), 0px 0px 1px 0px rgba(0, 0, 0, 0.06)"),elevation03:Dt.create("--ft-elevation-03","UNKNOWN","0px 6px 13px 0px rgba(0, 0, 0, 0.06), 0px 3px 7px 0px rgba(0, 0, 0, 0.14), 0px 1px 2px 0px rgba(0, 0, 0, 0.06)"),elevation04:Dt.create("--ft-elevation-04","UNKNOWN","0px 8px 16px 0px rgba(0, 0, 0, 0.06), 0px 4px 9px 0px rgba(0, 0, 0, 0.14), 0px 2px 3px 0px rgba(0, 0, 0, 0.06)"),elevation06:Dt.create("--ft-elevation-06","UNKNOWN","0px 12px 22px 0px rgba(0, 0, 0, 0.06), 0px 6px 13px 0px rgba(0, 0, 0, 0.14), 0px 4px 5px 0px rgba(0, 0, 0, 0.06)"),elevation08:Dt.create("--ft-elevation-08","UNKNOWN","0px 16px 28px 0px rgba(0, 0, 0, 0.06), 0px 8px 17px 0px rgba(0, 0, 0, 0.14), 0px 6px 7px 0px rgba(0, 0, 0, 0.06)"),elevation12:Dt.create("--ft-elevation-12","UNKNOWN","0px 22px 40px 0px rgba(0, 0, 0, 0.06), 0px 12px 23px 0px rgba(0, 0, 0, 0.14), 0px 10px 11px 0px rgba(0, 0, 0, 0.06)"),elevation16:Dt.create("--ft-elevation-16","UNKNOWN","0px 28px 52px 0px rgba(0, 0, 0, 0.06), 0px 16px 29px 0px rgba(0, 0, 0, 0.14), 0px 14px 15px 0px rgba(0, 0, 0, 0.06)"),elevation24:Dt.create("--ft-elevation-24","UNKNOWN","0px 40px 76px 0px rgba(0, 0, 0, 0.06), 0px 24px 41px 0px rgba(0, 0, 0, 0.14), 0px 22px 23px 0px rgba(0, 0, 0, 0.06)"),borderRadiusS:Dt.create("--ft-border-radius-S","SIZE","4px"),borderRadiusM:Dt.create("--ft-border-radius-M","SIZE","8px"),borderRadiusL:Dt.create("--ft-border-radius-L","SIZE","12px"),borderRadiusXL:Dt.create("--ft-border-radius-XL","SIZE","16px"),titleFont:Dt.create("--ft-title-font","UNKNOWN","Ubuntu, system-ui, sans-serif"),contentFont:Dt.create("--ft-content-font","UNKNOWN","'Open Sans', system-ui, sans-serif"),transitionDuration:Dt.create("--ft-transition-duration","UNKNOWN","250ms"),transitionTimingFunction:Dt.create("--ft-transition-timing-function","UNKNOWN","ease-in-out")};
|
|
121
121
|
/**
|
|
122
122
|
* @license
|
|
123
123
|
* Copyright 2021 Google LLC
|
package/build/redux.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { FtLitElement } from "./FtLitElement";
|
|
2
2
|
import { MiddlewareArray, Slice, Store } from "@reduxjs/toolkit";
|
|
3
|
-
export declare type ReduxSelector<T> = (rootState: T, element:
|
|
4
|
-
export declare const redux: <T, U
|
|
3
|
+
export declare type ReduxSelector<T, U extends FtLitElementRedux> = (rootState: T, element: U) => unknown;
|
|
4
|
+
export declare const redux: <T, U extends FtLitElementRedux>(selector?: ReduxSelector<T, U> | undefined, hasChanged?: ((value: U, oldValue: U) => boolean) | undefined) => (proto: Object, name: string) => void;
|
|
5
5
|
export declare abstract class FtLitElementRedux extends FtLitElement {
|
|
6
|
-
reduxProperties?: Map<string, ReduxSelector<unknown>>;
|
|
6
|
+
reduxProperties?: Map<string, ReduxSelector<unknown, FtLitElementRedux>>;
|
|
7
7
|
private unsubscribeFromStore;
|
|
8
8
|
private internalStore?;
|
|
9
9
|
get store(): any;
|
package/build/silent-define.js
CHANGED
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @see https://github.com/webcomponents/polyfills/tree/master/packages/scoped-custom-element-registry
|
|
16
16
|
*/
|
|
17
|
-
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,n=window.customElements.get,s=window.customElements,o=new WeakMap,i=new WeakMap,c=new WeakMap,r=new WeakMap;let a;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,o){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(o))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const r=o.prototype.attributeChangedCallback,a=new Set(o.observedAttributes||[]);w(o,a,r);const l={elementClass:o,connectedCallback:o.prototype.connectedCallback,disconnectedCallback:o.prototype.disconnectedCallback,adoptedCallback:o.prototype.adoptedCallback,attributeChangedCallback:r,formAssociated:o.formAssociated,formAssociatedCallback:o.prototype.formAssociatedCallback,formDisabledCallback:o.prototype.formDisabledCallback,formResetCallback:o.prototype.formResetCallback,formStateRestoreCallback:o.prototype.formStateRestoreCallback,observedAttributes:a};this._definitionsByTag.set(t,l),this._definitionsByClass.set(o,l);let h=n.call(s,t);h||(h=d(t),e.call(s,t,h)),this===window.customElements&&(c.set(o,l),l.standInClass=h);const u=this._awaitingUpgrade.get(t);if(u){this._awaitingUpgrade.delete(t);for(const t of u)i.delete(t),m(t,l,!0)}const f=this._whenDefinedPromises.get(t);return void 0!==f&&(f.resolve(o),this._whenDefinedPromises.delete(t)),o}upgrade(){b.push(this),s.upgrade.apply(s,arguments),b.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const e=this._getDefinition(t);if(void 0!==e)return Promise.resolve(e.elementClass);let n=this._whenDefinedPromises.get(t);return void 0===n&&(n={},n.promise=new Promise((t=>n.resolve=t)),this._whenDefinedPromises.set(t,n)),n.promise}_upgradeWhenDefined(t,e,n){let s=this._awaitingUpgrade.get(e);s||this._awaitingUpgrade.set(e,s=new Set),n?s.add(t):s.delete(t)}},window.HTMLElement=function(){let e=a;if(e)return a=void 0,e;const n=c.get(this.constructor);if(!n)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return e=Reflect.construct(t,[],n.standInClass),Object.setPrototypeOf(e,this.constructor.prototype),o.set(e,n),e},window.HTMLElement.prototype=t.prototype;const l=t=>t===document||t instanceof ShadowRoot,h=t=>{let e=t.getRootNode();if(!l(e)){const t=b[b.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),l(e)||(e=r.get(e)?.getRootNode()||document)}return e.customElements},d=e=>class{static get formAssociated(){return!0}constructor(){const n=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(n,HTMLElement.prototype);const s=h(n)||window.customElements,o=s._getDefinition(e);return o?m(n,o):i.set(n,s),n}connectedCallback(){const t=o.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):i.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=o.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):i.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){o.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=o.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=o.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=o.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=o.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},w=(t,e,n)=>{if(0===e.size||void 0===n)return;const s=t.prototype.setAttribute;s&&(t.prototype.setAttribute=function(t,o){const i=t.toLowerCase();if(e.has(i)){const t=this.getAttribute(i);s.call(this,i,o),n.call(this,i,t,o)}else s.call(this,i,o)});const o=t.prototype.removeAttribute;o&&(t.prototype.removeAttribute=function(t){const s=t.toLowerCase();if(e.has(s)){const t=this.getAttribute(s);o.call(this,s),n.call(this,s,t,null)}else o.call(this,s)})},u=e=>{const n=Object.getPrototypeOf(e);if(n!==window.HTMLElement)return n===t||"HTMLElement"===n?.prototype?.constructor?.name?Object.setPrototypeOf(e,window.HTMLElement):u(n)},m=(t,e,n=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),o.set(t,e),a=t;try{new e.elementClass}catch(t){u(e.elementClass),new e.elementClass}e.observedAttributes.forEach((n=>{t.hasAttribute(n)&&e.attributeChangedCallback.call(t,n,null,t.getAttribute(n))})),n&&e.connectedCallback&&t.isConnected&&e.connectedCallback.call(t)},f=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=f.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let b=[document];const E=(t,e,n)=>{const s=(n?Object.getPrototypeOf(n):t.prototype)[e];t.prototype[e]=function(){b.push(this);const t=s.apply(n||this,arguments);return void 0!==t&&r.set(t,this),b.pop(),t}};E(ShadowRoot,"createElement",document),E(ShadowRoot,"importNode",document),E(Element,"insertAdjacentHTML");const M=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...n,set(t){b.push(this),n.set.call(this,t),b.pop()}})};if(M(Element,"innerHTML"),M(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,e=HTMLElement.prototype.attachInternals,n=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...n){const s=e.call(this,...n);return t.set(s,this),s},n.forEach((e=>{const n=window.ElementInternals.prototype,s=n[e];n[e]=function(...e){const n=t.get(this);if(!0!==o.get(n).formAssociated)throw new DOMException(`Failed to execute ${s} on 'ElementInternals': The target element is not a form-associated custom element.`);s?.call(this,...e)}}));class s extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class i{constructor(t){const e=new Map;t.forEach(((t,n)=>{const s=t.getAttribute("name"),o=e.get(s)||[];this[+n]=t,o.push(t),e.set(s,o)})),this.length=t.length,e.forEach(((t,e)=>{t&&(1===t.length?this[e]=t[0]:this[e]=new s(t))}))}namedItem(t){return this[t]}}const c=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=c.get.call(this,[]),e=[];for(const n of t){const t=o.get(n);t&&!0!==t.formAssociated||e.push(n)}return new i(e)}})}}try{window.customElements.define("custom-element",null)}catch(t){const e=window.customElements.define;window.customElements.define=(t,n,s)=>{try{e.bind(window.customElements)(t,n,s)}catch(e){console.
|
|
17
|
+
if(!ShadowRoot.prototype.createElement){const t=window.HTMLElement,e=window.customElements.define,n=window.customElements.get,s=window.customElements,o=new WeakMap,i=new WeakMap,c=new WeakMap,r=new WeakMap;let a;window.CustomElementRegistry=class{constructor(){this._definitionsByTag=new Map,this._definitionsByClass=new Map,this._whenDefinedPromises=new Map,this._awaitingUpgrade=new Map}define(t,o){if(t=t.toLowerCase(),void 0!==this._getDefinition(t))throw new DOMException(`Failed to execute 'define' on 'CustomElementRegistry': the name "${t}" has already been used with this registry`);if(void 0!==this._definitionsByClass.get(o))throw new DOMException("Failed to execute 'define' on 'CustomElementRegistry': this constructor has already been used with this registry");const r=o.prototype.attributeChangedCallback,a=new Set(o.observedAttributes||[]);w(o,a,r);const l={elementClass:o,connectedCallback:o.prototype.connectedCallback,disconnectedCallback:o.prototype.disconnectedCallback,adoptedCallback:o.prototype.adoptedCallback,attributeChangedCallback:r,formAssociated:o.formAssociated,formAssociatedCallback:o.prototype.formAssociatedCallback,formDisabledCallback:o.prototype.formDisabledCallback,formResetCallback:o.prototype.formResetCallback,formStateRestoreCallback:o.prototype.formStateRestoreCallback,observedAttributes:a};this._definitionsByTag.set(t,l),this._definitionsByClass.set(o,l);let h=n.call(s,t);h||(h=d(t),e.call(s,t,h)),this===window.customElements&&(c.set(o,l),l.standInClass=h);const u=this._awaitingUpgrade.get(t);if(u){this._awaitingUpgrade.delete(t);for(const t of u)i.delete(t),m(t,l,!0)}const f=this._whenDefinedPromises.get(t);return void 0!==f&&(f.resolve(o),this._whenDefinedPromises.delete(t)),o}upgrade(){b.push(this),s.upgrade.apply(s,arguments),b.pop()}get(t){return this._definitionsByTag.get(t)?.elementClass}_getDefinition(t){return this._definitionsByTag.get(t)}whenDefined(t){const e=this._getDefinition(t);if(void 0!==e)return Promise.resolve(e.elementClass);let n=this._whenDefinedPromises.get(t);return void 0===n&&(n={},n.promise=new Promise((t=>n.resolve=t)),this._whenDefinedPromises.set(t,n)),n.promise}_upgradeWhenDefined(t,e,n){let s=this._awaitingUpgrade.get(e);s||this._awaitingUpgrade.set(e,s=new Set),n?s.add(t):s.delete(t)}},window.HTMLElement=function(){let e=a;if(e)return a=void 0,e;const n=c.get(this.constructor);if(!n)throw new TypeError("Illegal constructor (custom element class must be registered with global customElements registry to be newable)");return e=Reflect.construct(t,[],n.standInClass),Object.setPrototypeOf(e,this.constructor.prototype),o.set(e,n),e},window.HTMLElement.prototype=t.prototype;const l=t=>t===document||t instanceof ShadowRoot,h=t=>{let e=t.getRootNode();if(!l(e)){const t=b[b.length-1];if(t instanceof CustomElementRegistry)return t;e=t.getRootNode(),l(e)||(e=r.get(e)?.getRootNode()||document)}return e.customElements},d=e=>class{static get formAssociated(){return!0}constructor(){const n=Reflect.construct(t,[],this.constructor);Object.setPrototypeOf(n,HTMLElement.prototype);const s=h(n)||window.customElements,o=s._getDefinition(e);return o?m(n,o):i.set(n,s),n}connectedCallback(){const t=o.get(this);t?t.connectedCallback&&t.connectedCallback.apply(this,arguments):i.get(this)._upgradeWhenDefined(this,e,!0)}disconnectedCallback(){const t=o.get(this);t?t.disconnectedCallback&&t.disconnectedCallback.apply(this,arguments):i.get(this)._upgradeWhenDefined(this,e,!1)}adoptedCallback(){o.get(this)?.adoptedCallback?.apply(this,arguments)}formAssociatedCallback(){const t=o.get(this);t&&t.formAssociated&&t?.formAssociatedCallback?.apply(this,arguments)}formDisabledCallback(){const t=o.get(this);t?.formAssociated&&t?.formDisabledCallback?.apply(this,arguments)}formResetCallback(){const t=o.get(this);t?.formAssociated&&t?.formResetCallback?.apply(this,arguments)}formStateRestoreCallback(){const t=o.get(this);t?.formAssociated&&t?.formStateRestoreCallback?.apply(this,arguments)}},w=(t,e,n)=>{if(0===e.size||void 0===n)return;const s=t.prototype.setAttribute;s&&(t.prototype.setAttribute=function(t,o){const i=t.toLowerCase();if(e.has(i)){const t=this.getAttribute(i);s.call(this,i,o),n.call(this,i,t,o)}else s.call(this,i,o)});const o=t.prototype.removeAttribute;o&&(t.prototype.removeAttribute=function(t){const s=t.toLowerCase();if(e.has(s)){const t=this.getAttribute(s);o.call(this,s),n.call(this,s,t,null)}else o.call(this,s)})},u=e=>{const n=Object.getPrototypeOf(e);if(n!==window.HTMLElement)return n===t||"HTMLElement"===n?.prototype?.constructor?.name?Object.setPrototypeOf(e,window.HTMLElement):u(n)},m=(t,e,n=!1)=>{Object.setPrototypeOf(t,e.elementClass.prototype),o.set(t,e),a=t;try{new e.elementClass}catch(t){u(e.elementClass),new e.elementClass}e.observedAttributes.forEach((n=>{t.hasAttribute(n)&&e.attributeChangedCallback.call(t,n,null,t.getAttribute(n))})),n&&e.connectedCallback&&t.isConnected&&e.connectedCallback.call(t)},f=Element.prototype.attachShadow;Element.prototype.attachShadow=function(t){const e=f.apply(this,arguments);return t.customElements&&(e.customElements=t.customElements),e};let b=[document];const E=(t,e,n)=>{const s=(n?Object.getPrototypeOf(n):t.prototype)[e];t.prototype[e]=function(){b.push(this);const t=s.apply(n||this,arguments);return void 0!==t&&r.set(t,this),b.pop(),t}};E(ShadowRoot,"createElement",document),E(ShadowRoot,"importNode",document),E(Element,"insertAdjacentHTML");const M=(t,e)=>{const n=Object.getOwnPropertyDescriptor(t.prototype,e);Object.defineProperty(t.prototype,e,{...n,set(t){b.push(this),n.set.call(this,t),b.pop()}})};if(M(Element,"innerHTML"),M(ShadowRoot,"innerHTML"),Object.defineProperty(window,"customElements",{value:new CustomElementRegistry,configurable:!0,writable:!0}),window.ElementInternals&&window.ElementInternals.prototype.setFormValue){const t=new WeakMap,e=HTMLElement.prototype.attachInternals,n=["setFormValue","setValidity","checkValidity","reportValidity"];HTMLElement.prototype.attachInternals=function(...n){const s=e.call(this,...n);return t.set(s,this),s},n.forEach((e=>{const n=window.ElementInternals.prototype,s=n[e];n[e]=function(...e){const n=t.get(this);if(!0!==o.get(n).formAssociated)throw new DOMException(`Failed to execute ${s} on 'ElementInternals': The target element is not a form-associated custom element.`);s?.call(this,...e)}}));class s extends Array{constructor(t){super(...t),this._elements=t}get value(){return this._elements.find((t=>!0===t.checked))?.value||""}}class i{constructor(t){const e=new Map;t.forEach(((t,n)=>{const s=t.getAttribute("name"),o=e.get(s)||[];this[+n]=t,o.push(t),e.set(s,o)})),this.length=t.length,e.forEach(((t,e)=>{t&&(1===t.length?this[e]=t[0]:this[e]=new s(t))}))}namedItem(t){return this[t]}}const c=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get:function(){const t=c.get.call(this,[]),e=[];for(const n of t){const t=o.get(n);t&&!0!==t.formAssociated||e.push(n)}return new i(e)}})}}try{window.customElements.define("custom-element",null)}catch(t){const e=window.customElements.define;window.customElements.define=(t,n,s)=>{try{e.bind(window.customElements)(t,n,s)}catch(e){console.info(t,n,s,e)}}}}();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluid-topics/ft-wc-utils",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.21",
|
|
4
4
|
"description": "Internal web components tools",
|
|
5
5
|
"author": "Fluid Topics <devtopics@antidot.net>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
"@reduxjs/toolkit": "^1.6.2",
|
|
18
18
|
"lit": "2.2.8"
|
|
19
19
|
},
|
|
20
|
-
"gitHead": "
|
|
20
|
+
"gitHead": "44d378afb4633e1b5a2be18fb6051968816e577a"
|
|
21
21
|
}
|