@cscfi/csc-ui 1.2.0 → 1.2.2

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 (199) hide show
  1. package/dist/cjs/{c-badge_12.cjs.entry.js → c-autocomplete_16.cjs.entry.js} +1174 -52
  2. package/dist/cjs/c-autocomplete_16.cjs.entry.js.map +1 -0
  3. package/dist/cjs/{c-checkbox_2.cjs.entry.js → c-checkbox_3.cjs.entry.js} +14 -1
  4. package/dist/cjs/c-checkbox_3.cjs.entry.js.map +1 -0
  5. package/dist/cjs/c-csc-logo.cjs.entry.js +23 -0
  6. package/dist/cjs/c-csc-logo.cjs.entry.js.map +1 -0
  7. package/dist/cjs/c-main.cjs.entry.js +21 -0
  8. package/dist/cjs/c-main.cjs.entry.js.map +1 -0
  9. package/dist/cjs/c-menu_2.cjs.entry.js +2 -23
  10. package/dist/cjs/c-menu_2.cjs.entry.js.map +1 -1
  11. package/dist/cjs/c-row.cjs.entry.js +35 -0
  12. package/dist/cjs/c-row.cjs.entry.js.map +1 -0
  13. package/dist/cjs/c-slider.cjs.entry.js +6 -6
  14. package/dist/cjs/c-slider.cjs.entry.js.map +1 -1
  15. package/dist/cjs/c-toolbar.cjs.entry.js +21 -0
  16. package/dist/cjs/c-toolbar.cjs.entry.js.map +1 -0
  17. package/dist/cjs/csc-ui.cjs.js +1 -1
  18. package/dist/cjs/getScrollParent-5d488045.js +28 -0
  19. package/dist/cjs/getScrollParent-5d488045.js.map +1 -0
  20. package/dist/cjs/index-91ba22ab.js +14 -30
  21. package/dist/cjs/loader.cjs.js +1 -1
  22. package/dist/collection/components/c-autocomplete/c-autocomplete.js +27 -3
  23. package/dist/collection/components/c-autocomplete/c-autocomplete.js.map +1 -1
  24. package/dist/collection/components/c-dropdown/c-dropdown.css +6 -1
  25. package/dist/collection/components/c-dropdown/c-dropdown.js +18 -19
  26. package/dist/collection/components/c-dropdown/c-dropdown.js.map +1 -1
  27. package/dist/collection/components/c-menu-items/c-menu-items.js +2 -23
  28. package/dist/collection/components/c-menu-items/c-menu-items.js.map +1 -1
  29. package/dist/collection/components/c-select/c-select.js +58 -23
  30. package/dist/collection/components/c-select/c-select.js.map +1 -1
  31. package/dist/collection/components/c-slider/c-slider.css +70 -68
  32. package/dist/collection/components/c-slider/c-slider.js +7 -7
  33. package/dist/collection/components/c-slider/c-slider.js.map +1 -1
  34. package/dist/collection/utils/getScrollParent.js +23 -0
  35. package/dist/collection/utils/getScrollParent.js.map +1 -0
  36. package/dist/collection/utils/index.js +2 -0
  37. package/dist/collection/utils/index.js.map +1 -0
  38. package/dist/components/c-autocomplete.js +28 -4
  39. package/dist/components/c-autocomplete.js.map +1 -1
  40. package/dist/components/c-dropdown2.js +19 -20
  41. package/dist/components/c-dropdown2.js.map +1 -1
  42. package/dist/components/c-menu-items2.js +2 -23
  43. package/dist/components/c-menu-items2.js.map +1 -1
  44. package/dist/components/c-select.js +59 -24
  45. package/dist/components/c-select.js.map +1 -1
  46. package/dist/components/c-slider.js +7 -7
  47. package/dist/components/c-slider.js.map +1 -1
  48. package/dist/components/getScrollParent.js +26 -0
  49. package/dist/components/getScrollParent.js.map +1 -0
  50. package/dist/csc-ui/csc-ui.esm.js +1 -1
  51. package/dist/csc-ui/csc-ui.esm.js.map +1 -1
  52. package/dist/csc-ui/p-040ed3e2.entry.js +2 -0
  53. package/dist/csc-ui/p-040ed3e2.entry.js.map +1 -0
  54. package/dist/csc-ui/{p-bf01d3ef.entry.js → p-1d6c84df.entry.js} +2 -2
  55. package/dist/csc-ui/p-39df362b.entry.js +2 -0
  56. package/dist/csc-ui/p-39df362b.entry.js.map +1 -0
  57. package/dist/csc-ui/{p-27904068.entry.js → p-3bb67f38.entry.js} +2 -2
  58. package/dist/csc-ui/p-3f0e51ff.js +2 -0
  59. package/dist/csc-ui/p-3f0e51ff.js.map +1 -0
  60. package/dist/csc-ui/{p-0569fc3e.entry.js → p-468d9583.entry.js} +2 -2
  61. package/dist/csc-ui/{p-16098e94.entry.js → p-56b1e1ea.entry.js} +2 -2
  62. package/dist/csc-ui/p-682782b1.entry.js +2 -0
  63. package/dist/csc-ui/p-682782b1.entry.js.map +1 -0
  64. package/dist/csc-ui/{p-958cf6ed.entry.js → p-6e046723.entry.js} +2 -2
  65. package/dist/csc-ui/p-9c5488fc.entry.js +2 -0
  66. package/dist/csc-ui/p-9c5488fc.entry.js.map +1 -0
  67. package/dist/csc-ui/{p-862486aa.entry.js → p-9c80f35e.entry.js} +2 -2
  68. package/dist/csc-ui/{p-873aa915.entry.js → p-ab62f9b5.entry.js} +2 -2
  69. package/dist/csc-ui/{p-45641e3d.entry.js → p-ae16b1f4.entry.js} +2 -2
  70. package/dist/csc-ui/{p-7af82ab9.entry.js → p-b0fa27b6.entry.js} +2 -2
  71. package/dist/csc-ui/{p-2a622e79.entry.js → p-b83651f8.entry.js} +2 -2
  72. package/dist/csc-ui/p-b83651f8.entry.js.map +1 -0
  73. package/dist/csc-ui/p-ba475561.entry.js +2 -0
  74. package/dist/csc-ui/p-ba475561.entry.js.map +1 -0
  75. package/dist/csc-ui/{p-64bcde03.entry.js → p-bda722d5.entry.js} +2 -2
  76. package/dist/csc-ui/{p-47ca0a95.entry.js → p-c8a7a751.entry.js} +2 -2
  77. package/dist/csc-ui/{p-c291cbe2.entry.js → p-ccef8a49.entry.js} +2 -2
  78. package/dist/csc-ui/p-ee753bac.entry.js +2 -0
  79. package/dist/csc-ui/p-ee753bac.entry.js.map +1 -0
  80. package/dist/csc-ui/{p-5461ca29.js → p-f24b9d97.js} +2 -2
  81. package/dist/csc-ui/p-fa83a615.entry.js +2 -0
  82. package/dist/csc-ui/p-fa83a615.entry.js.map +1 -0
  83. package/dist/esm/c-accordion-item.entry.js +1 -1
  84. package/dist/esm/c-alert.entry.js +1 -1
  85. package/dist/esm/{c-badge_12.entry.js → c-autocomplete_16.entry.js} +1168 -50
  86. package/dist/esm/c-autocomplete_16.entry.js.map +1 -0
  87. package/dist/esm/{c-checkbox_2.entry.js → c-checkbox_3.entry.js} +15 -3
  88. package/dist/esm/c-checkbox_3.entry.js.map +1 -0
  89. package/dist/esm/c-csc-logo.entry.js +19 -0
  90. package/dist/esm/c-csc-logo.entry.js.map +1 -0
  91. package/dist/esm/c-data-table.entry.js +1 -1
  92. package/dist/esm/c-main.entry.js +17 -0
  93. package/dist/esm/c-main.entry.js.map +1 -0
  94. package/dist/esm/c-menu_2.entry.js +3 -24
  95. package/dist/esm/c-menu_2.entry.js.map +1 -1
  96. package/dist/esm/c-navigation-button.entry.js +1 -1
  97. package/dist/esm/c-radio-group.entry.js +1 -1
  98. package/dist/esm/c-row.entry.js +31 -0
  99. package/dist/esm/c-row.entry.js.map +1 -0
  100. package/dist/esm/c-side-navigation-item.entry.js +1 -1
  101. package/dist/esm/c-side-navigation.entry.js +1 -1
  102. package/dist/esm/c-slider.entry.js +6 -6
  103. package/dist/esm/c-slider.entry.js.map +1 -1
  104. package/dist/esm/c-swiper.entry.js +1 -1
  105. package/dist/esm/c-tabs.entry.js +1 -1
  106. package/dist/esm/c-tag.entry.js +1 -1
  107. package/dist/esm/c-text-field.entry.js +1 -1
  108. package/dist/esm/c-toast.entry.js +1 -1
  109. package/dist/esm/c-toolbar.entry.js +17 -0
  110. package/dist/esm/c-toolbar.entry.js.map +1 -0
  111. package/dist/esm/csc-ui.js +1 -1
  112. package/dist/esm/getScrollParent-f876ad1b.js +26 -0
  113. package/dist/esm/getScrollParent-f876ad1b.js.map +1 -0
  114. package/dist/esm/index-47956d53.js +14 -30
  115. package/dist/esm/loader.js +1 -1
  116. package/dist/esm/{mdi-e92c0e44.js → mdi-8656e74a.js} +2 -2
  117. package/dist/esm/{mdi-e92c0e44.js.map → mdi-8656e74a.js.map} +1 -1
  118. package/dist/types/components/c-autocomplete/c-autocomplete.d.ts +1 -0
  119. package/dist/types/components/c-dropdown/c-dropdown.d.ts +2 -1
  120. package/dist/types/components/c-menu-items/c-menu-items.d.ts +0 -1
  121. package/dist/types/components/c-select/c-select.d.ts +3 -0
  122. package/dist/types/components/c-slider/c-slider.d.ts +1 -1
  123. package/dist/types/components.d.ts +8 -8
  124. package/dist/types/utils/getScrollParent.d.ts +1 -0
  125. package/dist/types/utils/index.d.ts +1 -0
  126. package/package.json +1 -1
  127. package/vscode-data.json +4 -4
  128. package/dist/cjs/c-autocomplete.cjs.entry.js +0 -251
  129. package/dist/cjs/c-autocomplete.cjs.entry.js.map +0 -1
  130. package/dist/cjs/c-badge_12.cjs.entry.js.map +0 -1
  131. package/dist/cjs/c-card-actions.cjs.entry.js +0 -28
  132. package/dist/cjs/c-card-actions.cjs.entry.js.map +0 -1
  133. package/dist/cjs/c-card-content.cjs.entry.js +0 -21
  134. package/dist/cjs/c-card-content.cjs.entry.js.map +0 -1
  135. package/dist/cjs/c-card-title.cjs.entry.js +0 -21
  136. package/dist/cjs/c-card-title.cjs.entry.js.map +0 -1
  137. package/dist/cjs/c-checkbox_2.cjs.entry.js.map +0 -1
  138. package/dist/cjs/c-dropdown_2.cjs.entry.js +0 -512
  139. package/dist/cjs/c-dropdown_2.cjs.entry.js.map +0 -1
  140. package/dist/cjs/c-message.cjs.entry.js +0 -67
  141. package/dist/cjs/c-message.cjs.entry.js.map +0 -1
  142. package/dist/cjs/c-option.cjs.entry.js +0 -25
  143. package/dist/cjs/c-option.cjs.entry.js.map +0 -1
  144. package/dist/cjs/c-select.cjs.entry.js +0 -276
  145. package/dist/cjs/c-select.cjs.entry.js.map +0 -1
  146. package/dist/csc-ui/p-019c6898.entry.js +0 -2
  147. package/dist/csc-ui/p-019c6898.entry.js.map +0 -1
  148. package/dist/csc-ui/p-0666f12d.entry.js +0 -2
  149. package/dist/csc-ui/p-0666f12d.entry.js.map +0 -1
  150. package/dist/csc-ui/p-088b9c5e.entry.js +0 -2
  151. package/dist/csc-ui/p-088b9c5e.entry.js.map +0 -1
  152. package/dist/csc-ui/p-2a622e79.entry.js.map +0 -1
  153. package/dist/csc-ui/p-4e1d8f5d.entry.js +0 -2
  154. package/dist/csc-ui/p-4e1d8f5d.entry.js.map +0 -1
  155. package/dist/csc-ui/p-6c5e538b.entry.js +0 -2
  156. package/dist/csc-ui/p-6c5e538b.entry.js.map +0 -1
  157. package/dist/csc-ui/p-bbe8423c.entry.js +0 -2
  158. package/dist/csc-ui/p-bbe8423c.entry.js.map +0 -1
  159. package/dist/csc-ui/p-bddd9153.entry.js +0 -2
  160. package/dist/csc-ui/p-bddd9153.entry.js.map +0 -1
  161. package/dist/csc-ui/p-d1089126.entry.js +0 -2
  162. package/dist/csc-ui/p-d1089126.entry.js.map +0 -1
  163. package/dist/csc-ui/p-d2fc8cb4.entry.js +0 -2
  164. package/dist/csc-ui/p-d2fc8cb4.entry.js.map +0 -1
  165. package/dist/csc-ui/p-ec167606.entry.js +0 -2
  166. package/dist/csc-ui/p-ec167606.entry.js.map +0 -1
  167. package/dist/csc-ui/p-f148aad1.entry.js +0 -2
  168. package/dist/csc-ui/p-f148aad1.entry.js.map +0 -1
  169. package/dist/esm/c-autocomplete.entry.js +0 -247
  170. package/dist/esm/c-autocomplete.entry.js.map +0 -1
  171. package/dist/esm/c-badge_12.entry.js.map +0 -1
  172. package/dist/esm/c-card-actions.entry.js +0 -24
  173. package/dist/esm/c-card-actions.entry.js.map +0 -1
  174. package/dist/esm/c-card-content.entry.js +0 -17
  175. package/dist/esm/c-card-content.entry.js.map +0 -1
  176. package/dist/esm/c-card-title.entry.js +0 -17
  177. package/dist/esm/c-card-title.entry.js.map +0 -1
  178. package/dist/esm/c-checkbox_2.entry.js.map +0 -1
  179. package/dist/esm/c-dropdown_2.entry.js +0 -507
  180. package/dist/esm/c-dropdown_2.entry.js.map +0 -1
  181. package/dist/esm/c-message.entry.js +0 -63
  182. package/dist/esm/c-message.entry.js.map +0 -1
  183. package/dist/esm/c-option.entry.js +0 -21
  184. package/dist/esm/c-option.entry.js.map +0 -1
  185. package/dist/esm/c-select.entry.js +0 -272
  186. package/dist/esm/c-select.entry.js.map +0 -1
  187. /package/dist/csc-ui/{p-bf01d3ef.entry.js.map → p-1d6c84df.entry.js.map} +0 -0
  188. /package/dist/csc-ui/{p-27904068.entry.js.map → p-3bb67f38.entry.js.map} +0 -0
  189. /package/dist/csc-ui/{p-0569fc3e.entry.js.map → p-468d9583.entry.js.map} +0 -0
  190. /package/dist/csc-ui/{p-16098e94.entry.js.map → p-56b1e1ea.entry.js.map} +0 -0
  191. /package/dist/csc-ui/{p-958cf6ed.entry.js.map → p-6e046723.entry.js.map} +0 -0
  192. /package/dist/csc-ui/{p-862486aa.entry.js.map → p-9c80f35e.entry.js.map} +0 -0
  193. /package/dist/csc-ui/{p-873aa915.entry.js.map → p-ab62f9b5.entry.js.map} +0 -0
  194. /package/dist/csc-ui/{p-45641e3d.entry.js.map → p-ae16b1f4.entry.js.map} +0 -0
  195. /package/dist/csc-ui/{p-7af82ab9.entry.js.map → p-b0fa27b6.entry.js.map} +0 -0
  196. /package/dist/csc-ui/{p-64bcde03.entry.js.map → p-bda722d5.entry.js.map} +0 -0
  197. /package/dist/csc-ui/{p-47ca0a95.entry.js.map → p-c8a7a751.entry.js.map} +0 -0
  198. /package/dist/csc-ui/{p-c291cbe2.entry.js.map → p-ccef8a49.entry.js.map} +0 -0
  199. /package/dist/csc-ui/{p-5461ca29.js.map → p-f24b9d97.js.map} +0 -0
@@ -1,5 +1,277 @@
1
- import { r as registerInstance, h, H as Host, c as createEvent, g as getElement } from './index-47956d53.js';
2
- import { m as mdiFullscreenExit, a as mdiFullscreen } from './mdi-e92c0e44.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-47956d53.js';
2
+ import { m as mdiChevronDown, a as mdiClose, b as mdiFullscreenExit, c as mdiFullscreen, d as mdiAlert, e as mdiCloseCircle } from './mdi-8656e74a.js';
3
+ import { g as getScrollParent } from './getScrollParent-f876ad1b.js';
4
+
5
+ const cAutocompleteCss = "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-autocomplete){--_c-autocomplete-option-background-color:var(\n --c-autocomplete-option-background-color,\n var(--c-white)\n );--_c-autocomplete-option-background-hover-color:var(\n --c-autocomplete-option-background-hover-color,\n var(--c-primary-100)\n );--_c-autocomplete-active-color:var(\n --c-autocomplete-active-color,\n var(--c-primary-600)\n );--_c-autocomplete-inactive-color:var(\n --c-autocomplete-inactive-color,\n var(--c-tertiary-600)\n );--_c-autocomplete-background-color:var(\n --c-autocomplete-background-color,\n var(--c-transparent)\n );--_c-autocomplete-text-color:var(\n --c-autocomplete-text-color,\n var(--c-text-body)\n );--_c-autocomplete-option-text-color:var(\n --c-autocomplete-option-text-color,\n var(--c-text-body)\n );--_c-autocomplete-placeholder-color:var(\n --c-autocomplete-placeholder-color,\n var(--c-tertiary-500)\n );--c-select-option-background-color:var(\n --_c-autocomplete-option-background-color\n );--c-select-option-background-color-hover:var(\n --_c-autocomplete-option-background-hover-color\n );--c-select-option-text-color:var(--_c-autocomplete-option-text-color);--_c-input-active-color:var(--_c-autocomplete-active-color);--_c-input-inactive-color:var(--_c-autocomplete-inactive-color);--_c-input-background-color:var(--_c-autocomplete-background-color);--_c-input-text-color:var(--_c-autocomplete-text-color);--_c-input-placeholder-color:var(--_c-autocomplete-placeholder-color)}:host{display:block;cursor:text}.c-input-menu__chevron{fill:currentColor;transform:rotate(0deg);transition:transform 0.3s ease-in-out}.c-input-menu__chevron--active{transform:rotate(180deg)}.c-input-menu__input{width:100%;display:flex;justify-items:stretch}.c-input-menu__selection{display:none;pointer-events:none}.c-input-menu__selection--show{align-items:center;display:flex;width:100%;color:var(--_c-select-active-color)}.c-input-menu__item-wrapper{position:absolute;width:100%;top:44px;z-index:10;margin-left:calc(var(--_c-input-label-position) * -1)}.c-input-menu__item-wrapper--shadow{top:47px}.c-input-menu__items{position:absolute;background-color:var(--_c-select-option-background-color);min-width:calc(100% + 24px);box-shadow:0 8px 16px 0 rgba(0, 0, 0, 0.2);z-index:10;user-select:none;border-radius:4px;margin:0 -12px;overflow-y:scroll;list-style:none;padding:0}.c-input-menu__items--hidden{display:none}.c-input-menu__items li{cursor:pointer;display:flex;min-height:48px;padding:0 12px;transition:background-color 0.3s;font-size:14px;align-items:center;justify-content:flex-start;color:var(--_c-select-option-text-color)}.c-input-menu__items li.disabled{background-color:var(--c-tertiary-100);filter:grayscale(1) opacity(0.6);cursor:default}.c-input-menu__items li.disabled:hover{background-color:var(--c-tertiary-100)}.c-input-menu__items li.dense{padding:10px 14px}.c-input-menu__items li:hover{background-color:var(--_c-select-option-background-color-hover)}.c-input-menu__items li[aria-selected=true]{background-color:var(--_c-select-option-background-color-hover);box-shadow:inset 0 0 0 1px var(--_c-select-active-color);border-radius:4px;backface-visibility:hidden;transform:translate3d(0, 0, 0)}.c-input-menu__items li.none{color:rgba(0, 0, 0, 0.5)}.c-input-menu__items--empty li{color:var(--c-text-system);cursor:default;gap:8px;pointer-events:none}.c-input-menu__items--empty li svg{fill:var(--c-warning-600);height:18px;width:18px}input{max-height:32px;padding:8px 0;background-color:transparent;border:none;color:var(--c-text-body);flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;line-height:20px;max-width:100%;min-width:0;width:100%;pointer-events:none}input:focus,input:active{outline:none}input::-ms-reveal{display:none}svg{fill:currentColor;height:22px;width:22px}.c-input--disabled{color:var(--c-tertiary-400)}.c-input:focus-within{color:var(--c-primary-600)}.c-input--error{color:var(--c-error-600)}.c-input--error:focus-within{color: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}";
6
+
7
+ const CAutocomplete = class {
8
+ constructor(hostRef) {
9
+ registerInstance(this, hostRef);
10
+ this.changeQuery = createEvent(this, "changeQuery", 7);
11
+ this.changeValue = createEvent(this, "changeValue", 3);
12
+ if (hostRef.$hostElement$["s-ei"]) {
13
+ this.internals = hostRef.$hostElement$["s-ei"];
14
+ }
15
+ else {
16
+ this.internals = hostRef.$hostElement$.attachInternals();
17
+ hostRef.$hostElement$["s-ei"] = this.internals;
18
+ }
19
+ this._preventDialogOpen = false;
20
+ this._debounce = null;
21
+ this._handleSlotChange = () => {
22
+ this.optionElements = this.el.querySelectorAll('c-option');
23
+ const selection = Array.from(this.optionElements).find((option) => option.selected);
24
+ if (selection) {
25
+ this.value = this.returnObject
26
+ ? { name: selection.name, value: selection.value }
27
+ : selection.value;
28
+ this.changeValue.emit(this.value);
29
+ this.query = selection.name.toString();
30
+ this.changeQuery.emit(selection.value);
31
+ this.internals.setFormValue(selection.value.toString());
32
+ }
33
+ if (this.optionElements.length && !this.optionElementsExist) {
34
+ this.optionElementsExist = true;
35
+ }
36
+ };
37
+ this._toggleDropdown = (event) => {
38
+ event.stopPropagation();
39
+ if (this.dropdownVisible) {
40
+ this._dropdownElement.close();
41
+ return;
42
+ }
43
+ this._dropdownElement.open();
44
+ };
45
+ this._onButtonKeyDown = (src, event) => {
46
+ event.stopPropagation();
47
+ if (event.key !== 'Tab')
48
+ event.preventDefault();
49
+ if (['Enter', ' '].includes(event.key)) {
50
+ if (src === 'chevron') {
51
+ this._toggleDropdown(event);
52
+ return;
53
+ }
54
+ this._reset(event);
55
+ this._preventDialogOpen = true;
56
+ this._inputElement.focus();
57
+ }
58
+ };
59
+ this._reset = (event) => {
60
+ event.stopPropagation();
61
+ this.query = '';
62
+ this.value = null;
63
+ this.changeValue.emit(null);
64
+ this.internals.setFormValue(null);
65
+ this.changeQuery.emit('');
66
+ this._preventDialogOpen = true;
67
+ this._cInputElement.reset();
68
+ this._inputElement.focus();
69
+ this._dropdownElement.updateList();
70
+ };
71
+ this._onInputFocus = () => {
72
+ if (!this._preventDialogOpen) {
73
+ this._dropdownElement.open();
74
+ }
75
+ this._updateStatusText();
76
+ this._preventDialogOpen = false;
77
+ };
78
+ this.items = [];
79
+ this.value = null;
80
+ this.query = null;
81
+ this.hostId = undefined;
82
+ this.disabled = false;
83
+ this.label = undefined;
84
+ this.name = undefined;
85
+ this.placeholder = '';
86
+ this.hideDetails = false;
87
+ this.hint = '';
88
+ this.loading = false;
89
+ this.required = false;
90
+ this.valid = true;
91
+ this.validate = false;
92
+ this.validateOnBlur = false;
93
+ this.validation = 'Required field';
94
+ this.shadow = false;
95
+ this.returnObject = false;
96
+ this.itemsPerPage = 6;
97
+ this.optionElements = undefined;
98
+ this.currentIndex = null;
99
+ this.dropdownVisible = false;
100
+ this.statusText = '';
101
+ this.optionElementsExist = false;
102
+ }
103
+ get _id() {
104
+ return this.hostId || `autocomplete_${CAutocomplete._uniqueId}`;
105
+ }
106
+ async reset() {
107
+ this.query = '';
108
+ this.changeValue.emit(null);
109
+ this.internals.setFormValue(null);
110
+ this.changeQuery.emit('');
111
+ this._dropdownElement.updateList();
112
+ }
113
+ handleKeyDown(event) {
114
+ const alphanumeric = /^[0-9a-zA-Z ]+$/;
115
+ if (event.key.match(alphanumeric) && event.key.length === 1) {
116
+ if (!this.dropdownVisible) {
117
+ this._dropdownElement.open();
118
+ return;
119
+ }
120
+ this._inputElement.focus();
121
+ return;
122
+ }
123
+ if (event.key === 'Escape') {
124
+ event.preventDefault();
125
+ this._preventDialogOpen = true;
126
+ this._dropdownElement.close();
127
+ requestAnimationFrame(() => {
128
+ this._inputElement.focus();
129
+ });
130
+ return;
131
+ }
132
+ if (event.key === 'Tab') {
133
+ this._inputElement.focus();
134
+ requestAnimationFrame(() => {
135
+ this._dropdownElement.close();
136
+ });
137
+ return;
138
+ }
139
+ if (event.key === 'ArrowDown') {
140
+ event.preventDefault();
141
+ if (!this._items.length)
142
+ return;
143
+ if (!this.dropdownVisible || this.currentIndex === null) {
144
+ this.currentIndex = 0;
145
+ this._dropdownElement.open();
146
+ this._dropdownElement.focusItem(this.currentIndex);
147
+ return;
148
+ }
149
+ this.currentIndex = Math.min(this.currentIndex + 1, this._items.length - 1);
150
+ this._dropdownElement.focusItem(this.currentIndex);
151
+ return;
152
+ }
153
+ if (event.key === 'ArrowUp') {
154
+ event.preventDefault();
155
+ if (this.currentIndex === 0) {
156
+ this._dropdownElement.close();
157
+ this._inputElement.focus();
158
+ }
159
+ if (!this.dropdownVisible || this.currentIndex === null) {
160
+ this.currentIndex = this._items.length - 1;
161
+ this._dropdownElement.open();
162
+ this._dropdownElement.focusItem(this.currentIndex);
163
+ return;
164
+ }
165
+ this.currentIndex = Math.max(this.currentIndex - 1, 0);
166
+ this._dropdownElement.focusItem(this.currentIndex);
167
+ }
168
+ if (event.key === 'Enter') {
169
+ event.preventDefault();
170
+ if (this.currentIndex === null)
171
+ return;
172
+ this._dropdownElement.selectItem(this.currentIndex);
173
+ }
174
+ if (event.key === 'Home' && this.dropdownVisible) {
175
+ this.currentIndex = 0;
176
+ }
177
+ if (event.key === 'End' && this.dropdownVisible) {
178
+ this.currentIndex = this._items.length - 1;
179
+ }
180
+ }
181
+ onDropdownStateChange(event) {
182
+ const isOpen = event.detail;
183
+ this.dropdownVisible = isOpen;
184
+ if (!isOpen) {
185
+ requestAnimationFrame(() => {
186
+ this.currentIndex = null;
187
+ });
188
+ }
189
+ }
190
+ onSelectOption(event) {
191
+ this._dropdownElement.close();
192
+ const { name, value } = event.detail;
193
+ this.value = this.returnObject ? event.detail : value;
194
+ this.changeValue.emit(this.value);
195
+ this.internals.setFormValue(value);
196
+ this.query = name;
197
+ this.changeQuery.emit(name);
198
+ this._preventDialogOpen = true;
199
+ if (this.optionElementsExist) {
200
+ Array.from(this.optionElements).forEach((item) => {
201
+ item.selected = item.value === value && item.name === name;
202
+ });
203
+ this._dropdownElement.updateList();
204
+ }
205
+ this._inputElement.focus();
206
+ }
207
+ handleQueryChange() {
208
+ this._updateStatusText();
209
+ }
210
+ _updateInput(event) {
211
+ this._dropdownElement.open();
212
+ this.query = event.target.value;
213
+ this.changeQuery.emit(this.query);
214
+ this._dropdownElement.updateList();
215
+ }
216
+ _renderLoader() {
217
+ return h("c-spinner", { color: "var(--_c-autocomplete-active-color)", size: 20 });
218
+ }
219
+ _renderChevron() {
220
+ const classes = {
221
+ 'c-input-menu__chevron': true,
222
+ 'c-input-menu__chevron--active': this.dropdownVisible,
223
+ };
224
+ return (h("c-icon-button", { size: "x-small", class: classes, text: true, onClick: (event) => this._toggleDropdown(event), onKeyDown: (event) => this._onButtonKeyDown('chevron', event) }, h("c-icon", { path: mdiChevronDown, size: 24 })));
225
+ }
226
+ _renderReset() {
227
+ return (h("c-icon-button", { "aria-label": "", size: "x-small", text: true, onClick: (event) => this._reset(event), onKeyDown: (event) => this._onButtonKeyDown('reset', event) }, h("c-icon", { path: mdiClose, size: 20 })));
228
+ }
229
+ _renderInputElement() {
230
+ var _a;
231
+ return (h("div", { class: "c-input-menu__input" }, 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() })));
232
+ }
233
+ componentWillLoad() {
234
+ CAutocomplete._uniqueId += 1;
235
+ this._inputId =
236
+ 'input_' +
237
+ (this.hostId || this.label || this.placeholder).replace(/[^a-zA-Z0-9-_]/g, '');
238
+ }
239
+ get _items() {
240
+ return this.optionElementsExist ? this.optionElements : this.items;
241
+ }
242
+ _updateStatusText() {
243
+ if (this._debounce !== null) {
244
+ clearTimeout(this._debounce);
245
+ this._debounce = null;
246
+ }
247
+ this._debounce = window.setTimeout(() => {
248
+ const ending = !!this._items.length
249
+ ? ' or navigate using the up and down arrows'
250
+ : '';
251
+ if (this.currentIndex === null) {
252
+ this.statusText = this._items.length
253
+ ? `${this._items.length} result${this._items.length !== 1 ? 's' : ''} available`
254
+ : 'No search results available';
255
+ }
256
+ if (this.query !== null && this._items.length) {
257
+ this.statusText += ', input a search query to filter the results';
258
+ }
259
+ this._dropdownElement.setStatusText(this.statusText + ending);
260
+ this._debounce = null;
261
+ }, 1400);
262
+ }
263
+ render() {
264
+ const itemType = this.optionElementsExist ? 'option' : 'item';
265
+ return (h(Host, null, 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" }, 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" }, h("slot", { name: "pre", slot: "pre" }), h("div", { class: "c-input__content" }, this._renderInputElement(), this.loading && this._renderLoader(), !this.loading && this.value && this._renderReset(), !this.loading && !this.value && this._renderChevron(), h("slot", { onSlotchange: () => this._handleSlotChange() })), h("slot", { name: "post", slot: "post" })))));
266
+ }
267
+ static get formAssociated() { return true; }
268
+ get el() { return getElement(this); }
269
+ static get watchers() { return {
270
+ "query": ["handleQueryChange"]
271
+ }; }
272
+ };
273
+ CAutocomplete._uniqueId = 0;
274
+ CAutocomplete.style = cAutocompleteCss;
3
275
 
4
276
  const cBadgeCss = "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-badge-background-color:var(--c-badge-background-color, var(--c-warning-600));--_c-badge-text-color:var(--c-badge-text-color, var(--c-white));--_c-badge-border-color:var(--c-badge-border-color, var(--c-white));align-items:center;background-color:var(--_c-badge-background-color);border-radius:16px;box-shadow:0 0 0 2px var(--_c-badge-border-color);color:var(--_c-badge-text-color);display:flex;font-size:12px;height:16px;justify-content:center;justify-items:center;line-height:1;min-width:16px;padding:0 4px;pointer-events:none;position:absolute;right:-6px;top:-6px;z-index:2}";
5
277
 
@@ -211,19 +483,318 @@ const CCard = class {
211
483
  };
212
484
  CCard.style = cCardCss;
213
485
 
214
- const cCscLogoCss = "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;margin-top:4px}svg .cls-1{fill:none}svg .cls-2{clip-path:url(\"#clip-path\")}svg .cls-3{fill:#5e6a71}svg .cls-4{fill:#066778}svg .cls-5{fill:#830051}";
486
+ const cCardActionsCss = "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{padding:0 var(--_c-card-gap, 24px);display:block}:host menu{margin:0;padding:0}.c-card-actions{align-items:center;display:flex;gap:8px}.c-card-actions ::slotted(c-button[fit]){flex:1}.c-card-actions--align-center{align-items:center}.c-card-actions--align-start{align-items:flex-start}.c-card-actions--align-end{align-items:flex-end}.c-card-actions--justify-center{justify-content:center}.c-card-actions--justify-end{justify-content:flex-end}.c-card-actions--justify-start{justify-content:flex-start}.c-card-actions--justify-stretch{justify-content:stretch}.c-card-actions--justify-stretch ::slotted(*){flex:1}.c-card-actions--justify-space-between{justify-content:space-between}.c-card-actions--justify-space-around{justify-content:space-around}";
215
487
 
216
- const CCscLogo = class {
488
+ const CCardActions = class {
217
489
  constructor(hostRef) {
218
490
  registerInstance(this, hostRef);
219
- this.width = 60;
491
+ this.align = 'center';
492
+ this.justify = 'start';
220
493
  }
221
494
  render() {
222
- const svg = (h("svg", { viewBox: "0 0 233.61 149.04" }, h("defs", null, h("clipPath", { id: "clip-path", transform: "translate(0)" }, h("rect", { class: "cls-1", width: "233.61", height: "156.31" }))), h("title", null, "CSC_logo_no_tagline"), h("g", { id: "Layer_2", "data-name": "Layer 2" }, h("g", { id: "Layer_1-2", "data-name": "Layer 1" }, h("g", { class: "cls-2" }, h("path", { class: "cls-3", d: "M97.24,130.66l-.27-.17a.69.69,0,0,1-.44.19,14.57,14.57,0,0,1-1.87-1.07,9.29,9.29,0,0,0-4.46-1.06c-6,0-9.21,4.93-9.21,10.24S84.22,149,90.09,149c4.6,0,5.89-2.57,7-2.57a2.17,2.17,0,0,1,.25.05l.22-.11-2.44-3.34-.28.17a1.84,1.84,0,0,1,.06.41c0,1.34-2.36,2.71-4.64,2.65-4.33-.08-6.08-3.72-6.08-7.56s1.86-7.45,6-7.45c2.2,0,4.44,1.15,4.44,2.21,0,.25.06.41,0,.53l.33.13ZM108,146.72l.32.13a.75.75,0,0,1,.42-.22,12.54,12.54,0,0,0,7.62,2.41c4.32,0,7.28-2.49,7.28-6.19,0-8.14-11.86-4.17-11.86-8.6,0-1.7,1-3,4.11-3,2.41,0,5.26,1,5.26,2.49a.92.92,0,0,1,0,.3l.36.17,1.92-4.14-.28-.11a.85.85,0,0,1-.62.3,11.61,11.61,0,0,1-1.95-.88,11,11,0,0,0-4.5-.87c-4.33,0-7.4,2.08-7.4,5.8,0,7.82,11.76,3.68,11.76,8.67,0,2.27-1.65,3.28-4,3.28-2.77,0-6.11-1.53-6.11-3a1.89,1.89,0,0,1,0-.41l-.31-.17Zm42.56-16.06-.28-.17a.64.64,0,0,1-.43.19,14.57,14.57,0,0,1-1.87-1.07,9.3,9.3,0,0,0-4.47-1.06c-6,0-9.21,4.93-9.21,10.24S137.5,149,143.37,149c4.6,0,5.89-2.57,7-2.57a1.59,1.59,0,0,1,.24.05l.22-.11-2.44-3.34-.27.17a1.84,1.84,0,0,1,.05.41c0,1.34-2.35,2.71-4.63,2.65-4.33-.08-6.08-3.72-6.08-7.56s1.86-7.45,6-7.45c2.2,0,4.44,1.15,4.44,2.21a1.82,1.82,0,0,1,0,.53l.33.13Z", transform: "translate(0)" }), h("path", { class: "cls-4", d: "M117.26,117.71s-2.66-.42-2.72-1.66c-2.41-54.33-7.39-52.22-111.82-54.33-2,0-2.72-2.87-2.72-2.87H117.26Z", transform: "translate(0)" }), h("path", { class: "cls-5", d: "M116.35,0s2.66.42,2.72,1.66C121.49,56,126.46,53.88,230.89,56c2,0,2.72,2.87,2.72,2.87H116.35Z", transform: "translate(0)" }))))));
223
- return h(Host, { style: { width: `${this.width}px` } }, svg);
495
+ const classes = {
496
+ 'c-card-actions': true,
497
+ [`c-card-actions--align-${this.align}`]: true,
498
+ [`c-card-actions--justify-${this.justify}`]: true,
499
+ };
500
+ return (h("footer", null, h("menu", { class: classes }, h("slot", null))));
224
501
  }
225
502
  };
226
- CCscLogo.style = cCscLogoCss;
503
+ CCardActions.style = cCardActionsCss;
504
+
505
+ const cCardContentCss = "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;padding:0 var(--_c-card-gap, 24px)}.c-card-content{display:flex;flex-direction:column;gap:var(--_c-card-gap)}.c-card-content ::slotted(*){max-width:100%}";
506
+
507
+ const CCardContent = class {
508
+ constructor(hostRef) {
509
+ registerInstance(this, hostRef);
510
+ }
511
+ render() {
512
+ return (h("article", { class: "c-card-content" }, h("slot", null)));
513
+ }
514
+ };
515
+ CCardContent.style = cCardContentCss;
516
+
517
+ const cCardTitleCss = "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-card-title-color:var(--c-card-title-color, var(--c-text-system));--_c-card-title-underline-color:var(--c-card-title-underline-color, var(--c-primary-600));color:var(--_c-card-title-color);padding-inline:var(--_c-card-gap, 24px);display:block;font-family:var(--c-font-family);font-size:1rem;font-weight:500;text-transform:uppercase}.c-card-title__underline{background-color:var(--_c-card-title-underline-color);border-radius:4px;height:4px;margin-top:10px;width:44px}";
518
+
519
+ const CCardTitle = class {
520
+ constructor(hostRef) {
521
+ registerInstance(this, hostRef);
522
+ }
523
+ render() {
524
+ return (h("header", { class: "c-card-title" }, h("slot", null), h("div", { class: "c-card-title__underline" })));
525
+ }
526
+ };
527
+ CCardTitle.style = cCardTitleCss;
528
+
529
+ 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)}}";
530
+
531
+ const CDropdown = class {
532
+ constructor(hostRef) {
533
+ registerInstance(this, hostRef);
534
+ this.selectOption = createEvent(this, "selectOption", 7);
535
+ this.dropdownStateChange = createEvent(this, "dropdownStateChange", 7);
536
+ this._debounce = null;
537
+ this._isMobile = false;
538
+ this._listItems = [];
539
+ this._inputSize = {
540
+ height: 0,
541
+ width: 0,
542
+ };
543
+ this._openedOnTop = false;
544
+ this._hideDetails = false;
545
+ this.itemsPerPage = undefined;
546
+ this.parent = undefined;
547
+ this.items = undefined;
548
+ this.index = undefined;
549
+ this.hostId = undefined;
550
+ this.type = undefined;
551
+ this.itemType = undefined;
552
+ this.renderedList = null;
553
+ this.isOpen = false;
554
+ this.statusText = '';
555
+ }
556
+ optionsWatcher() {
557
+ requestAnimationFrame(() => {
558
+ this.renderedList = this._renderList();
559
+ });
560
+ }
561
+ async stateWatcher(isOpen) {
562
+ this.dropdownStateChange.emit(isOpen);
563
+ this._scrollParent = this._scrollParent || (await getScrollParent(this.el));
564
+ this._scrollParent.style.overflow = isOpen ? 'hidden' : null;
565
+ }
566
+ handleIndexChange(index) {
567
+ requestAnimationFrame(() => {
568
+ var _a;
569
+ this._updateStatusText();
570
+ (_a = this._listItems[index]) === null || _a === void 0 ? void 0 : _a.focus();
571
+ });
572
+ }
573
+ async setStatusText(text) {
574
+ requestAnimationFrame(() => {
575
+ this.statusText = text;
576
+ });
577
+ }
578
+ async focusItem(index) {
579
+ requestAnimationFrame(() => {
580
+ var _a;
581
+ (_a = this._listItems[index]) === null || _a === void 0 ? void 0 : _a.focus();
582
+ });
583
+ }
584
+ async open() {
585
+ if (this._dialog.open)
586
+ return;
587
+ this._outsideClickFn = this._handleOutsideClick.bind(this);
588
+ window.addEventListener('click', this._outsideClickFn);
589
+ requestAnimationFrame(() => {
590
+ this.isOpen = true;
591
+ this._positionMenu();
592
+ });
593
+ }
594
+ async close() {
595
+ this._dialog.close();
596
+ this.isOpen = false;
597
+ this._inputElement.slot = 'default';
598
+ this._inputElement.hideDetails = this._hideDetails;
599
+ this._dummyElement.style.width = '0';
600
+ this._dummyElement.style.display = 'none';
601
+ this._dialog.style.width = '0';
602
+ window.removeEventListener('click', this._outsideClickFn);
603
+ }
604
+ _setIsMobile() {
605
+ this._isMobile = window.matchMedia('only screen and (max-width: 760px)').matches;
606
+ }
607
+ componentDidLoad() {
608
+ this._setIsMobile();
609
+ this._hideDetails = this.parent.hideDetails;
610
+ this._inputElement = this.el.querySelector('c-input');
611
+ this._resizeObserver = new ResizeObserver((entries) => {
612
+ if (!this._dialog.open)
613
+ return;
614
+ requestAnimationFrame(() => {
615
+ if (!Array.isArray(entries) || !entries.length)
616
+ return;
617
+ this._setIsMobile();
618
+ this.close();
619
+ });
620
+ });
621
+ this._resizeObserver.observe(window.document.body);
622
+ requestAnimationFrame(() => {
623
+ this.renderedList = this._renderList();
624
+ });
625
+ }
626
+ async selectItem(index) {
627
+ const item = this._listItems[index];
628
+ if (item.classList.contains('disabled')) {
629
+ return true;
630
+ }
631
+ this._listItems[index].click();
632
+ return false;
633
+ }
634
+ async updateList() {
635
+ requestAnimationFrame(() => {
636
+ this.renderedList = this._renderList();
637
+ });
638
+ }
639
+ _handleOutsideClick(event) {
640
+ if (!this.isOpen)
641
+ return;
642
+ if (!event.composedPath().includes(this._dialog)) {
643
+ this.close();
644
+ }
645
+ }
646
+ _highlightMatchingText(value) {
647
+ const { query } = this.parent;
648
+ if (this.parent.tagName === 'C-SELECT' || query === '')
649
+ return value;
650
+ const regex = new RegExp(query, 'gi');
651
+ const highlighted = value
652
+ .replace(/(<([^>]+)>)/gi, '')
653
+ .replace(regex, (match) => `<mark>${match}</mark>`);
654
+ return highlighted;
655
+ }
656
+ _getParentPosition() {
657
+ return this.parent.shadowRoot
658
+ .querySelector('.c-input__slot')
659
+ .getBoundingClientRect();
660
+ }
661
+ _positionMenu() {
662
+ const { innerWidth, innerHeight } = window;
663
+ this._dialog.style.width = 'auto';
664
+ this._dialog.style.opacity = '0';
665
+ this._dialog.showModal();
666
+ requestAnimationFrame(() => {
667
+ let inputSlot = 'input-top';
668
+ const { top: parentTop, width } = this._getParentPosition();
669
+ const inputSize = this.el.getBoundingClientRect();
670
+ this._inputSize = {
671
+ height: inputSize.height,
672
+ width: inputSize.width,
673
+ };
674
+ if (!this._isMobile) {
675
+ this._dialog.style.width = `${width}px`;
676
+ this._dialog.style.top = `${inputSize.top}px`;
677
+ this._dialog.style.bottom = 'auto';
678
+ this._dialog.style.left = `${inputSize.left}px`;
679
+ const { bottom, right, height } = this._dialog.getBoundingClientRect();
680
+ const isInView = {
681
+ x: right < innerWidth,
682
+ y: bottom < innerHeight,
683
+ };
684
+ const fitsOnTop = parentTop - height > 0;
685
+ if (!fitsOnTop && !isInView.y) {
686
+ this._dialog.style.maxHeight = `${parentTop}px`;
687
+ }
688
+ if (!isInView.y || this._openedOnTop) {
689
+ this._openedOnTop = true;
690
+ this._inputElement.hideDetails = true;
691
+ inputSlot = 'input-bottom';
692
+ this._dialog.style.top = 'auto';
693
+ this._dialog.style.bottom = `${innerHeight - inputSize.top - 44}px`;
694
+ this._inputElement.scrollIntoView();
695
+ }
696
+ }
697
+ this._dummyElement.style.width = `${this._getParentPosition().width}px`;
698
+ this._dummyElement.style.height = `${this._inputSize.height}px`;
699
+ this._dummyElement.style.display = 'block';
700
+ this._dummyElement.slot = 'default';
701
+ this._inputElement.slot = inputSlot;
702
+ this._inputElement.hideDetails = true;
703
+ this._dialog.style.opacity = '1';
704
+ const input = this.parent.shadowRoot.querySelector('input');
705
+ input.focus();
706
+ });
707
+ }
708
+ _emptyItem() {
709
+ const { query, loading } = this.parent;
710
+ if (!query || loading)
711
+ return;
712
+ return (h("li", null, h("c-icon", { path: mdiAlert, size: 18, color: "var(--c-warning-600)" }), "No suggestions found"));
713
+ }
714
+ _renderList() {
715
+ return this.itemType === 'option'
716
+ ? this._renderOptionsList()
717
+ : this._renderItemsList();
718
+ }
719
+ _renderOptionsList() {
720
+ if (!this.items.length)
721
+ return this._emptyItem();
722
+ const options = Array.from(this.items);
723
+ this._listItems.length = 0;
724
+ return options.map((option, index) => {
725
+ const optionValue = option.querySelector('c-option-value');
726
+ if (optionValue) {
727
+ optionValue.innerHTML = this._highlightMatchingText(optionValue.textContent);
728
+ }
729
+ return (h("li", { ref: (el) => this._listItems.push(el), id: `${this.hostId}-option-${option.value}`, tabindex: "-1", role: "option", "aria-set-size": this.items.length.toString(), "aria-pos-in-set": (index + 1).toString(), "aria-selected": (!!option.selected).toString(), class: { disabled: !!option.disabled }, "data-name": option.name, onClick: (event) => {
730
+ if (option.disabled) {
731
+ event.preventDefault();
732
+ return;
733
+ }
734
+ this.selectOption.emit({ name: option.name, value: option.value });
735
+ }, innerHTML: option.outerHTML }));
736
+ });
737
+ }
738
+ _renderItemsList() {
739
+ if (!this.items.length)
740
+ return this._emptyItem();
741
+ this._listItems.length = 0;
742
+ return this.items.map((item, index) => {
743
+ return (h("li", { ref: (el) => this._listItems.push(el), id: `${this.hostId}-option-${item.value}`, tabindex: "-1", role: "option", "aria-set-size": this.items.length.toString(), "aria-pos-in-set": (index + 1).toString(), "aria-selected": (this.index === index).toString(), class: { disabled: !!item.disabled }, "data-name": item.name, onClick: (event) => {
744
+ if (item.disabled) {
745
+ event.preventDefault();
746
+ return;
747
+ }
748
+ this.selectOption.emit({ name: item.name, value: item.value });
749
+ } }, h("span", { innerHTML: this._highlightMatchingText(item.name) })));
750
+ });
751
+ }
752
+ _updateStatusText() {
753
+ if (this._debounce !== null) {
754
+ clearTimeout(this._debounce);
755
+ this._debounce = null;
756
+ }
757
+ this._debounce = window.setTimeout(() => {
758
+ var _a;
759
+ const selection = this._listItems[this.index];
760
+ const ending = !!this.items.length
761
+ ? ', to navigate use up and down arrows'
762
+ : '';
763
+ const total = this._listItems.length;
764
+ const position = this.index + 1;
765
+ const isDisabled = !!((_a = selection === null || selection === void 0 ? void 0 : selection.classList) === null || _a === void 0 ? void 0 : _a.contains('disabled'));
766
+ const beginning = isDisabled ? 'Disabled option - ' : '';
767
+ let selectionText = !!selection
768
+ ? `${beginning}${selection.dataset.name} - ${position} of ${total} is highlighted`
769
+ : null;
770
+ if (this.index === null && this.type === 'autocomplete') {
771
+ selectionText = this.items.length
772
+ ? `${this.items.length} result${this.items.length !== 1 ? 's' : ''} available`
773
+ : 'No search results available';
774
+ }
775
+ this.statusText = `${selectionText || ending}`;
776
+ this._debounce = null;
777
+ }, 1400);
778
+ }
779
+ render() {
780
+ if (!this._isMobile &&
781
+ this._dialog &&
782
+ this.itemsPerPage &&
783
+ this.itemsPerPage > 0 &&
784
+ this.items.length > this.itemsPerPage) {
785
+ this._dialog.style.maxHeight = 42 * (this.itemsPerPage + 0.5) + 60 + 'px';
786
+ this._list.style.maxHeight = 42 * (this.itemsPerPage + 0.5) + 'px';
787
+ }
788
+ return (h(Host, null, h("slot", { name: "default" }), h("div", { class: "dummy", ref: (el) => (this._dummyElement = el) }), h("dialog", { tabindex: "-1", ref: (el) => (this._dialog = el), class: { mobile: this._isMobile }, onCancel: () => this.close() }, h("div", { id: 'announce-' + this.hostId, class: "visuallyhidden", "aria-live": "polite", "aria-atomic": "true" }, this.statusText), h("div", { class: "input-top-wrapper" }, h("slot", { name: "input-top" })), h("ul", { ref: (el) => (this._list = el), id: `${this.hostId}--results`, role: "listbox", "aria-expanded": this.isOpen.toString(), class: { active: this.isOpen, mobile: this._isMobile }, tabindex: "-1" }, this.renderedList), h("div", { class: { active: this._openedOnTop, 'input-bottom-wrapper': true } }, h("slot", { name: "input-bottom" })))));
789
+ }
790
+ get el() { return getElement(this); }
791
+ static get watchers() { return {
792
+ "items": ["optionsWatcher"],
793
+ "isOpen": ["stateWatcher"],
794
+ "index": ["handleIndexChange"]
795
+ }; }
796
+ };
797
+ CDropdown.style = cDropdownCss;
227
798
 
228
799
  const cIconCss = "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-icon){--_c-icon-color:var(\n --c-icon-color,\n var(--_c-icon-default-color, curentColor)\n );--_c-icon-size:var(--c-icon-size, 24px);display:inline-flex;align-items:center;height:var(--_c-icon-size);width:var(--_c-icon-size)}:host(c-icon) svg{height:var(--_c-icon-size);width:var(--_c-icon-size)}:host(c-icon) svg path{fill:var(--_c-icon-color)}";
229
800
 
@@ -290,17 +861,307 @@ const CIconButton = class {
290
861
  };
291
862
  CIconButton.style = cIconButtonCss;
292
863
 
293
- const cMainCss = "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-main-background-color:var(--c-main-background-color, var(--c-primary-200));--_c-main-text-color:var(--c-main-text-color, var(--c-text-body));background:var(--_c-main-background-color);color:var(--_c-main-text-color);display:flex;flex-direction:column;height:100vh}:host ::slotted(*){color:var(--_c-main-text-color)}";
864
+ const cInputCss = "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-input){--_c-input-inactive-color:var(--c-tertiary-600);--_c-input-active-color:var(--c-primary-600);--_c-input-background-color:var(--c-transparent);--_c-input-text-color:var(--c-text-body);--_c-input-placeholder-color:var(--c-tertiary-500);--_c-input-shadow-active-color:var(--_c-input-active-color);--_c-input-shadow-background-color:var(--c-white);--_c-input-shadow-text-color:var(--_c-input-text-color);--_c-input-shadow-placeholder-color:var(--_c-input-placeholder-color);--_c-input-error-color: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-input{--_c-input-border-width:1px;align-items:flex-start;border-radius:4px;display:flex;flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;letter-spacing:normal;max-width:100%;text-align:left}.c-input input,.c-input select,.c-input textarea{background:none;border:0;display:inline-block;font-family:var(--c-font-family);font-size:16px;line-height:1;margin:0;padding:0;vertical-align:middle;white-space:normal}.c-input input,.c-input textarea{box-sizing:content-box;background-color:transparent;border:none;color:var(--_c-input-text-color);flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;line-height:20px;max-width:100%;min-width:0;width:100%}.c-input input[type=checkbox],.c-input input[type=radio],.c-input select{box-sizing:border-box}.c-input input[type=search]{appearance:textfield;box-sizing:content-box}.c-input ::-webkit-search-decoration{display:none}.c-input textarea{margin-top:4px;min-height:44px;overflow:auto;padding:8px 12px 8px 0;resize:vertical;vertical-align:top}.c-input input{max-height:32px;padding:8px 0}.c-input input:focus,.c-input input:active,.c-input input[aria-expanded=true],.c-input textarea:focus,.c-input textarea:active{outline:none}.c-input .c-input__content{align-items:center;display:flex;width:100%}.c-input .c-input__content slot{display:none}.c-input .c-input__content c-icon-button{aspect-ratio:1;margin-right:-6px}.c-input__control{border-radius:inherit;color:currentColor;display:flex;flex-flow:column wrap;flex-grow:1;gap:8px;height:auto;min-width:0;width:100%;position:relative}.c-input__slot{align-items:stretch;background:transparent;border-radius:inherit;color:inherit;cursor:text;display:flex;min-height:44px;padding:0 12px;position:relative;transition:0.3s cubic-bezier(0.25, 0.8, 0.5, 1);width:100%}.c-input__field{align-items:center;display:flex;flex:1 1 auto;gap:8px;position:relative}.c-input__field input,.c-input__field textarea{flex:1;outline:0}.c-input__field label{font-size:16px;height:20px;left:0;letter-spacing:normal;line-height:20px;max-width:90%;min-height:8px;overflow:hidden;pointer-events:none;position:absolute;right:auto;text-overflow:ellipsis;top:12px;transform-origin:top left;transform:translateX(var(--_c-input-label-position)) translateY(0) scale(1);transition:0.3s cubic-bezier(0.25, 0.8, 0.5, 1) 0.08s;white-space:nowrap}.c-input__field label.active{transform:translateY(-18px) scale(0.75)}.c-input__field label span{color:var(--c-error-600)}.c-input--select input{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.c-input--select .c-input__slot{cursor:pointer}.c-input fieldset{background-color:var(--_c-input-background-color);border-collapse:collapse;border-color:var(--_c-input-inactive-color);border-radius:inherit;border-style:solid;border-width:var(--_c-input-border-width);inset:0;margin:0;padding:0 0 0 8px;pointer-events:none;position:absolute;transition-duration:0.15s;transition-property:color;transition-timing-function:cubic-bezier(0.25, 0.8, 0.25, 1)}.c-input fieldset legend{float:none;line-height:11px;margin-left:-1px;padding:0;text-align:left;transition:width 0.3s cubic-bezier(0.25, 0.8, 0.5, 1);width:0}.c-input fieldset legend.active{width:var(--_c-input-legend-width)}.c-input--shadow .c-input__slot{background-color:var(--_c-input-shadow-background-color);box-shadow:rgba(0, 0, 0, 0.15) 0 5px 15px 0}.c-input--shadow .c-input__slot input,.c-input--shadow .c-input__slot textarea{color:var(--_c-input-shadow-text-color)}.c-input--shadow .c-input__slot:focus-within{outline:2px var(--_c-input-active-color) solid}.c-input--shadow .c-input__slot:focus-within c-icon{--c-icon-color:var(--_c-input-shadow-active-color) !important}.c-input--shadow input::placeholder,.c-input--shadow textarea::placeholder{color:var(--_c-input-shadow-placeholder-color);opacity:1}.c-input--disabled input,.c-input--disabled textarea,.c-input--disabled fieldset,.c-input--disabled label{--_c-input-error-color:var(--c-tertiary-500);color:var(--c-tertiary-500)}.c-input--textarea .c-input__field{margin-right:-12px}.c-input ::placeholder{color:var(--_c-input-placeholder-color);opacity:1}.c-input:focus-within,.c-input--active,.c-input:not(.c-input--disabled):active{--_c-input-border-width:2px;color:var(--_c-input-active-color)}.c-input:focus-within fieldset,.c-input--active fieldset,.c-input:not(.c-input--disabled):active fieldset{border-color:var(--_c-input-active-color)}.c-input:focus-within label,.c-input--active label,.c-input:not(.c-input--disabled):active label{color:var(--_c-input-active-color);transform:translateX(0) translateY(-18px) scale(0.75)}.c-input:focus-within legend,.c-input--active legend,.c-input:not(.c-input--disabled):active legend{width:var(--_c-input-legend-width)}.c-input.active:not(.filled) .c-input-menu__input{position:relative}.c-input.active:not(.filled) .c-input-menu__input::after{display:flex;align-items:center;position:absolute;inset:0;content:attr(data-placeholder);pointer-events:none;color:var(--_c-input-placeholder-color)}.c-input--error{color:var(--c-error-600)}.c-input--error fieldset{border-color:var(--c-error-600) !important}.c-input--error label{color:var(--c-error-600) !important}.c-input--error:focus-within{color:var(--c-error-600)}";
865
+
866
+ const CInput = class {
867
+ constructor(hostRef) {
868
+ registerInstance(this, hostRef);
869
+ this.changeValue = createEvent(this, "changeValue", 3);
870
+ this.itemClick = createEvent(this, "itemClick", 3);
871
+ this.dropdownClose = createEvent(this, "dropdownClose", 3);
872
+ this._hasBlurred = false;
873
+ this._debounce = null;
874
+ this._observer = new IntersectionObserver((entries, observer) => {
875
+ entries.forEach((entry) => {
876
+ if (entry.isIntersecting) {
877
+ this._calculateElementWidths();
878
+ observer.unobserve(entry.target);
879
+ }
880
+ });
881
+ }, { threshold: 1 });
882
+ this._onBlur = () => {
883
+ setTimeout(() => {
884
+ if (!this.active) {
885
+ this.isFocused = false;
886
+ this._hasBlurred = true;
887
+ }
888
+ this._onReset();
889
+ }, 100);
890
+ };
891
+ this._onFocus = (click = true) => {
892
+ var _a, _b;
893
+ if (this.disabled)
894
+ return;
895
+ this.isFocused = true;
896
+ (_a = this.inputField) === null || _a === void 0 ? void 0 : _a.focus();
897
+ if (click) {
898
+ (_b = this.inputField) === null || _b === void 0 ? void 0 : _b.click();
899
+ if (this.variant === 'select') {
900
+ this.itemClick.emit();
901
+ }
902
+ }
903
+ if (this.inputField) {
904
+ this.inputField.placeholder =
905
+ !!this.value || !this.placeholder ? '' : this.placeholder;
906
+ }
907
+ };
908
+ this.active = false;
909
+ this.autofocus = false;
910
+ this.disabled = false;
911
+ this.form = false;
912
+ this.hideDetails = false;
913
+ this.hint = '';
914
+ this.hostId = undefined;
915
+ this.inputId = undefined;
916
+ this.items = undefined;
917
+ this.itemsPerPage = 6;
918
+ this.label = undefined;
919
+ this.max = null;
920
+ this.min = null;
921
+ this.name = undefined;
922
+ this.placeholder = undefined;
923
+ this.readonly = false;
924
+ this.required = false;
925
+ this.rows = 1;
926
+ this.shadow = false;
927
+ this.step = null;
928
+ this.type = undefined;
929
+ this.valid = true;
930
+ this.validate = false;
931
+ this.validateOnBlur = false;
932
+ this.validation = 'Required field';
933
+ this.value = undefined;
934
+ this.variant = 'text';
935
+ this.isFocused = false;
936
+ this.labelWidth = 0;
937
+ this.preSlotWidth = 0;
938
+ this.statusText = '';
939
+ this.currentIndex = null;
940
+ }
941
+ onValidChange() {
942
+ if (this.validateOnBlur && !this._hasBlurred)
943
+ return;
944
+ this._setAriaDescriptionId();
945
+ }
946
+ onValidationMessageChange() {
947
+ this._updateStatusText();
948
+ }
949
+ onValueChange(value) {
950
+ if (!value) {
951
+ this._onReset();
952
+ }
953
+ }
954
+ onPlaceholderChange(placeholder) {
955
+ if (placeholder)
956
+ this._onReset();
957
+ }
958
+ async reset() {
959
+ this._onReset();
960
+ }
961
+ componentDidLoad() {
962
+ var _a, _b, _c, _d;
963
+ if (this.autofocus) {
964
+ setTimeout(() => {
965
+ this._onFocus(false);
966
+ }, 500);
967
+ }
968
+ this._calculateElementWidths();
969
+ this._setAriaDescriptionId();
970
+ if (this.label) {
971
+ this._observer.observe(this._labelRef);
972
+ }
973
+ (_a = this.inputField) === null || _a === void 0 ? void 0 : _a.addEventListener('focus', () => this._onFocus(false));
974
+ (_b = this.inputField) === null || _b === void 0 ? void 0 : _b.addEventListener('blur', () => this._onBlur());
975
+ (_c = this.inputField) === null || _c === void 0 ? void 0 : _c.addEventListener('keypress', this._preventNonNumericalInput);
976
+ if (this.inputField) {
977
+ this.inputField.placeholder =
978
+ !!this.label || !this.placeholder ? '' : this.placeholder;
979
+ this.inputField.title = (_d = this.label) !== null && _d !== void 0 ? _d : this.placeholder;
980
+ requestAnimationFrame(() => {
981
+ const container = this.inputField.closest('.c-input-menu__input');
982
+ if (!container)
983
+ return;
984
+ container.dataset.placeholder = this.placeholder;
985
+ });
986
+ }
987
+ }
988
+ disconnectedCallback() {
989
+ var _a, _b, _c, _d;
990
+ (_a = this.inputField) === null || _a === void 0 ? void 0 : _a.removeEventListener('focus', () => this._onFocus(false));
991
+ (_b = this.inputField) === null || _b === void 0 ? void 0 : _b.removeEventListener('blur', () => this._onBlur());
992
+ (_c = this.inputField) === null || _c === void 0 ? void 0 : _c.removeEventListener('keypress', this._preventNonNumericalInput);
993
+ this._observer.disconnect();
994
+ (_d = this._dropdownElement) === null || _d === void 0 ? void 0 : _d.remove();
995
+ }
996
+ get isActive() {
997
+ return !!this.value || typeof this.value === 'boolean' || this.isFocused;
998
+ }
999
+ _setAriaDescriptionId() {
1000
+ this.inputField.removeAttribute('aria-describedby');
1001
+ let type = null;
1002
+ if (this.valid && !this.value && this.hint) {
1003
+ type = 'hint';
1004
+ }
1005
+ if (!this.valid) {
1006
+ type = 'error';
1007
+ }
1008
+ if (type) {
1009
+ this.inputField.setAttribute('aria-describedby', `${type}-${this.inputId}`);
1010
+ }
1011
+ }
1012
+ _calculateElementWidths() {
1013
+ this.labelWidth = !!this.label ? this._labelRef.scrollWidth * 0.75 + 6 : 0;
1014
+ this.preSlotWidth = this.inputField.offsetLeft;
1015
+ }
1016
+ _onReset() {
1017
+ if (this.inputField) {
1018
+ if (!!this.placeholder &&
1019
+ !this.value &&
1020
+ (this.active || this.isFocused)) {
1021
+ this.inputField.placeholder = this.placeholder;
1022
+ return;
1023
+ }
1024
+ this.inputField.placeholder =
1025
+ !this.label && !this.value && !!this.placeholder
1026
+ ? this.placeholder
1027
+ : '';
1028
+ }
1029
+ }
1030
+ _preventNonNumericalInput(event) {
1031
+ if (this.type !== 'number')
1032
+ return;
1033
+ if (!event.key.match(/^[0-9,\.]+$/))
1034
+ event.preventDefault();
1035
+ }
1036
+ _renderBorders() {
1037
+ if (this.shadow)
1038
+ return;
1039
+ const classes = {
1040
+ active: this.isActive || this.active,
1041
+ };
1042
+ return (h("fieldset", { "aria-hidden": "true" }, h("legend", { class: classes, style: {
1043
+ '--_c-input-legend-width': this.labelWidth + 'px',
1044
+ } }, h("span", { class: "notranslate" }))));
1045
+ }
1046
+ _renderLabel() {
1047
+ if (!this.label)
1048
+ return;
1049
+ const classes = {
1050
+ active: this.isActive,
1051
+ };
1052
+ return (h("label", { htmlFor: this.inputId, ref: (el) => (this._labelRef = el), class: classes }, this.label, this.required && h("span", null, "\u00A0*")));
1053
+ }
1054
+ get inputField() {
1055
+ var _a;
1056
+ return (_a = this.el) === null || _a === void 0 ? void 0 : _a.querySelector('.c-input__input');
1057
+ }
1058
+ _updateStatusText() {
1059
+ if (this._debounce !== null) {
1060
+ clearTimeout(this._debounce);
1061
+ this._debounce = null;
1062
+ }
1063
+ this._debounce = window.setTimeout(() => {
1064
+ this.statusText = this.valid ? '' : `Error: ${this.validation}`;
1065
+ this._debounce = null;
1066
+ }, 1400);
1067
+ }
1068
+ render() {
1069
+ const containerClasses = {
1070
+ 'c-input': true,
1071
+ 'c-input--disabled': this.disabled,
1072
+ 'c-input--shadow': this.shadow,
1073
+ 'c-input--textarea': this.rows > 1,
1074
+ 'c-input--error': !this.valid,
1075
+ 'c-input--active': this.isFocused || this.active,
1076
+ filled: !!this.value,
1077
+ [`c-input--${this.variant}`]: true,
1078
+ };
1079
+ return (h(Host, { disabled: this.disabled }, h("div", { id: 'announce-' + this.inputId, class: "visuallyhidden", "aria-live": "polite", "aria-atomic": "true" }, this.statusText), h("div", { class: containerClasses }, h("div", { class: "c-input__control" }, h("div", { class: "c-input__slot", onClick: () => this._onFocus() }, this._renderBorders(), h("div", { class: "c-input__field", style: {
1080
+ '--_c-input-label-position': this.preSlotWidth + 'px',
1081
+ } }, h("slot", { name: "pre" }), this._renderLabel(), h("slot", null))), this.variant === 'select' && h("slot", { name: "dropdown" }), !this.hideDetails && (h("c-message", { hint: this.hint, inputId: this.inputId, valid: this.valid, validation: this.validation }))))));
1082
+ }
1083
+ get el() { return getElement(this); }
1084
+ static get watchers() { return {
1085
+ "valid": ["onValidChange"],
1086
+ "validation": ["onValidationMessageChange"],
1087
+ "value": ["onValueChange"],
1088
+ "placeholder": ["onPlaceholderChange"]
1089
+ }; }
1090
+ };
1091
+ CInput.style = cInputCss;
1092
+
1093
+ const cMessageCss = "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-message-error-color:var(--c-error-600);--_c-message-hint-color:var(--c-text-system);display:block;line-height:1;padding:0 12px}.c-message--active .c-message-item{opacity:1;transform:translateY(0)}.c-message-item{font-size:12px;min-height:16px;opacity:0;transform:translateY(-4px);transition:all 0.2s cubic-bezier(0.25, 0.8, 0.5, 1)}.c-message-item--hint{color:var(--_c-message-hint-color)}.c-message-item--error{color:var(--_c-message-error-color)}.c-message-item span{align-items:flex-start;color:currentColor;display:flex;gap:4px;min-height:16px}.c-message-item svg{fill:currentColor;height:16px;width:16px;position:relative;top:-2px}.c-message .visuallyhidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;white-space:nowrap;width:1px}";
294
1094
 
295
- const CMain = class {
1095
+ const CMessage = class {
296
1096
  constructor(hostRef) {
297
1097
  registerInstance(this, hostRef);
1098
+ this._validationIcon = (h("svg", { height: "16px", width: "16px", viewBox: "0 0 24 24" }, h("path", { d: mdiCloseCircle })));
1099
+ this.hint = '';
1100
+ this.inputId = undefined;
1101
+ this.valid = true;
1102
+ this.validation = 'Required field';
1103
+ this.messageOptions = {
1104
+ show: true,
1105
+ type: 'hint',
1106
+ content: '',
1107
+ };
1108
+ }
1109
+ onValidChange(valid) {
1110
+ this._handleValidation(valid);
1111
+ }
1112
+ onValidationMessageChange(message) {
1113
+ if (this.valid || !message)
1114
+ return;
1115
+ this.messageOptions = Object.assign(Object.assign({}, this.messageOptions), { content: (h("span", null, h("span", { class: "visuallyhidden" }, "Error: "), this._validationIcon, " ", message)) });
1116
+ }
1117
+ onHintMessageChange(message) {
1118
+ if (!this.valid || !message)
1119
+ return;
1120
+ this.messageOptions = Object.assign(Object.assign({}, this.messageOptions), { content: (h("span", null, h("span", { class: "visuallyhidden" }, "Hint: "), message)) });
1121
+ }
1122
+ _handleValidation(valid, timeout = 200) {
1123
+ this.messageOptions = Object.assign(Object.assign({}, this.messageOptions), { show: false });
1124
+ setTimeout(() => {
1125
+ this.messageOptions = Object.assign(Object.assign({}, this.messageOptions), { type: valid ? 'hint' : 'error', show: true, content: valid ? (h("span", { id: `hint-${this.inputId}` }, h("span", { class: "visuallyhidden" }, "Hint: "), this.hint)) : (h("span", { id: `error-${this.inputId}` }, this._validationIcon, h("span", { class: "visuallyhidden" }, "Error: "), this.validation)) });
1126
+ }, timeout);
1127
+ }
1128
+ componentDidLoad() {
1129
+ this._handleValidation(this.valid, 0);
298
1130
  }
299
1131
  render() {
300
- return (h("main", null, h("slot", null)));
1132
+ const classes = {
1133
+ 'c-message': true,
1134
+ 'c-message--active': this.messageOptions.show,
1135
+ };
1136
+ const messageClasses = {
1137
+ 'c-message-item': true,
1138
+ [`c-message-item--${this.messageOptions.type}`]: true,
1139
+ };
1140
+ return (h(Host, null, h("div", { class: classes }, h("div", { class: messageClasses }, this.messageOptions.content))));
1141
+ }
1142
+ static get watchers() { return {
1143
+ "valid": ["onValidChange"],
1144
+ "validation": ["onValidationMessageChange"],
1145
+ "hint": ["onHintMessageChange"]
1146
+ }; }
1147
+ };
1148
+ CMessage.style = cMessageCss;
1149
+
1150
+ const cOptionCss = "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;width:100%;padding:8px 0}";
1151
+
1152
+ const COption = class {
1153
+ constructor(hostRef) {
1154
+ registerInstance(this, hostRef);
1155
+ this.selected = false;
1156
+ this.disabled = false;
1157
+ this.name = undefined;
1158
+ this.value = undefined;
1159
+ }
1160
+ render() {
1161
+ return (h(Host, { tabindex: "-1" }, h("slot", null)));
301
1162
  }
302
1163
  };
303
- CMain.style = cMainCss;
1164
+ COption.style = cOptionCss;
304
1165
 
305
1166
  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)}}";
306
1167
 
@@ -348,43 +1209,312 @@ const CRipple = class {
348
1209
  };
349
1210
  CRipple.style = cRippleCss;
350
1211
 
351
- const cRowCss = "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-row){display:flex;flex:1 1 auto;flex-wrap:wrap;gap:var(--_c-row-gap)}:host(.c-row) slot{display:flex;flex-wrap:wrap;width:100%;gap:var(--_c-row-gap)}:host(.c-row--nowrap) slot{flex-wrap:nowrap !important}:host(.c-row--align-center) slot{align-items:center}:host(.c-row--align-start) slot{align-items:flex-start}:host(.c-row--align-end) slot{align-items:flex-end}:host(.c-row--justify-start) slot{justify-content:flex-start}:host(.c-row--justify-center) slot{justify-content:center}:host(.c-row--justify-end) slot{justify-content:flex-end}:host(.c-row--justify-space-between) slot{justify-content:space-between}:host(.c-row--justify-space-around) slot{justify-content:space-around}";
1212
+ const cSelectCss = "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-select-active-color:var(--c-select-active-color, var(--c-primary-600));--_c-select-inactive-color:var(--c-select-inactive-color, var(--c-tertiary-600));--_c-select-background-color:var(--c-select-background-color, var(--c-transparent));--_c-select-text-color:var(--c-select-text-color, var(--c-text-body));--_c-select-placeholder-color:var(--c-select-placeholder-color, var(--c-tertiary-500));--_c-select-option-background-color:var(--c-select-option-background-color, var(--c-white));--_c-select-option-background-color-hover:var(--c-select-option-background-color-hover, var(--c-primary-100));--_c-select-option-text-color:var(--c-select-option-text-color, var(--c-text-body));--_c-select-shadow-active-color:var(--c-select-shadow-active-color, var(--_c-select-active-color));--_c-select-shadow-background-color:var(--c-select-shadow-background-color, var(--c-white));--_c-select-shadow-text-color:var(--c-select-shadow-text-color, var(--_c-select-text-color));--_c-select-shadow-placeholder-color:var(--c-select-shadow-placeholder-color, var(--_c-select-placeholder-color));--_c-input-active-color:var(--_c-select-active-color);--_c-input-inactive-color:var(--_c-select-inactive-color);--_c-input-background-color:var(--_c-select-background-color);--_c-input-text-color:var(--_c-select-text-color);--_c-input-placeholder-color:var(--_c-select-placeholder-color);--_c-input-shadow-active-color:var(--_c-select-shadow-active-color);--_c-input-shadow-background-color:var(--_c-select-shadow-background-color);--_c-input-shadow-text-color:var(--_c-select-shadow-text-color);--_c-input-shadow-placeholder-color:var(--_c-select-shadow-placeholder-color)}:host{display:block;cursor:text}.c-input-menu__chevron{fill:currentColor;transform:rotate(0deg);transition:transform 0.3s ease-in-out}.c-input-menu__chevron--active{transform:rotate(180deg)}.c-input-menu__input{width:100%;display:flex;justify-items:stretch}.c-input-menu__selection{display:none;pointer-events:none}.c-input-menu__selection--show{align-items:center;display:flex;width:100%;color:var(--_c-select-active-color)}.c-input-menu__item-wrapper{position:absolute;width:100%;top:44px;z-index:10;margin-left:calc(var(--_c-input-label-position) * -1)}.c-input-menu__item-wrapper--shadow{top:47px}.c-input-menu__items{position:absolute;background-color:var(--_c-select-option-background-color);min-width:calc(100% + 24px);box-shadow:0 8px 16px 0 rgba(0, 0, 0, 0.2);z-index:10;user-select:none;border-radius:4px;margin:0 -12px;overflow-y:scroll;list-style:none;padding:0}.c-input-menu__items--hidden{display:none}.c-input-menu__items li{cursor:pointer;display:flex;min-height:48px;padding:0 12px;transition:background-color 0.3s;font-size:14px;align-items:center;justify-content:flex-start;color:var(--_c-select-option-text-color)}.c-input-menu__items li.disabled{background-color:var(--c-tertiary-100);filter:grayscale(1) opacity(0.6);cursor:default}.c-input-menu__items li.disabled:hover{background-color:var(--c-tertiary-100)}.c-input-menu__items li.dense{padding:10px 14px}.c-input-menu__items li:hover{background-color:var(--_c-select-option-background-color-hover)}.c-input-menu__items li[aria-selected=true]{background-color:var(--_c-select-option-background-color-hover);box-shadow:inset 0 0 0 1px var(--_c-select-active-color);border-radius:4px;backface-visibility:hidden;transform:translate3d(0, 0, 0)}.c-input-menu__items li.none{color:rgba(0, 0, 0, 0.5)}.c-input-menu__items--empty li{color:var(--c-text-system);cursor:default;gap:8px;pointer-events:none}.c-input-menu__items--empty li svg{fill:var(--c-warning-600);height:18px;width:18px}input{max-height:32px;padding:8px 0;background-color:transparent;border:none;color:var(--c-text-body);flex:1 1 auto;font-family:var(--c-font-family);font-size:16px;line-height:20px;max-width:100%;min-width:0;width:100%;pointer-events:none}input:focus,input:active{outline:none}input::-ms-reveal{display:none}svg{fill:currentColor;height:22px;width:22px}.c-input--disabled{color:var(--c-tertiary-400)}.c-input:focus-within{color:var(--c-primary-600)}.c-input--error{color:var(--c-error-600)}.c-input--error:focus-within{color: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}";
352
1213
 
353
- const CRow = class {
1214
+ const CSelect = class {
354
1215
  constructor(hostRef) {
355
1216
  registerInstance(this, hostRef);
356
- this.gap = 0;
357
- this.nowrap = false;
358
- this.align = undefined;
359
- this.justify = undefined;
1217
+ this.changeValue = createEvent(this, "changeValue", 3);
1218
+ if (hostRef.$hostElement$["s-ei"]) {
1219
+ this.internals = hostRef.$hostElement$["s-ei"];
1220
+ }
1221
+ else {
1222
+ this.internals = hostRef.$hostElement$.attachInternals();
1223
+ hostRef.$hostElement$["s-ei"] = this.internals;
1224
+ }
1225
+ this._preventDialogOpen = false;
1226
+ this._debounce = null;
1227
+ this._lastKeyPressTime = null;
1228
+ this._searchString = '';
1229
+ this._toggleDropdown = (event) => {
1230
+ event.stopPropagation();
1231
+ if (this.dropdownVisible) {
1232
+ this._dropdownElement.close();
1233
+ return;
1234
+ }
1235
+ this._dropdownElement.open();
1236
+ };
1237
+ this._onButtonKeyDown = (src, event) => {
1238
+ event.stopPropagation();
1239
+ if (event.key !== 'Tab')
1240
+ event.preventDefault();
1241
+ if (['Enter', ' '].includes(event.key)) {
1242
+ if (src === 'chevron') {
1243
+ this._toggleDropdown(event);
1244
+ return;
1245
+ }
1246
+ this._onReset(event);
1247
+ this._preventDialogOpen = true;
1248
+ requestAnimationFrame(() => {
1249
+ this._inputElement.focus();
1250
+ });
1251
+ }
1252
+ };
1253
+ this._onSlotChange = () => {
1254
+ this.optionElements = this.el.querySelectorAll('c-option');
1255
+ if (this.optionElements.length && !this.optionElementsExist) {
1256
+ this.optionElementsExist = true;
1257
+ }
1258
+ const selection = Array.from(this.optionElements).find((option) => option.selected);
1259
+ if (selection) {
1260
+ this.value = this.returnObject
1261
+ ? { name: selection.name, value: selection.value }
1262
+ : selection.value;
1263
+ this.changeValue.emit(this.value);
1264
+ this.internals.setFormValue(selection.value.toString());
1265
+ }
1266
+ };
1267
+ this._onReset = (event) => {
1268
+ event.stopPropagation();
1269
+ this.changeValue.emit(null);
1270
+ this.internals.setFormValue(null);
1271
+ this._selectionElement.classList.remove('c-input-menu__selection--show');
1272
+ this._selectionElement.replaceChildren(null);
1273
+ this._preventDialogOpen = true;
1274
+ this._cInputElement.reset();
1275
+ this._inputElement.focus();
1276
+ this._dropdownElement.updateList();
1277
+ };
1278
+ this._onInputFocus = () => {
1279
+ if (!this._preventDialogOpen) {
1280
+ this._dropdownElement.open();
1281
+ }
1282
+ this._updateStatusText();
1283
+ this._preventDialogOpen = false;
1284
+ };
1285
+ this.items = [];
1286
+ this.value = null;
1287
+ this.hostId = undefined;
1288
+ this.clearable = false;
1289
+ this.disabled = false;
1290
+ this.label = undefined;
1291
+ this.name = undefined;
1292
+ this.placeholder = '';
1293
+ this.hideDetails = false;
1294
+ this.hint = '';
1295
+ this.loading = false;
1296
+ this.required = false;
1297
+ this.valid = true;
1298
+ this.validate = false;
1299
+ this.validateOnBlur = false;
1300
+ this.validation = 'Required field';
1301
+ this.shadow = false;
1302
+ this.returnObject = false;
1303
+ this.itemsPerPage = 6;
1304
+ this.optionAsSelection = undefined;
1305
+ this.optionElements = undefined;
1306
+ this.currentIndex = null;
1307
+ this.dropdownVisible = false;
1308
+ this.statusText = '';
1309
+ this.optionElementsExist = false;
1310
+ }
1311
+ get _id() {
1312
+ return this.hostId || `select_${CSelect._uniqueId}`;
1313
+ }
1314
+ get _items() {
1315
+ return this.optionElementsExist ? this.optionElements : this.items;
1316
+ }
1317
+ get _value() {
1318
+ var _a, _b, _c, _d;
1319
+ if (!this.value)
1320
+ return '';
1321
+ if (!this.returnObject &&
1322
+ !['number', 'string'].includes(typeof this.value)) {
1323
+ console.warn(`[C-SELECT] The value should be of type 'number' or 'string' when return-object is not used.`);
1324
+ return '';
1325
+ }
1326
+ if (!this.returnObject &&
1327
+ ['number', 'string'].includes(typeof this.value)) {
1328
+ return (_b = (_a = Array.from(this._items)) === null || _a === void 0 ? void 0 : _a.find((item) => item.value === this.value)) === null || _b === void 0 ? void 0 : _b.name;
1329
+ }
1330
+ return (_d = (_c = Array.from(this._items)) === null || _c === void 0 ? void 0 : _c.find((item) => item.value === this.value.value)) === null || _d === void 0 ? void 0 : _d.name;
1331
+ }
1332
+ async reset() {
1333
+ this.changeValue.emit(null);
1334
+ this.internals.setFormValue(null);
1335
+ this._dropdownElement.updateList();
1336
+ }
1337
+ handleKeyDown(event) {
1338
+ const alphanumeric = /^[0-9a-zA-Z ]+$/;
1339
+ if (event.key.match(alphanumeric) && event.key.length === 1) {
1340
+ if (this.dropdownVisible)
1341
+ return;
1342
+ if (Date.now() - this._lastKeyPressTime > 3000) {
1343
+ this._searchString = event.key;
1344
+ }
1345
+ else {
1346
+ this._searchString += event.key;
1347
+ }
1348
+ this._lastKeyPressTime = Date.now();
1349
+ const selectionIndex = Array.from(this._items).findIndex((i) => i.name.toLowerCase().startsWith(this._searchString));
1350
+ this.currentIndex = selectionIndex >= 0 ? selectionIndex : null;
1351
+ if (this.currentIndex !== null) {
1352
+ this._dropdownElement.selectItem(this.currentIndex);
1353
+ }
1354
+ return;
1355
+ }
1356
+ if (event.key === 'Escape') {
1357
+ this._preventDialogOpen = true;
1358
+ this._dropdownElement.close();
1359
+ this._inputElement.focus();
1360
+ return;
1361
+ }
1362
+ if (event.key === 'Tab') {
1363
+ this._dropdownElement.close();
1364
+ }
1365
+ if (event.key === 'ArrowDown') {
1366
+ event.preventDefault();
1367
+ if (!this._items.length)
1368
+ return;
1369
+ if (!this.dropdownVisible) {
1370
+ this._dropdownElement.open();
1371
+ }
1372
+ this.currentIndex =
1373
+ this.currentIndex === null
1374
+ ? 0
1375
+ : Math.min(this.currentIndex + 1, this._items.length - 1);
1376
+ this._dropdownElement.focusItem(this.currentIndex);
1377
+ }
1378
+ if (event.key === 'ArrowUp') {
1379
+ event.preventDefault();
1380
+ if (this.currentIndex === 0) {
1381
+ this._dropdownElement.close();
1382
+ this._inputElement.focus();
1383
+ }
1384
+ if (!this.dropdownVisible) {
1385
+ this._dropdownElement.open();
1386
+ }
1387
+ this.currentIndex =
1388
+ this.currentIndex === null
1389
+ ? this._items.length - 1
1390
+ : Math.max(this.currentIndex - 1, 0);
1391
+ this._dropdownElement.focusItem(this.currentIndex);
1392
+ }
1393
+ if (event.key === ' ') {
1394
+ event.preventDefault();
1395
+ }
1396
+ if (event.key === 'Enter') {
1397
+ event.preventDefault();
1398
+ if (this.currentIndex === null)
1399
+ return;
1400
+ this._dropdownElement.selectItem(this.currentIndex);
1401
+ }
1402
+ if (event.key === 'Home' && this.dropdownVisible) {
1403
+ this.currentIndex = 0;
1404
+ }
1405
+ if (event.key === 'End' && this.dropdownVisible) {
1406
+ this.currentIndex = this._items.length - 1;
1407
+ }
1408
+ }
1409
+ onDropdownStateChange(event) {
1410
+ const isOpen = event.detail;
1411
+ this.dropdownVisible = isOpen;
1412
+ }
1413
+ onSelectOption(event) {
1414
+ this._dropdownElement.close();
1415
+ const { name, value } = event.detail;
1416
+ const selection = this._setCurrentIndex({ name, value });
1417
+ if (this.optionElementsExist && this.optionAsSelection && selection) {
1418
+ const clone = selection.cloneNode(true);
1419
+ this._selectionElement.classList.add('c-input-menu__selection--show');
1420
+ this._selectionElement.replaceChildren(clone);
1421
+ }
1422
+ this._dropdownElement.updateList();
1423
+ this.value = this.returnObject ? event.detail : value;
1424
+ this.changeValue.emit(this.value);
1425
+ this.internals.setFormValue(value);
1426
+ this._preventDialogOpen = true;
1427
+ this._inputElement.focus();
1428
+ }
1429
+ _setCurrentIndex({ value, name }) {
1430
+ let selection = null;
1431
+ Array.from(this._items).forEach((item, index) => {
1432
+ const selected = item.value === value && item.name === name;
1433
+ if (this.optionElementsExist) {
1434
+ item.selected = selected;
1435
+ }
1436
+ if (selected) {
1437
+ this.currentIndex = index;
1438
+ selection = item;
1439
+ }
1440
+ });
1441
+ return selection;
1442
+ }
1443
+ _updateInput() {
1444
+ this._dropdownElement.open();
1445
+ this._dropdownElement.updateList();
1446
+ }
1447
+ _updateStatusText() {
1448
+ if (this._debounce !== null) {
1449
+ clearTimeout(this._debounce);
1450
+ this._debounce = null;
1451
+ }
1452
+ this._debounce = window.setTimeout(() => {
1453
+ this.statusText = '';
1454
+ if (this.currentIndex === null) {
1455
+ this.statusText = this._items.length
1456
+ ? `${this._items.length} option${this._items.length !== 1 ? 's' : ''} available`
1457
+ : 'No options available';
1458
+ }
1459
+ const ending = !!this._items.length
1460
+ ? ', navigate using the up and down arrows'
1461
+ : '';
1462
+ this._dropdownElement.setStatusText(this.statusText + ending);
1463
+ this._debounce = null;
1464
+ }, 1400);
1465
+ }
1466
+ componentWillLoad() {
1467
+ CSelect._uniqueId += 1;
1468
+ this._inputId =
1469
+ 'input_' +
1470
+ (this.hostId || this.label || this.placeholder).replace(/[^a-zA-Z0-9-_]/g, '');
360
1471
  }
361
1472
  componentDidLoad() {
362
- this.el.style.setProperty('--_c-row-gap', this.el.dataset.gap);
1473
+ if (!this.value)
1474
+ return;
1475
+ const selection = Array.from(this._items).find((item) => {
1476
+ if (this.returnObject) {
1477
+ return (item.name === this.value.name &&
1478
+ item.value === this.value.value);
1479
+ }
1480
+ return item.value === this.value;
1481
+ });
1482
+ this._setCurrentIndex({
1483
+ name: selection.name,
1484
+ value: selection.value.toString(),
1485
+ });
363
1486
  }
364
- render() {
1487
+ _renderLoader() {
1488
+ return h("c-spinner", { color: "var(--_c-autocomplete-active-color)", size: 20 });
1489
+ }
1490
+ _renderChevron() {
365
1491
  const classes = {
366
- 'c-row': true,
367
- 'c-row--nowrap': this.nowrap,
368
- [`c-row--align-${this.align}`]: !!this.align,
369
- [`c-row--justify-${this.justify}`]: !!this.justify,
1492
+ 'c-input-menu__chevron': true,
1493
+ 'c-input-menu__chevron--active': this.dropdownVisible,
370
1494
  };
371
- return (h(Host, { "data-gap": `${this.gap}px`, class: classes }, h("slot", null)));
1495
+ return (h("c-icon-button", { size: "x-small", class: classes, text: true, onClick: (event) => this._toggleDropdown(event), onKeyDown: (event) => this._onButtonKeyDown('chevron', event) }, h("c-icon", { path: mdiChevronDown, size: 24 })));
372
1496
  }
373
- get el() { return getElement(this); }
374
- };
375
- CRow.style = cRowCss;
376
-
377
- const cSpacerCss = "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{flex-grow:1 !important}";
378
-
379
- const CSpacer = class {
380
- constructor(hostRef) {
381
- registerInstance(this, hostRef);
1497
+ _renderInputElement() {
1498
+ var _a;
1499
+ return (h("div", { class: "c-input-menu__input" }, h("input", { type: "text", readonly: true, 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._value, name: (_a = this.name) !== null && _a !== void 0 ? _a : null, onInput: () => this._updateInput(), onFocus: () => this._onInputFocus() }), h("div", { ref: (el) => (this._selectionElement = el), class: "c-input-menu__selection" })));
1500
+ }
1501
+ _renderReset() {
1502
+ return (h("c-icon-button", { "aria-label": "", size: "x-small", text: true, onClick: (event) => this._onReset(event), onKeyDown: (event) => this._onButtonKeyDown('reset', event) }, h("c-icon", { path: mdiClose, size: 20 })));
382
1503
  }
383
1504
  render() {
384
- return h(Host, null);
1505
+ const itemType = this.optionElementsExist ? 'option' : 'item';
1506
+ return (h(Host, null, 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: "select" }, 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.value, variant: "select", onClick: () => this._dropdownElement.open() }, h("slot", { name: "pre", slot: "pre" }), h("div", { class: "c-input__content" }, this._renderInputElement(), this.loading && this._renderLoader(), !this.loading &&
1507
+ this.value &&
1508
+ this.clearable &&
1509
+ this._renderReset(), !this.loading &&
1510
+ (!this.value || !this.clearable) &&
1511
+ this._renderChevron(), h("slot", { onSlotchange: () => this._onSlotChange() })), h("slot", { name: "post", slot: "post" })))));
385
1512
  }
1513
+ static get formAssociated() { return true; }
1514
+ get el() { return getElement(this); }
386
1515
  };
387
- CSpacer.style = cSpacerCss;
1516
+ CSelect._uniqueId = 0;
1517
+ CSelect.style = cSelectCss;
388
1518
 
389
1519
  const cSpinnerCss = "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-spinner-color:var(--c-spinner-color, var(--c-color));--_c-spinner-size:var(--c-size);--_c-spinner-width:var(--c-width);display:block;height:var(--_c-spinner-size);width:var(--_c-spinner-size)}:host(.c-spinner) svg{fill:var(--_c-spinner-color);height:var(--_c-spinner-size);overflow:visible;width:var(--_c-spinner-size)}:host(.c-spinner) svg circle{animation:spinner 2.5s linear infinite;fill:transparent;stroke-dasharray:calc(3.14 * var(--_c-spinner-size));stroke-linecap:round;stroke-width:var(--_c-spinner-width);stroke:var(--_c-spinner-color);transform-origin:calc(0.5px * var(--_c-spinner-size)) calc(0.5px * var(--_c-spinner-size)) 0}@keyframes spinner{0%{transform:rotate(0deg);stroke-dashoffset:calc(0.66 * var(--_c-spinner-size))}50%{transform:rotate(720deg);stroke-dashoffset:calc(3.14 * var(--_c-spinner-size))}100%{transform:rotate(1080deg);stroke-dashoffset:calc(0.66 * var(--_c-spinner-size))}}";
390
1520
 
@@ -411,18 +1541,6 @@ const CSpinner = class {
411
1541
  };
412
1542
  CSpinner.style = cSpinnerCss;
413
1543
 
414
- const cToolbarCss = "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-toolbar-background-color:var(--c-toolbar-background-color, var(--c-white));--_c-toolbar-text-color:var(--c-toolbar-text-color, var(--c-text-system))}:host .c-toolbar{align-items:center;background:var(--_c-toolbar-background-color);box-shadow:2px 4px 10px rgba(0, 0, 0, 0.1607843137);color:var(--_c-toolbar-text-color);column-gap:12px;display:flex;height:60px;padding-left:16px;padding-right:16px;position:fixed;width:100%;z-index:9}:host .spacer{height:60px;width:100%}:host(.relative) .c-toolbar{position:relative;margin-bottom:-60px}";
415
-
416
- const CToolbar = class {
417
- constructor(hostRef) {
418
- registerInstance(this, hostRef);
419
- }
420
- render() {
421
- return (h(Host, null, h("div", { class: "c-toolbar" }, h("slot", null)), h("div", { class: "spacer" })));
422
- }
423
- };
424
- CToolbar.style = cToolbarCss;
425
-
426
- export { CBadge as c_badge, CButton as c_button, CCard as c_card, CCscLogo as c_csc_logo, CIcon as c_icon, CIconButton as c_icon_button, CMain as c_main, CRipple as c_ripple, CRow as c_row, CSpacer as c_spacer, CSpinner as c_spinner, CToolbar as c_toolbar };
1544
+ export { CAutocomplete as c_autocomplete, CBadge as c_badge, CButton as c_button, CCard as c_card, CCardActions as c_card_actions, CCardContent as c_card_content, CCardTitle as c_card_title, CDropdown as c_dropdown, CIcon as c_icon, CIconButton as c_icon_button, CInput as c_input, CMessage as c_message, COption as c_option, CRipple as c_ripple, CSelect as c_select, CSpinner as c_spinner };
427
1545
 
428
- //# sourceMappingURL=c-badge_12.entry.js.map
1546
+ //# sourceMappingURL=c-autocomplete_16.entry.js.map