@cscfi/csc-ui 1.2.1 → 1.2.3

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