@rededor/cura 2.0.0-alpha.12 → 2.0.0-alpha.13
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/dist/cjs/{cura-accordion_21.cjs.entry.js → cura-accordion_22.cjs.entry.js} +6872 -0
- package/dist/cjs/cura.cjs.js +1 -1
- package/dist/cjs/index.cjs.js +1140 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/cura-calendar/cura-calendar.css +27 -0
- package/dist/collection/components/cura-calendar/cura-calendar.js +65 -2
- package/dist/collection/components/cura-calendar/cura-calendar.stories.js +10 -0
- package/dist/collection/index.js +2 -0
- package/dist/components/cura-calendar.js +1 -1
- package/dist/components/cura-input-date.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-CpmZ68rD.js → p-C05r6CQV.js} +1 -1
- package/dist/cura/cura.esm.js +1 -1
- package/dist/cura/index.esm.js +1 -1
- package/dist/cura/p-47fdb124.entry.js +1 -0
- package/dist/esm/{cura-accordion_21.entry.js → cura-accordion_22.entry.js} +6872 -1
- package/dist/esm/cura.js +1 -1
- package/dist/esm/index.js +1140 -0
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/cura-calendar/cura-calendar.d.ts +11 -0
- package/dist/types/components/cura-calendar/cura-calendar.stories.d.ts +11 -0
- package/dist/types/components.d.ts +13 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +2 -2
- package/dist/cjs/cura-calendar.cjs.entry.js +0 -6840
- package/dist/cura/p-27ba7ef5.entry.js +0 -1
- package/dist/cura/p-54624944.entry.js +0 -1
- package/dist/esm/cura-calendar.entry.js +0 -6838
package/dist/cura/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as o}from"./p-DQopj-k5.js";import"./p-BTIDzOyO.js";import"./p-DfJS7YqS.js";function p(o,p=window){p.CuraInit=o}function n(p){return(new o).loadVarsSSR(p)}export{p as CuraInit,n as InitVarsTheme}
|
|
1
|
+
import{C as e}from"./p-DQopj-k5.js";import"./p-BTIDzOyO.js";import"./p-DfJS7YqS.js";const t=new WeakMap,a=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,m=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,w=(e,t,a)=>{e.getAttribute(t)!==a&&e.setAttribute(t,a)},y=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?w(e,"aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},b=e=>{i.get(e).forEach((e=>{e.remove()})),i.set(e,[])},E=(e,t)=>{const a=document.createElement("input");return a.type="hidden",a.name=e.getAttribute("name"),e.after(a),i.get(t).push(a),a},M=(e,t)=>{if(t.length){const a=Array.from(t);a.forEach((t=>t.addEventListener("click",e.click.bind(e))));const[i]=a;let n=i.id;i.id||(n=`${i.htmlFor}_Label`,i.id=n),w(e,"aria-labelledby",n)}},v=e=>{const t=Array.from(e.elements).filter((e=>!e.tagName.includes("-")&&e.validity)).map((e=>e.validity.valid)),a=l.get(e)||[],i=[...t,...Array.from(a).filter((e=>e.isConnected)).map((e=>n.get(e).validity.valid))].includes(!1);e.toggleAttribute("internals-invalid",i),e.toggleAttribute("internals-valid",!i)},T=e=>{v(k(e.target))},g=e=>{v(k(e.target))},x=e=>{const t=l.get(e.target);t&&t.size&&t.forEach((e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)}))},F=(e,t,a)=>{if(t){const i=l.get(t);if(i)i.add(e);else{const a=new Set;a.add(e),l.set(t,a),(e=>{const t=["button[type=submit]","input[type=submit]","button:not([type])"].map((e=>`${e}:not([disabled])`)).map((t=>`${t}:not([form])${e.id?`,${t}[form='${e.id}']`:""}`)).join(",");e.addEventListener("click",(a=>{if(a.target.closest(t)){const t=l.get(e);if(e.noValidate)return;t.size&&Array.from(t).reverse().map((e=>n.get(e).reportValidity())).includes(!1)&&a.preventDefault()}}))})(t),t.addEventListener("reset",x),t.addEventListener("input",T),t.addEventListener("change",g)}o.set(t,{ref:e,internals:a}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout((()=>{e.formAssociatedCallback.apply(e,[t])}),0),v(t)}},k=e=>{let t=e.parentNode;return t&&"FORM"!==t.tagName&&(t=k(t)),t},I=(e,t,a=DOMException)=>{if(!e.constructor.formAssociated)throw new a(t)},O=(e,t,a)=>{const i=l.get(e);return i&&i.size&&i.forEach((e=>{n.get(e)[a]()||(t=!1)})),t},V=e=>{let t=!1;if(e.constructor.formAssociated){let a=n.get(e);void 0===a&&(e.attachInternals(),a=n.get(e),t=!0);const{labels:i,form:r}=a;M(e,i),F(e,r,a)}return t};function L(){return"undefined"!=typeof MutationObserver}const H={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBrailleLabel:"aria-braillelabel",ariaBrailleRoleDescription:"aria-brailleroledescription",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"};function S(e){const t=n.get(e),{form:a}=t;F(e,a,t),M(e,t.labels)}const W=(e,t=!1)=>{const a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>n.has(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let i=a.nextNode();const r=!t||e.disabled;for(;i;)i.formDisabledCallback&&r&&y(i,e.disabled),i=a.nextNode()},C={attributes:!0,attributeFilter:["disabled","name"]},D=L()?new MutationObserver((e=>{for(const t of e){const e=t.target;if("disabled"===t.attributeName&&(e.constructor.formAssociated?y(e,e.hasAttribute("disabled")):"fieldset"===e.localName&&W(e)),"name"===t.attributeName&&e.constructor.formAssociated){const t=n.get(e),a=c.get(e);t.setFormValue(a)}}})):{};function j(e){e.forEach((e=>{const{addedNodes:t,removedNodes:a}=e,r=Array.from(t),o=Array.from(a);r.forEach((e=>{if(n.has(e)&&e.constructor.formAssociated&&S(e),d.has(e)){const t=d.get(e);Object.keys(H).filter((e=>null!==t[e])).forEach((a=>{w(e,H[a],t[a])})),d.delete(e)}if(p.has(e)){const t=p.get(e);w(e,"internals-valid",t.validity.valid.toString()),w(e,"internals-invalid",(!t.validity.valid).toString()),w(e,"aria-invalid",(!t.validity.valid).toString()),p.delete(e)}if("form"===e.localName){const t=l.get(e),a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>!n.has(e)||!e.constructor.formAssociated||t&&t.has(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT});let i=a.nextNode();for(;i;)S(i),i=a.nextNode()}"fieldset"===e.localName&&(D.observe?.(e,C),W(e,!0))})),o.forEach((e=>{const t=n.get(e);t&&i.get(t)&&b(t),s.has(e)&&s.get(e).disconnect()}))}))}function R(e){e.forEach((e=>{const{removedNodes:t}=e;t.forEach((t=>{const a=h.get(e.target);n.has(t)&&V(t),a.disconnect()}))}))}!L()||new MutationObserver(j);const $={childList:!0,subtree:!0};class N{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const A=new WeakMap;function P(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class q extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||-1===e.tagName.indexOf("-"))throw new TypeError("Illegal constructor");A.set(this,e)}add(e){if(!/^--/.test(e)||"string"!=typeof e)throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${e} must start with '--'.`);const t=super.add(e),a=A.get(this),i=`state${e}`;return a.isConnected?P(a,i):setTimeout((()=>{P(a,i)})),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){const t=super.delete(e),a=A.get(this);return a.isConnected?(a.toggleAttribute(`state${e}`,!1),a.part&&a.part.remove(`state${e}`)):setTimeout((()=>{a.toggleAttribute(`state${e}`,!1),a.part&&a.part.remove(`state${e}`)})),t}}var z,B=function(e,t,a,i){if("a"===a&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?i:"a"===a?i.call(e):i?i.value:t.get(e)};class J{constructor(e){z.set(this,void 0),function(e,t,a,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");"a"===i?n.call(e,a):n?n.value=a:t.set(e,a)}(this,z,e,"f");for(let t=0;t<e.length;t++){let a=e[t];this[t]=a,a.hasAttribute("name")&&(this[a.getAttribute("name")]=a)}Object.freeze(this)}get length(){return B(this,z,"f").length}[(z=new WeakMap,Symbol.iterator)](){return B(this,z,"f")[Symbol.iterator]()}item(e){return null==this[e]?null:this[e]}namedItem(e){return null==this[e]?null:this[e]}}class K{static get isPolyfilled(){return!0}constructor(e){if(!e||!e.tagName||-1===e.tagName.indexOf("-"))throw new TypeError("Illegal constructor");const r=e.getRootNode(),o=new N;this.states=new q(e),t.set(this,e),a.set(this,o),n.set(e,this),((e,t)=>{for(let a in H){t[a]=null;let i=null;const n=H[a];Object.defineProperty(t,a,{get:()=>i,set(a){i=a,e.isConnected?w(e,n,a):d.set(e,t)}})}})(e,this),(e=>{i.set(this,[]),D.observe?.(e,C)})(e),Object.seal(this),r instanceof DocumentFragment&&(e=>{const t=new MutationObserver(R);window?.ShadyDOM?.inUse&&e.mode&&e.host&&(e=e.host),t.observe?.(e,{childList:!0}),h.set(e,t)})(r)}checkValidity(){const e=t.get(this);if(I(e,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const i=a.get(this);if(!i.valid){const t=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});e.dispatchEvent(t)}return i.valid}get form(){const e=t.get(this);let a;return I(e,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element."),!0===e.constructor.formAssociated&&(a=k(e)),a}get labels(){const e=t.get(this);I(e,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const a=e.getAttribute("id"),i=e.getRootNode();return i&&a?i.querySelectorAll(`[for="${a}"]`):[]}reportValidity(){const e=t.get(this);if(I(e,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const a=this.checkValidity(),i=m.get(this);if(i&&!e.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!a&&i&&(e.focus(),i.focus()),a}setFormValue(e){const a=t.get(this);I(a,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),b(this),null==e||e instanceof FormData?null!=e&&e instanceof FormData&&Array.from(e).reverse().forEach((([e,t])=>{if("string"==typeof t){const i=E(a,this);i.name=e,i.value=t}})):a.getAttribute("name")&&(E(a,this).value=e),c.set(a,e)}setValidity(e,i,n){const o=t.get(this);if(I(o,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!e)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");m.set(this,n);const s=a.get(this),l={};for(const t in e)l[t]=e[t];var c;0===Object.keys(l).length&&((c=s).badInput=!1,c.customError=!1,c.patternMismatch=!1,c.rangeOverflow=!1,c.rangeUnderflow=!1,c.stepMismatch=!1,c.tooLong=!1,c.tooShort=!1,c.typeMismatch=!1,c.valid=!0,c.valueMissing=!1);const d={...s,...l};delete d.valid;const{valid:u}=((e,t,a)=>(e.valid=(e=>{let t=!0;for(let a in e)"valid"!==a&&!1!==e[a]&&(t=!1);return t})(t),Object.keys(t).forEach((a=>e[a]=t[a])),a&&v(a),e))(s,d,this.form);if(!u&&!i)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");r.set(this,u?"":i),o.isConnected?(o.toggleAttribute("internals-invalid",!u),o.toggleAttribute("internals-valid",u),w(o,"aria-invalid",`${!u}`)):p.set(o,this)}get shadowRoot(){const e=t.get(this);return u.get(e)||null}get validationMessage(){const e=t.get(this);return I(e,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),r.get(this)}get validity(){const e=t.get(this);return I(e,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),a.get(this)}get willValidate(){const e=t.get(this);return I(e,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(e.matches(":disabled")||e.disabled||e.hasAttribute("disabled")||e.hasAttribute("readonly"))}}let Q=!1,U=!1;function Y(e){U||(U=!0,window.CustomStateSet=q,e&&(HTMLElement.prototype.attachInternals=function(...t){const a=e.call(this,t);return a.states=new q(this),a}))}function _(e,t=window){t.CuraInit=e}function G(t){return(new e).loadVarsSSR(t)}customElements.polyfillWrapFlushCallback||(function(){if("undefined"==typeof window||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);const a=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every((e=>e in a.internals))}()?"undefined"==typeof window||window.CustomStateSet||Y(HTMLElement.prototype.attachInternals):function(e=!0){let t=!1;if(!Q){if(Q=!0,"undefined"!=typeof window&&(window.ElementInternals=K),"undefined"!=typeof CustomElementRegistry){const a=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(e,i,n){if(i.formAssociated){const e=i.prototype.connectedCallback;i.prototype.connectedCallback=function(){f.has(this)||(f.set(this,!0),this.hasAttribute("disabled")&&y(this,!0)),null!=e&&e.apply(this),t=V(this)}}a.call(this,e,i,n)}}if("undefined"!=typeof HTMLElement&&(HTMLElement.prototype.attachInternals=function(){if(!this.tagName)return{};if(-1===this.tagName.indexOf("-"))throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.");if(n.has(this)&&!t)throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new K(this)}),"undefined"!=typeof Element){function i(...e){const t=r.apply(this,e);if(u.set(this,t),L()){const e=new MutationObserver(j);window.ShadyDOM?e.observe(this,$):e.observe(t,$),s.set(this,e)}return t}const r=Element.prototype.attachShadow;Element.prototype.attachShadow=i}L()&&"undefined"!=typeof document&&new MutationObserver(j).observe(document.documentElement,$),"undefined"!=typeof HTMLFormElement&&function(){const e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=function(...t){let a=e.apply(this,t);return O(this,a,"checkValidity")};const t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=function(...e){let a=t.apply(this,e);return O(this,a,"reportValidity")};const{get:a}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...e){const t=a.call(this,...e),i=Array.from(l.get(this)||[]);if(0===i.length)return t;const n=Array.from(t).concat(i).sort(((e,t)=>e.compareDocumentPosition?2&e.compareDocumentPosition(t)?1:-1:0));return new J(n)}})}(),(e||"undefined"!=typeof window&&!window.CustomStateSet)&&Y()}}(!1));export{_ as CuraInit,G as InitVarsTheme}
|