@cscfi/csc-ui 1.2.2 → 1.2.4

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 (130) hide show
  1. package/dist/cjs/{c-autocomplete_16.cjs.entry.js → c-autocomplete_23.cjs.entry.js} +665 -9
  2. package/dist/cjs/c-autocomplete_23.cjs.entry.js.map +1 -0
  3. package/dist/cjs/{c-checkbox_3.cjs.entry.js → c-pagination_2.cjs.entry.js} +1 -115
  4. package/dist/cjs/c-pagination_2.cjs.entry.js.map +1 -0
  5. package/dist/cjs/csc-ui.cjs.js +1 -1
  6. package/dist/cjs/index-91ba22ab.js +4 -28
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/collection/components/c-autocomplete/c-autocomplete.js +6 -13
  9. package/dist/collection/components/c-autocomplete/c-autocomplete.js.map +1 -1
  10. package/dist/collection/components/c-checkbox/c-checkbox.js +3 -11
  11. package/dist/collection/components/c-checkbox/c-checkbox.js.map +1 -1
  12. package/dist/collection/components/c-dropdown/c-dropdown.js +0 -1
  13. package/dist/collection/components/c-dropdown/c-dropdown.js.map +1 -1
  14. package/dist/collection/components/c-radio-group/c-radio-group.js +7 -1
  15. package/dist/collection/components/c-radio-group/c-radio-group.js.map +1 -1
  16. package/dist/collection/components/c-switch/c-switch.js +3 -11
  17. package/dist/collection/components/c-switch/c-switch.js.map +1 -1
  18. package/dist/collection/components/c-table/c-table.css +3 -0
  19. package/dist/collection/components/c-table/c-table.js +4 -1
  20. package/dist/collection/components/c-table/c-table.js.map +1 -1
  21. package/dist/components/c-autocomplete.js +7 -8
  22. package/dist/components/c-autocomplete.js.map +1 -1
  23. package/dist/components/c-checkbox2.js +3 -11
  24. package/dist/components/c-checkbox2.js.map +1 -1
  25. package/dist/components/c-dropdown2.js +0 -1
  26. package/dist/components/c-dropdown2.js.map +1 -1
  27. package/dist/components/c-radio-group.js +7 -1
  28. package/dist/components/c-radio-group.js.map +1 -1
  29. package/dist/components/c-switch.js +3 -11
  30. package/dist/components/c-switch.js.map +1 -1
  31. package/dist/components/c-table.js +5 -2
  32. package/dist/components/c-table.js.map +1 -1
  33. package/dist/csc-ui/csc-ui.esm.js +1 -1
  34. package/dist/csc-ui/csc-ui.esm.js.map +1 -1
  35. package/dist/csc-ui/{p-ae16b1f4.entry.js → p-1b181fd3.entry.js} +2 -2
  36. package/dist/csc-ui/{p-1d6c84df.entry.js → p-2e28b0cc.entry.js} +2 -2
  37. package/dist/csc-ui/{p-56b1e1ea.entry.js → p-34027974.entry.js} +2 -2
  38. package/dist/csc-ui/{p-9c80f35e.entry.js → p-367d3bd3.entry.js} +2 -2
  39. package/dist/csc-ui/{p-f24b9d97.js → p-667da79a.js} +2 -2
  40. package/dist/csc-ui/{p-b0fa27b6.entry.js → p-6ff81ae0.entry.js} +2 -2
  41. package/dist/csc-ui/{p-3bb67f38.entry.js → p-74a176e6.entry.js} +2 -2
  42. package/dist/csc-ui/p-8f36c6ba.entry.js +2 -0
  43. package/dist/csc-ui/{p-ab62f9b5.entry.js.map → p-8f36c6ba.entry.js.map} +1 -1
  44. package/dist/csc-ui/p-9ba0ed23.entry.js +2 -0
  45. package/dist/csc-ui/p-9ba0ed23.entry.js.map +1 -0
  46. package/dist/csc-ui/{p-c8a7a751.entry.js → p-a8a04dff.entry.js} +2 -2
  47. package/dist/csc-ui/{p-682782b1.entry.js → p-adaace9b.entry.js} +2 -2
  48. package/dist/csc-ui/{p-468d9583.entry.js → p-d074c6db.entry.js} +2 -2
  49. package/dist/csc-ui/{p-ccef8a49.entry.js → p-d22cd2a7.entry.js} +2 -2
  50. package/dist/csc-ui/p-e1955a0e.entry.js +2 -0
  51. package/dist/csc-ui/p-e1955a0e.entry.js.map +1 -0
  52. package/dist/esm/c-accordion-item.entry.js +1 -1
  53. package/dist/esm/c-alert.entry.js +1 -1
  54. package/dist/esm/{c-autocomplete_16.entry.js → c-autocomplete_23.entry.js} +660 -11
  55. package/dist/esm/c-autocomplete_23.entry.js.map +1 -0
  56. package/dist/esm/c-data-table.entry.js +1 -1
  57. package/dist/esm/c-menu_2.entry.js +1 -1
  58. package/dist/esm/c-navigation-button.entry.js +1 -1
  59. package/dist/esm/{c-checkbox_3.entry.js → c-pagination_2.entry.js} +4 -117
  60. package/dist/esm/c-pagination_2.entry.js.map +1 -0
  61. package/dist/esm/c-side-navigation-item.entry.js +1 -1
  62. package/dist/esm/c-side-navigation.entry.js +1 -1
  63. package/dist/esm/c-swiper.entry.js +1 -1
  64. package/dist/esm/c-tabs.entry.js +1 -1
  65. package/dist/esm/c-tag.entry.js +1 -1
  66. package/dist/esm/c-toast.entry.js +1 -1
  67. package/dist/esm/csc-ui.js +1 -1
  68. package/dist/esm/index-47956d53.js +4 -28
  69. package/dist/esm/loader.js +1 -1
  70. package/dist/esm/{mdi-8656e74a.js → mdi-e483616d.js} +2 -2
  71. package/dist/esm/{mdi-8656e74a.js.map → mdi-e483616d.js.map} +1 -1
  72. package/dist/types/components/c-autocomplete/c-autocomplete.d.ts +1 -1
  73. package/dist/types/components/c-table/c-table.d.ts +1 -0
  74. package/package.json +1 -1
  75. package/dist/cjs/c-autocomplete_16.cjs.entry.js.map +0 -1
  76. package/dist/cjs/c-checkbox_3.cjs.entry.js.map +0 -1
  77. package/dist/cjs/c-otp-input.cjs.entry.js +0 -154
  78. package/dist/cjs/c-otp-input.cjs.entry.js.map +0 -1
  79. package/dist/cjs/c-radio-group.cjs.entry.js +0 -154
  80. package/dist/cjs/c-radio-group.cjs.entry.js.map +0 -1
  81. package/dist/cjs/c-radio.cjs.entry.js +0 -24
  82. package/dist/cjs/c-radio.cjs.entry.js.map +0 -1
  83. package/dist/cjs/c-switch.cjs.entry.js +0 -71
  84. package/dist/cjs/c-switch.cjs.entry.js.map +0 -1
  85. package/dist/cjs/c-table.cjs.entry.js +0 -47
  86. package/dist/cjs/c-table.cjs.entry.js.map +0 -1
  87. package/dist/cjs/c-text-field.cjs.entry.js +0 -151
  88. package/dist/cjs/c-text-field.cjs.entry.js.map +0 -1
  89. package/dist/csc-ui/p-494a4f19.entry.js +0 -2
  90. package/dist/csc-ui/p-494a4f19.entry.js.map +0 -1
  91. package/dist/csc-ui/p-6e046723.entry.js +0 -2
  92. package/dist/csc-ui/p-6e046723.entry.js.map +0 -1
  93. package/dist/csc-ui/p-7ea05669.entry.js +0 -2
  94. package/dist/csc-ui/p-7ea05669.entry.js.map +0 -1
  95. package/dist/csc-ui/p-ab62f9b5.entry.js +0 -2
  96. package/dist/csc-ui/p-b83651f8.entry.js +0 -2
  97. package/dist/csc-ui/p-b83651f8.entry.js.map +0 -1
  98. package/dist/csc-ui/p-bda722d5.entry.js +0 -2
  99. package/dist/csc-ui/p-bda722d5.entry.js.map +0 -1
  100. package/dist/csc-ui/p-caa58a64.entry.js +0 -2
  101. package/dist/csc-ui/p-caa58a64.entry.js.map +0 -1
  102. package/dist/csc-ui/p-d7ca1f65.entry.js +0 -2
  103. package/dist/csc-ui/p-d7ca1f65.entry.js.map +0 -1
  104. package/dist/csc-ui/p-ee753bac.entry.js +0 -2
  105. package/dist/csc-ui/p-ee753bac.entry.js.map +0 -1
  106. package/dist/esm/c-autocomplete_16.entry.js.map +0 -1
  107. package/dist/esm/c-checkbox_3.entry.js.map +0 -1
  108. package/dist/esm/c-otp-input.entry.js +0 -150
  109. package/dist/esm/c-otp-input.entry.js.map +0 -1
  110. package/dist/esm/c-radio-group.entry.js +0 -150
  111. package/dist/esm/c-radio-group.entry.js.map +0 -1
  112. package/dist/esm/c-radio.entry.js +0 -20
  113. package/dist/esm/c-radio.entry.js.map +0 -1
  114. package/dist/esm/c-switch.entry.js +0 -67
  115. package/dist/esm/c-switch.entry.js.map +0 -1
  116. package/dist/esm/c-table.entry.js +0 -43
  117. package/dist/esm/c-table.entry.js.map +0 -1
  118. package/dist/esm/c-text-field.entry.js +0 -147
  119. package/dist/esm/c-text-field.entry.js.map +0 -1
  120. /package/dist/csc-ui/{p-ae16b1f4.entry.js.map → p-1b181fd3.entry.js.map} +0 -0
  121. /package/dist/csc-ui/{p-1d6c84df.entry.js.map → p-2e28b0cc.entry.js.map} +0 -0
  122. /package/dist/csc-ui/{p-56b1e1ea.entry.js.map → p-34027974.entry.js.map} +0 -0
  123. /package/dist/csc-ui/{p-9c80f35e.entry.js.map → p-367d3bd3.entry.js.map} +0 -0
  124. /package/dist/csc-ui/{p-f24b9d97.js.map → p-667da79a.js.map} +0 -0
  125. /package/dist/csc-ui/{p-b0fa27b6.entry.js.map → p-6ff81ae0.entry.js.map} +0 -0
  126. /package/dist/csc-ui/{p-3bb67f38.entry.js.map → p-74a176e6.entry.js.map} +0 -0
  127. /package/dist/csc-ui/{p-c8a7a751.entry.js.map → p-a8a04dff.entry.js.map} +0 -0
  128. /package/dist/csc-ui/{p-682782b1.entry.js.map → p-adaace9b.entry.js.map} +0 -0
  129. /package/dist/csc-ui/{p-468d9583.entry.js.map → p-d074c6db.entry.js.map} +0 -0
  130. /package/dist/csc-ui/{p-ccef8a49.entry.js.map → p-d22cd2a7.entry.js.map} +0 -0
@@ -30,8 +30,7 @@ const CAutocomplete = class {
30
30
  ? { name: selection.name, value: selection.value }
31
31
  : selection.value;
32
32
  this.changeValue.emit(this.value);
33
- this.query = selection.name.toString();
34
- this.changeQuery.emit(selection.value);
33
+ this.changeQuery.emit(this.query);
35
34
  this.internals.setFormValue(selection.value.toString());
36
35
  }
37
36
  if (this.optionElements.length && !this.optionElementsExist) {
@@ -114,7 +113,7 @@ const CAutocomplete = class {
114
113
  this.changeQuery.emit('');
115
114
  this._dropdownElement.updateList();
116
115
  }
117
- handleKeyDown(event) {
116
+ _handleKeyDown(event) {
118
117
  const alphanumeric = /^[0-9a-zA-Z ]+$/;
119
118
  if (event.key.match(alphanumeric) && event.key.length === 1) {
120
119
  if (!this.dropdownVisible) {
@@ -211,9 +210,9 @@ const CAutocomplete = class {
211
210
  handleQueryChange() {
212
211
  this._updateStatusText();
213
212
  }
214
- _updateInput(event) {
213
+ _updateInput() {
215
214
  this._dropdownElement.open();
216
- this.query = event.target.value;
215
+ this.query = this._inputElement.value;
217
216
  this.changeQuery.emit(this.query);
218
217
  this._dropdownElement.updateList();
219
218
  }
@@ -232,7 +231,7 @@ const CAutocomplete = class {
232
231
  }
233
232
  _renderInputElement() {
234
233
  var _a;
235
- return (index.h("div", { class: "c-input-menu__input" }, index.h("input", { type: "text", ref: (el) => (this._inputElement = el), "aria-expanded": this.dropdownVisible.toString(), "aria-owns": this._inputId + '-items', "aria-autocomplete": "list", autocomplete: "off", class: "c-input__input", role: "combobox", value: this.query, name: (_a = this.name) !== null && _a !== void 0 ? _a : null, onInput: (event) => this._updateInput(event), onFocus: () => this._onInputFocus() })));
234
+ return (index.h("div", { class: "c-input-menu__input" }, index.h("input", { type: "text", ref: (el) => (this._inputElement = el), "aria-expanded": this.dropdownVisible.toString(), "aria-owns": this._inputId + '-items', "aria-autocomplete": "list", autocomplete: "off", class: "c-input__input", role: "combobox", value: this.query, name: (_a = this.name) !== null && _a !== void 0 ? _a : null, onInput: () => this._updateInput(), onFocus: () => this._onInputFocus() })));
236
235
  }
237
236
  componentWillLoad() {
238
237
  CAutocomplete._uniqueId += 1;
@@ -266,7 +265,7 @@ const CAutocomplete = class {
266
265
  }
267
266
  render() {
268
267
  const itemType = this.optionElementsExist ? 'option' : 'item';
269
- return (index.h(index.Host, null, index.h("c-dropdown", { ref: (el) => (this._dropdownElement = el), id: `${this._id}-dropdown`, index: this.currentIndex, "items-per-page": this.itemsPerPage, "item-type": itemType, items: this._items, parent: this.el, type: "autocomplete" }, index.h("c-input", { slot: "default", ref: (el) => (this._cInputElement = el), active: this.dropdownVisible, disabled: this.disabled, "hide-details": this.hideDetails, hint: this.hint, id: this.hostId, "input-id": this._inputId, label: this.label, name: this.name, placeholder: this.placeholder, required: this.required, shadow: this.shadow, valid: this.valid, validate: this.validate, "validate-on-blur": this.validateOnBlur, validation: this.validation, value: this.query, variant: "select" }, index.h("slot", { name: "pre", slot: "pre" }), index.h("div", { class: "c-input__content" }, this._renderInputElement(), this.loading && this._renderLoader(), !this.loading && this.value && this._renderReset(), !this.loading && !this.value && this._renderChevron(), index.h("slot", { onSlotchange: () => this._handleSlotChange() })), index.h("slot", { name: "post", slot: "post" })))));
268
+ return (index.h(index.Host, null, index.h("c-dropdown", { ref: (el) => (this._dropdownElement = el), id: `${this._id}-dropdown`, index: this.currentIndex, "items-per-page": this.itemsPerPage, "item-type": itemType, items: this._items, parent: this.el, type: "autocomplete", onKeyDown: (event) => this._handleKeyDown(event) }, index.h("c-input", { slot: "default", ref: (el) => (this._cInputElement = el), active: this.dropdownVisible, disabled: this.disabled, "hide-details": this.hideDetails, hint: this.hint, id: this.hostId, "input-id": this._inputId, label: this.label, name: this.name, placeholder: this.placeholder, required: this.required, shadow: this.shadow, valid: this.valid, validate: this.validate, "validate-on-blur": this.validateOnBlur, validation: this.validation, value: this.query, variant: "select" }, index.h("slot", { name: "pre", slot: "pre" }), index.h("div", { class: "c-input__content" }, this._renderInputElement(), this.loading && this._renderLoader(), !this.loading && this.value && this._renderReset(), !this.loading && !this.value && this._renderChevron(), index.h("slot", { onSlotchange: () => this._handleSlotChange() })), index.h("slot", { name: "post", slot: "post" })))));
270
269
  }
271
270
  static get formAssociated() { return true; }
272
271
  get el() { return index.getElement(this); }
@@ -530,6 +529,111 @@ const CCardTitle = class {
530
529
  };
531
530
  CCardTitle.style = cCardTitleCss;
532
531
 
532
+ const cCheckboxCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-checkbox-background-color-hover:var(--c-checkbox-background-color-hover, rgba(var(--c-primary-rgb), 0.1));--_c-checkbox-color-active:var(--c-checkbox-color-active, var(--_c-checkbox-color));--_c-checkbox-color-disabled:var(--c-checkbox-color-disabled, var(--c-tertiary-500));--_c-checkbox-color:var(--c-checkbox-color, var(--c-primary-600));--_c-checkbox-color-error:var(--c-error-600)}.c-checkbox{position:relative;width:fit-content}.c-checkbox__details{line-height:1;padding:0 12px}.c-checkbox__details.active .c-checkbox__message{opacity:1;transform:translateY(0)}.c-checkbox__message{font-size:12px;opacity:0;transform:translateY(-4px);transition:all 0.2s cubic-bezier(0.25, 0.8, 0.5, 1)}.c-checkbox__message--hint{color:var(--c-tertiary-500)}.c-checkbox__message--error{color:var(--_c-checkbox-color-error)}.c-checkbox__message span{align-items:flex-start;color:currentColor;display:flex;gap:4px;height:16px}.c-checkbox__message svg{fill:currentColor;min-height:16px;min-width:16px;position:relative;top:-2px}.c-checkbox__label-content{padding-top:10px;text-align:left;user-select:none}.c-checkbox__label-content span.required{color:var(--c-error-600)}.c-checkbox--disabled{--_c-checkbox-color:var(--_c-checkbox-color-disabled);--c-error-600:var(--_c-checkbox-color);--_c-checkbox-color-active:var(--_c-checkbox-color-disabled);color:var(--_c-checkbox-color);opacity:0.75}.c-checkbox--disabled .c-checkbox__label{cursor:default}.c-checkbox--error{--_c-checkbox-color:var(--c-error-600);--_c-checkbox-color-active:var(--_c-checkbox-color-error);color:var(--_c-checkbox-color-error)}.c-checkbox input:focus{outline:none}.c-checkbox input:focus+.c-checkbox__label .ripple{outline:2px var(--_c-checkbox-color-active) solid}@supports selector(:focus-visible){.c-checkbox input:focus+.c-checkbox__label .ripple{outline:none}}.c-checkbox input:focus-visible+.c-checkbox__label .ripple{outline:2px var(--_c-checkbox-color-active) solid}.c-checkbox:not(.c-checkbox--disabled) .ripple:hover{background-color:var(--_c-checkbox-background-color-hover)}.c-checkbox .visuallyhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.c-checkbox input:checked+.c-checkbox__label .ripple::before{background:var(--_c-checkbox-color-active);border-color:var(--_c-checkbox-color-active)}.c-checkbox input:checked+.c-checkbox__label .path{stroke:#ffffff;fill:#ffffff;stroke-dashoffset:0;stroke-width:13;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10}.c-checkbox__label{cursor:pointer;display:flex;gap:4px;position:relative;user-select:none}.c-checkbox__label svg{height:14px;left:14px;position:absolute;top:14px;width:14px}.c-checkbox__label--indeterminate .path{stroke-dasharray:0 !important;stroke-dashoffset:0 !important;stroke:transparent}.c-checkbox__label .ripple{border-radius:50%;color:var(--_c-checkbox-color-active);display:grid;height:42px;min-width:42px;overflow:hidden;place-content:center;position:relative;transform:translateZ(0);width:42px}.c-checkbox__label .ripple::before{border-radius:2px;border:2px solid var(--_c-checkbox-color);content:\"\";display:inline-block;height:18px;left:12px;position:absolute;top:12px;transition:all 0.25s ease-out;vertical-align:middle;width:18px}";
533
+
534
+ const CCheckbox = class {
535
+ constructor(hostRef) {
536
+ index.registerInstance(this, hostRef);
537
+ this.changeValue = index.createEvent(this, "changeValue", 3);
538
+ if (hostRef.$hostElement$["s-ei"]) {
539
+ this.internals = hostRef.$hostElement$["s-ei"];
540
+ }
541
+ else {
542
+ this.internals = hostRef.$hostElement$.attachInternals();
543
+ hostRef.$hostElement$["s-ei"] = this.internals;
544
+ }
545
+ this._validationIcon = (index.h("svg", { height: "16px", width: "16px", viewBox: "0 0 24 24" }, index.h("path", { d: mdi.mdiCloseCircle })));
546
+ this.checked = false;
547
+ this.disabled = false;
548
+ this.hideDetails = false;
549
+ this.hint = '';
550
+ this.indeterminate = false;
551
+ this.label = '';
552
+ this.required = false;
553
+ this.valid = true;
554
+ this.validation = 'Required field';
555
+ this.value = false;
556
+ this.trueValue = true;
557
+ this.falseValue = false;
558
+ this.hostName = undefined;
559
+ this.messageOptions = {
560
+ show: false,
561
+ type: 'hint',
562
+ content: '',
563
+ };
564
+ }
565
+ onValidationMessageChange(message) {
566
+ this.onValidChange(message.length === 0);
567
+ }
568
+ onValidChange(valid) {
569
+ this._handleValidation(valid || this.valid);
570
+ }
571
+ handleKeyDown(event) {
572
+ if (['Space'].includes(event.code)) {
573
+ event.preventDefault();
574
+ this._toggleState(event);
575
+ }
576
+ }
577
+ componentWillLoad() {
578
+ this.checked = this.checked || this.value === this.trueValue;
579
+ this.internals.setFormValue(this.checked ? this.trueValue.toString() : this.falseValue.toString());
580
+ }
581
+ componentDidLoad() {
582
+ this._handleMessageOptions(this.valid);
583
+ }
584
+ _handleMessageOptions(valid) {
585
+ requestAnimationFrame(() => {
586
+ this.messageOptions = Object.assign(Object.assign({}, this.messageOptions), { type: valid ? 'hint' : 'error', show: true, content: valid ? (index.h("span", null, this.hint)) : (index.h("span", null, this._validationIcon, " ", this.validation)) });
587
+ });
588
+ }
589
+ _handleValidation(valid, timeout = 200) {
590
+ setTimeout(() => {
591
+ this._handleMessageOptions(valid);
592
+ }, timeout);
593
+ }
594
+ _toggleState(event) {
595
+ if (this.disabled)
596
+ return;
597
+ this._rippleElement.createRipple(event, this._container, true);
598
+ this.checked = !this.checked;
599
+ this.changeValue.emit(this.checked ? this.trueValue : this.falseValue);
600
+ this.internals.setFormValue(this.checked ? this.trueValue.toString() : this.falseValue.toString());
601
+ }
602
+ _renderMessages() {
603
+ if (this.hideDetails)
604
+ return;
605
+ const classes = {
606
+ 'c-checkbox__details': true,
607
+ active: this.messageOptions.show,
608
+ };
609
+ const messageClasses = {
610
+ 'c-checkbox__message': true,
611
+ [`c-checkbox__message--${this.messageOptions.type}`]: true,
612
+ };
613
+ return (index.h("div", { class: classes }, index.h("div", { class: messageClasses }, this.messageOptions.content)));
614
+ }
615
+ render() {
616
+ const wrapperClasses = {
617
+ 'c-checkbox': true,
618
+ 'c-checkbox--disabled': this.disabled,
619
+ 'c-checkbox--error': this.messageOptions.type === 'error',
620
+ };
621
+ const labelClasses = {
622
+ 'c-checkbox__label': true,
623
+ 'c-checkbox__label--indeterminate': this.indeterminate,
624
+ };
625
+ const slotHasContent = !!this.el.childNodes.length;
626
+ return (index.h(index.Host, null, index.h("div", { class: wrapperClasses }, index.h("input", Object.assign({ class: "visuallyhidden", id: "checkbox" }, (!!this.hostName ? { name: this.hostName } : {}), { type: "checkbox", "aria-checked": this.checked.toString(), "aria-disabled": this.disabled.toString(), checked: this.checked ? true : undefined, disabled: this.disabled, onChange: (event) => this._toggleState(event) })), index.h("label", { class: labelClasses, htmlFor: "checkbox" }, index.h("div", { class: "ripple", ref: (el) => (this._container = el) }, index.h("svg", { viewBox: "0 0 100 100" }, !this.indeterminate && this.checked && (index.h("path", { class: "path", d: "M 12 52 l 24 24 l 47 -47 l -3 -3 l -44 44 l -21 -21 l -3 3" })), this.indeterminate && (index.h("path", { class: "path", d: "M20 56 h60 v-8 h-60 z" }))), index.h("c-ripple", { ref: (el) => (this._rippleElement = el) })), (!!this.label || slotHasContent) && (index.h("div", { class: "c-checkbox__label-content" }, !!this.label ? this.label : index.h("slot", null), this.required && index.h("span", { class: "required" }, "\u00A0*"))))), this._renderMessages()));
627
+ }
628
+ static get formAssociated() { return true; }
629
+ get el() { return index.getElement(this); }
630
+ static get watchers() { return {
631
+ "validation": ["onValidationMessageChange"],
632
+ "valid": ["onValidChange"]
633
+ }; }
634
+ };
635
+ CCheckbox.style = cCheckboxCss;
636
+
533
637
  const cDropdownCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host(c-dropdown){--_c-dropdown-background-color:var(\n --c-dropdown-background-color,\n var(--c-white)\n );--_c-dropdown-background-color-hover:var(\n --c-dropdown-background-color-hover,\n var(--c-primary-200)\n );--_c-dropdown-text-color:var(--c-dropdown-text-color, var(--c-text-body));--_c-dropdown-text-color-active:var(\n --c-dropdown-text-color-active,\n var(--c-primary-600)\n );--_c-dropdown-font-size:14px;--_c-dropdown-height:42px;display:block;position:relative}:host(c-dropdown) mark{background-color:transparent;box-shadow:0 2px 0 0 var(--_c-dropdown-text-color-active);color:inherit}:host(c-dropdown) dialog{border-radius:4px;background-color:transparent;border:none;margin:-4px 0 0;overflow:visible;padding:4px 0 0;position:fixed}:host(c-dropdown) dialog::backdrop{display:none}:host(c-dropdown) dialog[open].mobile{background-color:var(--_c-dropdown-background-color);width:100vw;max-width:100vw;height:100vh;max-height:100svh;inset:0}:host(c-dropdown) dialog[open].mobile .input-top-wrapper{padding:8px}:host(c-dropdown) dialog .input-bottom-wrapper.active{padding-top:8px}:host(c-dropdown) .dummy{display:none}:host(c-dropdown) ul{background-color:var(--_c-dropdown-background-color);box-shadow:2px 4px 10px rgba(0, 0, 0, 0.1607843137);border-radius:4px;list-style:none;margin:0;outline:none;padding:0;pointer-events:auto;visibility:hidden;width:100%;height:max-content;overflow-y:scroll}:host(c-dropdown) ul.active{visibility:visible;animation:0.2s 1 fade-in cubic-bezier(0.25, 0.8, 0.5, 1)}:host(c-dropdown) ul.active.mobile{width:100vw;max-width:100vw;height:100vh;max-height:calc(100svh - 60px)}:host(c-dropdown) li{align-items:center;column-gap:12px;cursor:pointer;display:flex;flex-wrap:nowrap;font-size:var(--_c-dropdown-font-size);min-height:var(--_c-dropdown-height);outline:none;padding-left:10px;padding-right:10px;pointer-events:auto;white-space:nowrap;width:100%;border-radius:4px}:host(c-dropdown) li span,:host(c-dropdown) li c-option-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%}:host(c-dropdown) li:hover,:host(c-dropdown) li:focus,:host(c-dropdown) li.active{background:var(--_c-dropdown-background-color-hover);color:var(--_c-dropdown-text-color-active);box-shadow:inset 0 0 0 1px var(--_c-dropdown-text-color-active)}:host(c-dropdown) li:not(.disabled,:hover,:focus)[aria-selected=true]{background:var(--_c-dropdown-background-color-hover);color:var(--_c-dropdown-text-color-active);border-radius:0}:host(c-dropdown) li.disabled{background-color:rgba(var(--c-tertiary-rgb), 0.05);cursor:default;filter:grayscale(1) opacity(0.75)}:host(c-dropdown) .visuallyhidden{border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}@keyframes fade-in{from{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}";
534
638
 
535
639
  const CDropdown = class {
@@ -695,7 +799,6 @@ const CDropdown = class {
695
799
  inputSlot = 'input-bottom';
696
800
  this._dialog.style.top = 'auto';
697
801
  this._dialog.style.bottom = `${innerHeight - inputSize.top - 44}px`;
698
- this._inputElement.scrollIntoView();
699
802
  }
700
803
  }
701
804
  this._dummyElement.style.width = `${this._getParentPosition().width}px`;
@@ -1167,6 +1270,316 @@ const COption = class {
1167
1270
  };
1168
1271
  COption.style = cOptionCss;
1169
1272
 
1273
+ const cOtpInputCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-otp-input-border-color:var(--c-otp-input-border-color, var(--c-tertiary-500));--_c-otp-input-border-color-active:var(--c-otp-input-border-color-active, var(--c-primary-600));--_c-otp-input-height:var(--c-otp-input-height, 56px);--_c-otp-input-width:var(--c-otp-input-width, 42px);--_c-otp-input-font-size:var(--c-otp-input-font-size, 24px);--_c-otp-input-text-color:var(--c-otp-input-text-color, var(--c-text-body));--_c-otp-input-border-width:1px;display:block}:host(.error){--_c-otp-input-border-color:var(--c-error-600);--_c-otp-input-border-color-active:var(--c-error-600)}.visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}.c-otp-input{backface-visibility:hidden;display:inline-grid;gap:8px;grid-auto-columns:minmax(auto, var(--_c-otp-input-width));grid-auto-flow:column;margin-bottom:8px;transform:translate3d(0, 0, 0)}.c-otp-input--hide-details{margin-bottom:0}.c-otp-input input{border-radius:4px;border:none;box-shadow:inset 0 0 0 var(--_c-otp-input-border-width) var(--_c-otp-input-border-color);color:var(--_c-otp-input-text-color);font-size:var(--_c-otp-input-font-size);height:var(--_c-otp-input-height);max-width:var(--_c-otp-input-width);min-width:24px;text-align:center;width:100%}.c-otp-input input:focus{--_c-otp-input-border-width:2px;--_c-otp-input-border-color:var(--_c-otp-input-border-color-active);outline:none}.c-otp-input c-message{grid-column:1/span var(--_c-otp-input-count);grid-row:2}";
1274
+
1275
+ const COtpInput = class {
1276
+ constructor(hostRef) {
1277
+ index.registerInstance(this, hostRef);
1278
+ this.changeValue = index.createEvent(this, "changeValue", 3);
1279
+ this.completion = index.createEvent(this, "completion", 3);
1280
+ if (hostRef.$hostElement$["s-ei"]) {
1281
+ this.internals = hostRef.$hostElement$["s-ei"];
1282
+ }
1283
+ else {
1284
+ this.internals = hostRef.$hostElement$.attachInternals();
1285
+ hostRef.$hostElement$["s-ei"] = this.internals;
1286
+ }
1287
+ this._backSpacePressed = false;
1288
+ this._debounce = null;
1289
+ this._isPasting = false;
1290
+ this._inputs = new Array(this.length).fill(null);
1291
+ this._value = '';
1292
+ this.hideDetails = false;
1293
+ this.hint = '';
1294
+ this.elementId = undefined;
1295
+ this.length = 6;
1296
+ this.valid = true;
1297
+ this.validation = 'Required field';
1298
+ this.statusText = '';
1299
+ }
1300
+ onValidationMessageChange() {
1301
+ this._updateStatusText();
1302
+ }
1303
+ _emitValue() {
1304
+ requestAnimationFrame(() => {
1305
+ this._value = [...this._inputs].map((input) => input.value).join('');
1306
+ const isFullyFilled = this._value.length === this.length;
1307
+ this.changeValue.emit(isFullyFilled ? this._value : null);
1308
+ if (isFullyFilled) {
1309
+ this.completion.emit(this._value || null);
1310
+ }
1311
+ this.internals.setFormValue(this._value);
1312
+ this._updateStatusText();
1313
+ });
1314
+ }
1315
+ _getElements(event) {
1316
+ const target = event.target;
1317
+ const nextElement = target.nextElementSibling;
1318
+ const previousElement = target.previousElementSibling;
1319
+ return { target, nextElement, previousElement };
1320
+ }
1321
+ _onFocus(index) {
1322
+ this._inputs[index].select();
1323
+ }
1324
+ _onKeyDown(event) {
1325
+ this._backSpacePressed = false;
1326
+ const { target, previousElement } = this._getElements(event);
1327
+ if (event.key === 'Backspace') {
1328
+ this._backSpacePressed = true;
1329
+ if (previousElement && !target.value) {
1330
+ previousElement.focus();
1331
+ }
1332
+ this._emitValue();
1333
+ }
1334
+ }
1335
+ get id() {
1336
+ return this.elementId || `c-otp-input--${COtpInput._uniqueId}`;
1337
+ }
1338
+ _onInput(event) {
1339
+ const { target, nextElement, previousElement } = this._getElements(event);
1340
+ if (isNaN(+target.value)) {
1341
+ event.preventDefault();
1342
+ target.value = null;
1343
+ return;
1344
+ }
1345
+ if (this._isPasting) {
1346
+ this._isPasting = false;
1347
+ return;
1348
+ }
1349
+ if (this._backSpacePressed) {
1350
+ return;
1351
+ }
1352
+ if (event.data) {
1353
+ nextElement === null || nextElement === void 0 ? void 0 : nextElement.focus();
1354
+ }
1355
+ else {
1356
+ previousElement === null || previousElement === void 0 ? void 0 : previousElement.focus();
1357
+ }
1358
+ this._emitValue();
1359
+ }
1360
+ _onPaste(event) {
1361
+ event.preventDefault();
1362
+ const pasteData = event.clipboardData.getData('text');
1363
+ if (isNaN(+pasteData)) {
1364
+ return;
1365
+ }
1366
+ this._isPasting = true;
1367
+ for (const [index, value] of pasteData.split('').entries()) {
1368
+ if (index >= this._inputs.length) {
1369
+ continue;
1370
+ }
1371
+ this._inputs[index].value = null;
1372
+ this._inputs[index].value = value;
1373
+ }
1374
+ const nextElementIndex = Math.min(this.length, pasteData.length) - 1;
1375
+ requestAnimationFrame(() => {
1376
+ this._inputs[nextElementIndex].focus();
1377
+ this._emitValue();
1378
+ });
1379
+ }
1380
+ _updateStatusText() {
1381
+ if (this._debounce !== null) {
1382
+ clearTimeout(this._debounce);
1383
+ this._debounce = null;
1384
+ }
1385
+ this._debounce = window.setTimeout(() => {
1386
+ this.statusText = this.valid ? '' : `Error: ${this.validation} `;
1387
+ this.statusText += `Currently entered - ${this._value
1388
+ .split('')
1389
+ .join(' - ')}`;
1390
+ this.statusText = this.statusText.trim();
1391
+ this._debounce = null;
1392
+ }, 1400);
1393
+ }
1394
+ _renderInput(index$1) {
1395
+ return (index.h("input", { id: `${this.id}--input-${index$1 + 1}`, ref: (el) => (this._inputs[index$1] = el), "aria-label": `Enter code - digit number - ${index$1 + 1} of ${this.length}`, type: "tel", maxlength: "1", onFocus: () => this._onFocus(index$1), onInput: (event) => this._onInput(event), onKeyDown: (event) => this._onKeyDown(event), onPaste: (event) => index$1 === 0 && this._onPaste(event) }));
1396
+ }
1397
+ componentWillLoad() {
1398
+ COtpInput._uniqueId += 1;
1399
+ this.internals.setFormValue(this._value);
1400
+ }
1401
+ render() {
1402
+ const classes = {
1403
+ 'c-otp-input': true,
1404
+ 'c-otp-input--hide-details': this.hideDetails,
1405
+ };
1406
+ return (index.h(index.Host, { id: this.id, style: { '--_c-otp-input-count': this.length.toString() }, class: { error: !this.valid } }, index.h("div", { id: 'announce-' + this.id, class: "visuallyhidden", "aria-live": "polite", "aria-atomic": "true" }, this.statusText), index.h("div", { class: classes }, new Array(this.length)
1407
+ .fill(0)
1408
+ .map((_, index) => this._renderInput(index)), index.h("c-message", { hint: this.hint, inputId: this.elementId, valid: this.valid, validation: this.validation }))));
1409
+ }
1410
+ static get formAssociated() { return true; }
1411
+ static get watchers() { return {
1412
+ "validation": ["onValidationMessageChange"]
1413
+ }; }
1414
+ };
1415
+ COtpInput._uniqueId = 0;
1416
+ COtpInput.style = cOtpInputCss;
1417
+
1418
+ const cRadioCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{display:block}";
1419
+
1420
+ const CRadio = class {
1421
+ constructor(hostRef) {
1422
+ index.registerInstance(this, hostRef);
1423
+ this.checked = false;
1424
+ this.disabled = false;
1425
+ this.value = undefined;
1426
+ }
1427
+ render() {
1428
+ return index.h(index.Host, null);
1429
+ }
1430
+ };
1431
+ CRadio.style = cRadioCss;
1432
+
1433
+ const cRadioGroupCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{--_c-radio-group-background-color-hover:var(--c-radio-group-background-color-hover, rgba(var(--c-primary-rgb), 0.1));--_c-radio-group-color:var(--c-radio-group-color, var(--c-primary-600));--_c-radio-group-color-active:var(--c-radio-group-color-active, var(--_c-radio-group-color));--_c-radio-group-color-disabled:var(--c-radio-group-color-disabled, var(--c-tertiary-500));display:flex;flex-direction:column;gap:4px;width:fit-content}.c-radio-group{--_c-radio-group-error-color:var(--c-error-600);--_c-radio-flex-direction:column;--_c-radio-item-gap:2px}.c-radio-group__items{display:flex;flex-flow:var(--_c-radio-flex-direction) wrap;gap:var(--_c-radio-item-gap)}.c-radio-group__label span.required{color:var(--_c-radio-group-error-color)}.c-radio-group--disabled{--_c-radio-group-color:var(--_c-radio-group-color-disabled);--_c-radio-group-error-color:var(--_c-radio-group-color-disabled);color:var(--_c-radio-group-color-disabled);cursor:default;opacity:0.75}.c-radio-group--error{--_c-radio-group-color:var(--_c-radio-group-error-color);--_c-radio-group-color-active:var(--_c-radio-group-error-color);color:var(--_c-radio-group-error-color)}.c-radio-group--inline{--_c-radio-flex-direction:row;--_c-radio-item-gap:12px}.c-radio{align-items:flex-start;display:flex;position:relative;cursor:pointer;font-size:16px;user-select:none;gap:4px;line-height:1.2}.c-radio input{position:absolute;opacity:0;cursor:pointer;height:0;width:0}.c-radio input:checked~.ripple .selection::after{display:block;transform:scale(1)}.c-radio .ripple{position:relative;height:42px;width:42px;min-width:42px;border-radius:50%;overflow:hidden;transition:translateZ(0);color:var(--_c-radio-group-color)}.c-radio .selection{position:absolute;top:11px;left:11px;height:20px;width:20px;background-color:transparent;box-shadow:inset 0 0 0 2px var(--_c-radio-group-color);border-radius:50%;transition:box-shadow 0.15s ease-in-out}.c-radio .selection::after{content:\"\";position:absolute;transform:scale(0);transition:transform 0.15s ease-in-out;top:5px;left:5px;width:10px;height:10px;border-radius:50%;background:var(--_c-radio-group-color-active)}.c-radio__details{line-height:1;padding:0 12px}.c-radio__details.active .c-radio__message{opacity:1;transform:translateY(0)}.c-radio__message{font-size:12px;opacity:0;transform:translateY(-4px);transition:all 0.2s cubic-bezier(0.25, 0.8, 0.5, 1)}.c-radio__message--hint{color:var(--c-tertiary-500)}.c-radio__message--error{color:var(--_c-radio-group-error-color) !important}.c-radio__message span{align-items:flex-start;display:flex;gap:4px;height:16px}.c-radio__message span.error{color:var(--_c-radio-group-error-color)}.c-radio__message span.hint{color:var(--c-tertiary-500)}.c-radio__message svg{fill:currentColor;min-height:16px;min-width:16px;position:relative;top:-2px}.c-radio__label{padding-top:12px}.c-radio--disabled{--_c-radio-group-color:var(--_c-radio-group-color-disabled);--_c-radio-group-color-active:var(--_c-radio-group-color-disabled);color:var(--_c-radio-group-color);cursor:default;opacity:0.75}.c-radio--error{--_c-radio-group-color:var(--_c-radio-group-error-color);color:var(--_c-radio-group-error-color)}.c-radio--error span,.c-radio--error svg{fill:var(--_c-radio-group-error-color);color:var(--_c-radio-group-error-color)}.c-radio input:focus{outline:none}.c-radio input:focus+.ripple{outline:2px var(--_c-radio-group-color-active) solid}@supports selector(:focus-visible){.c-radio input:focus+.ripple{outline:none}}.c-radio input:focus-visible+.ripple{outline:2px var(--_c-radio-group-color) solid}.c-radio:not(.c-radio--disabled) .ripple:hover{background-color:var(--_c-radio-group-background-color-hover)}";
1434
+
1435
+ const CRadioGroup = class {
1436
+ constructor(hostRef) {
1437
+ index.registerInstance(this, hostRef);
1438
+ this.changeValue = index.createEvent(this, "changeValue", 3);
1439
+ if (hostRef.$hostElement$["s-ei"]) {
1440
+ this.internals = hostRef.$hostElement$["s-ei"];
1441
+ }
1442
+ else {
1443
+ this.internals = hostRef.$hostElement$.attachInternals();
1444
+ hostRef.$hostElement$["s-ei"] = this.internals;
1445
+ }
1446
+ this._containers = [];
1447
+ this._rippleElements = [];
1448
+ this._handleSlotChange = () => {
1449
+ this._getRadioButtons();
1450
+ };
1451
+ this._getRadioButtons = () => {
1452
+ const radios = this.el.querySelectorAll('c-radio');
1453
+ if (radios.length) {
1454
+ this.returnObject = false;
1455
+ this.items = [
1456
+ ...Array.from(radios).map((radio) => {
1457
+ if (!!radio.checked) {
1458
+ this.value = radio.value;
1459
+ this.changeValue.emit(this.value);
1460
+ }
1461
+ radio.style.display = 'none';
1462
+ return {
1463
+ name: radio.textContent,
1464
+ value: radio.value,
1465
+ disabled: !!radio.disabled,
1466
+ };
1467
+ }),
1468
+ ];
1469
+ }
1470
+ };
1471
+ this._getRadioButton = (item, index$1) => {
1472
+ var _a, _b, _c;
1473
+ const itemId = item.value.toString().replace(/[^a-zA-Z0-9-_]/g, '');
1474
+ const isChecked = !this.returnObject
1475
+ ? ((_b = (_a = this.items) === null || _a === void 0 ? void 0 : _a.find((i) => i.value === item.value)) === null || _b === void 0 ? void 0 : _b.value) === this.value
1476
+ : ((_c = this.value) === null || _c === void 0 ? void 0 : _c.value) === item.value;
1477
+ const classes = {
1478
+ 'c-radio': true,
1479
+ 'c-radio--disabled': !!item.disabled || this.disabled,
1480
+ 'c-radio--error': this.messageOptions.type === 'error',
1481
+ };
1482
+ return (index.h("label", { class: classes, id: itemId, onKeyDown: (event) => this._handleKeyDown(event, item, index$1) }, index.h("input", { type: "radio", "aria-checked": (this.value === item).toString(), "aria-disabled": (!!item.disabled || this.disabled).toString(), "aria-labelledby": itemId, disabled: !!item.disabled || this.disabled, checked: isChecked, name: CRadioGroup._uniqueId.toString(), onChange: (event) => this._select(event, item, index$1) }), index.h("span", { class: "ripple", ref: (el) => (this._containers[index$1] = el) }, index.h("span", { class: "selection" }), index.h("c-ripple", { ref: (el) => (this._rippleElements[index$1] = el) })), index.h("div", { class: "c-radio__label" }, item.name)));
1483
+ };
1484
+ this._validationIcon = (index.h("svg", { height: "16px", width: "16px", viewBox: "0 0 24 24" }, index.h("path", { d: mdi.mdiCloseCircle })));
1485
+ this.value = undefined;
1486
+ this.hideDetails = false;
1487
+ this.hint = '';
1488
+ this.inline = false;
1489
+ this.label = undefined;
1490
+ this.color = '';
1491
+ this.items = [];
1492
+ this.disabled = false;
1493
+ this.returnObject = false;
1494
+ this.required = false;
1495
+ this.valid = true;
1496
+ this.validation = 'Required field';
1497
+ this.messageOptions = {
1498
+ show: true,
1499
+ type: 'hint',
1500
+ content: '',
1501
+ };
1502
+ }
1503
+ onValidationMessageChange(message) {
1504
+ this.onValidChange(message.length === 0);
1505
+ }
1506
+ onValidChange(valid) {
1507
+ this._handleValidation(valid || this.valid);
1508
+ }
1509
+ componentDidLoad() {
1510
+ this._handleValidation(this.valid, 0);
1511
+ }
1512
+ _handleKeyDown(event, item, index) {
1513
+ if (['Space', 'Enter'].includes(event.code)) {
1514
+ event.preventDefault();
1515
+ this._select(event, item, index);
1516
+ }
1517
+ }
1518
+ _handleValidation(valid, timeout = 200) {
1519
+ this.messageOptions = Object.assign(Object.assign({}, this.messageOptions), { show: false });
1520
+ setTimeout(() => {
1521
+ this.messageOptions = Object.assign(Object.assign({}, this.messageOptions), { type: valid ? 'hint' : 'error', show: true, content: valid ? (index.h("span", null, this.hint)) : (index.h("span", null, this._validationIcon, " ", this.validation)) });
1522
+ }, timeout);
1523
+ }
1524
+ _select(event, item, index) {
1525
+ if (!!item.disabled || this.disabled)
1526
+ return;
1527
+ this._rippleElements[index].createRipple(event, this._containers[index], true);
1528
+ this.value = !this.returnObject ? item === null || item === void 0 ? void 0 : item.value : item;
1529
+ this.changeValue.emit(this.value);
1530
+ const value = !this.returnObject
1531
+ ? this.value
1532
+ : this.value.value;
1533
+ this.internals.setFormValue(value);
1534
+ }
1535
+ _renderMessages() {
1536
+ if (this.hideDetails)
1537
+ return;
1538
+ const classes = {
1539
+ 'c-radio__details': true,
1540
+ active: this.messageOptions.show,
1541
+ };
1542
+ const messageClasses = {
1543
+ 'c-radio__message': true,
1544
+ [`c-radio__message--${this.messageOptions.type}`]: true,
1545
+ };
1546
+ return (index.h("div", { class: classes }, index.h("div", { class: messageClasses }, this.messageOptions.content)));
1547
+ }
1548
+ componentWillLoad() {
1549
+ CRadioGroup._uniqueId += 1;
1550
+ const radios = this.el.querySelectorAll('c-radio');
1551
+ const checkedRadio = Array.from(radios).find((item) => item.checked);
1552
+ if (checkedRadio) {
1553
+ const value = checkedRadio.value;
1554
+ this.internals.setFormValue(value);
1555
+ }
1556
+ else if (this.value) {
1557
+ const value = !this.returnObject
1558
+ ? this.value
1559
+ : this.value.value;
1560
+ this.internals.setFormValue(value);
1561
+ }
1562
+ }
1563
+ render() {
1564
+ const slotHasContent = !!this.el.childNodes.length;
1565
+ const wrapperClasses = {
1566
+ 'c-radio-group': true,
1567
+ 'c-radio-group--disabled': this.disabled,
1568
+ 'c-radio-group--inline': this.inline,
1569
+ 'c-radio-group--error': this.messageOptions.type === 'error',
1570
+ };
1571
+ return (index.h("div", { class: wrapperClasses, role: "radiogroup", "aria-labelledby": "c-radio-group__label" }, (!!this.label || slotHasContent) && (index.h("label", { class: "c-radio-group__label" }, !!this.label && this.label, index.h("slot", { onSlotchange: this._handleSlotChange }), this.required && index.h("span", { class: "required" }, "\u00A0*"))), index.h("div", { class: "c-radio-group__items" }, this.items.map((item, index) => this._getRadioButton(item, index))), this._renderMessages()));
1572
+ }
1573
+ static get formAssociated() { return true; }
1574
+ get el() { return index.getElement(this); }
1575
+ static get watchers() { return {
1576
+ "validation": ["onValidationMessageChange"],
1577
+ "valid": ["onValidChange"]
1578
+ }; }
1579
+ };
1580
+ CRadioGroup._uniqueId = 0;
1581
+ CRadioGroup.style = cRadioGroupCss;
1582
+
1170
1583
  const cRippleCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host{pointer-events:none;user-select:none;display:block;overflow:hidden;position:absolute;top:0;left:0;border-radius:inherit;z-index:1}.c-ripple{position:absolute;pointer-events:none;border-radius:50%;transform:scale(0);background:currentColor;opacity:0}.c-ripple.animate{animation:ripple 0.5s backwards linear;opacity:0.3}@keyframes ripple{100%{opacity:0;transform:scale(5)}}";
1171
1584
 
1172
1585
  const CRipple = class {
@@ -1545,6 +1958,242 @@ const CSpinner = class {
1545
1958
  };
1546
1959
  CSpinner.style = cSpinnerCss;
1547
1960
 
1961
+ const cSwitchCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host(c-switch){--_c-switch-border-color:var(--c-switch-border-color, var(--c-tertiary-600));--_c-switch-handle-color:var(--c-switch-handle-color, var(--c-tertiary-600));--_c-switch-slider-color:var(--c-switch-slider-color, var(--c-transparent));--_c-switch-border-color-disabled:var(--c-switch-border-color-disabled, var(--c-transparent));--_c-switch-handle-color-disabled:var(--c-switch-handle-color-disabled, var(--c-tertiary-500));--_c-switch-slider-color-disabled:var(--c-switch-slider-color-disabled, var(--c-tertiary-200));--_c-switch-border-color-active:var(--c-switch-border-color-active, var(--c-primary-600));--_c-switch-handle-color-active:var(--c-switch-handle-color-active, var(--c-white));--_c-switch-slider-color-active:var(--c-switch-slider-color-active, var(--c-primary-600));--_c-switch-border-color-active-disabled:var(--c-switch-border-color-active-disabled, var(--c-tertiary-400));--_c-switch-handle-color-active-disabled:var(--c-switch-handle-color-active-disabled, var(--c-white));--_c-switch-slider-color-active-disabled:var(--c-switch-slider-color-active-disabled, var(--c-tertiary-400));display:inline-block}.c-switch{--_c-switch-handle-margin:5px;--_c-switch-pointer:pointer;--_c-switch-height:22px;--_c-switch-width:44px;--_c-switch-handle-size:calc(var(--_c-switch-height) - 2 * var(--_c-switch-handle-margin));--_c-switch-handle-position-active:calc(\n var(--_c-switch-width) - var(--_c-switch-handle-size) - 2 * var(--_c-switch-handle-margin)\n );backface-visibility:hidden;transform:translate3d(0, 0, 0);display:inline-grid;height:var(--_c-switch-height);position:relative;grid-template-columns:1fr;gap:12px;align-items:center}.c-switch--disabled{--_c-switch-pointer:default;--_c-switch-handle-color:var(--_c-switch-handle-color-disabled);--_c-switch-slider-color:var(--_c-switch-slider-color-disabled);--_c-switch-border-color:var(--_c-switch-border-color-disabled);--c-error-600:var(--c-tertiary-400);color:var(--c-tertiary-500)}.c-switch--label{grid-template-columns:var(--_c-switch-width) auto}.c-switch__label span.required{color:var(--c-error-600)}.c-switch__input{height:var(--_c-switch-height);position:relative;width:var(--_c-switch-width);align-self:start}.c-switch__slider{background-color:var(--_c-switch-slider-color);border-radius:var(--_c-switch-height);box-shadow:inset 0 0 0 2px var(--_c-switch-border-color);inset:0;cursor:var(--_c-switch-pointer);position:absolute;transform-origin:50% 50%;transition:0.3s cubic-bezier(0.25, 0.8, 0.5, 1)}.c-switch__slider::before{background-color:var(--_c-switch-handle-color);border-radius:50%;bottom:var(--_c-switch-handle-margin);content:\"\";height:var(--_c-switch-handle-size);left:var(--_c-switch-handle-margin);position:absolute;transition:0.3s cubic-bezier(0.25, 0.8, 0.5, 1);width:var(--_c-switch-handle-size)}.c-switch input{height:0;opacity:0;width:0}.c-switch input:checked+.c-switch__slider{--_c-switch-handle-color:var(--_c-switch-handle-color-active);--_c-switch-slider-color:var(--_c-switch-slider-color-active);--_c-switch-border-color:var(--_c-switch-border-color-active)}.c-switch input:checked+.c-switch__slider::before{transform:translateX(var(--_c-switch-handle-position-active))}.c-switch input:checked+.c-switch__slider--disabled{--_c-switch-handle-color:var(--_c-switch-handle-color-active-disabled);--_c-switch-slider-color:var(--_c-switch-slider-color-active-disabled);--_c-switch-border-color:var(--_c-switch-border-color-active-disabled)}.c-switch input:focus+.c-switch__slider{outline:none}.c-switch input:focus-visible+.c-switch__slider{outline:2px var(--c-primary-600) solid;outline-offset:2px}";
1962
+
1963
+ const CSwitch = class {
1964
+ constructor(hostRef) {
1965
+ index.registerInstance(this, hostRef);
1966
+ this.changeValue = index.createEvent(this, "changeValue", 3);
1967
+ if (hostRef.$hostElement$["s-ei"]) {
1968
+ this.internals = hostRef.$hostElement$["s-ei"];
1969
+ }
1970
+ else {
1971
+ this.internals = hostRef.$hostElement$.attachInternals();
1972
+ hostRef.$hostElement$["s-ei"] = this.internals;
1973
+ }
1974
+ this._toggleState = () => {
1975
+ if (this.hostDisabled)
1976
+ return;
1977
+ this.checked = !this.checked;
1978
+ this.changeValue.emit(this.checked ? this.trueValue : this.falseValue);
1979
+ this.internals.setFormValue(this.checked ? this.trueValue.toString() : this.falseValue.toString());
1980
+ };
1981
+ this.checked = false;
1982
+ this.value = false;
1983
+ this.trueValue = true;
1984
+ this.falseValue = false;
1985
+ this.hostDisabled = false;
1986
+ this.hostId = undefined;
1987
+ this.required = false;
1988
+ this.hasLabel = false;
1989
+ }
1990
+ componentWillLoad() {
1991
+ this.checked = this.checked || this.value === this.trueValue;
1992
+ this.internals.setFormValue(this.checked ? this.trueValue.toString() : this.falseValue.toString());
1993
+ }
1994
+ componentDidLoad() {
1995
+ const slotted = this.host.childNodes;
1996
+ this.hasLabel = slotted && slotted.length > 0;
1997
+ }
1998
+ render() {
1999
+ const classes = {
2000
+ 'c-switch': true,
2001
+ 'c-switch--disabled': !!this.hostDisabled,
2002
+ 'c-switch--label': this.hasLabel,
2003
+ };
2004
+ const sliderClasses = {
2005
+ 'c-switch__slider': true,
2006
+ 'c-switch__slider--disabled': !!this.hostDisabled,
2007
+ };
2008
+ return (index.h("label", { class: classes, htmlFor: this.hostId }, index.h("div", { class: "c-switch__input" }, index.h("input", { id: this.hostId, "aria-checked": this.checked.toString(), type: "checkbox", role: "switch", disabled: this.hostDisabled, checked: this.checked ? true : undefined, onChange: () => this._toggleState() }), index.h("span", { class: sliderClasses })), this.hasLabel ? (index.h("div", { class: "c-switch__label" }, index.h("slot", null), this.required && index.h("span", { class: "required" }, "\u00A0*"))) : null));
2009
+ }
2010
+ static get formAssociated() { return true; }
2011
+ get host() { return index.getElement(this); }
2012
+ };
2013
+ CSwitch.style = cSwitchCss;
2014
+
2015
+ const cTableCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:host,:root{--_c-table-border-color:var(--c-table-border-color, var(--c-tertiary-200));--_c-table-header-text-color:var(--c-table-header-text-color, var(--c-text-system));--_c-table-row-background-color-mobile:var(--c-table-row-background-color-mobile, rgba(var(--c-primary-rgb), 0.05))}table.c-table{border-collapse:collapse;border-spacing:0;border:0;font-size:100%;font-family:var(--c-font-family);margin:0;padding:0;width:100%}table.c-table slot{display:table}table.c-table caption,table.c-table tbody,table.c-table tfoot,table.c-table thead,table.c-table tr,table.c-table th,table.c-table td{border:0;font-size:100%;font-family:var(--c-font-family);margin:0;padding:0}table.c-table thead{background-color:var(--c-white);position:relative}table.c-table thead th{border-bottom:2px solid var(--_c-table-border-color);text-align:left}table.c-table tbody{box-shadow:inset 1px 0 0 0 var(--_c-table-border-color), inset -1px 0 0 0 var(--_c-table-border-color), inset 0 1px 0 0 var(--_c-table-border-color), inset 0 -1px 0 0 var(--_c-table-border-color);}@supports (-webkit-hyphens: none){table.c-table tbody{border:1px solid var(--_c-table-border-color)}table.c-table tbody tr{border-bottom:1px solid var(--_c-table-border-color)}}table.c-table tbody tr{box-shadow:inset 0 1px 0 0 var(--_c-table-border-color)}table.c-table tfoot{background-color:var(--c-white)}table.c-table tfoot tr{box-shadow:inset 0 1px 0 0 var(--_c-table-border-color)}table.c-table tfoot td{min-height:48px}table.c-table tfoot td c-pagination{flex:1}table.c-table th,table.c-table td{font-weight:400;box-sizing:border-box;line-height:normal;padding:16px}table.c-table th{height:48px;font-size:14px;color:var(--_c-table-header-text-color)}table.c-table td{font-size:16px;color:var(--c-text-body)}table.c-table--mobile{border-spacing:0 16px;border-collapse:separate}table.c-table--mobile tbody{box-shadow:none}table.c-table--mobile tbody tr{border-radius:4px;box-shadow:inset 0 0 0 1px var(--_c-table-border-color)}@supports (-webkit-hyphens: none){table.c-table--mobile tbody tr{display:grid;margin-bottom:16px;border:none}}table.c-table--mobile thead{display:none}table.c-table--mobile td{display:grid;gap:4px;padding:12px;min-height:62px}table.c-table--mobile td::before{font-size:14px;color:var(--_c-table-header-text-color);content:attr(data-title);display:inline-block;text-align:start;padding-right:8px}table.c-table--mobile td:nth-of-type(even){background-color:var(--_c-table-row-background-color-mobile)}";
2016
+
2017
+ const CTable = class {
2018
+ constructor(hostRef) {
2019
+ index.registerInstance(this, hostRef);
2020
+ this.mobileBreakpoint = 600;
2021
+ this.responsive = false;
2022
+ }
2023
+ get cells() {
2024
+ return Array.from(this._tableElement.querySelectorAll('td'));
2025
+ }
2026
+ get headers() {
2027
+ return Array.from(this._tableElement.querySelectorAll('th')).map((th) => th.innerHTML);
2028
+ }
2029
+ _handleResize(width) {
2030
+ const isMobile = width <= this.mobileBreakpoint;
2031
+ this._tableElement.classList.toggle('c-table--mobile', isMobile);
2032
+ }
2033
+ componentWillLoad() {
2034
+ this._tableElement = this.el.querySelector('table');
2035
+ this._tableElement.classList.add('c-table');
2036
+ this._observer = new ResizeObserver(([entry]) => {
2037
+ const { width } = entry.contentRect;
2038
+ this._handleResize(width);
2039
+ });
2040
+ }
2041
+ componentDidLoad() {
2042
+ if (this.responsive) {
2043
+ this._observer.observe(this._tableElement);
2044
+ }
2045
+ this.cells.forEach((cell, index) => {
2046
+ cell.dataset.title = this.headers[+index % this.headers.length];
2047
+ });
2048
+ }
2049
+ render() {
2050
+ return (index.h(index.Host, null, index.h("slot", null)));
2051
+ }
2052
+ get el() { return index.getElement(this); }
2053
+ };
2054
+ CTable.style = cTableCss;
2055
+
2056
+ const cTextFieldCss = "html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit;-webkit-tap-highlight-color:transparent}:host{font-family:var(--c-font-family)}::-ms-reveal{display:none}:root,:host{--_c-text-field-active-color:var(--c-text-field-active-color, var(--c-primary-600));--_c-text-field-inactive-color:var(--c-text-field-inactive-color, var(--c-tertiary-600));--_c-text-field-background-color:var(--c-text-field-background-color, var(--c-transparent));--_c-text-field-text-color:var(--c-text-field-text-color, var(--c-text-body));--_c-text-field-placeholder-color:var(--c-text-field-placeholder-color, var(--c-tertiary-500));--_c-text-field-shadow-active-color:var(--c-text-field-shadow-active-color, var(--_c-text-field-active-color));--_c-text-field-shadow-background-color:var(--c-text-field-shadow-background-color, var(--c-white));--_c-text-field-shadow-text-color:var(--c-text-field-shadow-text-color, var(--_c-text-field-text-color));--_c-text-field-shadow-placeholder-color:var(--c-text-field-shadow-placeholder-color, var(--_c-text-field-placeholder-color))}.c-input{--_c-input-active-color:var(--_c-text-field-active-color);--_c-input-inactive-color:var(--_c-text-field-inactive-color);--_c-input-background-color:var(--_c-text-field-background-color);--_c-input-text-color:var(--_c-text-field-text-color);--_c-input-placeholder-color:var(--_c-text-field-placeholder-color);--_c-input-shadow-active-color:var(--_c-text-field-shadow-active-color);--_c-input-shadow-background-color:var(--_c-text-field-shadow-background-color);--_c-input-shadow-text-color:var(--_c-text-field-shadow-text-color);--_c-input-shadow-placeholder-color:var(--_c-text-field-shadow-placeholder-color)}.c-input__password-toggle,.c-input__date-toggle{cursor:pointer;fill:currentColor;height:22px;width:22px}.c-input__password-toggle--disabled,.c-input__date-toggle--disabled{cursor:not-allowed;fill:var(--c-tertiary-500)}.c-input input[type=date]{opacity:0}.c-input input[type=date]::-webkit-calendar-picker-indicator,.c-input input[type=date]::-webkit-inner-spin-button{display:none;appearance:none}.c-input input[type=date]:focus,.c-input input[type=date].c-input__input--filled{opacity:1}";
2057
+
2058
+ const CTextField = class {
2059
+ constructor(hostRef) {
2060
+ index.registerInstance(this, hostRef);
2061
+ this.changeValue = index.createEvent(this, "changeValue", 3);
2062
+ if (hostRef.$hostElement$["s-ei"]) {
2063
+ this.internals = hostRef.$hostElement$["s-ei"];
2064
+ }
2065
+ else {
2066
+ this.internals = hostRef.$hostElement$.attachInternals();
2067
+ hostRef.$hostElement$["s-ei"] = this.internals;
2068
+ }
2069
+ this._originalType = '';
2070
+ this._handleChange = (event) => {
2071
+ this.value = this.trimWhitespace
2072
+ ? event.target.value.trim()
2073
+ : event.target.value;
2074
+ this.changeValue.emit(this.value);
2075
+ this.internals.setFormValue(this.value);
2076
+ };
2077
+ this._handleBlur = (event) => {
2078
+ if (this.trimWhitespace) {
2079
+ const trimmedValue = event.target.value.trim();
2080
+ event.target.value = trimmedValue;
2081
+ }
2082
+ };
2083
+ this._togglePasswordVisibility = () => {
2084
+ if (this.disabled)
2085
+ return;
2086
+ this.type = this.type === 'password' ? 'text' : 'password';
2087
+ };
2088
+ this.autofocus = false;
2089
+ this.autocapitalize = '';
2090
+ this.autocorrect = '';
2091
+ this.autocomplete = '';
2092
+ this.disabled = false;
2093
+ this.hideDetails = false;
2094
+ this.hint = '';
2095
+ this.hostId = undefined;
2096
+ this.trimWhitespace = false;
2097
+ this.label = undefined;
2098
+ this.max = null;
2099
+ this.min = null;
2100
+ this.name = undefined;
2101
+ this.number = false;
2102
+ this.placeholder = undefined;
2103
+ this.readonly = false;
2104
+ this.required = false;
2105
+ this.rows = 1;
2106
+ this.shadow = false;
2107
+ this.step = null;
2108
+ this.type = undefined;
2109
+ this.valid = true;
2110
+ this.validate = false;
2111
+ this.validateOnBlur = false;
2112
+ this.validation = 'Required field';
2113
+ this.value = undefined;
2114
+ this.isFocused = false;
2115
+ this.labelWidth = 0;
2116
+ this.preSlotWidth = 0;
2117
+ this.messageOptions = {
2118
+ show: true,
2119
+ type: 'hint',
2120
+ content: '',
2121
+ };
2122
+ }
2123
+ componentWillLoad() {
2124
+ CTextField._uniqueId += 1;
2125
+ this._originalType = this.type;
2126
+ this._inputId = `${(this.hostId ||
2127
+ this.label ||
2128
+ this.placeholder ||
2129
+ '').replace(/[^a-zA-Z0-9-_]/g, '')}_${CTextField._uniqueId}`;
2130
+ this.internals.setFormValue(this.value);
2131
+ }
2132
+ get isActive() {
2133
+ return !!this.value || this.isFocused;
2134
+ }
2135
+ get passwordIcon() {
2136
+ return this.type === 'password' ? mdi.mdiEye : mdi.mdiEyeOff;
2137
+ }
2138
+ _renderInputElement() {
2139
+ const props = {
2140
+ classes: {
2141
+ 'c-input__input': true,
2142
+ 'c-input__input--filled': !!this.value,
2143
+ },
2144
+ shared: {
2145
+ id: this._inputId,
2146
+ name: this.name,
2147
+ disabled: this.disabled,
2148
+ readonly: this.readonly,
2149
+ value: this.value,
2150
+ onInput: this._handleChange,
2151
+ onChange: this._handleChange,
2152
+ onBlur: this._handleBlur,
2153
+ },
2154
+ input: Object.assign(Object.assign(Object.assign({ type: this.number ? 'number' : this.type || 'text', min: this.min, max: this.max, step: this.step }, (!!this.autocomplete && { autocomplete: this.autocomplete })), (!!this.autocapitalize && { autocapitalize: this.autocapitalize })), (!!this.autocorrect && { autocorrect: this.autocorrect })),
2155
+ textArea: {
2156
+ rows: this.rows,
2157
+ },
2158
+ };
2159
+ const textInput = (index.h("input", Object.assign({ class: props.classes }, props.input, props.shared, { ref: (el) => (this._inputElement = el) })));
2160
+ const textArea = (index.h("textarea", Object.assign({ class: props.classes }, props.shared, props.textArea)));
2161
+ return this.rows > 1 ? textArea : textInput;
2162
+ }
2163
+ _isFirefox() {
2164
+ return !!navigator.userAgent.match(/firefox|fxios/i);
2165
+ }
2166
+ _renderDateToggle() {
2167
+ if (this._originalType !== 'date' || this._isFirefox())
2168
+ return;
2169
+ const classes = {
2170
+ 'c-input__date-toggle': true,
2171
+ 'c-input__date-toggle--disabled': this.disabled,
2172
+ };
2173
+ return (index.h("svg", { class: classes, viewBox: "0 0 24 24", onClick: this._toggleDatepicker.bind(this) }, index.h("path", { d: mdi.mdiCalendar })));
2174
+ }
2175
+ _toggleDatepicker() {
2176
+ var _a;
2177
+ (_a = this._inputElement) === null || _a === void 0 ? void 0 : _a.showPicker();
2178
+ }
2179
+ _renderPasswordToggle() {
2180
+ if (this._originalType !== 'password')
2181
+ return;
2182
+ const classes = {
2183
+ 'c-input__password-toggle': true,
2184
+ 'c-input__password-toggle--disabled': this.disabled,
2185
+ };
2186
+ return (index.h("svg", { class: classes, viewBox: "0 0 24 24", onClick: this._togglePasswordVisibility }, index.h("path", { d: this.passwordIcon })));
2187
+ }
2188
+ render() {
2189
+ return (index.h(index.Host, null, index.h("c-input", { autofocus: this.autofocus, disabled: this.disabled, "hide-details": this.hideDetails, hint: this.hint, id: this.hostId, "input-id": this._inputId, label: this.label, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, shadow: this.shadow, type: this.type, valid: this.valid, validate: this.validate, "validate-on-blur": this.validateOnBlur, validation: this.validation, value: this.value }, index.h("slot", { name: "pre", slot: "pre" }), this._renderInputElement(), this._renderPasswordToggle(), this._renderDateToggle(), index.h("slot", { name: "post" }))));
2190
+ }
2191
+ static get formAssociated() { return true; }
2192
+ get hiddenEl() { return index.getElement(this); }
2193
+ };
2194
+ CTextField._uniqueId = 0;
2195
+ CTextField.style = cTextFieldCss;
2196
+
1548
2197
  exports.c_autocomplete = CAutocomplete;
1549
2198
  exports.c_badge = CBadge;
1550
2199
  exports.c_button = CButton;
@@ -1552,14 +2201,21 @@ exports.c_card = CCard;
1552
2201
  exports.c_card_actions = CCardActions;
1553
2202
  exports.c_card_content = CCardContent;
1554
2203
  exports.c_card_title = CCardTitle;
2204
+ exports.c_checkbox = CCheckbox;
1555
2205
  exports.c_dropdown = CDropdown;
1556
2206
  exports.c_icon = CIcon;
1557
2207
  exports.c_icon_button = CIconButton;
1558
2208
  exports.c_input = CInput;
1559
2209
  exports.c_message = CMessage;
1560
2210
  exports.c_option = COption;
2211
+ exports.c_otp_input = COtpInput;
2212
+ exports.c_radio = CRadio;
2213
+ exports.c_radio_group = CRadioGroup;
1561
2214
  exports.c_ripple = CRipple;
1562
2215
  exports.c_select = CSelect;
1563
2216
  exports.c_spinner = CSpinner;
2217
+ exports.c_switch = CSwitch;
2218
+ exports.c_table = CTable;
2219
+ exports.c_text_field = CTextField;
1564
2220
 
1565
- //# sourceMappingURL=c-autocomplete_16.cjs.entry.js.map
2221
+ //# sourceMappingURL=c-autocomplete_23.cjs.entry.js.map