@energinet/watt 4.3.19 → 4.3.21

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 (171) hide show
  1. package/fesm2022/energinet-watt-badge.mjs +3 -3
  2. package/fesm2022/energinet-watt-badge.mjs.map +1 -1
  3. package/fesm2022/energinet-watt-breadcrumbs.mjs +8 -8
  4. package/fesm2022/energinet-watt-breadcrumbs.mjs.map +1 -1
  5. package/fesm2022/energinet-watt-button.mjs +3 -3
  6. package/fesm2022/energinet-watt-button.mjs.map +1 -1
  7. package/fesm2022/energinet-watt-card.mjs +6 -6
  8. package/fesm2022/energinet-watt-card.mjs.map +1 -1
  9. package/fesm2022/energinet-watt-checkbox.mjs +3 -3
  10. package/fesm2022/energinet-watt-checkbox.mjs.map +1 -1
  11. package/fesm2022/energinet-watt-chip.mjs +91 -27
  12. package/fesm2022/energinet-watt-chip.mjs.map +1 -1
  13. package/fesm2022/energinet-watt-clipboard.mjs +7 -7
  14. package/fesm2022/energinet-watt-clipboard.mjs.map +1 -1
  15. package/fesm2022/energinet-watt-code.mjs +6 -6
  16. package/fesm2022/energinet-watt-code.mjs.map +1 -1
  17. package/fesm2022/energinet-watt-core-breakpoints.mjs +3 -3
  18. package/fesm2022/energinet-watt-core-breakpoints.mjs.map +1 -1
  19. package/fesm2022/energinet-watt-core-color.mjs +3 -3
  20. package/fesm2022/energinet-watt-core-color.mjs.map +1 -1
  21. package/fesm2022/energinet-watt-core-date.mjs +6 -6
  22. package/fesm2022/energinet-watt-core-date.mjs.map +1 -1
  23. package/fesm2022/energinet-watt-data.mjs +12 -12
  24. package/fesm2022/energinet-watt-data.mjs.map +1 -1
  25. package/fesm2022/energinet-watt-datetime-field.mjs +3 -3
  26. package/fesm2022/energinet-watt-datetime-field.mjs.map +1 -1
  27. package/fesm2022/energinet-watt-description-list.mjs +6 -6
  28. package/fesm2022/energinet-watt-description-list.mjs.map +1 -1
  29. package/fesm2022/energinet-watt-drawer.mjs +19 -19
  30. package/fesm2022/energinet-watt-drawer.mjs.map +1 -1
  31. package/fesm2022/energinet-watt-dropdown.mjs +14 -4
  32. package/fesm2022/energinet-watt-dropdown.mjs.map +1 -1
  33. package/fesm2022/energinet-watt-dropzone.mjs +14 -14
  34. package/fesm2022/energinet-watt-dropzone.mjs.map +1 -1
  35. package/fesm2022/energinet-watt-empty-state.mjs +18 -18
  36. package/fesm2022/energinet-watt-empty-state.mjs.map +1 -1
  37. package/fesm2022/energinet-watt-expandable-card.mjs +9 -9
  38. package/fesm2022/energinet-watt-expandable-card.mjs.map +1 -1
  39. package/fesm2022/energinet-watt-field.mjs +15 -15
  40. package/fesm2022/energinet-watt-field.mjs.map +1 -1
  41. package/fesm2022/energinet-watt-file-field.mjs +3 -3
  42. package/fesm2022/energinet-watt-file-field.mjs.map +1 -1
  43. package/fesm2022/energinet-watt-heading.mjs +3 -3
  44. package/fesm2022/energinet-watt-heading.mjs.map +1 -1
  45. package/fesm2022/energinet-watt-icon-flags.mjs +30 -30
  46. package/fesm2022/energinet-watt-icon-flags.mjs.map +1 -1
  47. package/fesm2022/energinet-watt-icon.mjs +5 -3
  48. package/fesm2022/energinet-watt-icon.mjs.map +1 -1
  49. package/fesm2022/energinet-watt-json-viewer.mjs +12 -15
  50. package/fesm2022/energinet-watt-json-viewer.mjs.map +1 -1
  51. package/fesm2022/energinet-watt-menu.mjs +12 -12
  52. package/fesm2022/energinet-watt-menu.mjs.map +1 -1
  53. package/fesm2022/energinet-watt-modal.mjs +11 -11
  54. package/fesm2022/energinet-watt-modal.mjs.map +1 -1
  55. package/fesm2022/energinet-watt-paginator.mjs +6 -6
  56. package/fesm2022/energinet-watt-paginator.mjs.map +1 -1
  57. package/fesm2022/energinet-watt-phone-field.mjs +6 -6
  58. package/fesm2022/energinet-watt-phone-field.mjs.map +1 -1
  59. package/fesm2022/energinet-watt-picker-__shared.mjs +13 -17
  60. package/fesm2022/energinet-watt-picker-__shared.mjs.map +1 -1
  61. package/fesm2022/energinet-watt-picker-datepicker.mjs +7 -7
  62. package/fesm2022/energinet-watt-picker-datepicker.mjs.map +1 -1
  63. package/fesm2022/energinet-watt-picker-timepicker.mjs +3 -3
  64. package/fesm2022/energinet-watt-picker-timepicker.mjs.map +1 -1
  65. package/fesm2022/energinet-watt-progress-tracker.mjs +6 -6
  66. package/fesm2022/energinet-watt-progress-tracker.mjs.map +1 -1
  67. package/fesm2022/energinet-watt-query-params.mjs +3 -3
  68. package/fesm2022/energinet-watt-query-params.mjs.map +1 -1
  69. package/fesm2022/energinet-watt-radio.mjs +8 -8
  70. package/fesm2022/energinet-watt-radio.mjs.map +1 -1
  71. package/fesm2022/energinet-watt-search.mjs +6 -6
  72. package/fesm2022/energinet-watt-search.mjs.map +1 -1
  73. package/fesm2022/energinet-watt-segmented-buttons.mjs +6 -6
  74. package/fesm2022/energinet-watt-segmented-buttons.mjs.map +1 -1
  75. package/fesm2022/energinet-watt-separator.mjs +3 -3
  76. package/fesm2022/energinet-watt-separator.mjs.map +1 -1
  77. package/fesm2022/energinet-watt-shell.mjs +13 -13
  78. package/fesm2022/energinet-watt-shell.mjs.map +1 -1
  79. package/fesm2022/energinet-watt-slide-toggle.mjs +3 -3
  80. package/fesm2022/energinet-watt-slide-toggle.mjs.map +1 -1
  81. package/fesm2022/energinet-watt-slider.mjs +3 -3
  82. package/fesm2022/energinet-watt-slider.mjs.map +1 -1
  83. package/fesm2022/energinet-watt-spinner.mjs +3 -3
  84. package/fesm2022/energinet-watt-spinner.mjs.map +1 -1
  85. package/fesm2022/energinet-watt-stepper.mjs +9 -9
  86. package/fesm2022/energinet-watt-stepper.mjs.map +1 -1
  87. package/fesm2022/energinet-watt-table.mjs +18 -27
  88. package/fesm2022/energinet-watt-table.mjs.map +1 -1
  89. package/fesm2022/energinet-watt-tabs.mjs +15 -15
  90. package/fesm2022/energinet-watt-tabs.mjs.map +1 -1
  91. package/fesm2022/energinet-watt-text-field.mjs +3 -3
  92. package/fesm2022/energinet-watt-text-field.mjs.map +1 -1
  93. package/fesm2022/energinet-watt-textarea-field.mjs +38 -23
  94. package/fesm2022/energinet-watt-textarea-field.mjs.map +1 -1
  95. package/fesm2022/energinet-watt-toast.mjs +6 -6
  96. package/fesm2022/energinet-watt-toast.mjs.map +1 -1
  97. package/fesm2022/energinet-watt-tooltip.mjs +9 -9
  98. package/fesm2022/energinet-watt-tooltip.mjs.map +1 -1
  99. package/fesm2022/energinet-watt-utils-css.mjs +3 -3
  100. package/fesm2022/energinet-watt-utils-css.mjs.map +1 -1
  101. package/fesm2022/energinet-watt-utils-intersection-observer.mjs +3 -3
  102. package/fesm2022/energinet-watt-utils-intersection-observer.mjs.map +1 -1
  103. package/fesm2022/energinet-watt-utils-resize-observer.mjs +6 -6
  104. package/fesm2022/energinet-watt-utils-resize-observer.mjs.map +1 -1
  105. package/fesm2022/energinet-watt-validation-message.mjs +3 -3
  106. package/fesm2022/energinet-watt-validation-message.mjs.map +1 -1
  107. package/fesm2022/energinet-watt-vater.mjs +30 -30
  108. package/fesm2022/energinet-watt-vater.mjs.map +1 -1
  109. package/fesm2022/energinet-watt-year-field.mjs +4 -4
  110. package/fesm2022/energinet-watt-year-field.mjs.map +1 -1
  111. package/fesm2022/energinet-watt-yearmonth-field.mjs +4 -4
  112. package/fesm2022/energinet-watt-yearmonth-field.mjs.map +1 -1
  113. package/package.json +100 -99
  114. package/{button/index.d.ts → types/energinet-watt-button.d.ts} +1 -1
  115. package/{chip/index.d.ts → types/energinet-watt-chip.d.ts} +10 -2
  116. package/{data/index.d.ts → types/energinet-watt-data.d.ts} +1 -1
  117. package/{dropdown/index.d.ts → types/energinet-watt-dropdown.d.ts} +1 -0
  118. package/{empty-state/index.d.ts → types/energinet-watt-empty-state.d.ts} +1 -1
  119. package/{icon/index.d.ts → types/energinet-watt-icon.d.ts} +3 -1
  120. package/{modal/index.d.ts → types/energinet-watt-modal.d.ts} +1 -1
  121. package/{text-field/index.d.ts → types/energinet-watt-text-field.d.ts} +1 -1
  122. package/{textarea-field/index.d.ts → types/energinet-watt-textarea-field.d.ts} +1 -1
  123. package/{validation-message/index.d.ts → types/energinet-watt-validation-message.d.ts} +1 -1
  124. /package/{badge/index.d.ts → types/energinet-watt-badge.d.ts} +0 -0
  125. /package/{breadcrumbs/index.d.ts → types/energinet-watt-breadcrumbs.d.ts} +0 -0
  126. /package/{card/index.d.ts → types/energinet-watt-card.d.ts} +0 -0
  127. /package/{checkbox/index.d.ts → types/energinet-watt-checkbox.d.ts} +0 -0
  128. /package/{clipboard/index.d.ts → types/energinet-watt-clipboard.d.ts} +0 -0
  129. /package/{code/index.d.ts → types/energinet-watt-code.d.ts} +0 -0
  130. /package/{core/breakpoints/index.d.ts → types/energinet-watt-core-breakpoints.d.ts} +0 -0
  131. /package/{core/color/index.d.ts → types/energinet-watt-core-color.d.ts} +0 -0
  132. /package/{core/date/index.d.ts → types/energinet-watt-core-date.d.ts} +0 -0
  133. /package/{datetime-field/index.d.ts → types/energinet-watt-datetime-field.d.ts} +0 -0
  134. /package/{description-list/index.d.ts → types/energinet-watt-description-list.d.ts} +0 -0
  135. /package/{drawer/index.d.ts → types/energinet-watt-drawer.d.ts} +0 -0
  136. /package/{dropzone/index.d.ts → types/energinet-watt-dropzone.d.ts} +0 -0
  137. /package/{expandable-card/index.d.ts → types/energinet-watt-expandable-card.d.ts} +0 -0
  138. /package/{field/index.d.ts → types/energinet-watt-field.d.ts} +0 -0
  139. /package/{file-field/index.d.ts → types/energinet-watt-file-field.d.ts} +0 -0
  140. /package/{heading/index.d.ts → types/energinet-watt-heading.d.ts} +0 -0
  141. /package/{icon/flags/index.d.ts → types/energinet-watt-icon-flags.d.ts} +0 -0
  142. /package/{json-viewer/index.d.ts → types/energinet-watt-json-viewer.d.ts} +0 -0
  143. /package/{menu/index.d.ts → types/energinet-watt-menu.d.ts} +0 -0
  144. /package/{paginator/index.d.ts → types/energinet-watt-paginator.d.ts} +0 -0
  145. /package/{phone-field/index.d.ts → types/energinet-watt-phone-field.d.ts} +0 -0
  146. /package/{picker/__shared/index.d.ts → types/energinet-watt-picker-__shared.d.ts} +0 -0
  147. /package/{picker/datepicker/index.d.ts → types/energinet-watt-picker-datepicker.d.ts} +0 -0
  148. /package/{picker/timepicker/index.d.ts → types/energinet-watt-picker-timepicker.d.ts} +0 -0
  149. /package/{progress-tracker/index.d.ts → types/energinet-watt-progress-tracker.d.ts} +0 -0
  150. /package/{query-params/index.d.ts → types/energinet-watt-query-params.d.ts} +0 -0
  151. /package/{radio/index.d.ts → types/energinet-watt-radio.d.ts} +0 -0
  152. /package/{search/index.d.ts → types/energinet-watt-search.d.ts} +0 -0
  153. /package/{segmented-buttons/index.d.ts → types/energinet-watt-segmented-buttons.d.ts} +0 -0
  154. /package/{separator/index.d.ts → types/energinet-watt-separator.d.ts} +0 -0
  155. /package/{shell/index.d.ts → types/energinet-watt-shell.d.ts} +0 -0
  156. /package/{slide-toggle/index.d.ts → types/energinet-watt-slide-toggle.d.ts} +0 -0
  157. /package/{slider/index.d.ts → types/energinet-watt-slider.d.ts} +0 -0
  158. /package/{spinner/index.d.ts → types/energinet-watt-spinner.d.ts} +0 -0
  159. /package/{stepper/index.d.ts → types/energinet-watt-stepper.d.ts} +0 -0
  160. /package/{table/index.d.ts → types/energinet-watt-table.d.ts} +0 -0
  161. /package/{tabs/index.d.ts → types/energinet-watt-tabs.d.ts} +0 -0
  162. /package/{toast/index.d.ts → types/energinet-watt-toast.d.ts} +0 -0
  163. /package/{tooltip/index.d.ts → types/energinet-watt-tooltip.d.ts} +0 -0
  164. /package/{utils/css/index.d.ts → types/energinet-watt-utils-css.d.ts} +0 -0
  165. /package/{utils/intersection-observer/index.d.ts → types/energinet-watt-utils-intersection-observer.d.ts} +0 -0
  166. /package/{utils/resize-observer/index.d.ts → types/energinet-watt-utils-resize-observer.d.ts} +0 -0
  167. /package/{validators/index.d.ts → types/energinet-watt-validators.d.ts} +0 -0
  168. /package/{vater/index.d.ts → types/energinet-watt-vater.d.ts} +0 -0
  169. /package/{year-field/index.d.ts → types/energinet-watt-year-field.d.ts} +0 -0
  170. /package/{yearmonth-field/index.d.ts → types/energinet-watt-yearmonth-field.d.ts} +0 -0
  171. /package/{index.d.ts → types/energinet-watt.d.ts} +0 -0
@@ -182,6 +182,16 @@ class WattDropdownComponent {
182
182
  const optionsToSelect = toggleAllState ? filteredOptions : [];
183
183
  this.matSelectControl.patchValue(optionsToSelect);
184
184
  }
185
+ onFieldClick(event) {
186
+ const target = event.target;
187
+ // Prevent re-opening when click originated from backdrop or select panel
188
+ // This handles the case where Angular Material 21's inline overlay
189
+ // causes click events to bubble up to parent containers
190
+ if (!target?.classList.contains('cdk-overlay-backdrop') &&
191
+ !target?.closest('.mat-mdc-select-panel')) {
192
+ this.matSelect()?.open();
193
+ }
194
+ }
185
195
  sortOptions(options) {
186
196
  return [...options].sort((a, b) => {
187
197
  return this.sortDirection() === 'asc'
@@ -320,10 +330,10 @@ class WattDropdownComponent {
320
330
  selectedFilteredOptions.length === filteredOptions.length;
321
331
  }
322
332
  }
323
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
324
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattDropdownComponent, isStandalone: true, selector: "watt-dropdown", inputs: { hideSearch: { classPropertyName: "hideSearch", publicName: "hideSearch", isSignal: true, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null }, getCustomTrigger: { classPropertyName: "getCustomTrigger", publicName: "getCustomTrigger", isSignal: true, isRequired: false, transformFunction: null }, chipMode: { classPropertyName: "chipMode", publicName: "chipMode", isSignal: true, isRequired: false, transformFunction: null }, disableSelectedMode: { classPropertyName: "disableSelectedMode", publicName: "disableSelectedMode", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showResetOption: { classPropertyName: "showResetOption", publicName: "showResetOption", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, noOptionsFoundLabel: { classPropertyName: "noOptionsFoundLabel", publicName: "noOptionsFoundLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { options: "optionsChange" }, host: { properties: { "attr.watt-field-disabled": "isDisabled()", "class.watt-chip-mode": "chipMode()" } }, viewQueries: [{ propertyName: "matSelect", first: true, predicate: ["matSelect"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field\n [control]=\"parentControl\"\n [chipMode]=\"chipMode()\"\n [label]=\"label()\"\n (click)=\"matSelect.open()\"\n>\n @if (chipMode()) {\n <watt-menu-chip\n [opened]=\"matSelect.panelOpen\"\n (toggleChange)=\"matSelect.open()\"\n [selected]=\"!!matSelect?.triggerValue && !disableSelectedMode()\"\n [disabled]=\"matSelectControl.disabled\"\n >\n {{ placeholder() }}\n @if (showTriggerValue) {\n <span>\n @if (placeholder()) {\n :\n }\n {{ getCustomTrigger()?.(matSelect.value) ?? matSelect?.triggerValue }}\n </span>\n }\n @if (showChipLabel) {\n <span class=\"watt-chip-label\">{{ matSelectControl.value?.length }}</span>\n }\n </watt-menu-chip>\n }\n\n <mat-select\n [attr.aria-label]=\"label()\"\n [formControl]=\"matSelectControl\"\n [placeholder]=\"placeholder()\"\n #matSelect\n [panelWidth]=\"panelWidth()\"\n [multiple]=\"multiple()\"\n [class]=\"{ chip: chipMode(), 'mat-mdc-select-multiple': multiple() }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode(),\n 'mat-mdc-select-panel-multiple': multiple(),\n }\"\n >\n <!-- We use this instead of ngIf, since it will trigger a NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. -->\n <mat-option [style.display]=\"!hideSearch() ? 'block' : 'none'\">\n <ngx-mat-select-search\n [formControl]=\"filterControl\"\n [placeholderLabel]=\"placeholder()\"\n closeIcon=\"close\"\n [showToggleAllCheckbox]=\"multiple()\"\n (toggleAll)=\"onToggleAll($event)\"\n [toggleAllCheckboxChecked]=\"isToggleAllChecked\"\n [toggleAllCheckboxIndeterminate]=\"isToggleAllIndeterminate\"\n [noEntriesFoundLabel]=\"noOptionsFoundLabel()\"\n >\n <watt-icon ngxMatSelectSearchClear name=\"close\" size=\"s\" />\n </ngx-mat-select-search>\n </mat-option>\n\n @if (!multiple() && showResetOption()) {\n <mat-option>{{ emDash }}</mat-option>\n }\n\n @if (hasGroups()) {\n @for (item of filteredGroupedOptions(); track item) {\n @if (\"options\" in item) {\n <mat-optgroup [label]=\"item.label\" [disabled]=\"item.disabled\">\n @for (option of item.options; track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n </mat-optgroup>\n }\n }\n } @else {\n @for (option of filteredOptions(); track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n }\n </mat-select>\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n</watt-field>\n", styles: ["watt-dropdown:not(.watt-chip-mode){width:100%}watt-dropdown{--watt-input-color: var(--watt-typography-text-color);--watt-input-placeholder-color: var(--watt-on-light-high-emphasis);display:block;width:auto}watt-dropdown watt-field label .watt-field-wrapper{padding:0;position:relative}watt-dropdown.watt-chip-mode.ng-dirty.ng-invalid .watt-field-wrapper watt-chip label{border:1px solid var(--watt-color-state-danger)}watt-dropdown.watt-chip-mode[disabled=true] watt-field label .watt-field-wrapper{background-color:transparent}watt-dropdown .mat-input-element{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color);caret-color:var(--watt-color-neutral-grey-900)!important;padding:0 12px}watt-dropdown .mat-mdc-select-arrow{color:var(--watt-dropdown-arrow-color, rgba(0, 0, 0, .54));border:none;width:auto;height:auto}watt-dropdown .mat-mdc-select-arrow:before{width:.6em;height:.6em;bottom:.2em;position:relative;display:inline-block;border-style:solid;border-width:0 0 .15em .15em;transform:rotate(315deg);border-color:var(--watt-color-primary);content:\"\"}watt-dropdown .mat-mdc-select-arrow svg{display:none}watt-dropdown .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;padding:0 var(--watt-space-m)}watt-dropdown .mat-mdc-select-value{color:var(--watt-color-neutral-black);padding-right:var(--watt-space-m)}watt-dropdown .mat-mdc-select.mat-mdc-select-invalid.ng-pristine .mat-mdc-select-arrow{color:currentColor}watt-dropdown .watt-chip-label{float:right;margin-left:var(--watt-space-s);background:var(--watt-color-neutral-white)}watt-dropdown .watt-field--chip .mat-mdc-select{visibility:hidden;position:absolute;width:100%}watt-dropdown .mat-mdc-select-placeholder{color:var(--watt-input-placeholder-color)}watt-dropdown watt-field label .watt-field-wrapper{background-color:transparent}.watt-dropdown-panel{--watt-input-color: var(--watt-typography-text-color);padding:0}.watt-dropdown-panel .mat-select-search-inner-row .mat-select-search-input,.watt-dropdown-panel mat-option.contains-mat-select-search{height:48px}.watt-dropdown-panel:not(.watt-dropdown-panel-chip-mode){min-width:calc(100% + 2px)!important;margin-top:-36px;margin-left:-1px;min-height:48px}.watt-dropdown-panel .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{padding:0;margin:0 var(--watt-space-m)}.watt-dropdown-panel .mat-datepicker-content .mat-mdc-icon-button{--mat-mdc-button-persistent-ripple-color: transparent;--mat-mdc-button-ripple-color: transparent}.watt-dropdown-panel.watt-dropdown-panel-chip-mode{margin-top:4px}.watt-dropdown-panel.mat-mdc-select-search-panel{transform:scaleY(1)!important}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.contains-mat-select-search.mat-mdc-option-multiple{background-color:transparent}.watt-dropdown-panel ngx-mat-select-search .mat-select-search-inner-multiple .mat-select-search-inner-row{margin-left:5px}.watt-dropdown-panel ngx-mat-select-search .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{margin:0}.watt-dropdown-panel .mdc-list-item .mat-select-search-input,.watt-dropdown-panel .mat-mdc-option.mdc-list-item,.watt-dropdown-panel .mat-select-search-no-entries-found{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color)}.watt-dropdown-panel .mat-mdc-optgroup-label{font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;color:var(--watt-input-color)}.watt-dropdown-panel .mat-mdc-option.mdc-list-item .mat-select-search-no-entries-found{padding:var(--watt-space-s)}.watt-dropdown-panel .mat-checkbox-frame,.watt-dropdown-panel .mat-mdc-checkbox{border-color:var(--watt-color-primary)}.watt-dropdown-panel :not(.mat-mdc-option-multiple) .mat-pseudo-checkbox{display:none}.watt-dropdown-panel .mat-mdc-option-multiple .mat-pseudo-checkbox{display:inline-block}.watt-dropdown-panel .mat-pseudo-checkbox,.watt-dropdown-panel .mat-mdc-checkbox{color:var(--watt-color-primary)}.watt-dropdown-panel .mat-mdc-option{color:var(--watt-color-neutral-black);min-height:42px}.watt-dropdown-panel .mat-mdc-option[aria-disabled=true].contains-mat-select-search{margin-top:0;top:auto}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mat-mdc-option-active,.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mdc-list-item--selected.mat-mdc-option-active:not(.mat-mdc-option-multiple),.watt-dropdown-panel .mat-mdc-option:hover:not(.mat-mdc-option-disabled,.contains-mat-select-search),.watt-dropdown-panel .mat-mdc-option:focus:not(.mat-mdc-option-disabled){background-color:var(--watt-color-primary-light)}.watt-dropdown-panel .mat-mdc-option .mat-mdc-select-search-no-entries-found{text-align:center;padding:0}.watt-dropdown-panel .mat-mdc-option.mat-mdc-option-disabled{color:var(--watt-color-neutral-grey-400);cursor:not-allowed}.watt-dropdown-panel .mat-mdc-select-search-input:not(.mat-mdc-select-search-hidden){color:var(--watt-color-neutral-black)}.watt-dropdown-panel .mat-mdc-select-search-clear{background-color:var(--watt-color-neutral-white);color:var(--watt-color-neutral-grey-400)}.watt-dropdown-panel .mat-mdc-select-search-clear mat-icon{line-height:20px!important}\n"], dependencies: [{ kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i1.MatOptgroup, selector: "mat-optgroup", inputs: ["label", "disabled"], exportAs: ["matOptgroup"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NgxMatSelectSearchModule }, { kind: "component", type: i3.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti", "recreateValuesArray"], outputs: ["toggleAll"] }, { kind: "directive", type: i3.MatSelectSearchClearDirective, selector: "[ngxMatSelectSearchClear]" }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName", "displayMode", "autoFocus", "showErrors"] }, { kind: "component", type: WattMenuChipComponent, selector: "watt-menu-chip", inputs: ["opened", "disabled", "name", "value", "selected", "hasPopup"], outputs: ["toggleChange"] }], encapsulation: i0.ViewEncapsulation.None });
333
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattDropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
334
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: WattDropdownComponent, isStandalone: true, selector: "watt-dropdown", inputs: { hideSearch: { classPropertyName: "hideSearch", publicName: "hideSearch", isSignal: true, isRequired: false, transformFunction: null }, panelWidth: { classPropertyName: "panelWidth", publicName: "panelWidth", isSignal: true, isRequired: false, transformFunction: null }, getCustomTrigger: { classPropertyName: "getCustomTrigger", publicName: "getCustomTrigger", isSignal: true, isRequired: false, transformFunction: null }, chipMode: { classPropertyName: "chipMode", publicName: "chipMode", isSignal: true, isRequired: false, transformFunction: null }, disableSelectedMode: { classPropertyName: "disableSelectedMode", publicName: "disableSelectedMode", isSignal: true, isRequired: false, transformFunction: null }, sortDirection: { classPropertyName: "sortDirection", publicName: "sortDirection", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, showResetOption: { classPropertyName: "showResetOption", publicName: "showResetOption", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, noOptionsFoundLabel: { classPropertyName: "noOptionsFoundLabel", publicName: "noOptionsFoundLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { options: "optionsChange" }, host: { properties: { "attr.watt-field-disabled": "isDisabled()", "class.watt-chip-mode": "chipMode()" } }, viewQueries: [{ propertyName: "matSelect", first: true, predicate: ["matSelect"], descendants: true, isSignal: true }], ngImport: i0, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field\n [control]=\"parentControl\"\n [chipMode]=\"chipMode()\"\n [label]=\"label()\"\n (click)=\"onFieldClick($event)\"\n>\n @if (chipMode()) {\n <watt-menu-chip\n [opened]=\"matSelect.panelOpen\"\n (toggleChange)=\"matSelect.open()\"\n [selected]=\"!!matSelect?.triggerValue && !disableSelectedMode()\"\n [disabled]=\"matSelectControl.disabled\"\n >\n {{ placeholder() }}\n @if (showTriggerValue) {\n <span>\n @if (placeholder()) {\n :\n }\n {{ getCustomTrigger()?.(matSelect.value) ?? matSelect?.triggerValue }}\n </span>\n }\n @if (showChipLabel) {\n <span class=\"watt-chip-label\">{{ matSelectControl.value?.length }}</span>\n }\n </watt-menu-chip>\n }\n\n <mat-select\n [attr.aria-label]=\"label()\"\n [formControl]=\"matSelectControl\"\n [placeholder]=\"placeholder()\"\n #matSelect\n [panelWidth]=\"panelWidth()\"\n [multiple]=\"multiple()\"\n [class]=\"{ chip: chipMode(), 'mat-mdc-select-multiple': multiple() }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode(),\n 'mat-mdc-select-panel-multiple': multiple(),\n }\"\n >\n <!-- We use this instead of ngIf, since it will trigger a NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. -->\n <mat-option [style.display]=\"!hideSearch() ? 'block' : 'none'\">\n <ngx-mat-select-search\n [formControl]=\"filterControl\"\n [placeholderLabel]=\"placeholder()\"\n closeIcon=\"close\"\n [showToggleAllCheckbox]=\"multiple()\"\n (toggleAll)=\"onToggleAll($event)\"\n [toggleAllCheckboxChecked]=\"isToggleAllChecked\"\n [toggleAllCheckboxIndeterminate]=\"isToggleAllIndeterminate\"\n [noEntriesFoundLabel]=\"noOptionsFoundLabel()\"\n >\n <watt-icon ngxMatSelectSearchClear name=\"close\" size=\"s\" />\n </ngx-mat-select-search>\n </mat-option>\n\n @if (!multiple() && showResetOption()) {\n <mat-option>{{ emDash }}</mat-option>\n }\n\n @if (hasGroups()) {\n @for (item of filteredGroupedOptions(); track item) {\n @if (\"options\" in item) {\n <mat-optgroup [label]=\"item.label\" [disabled]=\"item.disabled\">\n @for (option of item.options; track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n </mat-optgroup>\n }\n }\n } @else {\n @for (option of filteredOptions(); track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n }\n </mat-select>\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n</watt-field>\n", styles: ["watt-dropdown:not(.watt-chip-mode){width:100%}watt-dropdown{--watt-input-color: var(--watt-typography-text-color);--watt-input-placeholder-color: var(--watt-on-light-high-emphasis);display:block;width:auto}watt-dropdown watt-field label .watt-field-wrapper{padding:0;position:relative}watt-dropdown.watt-chip-mode.ng-dirty.ng-invalid .watt-field-wrapper watt-chip label{border:1px solid var(--watt-color-state-danger)}watt-dropdown.watt-chip-mode[disabled=true] watt-field label .watt-field-wrapper{background-color:transparent}watt-dropdown .mat-input-element{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color);caret-color:var(--watt-color-neutral-grey-900)!important;padding:0 12px}watt-dropdown .mat-mdc-select-arrow{color:var(--watt-dropdown-arrow-color, rgba(0, 0, 0, .54));border:none;width:auto;height:auto}watt-dropdown .mat-mdc-select-arrow:before{width:.6em;height:.6em;bottom:.2em;position:relative;display:inline-block;border-style:solid;border-width:0 0 .15em .15em;transform:rotate(315deg);border-color:var(--watt-color-primary);content:\"\"}watt-dropdown .mat-mdc-select-arrow svg{display:none}watt-dropdown .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;padding:0 var(--watt-space-m)}watt-dropdown .mat-mdc-select-value{color:var(--watt-color-neutral-black);padding-right:var(--watt-space-m)}watt-dropdown .mat-mdc-select.mat-mdc-select-invalid.ng-pristine .mat-mdc-select-arrow{color:currentColor}watt-dropdown .watt-chip-label{float:right;margin-left:var(--watt-space-s);background:var(--watt-color-neutral-white)}watt-dropdown .watt-field--chip .mat-mdc-select{opacity:0;pointer-events:none;position:absolute;width:100%}watt-dropdown .mat-mdc-select-placeholder{color:var(--watt-input-placeholder-color)}watt-dropdown watt-field label .watt-field-wrapper{background-color:transparent}.watt-dropdown-panel{--watt-input-color: var(--watt-typography-text-color);padding:0}.watt-dropdown-panel .mat-select-search-inner-row .mat-select-search-input,.watt-dropdown-panel mat-option.contains-mat-select-search{height:48px}.watt-dropdown-panel:not(.watt-dropdown-panel-chip-mode){min-width:calc(100% + 2px)!important;margin-top:-36px;margin-left:-1px;min-height:48px}.watt-dropdown-panel .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{padding:0;margin:0 var(--watt-space-m)}.watt-dropdown-panel .mat-datepicker-content .mat-mdc-icon-button{--mat-mdc-button-persistent-ripple-color: transparent;--mat-mdc-button-ripple-color: transparent}.watt-dropdown-panel.watt-dropdown-panel-chip-mode{margin-top:4px}.watt-dropdown-panel.mat-mdc-select-search-panel{transform:scaleY(1)!important}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.contains-mat-select-search.mat-mdc-option-multiple{background-color:transparent}.watt-dropdown-panel ngx-mat-select-search .mat-select-search-inner-multiple .mat-select-search-inner-row{margin-left:5px}.watt-dropdown-panel ngx-mat-select-search .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{margin:0}.watt-dropdown-panel .mdc-list-item .mat-select-search-input,.watt-dropdown-panel .mat-mdc-option.mdc-list-item,.watt-dropdown-panel .mat-select-search-no-entries-found{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color)}.watt-dropdown-panel .mat-mdc-optgroup-label{font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;color:var(--watt-input-color)}.watt-dropdown-panel .mat-mdc-option.mdc-list-item .mat-select-search-no-entries-found{padding:var(--watt-space-s)}.watt-dropdown-panel .mat-checkbox-frame,.watt-dropdown-panel .mat-mdc-checkbox{border-color:var(--watt-color-primary)}.watt-dropdown-panel :not(.mat-mdc-option-multiple) .mat-pseudo-checkbox{display:none}.watt-dropdown-panel .mat-mdc-option-multiple .mat-pseudo-checkbox{display:inline-block}.watt-dropdown-panel .mat-pseudo-checkbox,.watt-dropdown-panel .mat-mdc-checkbox{color:var(--watt-color-primary)}.watt-dropdown-panel .mat-mdc-option{color:var(--watt-color-neutral-black);min-height:42px}.watt-dropdown-panel .mat-mdc-option[aria-disabled=true].contains-mat-select-search{margin-top:0;top:auto}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mat-mdc-option-active,.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mdc-list-item--selected.mat-mdc-option-active:not(.mat-mdc-option-multiple),.watt-dropdown-panel .mat-mdc-option:hover:not(.mat-mdc-option-disabled,.contains-mat-select-search),.watt-dropdown-panel .mat-mdc-option:focus:not(.mat-mdc-option-disabled){background-color:var(--watt-color-primary-light)}.watt-dropdown-panel .mat-mdc-option .mat-mdc-select-search-no-entries-found{text-align:center;padding:0}.watt-dropdown-panel .mat-mdc-option.mat-mdc-option-disabled{color:var(--watt-color-neutral-grey-400);cursor:not-allowed}.watt-dropdown-panel .mat-mdc-select-search-input:not(.mat-mdc-select-search-hidden){color:var(--watt-color-neutral-black)}.watt-dropdown-panel .mat-mdc-select-search-clear{background-color:var(--watt-color-neutral-white);color:var(--watt-color-neutral-grey-400)}.watt-dropdown-panel .mat-mdc-select-search-clear mat-icon{line-height:20px!important}\n"], dependencies: [{ kind: "ngmodule", type: MatSelectModule }, { kind: "component", type: i1.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth", "canSelectNullableOptions"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i1.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i1.MatOptgroup, selector: "mat-optgroup", inputs: ["label", "disabled"], exportAs: ["matOptgroup"] }, { kind: "ngmodule", type: MatOptionModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: NgxMatSelectSearchModule }, { kind: "component", type: i3.MatSelectSearchComponent, selector: "ngx-mat-select-search", inputs: ["placeholderLabel", "type", "closeIcon", "closeSvgIcon", "noEntriesFoundLabel", "clearSearchInput", "searching", "disableInitialFocus", "enableClearOnEscapePressed", "preventHomeEndKeyPropagation", "disableScrollToActiveOnOptionsChanged", "ariaLabel", "showToggleAllCheckbox", "toggleAllCheckboxChecked", "toggleAllCheckboxIndeterminate", "toggleAllCheckboxTooltipMessage", "toggleAllCheckboxTooltipPosition", "hideClearSearchButton", "alwaysRestoreSelectedOptionsMulti", "recreateValuesArray"], outputs: ["toggleAll"] }, { kind: "directive", type: i3.MatSelectSearchClearDirective, selector: "[ngxMatSelectSearchClear]" }, { kind: "component", type: WattIconComponent, selector: "watt-icon", inputs: ["name", "label", "size", "state"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName", "displayMode", "autoFocus", "showErrors"] }, { kind: "component", type: WattMenuChipComponent, selector: "watt-menu-chip", inputs: ["opened", "disabled", "name", "value", "selected", "hasPopup"], outputs: ["toggleChange"] }], encapsulation: i0.ViewEncapsulation.None });
325
335
  }
326
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattDropdownComponent, decorators: [{
336
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattDropdownComponent, decorators: [{
327
337
  type: Component,
328
338
  args: [{ selector: 'watt-dropdown', encapsulation: ViewEncapsulation.None, imports: [
329
339
  MatSelectModule,
@@ -336,7 +346,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImpo
336
346
  ], host: {
337
347
  '[attr.watt-field-disabled]': 'isDisabled()',
338
348
  '[class.watt-chip-mode]': 'chipMode()',
339
- }, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field\n [control]=\"parentControl\"\n [chipMode]=\"chipMode()\"\n [label]=\"label()\"\n (click)=\"matSelect.open()\"\n>\n @if (chipMode()) {\n <watt-menu-chip\n [opened]=\"matSelect.panelOpen\"\n (toggleChange)=\"matSelect.open()\"\n [selected]=\"!!matSelect?.triggerValue && !disableSelectedMode()\"\n [disabled]=\"matSelectControl.disabled\"\n >\n {{ placeholder() }}\n @if (showTriggerValue) {\n <span>\n @if (placeholder()) {\n :\n }\n {{ getCustomTrigger()?.(matSelect.value) ?? matSelect?.triggerValue }}\n </span>\n }\n @if (showChipLabel) {\n <span class=\"watt-chip-label\">{{ matSelectControl.value?.length }}</span>\n }\n </watt-menu-chip>\n }\n\n <mat-select\n [attr.aria-label]=\"label()\"\n [formControl]=\"matSelectControl\"\n [placeholder]=\"placeholder()\"\n #matSelect\n [panelWidth]=\"panelWidth()\"\n [multiple]=\"multiple()\"\n [class]=\"{ chip: chipMode(), 'mat-mdc-select-multiple': multiple() }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode(),\n 'mat-mdc-select-panel-multiple': multiple(),\n }\"\n >\n <!-- We use this instead of ngIf, since it will trigger a NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. -->\n <mat-option [style.display]=\"!hideSearch() ? 'block' : 'none'\">\n <ngx-mat-select-search\n [formControl]=\"filterControl\"\n [placeholderLabel]=\"placeholder()\"\n closeIcon=\"close\"\n [showToggleAllCheckbox]=\"multiple()\"\n (toggleAll)=\"onToggleAll($event)\"\n [toggleAllCheckboxChecked]=\"isToggleAllChecked\"\n [toggleAllCheckboxIndeterminate]=\"isToggleAllIndeterminate\"\n [noEntriesFoundLabel]=\"noOptionsFoundLabel()\"\n >\n <watt-icon ngxMatSelectSearchClear name=\"close\" size=\"s\" />\n </ngx-mat-select-search>\n </mat-option>\n\n @if (!multiple() && showResetOption()) {\n <mat-option>{{ emDash }}</mat-option>\n }\n\n @if (hasGroups()) {\n @for (item of filteredGroupedOptions(); track item) {\n @if (\"options\" in item) {\n <mat-optgroup [label]=\"item.label\" [disabled]=\"item.disabled\">\n @for (option of item.options; track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n </mat-optgroup>\n }\n }\n } @else {\n @for (option of filteredOptions(); track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n }\n </mat-select>\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n</watt-field>\n", styles: ["watt-dropdown:not(.watt-chip-mode){width:100%}watt-dropdown{--watt-input-color: var(--watt-typography-text-color);--watt-input-placeholder-color: var(--watt-on-light-high-emphasis);display:block;width:auto}watt-dropdown watt-field label .watt-field-wrapper{padding:0;position:relative}watt-dropdown.watt-chip-mode.ng-dirty.ng-invalid .watt-field-wrapper watt-chip label{border:1px solid var(--watt-color-state-danger)}watt-dropdown.watt-chip-mode[disabled=true] watt-field label .watt-field-wrapper{background-color:transparent}watt-dropdown .mat-input-element{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color);caret-color:var(--watt-color-neutral-grey-900)!important;padding:0 12px}watt-dropdown .mat-mdc-select-arrow{color:var(--watt-dropdown-arrow-color, rgba(0, 0, 0, .54));border:none;width:auto;height:auto}watt-dropdown .mat-mdc-select-arrow:before{width:.6em;height:.6em;bottom:.2em;position:relative;display:inline-block;border-style:solid;border-width:0 0 .15em .15em;transform:rotate(315deg);border-color:var(--watt-color-primary);content:\"\"}watt-dropdown .mat-mdc-select-arrow svg{display:none}watt-dropdown .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;padding:0 var(--watt-space-m)}watt-dropdown .mat-mdc-select-value{color:var(--watt-color-neutral-black);padding-right:var(--watt-space-m)}watt-dropdown .mat-mdc-select.mat-mdc-select-invalid.ng-pristine .mat-mdc-select-arrow{color:currentColor}watt-dropdown .watt-chip-label{float:right;margin-left:var(--watt-space-s);background:var(--watt-color-neutral-white)}watt-dropdown .watt-field--chip .mat-mdc-select{visibility:hidden;position:absolute;width:100%}watt-dropdown .mat-mdc-select-placeholder{color:var(--watt-input-placeholder-color)}watt-dropdown watt-field label .watt-field-wrapper{background-color:transparent}.watt-dropdown-panel{--watt-input-color: var(--watt-typography-text-color);padding:0}.watt-dropdown-panel .mat-select-search-inner-row .mat-select-search-input,.watt-dropdown-panel mat-option.contains-mat-select-search{height:48px}.watt-dropdown-panel:not(.watt-dropdown-panel-chip-mode){min-width:calc(100% + 2px)!important;margin-top:-36px;margin-left:-1px;min-height:48px}.watt-dropdown-panel .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{padding:0;margin:0 var(--watt-space-m)}.watt-dropdown-panel .mat-datepicker-content .mat-mdc-icon-button{--mat-mdc-button-persistent-ripple-color: transparent;--mat-mdc-button-ripple-color: transparent}.watt-dropdown-panel.watt-dropdown-panel-chip-mode{margin-top:4px}.watt-dropdown-panel.mat-mdc-select-search-panel{transform:scaleY(1)!important}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.contains-mat-select-search.mat-mdc-option-multiple{background-color:transparent}.watt-dropdown-panel ngx-mat-select-search .mat-select-search-inner-multiple .mat-select-search-inner-row{margin-left:5px}.watt-dropdown-panel ngx-mat-select-search .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{margin:0}.watt-dropdown-panel .mdc-list-item .mat-select-search-input,.watt-dropdown-panel .mat-mdc-option.mdc-list-item,.watt-dropdown-panel .mat-select-search-no-entries-found{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color)}.watt-dropdown-panel .mat-mdc-optgroup-label{font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;color:var(--watt-input-color)}.watt-dropdown-panel .mat-mdc-option.mdc-list-item .mat-select-search-no-entries-found{padding:var(--watt-space-s)}.watt-dropdown-panel .mat-checkbox-frame,.watt-dropdown-panel .mat-mdc-checkbox{border-color:var(--watt-color-primary)}.watt-dropdown-panel :not(.mat-mdc-option-multiple) .mat-pseudo-checkbox{display:none}.watt-dropdown-panel .mat-mdc-option-multiple .mat-pseudo-checkbox{display:inline-block}.watt-dropdown-panel .mat-pseudo-checkbox,.watt-dropdown-panel .mat-mdc-checkbox{color:var(--watt-color-primary)}.watt-dropdown-panel .mat-mdc-option{color:var(--watt-color-neutral-black);min-height:42px}.watt-dropdown-panel .mat-mdc-option[aria-disabled=true].contains-mat-select-search{margin-top:0;top:auto}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mat-mdc-option-active,.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mdc-list-item--selected.mat-mdc-option-active:not(.mat-mdc-option-multiple),.watt-dropdown-panel .mat-mdc-option:hover:not(.mat-mdc-option-disabled,.contains-mat-select-search),.watt-dropdown-panel .mat-mdc-option:focus:not(.mat-mdc-option-disabled){background-color:var(--watt-color-primary-light)}.watt-dropdown-panel .mat-mdc-option .mat-mdc-select-search-no-entries-found{text-align:center;padding:0}.watt-dropdown-panel .mat-mdc-option.mat-mdc-option-disabled{color:var(--watt-color-neutral-grey-400);cursor:not-allowed}.watt-dropdown-panel .mat-mdc-select-search-input:not(.mat-mdc-select-search-hidden){color:var(--watt-color-neutral-black)}.watt-dropdown-panel .mat-mdc-select-search-clear{background-color:var(--watt-color-neutral-white);color:var(--watt-color-neutral-grey-400)}.watt-dropdown-panel .mat-mdc-select-search-clear mat-icon{line-height:20px!important}\n"] }]
349
+ }, template: "<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field\n [control]=\"parentControl\"\n [chipMode]=\"chipMode()\"\n [label]=\"label()\"\n (click)=\"onFieldClick($event)\"\n>\n @if (chipMode()) {\n <watt-menu-chip\n [opened]=\"matSelect.panelOpen\"\n (toggleChange)=\"matSelect.open()\"\n [selected]=\"!!matSelect?.triggerValue && !disableSelectedMode()\"\n [disabled]=\"matSelectControl.disabled\"\n >\n {{ placeholder() }}\n @if (showTriggerValue) {\n <span>\n @if (placeholder()) {\n :\n }\n {{ getCustomTrigger()?.(matSelect.value) ?? matSelect?.triggerValue }}\n </span>\n }\n @if (showChipLabel) {\n <span class=\"watt-chip-label\">{{ matSelectControl.value?.length }}</span>\n }\n </watt-menu-chip>\n }\n\n <mat-select\n [attr.aria-label]=\"label()\"\n [formControl]=\"matSelectControl\"\n [placeholder]=\"placeholder()\"\n #matSelect\n [panelWidth]=\"panelWidth()\"\n [multiple]=\"multiple()\"\n [class]=\"{ chip: chipMode(), 'mat-mdc-select-multiple': multiple() }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode(),\n 'mat-mdc-select-panel-multiple': multiple(),\n }\"\n >\n <!-- We use this instead of ngIf, since it will trigger a NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. -->\n <mat-option [style.display]=\"!hideSearch() ? 'block' : 'none'\">\n <ngx-mat-select-search\n [formControl]=\"filterControl\"\n [placeholderLabel]=\"placeholder()\"\n closeIcon=\"close\"\n [showToggleAllCheckbox]=\"multiple()\"\n (toggleAll)=\"onToggleAll($event)\"\n [toggleAllCheckboxChecked]=\"isToggleAllChecked\"\n [toggleAllCheckboxIndeterminate]=\"isToggleAllIndeterminate\"\n [noEntriesFoundLabel]=\"noOptionsFoundLabel()\"\n >\n <watt-icon ngxMatSelectSearchClear name=\"close\" size=\"s\" />\n </ngx-mat-select-search>\n </mat-option>\n\n @if (!multiple() && showResetOption()) {\n <mat-option>{{ emDash }}</mat-option>\n }\n\n @if (hasGroups()) {\n @for (item of filteredGroupedOptions(); track item) {\n @if (\"options\" in item) {\n <mat-optgroup [label]=\"item.label\" [disabled]=\"item.disabled\">\n @for (option of item.options; track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n </mat-optgroup>\n }\n }\n } @else {\n @for (option of filteredOptions(); track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n }\n </mat-select>\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n</watt-field>\n", styles: ["watt-dropdown:not(.watt-chip-mode){width:100%}watt-dropdown{--watt-input-color: var(--watt-typography-text-color);--watt-input-placeholder-color: var(--watt-on-light-high-emphasis);display:block;width:auto}watt-dropdown watt-field label .watt-field-wrapper{padding:0;position:relative}watt-dropdown.watt-chip-mode.ng-dirty.ng-invalid .watt-field-wrapper watt-chip label{border:1px solid var(--watt-color-state-danger)}watt-dropdown.watt-chip-mode[disabled=true] watt-field label .watt-field-wrapper{background-color:transparent}watt-dropdown .mat-input-element{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color);caret-color:var(--watt-color-neutral-grey-900)!important;padding:0 12px}watt-dropdown .mat-mdc-select-arrow{color:var(--watt-dropdown-arrow-color, rgba(0, 0, 0, .54));border:none;width:auto;height:auto}watt-dropdown .mat-mdc-select-arrow:before{width:.6em;height:.6em;bottom:.2em;position:relative;display:inline-block;border-style:solid;border-width:0 0 .15em .15em;transform:rotate(315deg);border-color:var(--watt-color-primary);content:\"\"}watt-dropdown .mat-mdc-select-arrow svg{display:none}watt-dropdown .mat-mdc-select-trigger{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;padding:0 var(--watt-space-m)}watt-dropdown .mat-mdc-select-value{color:var(--watt-color-neutral-black);padding-right:var(--watt-space-m)}watt-dropdown .mat-mdc-select.mat-mdc-select-invalid.ng-pristine .mat-mdc-select-arrow{color:currentColor}watt-dropdown .watt-chip-label{float:right;margin-left:var(--watt-space-s);background:var(--watt-color-neutral-white)}watt-dropdown .watt-field--chip .mat-mdc-select{opacity:0;pointer-events:none;position:absolute;width:100%}watt-dropdown .mat-mdc-select-placeholder{color:var(--watt-input-placeholder-color)}watt-dropdown watt-field label .watt-field-wrapper{background-color:transparent}.watt-dropdown-panel{--watt-input-color: var(--watt-typography-text-color);padding:0}.watt-dropdown-panel .mat-select-search-inner-row .mat-select-search-input,.watt-dropdown-panel mat-option.contains-mat-select-search{height:48px}.watt-dropdown-panel:not(.watt-dropdown-panel-chip-mode){min-width:calc(100% + 2px)!important;margin-top:-36px;margin-left:-1px;min-height:48px}.watt-dropdown-panel .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{padding:0;margin:0 var(--watt-space-m)}.watt-dropdown-panel .mat-datepicker-content .mat-mdc-icon-button{--mat-mdc-button-persistent-ripple-color: transparent;--mat-mdc-button-ripple-color: transparent}.watt-dropdown-panel.watt-dropdown-panel-chip-mode{margin-top:4px}.watt-dropdown-panel.mat-mdc-select-search-panel{transform:scaleY(1)!important}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.contains-mat-select-search.mat-mdc-option-multiple{background-color:transparent}.watt-dropdown-panel ngx-mat-select-search .mat-select-search-inner-multiple .mat-select-search-inner-row{margin-left:5px}.watt-dropdown-panel ngx-mat-select-search .mat-mdc-checkbox.mat-select-search-toggle-all-checkbox{margin:0}.watt-dropdown-panel .mdc-list-item .mat-select-search-input,.watt-dropdown-panel .mat-mdc-option.mdc-list-item,.watt-dropdown-panel .mat-select-search-no-entries-found{font-size:.875rem;line-height:1.25rem;font-weight:400;text-transform:none;letter-spacing:0;color:var(--watt-input-color)}.watt-dropdown-panel .mat-mdc-optgroup-label{font-size:.875rem;line-height:1.25rem;font-weight:600;text-transform:none;letter-spacing:0;color:var(--watt-input-color)}.watt-dropdown-panel .mat-mdc-option.mdc-list-item .mat-select-search-no-entries-found{padding:var(--watt-space-s)}.watt-dropdown-panel .mat-checkbox-frame,.watt-dropdown-panel .mat-mdc-checkbox{border-color:var(--watt-color-primary)}.watt-dropdown-panel :not(.mat-mdc-option-multiple) .mat-pseudo-checkbox{display:none}.watt-dropdown-panel .mat-mdc-option-multiple .mat-pseudo-checkbox{display:inline-block}.watt-dropdown-panel .mat-pseudo-checkbox,.watt-dropdown-panel .mat-mdc-checkbox{color:var(--watt-color-primary)}.watt-dropdown-panel .mat-mdc-option{color:var(--watt-color-neutral-black);min-height:42px}.watt-dropdown-panel .mat-mdc-option[aria-disabled=true].contains-mat-select-search{margin-top:0;top:auto}.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mat-mdc-option-active,.watt-dropdown-panel .mat-mdc-option.mdc-list-item.mdc-list-item--selected.mat-mdc-option-active:not(.mat-mdc-option-multiple),.watt-dropdown-panel .mat-mdc-option:hover:not(.mat-mdc-option-disabled,.contains-mat-select-search),.watt-dropdown-panel .mat-mdc-option:focus:not(.mat-mdc-option-disabled){background-color:var(--watt-color-primary-light)}.watt-dropdown-panel .mat-mdc-option .mat-mdc-select-search-no-entries-found{text-align:center;padding:0}.watt-dropdown-panel .mat-mdc-option.mat-mdc-option-disabled{color:var(--watt-color-neutral-grey-400);cursor:not-allowed}.watt-dropdown-panel .mat-mdc-select-search-input:not(.mat-mdc-select-search-hidden){color:var(--watt-color-neutral-black)}.watt-dropdown-panel .mat-mdc-select-search-clear{background-color:var(--watt-color-neutral-white);color:var(--watt-color-neutral-grey-400)}.watt-dropdown-panel .mat-mdc-select-search-clear mat-icon{line-height:20px!important}\n"] }]
340
350
  }], ctorParameters: () => [], propDecorators: { matSelect: [{ type: i0.ViewChild, args: ['matSelect', { isSignal: true }] }], hideSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideSearch", required: false }] }], panelWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "panelWidth", required: false }] }], getCustomTrigger: [{ type: i0.Input, args: [{ isSignal: true, alias: "getCustomTrigger", required: false }] }], chipMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "chipMode", required: false }] }], disableSelectedMode: [{ type: i0.Input, args: [{ isSignal: true, alias: "disableSelectedMode", required: false }] }], sortDirection: [{ type: i0.Input, args: [{ isSignal: true, alias: "sortDirection", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }, { type: i0.Output, args: ["optionsChange"] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], showResetOption: [{ type: i0.Input, args: [{ isSignal: true, alias: "showResetOption", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], noOptionsFoundLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "noOptionsFoundLabel", required: false }] }] } });
341
351
 
342
352
  //#region License
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-dropdown.mjs","sources":["../../../libs/watt/package/dropdown/watt-dropdown.component.ts","../../../libs/watt/package/dropdown/watt-dropdown.component.html","../../../libs/watt/package/dropdown/index.ts","../../../libs/watt/package/dropdown/energinet-watt-dropdown.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n input,\n model,\n signal,\n effect,\n OnInit,\n inject,\n Component,\n viewChild,\n DestroyRef,\n ViewEncapsulation,\n computed,\n} from '@angular/core';\n\nimport {\n NgControl,\n ValidatorFn,\n FormControl,\n ValidationErrors,\n AsyncValidatorFn,\n UntypedFormControl,\n ReactiveFormsModule,\n ControlValueAccessor,\n} from '@angular/forms';\n\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { of, map } from 'rxjs';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { MatSelectModule, MatSelect } from '@angular/material/select';\nimport { MatOptionModule } from '@angular/material/core';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattMenuChipComponent } from '@energinet/watt/chip';\n\nimport type { WattDropdownValue } from './watt-dropdown-value';\nimport type {\n WattDropdownOptions,\n WattDropdownOptionGroup,\n WattDropdownGroupedOptions,\n} from './watt-dropdown-option';\n\n@Component({\n selector: 'watt-dropdown',\n templateUrl: './watt-dropdown.component.html',\n styleUrls: ['./watt-dropdown.component.scss'],\n encapsulation: ViewEncapsulation.None,\n imports: [\n MatSelectModule,\n MatOptionModule,\n ReactiveFormsModule,\n NgxMatSelectSearchModule,\n\n WattIconComponent,\n WattFieldComponent,\n WattMenuChipComponent,\n ],\n host: {\n '[attr.watt-field-disabled]': 'isDisabled()',\n '[class.watt-chip-mode]': 'chipMode()',\n },\n})\nexport class WattDropdownComponent<T = string> implements ControlValueAccessor, OnInit {\n private parentControlDirective = inject(NgControl, { host: true });\n private destroyRef = inject(DestroyRef);\n private validateParent?: ValidatorFn;\n private validateParentAsync?: AsyncValidatorFn;\n private _options: WattDropdownOptions = [];\n private _groupedOptions: WattDropdownGroupedOptions = [];\n parentControl: FormControl | null = null;\n matSelectControl = new FormControl<string | string[] | undefined | null>(null);\n\n /**\n * Control for the MatSelect filter keyword\n */\n filterControl = new UntypedFormControl();\n\n /**\n * List of options filtered by search keyword\n */\n filteredOptions = signal<WattDropdownOptions>([]);\n\n /**\n * List of grouped options filtered by search keyword\n */\n filteredGroupedOptions = signal<WattDropdownGroupedOptions>([]);\n\n mergedFilteredOptions = computed(() => {\n if (this.hasGroups()) {\n return this.filteredGroupedOptions()\n .flatMap((group) => ('options' in group ? group.options : []))\n .map((option) => option.value);\n }\n return this.filteredOptions().map((option) => option.value);\n });\n\n emDash = '—';\n isToggleAllChecked = false;\n isToggleAllIndeterminate = false;\n isDisabled = signal(false);\n\n get showTriggerValue(): boolean {\n const multiple = this.multiple();\n return (multiple &&\n this.matSelectControl.value?.length === 1 &&\n this.matSelectControl.value[0] !== '') ||\n (!multiple && this.matSelect()?.triggerValue)\n ? true\n : false;\n }\n\n get showChipLabel() {\n return this.multiple() && this.matSelectControl.value && this.matSelectControl.value.length > 1\n ? true\n : false;\n }\n\n matSelect = viewChild<MatSelect>('matSelect');\n hideSearch = input(false);\n panelWidth = input<null | 'auto'>(null);\n getCustomTrigger = input<(value: string | string[]) => string>();\n\n /**\n * Set the mode of the dropdown.\n */\n chipMode = input(false);\n disableSelectedMode = input(false);\n sortDirection = input<'asc' | 'desc'>();\n\n /**\n * Sets the options for the dropdown.\n * Can be a flat array of options or an array containing both options and option groups.\n */\n options = model<WattDropdownOptions<T> | WattDropdownGroupedOptions<T>>([]);\n\n /**\n * Sets support for selecting multiple dropdown options.\n */\n multiple = input(false);\n\n /**\n * Sets support for hiding the reset option in \"single\" select mode.\n */\n showResetOption = input(true);\n\n /**\n * Sets the placeholder for the dropdown.\n */\n placeholder = input('');\n\n /**\n * Sets the label for the dropdown.\n */\n label = input('');\n\n /**\n * Label to be shown when no options are found after filtering.\n *\n * Note: The label is visible in \"multiple\" mode only.\n */\n noOptionsFoundLabel = input('');\n\n hasGroups = computed(() => {\n const options = this.options() ?? [];\n return options.some(\n (option) => 'options' in option && Array.isArray((option as WattDropdownOptionGroup).options)\n );\n });\n\n constructor() {\n effect(() => {\n const options = this.options();\n if (Array.isArray(options)) {\n const optionsCopy = [...options];\n\n if (this.hasGroups()) {\n this.handleGroup(optionsCopy as WattDropdownGroupedOptions);\n } else {\n this.handleFlat(optionsCopy as WattDropdownOptions);\n }\n }\n });\n this.parentControlDirective.valueAccessor = this;\n }\n\n private handleFlat(optionsCopy: WattDropdownOptions) {\n if (this.sortDirection()) {\n optionsCopy = this.sortOptions(optionsCopy);\n }\n\n this._options = optionsCopy;\n this.filteredOptions.set(this._options);\n }\n\n private handleGroup(optionsCopy: WattDropdownGroupedOptions) {\n this._groupedOptions = this.processGroupedOptions(optionsCopy);\n this.filteredGroupedOptions.set(this._groupedOptions);\n }\n\n private processGroupedOptions(options: WattDropdownGroupedOptions): WattDropdownGroupedOptions {\n return options.map((group) => {\n if (this.sortDirection()) {\n group.options = this.sortOptions(group.options);\n }\n return group;\n });\n }\n\n ngOnInit() {\n this.listenForFilterFieldValueChanges();\n this.initializePropertiesFromParent();\n this.bindParentValidatorsToControl();\n this.bindControlToParent();\n }\n\n writeValue(value: WattDropdownValue) {\n this.matSelectControl.setValue(value);\n }\n\n registerOnChange(onChangeFn: (value: WattDropdownValue) => void) {\n this.changeParentValue = onChangeFn;\n }\n\n registerOnTouched(onTouchFn: () => void) {\n this.markParentControlAsTouched = onTouchFn;\n }\n\n setDisabledState(shouldDisable: boolean) {\n this.isDisabled.set(shouldDisable);\n if (shouldDisable) {\n this.matSelectControl.disable();\n } else {\n this.matSelectControl.enable();\n }\n }\n\n onToggleAll(toggleAllState: boolean) {\n const filteredOptions = this.mergedFilteredOptions();\n const optionsToSelect = toggleAllState ? filteredOptions : [];\n this.matSelectControl.patchValue(optionsToSelect);\n }\n\n public sortOptions(options: WattDropdownOptions): WattDropdownOptions {\n return [...options].sort((a, b) => {\n return this.sortDirection() === 'asc'\n ? a.displayValue.localeCompare(b.displayValue)\n : b.displayValue.localeCompare(a.displayValue);\n });\n }\n\n private listenForFilterFieldValueChanges() {\n this.filterControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.filterOptions();\n\n if (this.multiple()) {\n this.determineToggleAllCheckboxState();\n }\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private changeParentValue = (value: WattDropdownValue) => {\n // Intentionally left empty\n };\n\n private markParentControlAsTouched = () => {\n // Intentionally left empty\n };\n\n /**\n * @ignore\n *\n * Store the parent control, its validators and async validators in properties\n * of this component.\n */\n private initializePropertiesFromParent() {\n this.parentControl = this.parentControlDirective.control as UntypedFormControl;\n\n this.validateParent =\n (this.parentControl.validator && this.parentControl.validator.bind(this.parentControl)) ||\n (() => null);\n\n this.validateParentAsync =\n (this.parentControl.asyncValidator &&\n this.parentControl.asyncValidator.bind(this.parentControl)) ||\n (() => of(null));\n }\n\n /**\n * @ignore\n *\n * Inherit validators from parent form control.\n */\n private bindParentValidatorsToControl() {\n const validators = !this.matSelectControl.validator\n ? [this.validateParent]\n : Array.isArray(this.matSelectControl.validator)\n ? [...this.matSelectControl.validator, this.validateParent]\n : [this.matSelectControl.validator, this.validateParent];\n this.matSelectControl.setValidators(validators);\n\n const asyncValidators = !this.matSelectControl.asyncValidator\n ? [this.validateParentAsync]\n : Array.isArray(this.matSelectControl.asyncValidator)\n ? [...this.matSelectControl.asyncValidator, this.validateParentAsync]\n : [this.matSelectControl.asyncValidator, this.validateParentAsync];\n this.matSelectControl.setAsyncValidators(asyncValidators);\n\n this.matSelectControl.updateValueAndValidity();\n }\n\n /**\n * @ignore\n *\n * Emit values to the parent form control when our form control's value\n * changes.\n *\n * Reflect parent validation errors in our form control.\n */\n private bindControlToParent() {\n this.handleValueChange();\n this.handleStatusChange();\n }\n\n private handleStatusChange() {\n this.parentControl?.statusChanges\n .pipe(\n map(\n () =>\n ({\n ...this.parentControl?.errors,\n }) as ValidationErrors\n ),\n map((errors) => (Object.keys(errors).length > 0 ? errors : null)),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe((errors) => {\n this.matSelectControl.setErrors(errors);\n });\n }\n\n private handleValueChange() {\n this.matSelectControl.valueChanges\n .pipe(\n map((value) => (value === undefined ? null : value)),\n map((value: WattDropdownValue) => {\n if (Array.isArray(value) && value.length === 0) {\n return null;\n }\n\n return value;\n }),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe((value: WattDropdownValue) => {\n if (this.multiple()) {\n this.determineToggleAllCheckboxState();\n }\n\n this.markParentControlAsTouched();\n this.changeParentValue(value);\n });\n }\n\n private filterOptions() {\n if (!this._options) {\n return;\n }\n\n const search = (this.filterControl.value as string).trim().toLowerCase();\n\n if (!search) {\n this.filteredOptions.set(this._options.slice());\n\n if (this.hasGroups()) {\n this.filteredGroupedOptions.set(this._groupedOptions.slice());\n }\n return;\n }\n\n const filteredFlatOptions = this._options.filter(\n (option) => option.displayValue.toLowerCase().indexOf(search) > -1\n );\n\n this.filteredOptions.set(filteredFlatOptions);\n\n if (this.hasGroups()) {\n this.filterGroups(search);\n }\n }\n\n private filterGroups(search: string) {\n const filteredGroups = this._groupedOptions\n .map((item) => {\n if (!('options' in item)) {\n return null;\n }\n const filteredGroupOptions = item.options.filter(\n (option) => option.displayValue.toLowerCase().indexOf(search) > -1\n );\n\n return filteredGroupOptions.length > 0 ? { ...item, options: filteredGroupOptions } : null;\n })\n .filter(Boolean) as WattDropdownGroupedOptions;\n\n this.filteredGroupedOptions.set(filteredGroups);\n }\n\n private determineToggleAllCheckboxState() {\n const filteredOptions = this.mergedFilteredOptions();\n const selectedOptions = this.matSelectControl.value;\n\n if (Array.isArray(selectedOptions)) {\n const selectedFilteredOptions = filteredOptions.filter((option) =>\n selectedOptions.includes(option)\n );\n\n this.isToggleAllIndeterminate =\n selectedFilteredOptions.length > 0 &&\n selectedFilteredOptions.length < filteredOptions.length;\n\n this.isToggleAllChecked =\n selectedFilteredOptions.length > 0 &&\n selectedFilteredOptions.length === filteredOptions.length;\n }\n }\n}\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field\n [control]=\"parentControl\"\n [chipMode]=\"chipMode()\"\n [label]=\"label()\"\n (click)=\"matSelect.open()\"\n>\n @if (chipMode()) {\n <watt-menu-chip\n [opened]=\"matSelect.panelOpen\"\n (toggleChange)=\"matSelect.open()\"\n [selected]=\"!!matSelect?.triggerValue && !disableSelectedMode()\"\n [disabled]=\"matSelectControl.disabled\"\n >\n {{ placeholder() }}\n @if (showTriggerValue) {\n <span>\n @if (placeholder()) {\n :\n }\n {{ getCustomTrigger()?.(matSelect.value) ?? matSelect?.triggerValue }}\n </span>\n }\n @if (showChipLabel) {\n <span class=\"watt-chip-label\">{{ matSelectControl.value?.length }}</span>\n }\n </watt-menu-chip>\n }\n\n <mat-select\n [attr.aria-label]=\"label()\"\n [formControl]=\"matSelectControl\"\n [placeholder]=\"placeholder()\"\n #matSelect\n [panelWidth]=\"panelWidth()\"\n [multiple]=\"multiple()\"\n [class]=\"{ chip: chipMode(), 'mat-mdc-select-multiple': multiple() }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode(),\n 'mat-mdc-select-panel-multiple': multiple(),\n }\"\n >\n <!-- We use this instead of ngIf, since it will trigger a NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. -->\n <mat-option [style.display]=\"!hideSearch() ? 'block' : 'none'\">\n <ngx-mat-select-search\n [formControl]=\"filterControl\"\n [placeholderLabel]=\"placeholder()\"\n closeIcon=\"close\"\n [showToggleAllCheckbox]=\"multiple()\"\n (toggleAll)=\"onToggleAll($event)\"\n [toggleAllCheckboxChecked]=\"isToggleAllChecked\"\n [toggleAllCheckboxIndeterminate]=\"isToggleAllIndeterminate\"\n [noEntriesFoundLabel]=\"noOptionsFoundLabel()\"\n >\n <watt-icon ngxMatSelectSearchClear name=\"close\" size=\"s\" />\n </ngx-mat-select-search>\n </mat-option>\n\n @if (!multiple() && showResetOption()) {\n <mat-option>{{ emDash }}</mat-option>\n }\n\n @if (hasGroups()) {\n @for (item of filteredGroupedOptions(); track item) {\n @if (\"options\" in item) {\n <mat-optgroup [label]=\"item.label\" [disabled]=\"item.disabled\">\n @for (option of item.options; track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n </mat-optgroup>\n }\n }\n } @else {\n @for (option of filteredOptions(); track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n }\n </mat-select>\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n</watt-field>\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattDropdownComponent } from './watt-dropdown.component';\nexport {\n type WattDropdownOption,\n type WattDropdownOptions,\n type WattDropdownGroupedOptions,\n type WattDropdownOptionGroup,\n} from './watt-dropdown-option';\nexport { type WattDropdownValue } from './watt-dropdown-value';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAgEa,qBAAqB,CAAA;IACxB,sBAAsB,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC1D,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,cAAc;AACd,IAAA,mBAAmB;IACnB,QAAQ,GAAwB,EAAE;IAClC,eAAe,G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IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,mBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,qBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AExI9C;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"energinet-watt-dropdown.mjs","sources":["../../../libs/watt/package/dropdown/watt-dropdown.component.ts","../../../libs/watt/package/dropdown/watt-dropdown.component.html","../../../libs/watt/package/dropdown/index.ts","../../../libs/watt/package/dropdown/energinet-watt-dropdown.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n input,\n model,\n signal,\n effect,\n OnInit,\n inject,\n Component,\n viewChild,\n DestroyRef,\n ViewEncapsulation,\n computed,\n} from '@angular/core';\n\nimport {\n NgControl,\n ValidatorFn,\n FormControl,\n ValidationErrors,\n AsyncValidatorFn,\n UntypedFormControl,\n ReactiveFormsModule,\n ControlValueAccessor,\n} from '@angular/forms';\n\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\n\nimport { of, map } from 'rxjs';\nimport { NgxMatSelectSearchModule } from 'ngx-mat-select-search';\nimport { MatSelectModule, MatSelect } from '@angular/material/select';\nimport { MatOptionModule } from '@angular/material/core';\n\nimport { WattIconComponent } from '@energinet/watt/icon';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { WattMenuChipComponent } from '@energinet/watt/chip';\n\nimport type { WattDropdownValue } from './watt-dropdown-value';\nimport type {\n WattDropdownOptions,\n WattDropdownOptionGroup,\n WattDropdownGroupedOptions,\n} from './watt-dropdown-option';\n\n@Component({\n selector: 'watt-dropdown',\n templateUrl: './watt-dropdown.component.html',\n styleUrls: ['./watt-dropdown.component.scss'],\n encapsulation: ViewEncapsulation.None,\n imports: [\n MatSelectModule,\n MatOptionModule,\n ReactiveFormsModule,\n NgxMatSelectSearchModule,\n\n WattIconComponent,\n WattFieldComponent,\n WattMenuChipComponent,\n ],\n host: {\n '[attr.watt-field-disabled]': 'isDisabled()',\n '[class.watt-chip-mode]': 'chipMode()',\n },\n})\nexport class WattDropdownComponent<T = string> implements ControlValueAccessor, OnInit {\n private parentControlDirective = inject(NgControl, { host: true });\n private destroyRef = inject(DestroyRef);\n private validateParent?: ValidatorFn;\n private validateParentAsync?: AsyncValidatorFn;\n private _options: WattDropdownOptions = [];\n private _groupedOptions: WattDropdownGroupedOptions = [];\n parentControl: FormControl | null = null;\n matSelectControl = new FormControl<string | string[] | undefined | null>(null);\n\n /**\n * Control for the MatSelect filter keyword\n */\n filterControl = new UntypedFormControl();\n\n /**\n * List of options filtered by search keyword\n */\n filteredOptions = signal<WattDropdownOptions>([]);\n\n /**\n * List of grouped options filtered by search keyword\n */\n filteredGroupedOptions = signal<WattDropdownGroupedOptions>([]);\n\n mergedFilteredOptions = computed(() => {\n if (this.hasGroups()) {\n return this.filteredGroupedOptions()\n .flatMap((group) => ('options' in group ? group.options : []))\n .map((option) => option.value);\n }\n return this.filteredOptions().map((option) => option.value);\n });\n\n emDash = '—';\n isToggleAllChecked = false;\n isToggleAllIndeterminate = false;\n isDisabled = signal(false);\n\n get showTriggerValue(): boolean {\n const multiple = this.multiple();\n return (multiple &&\n this.matSelectControl.value?.length === 1 &&\n this.matSelectControl.value[0] !== '') ||\n (!multiple && this.matSelect()?.triggerValue)\n ? true\n : false;\n }\n\n get showChipLabel() {\n return this.multiple() && this.matSelectControl.value && this.matSelectControl.value.length > 1\n ? true\n : false;\n }\n\n matSelect = viewChild<MatSelect>('matSelect');\n hideSearch = input(false);\n panelWidth = input<null | 'auto'>(null);\n getCustomTrigger = input<(value: string | string[]) => string>();\n\n /**\n * Set the mode of the dropdown.\n */\n chipMode = input(false);\n disableSelectedMode = input(false);\n sortDirection = input<'asc' | 'desc'>();\n\n /**\n * Sets the options for the dropdown.\n * Can be a flat array of options or an array containing both options and option groups.\n */\n options = model<WattDropdownOptions<T> | WattDropdownGroupedOptions<T>>([]);\n\n /**\n * Sets support for selecting multiple dropdown options.\n */\n multiple = input(false);\n\n /**\n * Sets support for hiding the reset option in \"single\" select mode.\n */\n showResetOption = input(true);\n\n /**\n * Sets the placeholder for the dropdown.\n */\n placeholder = input('');\n\n /**\n * Sets the label for the dropdown.\n */\n label = input('');\n\n /**\n * Label to be shown when no options are found after filtering.\n *\n * Note: The label is visible in \"multiple\" mode only.\n */\n noOptionsFoundLabel = input('');\n\n hasGroups = computed(() => {\n const options = this.options() ?? [];\n return options.some(\n (option) => 'options' in option && Array.isArray((option as WattDropdownOptionGroup).options)\n );\n });\n\n constructor() {\n effect(() => {\n const options = this.options();\n if (Array.isArray(options)) {\n const optionsCopy = [...options];\n\n if (this.hasGroups()) {\n this.handleGroup(optionsCopy as WattDropdownGroupedOptions);\n } else {\n this.handleFlat(optionsCopy as WattDropdownOptions);\n }\n }\n });\n this.parentControlDirective.valueAccessor = this;\n }\n\n private handleFlat(optionsCopy: WattDropdownOptions) {\n if (this.sortDirection()) {\n optionsCopy = this.sortOptions(optionsCopy);\n }\n\n this._options = optionsCopy;\n this.filteredOptions.set(this._options);\n }\n\n private handleGroup(optionsCopy: WattDropdownGroupedOptions) {\n this._groupedOptions = this.processGroupedOptions(optionsCopy);\n this.filteredGroupedOptions.set(this._groupedOptions);\n }\n\n private processGroupedOptions(options: WattDropdownGroupedOptions): WattDropdownGroupedOptions {\n return options.map((group) => {\n if (this.sortDirection()) {\n group.options = this.sortOptions(group.options);\n }\n return group;\n });\n }\n\n ngOnInit() {\n this.listenForFilterFieldValueChanges();\n this.initializePropertiesFromParent();\n this.bindParentValidatorsToControl();\n this.bindControlToParent();\n }\n\n writeValue(value: WattDropdownValue) {\n this.matSelectControl.setValue(value);\n }\n\n registerOnChange(onChangeFn: (value: WattDropdownValue) => void) {\n this.changeParentValue = onChangeFn;\n }\n\n registerOnTouched(onTouchFn: () => void) {\n this.markParentControlAsTouched = onTouchFn;\n }\n\n setDisabledState(shouldDisable: boolean) {\n this.isDisabled.set(shouldDisable);\n if (shouldDisable) {\n this.matSelectControl.disable();\n } else {\n this.matSelectControl.enable();\n }\n }\n\n onToggleAll(toggleAllState: boolean) {\n const filteredOptions = this.mergedFilteredOptions();\n const optionsToSelect = toggleAllState ? filteredOptions : [];\n this.matSelectControl.patchValue(optionsToSelect);\n }\n\n onFieldClick(event: MouseEvent) {\n const target = event.target as HTMLElement;\n // Prevent re-opening when click originated from backdrop or select panel\n // This handles the case where Angular Material 21's inline overlay\n // causes click events to bubble up to parent containers\n if (\n !target?.classList.contains('cdk-overlay-backdrop') &&\n !target?.closest('.mat-mdc-select-panel')\n ) {\n this.matSelect()?.open();\n }\n }\n\n public sortOptions(options: WattDropdownOptions): WattDropdownOptions {\n return [...options].sort((a, b) => {\n return this.sortDirection() === 'asc'\n ? a.displayValue.localeCompare(b.displayValue)\n : b.displayValue.localeCompare(a.displayValue);\n });\n }\n\n private listenForFilterFieldValueChanges() {\n this.filterControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(() => {\n this.filterOptions();\n\n if (this.multiple()) {\n this.determineToggleAllCheckboxState();\n }\n });\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n private changeParentValue = (value: WattDropdownValue) => {\n // Intentionally left empty\n };\n\n private markParentControlAsTouched = () => {\n // Intentionally left empty\n };\n\n /**\n * @ignore\n *\n * Store the parent control, its validators and async validators in properties\n * of this component.\n */\n private initializePropertiesFromParent() {\n this.parentControl = this.parentControlDirective.control as UntypedFormControl;\n\n this.validateParent =\n (this.parentControl.validator && this.parentControl.validator.bind(this.parentControl)) ||\n (() => null);\n\n this.validateParentAsync =\n (this.parentControl.asyncValidator &&\n this.parentControl.asyncValidator.bind(this.parentControl)) ||\n (() => of(null));\n }\n\n /**\n * @ignore\n *\n * Inherit validators from parent form control.\n */\n private bindParentValidatorsToControl() {\n const validators = !this.matSelectControl.validator\n ? [this.validateParent]\n : Array.isArray(this.matSelectControl.validator)\n ? [...this.matSelectControl.validator, this.validateParent]\n : [this.matSelectControl.validator, this.validateParent];\n this.matSelectControl.setValidators(validators);\n\n const asyncValidators = !this.matSelectControl.asyncValidator\n ? [this.validateParentAsync]\n : Array.isArray(this.matSelectControl.asyncValidator)\n ? [...this.matSelectControl.asyncValidator, this.validateParentAsync]\n : [this.matSelectControl.asyncValidator, this.validateParentAsync];\n this.matSelectControl.setAsyncValidators(asyncValidators);\n\n this.matSelectControl.updateValueAndValidity();\n }\n\n /**\n * @ignore\n *\n * Emit values to the parent form control when our form control's value\n * changes.\n *\n * Reflect parent validation errors in our form control.\n */\n private bindControlToParent() {\n this.handleValueChange();\n this.handleStatusChange();\n }\n\n private handleStatusChange() {\n this.parentControl?.statusChanges\n .pipe(\n map(\n () =>\n ({\n ...this.parentControl?.errors,\n }) as ValidationErrors\n ),\n map((errors) => (Object.keys(errors).length > 0 ? errors : null)),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe((errors) => {\n this.matSelectControl.setErrors(errors);\n });\n }\n\n private handleValueChange() {\n this.matSelectControl.valueChanges\n .pipe(\n map((value) => (value === undefined ? null : value)),\n map((value: WattDropdownValue) => {\n if (Array.isArray(value) && value.length === 0) {\n return null;\n }\n\n return value;\n }),\n takeUntilDestroyed(this.destroyRef)\n )\n .subscribe((value: WattDropdownValue) => {\n if (this.multiple()) {\n this.determineToggleAllCheckboxState();\n }\n\n this.markParentControlAsTouched();\n this.changeParentValue(value);\n });\n }\n\n private filterOptions() {\n if (!this._options) {\n return;\n }\n\n const search = (this.filterControl.value as string).trim().toLowerCase();\n\n if (!search) {\n this.filteredOptions.set(this._options.slice());\n\n if (this.hasGroups()) {\n this.filteredGroupedOptions.set(this._groupedOptions.slice());\n }\n return;\n }\n\n const filteredFlatOptions = this._options.filter(\n (option) => option.displayValue.toLowerCase().indexOf(search) > -1\n );\n\n this.filteredOptions.set(filteredFlatOptions);\n\n if (this.hasGroups()) {\n this.filterGroups(search);\n }\n }\n\n private filterGroups(search: string) {\n const filteredGroups = this._groupedOptions\n .map((item) => {\n if (!('options' in item)) {\n return null;\n }\n const filteredGroupOptions = item.options.filter(\n (option) => option.displayValue.toLowerCase().indexOf(search) > -1\n );\n\n return filteredGroupOptions.length > 0 ? { ...item, options: filteredGroupOptions } : null;\n })\n .filter(Boolean) as WattDropdownGroupedOptions;\n\n this.filteredGroupedOptions.set(filteredGroups);\n }\n\n private determineToggleAllCheckboxState() {\n const filteredOptions = this.mergedFilteredOptions();\n const selectedOptions = this.matSelectControl.value;\n\n if (Array.isArray(selectedOptions)) {\n const selectedFilteredOptions = filteredOptions.filter((option) =>\n selectedOptions.includes(option)\n );\n\n this.isToggleAllIndeterminate =\n selectedFilteredOptions.length > 0 &&\n selectedFilteredOptions.length < filteredOptions.length;\n\n this.isToggleAllChecked =\n selectedFilteredOptions.length > 0 &&\n selectedFilteredOptions.length === filteredOptions.length;\n }\n }\n}\n","<!--\n@license\nCopyright 2020 Energinet DataHub A/S\n\nLicensed under the Apache License, Version 2.0 (the \"License2\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n<watt-field\n [control]=\"parentControl\"\n [chipMode]=\"chipMode()\"\n [label]=\"label()\"\n (click)=\"onFieldClick($event)\"\n>\n @if (chipMode()) {\n <watt-menu-chip\n [opened]=\"matSelect.panelOpen\"\n (toggleChange)=\"matSelect.open()\"\n [selected]=\"!!matSelect?.triggerValue && !disableSelectedMode()\"\n [disabled]=\"matSelectControl.disabled\"\n >\n {{ placeholder() }}\n @if (showTriggerValue) {\n <span>\n @if (placeholder()) {\n :\n }\n {{ getCustomTrigger()?.(matSelect.value) ?? matSelect?.triggerValue }}\n </span>\n }\n @if (showChipLabel) {\n <span class=\"watt-chip-label\">{{ matSelectControl.value?.length }}</span>\n }\n </watt-menu-chip>\n }\n\n <mat-select\n [attr.aria-label]=\"label()\"\n [formControl]=\"matSelectControl\"\n [placeholder]=\"placeholder()\"\n #matSelect\n [panelWidth]=\"panelWidth()\"\n [multiple]=\"multiple()\"\n [class]=\"{ chip: chipMode(), 'mat-mdc-select-multiple': multiple() }\"\n [panelClass]=\"{\n 'watt-dropdown-panel': true,\n 'watt-dropdown-panel-chip-mode': chipMode(),\n 'mat-mdc-select-panel-multiple': multiple(),\n }\"\n >\n <!-- We use this instead of ngIf, since it will trigger a NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. -->\n <mat-option [style.display]=\"!hideSearch() ? 'block' : 'none'\">\n <ngx-mat-select-search\n [formControl]=\"filterControl\"\n [placeholderLabel]=\"placeholder()\"\n closeIcon=\"close\"\n [showToggleAllCheckbox]=\"multiple()\"\n (toggleAll)=\"onToggleAll($event)\"\n [toggleAllCheckboxChecked]=\"isToggleAllChecked\"\n [toggleAllCheckboxIndeterminate]=\"isToggleAllIndeterminate\"\n [noEntriesFoundLabel]=\"noOptionsFoundLabel()\"\n >\n <watt-icon ngxMatSelectSearchClear name=\"close\" size=\"s\" />\n </ngx-mat-select-search>\n </mat-option>\n\n @if (!multiple() && showResetOption()) {\n <mat-option>{{ emDash }}</mat-option>\n }\n\n @if (hasGroups()) {\n @for (item of filteredGroupedOptions(); track item) {\n @if (\"options\" in item) {\n <mat-optgroup [label]=\"item.label\" [disabled]=\"item.disabled\">\n @for (option of item.options; track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n </mat-optgroup>\n }\n }\n } @else {\n @for (option of filteredOptions(); track option) {\n <mat-option\n [value]=\"option.value\"\n [disabled]=\"option.disabled\"\n [class.mat-mdc-option-multiple]=\"multiple()\"\n >\n {{ option.displayValue }}\n </mat-option>\n }\n }\n </mat-select>\n <ng-content />\n <ng-content ngProjectAs=\"watt-field-hint\" select=\"watt-field-hint\" />\n <ng-content ngProjectAs=\"watt-field-error\" select=\"watt-field-error\" />\n</watt-field>\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattDropdownComponent } from './watt-dropdown.component';\nexport {\n type WattDropdownOption,\n type WattDropdownOptions,\n type WattDropdownGroupedOptions,\n type WattDropdownOptionGroup,\n} from './watt-dropdown-option';\nexport { type WattDropdownValue } from './watt-dropdown-value';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAgEa,qBAAqB,CAAA;IACxB,sBAAsB,GAAG,MAAM,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC1D,IAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC/B,IAAA,cAAc;AACd,IAAA,mBAAmB;IACnB,QAAQ,GAAwB,EAAE;IAClC,eAAe,GAA+B,EAAE;IACxD,aAAa,GAAuB,IAAI;AACxC,IAAA,gBAAgB,GAAG,IAAI,WAAW,CAAuC,IAAI,CAAC;AAE9E;;AAEG;AACH,IAAA,aAAa,GAAG,IAAI,kBAAkB,EAAE;AAExC;;AAEG;AACH,IAAA,eAAe,GAAG,MAAM,CAAsB,EAAE,2DAAC;AAEjD;;AAEG;AACH,IAAA,sBAAsB,GAAG,MAAM,CAA6B,EAAE,kEAAC;AAE/D,IAAA,qBAAqB,GAAG,QAAQ,CAAC,MAAK;AACpC,QAAA,IAAI,IAAI,CAAC,SAAS,EAAE,EAAE;YACpB,OAAO,IAAI,CAAC,sBAAsB;iBAC/B,OAAO,CAAC,CAAC,KAAK,MAAM,SAAS,IAAI,KAAK,GAAG,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC;iBAC5D,GAAG,CAAC,CAAC,MAAM,KAAK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AA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,aAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,mBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,qBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AExI9C;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
@@ -32,10 +32,10 @@ class WattDropZoneIntlService {
32
32
  button = 'Choose file';
33
33
  buttonMultiple = 'Choose files';
34
34
  loadingMessage = 'Loading';
35
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattDropZoneIntlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
36
- static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattDropZoneIntlService, providedIn: 'root' });
35
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattDropZoneIntlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
36
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattDropZoneIntlService, providedIn: 'root' });
37
37
  }
38
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattDropZoneIntlService, decorators: [{
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattDropZoneIntlService, decorators: [{
39
39
  type: Injectable,
40
40
  args: [{ providedIn: 'root' }]
41
41
  }] });
@@ -70,10 +70,10 @@ class FileTypeValidator {
70
70
  ? { type: true }
71
71
  : null;
72
72
  }
73
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FileTypeValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
74
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.15", type: FileTypeValidator, isStandalone: true, providers: [{ provide: NG_VALIDATORS, useExisting: FileTypeValidator, multi: true }], ngImport: i0 });
73
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: FileTypeValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
74
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: FileTypeValidator, isStandalone: true, providers: [{ provide: NG_VALIDATORS, useExisting: FileTypeValidator, multi: true }], ngImport: i0 });
75
75
  }
76
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: FileTypeValidator, decorators: [{
76
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: FileTypeValidator, decorators: [{
77
77
  type: Directive,
78
78
  args: [{
79
79
  providers: [{ provide: NG_VALIDATORS, useExisting: FileTypeValidator, multi: true }],
@@ -89,10 +89,10 @@ class MultipleFilesValidator {
89
89
  const multiple = this.component.multiple();
90
90
  return !multiple && control.value?.length !== 1 ? { multiple: true } : null;
91
91
  }
92
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MultipleFilesValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
93
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.15", type: MultipleFilesValidator, isStandalone: true, providers: [{ provide: NG_VALIDATORS, useExisting: MultipleFilesValidator, multi: true }], ngImport: i0 });
92
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: MultipleFilesValidator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
93
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.5", type: MultipleFilesValidator, isStandalone: true, providers: [{ provide: NG_VALIDATORS, useExisting: MultipleFilesValidator, multi: true }], ngImport: i0 });
94
94
  }
95
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: MultipleFilesValidator, decorators: [{
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: MultipleFilesValidator, decorators: [{
96
96
  type: Directive,
97
97
  args: [{
98
98
  providers: [{ provide: NG_VALIDATORS, useExisting: MultipleFilesValidator, multi: true }],
@@ -125,11 +125,11 @@ const maxFileSize = (size) => (control) => control.value?.some((file) => file.si
125
125
  class WattDropZone {
126
126
  intl = inject(WattDropZoneIntlService);
127
127
  /** Whether the dropzone should accept multiple files. */
128
- multiple = input(false, ...(ngDevMode ? [{ debugName: "multiple", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
128
+ multiple = input(false, { ...(ngDevMode ? { debugName: "multiple" } : {}), transform: booleanAttribute });
129
129
  /** Label for the dropzone. */
130
130
  label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
131
131
  /** Comma-separated list of MIME types that the dropzone accepts. */
132
- accept = input([], ...(ngDevMode ? [{ debugName: "accept", transform: (value) => value.split(',') }] : [{ transform: (value) => value.split(',') }]));
132
+ accept = input([], { ...(ngDevMode ? { debugName: "accept" } : {}), transform: (value) => value.split(',') });
133
133
  /** Whether to show the progress bar. Use in conjunction with `progress`. */
134
134
  showProgressBar = input(false, ...(ngDevMode ? [{ debugName: "showProgressBar" }] : []));
135
135
  /** Value for the progress bar. Only shown when `showProgressBar` is true. */
@@ -169,8 +169,8 @@ class WattDropZone {
169
169
  writeValue = () => { }; // eslint-disable-line @typescript-eslint/no-empty-function
170
170
  registerOnTouched = (fn) => this.selected.subscribe(fn);
171
171
  registerOnChange = (fn) => this.selected.subscribe(fn);
172
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattDropZone, deps: [], target: i0.ɵɵFactoryTarget.Component });
173
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.15", type: WattDropZone, isStandalone: true, selector: "watt-dropzone", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, showProgressBar: { classPropertyName: "showProgressBar", publicName: "showProgressBar", isSignal: true, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null }, loadingMessage: { classPropertyName: "loadingMessage", publicName: "loadingMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, providers: [
172
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattDropZone, deps: [], target: i0.ɵɵFactoryTarget.Component });
173
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.5", type: WattDropZone, isStandalone: true, selector: "watt-dropzone", inputs: { multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, accept: { classPropertyName: "accept", publicName: "accept", isSignal: true, isRequired: false, transformFunction: null }, showProgressBar: { classPropertyName: "showProgressBar", publicName: "showProgressBar", isSignal: true, isRequired: false, transformFunction: null }, progress: { classPropertyName: "progress", publicName: "progress", isSignal: true, isRequired: false, transformFunction: null }, loadingMessage: { classPropertyName: "loadingMessage", publicName: "loadingMessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selected" }, providers: [
174
174
  {
175
175
  provide: NG_VALUE_ACCESSOR,
176
176
  useExisting: forwardRef(() => WattDropZone),
@@ -223,7 +223,7 @@ class WattDropZone {
223
223
  </watt-field>
224
224
  `, isInline: true, styles: [".wrapper{display:block;min-height:184px}.dropzone{padding:var(--watt-space-l);background:var(--watt-color-neutral-grey-200)}.dragOver{background:var(--watt-color-state-info-light)}.mat-mdc-progress-bar{--mat-progress-bar-active-indicator-color: var(--watt-color-primary);--mat-progress-bar-track-color: var(--watt-color-primary-light)}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "component", type: VaterStackComponent, selector: "vater-stack, [vater-stack]" }, { kind: "component", type: WattButtonComponent, selector: "watt-button", inputs: ["icon", "variant", "size", "type", "formId", "disabled", "loading"] }, { kind: "component", type: WattFieldComponent, selector: "watt-field", inputs: ["control", "label", "id", "chipMode", "tooltip", "placeholder", "anchorName", "displayMode", "autoFocus", "showErrors"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i2.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }] });
225
225
  }
226
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: WattDropZone, decorators: [{
226
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.5", ngImport: i0, type: WattDropZone, decorators: [{
227
227
  type: Component,
228
228
  args: [{ imports: [
229
229
  ReactiveFormsModule,
@@ -1 +1 @@
1
- {"version":3,"file":"energinet-watt-dropzone.mjs","sources":["../../../libs/watt/package/dropzone/watt-dropzone-intl.ts","../../../libs/watt/package/dropzone/watt-dropzone-validators.ts","../../../libs/watt/package/dropzone/watt-dropzone.ts","../../../libs/watt/package/dropzone/index.ts","../../../libs/watt/package/dropzone/energinet-watt-dropzone.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class WattDropZoneIntlService {\n prompt = 'Drop file here';\n promptMultiple = 'Drop files here';\n separator = 'or';\n button = 'Choose file';\n buttonMultiple = 'Choose files';\n loadingMessage = 'Loading';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Directive, inject } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\nimport { WattDropZone, MimeType } from './watt-dropzone';\n\n/**\n * Directive that validates the file type of provided files. This is automatically\n * applied to the `WattDropZone` component via `hostDirectives`.\n */\n@Directive({\n providers: [{ provide: NG_VALIDATORS, useExisting: FileTypeValidator, multi: true }],\n})\nexport class FileTypeValidator implements Validator {\n component = inject(WattDropZone, { host: true, self: true });\n validate(control: AbstractControl<File[] | null>): ValidationErrors | null {\n const accept = this.component.accept();\n return accept.length > 0 && control.value?.some((i) => !accept.includes(i.type as MimeType))\n ? { type: true }\n : null;\n }\n}\n\n/**\n * Directive validating that a single file is selected when `multiple` is false.\n * This is automatically applied to the `WattDropZone` component via `hostDirectives`.\n */\n@Directive({\n providers: [{ provide: NG_VALIDATORS, useExisting: MultipleFilesValidator, multi: true }],\n})\nexport class MultipleFilesValidator implements Validator {\n component = inject(WattDropZone, { host: true, self: true });\n validate(control: AbstractControl<File[] | null>): ValidationErrors | null {\n const multiple = this.component.multiple();\n return !multiple && control.value?.length !== 1 ? { multiple: true } : null;\n }\n}\n\n/** Validates that the file size is less than or equal to the specified maximum size. */\nexport const limitFiles =\n (limit: number) =>\n (control: AbstractControl<File[] | null>): ValidationErrors | null =>\n control.value?.length && control.value.length > limit ? { limit } : null;\n\n/** Validates that the file size is less than or equal to the specified maximum size. */\nexport const maxFileSize =\n (size: number) =>\n (control: AbstractControl<File[] | null>): ValidationErrors | null =>\n control.value?.some((file) => file.size > size) ? { size } : null;\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n Component,\n booleanAttribute,\n forwardRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { VaterStackComponent, VaterUtilityDirective } from '@energinet/watt/vater';\nimport { WattDropZoneIntlService } from './watt-dropzone-intl';\nimport { FileTypeValidator, MultipleFilesValidator } from './watt-dropzone-validators';\n\n// Slightly better typing than just raw string\nexport type MimeType = `${string}/${string}`;\n\n@Component({\n imports: [\n ReactiveFormsModule,\n VaterStackComponent,\n VaterUtilityDirective,\n WattButtonComponent,\n WattFieldComponent,\n MatProgressBarModule,\n ],\n selector: 'watt-dropzone',\n hostDirectives: [FileTypeValidator, MultipleFilesValidator],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattDropZone),\n multi: true,\n },\n ],\n styles: `\n .wrapper {\n display: block;\n min-height: 184px; /* Magic UX number */\n }\n\n .dropzone {\n padding: var(--watt-space-l);\n background: var(--watt-color-neutral-grey-200);\n }\n\n .dragOver {\n background: var(--watt-color-state-info-light);\n }\n\n .mat-mdc-progress-bar {\n --mat-progress-bar-active-indicator-color: var(--watt-color-primary);\n --mat-progress-bar-track-color: var(--watt-color-primary-light);\n }\n `,\n template: `\n <watt-field [label]=\"label()\">\n <ng-content />\n <ng-content select=\"watt-field-error\" ngProjectAs=\"watt-field-error\" />\n <ng-content select=\"watt-field-warning\" ngProjectAs=\"watt-field-warning\" />\n <ng-content select=\"watt-field-hint\" ngProjectAs=\"watt-field-hint\" />\n <span class=\"wrapper\">\n <vater-stack\n inset=\"0\"\n class=\"dropzone\"\n [class.dragOver]=\"dragOver()\"\n (dragover)=\"handleDragOver($event)\"\n (drop)=\"handleDrop($event)\"\n (drop)=\"dragOver.set(false)\"\n (dragleave)=\"dragOver.set(false)\"\n >\n @if (showProgressBar()) {\n <vater-stack center gap=\"s\" fill=\"horizontal\" align=\"start\">\n <vater-stack fill=\"horizontal\" direction=\"row\" justify=\"space-between\">\n <span>{{ loadingMessage() ?? intl.loadingMessage }}</span>\n <span>{{ progress() }}%</span>\n </vater-stack>\n\n <mat-progress-bar mode=\"determinate\" [value]=\"progress()\" />\n </vater-stack>\n } @else {\n <vater-stack center gap=\"xs\">\n <input\n #input\n hidden\n type=\"file\"\n [multiple]=\"multiple()\"\n [accept]=\"accept().join(',')\"\n (change)=\"handleChange(input)\"\n />\n <span>{{ multiple() ? intl.promptMultiple : intl.prompt }}</span>\n <span class=\"watt-on-light--medium-emphasis\">{{ intl.separator }}</span>\n <watt-button size=\"small\" variant=\"secondary\" (click)=\"input.click()\">\n {{ multiple() ? intl.buttonMultiple : intl.button }}\n </watt-button>\n </vater-stack>\n }\n </vater-stack>\n </span>\n </watt-field>\n `,\n})\n// eslint-disable-next-line @angular-eslint/component-class-suffix\nexport class WattDropZone implements ControlValueAccessor {\n intl = inject(WattDropZoneIntlService);\n\n /** Whether the dropzone should accept multiple files. */\n multiple = input(false, { transform: booleanAttribute });\n\n /** Label for the dropzone. */\n label = input<string>();\n\n /** Comma-separated list of MIME types that the dropzone accepts. */\n accept = input([], { transform: (value: MimeType) => value.split(',') as MimeType[] });\n\n /** Whether to show the progress bar. Use in conjunction with `progress`. */\n showProgressBar = input(false);\n\n /** Value for the progress bar. Only shown when `showProgressBar` is true. */\n progress = input(0);\n\n /** Message to display when `showProgressBar` is true. Overrides default implementation. */\n loadingMessage = input<string>();\n\n /** Emits when one or more files are selected. */\n selected = output<File[]>();\n\n // Tracks (valid) drag over state\n dragOver = signal(false);\n\n handleChange(input: HTMLInputElement) {\n if (!input.files) return;\n this.selected.emit(Array.from(input.files));\n input.value = ''; // fix for chrome not emitting event when selecting the same file\n }\n\n handleDrop(event: DragEvent) {\n if (!event.dataTransfer) return;\n if (!this.dragOver()) return;\n\n // Prevent opening the file in the browser\n event.preventDefault();\n\n this.selected.emit(Array.from(event.dataTransfer.files));\n }\n\n handleDragOver(event: DragEvent) {\n if (!event.dataTransfer) return;\n\n // Ignore non-file items such as strings\n if (Array.from(event.dataTransfer.items).some((i) => i.kind !== 'file')) return;\n\n // Prevent opening the file in the browser\n event.preventDefault();\n\n this.dragOver.set(true);\n }\n\n // Implementation for ControlValueAccessor\n writeValue = () => {}; // eslint-disable-line @typescript-eslint/no-empty-function\n registerOnTouched = (fn: () => void) => this.selected.subscribe(fn);\n registerOnChange = (fn: (value: File[]) => void) => this.selected.subscribe(fn);\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattDropZone } from './watt-dropzone';\nexport { WattDropZoneIntlService } from './watt-dropzone-intl';\nexport {\n FileTypeValidator,\n MultipleFilesValidator,\n maxFileSize,\n limitFiles,\n} from './watt-dropzone-validators';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.FileTypeValidator","i1.MultipleFilesValidator"],"mappings":";;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAIa,uBAAuB,CAAA;IAClC,MAAM,GAAG,gBAAgB;IACzB,cAAc,GAAG,iBAAiB;IAClC,SAAS,GAAG,IAAI;IAChB,MAAM,GAAG,aAAa;IACtB,cAAc,GAAG,cAAc;IAC/B,cAAc,GAAG,SAAS;wGANf,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;AAAvB,IAAA,OAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,uBAAu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qBACF,EAAA,QAAA,EAqBS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,mVAAA,CAAA,EAAA;;;AC1HH;AACA;;;;;;;;;;;;;;;AAeG;AACH;;ACjBA;;AAEG;;;;"}
1
+ {"version":3,"file":"energinet-watt-dropzone.mjs","sources":["../../../libs/watt/package/dropzone/watt-dropzone-intl.ts","../../../libs/watt/package/dropzone/watt-dropzone-validators.ts","../../../libs/watt/package/dropzone/watt-dropzone.ts","../../../libs/watt/package/dropzone/index.ts","../../../libs/watt/package/dropzone/energinet-watt-dropzone.ts"],"sourcesContent":["//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Injectable } from '@angular/core';\n\n@Injectable({ providedIn: 'root' })\nexport class WattDropZoneIntlService {\n prompt = 'Drop file here';\n promptMultiple = 'Drop files here';\n separator = 'or';\n button = 'Choose file';\n buttonMultiple = 'Choose files';\n loadingMessage = 'Loading';\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport { Directive, inject } from '@angular/core';\nimport { AbstractControl, NG_VALIDATORS, ValidationErrors, Validator } from '@angular/forms';\nimport { WattDropZone, MimeType } from './watt-dropzone';\n\n/**\n * Directive that validates the file type of provided files. This is automatically\n * applied to the `WattDropZone` component via `hostDirectives`.\n */\n@Directive({\n providers: [{ provide: NG_VALIDATORS, useExisting: FileTypeValidator, multi: true }],\n})\nexport class FileTypeValidator implements Validator {\n component = inject(WattDropZone, { host: true, self: true });\n validate(control: AbstractControl<File[] | null>): ValidationErrors | null {\n const accept = this.component.accept();\n return accept.length > 0 && control.value?.some((i) => !accept.includes(i.type as MimeType))\n ? { type: true }\n : null;\n }\n}\n\n/**\n * Directive validating that a single file is selected when `multiple` is false.\n * This is automatically applied to the `WattDropZone` component via `hostDirectives`.\n */\n@Directive({\n providers: [{ provide: NG_VALIDATORS, useExisting: MultipleFilesValidator, multi: true }],\n})\nexport class MultipleFilesValidator implements Validator {\n component = inject(WattDropZone, { host: true, self: true });\n validate(control: AbstractControl<File[] | null>): ValidationErrors | null {\n const multiple = this.component.multiple();\n return !multiple && control.value?.length !== 1 ? { multiple: true } : null;\n }\n}\n\n/** Validates that the file size is less than or equal to the specified maximum size. */\nexport const limitFiles =\n (limit: number) =>\n (control: AbstractControl<File[] | null>): ValidationErrors | null =>\n control.value?.length && control.value.length > limit ? { limit } : null;\n\n/** Validates that the file size is less than or equal to the specified maximum size. */\nexport const maxFileSize =\n (size: number) =>\n (control: AbstractControl<File[] | null>): ValidationErrors | null =>\n control.value?.some((file) => file.size > size) ? { size } : null;\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nimport {\n Component,\n booleanAttribute,\n forwardRef,\n inject,\n input,\n output,\n signal,\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR, ReactiveFormsModule } from '@angular/forms';\nimport { MatProgressBarModule } from '@angular/material/progress-bar';\n\nimport { WattButtonComponent } from '@energinet/watt/button';\nimport { WattFieldComponent } from '@energinet/watt/field';\nimport { VaterStackComponent, VaterUtilityDirective } from '@energinet/watt/vater';\nimport { WattDropZoneIntlService } from './watt-dropzone-intl';\nimport { FileTypeValidator, MultipleFilesValidator } from './watt-dropzone-validators';\n\n// Slightly better typing than just raw string\nexport type MimeType = `${string}/${string}`;\n\n@Component({\n imports: [\n ReactiveFormsModule,\n VaterStackComponent,\n VaterUtilityDirective,\n WattButtonComponent,\n WattFieldComponent,\n MatProgressBarModule,\n ],\n selector: 'watt-dropzone',\n hostDirectives: [FileTypeValidator, MultipleFilesValidator],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => WattDropZone),\n multi: true,\n },\n ],\n styles: `\n .wrapper {\n display: block;\n min-height: 184px; /* Magic UX number */\n }\n\n .dropzone {\n padding: var(--watt-space-l);\n background: var(--watt-color-neutral-grey-200);\n }\n\n .dragOver {\n background: var(--watt-color-state-info-light);\n }\n\n .mat-mdc-progress-bar {\n --mat-progress-bar-active-indicator-color: var(--watt-color-primary);\n --mat-progress-bar-track-color: var(--watt-color-primary-light);\n }\n `,\n template: `\n <watt-field [label]=\"label()\">\n <ng-content />\n <ng-content select=\"watt-field-error\" ngProjectAs=\"watt-field-error\" />\n <ng-content select=\"watt-field-warning\" ngProjectAs=\"watt-field-warning\" />\n <ng-content select=\"watt-field-hint\" ngProjectAs=\"watt-field-hint\" />\n <span class=\"wrapper\">\n <vater-stack\n inset=\"0\"\n class=\"dropzone\"\n [class.dragOver]=\"dragOver()\"\n (dragover)=\"handleDragOver($event)\"\n (drop)=\"handleDrop($event)\"\n (drop)=\"dragOver.set(false)\"\n (dragleave)=\"dragOver.set(false)\"\n >\n @if (showProgressBar()) {\n <vater-stack center gap=\"s\" fill=\"horizontal\" align=\"start\">\n <vater-stack fill=\"horizontal\" direction=\"row\" justify=\"space-between\">\n <span>{{ loadingMessage() ?? intl.loadingMessage }}</span>\n <span>{{ progress() }}%</span>\n </vater-stack>\n\n <mat-progress-bar mode=\"determinate\" [value]=\"progress()\" />\n </vater-stack>\n } @else {\n <vater-stack center gap=\"xs\">\n <input\n #input\n hidden\n type=\"file\"\n [multiple]=\"multiple()\"\n [accept]=\"accept().join(',')\"\n (change)=\"handleChange(input)\"\n />\n <span>{{ multiple() ? intl.promptMultiple : intl.prompt }}</span>\n <span class=\"watt-on-light--medium-emphasis\">{{ intl.separator }}</span>\n <watt-button size=\"small\" variant=\"secondary\" (click)=\"input.click()\">\n {{ multiple() ? intl.buttonMultiple : intl.button }}\n </watt-button>\n </vater-stack>\n }\n </vater-stack>\n </span>\n </watt-field>\n `,\n})\n// eslint-disable-next-line @angular-eslint/component-class-suffix\nexport class WattDropZone implements ControlValueAccessor {\n intl = inject(WattDropZoneIntlService);\n\n /** Whether the dropzone should accept multiple files. */\n multiple = input(false, { transform: booleanAttribute });\n\n /** Label for the dropzone. */\n label = input<string>();\n\n /** Comma-separated list of MIME types that the dropzone accepts. */\n accept = input([], { transform: (value: MimeType) => value.split(',') as MimeType[] });\n\n /** Whether to show the progress bar. Use in conjunction with `progress`. */\n showProgressBar = input(false);\n\n /** Value for the progress bar. Only shown when `showProgressBar` is true. */\n progress = input(0);\n\n /** Message to display when `showProgressBar` is true. Overrides default implementation. */\n loadingMessage = input<string>();\n\n /** Emits when one or more files are selected. */\n selected = output<File[]>();\n\n // Tracks (valid) drag over state\n dragOver = signal(false);\n\n handleChange(input: HTMLInputElement) {\n if (!input.files) return;\n this.selected.emit(Array.from(input.files));\n input.value = ''; // fix for chrome not emitting event when selecting the same file\n }\n\n handleDrop(event: DragEvent) {\n if (!event.dataTransfer) return;\n if (!this.dragOver()) return;\n\n // Prevent opening the file in the browser\n event.preventDefault();\n\n this.selected.emit(Array.from(event.dataTransfer.files));\n }\n\n handleDragOver(event: DragEvent) {\n if (!event.dataTransfer) return;\n\n // Ignore non-file items such as strings\n if (Array.from(event.dataTransfer.items).some((i) => i.kind !== 'file')) return;\n\n // Prevent opening the file in the browser\n event.preventDefault();\n\n this.dragOver.set(true);\n }\n\n // Implementation for ControlValueAccessor\n writeValue = () => {}; // eslint-disable-line @typescript-eslint/no-empty-function\n registerOnTouched = (fn: () => void) => this.selected.subscribe(fn);\n registerOnChange = (fn: (value: File[]) => void) => this.selected.subscribe(fn);\n}\n","//#region License\n/**\n * @license\n * Copyright 2020 Energinet DataHub A/S\n *\n * Licensed under the Apache License, Version 2.0 (the \"License2\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n//#endregion\nexport { WattDropZone } from './watt-dropzone';\nexport { WattDropZoneIntlService } from './watt-dropzone-intl';\nexport {\n FileTypeValidator,\n MultipleFilesValidator,\n maxFileSize,\n limitFiles,\n} from './watt-dropzone-validators';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.FileTypeValidator","i1.MultipleFilesValidator"],"mappings":";;;;;;;;;AAAA;AACA;;;;;;;;;;;;;;;AAeG;AACH;MAIa,uBAAuB,CAAA;IAClC,MAAM,GAAG,gBAAgB;IACzB,cAAc,GAAG,iBAAiB;IAClC,SAAS,GAAG,IAAI;IAChB,MAAM,GAAG,aAAa;IACtB,cAAc,GAAG,cAAc;IAC/B,cAAc,GAAG,SAAS;uGANf,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EA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