@cupra/ui-kit 2.0.0-canary.62 → 2.0.0-canary.63

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.
Files changed (82) hide show
  1. package/dist/cjs/components/ds-select/ds-select.cjs +4 -3
  2. package/dist/cjs/components/ds-slider/ds-slider.cjs +18 -18
  3. package/dist/cjs/components/ds-text-input/ds-text-input.cjs +3 -2
  4. package/dist/cjs/components/ds-textarea/ds-textarea.cjs +4 -3
  5. package/dist/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
  6. package/dist/cjs/mixins/inputStatesMixin.cjs +1 -1
  7. package/dist/cjs/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.cjs +2 -2
  8. package/dist/cjs/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.cjs +1 -1
  9. package/dist/cjs/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.cjs +5 -0
  10. package/dist/cjs/utils/IconsManager.cjs +1 -1
  11. package/dist/cjs/utils/PubSub.cjs +1 -1
  12. package/dist/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
  13. package/dist/cjs/utils/concurrencyLimit.cjs +1 -0
  14. package/dist/cjs/utils/cssWithTokens.cjs +1 -1
  15. package/dist/cjs/utils/htmlWithTokens.cjs +1 -1
  16. package/dist/esm/components/ds-select/ds-select.js +38 -32
  17. package/dist/esm/components/ds-slider/ds-slider.js +84 -67
  18. package/dist/esm/components/ds-text-input/ds-text-input.js +38 -30
  19. package/dist/esm/components/ds-textarea/ds-textarea.js +45 -37
  20. package/dist/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
  21. package/dist/esm/mixins/inputStatesMixin.js +4 -3
  22. package/dist/esm/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.js +17 -16
  23. package/dist/esm/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.js +4 -4
  24. package/dist/esm/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.js +30 -0
  25. package/dist/esm/utils/IconsManager.js +1 -1
  26. package/dist/esm/utils/PubSub.js +1 -1
  27. package/dist/esm/utils/StylesRegistry/StylesRegistry.js +8 -6
  28. package/dist/esm/utils/concurrencyLimit.js +32 -0
  29. package/dist/esm/utils/cssWithTokens.js +1 -1
  30. package/dist/esm/utils/htmlWithTokens.js +1 -1
  31. package/dist/types/components/ds-select/ds-select.d.ts +2 -0
  32. package/dist/types/components/ds-select/ds-select.types.d.ts +1 -0
  33. package/dist/types/components/ds-slider/ds-slider.d.ts +7 -2
  34. package/dist/types/components/ds-slider/ds-slider.types.d.ts +18 -3
  35. package/dist/types/components/ds-text-input/ds-text-input.d.ts +2 -0
  36. package/dist/types/components/ds-text-input/ds-text-input.types.d.ts +1 -0
  37. package/dist/types/components/ds-textarea/ds-textarea.d.ts +2 -0
  38. package/dist/types/components/ds-textarea/ds-textarea.types.d.ts +1 -0
  39. package/dist/types/mixins/inputStatesMixin.d.ts +1 -0
  40. package/dist/types/utils/concurrencyLimit.d.ts +4 -0
  41. package/dist/types/utils/concurrencyLimit.test.d.ts +1 -0
  42. package/dist-react/cjs/components/ds-select/ds-select.cjs +4 -3
  43. package/dist-react/cjs/components/ds-slider/ds-slider.cjs +18 -18
  44. package/dist-react/cjs/components/ds-text-input/ds-text-input.cjs +3 -2
  45. package/dist-react/cjs/components/ds-textarea/ds-textarea.cjs +4 -3
  46. package/dist-react/cjs/components/ds-theme-provider/ds-theme-provider.cjs +1 -1
  47. package/dist-react/cjs/mixins/inputStatesMixin.cjs +1 -1
  48. package/dist-react/cjs/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.cjs +2 -2
  49. package/dist-react/cjs/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.cjs +1 -1
  50. package/dist-react/cjs/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.cjs +5 -0
  51. package/dist-react/cjs/utils/IconsManager.cjs +1 -1
  52. package/dist-react/cjs/utils/PubSub.cjs +1 -1
  53. package/dist-react/cjs/utils/StylesRegistry/StylesRegistry.cjs +1 -1
  54. package/dist-react/cjs/utils/concurrencyLimit.cjs +1 -0
  55. package/dist-react/cjs/utils/cssWithTokens.cjs +1 -1
  56. package/dist-react/cjs/utils/htmlWithTokens.cjs +1 -1
  57. package/dist-react/esm/components/ds-select/ds-select.js +38 -32
  58. package/dist-react/esm/components/ds-slider/ds-slider.js +84 -67
  59. package/dist-react/esm/components/ds-text-input/ds-text-input.js +38 -30
  60. package/dist-react/esm/components/ds-textarea/ds-textarea.js +45 -37
  61. package/dist-react/esm/components/ds-theme-provider/ds-theme-provider.js +1 -1
  62. package/dist-react/esm/mixins/inputStatesMixin.js +4 -3
  63. package/dist-react/esm/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive-helpers.js +17 -16
  64. package/dist-react/esm/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directive.js +4 -4
  65. package/dist-react/esm/node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.js +30 -0
  66. package/dist-react/esm/utils/IconsManager.js +1 -1
  67. package/dist-react/esm/utils/PubSub.js +1 -1
  68. package/dist-react/esm/utils/StylesRegistry/StylesRegistry.js +8 -6
  69. package/dist-react/esm/utils/concurrencyLimit.js +32 -0
  70. package/dist-react/esm/utils/cssWithTokens.js +1 -1
  71. package/dist-react/esm/utils/htmlWithTokens.js +1 -1
  72. package/dist-react/types/components/ds-select/ds-select.d.ts +2 -0
  73. package/dist-react/types/components/ds-select/ds-select.types.d.ts +1 -0
  74. package/dist-react/types/components/ds-slider/ds-slider.d.ts +7 -2
  75. package/dist-react/types/components/ds-slider/ds-slider.types.d.ts +18 -3
  76. package/dist-react/types/components/ds-text-input/ds-text-input.d.ts +2 -0
  77. package/dist-react/types/components/ds-text-input/ds-text-input.types.d.ts +1 -0
  78. package/dist-react/types/components/ds-textarea/ds-textarea.d.ts +2 -0
  79. package/dist-react/types/components/ds-textarea/ds-textarea.types.d.ts +1 -0
  80. package/dist-react/types/mixins/inputStatesMixin.d.ts +1 -0
  81. package/dist-react/types/utils/concurrencyLimit.d.ts +4 -0
  82. package/package.json +1 -1
@@ -1,13 +1,14 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("../base/UiKitElement.cjs"),y=require("../../decorators/customUiKitElement.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const r=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const h=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),o=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),b=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs"),p=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.cjs"),u=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),S=require("./controllers/SelectKeyboardController.cjs"),O=require("./styles/common.styles.cjs");var f=Object.defineProperty,g=Object.getOwnPropertyDescriptor,n=(c,e,t,i)=>{for(var s=i>1?void 0:i?g(e,t):e,a=c.length-1,l;a>=0;a--)(l=c[a])&&(s=(i?l(e,t,s):l(s))||s);return i&&s&&f(e,t,s),s};exports.DsSelect=class extends m.UiKitElement{constructor(){super(...arguments),this.mode="light",this.size="medium",this.variant="primary",this._open=!1,this.nativeSelect=null,this.nativeLabel=null,this.nativeOptions=[],this.activeIndex=-1,this.hasForcedError=!1,this.handleMutations=e=>{e.forEach(t=>{t.type==="childList"&&this.syncNativeOptions()}),this.requestUpdate()},this.syncNativeOptions=()=>{this.nativeOptions=Array.from(this.nativeSelect.options)},this.handleOpen=()=>{this._open=!0,this.activeIndex=this.findSelectedOptionIndex(),this.focusDisplaySelect()},this.handleClose=()=>{this._open=!1},this.handleClickDisplaySelect=()=>{this._open?this.handleClose():this.handleOpen()},this.handleKeydown=e=>{this._open?S.SelectKeyboardController.handleKeydownWhenOpen(e,{commit:()=>this.commitSelection(),navigateNext:()=>this.advanceSelection(1),navigatePrev:()=>this.advanceSelection(-1),navigateFirst:()=>this.advanceToFirst(),navigateLast:()=>this.advanceToLast(),close:this.handleClose}):S.SelectKeyboardController.handleKeydownWhenClosed(e,{open:this.handleOpen})}}firstUpdated(){this.initializeNativeSelect()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}initializeNativeSelect(){var e,t;this.nativeSelect=(e=this.nativeSelects)==null?void 0:e[0],this.nativeLabel=(t=this.nativeLabels)==null?void 0:t[0],this.nativeSelect&&(this.syncNativeOptions(),this.setupNativeElementsAttributes(),this.setupEventListeners())}handleChangeForcedError(){var e;this.hasForcedError=((e=this.forcedError)==null?void 0:e.length)>0}setupNativeElementsAttributes(){this.nativeSelect.setAttribute("aria-hidden","true"),this.nativeSelect.setAttribute("tabindex","-1")}setupEventListeners(){this.nativeSelect.addEventListener("change",this.syncNativeOptions),this.observer=new MutationObserver(this.handleMutations),this.observer.observe(this.nativeSelect,{childList:!0,subtree:!0,attributes:!0})}cleanup(){var e,t;(e=this.nativeSelect)==null||e.removeEventListener("change",this.syncNativeOptions),(t=this.observer)==null||t.disconnect()}findSelectedOptionIndex(){var t;const e=this.nativeOptions.findIndex(i=>i.value===this.nativeSelect.value);return(t=this.nativeOptions[e])!=null&&t.hidden?this.nativeOptions.findIndex(i=>!i.hidden):e}focusDisplaySelect(){this.updateComplete.then(()=>{var e;(e=this.displaySelect)==null||e.focus()})}advanceToFirst(){if(this.nativeOptions.length){const t=this.nativeOptions.findIndex(i=>!i.hidden);this.advanceSelection(t-this.activeIndex)}}advanceToLast(){if(this.nativeOptions.length){let t=-1;for(let i=this.nativeOptions.length-1;i>=0;i--)if(!this.nativeOptions[i].hidden){t=i;break}this.advanceSelection(t-this.activeIndex)}}advanceSelection(e){const t=this.nativeOptions.length;this.activeIndex=(this.activeIndex+e+t)%t,this.shouldSkipHiddenOption()?this.advanceSelection(Math.sign(e)):this.scrollToActive(this.nativeOptions[this.activeIndex])}shouldSkipHiddenOption(){return this.nativeOptions.some(t=>!t.hidden)&&this.nativeOptions[this.activeIndex].hidden}scrollToActive(e){var t;(t=e==null?void 0:e.scrollIntoView)==null||t.call(e,{block:"nearest"})}commitSelection(){this.handleClose();const e=this.nativeOptions[this.activeIndex];this.nativeSelect&&(e!=null&&e.value)&&this.updateNativeSelectValue(e.value)}updateNativeSelectValue(e){this.nativeSelect.value=e,["input","change"].forEach(t=>this.nativeSelect.dispatchEvent(new Event(t,{bubbles:!0,composed:!0})))}get containerClasses(){var e,t,i,s;return{container:!0,open:this._open,disabled:!!((e=this.nativeSelect)!=null&&e.disabled),filled:!!((i=(t=this.nativeOptions)==null?void 0:t.find(a=>a.selected&&!a.hidden))!=null&&i.selected),invalid:!((s=this.nativeSelect)!=null&&s.validity.valid),error:this.hasForcedError,[this.size]:!!this.size,[this.mode]:!!this.mode,[this.variant]:!!this.variant}}set open(e){this._open=e}get open(){return this._open}render(){return r.html`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("../base/UiKitElement.cjs"),m=require("../../decorators/customUiKitElement.cjs"),b=require("../../utils/booleanConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const r=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const c=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),o=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),O=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs"),p=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.cjs"),u=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),S=require("./controllers/SelectKeyboardController.cjs"),f=require("./styles/common.styles.cjs");var g=Object.defineProperty,C=Object.getOwnPropertyDescriptor,n=(d,e,t,i)=>{for(var s=i>1?void 0:i?C(e,t):e,a=d.length-1,l;a>=0;a--)(l=d[a])&&(s=(i?l(e,t,s):l(s))||s);return i&&s&&g(e,t,s),s};exports.DsSelect=class extends y.UiKitElement{constructor(){super(...arguments),this.mode="light",this.size="medium",this.variant="primary",this.readonly=!1,this._open=!1,this.nativeSelect=null,this.nativeLabel=null,this.nativeOptions=[],this.activeIndex=-1,this.hasForcedError=!1,this.handleMutations=e=>{e.forEach(t=>{t.type==="childList"&&this.syncNativeOptions()}),this.requestUpdate()},this.syncNativeOptions=()=>{this.nativeOptions=Array.from(this.nativeSelect.options)},this.handleOpen=()=>{this.readonly||(this._open=!0,this.activeIndex=this.findSelectedOptionIndex(),this.focusDisplaySelect())},this.handleClose=()=>{this._open=!1},this.handleClickDisplaySelect=()=>{this._open?this.handleClose():this.handleOpen()},this.handleKeydown=e=>{this._open?S.SelectKeyboardController.handleKeydownWhenOpen(e,{commit:()=>this.commitSelection(),navigateNext:()=>this.advanceSelection(1),navigatePrev:()=>this.advanceSelection(-1),navigateFirst:()=>this.advanceToFirst(),navigateLast:()=>this.advanceToLast(),close:this.handleClose}):S.SelectKeyboardController.handleKeydownWhenClosed(e,{open:this.handleOpen})}}firstUpdated(){this.initializeNativeSelect()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}initializeNativeSelect(){var e,t;this.nativeSelect=(e=this.nativeSelects)==null?void 0:e[0],this.nativeLabel=(t=this.nativeLabels)==null?void 0:t[0],this.nativeSelect&&(this.syncNativeOptions(),this.setupNativeElementsAttributes(),this.setupEventListeners())}handleChangeForcedError(){var e;this.hasForcedError=((e=this.forcedError)==null?void 0:e.length)>0}setupNativeElementsAttributes(){this.nativeSelect.setAttribute("aria-hidden","true"),this.nativeSelect.setAttribute("tabindex","-1")}setupEventListeners(){this.nativeSelect.addEventListener("change",this.syncNativeOptions),this.observer=new MutationObserver(this.handleMutations),this.observer.observe(this.nativeSelect,{childList:!0,subtree:!0,attributes:!0})}cleanup(){var e,t;(e=this.nativeSelect)==null||e.removeEventListener("change",this.syncNativeOptions),(t=this.observer)==null||t.disconnect()}findSelectedOptionIndex(){var t;const e=this.nativeOptions.findIndex(i=>i.value===this.nativeSelect.value);return(t=this.nativeOptions[e])!=null&&t.hidden?this.nativeOptions.findIndex(i=>!i.hidden):e}focusDisplaySelect(){this.updateComplete.then(()=>{var e;(e=this.displaySelect)==null||e.focus()})}advanceToFirst(){if(this.nativeOptions.length){const t=this.nativeOptions.findIndex(i=>!i.hidden);this.advanceSelection(t-this.activeIndex)}}advanceToLast(){if(this.nativeOptions.length){let t=-1;for(let i=this.nativeOptions.length-1;i>=0;i--)if(!this.nativeOptions[i].hidden){t=i;break}this.advanceSelection(t-this.activeIndex)}}advanceSelection(e){const t=this.nativeOptions.length;this.activeIndex=(this.activeIndex+e+t)%t,this.shouldSkipHiddenOption()?this.advanceSelection(Math.sign(e)):this.scrollToActive(this.nativeOptions[this.activeIndex])}shouldSkipHiddenOption(){return this.nativeOptions.some(t=>!t.hidden)&&this.nativeOptions[this.activeIndex].hidden}scrollToActive(e){var t;(t=e==null?void 0:e.scrollIntoView)==null||t.call(e,{block:"nearest"})}commitSelection(){this.handleClose();const e=this.nativeOptions[this.activeIndex];this.nativeSelect&&(e!=null&&e.value)&&this.updateNativeSelectValue(e.value)}updateNativeSelectValue(e){this.nativeSelect.value=e,["input","change"].forEach(t=>this.nativeSelect.dispatchEvent(new Event(t,{bubbles:!0,composed:!0})))}get containerClasses(){var e,t,i,s;return{container:!0,open:this._open,disabled:!!((e=this.nativeSelect)!=null&&e.disabled),readonly:!!this.readonly,filled:!!((i=(t=this.nativeOptions)==null?void 0:t.find(a=>a.selected&&!a.hidden))!=null&&i.selected),invalid:!((s=this.nativeSelect)!=null&&s.validity.valid),error:this.hasForcedError,[this.size]:!!this.size,[this.mode]:!!this.mode,[this.variant]:!!this.variant}}set open(e){this._open=e}get open(){return this._open}render(){return r.html`
2
2
  <slot @slotchange=${this.initializeNativeSelect}></slot>
3
3
  <div class=${u.classMap(this.containerClasses)}>
4
4
  ${this.displaySelectTemplate}
5
5
  ${this.optionsContainerTemplate}
6
6
  <slot name="helper-text"></slot>
7
+ <slot name="readonly-text"></slot>
7
8
  <slot name="forced-error" @slotchange=${this.handleChangeForcedError}></slot>
8
9
  <slot name="invalid-error"></slot>
9
10
  </div>
10
- `}get iconTemplate(){return this.componentFactory.createIcon({class:"icon","icon-name":this._open?"arrow-up":"arrow-down"})}get displaySelectTemplate(){var i,s,a;const e=this.nativeOptions.find(l=>l.selected),t=(i=Array.from((e==null?void 0:e.childNodes)||[]))==null?void 0:i.map(l=>{const v=l.cloneNode(!0);if(l.nodeType!==3)return v;if(l.textContent.trim()==="")return"";const d=document.createElement("span");return d.classList.add("text"),d.appendChild(v),d});return r.html`
11
+ `}get iconTemplate(){return this.componentFactory.createIcon({class:"icon","icon-name":this._open?"arrow-up":"arrow-down"})}get displaySelectTemplate(){var i,s,a;const e=this.nativeOptions.find(l=>l.selected),t=(i=Array.from((e==null?void 0:e.childNodes)||[]))==null?void 0:i.map(l=>{const v=l.cloneNode(!0);if(l.nodeType!==3)return v;if(l.textContent.trim()==="")return"";const h=document.createElement("span");return h.classList.add("text"),h.appendChild(v),h});return r.html`
11
12
  <div class="select-outline">
12
13
  <div class="select-container">
13
14
  <label id="display-label" class="label">${(s=this.nativeLabel)==null?void 0:s.innerText}</label>
@@ -44,4 +45,4 @@
44
45
  >
45
46
  ${i}
46
47
  </div>
47
- `}};exports.DsSelect.styles=[O.commonStyles];exports.DsSelect.ARIA_OPTION_PREFIX="option-";n([h.property({type:String})],exports.DsSelect.prototype,"mode",2);n([h.property({type:String})],exports.DsSelect.prototype,"size",2);n([h.property({type:String})],exports.DsSelect.prototype,"variant",2);n([o.state()],exports.DsSelect.prototype,"_open",2);n([o.state()],exports.DsSelect.prototype,"nativeSelect",2);n([o.state()],exports.DsSelect.prototype,"nativeLabel",2);n([o.state()],exports.DsSelect.prototype,"nativeOptions",2);n([o.state()],exports.DsSelect.prototype,"activeIndex",2);n([o.state()],exports.DsSelect.prototype,"hasForcedError",2);n([p.queryAssignedElements({slot:"",selector:"select",flatten:!0})],exports.DsSelect.prototype,"nativeSelects",2);n([p.queryAssignedElements({slot:"",selector:"label",flatten:!0})],exports.DsSelect.prototype,"nativeLabels",2);n([p.queryAssignedElements({slot:"forced-error",flatten:!0})],exports.DsSelect.prototype,"forcedError",2);n([b.query(".select")],exports.DsSelect.prototype,"displaySelect",2);exports.DsSelect=n([y.customUiKitElement("ds-select")],exports.DsSelect);
48
+ `}};exports.DsSelect.styles=[f.commonStyles];exports.DsSelect.ARIA_OPTION_PREFIX="option-";n([c.property({type:String})],exports.DsSelect.prototype,"mode",2);n([c.property({type:String})],exports.DsSelect.prototype,"size",2);n([c.property({type:String})],exports.DsSelect.prototype,"variant",2);n([c.property({type:Boolean,converter:b.booleanConverter,reflect:!0})],exports.DsSelect.prototype,"readonly",2);n([o.state()],exports.DsSelect.prototype,"_open",2);n([o.state()],exports.DsSelect.prototype,"nativeSelect",2);n([o.state()],exports.DsSelect.prototype,"nativeLabel",2);n([o.state()],exports.DsSelect.prototype,"nativeOptions",2);n([o.state()],exports.DsSelect.prototype,"activeIndex",2);n([o.state()],exports.DsSelect.prototype,"hasForcedError",2);n([p.queryAssignedElements({slot:"",selector:"select",flatten:!0})],exports.DsSelect.prototype,"nativeSelects",2);n([p.queryAssignedElements({slot:"",selector:"label",flatten:!0})],exports.DsSelect.prototype,"nativeLabels",2);n([p.queryAssignedElements({slot:"forced-error",flatten:!0})],exports.DsSelect.prototype,"forcedError",2);n([O.query(".select")],exports.DsSelect.prototype,"displaySelect",2);exports.DsSelect=n([m.customUiKitElement("ds-select")],exports.DsSelect);
@@ -1,17 +1,17 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../base/UiKitElement.cjs"),c=require("./utils/getStepValue/getStepValue.cjs"),D=require("./utils/roundToDecimals/roundToDecimals.cjs"),V=require("../../decorators/customUiKitElement.cjs"),$=require("../../mixins/ViewportMixin.cjs"),T=require("../../utils/booleanConverter.cjs"),L=require("../../utils/formatNumber/formatNumber.cjs"),P=require("../../utils/htmlWithTokens.cjs"),k=require("../../utils/objectConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const o=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const a=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),m=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),E=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs"),q=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),d=require("./styles/common.styles.cjs");var F=Object.defineProperty,N=Object.getOwnPropertyDescriptor,n=(u,t,e,i)=>{for(var s=i>1?void 0:i?N(t,e):t,r=u.length-1,l;r>=0;r--)(l=u[r])&&(s=(i?l(t,e,s):l(s))||s);return i&&s&&F(t,e,s),s};exports.DsSlider=class extends $.ViewportMixin(w.UiKitElement){constructor(){super(...arguments),this.min=0,this.max=100,this.minLabel="",this.maxLabel="",this.step=1,this.initialValueMin=0,this.mode="light",this.locale=void 0,this.localeMatcher="lookup",this.useGrouping=!0,this.minimumIntegerDigits=1,this.minimumFractionDigits=0,this.maximumFractionDigits=3,this.size="medium",this.disabled=!1,this.keyboardMode=!1,this.getNewValue=t=>{const{width:e,left:i}=this.track.getBoundingClientRect(),s=t.type.indexOf("mouse")!==-1?t.clientX:t.touches[0].clientX,l=Math.min(Math.max(0,s-i),e)*100/e;return this.min+l*(this.max-this.min)/100},this.setActiveThumb=t=>{const e=this.getNewValue(t);typeof this.valueMax!="number"||e<=this.valueMin?this.activeThumb="min":e>=this.valueMax?this.activeThumb="max":e-this.valueMin<this.valueMax-e?this.activeThumb="min":this.activeThumb="max"},this.handleMouseMove=t=>{this.animationFrameRequest&&cancelAnimationFrame(this.animationFrameRequest),this.animationFrameRequest=requestAnimationFrame(()=>{const e=this.getNewValue(t),i=this.activeThumb??"min",{stepValue:s}=c.getStepValue({step:this.step,min:this.min,max:this.max,proposedValue:e,role:i,currentValues:{1:this.valueMin,...typeof this.valueMax=="number"?{2:this.valueMax}:{}}});this.handleChange({value:s,role:i})})},this.handleMouseDown=t=>{var e;this.disabled||((e=t==null?void 0:t.preventDefault)==null||e.call(t),this.setActiveThumb(t),this.handleMouseMove(t),window==null||window.addEventListener("mousemove",this.handleMouseMove),window==null||window.addEventListener("touchmove",this.handleMouseMove),window==null||window.addEventListener("pointerup",this.handlePointerUp))},this.handlePointerUp=()=>{window==null||window.removeEventListener("mousemove",this.handleMouseMove),window==null||window.removeEventListener("touchmove",this.handleMouseMove),window==null||window.removeEventListener("pointerup",this.handlePointerUp)},this.handleKeydown=()=>{this.keyboardMode=!0},this.handlePointerOrMouseDown=()=>{this.keyboardMode=!1},this.onInputFocus=(t,e)=>{const i=t.currentTarget,s=e===1?"min":"max";this.editingField=s,i.type="number",i.step=String(this.step??1);const r=s==="min"?this.valueMin:this.valueMax;i.value=String(r??""),this.keyboardMode&&i.classList.add("focus-visible")},this.commitInputValue=(t,e)=>{const i=t.currentTarget,s=e===1?"min":"max",{stepValue:r}=c.getStepValue({step:this.step,min:this.min,max:this.max,proposedValue:Number(i.value),role:s,currentValues:{1:this.valueMin,...typeof this.valueMax=="number"?{2:this.valueMax}:{}}});this.handleChange({value:r,role:s}),i.value=String(r)},this.onInputBlur=t=>{var i;this.editingField=void 0;const e=t.currentTarget;(i=e==null?void 0:e.classList)==null||i.remove("focus-visible")},this.onInputKeyDown=(t,e)=>{t.key==="Enter"&&(t.preventDefault(),this.commitInputValue(t,e))},this.onThumbKeyDown=(t,e)=>{if(!this.disabled&&(t.key==="ArrowLeft"||t.key==="ArrowRight")){t.preventDefault();const i=this.step??1,s=t.key==="ArrowLeft"?-i:i,r=e===1?"min":"max",p=(r==="min"?this.valueMin:this.valueMax)+s,{stepValue:y}=c.getStepValue({step:this.step,min:this.min,max:this.max,proposedValue:p,role:r,currentValues:{1:this.valueMin,...typeof this.valueMax=="number"?{2:this.valueMax}:{}}});this.handleChange({value:y,role:r})}}}disconnectedCallback(){super.disconnectedCallback(),window==null||window.removeEventListener("mousemove",this.handleMouseMove),window==null||window.removeEventListener("touchmove",this.handleMouseMove),window==null||window.removeEventListener("pointerup",this.handlePointerUp),window==null||window.removeEventListener("keydown",this.handleKeydown),window==null||window.removeEventListener("mousedown",this.handlePointerOrMouseDown),window==null||window.removeEventListener("pointerdown",this.handlePointerOrMouseDown)}firstUpdated(t){super.firstUpdated(t),window==null||window.addEventListener("keydown",this.handleKeydown),window==null||window.addEventListener("mousedown",this.handlePointerOrMouseDown),window==null||window.addEventListener("pointerdown",this.handlePointerOrMouseDown),["min","max"].forEach(i=>{const r=this[i==="min"?"initialValueMin":"initialValueMax"];if(typeof r!="number")return;const{stepValue:l}=c.getStepValue({step:this.step,min:this.min,max:this.max,proposedValue:r,role:i,currentValues:{1:this.valueMin,...typeof this.valueMax=="number"?{2:this.valueMax}:{}}});this[i==="min"?"valueMin":"valueMax"]!==l&&this.handleChange({value:l,role:i})})}getTrackPct(t){const e=this.max-this.min;return e===0?0:(t-this.min)/e*100}handleChange({value:t,role:e}){const i=D.roundToDecimals({value:t,fractionDigits:this.maximumFractionDigits}),s=e==="min"?"valueMin":"valueMax";this[s]!==i&&(this[s]=i,this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{role:e,value:i}})))}formatNumber(t){const e={value:t,locale:this.locale,...this.unitStyle&&{style:this.unitStyle},...this.currency&&{currency:this.currency},...this.unit&&{unit:this.unit},localeMatcher:this.localeMatcher,minimumIntegerDigits:this.minimumIntegerDigits,minimumFractionDigits:this.minimumFractionDigits,maximumFractionDigits:this.maximumFractionDigits,thousandSeparator:this.thousandSeparator,fractionSeparator:this.fractionSeparator,useGrouping:this.useGrouping};return L.formatNumber(e)}get rangeValuesTemplates(){const{formattedValue:t,unitSymbol:e,unitSymbolPosition:i}=this.formatNumber(this.min),s=this.unitSymbol??e,r=this.unitSymbolPosition??i,{formattedValue:l}=this.formatNumber(this.max);return o.html`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("../base/UiKitElement.cjs"),c=require("./utils/getStepValue/getStepValue.cjs"),D=require("./utils/roundToDecimals/roundToDecimals.cjs"),$=require("../../decorators/customUiKitElement.cjs"),V=require("../../mixins/ViewportMixin.cjs"),_=require("../../utils/booleanConverter.cjs"),T=require("../../utils/formatNumber/formatNumber.cjs"),L=require("../../utils/htmlWithTokens.cjs"),P=require("../../utils/objectConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const o=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const a=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),h=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),k=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.cjs"),q=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),E=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/live.cjs"),d=require("./styles/common.styles.cjs");var F=Object.defineProperty,C=Object.getOwnPropertyDescriptor,s=(u,t,e,i)=>{for(var n=i>1?void 0:i?C(t,e):t,r=u.length-1,l;r>=0;r--)(l=u[r])&&(n=(i?l(t,e,n):l(n))||n);return i&&n&&F(t,e,n),n};exports.DsSlider=class extends V.ViewportMixin(w.UiKitElement){constructor(){super(...arguments),this.min=0,this.max=100,this.minLabel="",this.maxLabel="",this.step=1,this.initialValueMin=0,this.mode="light",this.locale=void 0,this.localeMatcher="lookup",this.useGrouping=!0,this.minimumIntegerDigits=1,this.minimumFractionDigits=0,this.maximumFractionDigits=3,this.size="medium",this.disabled=!1,this.keyboardMode=!1,this.getNewValue=t=>{const{width:e,left:i}=this.track.getBoundingClientRect(),n=t.type.indexOf("mouse")!==-1?t.clientX:t.touches[0].clientX,l=Math.min(Math.max(0,n-i),e)*100/e;return this.min+l*(this.max-this.min)/100},this.setActiveThumb=t=>{const e=this.getNewValue(t);typeof this._valueMax!="number"||e<=this._valueMin?this.activeThumb="min":e>=this._valueMax?this.activeThumb="max":e-this._valueMin<this._valueMax-e?this.activeThumb="min":this.activeThumb="max"},this.handleMouseMove=t=>{this.animationFrameRequest&&cancelAnimationFrame(this.animationFrameRequest),this.animationFrameRequest=requestAnimationFrame(()=>{const e=this.getNewValue(t),i=this.activeThumb??"min",{stepValue:n}=c.getStepValue({step:this.step,min:this.min,max:this.max,proposedValue:e,role:i,currentValues:{1:this._valueMin,...typeof this._valueMax=="number"?{2:this._valueMax}:{}}});this.handleChange({value:n,role:i})})},this.handleMouseDown=t=>{var e;this.disabled||((e=t==null?void 0:t.preventDefault)==null||e.call(t),this.setActiveThumb(t),this.handleMouseMove(t),window==null||window.addEventListener("mousemove",this.handleMouseMove),window==null||window.addEventListener("touchmove",this.handleMouseMove),window==null||window.addEventListener("pointerup",this.handlePointerUp))},this.handlePointerUp=()=>{window==null||window.removeEventListener("mousemove",this.handleMouseMove),window==null||window.removeEventListener("touchmove",this.handleMouseMove),window==null||window.removeEventListener("pointerup",this.handlePointerUp)},this.handleKeydown=()=>{this.keyboardMode=!0},this.handlePointerOrMouseDown=()=>{this.keyboardMode=!1},this.onInputFocus=(t,e)=>{const i=t.currentTarget,n=e===1?"min":"max";this.editingField=n,i.type="number",i.step=String(this.step??1);const r=n==="min"?this._valueMin:this._valueMax;i.value=String(r??""),this.keyboardMode&&i.classList.add("focus-visible")},this.commitInputValue=(t,e)=>{const i=t.currentTarget,n=e===1?"min":"max",{stepValue:r}=c.getStepValue({step:this.step,min:this.min,max:this.max,proposedValue:Number(i.value),role:n,currentValues:{1:this._valueMin,...typeof this._valueMax=="number"?{2:this._valueMax}:{}}});this.handleChange({value:r,role:n}),this.isControlled(n)||(i.value=String(r))},this.onInputBlur=t=>{var i;this.editingField=void 0;const e=t.currentTarget;(i=e==null?void 0:e.classList)==null||i.remove("focus-visible")},this.onInputKeyDown=(t,e)=>{t.key==="Enter"&&(t.preventDefault(),this.commitInputValue(t,e))},this.onThumbKeyDown=(t,e)=>{if(!this.disabled&&(t.key==="ArrowLeft"||t.key==="ArrowRight")){t.preventDefault();const i=this.step??1,n=t.key==="ArrowLeft"?-i:i,r=e===1?"min":"max",p=(r==="min"?this._valueMin:this._valueMax)+n,{stepValue:y}=c.getStepValue({step:this.step,min:this.min,max:this.max,proposedValue:p,role:r,currentValues:{1:this._valueMin,...typeof this._valueMax=="number"?{2:this._valueMax}:{}}});this.handleChange({value:y,role:r})}}}get isRange(){return typeof this.initialValueMax=="number"||typeof this.valueMax=="number"}isControlled(t){return typeof(t==="min"?this.valueMin:this.valueMax)=="number"}willUpdate(t){super.willUpdate(t),typeof this.valueMin=="number"&&(this._valueMin=this.valueMin),typeof this.valueMax=="number"&&(this._valueMax=this.valueMax)}disconnectedCallback(){super.disconnectedCallback(),window==null||window.removeEventListener("mousemove",this.handleMouseMove),window==null||window.removeEventListener("touchmove",this.handleMouseMove),window==null||window.removeEventListener("pointerup",this.handlePointerUp),window==null||window.removeEventListener("keydown",this.handleKeydown),window==null||window.removeEventListener("mousedown",this.handlePointerOrMouseDown),window==null||window.removeEventListener("pointerdown",this.handlePointerOrMouseDown)}firstUpdated(t){super.firstUpdated(t),window==null||window.addEventListener("keydown",this.handleKeydown),window==null||window.addEventListener("mousedown",this.handlePointerOrMouseDown),window==null||window.addEventListener("pointerdown",this.handlePointerOrMouseDown),["min","max"].forEach(i=>{if(this.isControlled(i))return;const r=this[i==="min"?"initialValueMin":"initialValueMax"];if(typeof r!="number")return;const{stepValue:l}=c.getStepValue({step:this.step,min:this.min,max:this.max,proposedValue:r,role:i,currentValues:{1:this._valueMin,...typeof this._valueMax=="number"?{2:this._valueMax}:{}}});this[i==="min"?"_valueMin":"_valueMax"]!==l&&this.handleChange({value:l,role:i})})}getTrackPct(t){const e=this.max-this.min;return e===0?0:(t-this.min)/e*100}handleChange({value:t,role:e}){const i=D.roundToDecimals({value:t,fractionDigits:this.maximumFractionDigits}),n=e==="min"?"_valueMin":"_valueMax";this[n]!==i&&(this.isControlled(e)||(this[n]=i),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{role:e,value:i}})))}formatNumber(t){const e={value:t,locale:this.locale,...this.unitStyle&&{style:this.unitStyle},...this.currency&&{currency:this.currency},...this.unit&&{unit:this.unit},localeMatcher:this.localeMatcher,minimumIntegerDigits:this.minimumIntegerDigits,minimumFractionDigits:this.minimumFractionDigits,maximumFractionDigits:this.maximumFractionDigits,thousandSeparator:this.thousandSeparator,fractionSeparator:this.fractionSeparator,useGrouping:this.useGrouping};return T.formatNumber(e)}get rangeValuesTemplates(){const{formattedValue:t,unitSymbol:e,unitSymbolPosition:i}=this.formatNumber(this.min),n=this.unitSymbol??e,r=this.unitSymbolPosition??i,{formattedValue:l}=this.formatNumber(this.max);return o.html`
2
2
  <div class="range-value-text">
3
3
  ${this.minLabel?o.html`<span class="range-value-label">${this.minLabel}</span>`:o.nothing}
4
- ${r==="left"?o.html`<span>${s}</span>`:o.nothing}
4
+ ${r==="left"?o.html`<span>${n}</span>`:o.nothing}
5
5
  <span>${t}</span>
6
- ${r==="right"?o.html`<span>${s}</span>`:o.nothing}
6
+ ${r==="right"?o.html`<span>${n}</span>`:o.nothing}
7
7
  </div>
8
8
  <div class="range-value-text">
9
9
  ${this.maxLabel?o.html` <span class="range-value-label">${this.maxLabel}</span>`:o.nothing}
10
- ${r==="left"?o.html`<span>${s}</span>`:o.nothing}
10
+ ${r==="left"?o.html`<span>${n}</span>`:o.nothing}
11
11
  <span>${l}</span>
12
- ${r==="right"?o.html`<span>${s}</span>`:o.nothing}
12
+ ${r==="right"?o.html`<span>${n}</span>`:o.nothing}
13
13
  </div>
14
- `}getThumbTemplate(t){const e=t===1?"min":"max",i=e==="min"?this.valueMin:this.valueMax,{minLimit:s,maxLimit:r}=c.getStepValue({step:this.step,min:this.min,max:this.max,proposedValue:i,role:e,currentValues:{1:this.valueMin,...typeof this.valueMax=="number"?{2:this.valueMax}:{}}}),l=this.getTrackPct(i);return o.html`
14
+ `}getThumbTemplate(t){const e=t===1?"min":"max",i=e==="min"?this._valueMin:this._valueMax,{minLimit:n,maxLimit:r}=c.getStepValue({step:this.step,min:this.min,max:this.max,proposedValue:i,role:e,currentValues:{1:this._valueMin,...typeof this._valueMax=="number"?{2:this._valueMax}:{}}}),l=this.getTrackPct(i);return o.html`
15
15
  <style>
16
16
  .thumb${t} {
17
17
  left: ${l}%;
@@ -25,7 +25,7 @@
25
25
  tabindex=${this.disabled?-1:0}
26
26
  aria-disabled=${String(!!this.disabled)}
27
27
  aria-label=${t===1?"Minumum value":"Maximum Value"}
28
- aria-valuemin=${s}
28
+ aria-valuemin=${n}
29
29
  aria-valuemax=${r}
30
30
  aria-valuenow=${i}
31
31
  >
@@ -40,8 +40,8 @@
40
40
  </div>
41
41
  `}get thumbTemplates(){return o.html`
42
42
  ${this.getThumbTemplate(1)}
43
- ${typeof this.initialValueMax=="number"?this.getThumbTemplate(2):o.nothing}
44
- `}get trackRangeTemplate(){let t,e;return typeof this.initialValueMax!="number"?(t=0,e=this.getTrackPct(this.valueMin)):(t=this.getTrackPct(this.valueMin),e=this.getTrackPct(this.valueMax)-t),o.html`
43
+ ${this.isRange?this.getThumbTemplate(2):o.nothing}
44
+ `}get trackRangeTemplate(){let t,e;return this.isRange?(t=this.getTrackPct(this._valueMin),e=this.getTrackPct(this._valueMax)-t):(t=0,e=this.getTrackPct(this._valueMin)),o.html`
45
45
  <style>
46
46
  .track-range {
47
47
  left: ${t}%;
@@ -49,31 +49,31 @@
49
49
  }
50
50
  </style>
51
51
  <div class="track-range" role="presentation"></div>
52
- `}getInputTemplate(t){const e=t===1?"min":"max",i=this.editingField===e,s=e==="min"?this.valueMin:this.valueMax,{formattedValue:r,unitSymbol:l,unitSymbolPosition:p}=this.formatNumber(s),y=this.unitSymbolPosition??p,b=this.unitSymbol??l,g=b?y==="left"?`${b} ${r}`:`${r} ${b}`:`${r}`,S=i?"number":"text",v=i?String(s??""):g,M=t===1?this.inputMinAriaLabel:this.inputMaxAriaLabel,x=typeof this.initialValueMax=="number"?t===1?"Start value":"End value":"Value",f=M??x;return o.html`
52
+ `}getInputTemplate(t){const e=t===1?"min":"max",i=this.editingField===e,n=e==="min"?this._valueMin:this._valueMax,{formattedValue:r,unitSymbol:l,unitSymbolPosition:p}=this.formatNumber(n),y=this.unitSymbolPosition??p,b=this.unitSymbol??l,g=b?y==="left"?`${b} ${r}`:`${r} ${b}`:`${r}`,S=i?"number":"text",v=i?String(n??""):g,M=t===1?this.inputMinAriaLabel:this.inputMaxAriaLabel,f=this.isRange?t===1?"Start value":"End value":"Value",x=M??f;return o.html`
53
53
  <div class="input-wrapper">
54
54
  <input
55
55
  class="input-value input-value-${t}"
56
56
  type=${S}
57
- .value=${v}
57
+ .value=${E.live(v)}
58
58
  step=${String(this.step??1)}
59
59
  ?disabled=${this.disabled}
60
60
  tabindex=${this.disabled?-1:0}
61
61
  aria-disabled=${String(!!this.disabled)}
62
- aria-label=${f}
62
+ aria-label=${x}
63
63
  ?readonly=${this.disabled}
64
- @focus=${h=>this.onInputFocus(h,t)}
64
+ @focus=${m=>this.onInputFocus(m,t)}
65
65
  @blur=${this.onInputBlur}
66
- @change=${h=>this.commitInputValue(h,t)}
67
- @keydown=${h=>this.onInputKeyDown(h,t)}
66
+ @change=${m=>this.commitInputValue(m,t)}
67
+ @keydown=${m=>this.onInputKeyDown(m,t)}
68
68
  title=${v}
69
69
  />
70
70
  </div>
71
71
  `}get inputsTemplate(){return o.html`
72
72
  <div class="inputs-container">
73
73
  ${this.getInputTemplate(1)}
74
- ${typeof this.initialValueMax=="number"?this.getInputTemplate(2):o.nothing}
74
+ ${this.isRange?this.getInputTemplate(2):o.nothing}
75
75
  </div>
76
- `}get containerClasses(){var e;const t=typeof this.size=="string"?this.size:(e=this.size)==null?void 0:e[this.viewport];return{container:!0,[this.mode]:!!this.mode,[t]:!!t,disabled:!!this.disabled}}get styleTokens(){return P.htmlWithTokens`
76
+ `}get containerClasses(){var e;const t=typeof this.size=="string"?this.size:(e=this.size)==null?void 0:e[this.viewport];return{container:!0,[this.mode]:!!this.mode,[t]:!!t,disabled:!!this.disabled}}get styleTokens(){return L.htmlWithTokens`
77
77
  <style>
78
78
  :host{
79
79
  color-scheme: ${this.mode};
@@ -89,4 +89,4 @@
89
89
  <div class="range-value-container">${this.rangeValuesTemplates}</div>
90
90
  ${this.inputsTemplate}
91
91
  </div>
92
- `}};exports.DsSlider.styles=[d.commonStyles,d.trackStyles,d.thumbStyles,d.currentValueStyles,d.rangeValueStyles];n([a.property({type:Number})],exports.DsSlider.prototype,"min",2);n([a.property({type:Number})],exports.DsSlider.prototype,"max",2);n([a.property({type:String,attribute:"min-label"})],exports.DsSlider.prototype,"minLabel",2);n([a.property({type:String,attribute:"max-label"})],exports.DsSlider.prototype,"maxLabel",2);n([a.property({type:Number})],exports.DsSlider.prototype,"step",2);n([a.property({type:Number,attribute:"initial-value-min"})],exports.DsSlider.prototype,"initialValueMin",2);n([a.property({type:Number,attribute:"initial-value-max"})],exports.DsSlider.prototype,"initialValueMax",2);n([a.property({type:String,reflect:!0})],exports.DsSlider.prototype,"mode",2);n([a.property({type:String,attribute:"locale"})],exports.DsSlider.prototype,"locale",2);n([a.property({type:String,attribute:"locale-matcher"})],exports.DsSlider.prototype,"localeMatcher",2);n([a.property({type:String,attribute:"unit-symbol"})],exports.DsSlider.prototype,"unitSymbol",2);n([a.property({type:String,attribute:"unit-symbol-position"})],exports.DsSlider.prototype,"unitSymbolPosition",2);n([a.property({type:String,attribute:"unit-style"})],exports.DsSlider.prototype,"unitStyle",2);n([a.property({type:String,attribute:"currency"})],exports.DsSlider.prototype,"currency",2);n([a.property({type:String,attribute:"unit"})],exports.DsSlider.prototype,"unit",2);n([a.property({type:String,attribute:"use-grouping",converter:u=>u==="auto"?"auto":typeof u=="boolean"?u:u==="true"||u===""?!0:u!=="false"})],exports.DsSlider.prototype,"useGrouping",2);n([a.property({type:Number,attribute:"minimum-integer-digits"})],exports.DsSlider.prototype,"minimumIntegerDigits",2);n([a.property({type:Number,attribute:"minimum-fraction-digits"})],exports.DsSlider.prototype,"minimumFractionDigits",2);n([a.property({type:Number,attribute:"maximum-fraction-digits"})],exports.DsSlider.prototype,"maximumFractionDigits",2);n([a.property({type:String,attribute:"thousand-separator"})],exports.DsSlider.prototype,"thousandSeparator",2);n([a.property({type:String,attribute:"fraction-separator"})],exports.DsSlider.prototype,"fractionSeparator",2);n([a.property({type:String,converter:k.objectConverter})],exports.DsSlider.prototype,"size",2);n([a.property({type:Boolean,converter:T.booleanConverter})],exports.DsSlider.prototype,"disabled",2);n([a.property({type:String,attribute:"input-min-aria-label"})],exports.DsSlider.prototype,"inputMinAriaLabel",2);n([a.property({type:String,attribute:"input-max-aria-label"})],exports.DsSlider.prototype,"inputMaxAriaLabel",2);n([E.query(".track")],exports.DsSlider.prototype,"track",2);n([m.state()],exports.DsSlider.prototype,"valueMin",2);n([m.state()],exports.DsSlider.prototype,"valueMax",2);n([m.state()],exports.DsSlider.prototype,"activeThumb",2);n([m.state()],exports.DsSlider.prototype,"animationFrameRequest",2);n([m.state()],exports.DsSlider.prototype,"editingField",2);n([m.state()],exports.DsSlider.prototype,"keyboardMode",2);exports.DsSlider=n([V.customUiKitElement("ds-slider")],exports.DsSlider);
92
+ `}};exports.DsSlider.styles=[d.commonStyles,d.trackStyles,d.thumbStyles,d.currentValueStyles,d.rangeValueStyles];s([a.property({type:Number})],exports.DsSlider.prototype,"min",2);s([a.property({type:Number})],exports.DsSlider.prototype,"max",2);s([a.property({type:String,attribute:"min-label"})],exports.DsSlider.prototype,"minLabel",2);s([a.property({type:String,attribute:"max-label"})],exports.DsSlider.prototype,"maxLabel",2);s([a.property({type:Number})],exports.DsSlider.prototype,"step",2);s([a.property({type:Number,attribute:"initial-value-min"})],exports.DsSlider.prototype,"initialValueMin",2);s([a.property({type:Number,attribute:"initial-value-max"})],exports.DsSlider.prototype,"initialValueMax",2);s([a.property({type:Number,attribute:"value-min"})],exports.DsSlider.prototype,"valueMin",2);s([a.property({type:Number,attribute:"value-max"})],exports.DsSlider.prototype,"valueMax",2);s([a.property({type:String,reflect:!0})],exports.DsSlider.prototype,"mode",2);s([a.property({type:String,attribute:"locale"})],exports.DsSlider.prototype,"locale",2);s([a.property({type:String,attribute:"locale-matcher"})],exports.DsSlider.prototype,"localeMatcher",2);s([a.property({type:String,attribute:"unit-symbol"})],exports.DsSlider.prototype,"unitSymbol",2);s([a.property({type:String,attribute:"unit-symbol-position"})],exports.DsSlider.prototype,"unitSymbolPosition",2);s([a.property({type:String,attribute:"unit-style"})],exports.DsSlider.prototype,"unitStyle",2);s([a.property({type:String,attribute:"currency"})],exports.DsSlider.prototype,"currency",2);s([a.property({type:String,attribute:"unit"})],exports.DsSlider.prototype,"unit",2);s([a.property({type:String,attribute:"use-grouping",converter:u=>u==="auto"?"auto":typeof u=="boolean"?u:u==="true"||u===""?!0:u!=="false"})],exports.DsSlider.prototype,"useGrouping",2);s([a.property({type:Number,attribute:"minimum-integer-digits"})],exports.DsSlider.prototype,"minimumIntegerDigits",2);s([a.property({type:Number,attribute:"minimum-fraction-digits"})],exports.DsSlider.prototype,"minimumFractionDigits",2);s([a.property({type:Number,attribute:"maximum-fraction-digits"})],exports.DsSlider.prototype,"maximumFractionDigits",2);s([a.property({type:String,attribute:"thousand-separator"})],exports.DsSlider.prototype,"thousandSeparator",2);s([a.property({type:String,attribute:"fraction-separator"})],exports.DsSlider.prototype,"fractionSeparator",2);s([a.property({type:String,converter:P.objectConverter})],exports.DsSlider.prototype,"size",2);s([a.property({type:Boolean,converter:_.booleanConverter})],exports.DsSlider.prototype,"disabled",2);s([a.property({type:String,attribute:"input-min-aria-label"})],exports.DsSlider.prototype,"inputMinAriaLabel",2);s([a.property({type:String,attribute:"input-max-aria-label"})],exports.DsSlider.prototype,"inputMaxAriaLabel",2);s([k.query(".track")],exports.DsSlider.prototype,"track",2);s([h.state()],exports.DsSlider.prototype,"_valueMin",2);s([h.state()],exports.DsSlider.prototype,"_valueMax",2);s([h.state()],exports.DsSlider.prototype,"activeThumb",2);s([h.state()],exports.DsSlider.prototype,"animationFrameRequest",2);s([h.state()],exports.DsSlider.prototype,"editingField",2);s([h.state()],exports.DsSlider.prototype,"keyboardMode",2);exports.DsSlider=s([$.customUiKitElement("ds-slider")],exports.DsSlider);
@@ -1,14 +1,15 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),h=require("../../decorators/customUiKitElement.cjs"),c=require("../../mixins/inputStatesMixin.cjs"),d=require("../../utils/validateMaxLength.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const a=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),v=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),m=require("./styles/common.styles.cjs");var f=Object.defineProperty,x=Object.getOwnPropertyDescriptor,n=(o,t,s,e)=>{for(var r=e>1?void 0:e?x(t,s):t,p=o.length-1,l;p>=0;p--)(l=o[p])&&(r=(e?l(t,s,r):l(r))||r);return e&&r&&f(t,s,r),r};exports.DsTextInput=class extends c.inputStatesMixin(u.UiKitElement){constructor(){super(...arguments),this.keyboardMode=!1,this.size="medium",this.helperText="",this.forcedError="",this.invalidError="",this.dataAriaLabelRemoveButton="",this.handleClickIcon=()=>{this.nativeInput.value="",this.nativeInput.focus(),["input","change"].forEach(t=>this.nativeInput.dispatchEvent(new Event(t,{bubbles:!0,composed:!0})))}}get classes(){return{container:!0,error:!!this.forcedError,[this.size]:!!this.size,disabled:this.inputStates.disabled,filled:this.inputStates.filled,invalid:this.inputStates.invalid,focus:this.inputStates.focus,"focus-visible":this.inputStates.focusVisible}}render(){return i.html`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../base/UiKitElement.cjs"),h=require("../../decorators/customUiKitElement.cjs"),d=require("../../mixins/inputStatesMixin.cjs"),c=require("../../utils/validateMaxLength.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const e=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const a=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),v=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),m=require("./styles/common.styles.cjs");var y=Object.defineProperty,x=Object.getOwnPropertyDescriptor,s=(o,t,n,r)=>{for(var i=r>1?void 0:r?x(t,n):t,l=o.length-1,p;l>=0;l--)(p=o[l])&&(i=(r?p(t,n,i):p(i))||i);return r&&i&&y(t,n,i),i};exports.DsTextInput=class extends d.inputStatesMixin(u.UiKitElement){constructor(){super(...arguments),this.keyboardMode=!1,this.size="medium",this.helperText="",this.forcedError="",this.invalidError="",this.readonlyText="",this.dataAriaLabelRemoveButton="",this.handleClickIcon=()=>{this.nativeInput.value="",this.nativeInput.focus(),["input","change"].forEach(t=>this.nativeInput.dispatchEvent(new Event(t,{bubbles:!0,composed:!0})))}}get classes(){return{container:!0,error:!!this.forcedError,[this.size]:!!this.size,disabled:this.inputStates.disabled,readonly:this.inputStates.readonly,filled:this.inputStates.filled,invalid:this.inputStates.invalid,focus:this.inputStates.focus,"focus-visible":this.inputStates.focusVisible}}render(){return e.html`
2
2
  <div class=${v.classMap(this.classes)}>
3
3
  <div class="input-container">
4
4
  <div><slot></slot></div>
5
5
  ${this.iconTemplate}
6
6
  </div>
7
7
  <div class="footer">
8
+ ${this.readonlyTextTemplate}
8
9
  ${this.helperTextTemplate}
9
10
  ${this.forcedErrorTemplate}
10
11
  ${this.invalidErrorTemplate}
11
12
  ${this.lengthTemplate}
12
13
  </div>
13
14
  </div>
14
- `}get iconTemplate(){var t,s,e;return(s=(t=this.nativeInput)==null?void 0:t.value)!=null&&s.length?this.componentFactory.createIconButton({class:"icon-button","icon-name":"cross",size:this.size,disabled:!!((e=this.nativeInput)!=null&&e.disabled),variant:"naked","@click":this.handleClickIcon,"data-aria-label":this.dataAriaLabelRemoveButton||"remove button"}):i.nothing}get lengthTemplate(){var s,e,r;const t=(e=(s=this.nativeInput)==null?void 0:s.maxLength)==null?void 0:e.toString();return d.validateMaxLength(t)?i.html`<span class="char-counter">${((r=this.inputStates.currentValue)==null?void 0:r.length)||0}/${t}</span>`:i.nothing}get helperTextTemplate(){return this.forcedError||this.inputStates.invalid&&this.invalidError?i.nothing:i.html`<span class="support-text helper-text">${this.helperText}</span>`}get forcedErrorTemplate(){return this.forcedError?i.html`<span class="support-text error-text forced-error">${this.forcedError}</span>`:i.nothing}get invalidErrorTemplate(){return this.forcedError||!this.inputStates.invalid||!this.invalidError?i.nothing:i.html`<span class="support-text error-text invalid-error">${this.invalidError}</span>`}};exports.DsTextInput.styles=[m.commonStyles];n([a.property({type:String})],exports.DsTextInput.prototype,"size",2);n([a.property({type:String,attribute:"helper-text"})],exports.DsTextInput.prototype,"helperText",2);n([a.property({type:String,attribute:"forced-error"})],exports.DsTextInput.prototype,"forcedError",2);n([a.property({type:String,attribute:"invalid-error"})],exports.DsTextInput.prototype,"invalidError",2);n([a.property({type:String,attribute:"data-aria-label-remove-button"})],exports.DsTextInput.prototype,"dataAriaLabelRemoveButton",2);exports.DsTextInput=n([h.customUiKitElement("ds-text-input")],exports.DsTextInput);
15
+ `}get iconTemplate(){var t,n,r;return!((n=(t=this.nativeInput)==null?void 0:t.value)!=null&&n.length)||this.inputStates.readonly?e.nothing:this.componentFactory.createIconButton({class:"icon-button","icon-name":"cross",size:this.size,disabled:!!((r=this.nativeInput)!=null&&r.disabled),variant:"naked","@click":this.handleClickIcon,"data-aria-label":this.dataAriaLabelRemoveButton||"remove button"})}get lengthTemplate(){var n,r,i;const t=(r=(n=this.nativeInput)==null?void 0:n.maxLength)==null?void 0:r.toString();return c.validateMaxLength(t)?e.html`<span class="char-counter">${((i=this.inputStates.currentValue)==null?void 0:i.length)||0}/${t}</span>`:e.nothing}get helperTextTemplate(){return this.inputStates.readonly||this.forcedError||this.inputStates.invalid&&this.invalidError?e.nothing:e.html`<span class="support-text helper-text">${this.helperText}</span>`}get forcedErrorTemplate(){return this.inputStates.readonly||!this.forcedError?e.nothing:e.html`<span class="support-text error-text forced-error">${this.forcedError}</span>`}get readonlyTextTemplate(){return!this.inputStates.readonly||!this.readonlyText?e.nothing:e.html`<span class="support-text readonly-text">${this.readonlyText}</span>`}get invalidErrorTemplate(){return this.inputStates.readonly||this.forcedError||!this.inputStates.invalid||!this.invalidError?e.nothing:e.html`<span class="support-text error-text invalid-error">${this.invalidError}</span>`}};exports.DsTextInput.styles=[m.commonStyles];s([a.property({type:String})],exports.DsTextInput.prototype,"size",2);s([a.property({type:String,attribute:"helper-text"})],exports.DsTextInput.prototype,"helperText",2);s([a.property({type:String,attribute:"forced-error"})],exports.DsTextInput.prototype,"forcedError",2);s([a.property({type:String,attribute:"invalid-error"})],exports.DsTextInput.prototype,"invalidError",2);s([a.property({type:String,attribute:"readonly-text"})],exports.DsTextInput.prototype,"readonlyText",2);s([a.property({type:String,attribute:"data-aria-label-remove-button"})],exports.DsTextInput.prototype,"dataAriaLabelRemoveButton",2);exports.DsTextInput=s([h.customUiKitElement("ds-text-input")],exports.DsTextInput);
@@ -1,13 +1,14 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../base/UiKitElement.cjs"),u=require("../../decorators/customUiKitElement.cjs"),c=require("../../mixins/ViewportMixin.cjs"),d=require("../../mixins/inputStatesMixin.cjs"),m=require("../../utils/objectConverter.cjs"),v=require("../../utils/validateMaxLength.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const r=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const n=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),x=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),f=require("./styles/common.styles.cjs");var g=Object.defineProperty,y=Object.getOwnPropertyDescriptor,o=(a,t,s,i)=>{for(var e=i>1?void 0:i?y(t,s):t,l=a.length-1,p;l>=0;l--)(p=a[l])&&(e=(i?p(t,s,e):p(e))||e);return i&&e&&g(t,s,e),e};exports.DsTextarea=class extends d.inputStatesMixin(c.ViewportMixin(h.UiKitElement)){constructor(){super(...arguments),this.keyboardMode=!1,this.size="medium",this.helperText="",this.forcedError="",this.invalidError="",this.mode="light"}onInputReady(t){t.classList.add("ds-scroll")}get classes(){const t=typeof this.size=="string"?this.size:this.size[this.viewport];return{container:!0,error:!!this.forcedError,[t]:!!t,[this.mode]:!!this.mode,disabled:this.inputStates.disabled,filled:this.inputStates.filled,invalid:this.inputStates.invalid,focus:this.inputStates.focus,"focus-visible":this.inputStates.focusVisible}}render(){return r.html`
2
- <div class=${x.classMap(this.classes)}>
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("../base/UiKitElement.cjs"),u=require("../../decorators/customUiKitElement.cjs"),d=require("../../mixins/ViewportMixin.cjs"),c=require("../../mixins/inputStatesMixin.cjs"),x=require("../../utils/objectConverter.cjs"),y=require("../../utils/validateMaxLength.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const e=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),m=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.cjs"),v=require("./styles/common.styles.cjs");var T=Object.defineProperty,f=Object.getOwnPropertyDescriptor,s=(a,t,n,i)=>{for(var r=i>1?void 0:i?f(t,n):t,l=a.length-1,p;l>=0;l--)(p=a[l])&&(r=(i?p(t,n,r):p(r))||r);return i&&r&&T(t,n,r),r};exports.DsTextarea=class extends c.inputStatesMixin(d.ViewportMixin(h.UiKitElement)){constructor(){super(...arguments),this.keyboardMode=!1,this.size="medium",this.helperText="",this.forcedError="",this.invalidError="",this.readonlyText="",this.mode="light"}onInputReady(t){t.classList.add("ds-scroll")}get classes(){const t=typeof this.size=="string"?this.size:this.size[this.viewport];return{container:!0,error:!!this.forcedError,[t]:!!t,[this.mode]:!!this.mode,disabled:this.inputStates.disabled,readonly:this.inputStates.readonly,filled:this.inputStates.filled,invalid:this.inputStates.invalid,focus:this.inputStates.focus,"focus-visible":this.inputStates.focusVisible}}render(){return e.html`
2
+ <div class=${m.classMap(this.classes)}>
3
3
  <div class="input-container">
4
4
  <slot></slot>
5
5
  </div>
6
6
  <div class="footer">
7
+ ${this.readonlyTextTemplate}
7
8
  ${this.helperTextTemplate}
8
9
  ${this.forcedErrorTemplate}
9
10
  ${this.invalidErrorTemplate}
10
11
  ${this.lengthTemplate}
11
12
  </div>
12
13
  </div>
13
- `}get lengthTemplate(){var s,i,e;const t=(i=(s=this.nativeInput)==null?void 0:s.maxLength)==null?void 0:i.toString();return v.validateMaxLength(t)?r.html`<span class="char-counter">${((e=this.inputStates.currentValue)==null?void 0:e.length)||0}/${t}</span>`:r.nothing}get helperTextTemplate(){return this.forcedError||this.inputStates.invalid&&this.invalidError?r.nothing:r.html`<span class="support-text helper-text">${this.helperText}</span>`}get forcedErrorTemplate(){return this.forcedError?r.html`<span class="support-text error-text forced-error">${this.forcedError}</span>`:r.nothing}get invalidErrorTemplate(){return this.forcedError||!this.inputStates.invalid||!this.invalidError?r.nothing:r.html`<span class="support-text error-text invalid-error">${this.invalidError}</span>`}};exports.DsTextarea.styles=[f.commonStyles];o([n.property({type:String,converter:m.objectConverter})],exports.DsTextarea.prototype,"size",2);o([n.property({type:String,attribute:"helper-text"})],exports.DsTextarea.prototype,"helperText",2);o([n.property({type:String,attribute:"forced-error"})],exports.DsTextarea.prototype,"forcedError",2);o([n.property({type:String,attribute:"invalid-error"})],exports.DsTextarea.prototype,"invalidError",2);o([n.property({type:String})],exports.DsTextarea.prototype,"mode",2);exports.DsTextarea=o([u.customUiKitElement("ds-textarea")],exports.DsTextarea);
14
+ `}get lengthTemplate(){var n,i,r;const t=(i=(n=this.nativeInput)==null?void 0:n.maxLength)==null?void 0:i.toString();return y.validateMaxLength(t)?e.html`<span class="char-counter">${((r=this.inputStates.currentValue)==null?void 0:r.length)||0}/${t}</span>`:e.nothing}get helperTextTemplate(){return this.inputStates.readonly||this.forcedError||this.inputStates.invalid&&this.invalidError?e.nothing:e.html`<span class="support-text helper-text">${this.helperText}</span>`}get forcedErrorTemplate(){return this.inputStates.readonly||!this.forcedError?e.nothing:e.html`<span class="support-text error-text forced-error">${this.forcedError}</span>`}get readonlyTextTemplate(){return!this.inputStates.readonly||!this.readonlyText?e.nothing:e.html`<span class="support-text readonly-text">${this.readonlyText}</span>`}get invalidErrorTemplate(){return this.inputStates.readonly||this.forcedError||!this.inputStates.invalid||!this.invalidError?e.nothing:e.html`<span class="support-text error-text invalid-error">${this.invalidError}</span>`}};exports.DsTextarea.styles=[v.commonStyles];s([o.property({type:String,converter:x.objectConverter})],exports.DsTextarea.prototype,"size",2);s([o.property({type:String,attribute:"helper-text"})],exports.DsTextarea.prototype,"helperText",2);s([o.property({type:String,attribute:"forced-error"})],exports.DsTextarea.prototype,"forcedError",2);s([o.property({type:String,attribute:"invalid-error"})],exports.DsTextarea.prototype,"invalidError",2);s([o.property({type:String,attribute:"readonly-text"})],exports.DsTextarea.prototype,"readonlyText",2);s([o.property({type:String})],exports.DsTextarea.prototype,"mode",2);exports.DsTextarea=s([u.customUiKitElement("ds-textarea")],exports.DsTextarea);
@@ -1,4 +1,4 @@
1
1
  "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../../core/theme.constants.cjs"),p=require("../../decorators/customUiKitElement.cjs"),f=require("../../node_modules/.pnpm/@lit_context@1.1.6/node_modules/@lit/context/lib/decorators/provide.cjs"),y=require("../../utils/PubSub.cjs"),m=require("../../utils/booleanConverter.cjs");require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const l=require("../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs"),v=require("../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs"),h=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.cjs"),u=require("../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.cjs"),$=require("../../styles/source/shared/fonts-config.cjs"),T=require("./themeContext.cjs");var b=Object.defineProperty,P=Object.getOwnPropertyDescriptor,d=(a,e,s,o)=>{for(var t=o>1?void 0:o?P(e,s):e,r=a.length-1,n;r>=0;r--)(n=a[r])&&(t=(o?n(e,s,t):n(t))||t);return o&&t&&b(e,s,t),t};exports.DsThemeProvider=class extends v.LitElement{constructor(){super(...arguments),this.loadFonts=!0,this.loadStyles=!0,this.cssLoaded=!1,this.loadedFonts=new Set}updated(e){super.updated(e),e.has("theme")&&(y.pubSub.publish("theme",this.theme),sessionStorage==null||sessionStorage.setItem(c.THEME_STORAGE_KEY,this.theme),typeof FontFace<"u"&&(document!=null&&document.fonts)&&this.loadThemeFonts(),this.loadThemeStyles().then(()=>{this.cssLoaded=!0,this.dispatchEvent(new CustomEvent("ui-kit:ready",{bubbles:!0,composed:!0}))}))}loadThemeFonts(){var e;(e=$.fontsConfig[this.theme])==null||e.fonts.forEach(s=>{this.loadThemeFont(s)})}async loadThemeFont({weight:e,name:s,file:o}){if(!this.loadFonts)return Promise.resolve();const t=`${s}-${e}`;if(this.loadedFonts.has(t))return;const r=new FontFace(s,`url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff2') format('woff2'),
2
2
  url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.woff') format('woff'),
3
3
  url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.ttf') format('truetype'),
4
- url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.62",t=`https://ds-assets.cupra.com${o}/styles/${this.theme}/theme.css`;if(document.head.querySelector(`link[href="${t}"]`))e();else{const r=`ui-kit-theme-${o}`,n=document.getElementById(r),i=document.createElement("link");i.id=r,i.rel="stylesheet",i.href=t,i.onload=()=>e(),i.onerror=()=>s(new Error(`Failed to load theme CSS: ${t}`)),document.head.appendChild(i),n==null||n.remove()}}):Promise.resolve()}render(){return this.cssLoaded?l.html`<slot></slot>`:l.nothing}};d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-fonts"})],exports.DsThemeProvider.prototype,"loadFonts",2);d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-styles"})],exports.DsThemeProvider.prototype,"loadStyles",2);d([f.provide({context:T.themeContext}),h.property({type:String})],exports.DsThemeProvider.prototype,"theme",2);d([u.state()],exports.DsThemeProvider.prototype,"cssLoaded",2);d([u.state()],exports.DsThemeProvider.prototype,"loadedFonts",2);exports.DsThemeProvider=d([p.customUiKitElement("ds-theme-provider")],exports.DsThemeProvider);
4
+ url('https://ds-assets.cupra.com/fonts/${this.theme}/${o}.otf') format('opentype')`,{style:"normal",weight:e,display:"swap"});try{await r.load(),document.fonts.add(r),this.loadedFonts.add(t)}catch(n){console.error(`Error loading "${s}" font with "${e}" weight:`,n)}}loadThemeStyles(){return this.loadStyles?new Promise((e,s)=>{const o="/2.0.0-canary.63",t=`https://ds-assets.cupra.com${o}/styles/${this.theme}/theme.css`;if(document.head.querySelector(`link[href="${t}"]`))e();else{const r=`ui-kit-theme-${o}`,n=document.getElementById(r),i=document.createElement("link");i.id=r,i.rel="stylesheet",i.href=t,i.onload=()=>e(),i.onerror=()=>s(new Error(`Failed to load theme CSS: ${t}`)),document.head.appendChild(i),n==null||n.remove()}}):Promise.resolve()}render(){return this.cssLoaded?l.html`<slot></slot>`:l.nothing}};d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-fonts"})],exports.DsThemeProvider.prototype,"loadFonts",2);d([h.property({type:Boolean,converter:m.booleanConverter,attribute:"load-styles"})],exports.DsThemeProvider.prototype,"loadStyles",2);d([f.provide({context:T.themeContext}),h.property({type:String})],exports.DsThemeProvider.prototype,"theme",2);d([u.state()],exports.DsThemeProvider.prototype,"cssLoaded",2);d([u.state()],exports.DsThemeProvider.prototype,"loadedFonts",2);exports.DsThemeProvider=d([p.customUiKitElement("ds-theme-provider")],exports.DsThemeProvider);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=u=>class extends u{constructor(){super(...arguments),this.inputStates={currentValue:"",focus:!1,focusVisible:!1,invalid:!1,filled:!1,disabled:!1},this.keyboardMode=!1,this._updateStates=()=>{var t,e,s,i,n;this.inputStates.currentValue=(t=this.nativeInput)==null?void 0:t.value,this.inputStates.invalid=!((e=this.nativeInput)!=null&&e.validity.valid),this.inputStates.focus=document.activeElement===this.nativeInput,this.inputStates.disabled=(s=this.nativeInput)==null?void 0:s.disabled,this.inputStates.filled=((n=(i=this.nativeInput)==null?void 0:i.value)==null?void 0:n.length)>0,this.requestUpdate()},this._handleKeydown=()=>{this.keyboardMode=!0},this._handleMousedown=()=>{this.keyboardMode=!1},this._handlePointerdown=()=>{this.keyboardMode=!1},this._handleFocusIn=t=>{t.target===this.nativeInput&&(this.inputStates.focus=!0,this.inputStates.focusVisible=!!this.keyboardMode,this.requestUpdate())},this._handleFocusOut=()=>{this.inputStates.focus=!1,this.inputStates.focusVisible=!1,this.requestUpdate()}}onInputReady(t){}firstUpdated(t){super.firstUpdated(t),window==null||window.addEventListener("keydown",this._handleKeydown),window==null||window.addEventListener("mousedown",this._handleMousedown),window==null||window.addEventListener("pointerdown",this._handlePointerdown);const e=()=>{var i,n,a;const s=this.querySelector("input")||this.querySelector("textarea")||((i=this.shadowRoot)==null?void 0:i.querySelector("input"))||((n=this.shadowRoot)==null?void 0:n.querySelector("textarea"));s&&(this.nativeInput=s,this._setupInputObservers(),this.onInputReady(s),(a=this.hostMutationObserver)==null||a.disconnect())};e(),this.hostMutationObserver=new MutationObserver(e),this.hostMutationObserver.observe(this,{childList:!0,subtree:!0,attributes:!0})}_setupInputObservers(){this.nativeInput.addEventListener("input",this._updateStates),this.nativeInput.addEventListener("focusin",this._handleFocusIn),this.nativeInput.addEventListener("focusout",this._handleFocusOut),this.inputMutationObserver=new MutationObserver(this._updateStates),this.inputMutationObserver.observe(this.nativeInput,{attributes:!0}),this._updateStates()}disconnectedCallback(){var t,e;super.disconnectedCallback(),window==null||window.removeEventListener("keydown",this._handleKeydown),window==null||window.removeEventListener("mousedown",this._handleMousedown),window==null||window.removeEventListener("pointerdown",this._handlePointerdown),(t=this.hostMutationObserver)==null||t.disconnect(),(e=this.inputMutationObserver)==null||e.disconnect(),this.nativeInput&&(this.nativeInput.removeEventListener("input",this._updateStates),this.nativeInput.removeEventListener("focusin",this._handleFocusIn),this.nativeInput.removeEventListener("focusout",this._handleFocusOut))}};exports.inputStatesMixin=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=u=>class extends u{constructor(){super(...arguments),this.inputStates={currentValue:"",focus:!1,focusVisible:!1,invalid:!1,filled:!1,disabled:!1,readonly:!1},this.keyboardMode=!1,this._updateStates=()=>{var t,e,s,i,n,a;this.inputStates.currentValue=(t=this.nativeInput)==null?void 0:t.value,this.inputStates.invalid=!((e=this.nativeInput)!=null&&e.validity.valid),this.inputStates.focus=document.activeElement===this.nativeInput,this.inputStates.disabled=(s=this.nativeInput)==null?void 0:s.disabled,this.inputStates.readonly=((i=this.nativeInput)==null?void 0:i.readOnly)??!1,this.inputStates.filled=((a=(n=this.nativeInput)==null?void 0:n.value)==null?void 0:a.length)>0,this.requestUpdate()},this._handleKeydown=()=>{this.keyboardMode=!0},this._handleMousedown=()=>{this.keyboardMode=!1},this._handlePointerdown=()=>{this.keyboardMode=!1},this._handleFocusIn=t=>{t.target===this.nativeInput&&(this.inputStates.focus=!0,this.inputStates.focusVisible=!!this.keyboardMode,this.requestUpdate())},this._handleFocusOut=()=>{this.inputStates.focus=!1,this.inputStates.focusVisible=!1,this.requestUpdate()}}onInputReady(t){}firstUpdated(t){super.firstUpdated(t),window==null||window.addEventListener("keydown",this._handleKeydown),window==null||window.addEventListener("mousedown",this._handleMousedown),window==null||window.addEventListener("pointerdown",this._handlePointerdown);const e=()=>{var i,n,a;const s=this.querySelector("input")||this.querySelector("textarea")||((i=this.shadowRoot)==null?void 0:i.querySelector("input"))||((n=this.shadowRoot)==null?void 0:n.querySelector("textarea"));s&&(this.nativeInput=s,this._setupInputObservers(),this.onInputReady(s),(a=this.hostMutationObserver)==null||a.disconnect())};e(),this.hostMutationObserver=new MutationObserver(e),this.hostMutationObserver.observe(this,{childList:!0,subtree:!0,attributes:!0})}_setupInputObservers(){this.nativeInput.addEventListener("input",this._updateStates),this.nativeInput.addEventListener("focusin",this._handleFocusIn),this.nativeInput.addEventListener("focusout",this._handleFocusOut),this.inputMutationObserver=new MutationObserver(this._updateStates),this.inputMutationObserver.observe(this.nativeInput,{attributes:!0}),this._updateStates()}disconnectedCallback(){var t,e;super.disconnectedCallback(),window==null||window.removeEventListener("keydown",this._handleKeydown),window==null||window.removeEventListener("mousedown",this._handleMousedown),window==null||window.removeEventListener("pointerdown",this._handlePointerdown),(t=this.hostMutationObserver)==null||t.disconnect(),(e=this.inputMutationObserver)==null||e.disconnect(),this.nativeInput&&(this.nativeInput.removeEventListener("input",this._updateStates),this.nativeInput.removeEventListener("focusin",this._handleFocusIn),this.nativeInput.removeEventListener("focusout",this._handleFocusOut))}};exports.inputStatesMixin=o;
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./lit-html.cjs");/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./lit-html.cjs");/**
2
2
  * @license
3
3
  * Copyright 2020 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const{I:c}=a._$LH,d=()=>document.createComment(""),u=(e,r,t)=>{var s;const o=e._$AA.parentNode,A=r===void 0?e._$AB:r._$AA;if(t===void 0){const _=o.insertBefore(d(),A),$=o.insertBefore(d(),A);t=new c(_,$,e,e.options)}else{const _=t._$AB.nextSibling,$=t._$AM,l=$!==e;if(l){let i;(s=t._$AQ)==null||s.call(t,e),t._$AM=e,t._$AP!==void 0&&(i=e._$AU)!==$._$AU&&t._$AP(i)}if(_!==A||l){let i=t._$AA;for(;i!==_;){const m=i.nextSibling;o.insertBefore(i,A),i=m}}}return t},n=(e,r,t=e)=>(e._$AI(r,t),e),f={},v=(e,r=f)=>e._$AH=r,P=e=>e._$AH,g=e=>{e._$AR(),e._$AA.remove()};exports.getCommittedValue=P;exports.insertPart=u;exports.removePart=g;exports.setChildPartValue=n;exports.setCommittedValue=v;
5
+ */const{I:a}=n._$LH,c=e=>e.strings===void 0,d=()=>document.createComment(""),u=(e,r,t)=>{var $;const _=e._$AA.parentNode,s=r===void 0?e._$AB:r._$AA;if(t===void 0){const A=_.insertBefore(d(),s),o=_.insertBefore(d(),s);t=new a(A,o,e,e.options)}else{const A=t._$AB.nextSibling,o=t._$AM,l=o!==e;if(l){let i;($=t._$AQ)==null||$.call(t,e),t._$AM=e,t._$AP!==void 0&&(i=e._$AU)!==o._$AU&&t._$AP(i)}if(A!==s||l){let i=t._$AA;for(;i!==A;){const m=i.nextSibling;_.insertBefore(i,s),i=m}}}return t},f=(e,r,t=e)=>(e._$AI(r,t),e),v={},g=(e,r=v)=>e._$AH=r,P=e=>e._$AH,p=e=>{e._$AR(),e._$AA.remove()};exports.getCommittedValue=P;exports.insertPart=u;exports.isSingleExpression=c;exports.removePart=p;exports.setChildPartValue=f;exports.setCommittedValue=g;
@@ -2,4 +2,4 @@
2
2
  * @license
3
3
  * Copyright 2017 Google LLC
4
4
  * SPDX-License-Identifier: BSD-3-Clause
5
- */const s={ATTRIBUTE:1,CHILD:2},u=i=>(...t)=>({_$litDirective$:i,values:t});class ${constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}exports.Directive=$;exports.PartType=s;exports.directive=u;
5
+ */const s={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},u=i=>(...t)=>({_$litDirective$:i,values:t});class T{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}exports.Directive=T;exports.PartType=s;exports.directive=u;
@@ -0,0 +1,5 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("../lit-html.cjs"),t=require("../directive.cjs"),s=require("../directive-helpers.cjs");/**
2
+ * @license
3
+ * Copyright 2020 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */const l=t.directive(class extends t.Directive{constructor(e){if(super(e),e.type!==t.PartType.PROPERTY&&e.type!==t.PartType.ATTRIBUTE&&e.type!==t.PartType.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!s.isSingleExpression(e))throw Error("`live` bindings can only contain a single expression")}render(e){return e}update(e,[r]){if(r===n.noChange||r===n.nothing)return r;const i=e.element,o=e.name;if(e.type===t.PartType.PROPERTY){if(r===i[o])return n.noChange}else if(e.type===t.PartType.BOOLEAN_ATTRIBUTE){if(!!r===i.hasAttribute(o))return n.noChange}else if(e.type===t.PartType.ATTRIBUTE&&i.getAttribute(o)===r+"")return n.noChange;return s.setCommittedValue(e),r}});exports.live=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.62"),h=globalThis;let c=h[o];c||(c=new u,Object.defineProperty(h,o,{value:c,writable:!1,configurable:!1,enumerable:!1}));const f=c;exports.iconsManager=f;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("../core/theme.constants.cjs"),l=require("./PubSub.cjs");class u{constructor(){this.icons={},this.handleChangeTheme=e=>{if(this.theme===e)return;this.theme=e;const n=Object.keys(this.icons);this.icons={},n.forEach(s=>this.fetchIcon(s))},this.fetchIcon=async(e,n={})=>{const s=typeof sessionStorage<"u"?sessionStorage==null?void 0:sessionStorage.getItem(r.THEME_STORAGE_KEY):null;!this.theme&&s&&(this.theme=s);const t=this.icons[e];if(t)return await t;const i=this.loadIcon(e,n).catch(a=>{throw delete this.icons[e],a});return this.icons[e]=i,i},this.loadIcon=(e,{cache:n="force-cache",...s})=>!this.theme||typeof fetch>"u"?Promise.resolve('<svg class="ds-icon"></svg>'):fetch(`https://ds-assets.cupra.com/icons/${this.theme}/${e}.svg`,{cache:n,...s}).then(t=>t.text()).catch(t=>{if((t==null?void 0:t.name)==="AbortError")throw t;return console.error(`Failed to fetch icon "${e}":`,t),""}),l.pubSub.subscribe("theme",this.handleChangeTheme)}}const o=Symbol.for("@cupra/ui-kit/icons-manager/2.0.0-canary.63"),h=globalThis;let c=h[o];c||(c=new u,Object.defineProperty(h,o,{value:c,writable:!1,configurable:!1,enumerable:!1}));const f=c;exports.iconsManager=f;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.62"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class u{constructor(){this.subscribers={},this.lastPublishedData={}}subscribe(s,r){return this.subscribers[s]||(this.subscribers[s]=[]),this.subscribers[s].push(r),this.lastPublishedData[s]}unsubscribe(s,r){this.subscribers[s]&&(this.subscribers[s]=this.subscribers[s].filter(i=>i!==r))}publish(s,r){this.lastPublishedData[s]=r,this.subscribers[s]&&this.subscribers[s].forEach(i=>{try{i(r)}catch(c){console.error(`Error in subscriber for event "${s}":`,c)}})}}const t=Symbol.for("@cupra/ui-kit/pubsub/2.0.0-canary.63"),e=globalThis;let b=e[t];b||(b=new u,Object.defineProperty(e,t,{value:b,writable:!1,configurable:!1,enumerable:!1}));const l=b;exports.PubSub=u;exports.pubSub=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const r=`https://ds-assets.cupra.com/2.0.0-canary.62/styles/${t}/components/${e}.css`,c=this.getCachedStyleSheetPromise({url:r});if(c)return c;const i=this.fetchStyle({url:r}).then(n=>(n||this.stylePromises.delete(r),n));return this.stylePromises.set(r,i),this.stylePromises.get(r)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const o=s.getInstance();exports.stylesRegistry=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("../concurrencyLimit.cjs"),a=o.concurrencyLimit(20);class s{constructor(){this.stylePromises=new Map,this.getStyles=async({componentName:e,theme:t})=>{if(!t||!e)return;const c=`https://ds-assets.cupra.com/2.0.0-canary.63/styles/${t}/components/${e}.css`,r=this.getCachedStyleSheetPromise({url:c});if(r)return r;const i=a(()=>this.fetchStyle({url:c})).then(n=>(n||this.stylePromises.delete(c),n));return this.stylePromises.set(c,i),this.stylePromises.get(c)}}async fetchStyle({url:e}){try{if(typeof fetch>"u")return;const t=await fetch(e,{cache:"force-cache"});if(t.ok)return t.text()}catch(t){console.error(`Failed to fetch Style Sheet "${e}":`,t)}}getCachedStyleSheetPromise({url:e}){return this.stylePromises.get(e)}static getInstance(){return s.instance||(s.instance=new s),s.instance}}const h=s.getInstance();exports.stylesRegistry=h;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function c(r){let n=0;const e=[];function u(){if(n<r){n++;return}return new Promise(t=>{e.push(()=>{n++,t()})})}function o(){n--;const t=e.shift();t&&t()}return async t=>{const i=u();i&&await i;try{return await t()}finally{o()}}}exports.concurrencyLimit=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-62"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const e=require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.cjs");function i(r,...t){const s=String.raw({raw:r},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-63"),n=e.unsafeCSS(s);return e.css`${n}`}exports.cssWithTokens=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-62"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.cjs");const i=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.cjs");require("../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.cjs");const o=require("../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/unsafe-html.cjs");function a(e,...t){const r=String.raw({raw:e},...t).replace(/(--private-[\w-]+)(?=\s*[):,])/g,"$1-v2-0-0-canary-63"),n=o.unsafeHTML(r);return i.html`${n}`}exports.htmlWithTokens=a;
@@ -1,30 +1,31 @@
1
- import { UiKitElement as f } from "../base/UiKitElement.js";
2
- import { customUiKitElement as S } from "../../decorators/customUiKitElement.js";
1
+ import { UiKitElement as y } from "../base/UiKitElement.js";
2
+ import { customUiKitElement as f } from "../../decorators/customUiKitElement.js";
3
+ import { booleanConverter as S } from "../../utils/booleanConverter.js";
3
4
  import "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";
4
- import { html as d, nothing as y } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
5
+ import { html as c, nothing as O } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";
5
6
  import "../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";
6
- import { property as p } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
7
- import { state as c } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
8
- import { query as O } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js";
7
+ import { property as h } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";
8
+ import { state as d } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";
9
+ import { query as b } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query.js";
9
10
  import { queryAssignedElements as v } from "../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/query-assigned-elements.js";
10
11
  import { classMap as u } from "../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";
11
12
  import { SelectKeyboardController as m } from "./controllers/SelectKeyboardController.js";
12
- import { commonStyles as b } from "./styles/common.styles.js";
13
- var x = Object.defineProperty, I = Object.getOwnPropertyDescriptor, n = (e, t, i, o) => {
14
- for (var a = o > 1 ? void 0 : o ? I(t, i) : t, l = e.length - 1, r; l >= 0; l--)
13
+ import { commonStyles as x } from "./styles/common.styles.js";
14
+ var I = Object.defineProperty, C = Object.getOwnPropertyDescriptor, n = (e, t, i, o) => {
15
+ for (var a = o > 1 ? void 0 : o ? C(t, i) : t, l = e.length - 1, r; l >= 0; l--)
15
16
  (r = e[l]) && (a = (o ? r(t, i, a) : r(a)) || a);
16
- return o && a && x(t, i, a), a;
17
+ return o && a && I(t, i, a), a;
17
18
  };
18
- let s = class extends f {
19
+ let s = class extends y {
19
20
  constructor() {
20
- super(...arguments), this.mode = "light", this.size = "medium", this.variant = "primary", this._open = !1, this.nativeSelect = null, this.nativeLabel = null, this.nativeOptions = [], this.activeIndex = -1, this.hasForcedError = !1, this.handleMutations = (e) => {
21
+ super(...arguments), this.mode = "light", this.size = "medium", this.variant = "primary", this.readonly = !1, this._open = !1, this.nativeSelect = null, this.nativeLabel = null, this.nativeOptions = [], this.activeIndex = -1, this.hasForcedError = !1, this.handleMutations = (e) => {
21
22
  e.forEach((t) => {
22
23
  t.type === "childList" && this.syncNativeOptions();
23
24
  }), this.requestUpdate();
24
25
  }, this.syncNativeOptions = () => {
25
26
  this.nativeOptions = Array.from(this.nativeSelect.options);
26
27
  }, this.handleOpen = () => {
27
- this._open = !0, this.activeIndex = this.findSelectedOptionIndex(), this.focusDisplaySelect();
28
+ this.readonly || (this._open = !0, this.activeIndex = this.findSelectedOptionIndex(), this.focusDisplaySelect());
28
29
  }, this.handleClose = () => {
29
30
  this._open = !1;
30
31
  }, this.handleClickDisplaySelect = () => {
@@ -125,6 +126,7 @@ let s = class extends f {
125
126
  container: !0,
126
127
  open: this._open,
127
128
  disabled: !!((e = this.nativeSelect) != null && e.disabled),
129
+ readonly: !!this.readonly,
128
130
  filled: !!((i = (t = this.nativeOptions) == null ? void 0 : t.find((a) => a.selected && !a.hidden)) != null && i.selected),
129
131
  invalid: !((o = this.nativeSelect) != null && o.validity.valid),
130
132
  error: this.hasForcedError,
@@ -140,12 +142,13 @@ let s = class extends f {
140
142
  return this._open;
141
143
  }
142
144
  render() {
143
- return d`
145
+ return c`
144
146
  <slot @slotchange=${this.initializeNativeSelect}></slot>
145
147
  <div class=${u(this.containerClasses)}>
146
148
  ${this.displaySelectTemplate}
147
149
  ${this.optionsContainerTemplate}
148
150
  <slot name="helper-text"></slot>
151
+ <slot name="readonly-text"></slot>
149
152
  <slot name="forced-error" @slotchange=${this.handleChangeForcedError}></slot>
150
153
  <slot name="invalid-error"></slot>
151
154
  </div>
@@ -164,10 +167,10 @@ let s = class extends f {
164
167
  if (l.nodeType !== 3)
165
168
  return r;
166
169
  if (l.textContent.trim() === "") return "";
167
- const h = document.createElement("span");
168
- return h.classList.add("text"), h.appendChild(r), h;
170
+ const p = document.createElement("span");
171
+ return p.classList.add("text"), p.appendChild(r), p;
169
172
  });
170
- return d`
173
+ return c`
171
174
  <div class="select-outline">
172
175
  <div class="select-container">
173
176
  <label id="display-label" class="label">${(o = this.nativeLabel) == null ? void 0 : o.innerText}</label>
@@ -195,17 +198,17 @@ let s = class extends f {
195
198
  return this._open && this.activeIndex >= 0 ? `${s.ARIA_OPTION_PREFIX}${this.nativeOptions[this.activeIndex].value}` : "";
196
199
  }
197
200
  get optionsContainerTemplate() {
198
- return d`
201
+ return c`
199
202
  <div id="options-container" class="options-container" role="listbox">
200
203
  ${this.nativeOptions.map(
201
- (e, t) => e.hidden ? y : this.renderOptionClone(e, t)
204
+ (e, t) => e.hidden ? O : this.renderOptionClone(e, t)
202
205
  )}
203
206
  </div>
204
207
  `;
205
208
  }
206
209
  renderOptionClone(e, t) {
207
210
  const i = Array.from(e.childNodes).map((o) => o.cloneNode(!0));
208
- return d`
211
+ return c`
209
212
  <div
210
213
  id="${s.ARIA_OPTION_PREFIX}${e.value}"
211
214
  class=${u({
@@ -225,34 +228,37 @@ let s = class extends f {
225
228
  `;
226
229
  }
227
230
  };
228
- s.styles = [b];
231
+ s.styles = [x];
229
232
  s.ARIA_OPTION_PREFIX = "option-";
230
233
  n([
231
- p({ type: String })
234
+ h({ type: String })
232
235
  ], s.prototype, "mode", 2);
233
236
  n([
234
- p({ type: String })
237
+ h({ type: String })
235
238
  ], s.prototype, "size", 2);
236
239
  n([
237
- p({ type: String })
240
+ h({ type: String })
238
241
  ], s.prototype, "variant", 2);
239
242
  n([
240
- c()
243
+ h({ type: Boolean, converter: S, reflect: !0 })
244
+ ], s.prototype, "readonly", 2);
245
+ n([
246
+ d()
241
247
  ], s.prototype, "_open", 2);
242
248
  n([
243
- c()
249
+ d()
244
250
  ], s.prototype, "nativeSelect", 2);
245
251
  n([
246
- c()
252
+ d()
247
253
  ], s.prototype, "nativeLabel", 2);
248
254
  n([
249
- c()
255
+ d()
250
256
  ], s.prototype, "nativeOptions", 2);
251
257
  n([
252
- c()
258
+ d()
253
259
  ], s.prototype, "activeIndex", 2);
254
260
  n([
255
- c()
261
+ d()
256
262
  ], s.prototype, "hasForcedError", 2);
257
263
  n([
258
264
  v({ slot: "", selector: "select", flatten: !0 })
@@ -264,10 +270,10 @@ n([
264
270
  v({ slot: "forced-error", flatten: !0 })
265
271
  ], s.prototype, "forcedError", 2);
266
272
  n([
267
- O(".select")
273
+ b(".select")
268
274
  ], s.prototype, "displaySelect", 2);
269
275
  s = n([
270
- S("ds-select")
276
+ f("ds-select")
271
277
  ], s);
272
278
  export {
273
279
  s as DsSelect