@aeris-ui/core 22.0.0-alpha.1 → 22.0.0-alpha.10
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.
- package/README.md +200 -191
- package/fesm2022/aeris-ui-core-accordion.mjs +646 -255
- package/fesm2022/aeris-ui-core-accordion.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-animate-on-scroll.mjs +284 -103
- package/fesm2022/aeris-ui-core-animate-on-scroll.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-auto-complete.mjs +1228 -446
- package/fesm2022/aeris-ui-core-auto-complete.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-auto-focus.mjs +111 -61
- package/fesm2022/aeris-ui-core-auto-focus.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-avatar.mjs +383 -101
- package/fesm2022/aeris-ui-core-avatar.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-badge.mjs +562 -115
- package/fesm2022/aeris-ui-core-badge.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-block-ui.mjs +209 -101
- package/fesm2022/aeris-ui-core-block-ui.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-breadcrumb.mjs +581 -189
- package/fesm2022/aeris-ui-core-breadcrumb.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-button-group.mjs +153 -38
- package/fesm2022/aeris-ui-core-button-group.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-button.mjs +741 -139
- package/fesm2022/aeris-ui-core-button.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-card.mjs +371 -101
- package/fesm2022/aeris-ui-core-card.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-carousel.mjs +773 -369
- package/fesm2022/aeris-ui-core-carousel.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-cascade-select.mjs +1171 -521
- package/fesm2022/aeris-ui-core-cascade-select.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-chart.mjs +455 -258
- package/fesm2022/aeris-ui-core-chart.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-checkbox.mjs +440 -140
- package/fesm2022/aeris-ui-core-checkbox.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-chip.mjs +430 -117
- package/fesm2022/aeris-ui-core-chip.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-class-names.mjs +87 -65
- package/fesm2022/aeris-ui-core-class-names.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-code-block.mjs +637 -0
- package/fesm2022/aeris-ui-core-code-block.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-color-picker.mjs +1340 -700
- package/fesm2022/aeris-ui-core-color-picker.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-compare.mjs +823 -318
- package/fesm2022/aeris-ui-core-compare.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-confirm-dialog.mjs +1404 -555
- package/fesm2022/aeris-ui-core-confirm-dialog.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-confirm-popup.mjs +1471 -740
- package/fesm2022/aeris-ui-core-confirm-popup.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-context-menu.mjs +918 -443
- package/fesm2022/aeris-ui-core-context-menu.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-date-picker.mjs +1942 -1123
- package/fesm2022/aeris-ui-core-date-picker.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-dialog.mjs +1079 -346
- package/fesm2022/aeris-ui-core-dialog.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-divider.mjs +204 -43
- package/fesm2022/aeris-ui-core-divider.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-drawer.mjs +1015 -322
- package/fesm2022/aeris-ui-core-drawer.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-dynamic-dialog.mjs +410 -254
- package/fesm2022/aeris-ui-core-dynamic-dialog.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-editor.mjs +967 -587
- package/fesm2022/aeris-ui-core-editor.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-file-upload.mjs +1379 -522
- package/fesm2022/aeris-ui-core-file-upload.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-filter-service.mjs +258 -301
- package/fesm2022/aeris-ui-core-filter-service.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-fluid.mjs +68 -21
- package/fesm2022/aeris-ui-core-fluid.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-focus-trap.mjs +206 -182
- package/fesm2022/aeris-ui-core-focus-trap.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-form-field.mjs +688 -0
- package/fesm2022/aeris-ui-core-form-field.mjs.map +1 -0
- package/fesm2022/aeris-ui-core-galleria.mjs +2446 -1117
- package/fesm2022/aeris-ui-core-galleria.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-glass.mjs +110 -33
- package/fesm2022/aeris-ui-core-glass.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-icon-field.mjs +426 -98
- package/fesm2022/aeris-ui-core-icon-field.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-inplace.mjs +452 -130
- package/fesm2022/aeris-ui-core-inplace.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-input-group.mjs +413 -107
- package/fesm2022/aeris-ui-core-input-group.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-input-mask.mjs +658 -255
- package/fesm2022/aeris-ui-core-input-mask.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-input-number.mjs +926 -291
- package/fesm2022/aeris-ui-core-input-number.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-input-otp.mjs +678 -264
- package/fesm2022/aeris-ui-core-input-otp.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-input-text.mjs +625 -158
- package/fesm2022/aeris-ui-core-input-text.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-key-filter.mjs +263 -201
- package/fesm2022/aeris-ui-core-key-filter.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-mega-menu.mjs +613 -382
- package/fesm2022/aeris-ui-core-mega-menu.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-menu.mjs +1062 -472
- package/fesm2022/aeris-ui-core-menu.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-menubar.mjs +994 -393
- package/fesm2022/aeris-ui-core-menubar.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-message.mjs +477 -145
- package/fesm2022/aeris-ui-core-message.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-meter-group.mjs +623 -230
- package/fesm2022/aeris-ui-core-meter-group.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-multi-select.mjs +1598 -561
- package/fesm2022/aeris-ui-core-multi-select.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-order-list.mjs +592 -220
- package/fesm2022/aeris-ui-core-order-list.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-organization-chart.mjs +485 -199
- package/fesm2022/aeris-ui-core-organization-chart.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-paginator.mjs +428 -123
- package/fesm2022/aeris-ui-core-paginator.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-panel.mjs +596 -196
- package/fesm2022/aeris-ui-core-panel.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-password.mjs +925 -249
- package/fesm2022/aeris-ui-core-password.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-pick-list.mjs +1280 -659
- package/fesm2022/aeris-ui-core-pick-list.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-popover.mjs +912 -375
- package/fesm2022/aeris-ui-core-popover.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-progress-bar.mjs +549 -176
- package/fesm2022/aeris-ui-core-progress-bar.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-progress-spinner.mjs +410 -133
- package/fesm2022/aeris-ui-core-progress-spinner.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-radio-button.mjs +394 -124
- package/fesm2022/aeris-ui-core-radio-button.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-rating.mjs +506 -231
- package/fesm2022/aeris-ui-core-rating.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-scroll-panel.mjs +457 -154
- package/fesm2022/aeris-ui-core-scroll-panel.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-scroll-top.mjs +226 -63
- package/fesm2022/aeris-ui-core-scroll-top.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-select.mjs +1845 -648
- package/fesm2022/aeris-ui-core-select.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-skeleton.mjs +149 -45
- package/fesm2022/aeris-ui-core-skeleton.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-slider.mjs +884 -430
- package/fesm2022/aeris-ui-core-slider.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-speed-dial.mjs +861 -337
- package/fesm2022/aeris-ui-core-speed-dial.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-split-button.mjs +955 -266
- package/fesm2022/aeris-ui-core-split-button.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-splitter.mjs +812 -352
- package/fesm2022/aeris-ui-core-splitter.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-stepper.mjs +697 -254
- package/fesm2022/aeris-ui-core-stepper.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-style-class.mjs +587 -342
- package/fesm2022/aeris-ui-core-style-class.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-table.mjs +2034 -869
- package/fesm2022/aeris-ui-core-table.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tabs.mjs +789 -279
- package/fesm2022/aeris-ui-core-tabs.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-textarea.mjs +856 -219
- package/fesm2022/aeris-ui-core-textarea.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-theme-builder.mjs +1284 -1399
- package/fesm2022/aeris-ui-core-theme-builder.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-theming.mjs +132 -144
- package/fesm2022/aeris-ui-core-theming.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tiered-menu.mjs +909 -441
- package/fesm2022/aeris-ui-core-tiered-menu.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-timeline.mjs +407 -131
- package/fesm2022/aeris-ui-core-timeline.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-toast.mjs +1076 -384
- package/fesm2022/aeris-ui-core-toast.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-toggle-switch.mjs +398 -132
- package/fesm2022/aeris-ui-core-toggle-switch.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-toolbar.mjs +458 -121
- package/fesm2022/aeris-ui-core-toolbar.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tooltip.mjs +625 -330
- package/fesm2022/aeris-ui-core-tooltip.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tree-select.mjs +1453 -621
- package/fesm2022/aeris-ui-core-tree-select.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tree-table.mjs +2019 -940
- package/fesm2022/aeris-ui-core-tree-table.mjs.map +1 -1
- package/fesm2022/aeris-ui-core-tree.mjs +1107 -658
- package/fesm2022/aeris-ui-core-tree.mjs.map +1 -1
- package/fesm2022/aeris-ui-core.mjs +985 -316
- package/fesm2022/aeris-ui-core.mjs.map +1 -1
- package/package.json +20 -8
- package/schematics/ng-add/schema.json +1 -1
- package/schematics/runtime/schematics/ng-add/options.js +4 -4
- package/schematics/runtime/schematics/ng-add/options.js.map +1 -1
- package/schematics/runtime/schematics/ng-add/workspace.js +1 -1
- package/schematics/runtime/schematics/ng-add/workspace.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-contrast.js +6 -17
- package/schematics/runtime/theme-builder/aeris-contrast.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-foundation.js +10 -4
- package/schematics/runtime/theme-builder/aeris-foundation.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-semantic-tones.js +28 -5
- package/schematics/runtime/theme-builder/aeris-semantic-tones.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-theme-generator.js +2 -2
- package/schematics/runtime/theme-builder/aeris-theme-generator.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-theme-resolver.js +22 -8
- package/schematics/runtime/theme-builder/aeris-theme-resolver.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-theme-tokens.js +12 -4
- package/schematics/runtime/theme-builder/aeris-theme-tokens.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-theme-validation.js +7 -1
- package/schematics/runtime/theme-builder/aeris-theme-validation.js.map +1 -1
- package/schematics/runtime/theme-builder/aeris-theme.js +49 -33
- package/schematics/runtime/theme-builder/aeris-theme.js.map +1 -1
- package/styles/_fallback-colors.scss +10 -0
- package/styles/_mobile.scss +16 -0
- package/styles/_tokens.scss +5 -5
- package/styles/aeris.css +412 -125
- package/styles/controls.css +61 -29
- package/tools/aeris-theme.mjs +2 -2
- package/tools/aeris-theme.schema.json +5 -2
- package/types/aeris-ui-core-accordion.d.ts +167 -93
- package/types/aeris-ui-core-animate-on-scroll.d.ts +72 -31
- package/types/aeris-ui-core-auto-complete.d.ts +327 -140
- package/types/aeris-ui-core-auto-focus.d.ts +24 -16
- package/types/aeris-ui-core-avatar.d.ts +112 -42
- package/types/aeris-ui-core-badge.d.ts +160 -46
- package/types/aeris-ui-core-block-ui.d.ts +47 -27
- package/types/aeris-ui-core-breadcrumb.d.ts +163 -92
- package/types/aeris-ui-core-button-group.d.ts +37 -16
- package/types/aeris-ui-core-button.d.ts +226 -67
- package/types/aeris-ui-core-card.d.ts +74 -37
- package/types/aeris-ui-core-carousel.d.ts +201 -117
- package/types/aeris-ui-core-cascade-select.d.ts +257 -123
- package/types/aeris-ui-core-chart.d.ts +134 -84
- package/types/aeris-ui-core-checkbox.d.ts +139 -54
- package/types/aeris-ui-core-chip.d.ts +116 -51
- package/types/aeris-ui-core-class-names.d.ts +22 -20
- package/types/aeris-ui-core-code-block.d.ts +188 -0
- package/types/aeris-ui-core-color-picker.d.ts +348 -143
- package/types/aeris-ui-core-compare.d.ts +224 -102
- package/types/aeris-ui-core-confirm-dialog.d.ts +442 -245
- package/types/aeris-ui-core-confirm-popup.d.ts +442 -263
- package/types/aeris-ui-core-context-menu.d.ts +264 -146
- package/types/aeris-ui-core-date-picker.d.ts +489 -217
- package/types/aeris-ui-core-dialog.d.ts +288 -117
- package/types/aeris-ui-core-divider.d.ts +58 -20
- package/types/aeris-ui-core-drawer.d.ts +273 -112
- package/types/aeris-ui-core-dynamic-dialog.d.ts +158 -137
- package/types/aeris-ui-core-editor.d.ts +250 -123
- package/types/aeris-ui-core-file-upload.d.ts +367 -197
- package/types/aeris-ui-core-filter-service.d.ts +48 -52
- package/types/aeris-ui-core-fluid.d.ts +12 -9
- package/types/aeris-ui-core-focus-trap.d.ts +39 -31
- package/types/aeris-ui-core-form-field.d.ts +163 -0
- package/types/aeris-ui-core-galleria.d.ts +588 -256
- package/types/aeris-ui-core-glass.d.ts +24 -11
- package/types/aeris-ui-core-icon-field.d.ts +94 -32
- package/types/aeris-ui-core-inplace.d.ts +123 -62
- package/types/aeris-ui-core-input-group.d.ts +84 -33
- package/types/aeris-ui-core-input-mask.d.ts +194 -69
- package/types/aeris-ui-core-input-number.d.ts +272 -87
- package/types/aeris-ui-core-input-otp.d.ts +191 -81
- package/types/aeris-ui-core-input-text.d.ts +185 -60
- package/types/aeris-ui-core-key-filter.d.ts +53 -39
- package/types/aeris-ui-core-mega-menu.d.ts +175 -121
- package/types/aeris-ui-core-menu.d.ts +277 -168
- package/types/aeris-ui-core-menubar.d.ts +273 -135
- package/types/aeris-ui-core-message.d.ts +132 -60
- package/types/aeris-ui-core-meter-group.d.ts +163 -90
- package/types/aeris-ui-core-multi-select.d.ts +439 -180
- package/types/aeris-ui-core-order-list.d.ts +144 -66
- package/types/aeris-ui-core-organization-chart.d.ts +133 -77
- package/types/aeris-ui-core-paginator.d.ts +93 -38
- package/types/aeris-ui-core-panel.d.ts +149 -78
- package/types/aeris-ui-core-password.d.ts +258 -102
- package/types/aeris-ui-core-pick-list.d.ts +374 -179
- package/types/aeris-ui-core-popover.d.ts +219 -105
- package/types/aeris-ui-core-progress-bar.d.ts +157 -73
- package/types/aeris-ui-core-progress-spinner.d.ts +110 -48
- package/types/aeris-ui-core-radio-button.d.ts +124 -50
- package/types/aeris-ui-core-rating.d.ts +149 -76
- package/types/aeris-ui-core-scroll-panel.d.ts +142 -64
- package/types/aeris-ui-core-scroll-top.d.ts +66 -29
- package/types/aeris-ui-core-select.d.ts +475 -217
- package/types/aeris-ui-core-skeleton.d.ts +39 -17
- package/types/aeris-ui-core-slider.d.ts +270 -115
- package/types/aeris-ui-core-speed-dial.d.ts +241 -111
- package/types/aeris-ui-core-split-button.d.ts +267 -113
- package/types/aeris-ui-core-splitter.d.ts +225 -106
- package/types/aeris-ui-core-stepper.d.ts +184 -91
- package/types/aeris-ui-core-style-class.d.ts +141 -71
- package/types/aeris-ui-core-table.d.ts +596 -304
- package/types/aeris-ui-core-tabs.d.ts +181 -76
- package/types/aeris-ui-core-textarea.d.ts +261 -78
- package/types/aeris-ui-core-theme-builder.d.ts +472 -450
- package/types/aeris-ui-core-theming.d.ts +42 -45
- package/types/aeris-ui-core-tiered-menu.d.ts +251 -142
- package/types/aeris-ui-core-timeline.d.ts +109 -71
- package/types/aeris-ui-core-toast.d.ts +225 -115
- package/types/aeris-ui-core-toggle-switch.d.ts +125 -51
- package/types/aeris-ui-core-toolbar.d.ts +98 -41
- package/types/aeris-ui-core-tooltip.d.ts +157 -88
- package/types/aeris-ui-core-tree-select.d.ts +364 -171
- package/types/aeris-ui-core-tree-table.d.ts +566 -286
- package/types/aeris-ui-core-tree.d.ts +270 -165
- package/types/aeris-ui-core.d.ts +197 -72
|
@@ -1,386 +1,765 @@
|
|
|
1
|
-
import { NgTemplateOutlet } from
|
|
2
|
-
import * as i0 from
|
|
3
|
-
import {
|
|
4
|
-
import { NG_VALUE_ACCESSOR } from
|
|
5
|
-
|
|
6
|
-
class AerisCascadeSelectOptionTemplate {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { NgTemplateOutlet } from "@angular/common";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Component, DestroyRef, Directive, ElementRef, TemplateRef, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, forwardRef, inject, input, model, output, signal, viewChild, viewChildren } from "@angular/core";
|
|
4
|
+
import { NG_VALUE_ACCESSOR } from "@angular/forms";
|
|
5
|
+
import { AERIS_OVERLAY_APPEND_TO, ɵAerisAppendTo, ɵaerisDisplayInvalid } from "@aeris-ui/core";
|
|
6
|
+
var AerisCascadeSelectOptionTemplate = class AerisCascadeSelectOptionTemplate {
|
|
7
|
+
template = inject(TemplateRef);
|
|
8
|
+
static ngTemplateContextGuard(_directive, context) {
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
12
|
+
minVersion: "12.0.0",
|
|
13
|
+
version: "22.2.2",
|
|
14
|
+
ngImport: i0,
|
|
15
|
+
type: AerisCascadeSelectOptionTemplate,
|
|
16
|
+
deps: [],
|
|
17
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
18
|
+
});
|
|
19
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
20
|
+
minVersion: "14.0.0",
|
|
21
|
+
version: "22.2.2",
|
|
22
|
+
type: AerisCascadeSelectOptionTemplate,
|
|
23
|
+
isStandalone: true,
|
|
24
|
+
selector: "ng-template[aerisCascadeSelectOption]",
|
|
25
|
+
ngImport: i0
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
29
|
+
minVersion: "12.0.0",
|
|
30
|
+
version: "22.2.2",
|
|
31
|
+
ngImport: i0,
|
|
32
|
+
type: AerisCascadeSelectOptionTemplate,
|
|
33
|
+
decorators: [{
|
|
34
|
+
type: Directive,
|
|
35
|
+
args: [{ selector: "ng-template[aerisCascadeSelectOption]" }]
|
|
36
|
+
}]
|
|
37
|
+
});
|
|
38
|
+
var AerisCascadeSelectEmptyTemplate = class AerisCascadeSelectEmptyTemplate {
|
|
39
|
+
template = inject(TemplateRef);
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
41
|
+
minVersion: "12.0.0",
|
|
42
|
+
version: "22.2.2",
|
|
43
|
+
ngImport: i0,
|
|
44
|
+
type: AerisCascadeSelectEmptyTemplate,
|
|
45
|
+
deps: [],
|
|
46
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
47
|
+
});
|
|
48
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
49
|
+
minVersion: "14.0.0",
|
|
50
|
+
version: "22.2.2",
|
|
51
|
+
type: AerisCascadeSelectEmptyTemplate,
|
|
52
|
+
isStandalone: true,
|
|
53
|
+
selector: "ng-template[aerisCascadeSelectEmpty]",
|
|
54
|
+
ngImport: i0
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
58
|
+
minVersion: "12.0.0",
|
|
59
|
+
version: "22.2.2",
|
|
60
|
+
ngImport: i0,
|
|
61
|
+
type: AerisCascadeSelectEmptyTemplate,
|
|
62
|
+
decorators: [{
|
|
63
|
+
type: Directive,
|
|
64
|
+
args: [{ selector: "ng-template[aerisCascadeSelectEmpty]" }]
|
|
65
|
+
}]
|
|
66
|
+
});
|
|
27
67
|
let nextCascadeSelectId = 0;
|
|
28
|
-
class AerisCascadeSelect {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
68
|
+
var AerisCascadeSelect = class AerisCascadeSelect {
|
|
69
|
+
dismissOverlay = () => {
|
|
70
|
+
this.closePanel();
|
|
71
|
+
return true;
|
|
72
|
+
};
|
|
73
|
+
controlElement = viewChild("control", ...ngDevMode ? [{ debugName: "controlElement" }] : /* istanbul ignore next */ []);
|
|
74
|
+
triggerElement = viewChild("trigger", ...ngDevMode ? [{ debugName: "triggerElement" }] : /* istanbul ignore next */ []);
|
|
75
|
+
panels = viewChildren("optionsPanel", ...ngDevMode ? [{ debugName: "panels" }] : /* istanbul ignore next */ []);
|
|
76
|
+
host = inject(ElementRef);
|
|
77
|
+
destroyRef = inject(DestroyRef);
|
|
78
|
+
defaultAppendTo = inject(AERIS_OVERLAY_APPEND_TO);
|
|
79
|
+
panelPortals = viewChildren(ɵAerisAppendTo, ...ngDevMode ? [{ debugName: "panelPortals" }] : /* istanbul ignore next */ []);
|
|
80
|
+
generatedId = `aeris-cascade-select-${++nextCascadeSelectId}`;
|
|
81
|
+
formDisabled = signal(false, ...ngDevMode ? [{ debugName: "formDisabled" }] : /* istanbul ignore next */ []);
|
|
82
|
+
panelOpen = signal(false, ...ngDevMode ? [{ debugName: "panelOpen" }] : /* istanbul ignore next */ []);
|
|
83
|
+
activePath = signal([], ...ngDevMode ? [{ debugName: "activePath" }] : /* istanbul ignore next */ []);
|
|
84
|
+
expandedPath = signal([], ...ngDevMode ? [{ debugName: "expandedPath" }] : /* istanbul ignore next */ []);
|
|
85
|
+
mobile = signal(false, ...ngDevMode ? [{ debugName: "mobile" }] : /* istanbul ignore next */ []);
|
|
86
|
+
activeLevel = signal(0, ...ngDevMode ? [{ debugName: "activeLevel" }] : /* istanbul ignore next */ []);
|
|
87
|
+
onChange = () => void 0;
|
|
88
|
+
onTouched = () => void 0;
|
|
89
|
+
constructor() {
|
|
90
|
+
afterRenderEffect(() => {
|
|
91
|
+
const id = this.open() ? this.activeOptionId() : null;
|
|
92
|
+
const option = id ? this.host.nativeElement.ownerDocument.getElementById(id) : null;
|
|
93
|
+
const panel = option?.closest(this.mobile() ? ".aeris-cascade-select__panel" : ".aeris-cascade-select__panel, .aeris-cascade-select__submenu");
|
|
94
|
+
if (!option || !panel) return;
|
|
95
|
+
const itemBounds = option.getBoundingClientRect();
|
|
96
|
+
const panelBounds = panel.getBoundingClientRect();
|
|
97
|
+
const delta = itemBounds.bottom > panelBounds.bottom ? itemBounds.bottom - panelBounds.bottom : itemBounds.top < panelBounds.top ? itemBounds.top - panelBounds.top : 0;
|
|
98
|
+
if (delta) panel.scrollBy({
|
|
99
|
+
top: delta,
|
|
100
|
+
behavior: "instant"
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
afterNextRender(() => {
|
|
104
|
+
const query = this.host.nativeElement.ownerDocument.defaultView?.matchMedia?.("(max-width: 36rem)");
|
|
105
|
+
if (!query) return;
|
|
106
|
+
const update = () => this.mobile.set(query.matches);
|
|
107
|
+
update();
|
|
108
|
+
query.addEventListener("change", update);
|
|
109
|
+
this.destroyRef.onDestroy(() => query.removeEventListener("change", update));
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
value = model(null, ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
|
|
113
|
+
options = input([], ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
|
|
114
|
+
inputId = input("", ...ngDevMode ? [{ debugName: "inputId" }] : /* istanbul ignore next */ []);
|
|
115
|
+
name = input("", ...ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []);
|
|
116
|
+
placeholder = input("Select an option", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
|
|
117
|
+
ariaLabel = input(...ngDevMode ? [void 0, { debugName: "ariaLabel" }] : /* istanbul ignore next */ []);
|
|
118
|
+
ariaLabelledBy = input(...ngDevMode ? [void 0, { debugName: "ariaLabelledBy" }] : /* istanbul ignore next */ []);
|
|
119
|
+
ariaDescribedBy = input(...ngDevMode ? [void 0, { debugName: "ariaDescribedBy" }] : /* istanbul ignore next */ []);
|
|
120
|
+
clearButtonAriaLabel = input("Clear value", ...ngDevMode ? [{ debugName: "clearButtonAriaLabel" }] : /* istanbul ignore next */ []);
|
|
121
|
+
emptyMessage = input("No options available", ...ngDevMode ? [{ debugName: "emptyMessage" }] : /* istanbul ignore next */ []);
|
|
122
|
+
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
123
|
+
appearance = input("outline", ...ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []);
|
|
124
|
+
separator = input(" / ", ...ngDevMode ? [{ debugName: "separator" }] : /* istanbul ignore next */ []);
|
|
125
|
+
panelMaxHeight = input("18rem", ...ngDevMode ? [{ debugName: "panelMaxHeight" }] : /* istanbul ignore next */ []);
|
|
126
|
+
appendTo = input(...ngDevMode ? [void 0, { debugName: "appendTo" }] : /* istanbul ignore next */ []);
|
|
127
|
+
viewportMargin = input(8, ...ngDevMode ? [{ debugName: "viewportMargin" }] : /* istanbul ignore next */ []);
|
|
128
|
+
invalid = input(false, {
|
|
129
|
+
...ngDevMode ? { debugName: "invalid" } : /* istanbul ignore next */ {},
|
|
130
|
+
transform: booleanAttribute
|
|
131
|
+
});
|
|
132
|
+
touched = input(null, ...ngDevMode ? [{ debugName: "touched" }] : /* istanbul ignore next */ []);
|
|
133
|
+
displayInvalid = computed(() => ɵaerisDisplayInvalid(this.invalid(), this.touched()), ...ngDevMode ? [{ debugName: "displayInvalid" }] : /* istanbul ignore next */ []);
|
|
134
|
+
disabled = input(false, {
|
|
135
|
+
...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
|
|
136
|
+
transform: booleanAttribute
|
|
137
|
+
});
|
|
138
|
+
required = input(false, {
|
|
139
|
+
...ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {},
|
|
140
|
+
transform: booleanAttribute
|
|
141
|
+
});
|
|
142
|
+
fluid = input(false, {
|
|
143
|
+
...ngDevMode ? { debugName: "fluid" } : /* istanbul ignore next */ {},
|
|
144
|
+
transform: booleanAttribute
|
|
145
|
+
});
|
|
146
|
+
clearable = input(false, {
|
|
147
|
+
...ngDevMode ? { debugName: "clearable" } : /* istanbul ignore next */ {},
|
|
148
|
+
transform: booleanAttribute
|
|
149
|
+
});
|
|
150
|
+
selectBranches = input(false, {
|
|
151
|
+
...ngDevMode ? { debugName: "selectBranches" } : /* istanbul ignore next */ {},
|
|
152
|
+
transform: booleanAttribute
|
|
153
|
+
});
|
|
154
|
+
changed = output();
|
|
155
|
+
cleared = output();
|
|
156
|
+
opened = output();
|
|
157
|
+
closed = output();
|
|
158
|
+
focused = output();
|
|
159
|
+
blurred = output();
|
|
160
|
+
touch = output();
|
|
161
|
+
optionTemplate = contentChild(AerisCascadeSelectOptionTemplate, ...ngDevMode ? [{ debugName: "optionTemplate" }] : /* istanbul ignore next */ []);
|
|
162
|
+
emptyTemplate = contentChild(AerisCascadeSelectEmptyTemplate, ...ngDevMode ? [{ debugName: "emptyTemplate" }] : /* istanbul ignore next */ []);
|
|
163
|
+
panelId = `${this.generatedId}-panel`;
|
|
164
|
+
resolvedInputId = computed(() => this.inputId() || this.generatedId, ...ngDevMode ? [{ debugName: "resolvedInputId" }] : /* istanbul ignore next */ []);
|
|
165
|
+
open = computed(() => this.panelOpen(), ...ngDevMode ? [{ debugName: "open" }] : /* istanbul ignore next */ []);
|
|
166
|
+
submenuPlacement = computed(() => {
|
|
167
|
+
this.open();
|
|
168
|
+
return this.host.nativeElement.ownerDocument.defaultView?.getComputedStyle(this.host.nativeElement).direction === "rtl" ? "left" : "right";
|
|
169
|
+
}, ...ngDevMode ? [{ debugName: "submenuPlacement" }] : /* istanbul ignore next */ []);
|
|
170
|
+
submenuTarget = computed(() => {
|
|
171
|
+
if (this.mobile()) return "self";
|
|
172
|
+
const target = this.appendTo() ?? this.defaultAppendTo;
|
|
173
|
+
return target === "self" ? this.host.nativeElement : target ?? "body";
|
|
174
|
+
}, ...ngDevMode ? [{ debugName: "submenuTarget" }] : /* istanbul ignore next */ []);
|
|
175
|
+
effectiveDisabled = computed(() => this.disabled() || this.formDisabled(), ...ngDevMode ? [{ debugName: "effectiveDisabled" }] : /* istanbul ignore next */ []);
|
|
176
|
+
selectedPath = computed(() => this.findPathByValue(this.value()), ...ngDevMode ? [{ debugName: "selectedPath" }] : /* istanbul ignore next */ []);
|
|
177
|
+
displayValue = computed(() => this.selectedPath().map((option) => option.label).join(this.separator()), ...ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []);
|
|
178
|
+
showClearButton = computed(() => this.clearable() && this.value() !== null && !this.effectiveDisabled(), ...ngDevMode ? [{ debugName: "showClearButton" }] : /* istanbul ignore next */ []);
|
|
179
|
+
activeOptionId = computed(() => {
|
|
180
|
+
const option = this.activePath()[this.activeLevel()];
|
|
181
|
+
return option ? this.optionId(this.activeLevel(), option.value) : null;
|
|
182
|
+
}, ...ngDevMode ? [{ debugName: "activeOptionId" }] : /* istanbul ignore next */ []);
|
|
183
|
+
writeValue(value) {
|
|
184
|
+
this.value.set(typeof value === "string" ? value : value == null ? null : String(value));
|
|
185
|
+
}
|
|
186
|
+
registerOnChange(callback) {
|
|
187
|
+
this.onChange = callback;
|
|
188
|
+
}
|
|
189
|
+
registerOnTouched(callback) {
|
|
190
|
+
this.onTouched = callback;
|
|
191
|
+
}
|
|
192
|
+
setDisabledState(disabled) {
|
|
193
|
+
this.formDisabled.set(disabled);
|
|
194
|
+
}
|
|
195
|
+
focus(options) {
|
|
196
|
+
this.triggerElement()?.nativeElement.focus(options);
|
|
197
|
+
}
|
|
198
|
+
openPanel() {
|
|
199
|
+
if (this.effectiveDisabled()) return;
|
|
200
|
+
if (!this.panelOpen()) {
|
|
201
|
+
const selected = this.selectedPath();
|
|
202
|
+
const first = this.firstEnabled(this.options());
|
|
203
|
+
this.activePath.set(selected.length ? selected : first ? [first] : []);
|
|
204
|
+
this.expandedPath.set(selected.slice(0, -1));
|
|
205
|
+
this.activeLevel.set(Math.max(0, selected.length - 1));
|
|
206
|
+
this.panelOpen.set(true);
|
|
207
|
+
this.opened.emit();
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
closePanel() {
|
|
211
|
+
if (!this.panelOpen()) return;
|
|
212
|
+
for (const portal of this.panelPortals()) portal.restore();
|
|
213
|
+
this.panelOpen.set(false);
|
|
214
|
+
this.activePath.set([]);
|
|
215
|
+
this.expandedPath.set([]);
|
|
216
|
+
this.activeLevel.set(0);
|
|
217
|
+
this.closed.emit();
|
|
218
|
+
}
|
|
219
|
+
toggle() {
|
|
220
|
+
if (this.panelOpen()) this.closePanel();
|
|
221
|
+
else this.openPanel();
|
|
222
|
+
}
|
|
223
|
+
clear() {
|
|
224
|
+
if (this.effectiveDisabled()) return;
|
|
225
|
+
this.setValue(null, null, new Event("clear"));
|
|
226
|
+
this.activePath.set([]);
|
|
227
|
+
this.cleared.emit();
|
|
228
|
+
this.closePanel();
|
|
229
|
+
this.focus();
|
|
230
|
+
}
|
|
231
|
+
reset() {
|
|
232
|
+
this.setValue(null, null, new Event("reset"));
|
|
233
|
+
this.activePath.set([]);
|
|
234
|
+
this.closePanel();
|
|
235
|
+
}
|
|
236
|
+
handleBlur(event) {
|
|
237
|
+
this.touch.emit();
|
|
238
|
+
this.onTouched();
|
|
239
|
+
this.blurred.emit(event);
|
|
240
|
+
}
|
|
241
|
+
handleFocusOut(event) {
|
|
242
|
+
const nextTarget = event.relatedTarget;
|
|
243
|
+
const currentTarget = event.currentTarget;
|
|
244
|
+
if (!nextTarget || !currentTarget.contains(nextTarget) && !this.panels().some((panel) => panel.nativeElement.contains(nextTarget))) this.closePanel();
|
|
245
|
+
}
|
|
246
|
+
handleOutside(event) {
|
|
247
|
+
const target = event.target;
|
|
248
|
+
if (target instanceof Node && (this.host.nativeElement.contains(target) || this.panels().some((panel) => panel.nativeElement.contains(target)))) return;
|
|
249
|
+
this.closePanel();
|
|
250
|
+
}
|
|
251
|
+
handleKeydown(event) {
|
|
252
|
+
switch (event.key) {
|
|
253
|
+
case "ArrowDown":
|
|
254
|
+
event.preventDefault();
|
|
255
|
+
if (!this.panelOpen()) {
|
|
256
|
+
this.openPanel();
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
this.openPanel();
|
|
260
|
+
this.moveActive(1);
|
|
261
|
+
break;
|
|
262
|
+
case "ArrowUp":
|
|
263
|
+
event.preventDefault();
|
|
264
|
+
if (!this.panelOpen()) {
|
|
265
|
+
this.openPanel();
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
268
|
+
this.openPanel();
|
|
269
|
+
this.moveActive(-1);
|
|
270
|
+
break;
|
|
271
|
+
case "ArrowRight":
|
|
272
|
+
event.preventDefault();
|
|
273
|
+
this.openPanel();
|
|
274
|
+
if (this.submenuPlacement() === "left") this.leaveChildColumn();
|
|
275
|
+
else this.enterChildColumn();
|
|
276
|
+
break;
|
|
277
|
+
case "ArrowLeft":
|
|
278
|
+
if (this.panelOpen()) {
|
|
279
|
+
event.preventDefault();
|
|
280
|
+
if (this.submenuPlacement() === "left") this.enterChildColumn();
|
|
281
|
+
else this.leaveChildColumn();
|
|
282
|
+
}
|
|
283
|
+
break;
|
|
284
|
+
case "Home":
|
|
285
|
+
if (this.panelOpen()) {
|
|
286
|
+
event.preventDefault();
|
|
287
|
+
this.setBoundaryActive("first");
|
|
288
|
+
}
|
|
289
|
+
break;
|
|
290
|
+
case "End":
|
|
291
|
+
if (this.panelOpen()) {
|
|
292
|
+
event.preventDefault();
|
|
293
|
+
this.setBoundaryActive("last");
|
|
294
|
+
}
|
|
295
|
+
break;
|
|
296
|
+
case "Enter":
|
|
297
|
+
case " ":
|
|
298
|
+
event.preventDefault();
|
|
299
|
+
if (!this.panelOpen()) {
|
|
300
|
+
this.openPanel();
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
this.commitActiveOption(event);
|
|
304
|
+
break;
|
|
305
|
+
case "Escape":
|
|
306
|
+
if (this.panelOpen()) {
|
|
307
|
+
event.preventDefault();
|
|
308
|
+
this.closePanel();
|
|
309
|
+
this.focus();
|
|
310
|
+
}
|
|
311
|
+
break;
|
|
312
|
+
case "Tab": this.closePanel();
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
activateOption(level, option) {
|
|
316
|
+
if (option.disabled) return;
|
|
317
|
+
this.activeLevel.set(level);
|
|
318
|
+
this.activePath.update((path) => [...path.slice(0, level), option]);
|
|
319
|
+
if (this.expandedPath()[level]?.value !== option.value) this.expandedPath.update((path) => path.slice(0, level));
|
|
320
|
+
}
|
|
321
|
+
handleOptionHover(level, option) {
|
|
322
|
+
if (this.mobile() || option.disabled) return;
|
|
323
|
+
this.activateOption(level, option);
|
|
324
|
+
if (this.hasChildren(option)) this.expandedPath.set(this.activePath().slice(0, level + 1));
|
|
325
|
+
}
|
|
326
|
+
handleOptionClick(level, option, event) {
|
|
327
|
+
if (option.disabled) return;
|
|
328
|
+
this.activateOption(level, option);
|
|
329
|
+
if (this.hasChildren(option) && !this.selectBranches()) {
|
|
330
|
+
if (this.expandedPath()[level]?.value === option.value) this.expandedPath.update((path) => path.slice(0, level));
|
|
331
|
+
else this.expandedPath.set(this.activePath().slice(0, level + 1));
|
|
332
|
+
this.focus();
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
this.selectOption(option, event);
|
|
336
|
+
}
|
|
337
|
+
hasChildren(option) {
|
|
338
|
+
return (option.children?.length ?? 0) > 0;
|
|
339
|
+
}
|
|
340
|
+
isSelected(option) {
|
|
341
|
+
return this.value() === option.value;
|
|
342
|
+
}
|
|
343
|
+
isActive(level, option) {
|
|
344
|
+
return this.activePath()[level]?.value === option.value;
|
|
345
|
+
}
|
|
346
|
+
isInActivePath(option) {
|
|
347
|
+
return this.expandedPath().some((active) => active.value === option.value);
|
|
348
|
+
}
|
|
349
|
+
optionId(level, value) {
|
|
350
|
+
return `${this.panelId}-${level}-${this.sanitizeId(value)}`;
|
|
351
|
+
}
|
|
352
|
+
moveActive(direction) {
|
|
353
|
+
const options = this.enabledOptionsAtLevel(this.activeLevel());
|
|
354
|
+
if (options.length === 0) return;
|
|
355
|
+
const current = this.activePath()[this.activeLevel()];
|
|
356
|
+
const currentIndex = options.findIndex((option) => option.value === current?.value);
|
|
357
|
+
const next = options[currentIndex < 0 ? direction > 0 ? 0 : options.length - 1 : (currentIndex + direction + options.length) % options.length];
|
|
358
|
+
if (next) this.activateOption(this.activeLevel(), next);
|
|
359
|
+
}
|
|
360
|
+
setBoundaryActive(boundary) {
|
|
361
|
+
const options = this.enabledOptionsAtLevel(this.activeLevel());
|
|
362
|
+
const next = boundary === "first" ? options[0] : options.at(-1);
|
|
363
|
+
if (next) this.activateOption(this.activeLevel(), next);
|
|
364
|
+
}
|
|
365
|
+
enterChildColumn() {
|
|
366
|
+
const active = this.resolveOption(this.activePath()[this.activeLevel()] ?? null);
|
|
367
|
+
if (!active || !this.hasChildren(active)) return;
|
|
368
|
+
if (!this.isInActivePath(active)) {
|
|
369
|
+
this.expandedPath.set(this.activePath().slice(0, this.activeLevel() + 1));
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
const child = this.firstEnabled(active.children ?? []);
|
|
373
|
+
if (!child) return;
|
|
374
|
+
const nextLevel = this.activeLevel() + 1;
|
|
375
|
+
this.activeLevel.set(nextLevel);
|
|
376
|
+
this.activePath.update((path) => [...path.slice(0, nextLevel), child]);
|
|
377
|
+
}
|
|
378
|
+
leaveChildColumn() {
|
|
379
|
+
const active = this.activePath()[this.activeLevel()];
|
|
380
|
+
if (active && this.isInActivePath(active)) {
|
|
381
|
+
this.expandedPath.update((path) => path.slice(0, this.activeLevel()));
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
if (this.activeLevel() === 0) return;
|
|
385
|
+
this.activeLevel.update((level) => level - 1);
|
|
386
|
+
this.activePath.update((path) => path.slice(0, this.activeLevel() + 1));
|
|
387
|
+
}
|
|
388
|
+
commitActiveOption(event) {
|
|
389
|
+
const active = this.resolveOption(this.activePath()[this.activeLevel()] ?? null);
|
|
390
|
+
if (!active || active.disabled) return;
|
|
391
|
+
if (this.hasChildren(active) && !this.selectBranches()) {
|
|
392
|
+
this.enterChildColumn();
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
this.selectOption(active, event);
|
|
396
|
+
}
|
|
397
|
+
selectOption(option, originalEvent) {
|
|
398
|
+
this.setValue(option.value, option, originalEvent);
|
|
399
|
+
this.closePanel();
|
|
400
|
+
this.focus();
|
|
401
|
+
}
|
|
402
|
+
setValue(value, option, originalEvent) {
|
|
403
|
+
if (this.value() === value) return;
|
|
404
|
+
this.value.set(value);
|
|
405
|
+
this.onChange(value);
|
|
406
|
+
this.changed.emit({
|
|
407
|
+
originalEvent,
|
|
408
|
+
value,
|
|
409
|
+
option,
|
|
410
|
+
path: value === null ? [] : this.findPathByValue(value)
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
enabledOptionsAtLevel(level) {
|
|
414
|
+
return (level === 0 ? this.options() : this.expandedPath()[level - 1]?.children ?? []).filter((option) => !option.disabled);
|
|
415
|
+
}
|
|
416
|
+
firstEnabled(options) {
|
|
417
|
+
return options.find((option) => !option.disabled) ?? null;
|
|
418
|
+
}
|
|
419
|
+
findPathByValue(value) {
|
|
420
|
+
if (value === null) return [];
|
|
421
|
+
return this.findPath(this.options(), value) ?? [];
|
|
422
|
+
}
|
|
423
|
+
resolveOption(option) {
|
|
424
|
+
if (!option) return null;
|
|
425
|
+
return this.findPathByValue(option.value).at(-1) ?? option;
|
|
426
|
+
}
|
|
427
|
+
findPath(options, value, path = []) {
|
|
428
|
+
for (const option of options) {
|
|
429
|
+
const nextPath = [...path, option];
|
|
430
|
+
if (option.value === value) return nextPath;
|
|
431
|
+
const childPath = this.findPath(option.children ?? [], value, nextPath);
|
|
432
|
+
if (childPath) return childPath;
|
|
433
|
+
}
|
|
434
|
+
return null;
|
|
435
|
+
}
|
|
436
|
+
sanitizeId(value) {
|
|
437
|
+
const readable = value.toLowerCase().replace(/[^a-z0-9_-]+/g, "-");
|
|
438
|
+
const exact = Array.from(value, (character) => (character.codePointAt(0) ?? 0).toString(16)).join("-");
|
|
439
|
+
return `${readable || "option"}--${exact || "empty"}`;
|
|
440
|
+
}
|
|
441
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
442
|
+
minVersion: "12.0.0",
|
|
443
|
+
version: "22.2.2",
|
|
444
|
+
ngImport: i0,
|
|
445
|
+
type: AerisCascadeSelect,
|
|
446
|
+
deps: [],
|
|
447
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
448
|
+
});
|
|
449
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
450
|
+
minVersion: "17.0.0",
|
|
451
|
+
version: "22.2.2",
|
|
452
|
+
type: AerisCascadeSelect,
|
|
453
|
+
isStandalone: true,
|
|
454
|
+
selector: "aeris-cascade-select",
|
|
455
|
+
inputs: {
|
|
456
|
+
value: {
|
|
457
|
+
classPropertyName: "value",
|
|
458
|
+
publicName: "value",
|
|
459
|
+
isSignal: true,
|
|
460
|
+
isRequired: false,
|
|
461
|
+
transformFunction: null
|
|
462
|
+
},
|
|
463
|
+
options: {
|
|
464
|
+
classPropertyName: "options",
|
|
465
|
+
publicName: "options",
|
|
466
|
+
isSignal: true,
|
|
467
|
+
isRequired: false,
|
|
468
|
+
transformFunction: null
|
|
469
|
+
},
|
|
470
|
+
inputId: {
|
|
471
|
+
classPropertyName: "inputId",
|
|
472
|
+
publicName: "inputId",
|
|
473
|
+
isSignal: true,
|
|
474
|
+
isRequired: false,
|
|
475
|
+
transformFunction: null
|
|
476
|
+
},
|
|
477
|
+
name: {
|
|
478
|
+
classPropertyName: "name",
|
|
479
|
+
publicName: "name",
|
|
480
|
+
isSignal: true,
|
|
481
|
+
isRequired: false,
|
|
482
|
+
transformFunction: null
|
|
483
|
+
},
|
|
484
|
+
placeholder: {
|
|
485
|
+
classPropertyName: "placeholder",
|
|
486
|
+
publicName: "placeholder",
|
|
487
|
+
isSignal: true,
|
|
488
|
+
isRequired: false,
|
|
489
|
+
transformFunction: null
|
|
490
|
+
},
|
|
491
|
+
ariaLabel: {
|
|
492
|
+
classPropertyName: "ariaLabel",
|
|
493
|
+
publicName: "ariaLabel",
|
|
494
|
+
isSignal: true,
|
|
495
|
+
isRequired: false,
|
|
496
|
+
transformFunction: null
|
|
497
|
+
},
|
|
498
|
+
ariaLabelledBy: {
|
|
499
|
+
classPropertyName: "ariaLabelledBy",
|
|
500
|
+
publicName: "ariaLabelledBy",
|
|
501
|
+
isSignal: true,
|
|
502
|
+
isRequired: false,
|
|
503
|
+
transformFunction: null
|
|
504
|
+
},
|
|
505
|
+
ariaDescribedBy: {
|
|
506
|
+
classPropertyName: "ariaDescribedBy",
|
|
507
|
+
publicName: "ariaDescribedBy",
|
|
508
|
+
isSignal: true,
|
|
509
|
+
isRequired: false,
|
|
510
|
+
transformFunction: null
|
|
511
|
+
},
|
|
512
|
+
clearButtonAriaLabel: {
|
|
513
|
+
classPropertyName: "clearButtonAriaLabel",
|
|
514
|
+
publicName: "clearButtonAriaLabel",
|
|
515
|
+
isSignal: true,
|
|
516
|
+
isRequired: false,
|
|
517
|
+
transformFunction: null
|
|
518
|
+
},
|
|
519
|
+
emptyMessage: {
|
|
520
|
+
classPropertyName: "emptyMessage",
|
|
521
|
+
publicName: "emptyMessage",
|
|
522
|
+
isSignal: true,
|
|
523
|
+
isRequired: false,
|
|
524
|
+
transformFunction: null
|
|
525
|
+
},
|
|
526
|
+
size: {
|
|
527
|
+
classPropertyName: "size",
|
|
528
|
+
publicName: "size",
|
|
529
|
+
isSignal: true,
|
|
530
|
+
isRequired: false,
|
|
531
|
+
transformFunction: null
|
|
532
|
+
},
|
|
533
|
+
appearance: {
|
|
534
|
+
classPropertyName: "appearance",
|
|
535
|
+
publicName: "appearance",
|
|
536
|
+
isSignal: true,
|
|
537
|
+
isRequired: false,
|
|
538
|
+
transformFunction: null
|
|
539
|
+
},
|
|
540
|
+
separator: {
|
|
541
|
+
classPropertyName: "separator",
|
|
542
|
+
publicName: "separator",
|
|
543
|
+
isSignal: true,
|
|
544
|
+
isRequired: false,
|
|
545
|
+
transformFunction: null
|
|
546
|
+
},
|
|
547
|
+
panelMaxHeight: {
|
|
548
|
+
classPropertyName: "panelMaxHeight",
|
|
549
|
+
publicName: "panelMaxHeight",
|
|
550
|
+
isSignal: true,
|
|
551
|
+
isRequired: false,
|
|
552
|
+
transformFunction: null
|
|
553
|
+
},
|
|
554
|
+
appendTo: {
|
|
555
|
+
classPropertyName: "appendTo",
|
|
556
|
+
publicName: "appendTo",
|
|
557
|
+
isSignal: true,
|
|
558
|
+
isRequired: false,
|
|
559
|
+
transformFunction: null
|
|
560
|
+
},
|
|
561
|
+
viewportMargin: {
|
|
562
|
+
classPropertyName: "viewportMargin",
|
|
563
|
+
publicName: "viewportMargin",
|
|
564
|
+
isSignal: true,
|
|
565
|
+
isRequired: false,
|
|
566
|
+
transformFunction: null
|
|
567
|
+
},
|
|
568
|
+
invalid: {
|
|
569
|
+
classPropertyName: "invalid",
|
|
570
|
+
publicName: "invalid",
|
|
571
|
+
isSignal: true,
|
|
572
|
+
isRequired: false,
|
|
573
|
+
transformFunction: null
|
|
574
|
+
},
|
|
575
|
+
touched: {
|
|
576
|
+
classPropertyName: "touched",
|
|
577
|
+
publicName: "touched",
|
|
578
|
+
isSignal: true,
|
|
579
|
+
isRequired: false,
|
|
580
|
+
transformFunction: null
|
|
581
|
+
},
|
|
582
|
+
disabled: {
|
|
583
|
+
classPropertyName: "disabled",
|
|
584
|
+
publicName: "disabled",
|
|
585
|
+
isSignal: true,
|
|
586
|
+
isRequired: false,
|
|
587
|
+
transformFunction: null
|
|
588
|
+
},
|
|
589
|
+
required: {
|
|
590
|
+
classPropertyName: "required",
|
|
591
|
+
publicName: "required",
|
|
592
|
+
isSignal: true,
|
|
593
|
+
isRequired: false,
|
|
594
|
+
transformFunction: null
|
|
595
|
+
},
|
|
596
|
+
fluid: {
|
|
597
|
+
classPropertyName: "fluid",
|
|
598
|
+
publicName: "fluid",
|
|
599
|
+
isSignal: true,
|
|
600
|
+
isRequired: false,
|
|
601
|
+
transformFunction: null
|
|
602
|
+
},
|
|
603
|
+
clearable: {
|
|
604
|
+
classPropertyName: "clearable",
|
|
605
|
+
publicName: "clearable",
|
|
606
|
+
isSignal: true,
|
|
607
|
+
isRequired: false,
|
|
608
|
+
transformFunction: null
|
|
609
|
+
},
|
|
610
|
+
selectBranches: {
|
|
611
|
+
classPropertyName: "selectBranches",
|
|
612
|
+
publicName: "selectBranches",
|
|
613
|
+
isSignal: true,
|
|
614
|
+
isRequired: false,
|
|
615
|
+
transformFunction: null
|
|
616
|
+
}
|
|
617
|
+
},
|
|
618
|
+
outputs: {
|
|
619
|
+
value: "valueChange",
|
|
620
|
+
changed: "changed",
|
|
621
|
+
cleared: "cleared",
|
|
622
|
+
opened: "opened",
|
|
623
|
+
closed: "closed",
|
|
624
|
+
focused: "focused",
|
|
625
|
+
blurred: "blurred",
|
|
626
|
+
touch: "touch"
|
|
627
|
+
},
|
|
628
|
+
host: { properties: { "attr.data-fluid": "fluid() || null" } },
|
|
629
|
+
providers: [{
|
|
630
|
+
provide: NG_VALUE_ACCESSOR,
|
|
631
|
+
useExisting: forwardRef(() => AerisCascadeSelect),
|
|
632
|
+
multi: true
|
|
633
|
+
}],
|
|
634
|
+
queries: [{
|
|
635
|
+
propertyName: "optionTemplate",
|
|
636
|
+
first: true,
|
|
637
|
+
predicate: AerisCascadeSelectOptionTemplate,
|
|
638
|
+
descendants: true,
|
|
639
|
+
isSignal: true
|
|
640
|
+
}, {
|
|
641
|
+
propertyName: "emptyTemplate",
|
|
642
|
+
first: true,
|
|
643
|
+
predicate: AerisCascadeSelectEmptyTemplate,
|
|
644
|
+
descendants: true,
|
|
645
|
+
isSignal: true
|
|
646
|
+
}],
|
|
647
|
+
viewQueries: [
|
|
648
|
+
{
|
|
649
|
+
propertyName: "controlElement",
|
|
650
|
+
first: true,
|
|
651
|
+
predicate: ["control"],
|
|
652
|
+
descendants: true,
|
|
653
|
+
isSignal: true
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
propertyName: "triggerElement",
|
|
657
|
+
first: true,
|
|
658
|
+
predicate: ["trigger"],
|
|
659
|
+
descendants: true,
|
|
660
|
+
isSignal: true
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
propertyName: "panels",
|
|
664
|
+
predicate: ["optionsPanel"],
|
|
665
|
+
descendants: true,
|
|
666
|
+
isSignal: true
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
propertyName: "panelPortals",
|
|
670
|
+
predicate: ɵAerisAppendTo,
|
|
671
|
+
descendants: true,
|
|
672
|
+
isSignal: true
|
|
673
|
+
}
|
|
674
|
+
],
|
|
675
|
+
ngImport: i0,
|
|
676
|
+
template: `
|
|
677
|
+
<ng-template #optionList let-items let-level="level">
|
|
678
|
+
<ul class="aeris-cascade-select__options" role="presentation">
|
|
679
|
+
@for (option of items; track option.value; let index = $index) {
|
|
680
|
+
<li #optionAnchor class="aeris-cascade-select__item" role="none">
|
|
681
|
+
<button
|
|
682
|
+
type="button"
|
|
683
|
+
role="treeitem"
|
|
684
|
+
tabindex="-1"
|
|
685
|
+
class="aeris-cascade-select__option"
|
|
686
|
+
[id]="optionId(level, option.value)"
|
|
687
|
+
[disabled]="option.disabled"
|
|
688
|
+
[attr.aria-label]="option.label"
|
|
689
|
+
[attr.aria-level]="level + 1"
|
|
690
|
+
[attr.aria-posinset]="index + 1"
|
|
691
|
+
[attr.aria-setsize]="items.length"
|
|
692
|
+
[attr.aria-selected]="isSelected(option)"
|
|
693
|
+
[attr.aria-expanded]="hasChildren(option) ? isInActivePath(option) : null"
|
|
694
|
+
[attr.aria-owns]="
|
|
695
|
+
hasChildren(option) && isInActivePath(option)
|
|
696
|
+
? optionId(level, option.value) + '-children'
|
|
697
|
+
: null
|
|
698
|
+
"
|
|
699
|
+
[attr.data-active]="isActive(level, option) || null"
|
|
700
|
+
[attr.data-has-children]="hasChildren(option) || null"
|
|
701
|
+
(mouseenter)="handleOptionHover(level, option)"
|
|
702
|
+
(mousedown)="$event.preventDefault()"
|
|
703
|
+
(click)="handleOptionClick(level, option, $event)"
|
|
704
|
+
>
|
|
705
|
+
@if (optionTemplate(); as template) {
|
|
706
|
+
<ng-container
|
|
707
|
+
[ngTemplateOutlet]="template.template"
|
|
708
|
+
[ngTemplateOutletContext]="{
|
|
709
|
+
$implicit: option,
|
|
710
|
+
option,
|
|
711
|
+
active: isActive(level, option),
|
|
712
|
+
selected: isSelected(option),
|
|
713
|
+
level,
|
|
714
|
+
hasChildren: hasChildren(option),
|
|
715
|
+
}"
|
|
716
|
+
/>
|
|
717
|
+
} @else {
|
|
718
|
+
<span class="aeris-cascade-select__option-copy">
|
|
719
|
+
<span>{{ option.label }}</span>
|
|
720
|
+
@if (option.description) {
|
|
721
|
+
<small>{{ option.description }}</small>
|
|
722
|
+
}
|
|
723
|
+
</span>
|
|
724
|
+
@if (hasChildren(option)) {
|
|
725
|
+
<span class="aeris-cascade-select__option-chevron" aria-hidden="true"></span>
|
|
233
726
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
}
|
|
262
|
-
isInActivePath(option) {
|
|
263
|
-
return this.activePath().some((active) => active.value === option.value);
|
|
264
|
-
}
|
|
265
|
-
optionId(level, value) {
|
|
266
|
-
return `${this.panelId}-${level}-${this.sanitizeId(value)}`;
|
|
267
|
-
}
|
|
268
|
-
columnLabel(level) {
|
|
269
|
-
return level === 0 ? 'Root options' : `Level ${level + 1} options`;
|
|
270
|
-
}
|
|
271
|
-
columnKey(column, index) {
|
|
272
|
-
return `${index}-${column.parent?.value ?? 'root'}`;
|
|
273
|
-
}
|
|
274
|
-
moveActive(direction) {
|
|
275
|
-
const options = this.enabledOptionsAtLevel(this.activeLevel());
|
|
276
|
-
if (options.length === 0)
|
|
277
|
-
return;
|
|
278
|
-
const current = this.activePath()[this.activeLevel()];
|
|
279
|
-
const currentIndex = options.findIndex((option) => option.value === current?.value);
|
|
280
|
-
const nextIndex = currentIndex < 0
|
|
281
|
-
? direction > 0
|
|
282
|
-
? 0
|
|
283
|
-
: options.length - 1
|
|
284
|
-
: (currentIndex + direction + options.length) % options.length;
|
|
285
|
-
const next = options[nextIndex];
|
|
286
|
-
if (next)
|
|
287
|
-
this.activateOption(this.activeLevel(), next);
|
|
288
|
-
}
|
|
289
|
-
setBoundaryActive(boundary) {
|
|
290
|
-
const options = this.enabledOptionsAtLevel(this.activeLevel());
|
|
291
|
-
const next = boundary === 'first' ? options[0] : options.at(-1);
|
|
292
|
-
if (next)
|
|
293
|
-
this.activateOption(this.activeLevel(), next);
|
|
294
|
-
}
|
|
295
|
-
enterChildColumn() {
|
|
296
|
-
const active = this.resolveOption(this.activePath()[this.activeLevel()] ?? null);
|
|
297
|
-
if (!active || !this.hasChildren(active))
|
|
298
|
-
return;
|
|
299
|
-
const child = this.firstEnabled(active.children ?? []);
|
|
300
|
-
if (!child)
|
|
301
|
-
return;
|
|
302
|
-
const nextLevel = this.activeLevel() + 1;
|
|
303
|
-
this.activeLevel.set(nextLevel);
|
|
304
|
-
this.activePath.update((path) => [...path.slice(0, nextLevel), child]);
|
|
305
|
-
}
|
|
306
|
-
leaveChildColumn() {
|
|
307
|
-
if (this.activeLevel() === 0)
|
|
308
|
-
return;
|
|
309
|
-
this.activeLevel.update((level) => level - 1);
|
|
310
|
-
this.activePath.update((path) => path.slice(0, this.activeLevel() + 1));
|
|
311
|
-
}
|
|
312
|
-
commitActiveOption(event) {
|
|
313
|
-
const active = this.resolveOption(this.activePath()[this.activeLevel()] ?? null);
|
|
314
|
-
if (!active || active.disabled)
|
|
315
|
-
return;
|
|
316
|
-
if (this.hasChildren(active) && !this.selectBranches()) {
|
|
317
|
-
this.enterChildColumn();
|
|
318
|
-
return;
|
|
319
|
-
}
|
|
320
|
-
this.selectOption(active, event);
|
|
321
|
-
}
|
|
322
|
-
selectOption(option, originalEvent) {
|
|
323
|
-
this.setValue(option.value, option, originalEvent);
|
|
324
|
-
this.closePanel();
|
|
325
|
-
this.focus();
|
|
326
|
-
}
|
|
327
|
-
setValue(value, option, originalEvent) {
|
|
328
|
-
if (this.value() === value)
|
|
329
|
-
return;
|
|
330
|
-
this.value.set(value);
|
|
331
|
-
this.onChange(value);
|
|
332
|
-
this.changed.emit({
|
|
333
|
-
originalEvent,
|
|
334
|
-
value,
|
|
335
|
-
option,
|
|
336
|
-
path: value === null ? [] : this.findPathByValue(value),
|
|
337
|
-
});
|
|
338
|
-
}
|
|
339
|
-
enabledOptionsAtLevel(level) {
|
|
340
|
-
return (this.columns()[level]?.options ?? []).filter((option) => !option.disabled);
|
|
341
|
-
}
|
|
342
|
-
firstEnabled(options) {
|
|
343
|
-
return options.find((option) => !option.disabled) ?? null;
|
|
344
|
-
}
|
|
345
|
-
findPathByValue(value) {
|
|
346
|
-
if (value === null)
|
|
347
|
-
return [];
|
|
348
|
-
return this.findPath(this.options(), value) ?? [];
|
|
349
|
-
}
|
|
350
|
-
resolveOption(option) {
|
|
351
|
-
if (!option)
|
|
352
|
-
return null;
|
|
353
|
-
return this.findPathByValue(option.value).at(-1) ?? option;
|
|
354
|
-
}
|
|
355
|
-
findPath(options, value, path = []) {
|
|
356
|
-
for (const option of options) {
|
|
357
|
-
const nextPath = [...path, option];
|
|
358
|
-
if (option.value === value)
|
|
359
|
-
return nextPath;
|
|
360
|
-
const childPath = this.findPath(option.children ?? [], value, nextPath);
|
|
361
|
-
if (childPath)
|
|
362
|
-
return childPath;
|
|
727
|
+
}
|
|
728
|
+
</button>
|
|
729
|
+
@if (hasChildren(option) && isInActivePath(option)) {
|
|
730
|
+
<div
|
|
731
|
+
#optionsPanel
|
|
732
|
+
class="aeris-cascade-select__submenu"
|
|
733
|
+
role="group"
|
|
734
|
+
[id]="optionId(level, option.value) + '-children'"
|
|
735
|
+
[attr.aria-label]="option.label"
|
|
736
|
+
[aerisInternalAppendTo]="submenuTarget()"
|
|
737
|
+
[aerisInternalAppendToDismiss]="dismissOverlay"
|
|
738
|
+
[aerisInternalAppendToAnchor]="optionAnchor"
|
|
739
|
+
[aerisInternalAppendToPositionSelf]="!mobile()"
|
|
740
|
+
[aerisInternalAppendToPlacement]="submenuPlacement()"
|
|
741
|
+
aerisInternalAppendToAlignment="start"
|
|
742
|
+
[aerisInternalAppendToOffset]="1"
|
|
743
|
+
[aerisInternalAppendToCollisionPadding]="viewportMargin()"
|
|
744
|
+
(aerisInternalAppendToOutside)="handleOutside($event)"
|
|
745
|
+
[style.max-height]="mobile() ? null : panelMaxHeight()"
|
|
746
|
+
>
|
|
747
|
+
<ng-container
|
|
748
|
+
[ngTemplateOutlet]="optionList"
|
|
749
|
+
[ngTemplateOutletContext]="{ $implicit: option.children, level: level + 1 }"
|
|
750
|
+
/>
|
|
751
|
+
</div>
|
|
752
|
+
}
|
|
753
|
+
</li>
|
|
363
754
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
sanitizeId(value) {
|
|
367
|
-
const sanitized = value.toLocaleLowerCase().replace(/[^a-z0-9_-]+/g, '-');
|
|
368
|
-
return sanitized || 'option';
|
|
369
|
-
}
|
|
370
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisCascadeSelect, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
371
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.6", type: AerisCascadeSelect, isStandalone: true, selector: "aeris-cascade-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "inputId", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "ariaLabelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "ariaDescribedby", isSignal: true, isRequired: false, transformFunction: null }, clearButtonAriaLabel: { classPropertyName: "clearButtonAriaLabel", publicName: "clearButtonAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, emptyMessage: { classPropertyName: "emptyMessage", publicName: "emptyMessage", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, separator: { classPropertyName: "separator", publicName: "separator", isSignal: true, isRequired: false, transformFunction: null }, panelMaxHeight: { classPropertyName: "panelMaxHeight", publicName: "panelMaxHeight", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, clearable: { classPropertyName: "clearable", publicName: "clearable", isSignal: true, isRequired: false, transformFunction: null }, selectBranches: { classPropertyName: "selectBranches", publicName: "selectBranches", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", changed: "changed", cleared: "cleared", opened: "opened", closed: "closed", focused: "focused", blurred: "blurred", touch: "touch" }, host: { properties: { "attr.data-fluid": "fluid() || null" } }, providers: [
|
|
372
|
-
{
|
|
373
|
-
provide: NG_VALUE_ACCESSOR,
|
|
374
|
-
useExisting: forwardRef(() => AerisCascadeSelect),
|
|
375
|
-
multi: true,
|
|
376
|
-
},
|
|
377
|
-
], queries: [{ propertyName: "optionTemplate", first: true, predicate: AerisCascadeSelectOptionTemplate, descendants: true, isSignal: true }, { propertyName: "emptyTemplate", first: true, predicate: AerisCascadeSelectEmptyTemplate, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "triggerElement", first: true, predicate: ["trigger"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
755
|
+
</ul>
|
|
756
|
+
</ng-template>
|
|
378
757
|
<div
|
|
379
758
|
class="aeris-cascade-select"
|
|
380
759
|
[attr.data-size]="size()"
|
|
381
760
|
[attr.data-appearance]="appearance()"
|
|
382
761
|
[attr.data-open]="open() || null"
|
|
383
|
-
[attr.data-invalid]="
|
|
762
|
+
[attr.data-invalid]="displayInvalid() || null"
|
|
384
763
|
[attr.data-disabled]="effectiveDisabled() || null"
|
|
385
764
|
[attr.data-fluid]="fluid() || null"
|
|
386
765
|
(focusout)="handleFocusOut($event)"
|
|
@@ -389,21 +768,21 @@ class AerisCascadeSelect {
|
|
|
389
768
|
<input type="hidden" [name]="name()" [value]="value()" />
|
|
390
769
|
}
|
|
391
770
|
|
|
392
|
-
<div class="aeris-cascade-select__control">
|
|
771
|
+
<div #control class="aeris-cascade-select__control">
|
|
393
772
|
<button
|
|
394
773
|
#trigger
|
|
395
774
|
class="aeris-cascade-select__trigger"
|
|
396
775
|
type="button"
|
|
397
776
|
role="combobox"
|
|
398
|
-
aria-haspopup="
|
|
777
|
+
aria-haspopup="tree"
|
|
399
778
|
[id]="resolvedInputId()"
|
|
400
779
|
[attr.aria-expanded]="open()"
|
|
401
780
|
[attr.aria-controls]="panelId"
|
|
402
781
|
[attr.aria-activedescendant]="open() ? activeOptionId() : null"
|
|
403
782
|
[attr.aria-label]="ariaLabel() || null"
|
|
404
|
-
[attr.aria-labelledby]="
|
|
405
|
-
[attr.aria-describedby]="
|
|
406
|
-
[attr.aria-invalid]="
|
|
783
|
+
[attr.aria-labelledby]="ariaLabelledBy() || null"
|
|
784
|
+
[attr.aria-describedby]="ariaDescribedBy() || null"
|
|
785
|
+
[attr.aria-invalid]="displayInvalid() || null"
|
|
407
786
|
[attr.aria-required]="required() || null"
|
|
408
787
|
[disabled]="effectiveDisabled()"
|
|
409
788
|
(click)="toggle()"
|
|
@@ -438,20 +817,21 @@ class AerisCascadeSelect {
|
|
|
438
817
|
</div>
|
|
439
818
|
|
|
440
819
|
@if (open()) {
|
|
441
|
-
<button
|
|
442
|
-
type="button"
|
|
443
|
-
class="aeris-cascade-select__dismiss"
|
|
444
|
-
tabindex="-1"
|
|
445
|
-
aria-hidden="true"
|
|
446
|
-
(click)="closePanel()"
|
|
447
|
-
></button>
|
|
448
|
-
|
|
449
820
|
<div
|
|
821
|
+
#optionsPanel
|
|
450
822
|
class="aeris-cascade-select__panel"
|
|
823
|
+
[aerisInternalAppendTo]="appendTo()"
|
|
824
|
+
[aerisInternalAppendToDismiss]="dismissOverlay"
|
|
825
|
+
[aerisInternalAppendToAnchor]="controlElement()?.nativeElement ?? null"
|
|
826
|
+
[aerisInternalAppendToMatchWidth]="true"
|
|
827
|
+
[aerisInternalAppendToCollisionPadding]="viewportMargin()"
|
|
828
|
+
(aerisInternalAppendToOutside)="handleOutside($event)"
|
|
451
829
|
[id]="panelId"
|
|
830
|
+
role="tree"
|
|
831
|
+
[attr.aria-label]="ariaLabel() || 'Options'"
|
|
452
832
|
[style.max-height]="panelMaxHeight()"
|
|
453
833
|
>
|
|
454
|
-
@if (
|
|
834
|
+
@if (options().length === 0) {
|
|
455
835
|
<div class="aeris-cascade-select__state">
|
|
456
836
|
@if (emptyTemplate(); as template) {
|
|
457
837
|
<ng-container [ngTemplateOutlet]="template.template" />
|
|
@@ -460,69 +840,143 @@ class AerisCascadeSelect {
|
|
|
460
840
|
}
|
|
461
841
|
</div>
|
|
462
842
|
} @else {
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
[attr.aria-label]="columnLabel(level)"
|
|
468
|
-
>
|
|
469
|
-
@for (option of column.options; track option.value) {
|
|
470
|
-
<button
|
|
471
|
-
type="button"
|
|
472
|
-
role="option"
|
|
473
|
-
class="aeris-cascade-select__option"
|
|
474
|
-
[id]="optionId(level, option.value)"
|
|
475
|
-
[disabled]="option.disabled"
|
|
476
|
-
[attr.aria-selected]="isSelected(option)"
|
|
477
|
-
[attr.aria-expanded]="hasChildren(option) ? isInActivePath(option) : null"
|
|
478
|
-
[attr.data-active]="isActive(level, option) || null"
|
|
479
|
-
[attr.data-has-children]="hasChildren(option) || null"
|
|
480
|
-
(mouseenter)="activateOption(level, option)"
|
|
481
|
-
(focus)="activateOption(level, option)"
|
|
482
|
-
(click)="handleOptionClick(level, option, $event)"
|
|
483
|
-
>
|
|
484
|
-
@if (optionTemplate(); as template) {
|
|
485
|
-
<ng-container
|
|
486
|
-
[ngTemplateOutlet]="template.template"
|
|
487
|
-
[ngTemplateOutletContext]="{
|
|
488
|
-
$implicit: option,
|
|
489
|
-
option,
|
|
490
|
-
active: isActive(level, option),
|
|
491
|
-
selected: isSelected(option),
|
|
492
|
-
level,
|
|
493
|
-
hasChildren: hasChildren(option)
|
|
494
|
-
}"
|
|
495
|
-
/>
|
|
496
|
-
} @else {
|
|
497
|
-
<span class="aeris-cascade-select__option-copy">
|
|
498
|
-
<span>{{ option.label }}</span>
|
|
499
|
-
@if (option.description) {
|
|
500
|
-
<small>{{ option.description }}</small>
|
|
501
|
-
}
|
|
502
|
-
</span>
|
|
503
|
-
@if (hasChildren(option)) {
|
|
504
|
-
<span class="aeris-cascade-select__option-chevron" aria-hidden="true"></span>
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
</button>
|
|
508
|
-
}
|
|
509
|
-
</div>
|
|
510
|
-
}
|
|
843
|
+
<ng-container
|
|
844
|
+
[ngTemplateOutlet]="optionList"
|
|
845
|
+
[ngTemplateOutletContext]="{ $implicit: options(), level: 0 }"
|
|
846
|
+
/>
|
|
511
847
|
}
|
|
512
848
|
</div>
|
|
513
849
|
}
|
|
514
850
|
</div>
|
|
515
|
-
`,
|
|
516
|
-
|
|
517
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: AerisCascadeSelect, decorators: [{
|
|
518
|
-
|
|
519
|
-
|
|
851
|
+
`,
|
|
852
|
+
isInline: true,
|
|
853
|
+
styles: [":host{--_aeris-chevron-mask: var( --aeris-icon-chevron, url(data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%3E%3Cpath%20d=%27M7%209.5%2012%2014.5%2017%209.5%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%272.4%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27/%3E%3C/svg%3E) );display:inline-block;min-width:0;width:14rem;max-width:100%;color:var(--aeris-cascade-select-text, var(--aeris-text, #111111));font:inherit}:host([data-fluid]){width:100%}.aeris-cascade-select{--aeris-cascade-select-height: var(--aeris-control-height, 2.625rem);--aeris-cascade-select-font-size: var(--aeris-font-size-lg, .875rem);--aeris-cascade-select-padding: var(--aeris-control-padding-x, .75rem);--aeris-cascade-select-density-gap: var(--aeris-density-gap, .5rem);position:relative;width:100%}.aeris-cascade-select[data-size=xs]{--aeris-cascade-select-height: calc(var(--aeris-control-height, 2.625rem) - .875rem);--aeris-cascade-select-font-size: var(--aeris-font-size-sm, .75rem);--aeris-cascade-select-padding: calc(var(--aeris-control-padding-x, .75rem) * .75)}.aeris-cascade-select[data-size=sm]{--aeris-cascade-select-height: calc(var(--aeris-control-height, 2.625rem) - .5rem);--aeris-cascade-select-font-size: var(--aeris-font-size-md, .8125rem);--aeris-cascade-select-padding: calc(var(--aeris-control-padding-x, .75rem) * .85)}.aeris-cascade-select[data-size=lg]{--aeris-cascade-select-height: calc(var(--aeris-control-height, 2.625rem) + .5rem);--aeris-cascade-select-font-size: var(--aeris-font-size-xl, .9375rem);--aeris-cascade-select-padding: calc(var(--aeris-control-padding-x, .75rem) * 1.15)}.aeris-cascade-select__control{position:relative}.aeris-cascade-select__trigger{width:100%;min-height:var(--aeris-cascade-select-height);display:flex;align-items:center;gap:calc(var(--aeris-cascade-select-density-gap) + .25rem);padding:0 2.75rem 0 var(--aeris-cascade-select-padding);border:1px solid var(--aeris-cascade-select-border, var(--aeris-border, #efefef));border-radius:var(--aeris-cascade-select-radius, var(--aeris-radius-control, var(--aeris-radius-sm, .4375rem)));background:var(--aeris-cascade-select-background, var(--aeris-surface, #fff));color:inherit;font:inherit;font-size:var(--aeris-cascade-select-font-size);line-height:1.35;text-align:left;cursor:pointer;transition:border-color var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease),background-color var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease),box-shadow var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease)}.aeris-cascade-select__control:has(.aeris-cascade-select__clear) .aeris-cascade-select__trigger{padding-right:4.5rem}.aeris-cascade-select[data-appearance=filled] .aeris-cascade-select__trigger{border-color:transparent;background:var(--aeris-cascade-select-filled-background, var(--aeris-surface-2, #f3f3f3))}.aeris-cascade-select[data-open] .aeris-cascade-select__trigger{border-color:var(--aeris-cascade-select-hover-border, var(--aeris-control-hover-border, var(--aeris-primary, #111111)))}@media(hover:hover){.aeris-cascade-select__trigger:hover{border-color:var(--aeris-cascade-select-hover-border, var(--aeris-control-hover-border, var(--aeris-primary, #111111)))}}.aeris-cascade-select__trigger:focus-visible{outline:0;border-color:var(--aeris-cascade-select-focus, var(--aeris-control-focus-border, var(--aeris-focus, #111111)));box-shadow:0 0 0 var(--aeris-focus-ring-width, 3px) var(--aeris-control-focus-ring-color, var(--aeris-focus-ring-color, transparent))}.aeris-cascade-select[data-invalid] .aeris-cascade-select__trigger{border-color:var(--aeris-control-invalid-border, var(--aeris-danger, #c81e2a))}.aeris-cascade-select[data-invalid] .aeris-cascade-select__trigger:focus-visible{box-shadow:0 0 0 var(--aeris-focus-ring-width, 3px) var(--aeris-control-invalid-focus-ring-color, transparent)}.aeris-cascade-select[data-disabled] .aeris-cascade-select__trigger{opacity:var(--aeris-disabled-opacity, .5);cursor:not-allowed}.aeris-cascade-select__value{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aeris-cascade-select__placeholder{color:var(--aeris-cascade-select-placeholder, var(--aeris-text-2, #454545))}.aeris-cascade-select__chevron,.aeris-cascade-select__option-chevron{position:relative;width:1rem;height:1rem}.aeris-cascade-select__chevron{position:absolute;top:50%;right:var(--aeris-cascade-select-padding);color:var(--aeris-cascade-select-icon, var(--aeris-text-2, #454545));transform:translateY(-50%);pointer-events:none}.aeris-cascade-select__chevron:before,.aeris-cascade-select__option-chevron:before{position:absolute;top:50%;left:50%;width:1rem;height:1rem;background:currentColor;content:\"\";transform:translate(-50%,-50%);transition:transform var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease);-webkit-mask:var(--_aeris-chevron-mask) center/100% 100% no-repeat;mask:var(--_aeris-chevron-mask) center/100% 100% no-repeat}.aeris-cascade-select[data-open] .aeris-cascade-select__chevron:before{transform:translate(-50%,-50%) rotate(180deg)}.aeris-cascade-select__clear{position:absolute;top:50%;right:2.125rem;width:1.5rem;height:1.5rem;display:grid;place-items:center;padding:0;border:0;border-radius:var(--aeris-radius-control, var(--aeris-radius-sm, .4375rem));background:transparent;color:var(--aeris-cascade-select-icon, var(--aeris-text-2, #454545));transform:translateY(-50%);cursor:pointer}.aeris-cascade-select__clear:focus-visible{background:var(--aeris-surface-2, #f3f3f3);color:var(--aeris-text, #111111)}@media(hover:hover){.aeris-cascade-select__clear:hover{background:var(--aeris-surface-2, #f3f3f3);color:var(--aeris-text, #111111)}}.aeris-cascade-select__clear:focus-visible{outline:var(--aeris-focus-ring-width, 3px) solid var(--aeris-focus, #111111);outline-offset:1px}.aeris-cascade-select__clear>span{width:var(--aeris-icon-size, 1rem);height:var(--aeris-icon-size, 1rem);background:currentColor;-webkit-mask:var(--aeris-icon-close) center/100% 100% no-repeat;mask:var(--aeris-icon-close) center/100% 100% no-repeat}.aeris-cascade-select__panel,.aeris-cascade-select__submenu{box-sizing:border-box;position:absolute;z-index:90;top:calc(100% + .4375rem);left:0;width:var(--aeris-cascade-select-submenu-width, 13rem);max-width:calc(100vw - 1rem);display:block;overflow:auto;scrollbar-color:var(--aeris-border, #efefef) transparent;scrollbar-width:thin;padding-block:var(--aeris-overlay-padding, calc(var(--aeris-cascade-select-density-gap) * .75));border:1px solid var(--aeris-cascade-select-panel-border, var(--aeris-border));border-radius:var(--aeris-cascade-select-panel-radius, var(--aeris-radius-overlay, var(--aeris-radius-md, .6875rem)));background:var(--aeris-cascade-select-panel-background, var(--aeris-surface, #fff));box-shadow:var(--aeris-cascade-select-panel-shadow, var(--aeris-overlay-shadow, var(--aeris-shadow-lg, 0 18px 48px rgba(0, 0, 0, .18))))}.aeris-cascade-select__panel::-webkit-scrollbar{width:.75rem;height:.75rem}.aeris-cascade-select__panel::-webkit-scrollbar-track,.aeris-cascade-select__panel::-webkit-scrollbar-corner{background:transparent}.aeris-cascade-select__panel::-webkit-scrollbar-thumb{border:3px solid transparent;border-radius:var(--aeris-radius-pill, 999px);background:var(--aeris-border, #efefef);background-clip:content-box}.aeris-cascade-select__options{display:grid;align-content:start;gap:calc(var(--aeris-cascade-select-density-gap) * .25);margin:0;padding:0;list-style:none}.aeris-cascade-select__item{box-sizing:border-box;min-width:0;padding-inline:var(--aeris-overlay-padding, calc(var(--aeris-cascade-select-density-gap) * .75))}.aeris-cascade-select__submenu{animation:aeris-overlay-enter var(--aeris-motion-normal, .15s) var(--aeris-ease-enter, ease-out) both}.aeris-cascade-select__option{width:100%;min-height:var(--aeris-item-height, 2.5rem);display:flex;align-items:center;justify-content:space-between;gap:calc(var(--aeris-cascade-select-density-gap) + .25rem);padding:var(--aeris-item-padding-y, .5rem) var(--aeris-item-padding-x, .75rem);border:0;border-radius:var(--aeris-radius-item, var(--aeris-radius-sm, .4375rem));background:transparent;color:inherit;font:inherit;font-size:var(--aeris-item-font-size, .875rem);line-height:1.35;text-align:left;cursor:pointer}.aeris-cascade-select__option[data-active]{background:var(--aeris-cascade-select-option-hover, var(--aeris-interactive-hover, var(--aeris-surface-2, #f3f3f3)))}@media(hover:hover){.aeris-cascade-select__option:hover{background:var(--aeris-cascade-select-option-hover, var(--aeris-interactive-hover, var(--aeris-surface-2, #f3f3f3)))}}.aeris-cascade-select__option[aria-selected=true]{background:var(--aeris-cascade-select-option-selected, var(--aeris-primary-soft, #e7eddc));color:var(--aeris-cascade-select-option-selected-text, var(--aeris-text, #111111));font-weight:var(--aeris-font-weight-bold, 700)}.aeris-cascade-select__option:disabled{opacity:var(--aeris-disabled-opacity, .5);cursor:not-allowed}.aeris-cascade-select__option-copy{min-width:0;flex:1;display:grid;gap:calc(var(--aeris-cascade-select-density-gap) * .25)}.aeris-cascade-select__option-copy>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aeris-cascade-select__option-copy small{color:var(--aeris-text-2, #454545);font-size:var(--aeris-font-size-sm, .75rem)}.aeris-cascade-select__option-chevron{flex:0 0 auto;color:var(--aeris-text-2, #454545)}.aeris-cascade-select__option-chevron:before{transform:translate(-50%,-50%) rotate(-90deg)}.aeris-cascade-select__state{min-width:0;overflow-wrap:anywhere;padding:calc(var(--aeris-item-padding-y, .5rem) * 1.75) calc(var(--aeris-item-padding-x, .75rem) * 1.15);color:var(--aeris-text-2, #454545);font-size:var(--aeris-font-size-lg, .875rem)}.aeris-cascade-select__option-chevron:dir(rtl):before{transform:translate(-50%,-50%) rotate(90deg)}@media(max-width:36rem){.aeris-cascade-select__panel{width:max-content;overflow-x:hidden}.aeris-cascade-select__submenu{position:static;display:block;width:auto;max-width:none;margin-inline-start:.625rem;padding:0;border:none;overflow:visible;background:transparent;box-shadow:none}.aeris-cascade-select__submenu .aeris-cascade-select__item{padding-inline:0}.aeris-cascade-select__option-chevron:before,.aeris-cascade-select__option-chevron:dir(rtl):before{transform:translate(-50%,-50%)}.aeris-cascade-select__option[aria-expanded=true] .aeris-cascade-select__option-chevron:before{transform:translate(-50%,-50%) rotate(180deg)}}@media(prefers-reduced-motion:reduce){.aeris-cascade-select__submenu{animation:none}.aeris-cascade-select__trigger,.aeris-cascade-select__chevron:before,.aeris-cascade-select__option-chevron:before{transition:none}}\n"],
|
|
854
|
+
dependencies: [{
|
|
855
|
+
kind: "directive",
|
|
856
|
+
type: NgTemplateOutlet,
|
|
857
|
+
selector: "[ngTemplateOutlet]",
|
|
858
|
+
inputs: [
|
|
859
|
+
"ngTemplateOutletContext",
|
|
860
|
+
"ngTemplateOutlet",
|
|
861
|
+
"ngTemplateOutletInjector"
|
|
862
|
+
]
|
|
863
|
+
}, {
|
|
864
|
+
kind: "directive",
|
|
865
|
+
type: ɵAerisAppendTo,
|
|
866
|
+
selector: "[aerisInternalAppendTo]",
|
|
867
|
+
inputs: [
|
|
868
|
+
"aerisInternalAppendTo",
|
|
869
|
+
"aerisInternalAppendToDefault",
|
|
870
|
+
"aerisInternalAppendToAnchor",
|
|
871
|
+
"aerisInternalAppendToOffset",
|
|
872
|
+
"aerisInternalAppendToMatchWidth",
|
|
873
|
+
"aerisInternalAppendToPlacement",
|
|
874
|
+
"aerisInternalAppendToAlignment",
|
|
875
|
+
"aerisInternalAppendToCollisionPadding",
|
|
876
|
+
"aerisInternalAppendToPositionSelf",
|
|
877
|
+
"aerisInternalAppendToDismiss"
|
|
878
|
+
],
|
|
879
|
+
outputs: ["aerisInternalAppendToOutside"]
|
|
880
|
+
}]
|
|
881
|
+
});
|
|
882
|
+
};
|
|
883
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
884
|
+
minVersion: "12.0.0",
|
|
885
|
+
version: "22.2.2",
|
|
886
|
+
ngImport: i0,
|
|
887
|
+
type: AerisCascadeSelect,
|
|
888
|
+
decorators: [{
|
|
889
|
+
type: Component,
|
|
890
|
+
args: [{
|
|
891
|
+
selector: "aeris-cascade-select",
|
|
892
|
+
imports: [NgTemplateOutlet, ɵAerisAppendTo],
|
|
893
|
+
template: `
|
|
894
|
+
<ng-template #optionList let-items let-level="level">
|
|
895
|
+
<ul class="aeris-cascade-select__options" role="presentation">
|
|
896
|
+
@for (option of items; track option.value; let index = $index) {
|
|
897
|
+
<li #optionAnchor class="aeris-cascade-select__item" role="none">
|
|
898
|
+
<button
|
|
899
|
+
type="button"
|
|
900
|
+
role="treeitem"
|
|
901
|
+
tabindex="-1"
|
|
902
|
+
class="aeris-cascade-select__option"
|
|
903
|
+
[id]="optionId(level, option.value)"
|
|
904
|
+
[disabled]="option.disabled"
|
|
905
|
+
[attr.aria-label]="option.label"
|
|
906
|
+
[attr.aria-level]="level + 1"
|
|
907
|
+
[attr.aria-posinset]="index + 1"
|
|
908
|
+
[attr.aria-setsize]="items.length"
|
|
909
|
+
[attr.aria-selected]="isSelected(option)"
|
|
910
|
+
[attr.aria-expanded]="hasChildren(option) ? isInActivePath(option) : null"
|
|
911
|
+
[attr.aria-owns]="
|
|
912
|
+
hasChildren(option) && isInActivePath(option)
|
|
913
|
+
? optionId(level, option.value) + '-children'
|
|
914
|
+
: null
|
|
915
|
+
"
|
|
916
|
+
[attr.data-active]="isActive(level, option) || null"
|
|
917
|
+
[attr.data-has-children]="hasChildren(option) || null"
|
|
918
|
+
(mouseenter)="handleOptionHover(level, option)"
|
|
919
|
+
(mousedown)="$event.preventDefault()"
|
|
920
|
+
(click)="handleOptionClick(level, option, $event)"
|
|
921
|
+
>
|
|
922
|
+
@if (optionTemplate(); as template) {
|
|
923
|
+
<ng-container
|
|
924
|
+
[ngTemplateOutlet]="template.template"
|
|
925
|
+
[ngTemplateOutletContext]="{
|
|
926
|
+
$implicit: option,
|
|
927
|
+
option,
|
|
928
|
+
active: isActive(level, option),
|
|
929
|
+
selected: isSelected(option),
|
|
930
|
+
level,
|
|
931
|
+
hasChildren: hasChildren(option),
|
|
932
|
+
}"
|
|
933
|
+
/>
|
|
934
|
+
} @else {
|
|
935
|
+
<span class="aeris-cascade-select__option-copy">
|
|
936
|
+
<span>{{ option.label }}</span>
|
|
937
|
+
@if (option.description) {
|
|
938
|
+
<small>{{ option.description }}</small>
|
|
939
|
+
}
|
|
940
|
+
</span>
|
|
941
|
+
@if (hasChildren(option)) {
|
|
942
|
+
<span class="aeris-cascade-select__option-chevron" aria-hidden="true"></span>
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
</button>
|
|
946
|
+
@if (hasChildren(option) && isInActivePath(option)) {
|
|
947
|
+
<div
|
|
948
|
+
#optionsPanel
|
|
949
|
+
class="aeris-cascade-select__submenu"
|
|
950
|
+
role="group"
|
|
951
|
+
[id]="optionId(level, option.value) + '-children'"
|
|
952
|
+
[attr.aria-label]="option.label"
|
|
953
|
+
[aerisInternalAppendTo]="submenuTarget()"
|
|
954
|
+
[aerisInternalAppendToDismiss]="dismissOverlay"
|
|
955
|
+
[aerisInternalAppendToAnchor]="optionAnchor"
|
|
956
|
+
[aerisInternalAppendToPositionSelf]="!mobile()"
|
|
957
|
+
[aerisInternalAppendToPlacement]="submenuPlacement()"
|
|
958
|
+
aerisInternalAppendToAlignment="start"
|
|
959
|
+
[aerisInternalAppendToOffset]="1"
|
|
960
|
+
[aerisInternalAppendToCollisionPadding]="viewportMargin()"
|
|
961
|
+
(aerisInternalAppendToOutside)="handleOutside($event)"
|
|
962
|
+
[style.max-height]="mobile() ? null : panelMaxHeight()"
|
|
963
|
+
>
|
|
964
|
+
<ng-container
|
|
965
|
+
[ngTemplateOutlet]="optionList"
|
|
966
|
+
[ngTemplateOutletContext]="{ $implicit: option.children, level: level + 1 }"
|
|
967
|
+
/>
|
|
968
|
+
</div>
|
|
969
|
+
}
|
|
970
|
+
</li>
|
|
971
|
+
}
|
|
972
|
+
</ul>
|
|
973
|
+
</ng-template>
|
|
520
974
|
<div
|
|
521
975
|
class="aeris-cascade-select"
|
|
522
976
|
[attr.data-size]="size()"
|
|
523
977
|
[attr.data-appearance]="appearance()"
|
|
524
978
|
[attr.data-open]="open() || null"
|
|
525
|
-
[attr.data-invalid]="
|
|
979
|
+
[attr.data-invalid]="displayInvalid() || null"
|
|
526
980
|
[attr.data-disabled]="effectiveDisabled() || null"
|
|
527
981
|
[attr.data-fluid]="fluid() || null"
|
|
528
982
|
(focusout)="handleFocusOut($event)"
|
|
@@ -531,21 +985,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
531
985
|
<input type="hidden" [name]="name()" [value]="value()" />
|
|
532
986
|
}
|
|
533
987
|
|
|
534
|
-
<div class="aeris-cascade-select__control">
|
|
988
|
+
<div #control class="aeris-cascade-select__control">
|
|
535
989
|
<button
|
|
536
990
|
#trigger
|
|
537
991
|
class="aeris-cascade-select__trigger"
|
|
538
992
|
type="button"
|
|
539
993
|
role="combobox"
|
|
540
|
-
aria-haspopup="
|
|
994
|
+
aria-haspopup="tree"
|
|
541
995
|
[id]="resolvedInputId()"
|
|
542
996
|
[attr.aria-expanded]="open()"
|
|
543
997
|
[attr.aria-controls]="panelId"
|
|
544
998
|
[attr.aria-activedescendant]="open() ? activeOptionId() : null"
|
|
545
999
|
[attr.aria-label]="ariaLabel() || null"
|
|
546
|
-
[attr.aria-labelledby]="
|
|
547
|
-
[attr.aria-describedby]="
|
|
548
|
-
[attr.aria-invalid]="
|
|
1000
|
+
[attr.aria-labelledby]="ariaLabelledBy() || null"
|
|
1001
|
+
[attr.aria-describedby]="ariaDescribedBy() || null"
|
|
1002
|
+
[attr.aria-invalid]="displayInvalid() || null"
|
|
549
1003
|
[attr.aria-required]="required() || null"
|
|
550
1004
|
[disabled]="effectiveDisabled()"
|
|
551
1005
|
(click)="toggle()"
|
|
@@ -580,20 +1034,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
580
1034
|
</div>
|
|
581
1035
|
|
|
582
1036
|
@if (open()) {
|
|
583
|
-
<button
|
|
584
|
-
type="button"
|
|
585
|
-
class="aeris-cascade-select__dismiss"
|
|
586
|
-
tabindex="-1"
|
|
587
|
-
aria-hidden="true"
|
|
588
|
-
(click)="closePanel()"
|
|
589
|
-
></button>
|
|
590
|
-
|
|
591
1037
|
<div
|
|
1038
|
+
#optionsPanel
|
|
592
1039
|
class="aeris-cascade-select__panel"
|
|
1040
|
+
[aerisInternalAppendTo]="appendTo()"
|
|
1041
|
+
[aerisInternalAppendToDismiss]="dismissOverlay"
|
|
1042
|
+
[aerisInternalAppendToAnchor]="controlElement()?.nativeElement ?? null"
|
|
1043
|
+
[aerisInternalAppendToMatchWidth]="true"
|
|
1044
|
+
[aerisInternalAppendToCollisionPadding]="viewportMargin()"
|
|
1045
|
+
(aerisInternalAppendToOutside)="handleOutside($event)"
|
|
593
1046
|
[id]="panelId"
|
|
1047
|
+
role="tree"
|
|
1048
|
+
[attr.aria-label]="ariaLabel() || 'Options'"
|
|
594
1049
|
[style.max-height]="panelMaxHeight()"
|
|
595
1050
|
>
|
|
596
|
-
@if (
|
|
1051
|
+
@if (options().length === 0) {
|
|
597
1052
|
<div class="aeris-cascade-select__state">
|
|
598
1053
|
@if (emptyTemplate(); as template) {
|
|
599
1054
|
<ng-container [ngTemplateOutlet]="template.template" />
|
|
@@ -602,72 +1057,267 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
602
1057
|
}
|
|
603
1058
|
</div>
|
|
604
1059
|
} @else {
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
[attr.aria-label]="columnLabel(level)"
|
|
610
|
-
>
|
|
611
|
-
@for (option of column.options; track option.value) {
|
|
612
|
-
<button
|
|
613
|
-
type="button"
|
|
614
|
-
role="option"
|
|
615
|
-
class="aeris-cascade-select__option"
|
|
616
|
-
[id]="optionId(level, option.value)"
|
|
617
|
-
[disabled]="option.disabled"
|
|
618
|
-
[attr.aria-selected]="isSelected(option)"
|
|
619
|
-
[attr.aria-expanded]="hasChildren(option) ? isInActivePath(option) : null"
|
|
620
|
-
[attr.data-active]="isActive(level, option) || null"
|
|
621
|
-
[attr.data-has-children]="hasChildren(option) || null"
|
|
622
|
-
(mouseenter)="activateOption(level, option)"
|
|
623
|
-
(focus)="activateOption(level, option)"
|
|
624
|
-
(click)="handleOptionClick(level, option, $event)"
|
|
625
|
-
>
|
|
626
|
-
@if (optionTemplate(); as template) {
|
|
627
|
-
<ng-container
|
|
628
|
-
[ngTemplateOutlet]="template.template"
|
|
629
|
-
[ngTemplateOutletContext]="{
|
|
630
|
-
$implicit: option,
|
|
631
|
-
option,
|
|
632
|
-
active: isActive(level, option),
|
|
633
|
-
selected: isSelected(option),
|
|
634
|
-
level,
|
|
635
|
-
hasChildren: hasChildren(option)
|
|
636
|
-
}"
|
|
637
|
-
/>
|
|
638
|
-
} @else {
|
|
639
|
-
<span class="aeris-cascade-select__option-copy">
|
|
640
|
-
<span>{{ option.label }}</span>
|
|
641
|
-
@if (option.description) {
|
|
642
|
-
<small>{{ option.description }}</small>
|
|
643
|
-
}
|
|
644
|
-
</span>
|
|
645
|
-
@if (hasChildren(option)) {
|
|
646
|
-
<span class="aeris-cascade-select__option-chevron" aria-hidden="true"></span>
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
</button>
|
|
650
|
-
}
|
|
651
|
-
</div>
|
|
652
|
-
}
|
|
1060
|
+
<ng-container
|
|
1061
|
+
[ngTemplateOutlet]="optionList"
|
|
1062
|
+
[ngTemplateOutletContext]="{ $implicit: options(), level: 0 }"
|
|
1063
|
+
/>
|
|
653
1064
|
}
|
|
654
1065
|
</div>
|
|
655
1066
|
}
|
|
656
1067
|
</div>
|
|
657
|
-
`,
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
'[attr.data-fluid]': 'fluid() || null',
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
1068
|
+
`,
|
|
1069
|
+
providers: [{
|
|
1070
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1071
|
+
useExisting: forwardRef(() => AerisCascadeSelect),
|
|
1072
|
+
multi: true
|
|
1073
|
+
}],
|
|
1074
|
+
host: { "[attr.data-fluid]": "fluid() || null" },
|
|
1075
|
+
styles: [":host{--_aeris-chevron-mask: var( --aeris-icon-chevron, url(data:image/svg+xml,%3Csvg%20xmlns=%27http://www.w3.org/2000/svg%27%20viewBox=%270%200%2024%2024%27%3E%3Cpath%20d=%27M7%209.5%2012%2014.5%2017%209.5%27%20fill=%27none%27%20stroke=%27black%27%20stroke-width=%272.4%27%20stroke-linecap=%27round%27%20stroke-linejoin=%27round%27/%3E%3C/svg%3E) );display:inline-block;min-width:0;width:14rem;max-width:100%;color:var(--aeris-cascade-select-text, var(--aeris-text, #111111));font:inherit}:host([data-fluid]){width:100%}.aeris-cascade-select{--aeris-cascade-select-height: var(--aeris-control-height, 2.625rem);--aeris-cascade-select-font-size: var(--aeris-font-size-lg, .875rem);--aeris-cascade-select-padding: var(--aeris-control-padding-x, .75rem);--aeris-cascade-select-density-gap: var(--aeris-density-gap, .5rem);position:relative;width:100%}.aeris-cascade-select[data-size=xs]{--aeris-cascade-select-height: calc(var(--aeris-control-height, 2.625rem) - .875rem);--aeris-cascade-select-font-size: var(--aeris-font-size-sm, .75rem);--aeris-cascade-select-padding: calc(var(--aeris-control-padding-x, .75rem) * .75)}.aeris-cascade-select[data-size=sm]{--aeris-cascade-select-height: calc(var(--aeris-control-height, 2.625rem) - .5rem);--aeris-cascade-select-font-size: var(--aeris-font-size-md, .8125rem);--aeris-cascade-select-padding: calc(var(--aeris-control-padding-x, .75rem) * .85)}.aeris-cascade-select[data-size=lg]{--aeris-cascade-select-height: calc(var(--aeris-control-height, 2.625rem) + .5rem);--aeris-cascade-select-font-size: var(--aeris-font-size-xl, .9375rem);--aeris-cascade-select-padding: calc(var(--aeris-control-padding-x, .75rem) * 1.15)}.aeris-cascade-select__control{position:relative}.aeris-cascade-select__trigger{width:100%;min-height:var(--aeris-cascade-select-height);display:flex;align-items:center;gap:calc(var(--aeris-cascade-select-density-gap) + .25rem);padding:0 2.75rem 0 var(--aeris-cascade-select-padding);border:1px solid var(--aeris-cascade-select-border, var(--aeris-border, #efefef));border-radius:var(--aeris-cascade-select-radius, var(--aeris-radius-control, var(--aeris-radius-sm, .4375rem)));background:var(--aeris-cascade-select-background, var(--aeris-surface, #fff));color:inherit;font:inherit;font-size:var(--aeris-cascade-select-font-size);line-height:1.35;text-align:left;cursor:pointer;transition:border-color var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease),background-color var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease),box-shadow var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease)}.aeris-cascade-select__control:has(.aeris-cascade-select__clear) .aeris-cascade-select__trigger{padding-right:4.5rem}.aeris-cascade-select[data-appearance=filled] .aeris-cascade-select__trigger{border-color:transparent;background:var(--aeris-cascade-select-filled-background, var(--aeris-surface-2, #f3f3f3))}.aeris-cascade-select[data-open] .aeris-cascade-select__trigger{border-color:var(--aeris-cascade-select-hover-border, var(--aeris-control-hover-border, var(--aeris-primary, #111111)))}@media(hover:hover){.aeris-cascade-select__trigger:hover{border-color:var(--aeris-cascade-select-hover-border, var(--aeris-control-hover-border, var(--aeris-primary, #111111)))}}.aeris-cascade-select__trigger:focus-visible{outline:0;border-color:var(--aeris-cascade-select-focus, var(--aeris-control-focus-border, var(--aeris-focus, #111111)));box-shadow:0 0 0 var(--aeris-focus-ring-width, 3px) var(--aeris-control-focus-ring-color, var(--aeris-focus-ring-color, transparent))}.aeris-cascade-select[data-invalid] .aeris-cascade-select__trigger{border-color:var(--aeris-control-invalid-border, var(--aeris-danger, #c81e2a))}.aeris-cascade-select[data-invalid] .aeris-cascade-select__trigger:focus-visible{box-shadow:0 0 0 var(--aeris-focus-ring-width, 3px) var(--aeris-control-invalid-focus-ring-color, transparent)}.aeris-cascade-select[data-disabled] .aeris-cascade-select__trigger{opacity:var(--aeris-disabled-opacity, .5);cursor:not-allowed}.aeris-cascade-select__value{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aeris-cascade-select__placeholder{color:var(--aeris-cascade-select-placeholder, var(--aeris-text-2, #454545))}.aeris-cascade-select__chevron,.aeris-cascade-select__option-chevron{position:relative;width:1rem;height:1rem}.aeris-cascade-select__chevron{position:absolute;top:50%;right:var(--aeris-cascade-select-padding);color:var(--aeris-cascade-select-icon, var(--aeris-text-2, #454545));transform:translateY(-50%);pointer-events:none}.aeris-cascade-select__chevron:before,.aeris-cascade-select__option-chevron:before{position:absolute;top:50%;left:50%;width:1rem;height:1rem;background:currentColor;content:\"\";transform:translate(-50%,-50%);transition:transform var(--aeris-motion-normal, .15s) var(--aeris-ease-standard, ease);-webkit-mask:var(--_aeris-chevron-mask) center/100% 100% no-repeat;mask:var(--_aeris-chevron-mask) center/100% 100% no-repeat}.aeris-cascade-select[data-open] .aeris-cascade-select__chevron:before{transform:translate(-50%,-50%) rotate(180deg)}.aeris-cascade-select__clear{position:absolute;top:50%;right:2.125rem;width:1.5rem;height:1.5rem;display:grid;place-items:center;padding:0;border:0;border-radius:var(--aeris-radius-control, var(--aeris-radius-sm, .4375rem));background:transparent;color:var(--aeris-cascade-select-icon, var(--aeris-text-2, #454545));transform:translateY(-50%);cursor:pointer}.aeris-cascade-select__clear:focus-visible{background:var(--aeris-surface-2, #f3f3f3);color:var(--aeris-text, #111111)}@media(hover:hover){.aeris-cascade-select__clear:hover{background:var(--aeris-surface-2, #f3f3f3);color:var(--aeris-text, #111111)}}.aeris-cascade-select__clear:focus-visible{outline:var(--aeris-focus-ring-width, 3px) solid var(--aeris-focus, #111111);outline-offset:1px}.aeris-cascade-select__clear>span{width:var(--aeris-icon-size, 1rem);height:var(--aeris-icon-size, 1rem);background:currentColor;-webkit-mask:var(--aeris-icon-close) center/100% 100% no-repeat;mask:var(--aeris-icon-close) center/100% 100% no-repeat}.aeris-cascade-select__panel,.aeris-cascade-select__submenu{box-sizing:border-box;position:absolute;z-index:90;top:calc(100% + .4375rem);left:0;width:var(--aeris-cascade-select-submenu-width, 13rem);max-width:calc(100vw - 1rem);display:block;overflow:auto;scrollbar-color:var(--aeris-border, #efefef) transparent;scrollbar-width:thin;padding-block:var(--aeris-overlay-padding, calc(var(--aeris-cascade-select-density-gap) * .75));border:1px solid var(--aeris-cascade-select-panel-border, var(--aeris-border));border-radius:var(--aeris-cascade-select-panel-radius, var(--aeris-radius-overlay, var(--aeris-radius-md, .6875rem)));background:var(--aeris-cascade-select-panel-background, var(--aeris-surface, #fff));box-shadow:var(--aeris-cascade-select-panel-shadow, var(--aeris-overlay-shadow, var(--aeris-shadow-lg, 0 18px 48px rgba(0, 0, 0, .18))))}.aeris-cascade-select__panel::-webkit-scrollbar{width:.75rem;height:.75rem}.aeris-cascade-select__panel::-webkit-scrollbar-track,.aeris-cascade-select__panel::-webkit-scrollbar-corner{background:transparent}.aeris-cascade-select__panel::-webkit-scrollbar-thumb{border:3px solid transparent;border-radius:var(--aeris-radius-pill, 999px);background:var(--aeris-border, #efefef);background-clip:content-box}.aeris-cascade-select__options{display:grid;align-content:start;gap:calc(var(--aeris-cascade-select-density-gap) * .25);margin:0;padding:0;list-style:none}.aeris-cascade-select__item{box-sizing:border-box;min-width:0;padding-inline:var(--aeris-overlay-padding, calc(var(--aeris-cascade-select-density-gap) * .75))}.aeris-cascade-select__submenu{animation:aeris-overlay-enter var(--aeris-motion-normal, .15s) var(--aeris-ease-enter, ease-out) both}.aeris-cascade-select__option{width:100%;min-height:var(--aeris-item-height, 2.5rem);display:flex;align-items:center;justify-content:space-between;gap:calc(var(--aeris-cascade-select-density-gap) + .25rem);padding:var(--aeris-item-padding-y, .5rem) var(--aeris-item-padding-x, .75rem);border:0;border-radius:var(--aeris-radius-item, var(--aeris-radius-sm, .4375rem));background:transparent;color:inherit;font:inherit;font-size:var(--aeris-item-font-size, .875rem);line-height:1.35;text-align:left;cursor:pointer}.aeris-cascade-select__option[data-active]{background:var(--aeris-cascade-select-option-hover, var(--aeris-interactive-hover, var(--aeris-surface-2, #f3f3f3)))}@media(hover:hover){.aeris-cascade-select__option:hover{background:var(--aeris-cascade-select-option-hover, var(--aeris-interactive-hover, var(--aeris-surface-2, #f3f3f3)))}}.aeris-cascade-select__option[aria-selected=true]{background:var(--aeris-cascade-select-option-selected, var(--aeris-primary-soft, #e7eddc));color:var(--aeris-cascade-select-option-selected-text, var(--aeris-text, #111111));font-weight:var(--aeris-font-weight-bold, 700)}.aeris-cascade-select__option:disabled{opacity:var(--aeris-disabled-opacity, .5);cursor:not-allowed}.aeris-cascade-select__option-copy{min-width:0;flex:1;display:grid;gap:calc(var(--aeris-cascade-select-density-gap) * .25)}.aeris-cascade-select__option-copy>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.aeris-cascade-select__option-copy small{color:var(--aeris-text-2, #454545);font-size:var(--aeris-font-size-sm, .75rem)}.aeris-cascade-select__option-chevron{flex:0 0 auto;color:var(--aeris-text-2, #454545)}.aeris-cascade-select__option-chevron:before{transform:translate(-50%,-50%) rotate(-90deg)}.aeris-cascade-select__state{min-width:0;overflow-wrap:anywhere;padding:calc(var(--aeris-item-padding-y, .5rem) * 1.75) calc(var(--aeris-item-padding-x, .75rem) * 1.15);color:var(--aeris-text-2, #454545);font-size:var(--aeris-font-size-lg, .875rem)}.aeris-cascade-select__option-chevron:dir(rtl):before{transform:translate(-50%,-50%) rotate(90deg)}@media(max-width:36rem){.aeris-cascade-select__panel{width:max-content;overflow-x:hidden}.aeris-cascade-select__submenu{position:static;display:block;width:auto;max-width:none;margin-inline-start:.625rem;padding:0;border:none;overflow:visible;background:transparent;box-shadow:none}.aeris-cascade-select__submenu .aeris-cascade-select__item{padding-inline:0}.aeris-cascade-select__option-chevron:before,.aeris-cascade-select__option-chevron:dir(rtl):before{transform:translate(-50%,-50%)}.aeris-cascade-select__option[aria-expanded=true] .aeris-cascade-select__option-chevron:before{transform:translate(-50%,-50%) rotate(180deg)}}@media(prefers-reduced-motion:reduce){.aeris-cascade-select__submenu{animation:none}.aeris-cascade-select__trigger,.aeris-cascade-select__chevron:before,.aeris-cascade-select__option-chevron:before{transition:none}}\n"]
|
|
1076
|
+
}]
|
|
1077
|
+
}],
|
|
1078
|
+
ctorParameters: () => [],
|
|
1079
|
+
propDecorators: {
|
|
1080
|
+
controlElement: [{
|
|
1081
|
+
type: i0.ViewChild,
|
|
1082
|
+
args: ["control", { isSignal: true }]
|
|
1083
|
+
}],
|
|
1084
|
+
triggerElement: [{
|
|
1085
|
+
type: i0.ViewChild,
|
|
1086
|
+
args: ["trigger", { isSignal: true }]
|
|
1087
|
+
}],
|
|
1088
|
+
panels: [{
|
|
1089
|
+
type: i0.ViewChildren,
|
|
1090
|
+
args: ["optionsPanel", { isSignal: true }]
|
|
1091
|
+
}],
|
|
1092
|
+
panelPortals: [{
|
|
1093
|
+
type: i0.ViewChildren,
|
|
1094
|
+
args: [i0.forwardRef(() => ɵAerisAppendTo), { isSignal: true }]
|
|
1095
|
+
}],
|
|
1096
|
+
value: [{
|
|
1097
|
+
type: i0.Input,
|
|
1098
|
+
args: [{
|
|
1099
|
+
isSignal: true,
|
|
1100
|
+
alias: "value",
|
|
1101
|
+
required: false
|
|
1102
|
+
}]
|
|
1103
|
+
}, {
|
|
1104
|
+
type: i0.Output,
|
|
1105
|
+
args: ["valueChange"]
|
|
1106
|
+
}],
|
|
1107
|
+
options: [{
|
|
1108
|
+
type: i0.Input,
|
|
1109
|
+
args: [{
|
|
1110
|
+
isSignal: true,
|
|
1111
|
+
alias: "options",
|
|
1112
|
+
required: false
|
|
1113
|
+
}]
|
|
1114
|
+
}],
|
|
1115
|
+
inputId: [{
|
|
1116
|
+
type: i0.Input,
|
|
1117
|
+
args: [{
|
|
1118
|
+
isSignal: true,
|
|
1119
|
+
alias: "inputId",
|
|
1120
|
+
required: false
|
|
1121
|
+
}]
|
|
1122
|
+
}],
|
|
1123
|
+
name: [{
|
|
1124
|
+
type: i0.Input,
|
|
1125
|
+
args: [{
|
|
1126
|
+
isSignal: true,
|
|
1127
|
+
alias: "name",
|
|
1128
|
+
required: false
|
|
1129
|
+
}]
|
|
1130
|
+
}],
|
|
1131
|
+
placeholder: [{
|
|
1132
|
+
type: i0.Input,
|
|
1133
|
+
args: [{
|
|
1134
|
+
isSignal: true,
|
|
1135
|
+
alias: "placeholder",
|
|
1136
|
+
required: false
|
|
1137
|
+
}]
|
|
1138
|
+
}],
|
|
1139
|
+
ariaLabel: [{
|
|
1140
|
+
type: i0.Input,
|
|
1141
|
+
args: [{
|
|
1142
|
+
isSignal: true,
|
|
1143
|
+
alias: "ariaLabel",
|
|
1144
|
+
required: false
|
|
1145
|
+
}]
|
|
1146
|
+
}],
|
|
1147
|
+
ariaLabelledBy: [{
|
|
1148
|
+
type: i0.Input,
|
|
1149
|
+
args: [{
|
|
1150
|
+
isSignal: true,
|
|
1151
|
+
alias: "ariaLabelledBy",
|
|
1152
|
+
required: false
|
|
1153
|
+
}]
|
|
1154
|
+
}],
|
|
1155
|
+
ariaDescribedBy: [{
|
|
1156
|
+
type: i0.Input,
|
|
1157
|
+
args: [{
|
|
1158
|
+
isSignal: true,
|
|
1159
|
+
alias: "ariaDescribedBy",
|
|
1160
|
+
required: false
|
|
1161
|
+
}]
|
|
1162
|
+
}],
|
|
1163
|
+
clearButtonAriaLabel: [{
|
|
1164
|
+
type: i0.Input,
|
|
1165
|
+
args: [{
|
|
1166
|
+
isSignal: true,
|
|
1167
|
+
alias: "clearButtonAriaLabel",
|
|
1168
|
+
required: false
|
|
1169
|
+
}]
|
|
1170
|
+
}],
|
|
1171
|
+
emptyMessage: [{
|
|
1172
|
+
type: i0.Input,
|
|
1173
|
+
args: [{
|
|
1174
|
+
isSignal: true,
|
|
1175
|
+
alias: "emptyMessage",
|
|
1176
|
+
required: false
|
|
1177
|
+
}]
|
|
1178
|
+
}],
|
|
1179
|
+
size: [{
|
|
1180
|
+
type: i0.Input,
|
|
1181
|
+
args: [{
|
|
1182
|
+
isSignal: true,
|
|
1183
|
+
alias: "size",
|
|
1184
|
+
required: false
|
|
1185
|
+
}]
|
|
1186
|
+
}],
|
|
1187
|
+
appearance: [{
|
|
1188
|
+
type: i0.Input,
|
|
1189
|
+
args: [{
|
|
1190
|
+
isSignal: true,
|
|
1191
|
+
alias: "appearance",
|
|
1192
|
+
required: false
|
|
1193
|
+
}]
|
|
1194
|
+
}],
|
|
1195
|
+
separator: [{
|
|
1196
|
+
type: i0.Input,
|
|
1197
|
+
args: [{
|
|
1198
|
+
isSignal: true,
|
|
1199
|
+
alias: "separator",
|
|
1200
|
+
required: false
|
|
1201
|
+
}]
|
|
1202
|
+
}],
|
|
1203
|
+
panelMaxHeight: [{
|
|
1204
|
+
type: i0.Input,
|
|
1205
|
+
args: [{
|
|
1206
|
+
isSignal: true,
|
|
1207
|
+
alias: "panelMaxHeight",
|
|
1208
|
+
required: false
|
|
1209
|
+
}]
|
|
1210
|
+
}],
|
|
1211
|
+
appendTo: [{
|
|
1212
|
+
type: i0.Input,
|
|
1213
|
+
args: [{
|
|
1214
|
+
isSignal: true,
|
|
1215
|
+
alias: "appendTo",
|
|
1216
|
+
required: false
|
|
1217
|
+
}]
|
|
1218
|
+
}],
|
|
1219
|
+
viewportMargin: [{
|
|
1220
|
+
type: i0.Input,
|
|
1221
|
+
args: [{
|
|
1222
|
+
isSignal: true,
|
|
1223
|
+
alias: "viewportMargin",
|
|
1224
|
+
required: false
|
|
1225
|
+
}]
|
|
1226
|
+
}],
|
|
1227
|
+
invalid: [{
|
|
1228
|
+
type: i0.Input,
|
|
1229
|
+
args: [{
|
|
1230
|
+
isSignal: true,
|
|
1231
|
+
alias: "invalid",
|
|
1232
|
+
required: false
|
|
1233
|
+
}]
|
|
1234
|
+
}],
|
|
1235
|
+
touched: [{
|
|
1236
|
+
type: i0.Input,
|
|
1237
|
+
args: [{
|
|
1238
|
+
isSignal: true,
|
|
1239
|
+
alias: "touched",
|
|
1240
|
+
required: false
|
|
1241
|
+
}]
|
|
1242
|
+
}],
|
|
1243
|
+
disabled: [{
|
|
1244
|
+
type: i0.Input,
|
|
1245
|
+
args: [{
|
|
1246
|
+
isSignal: true,
|
|
1247
|
+
alias: "disabled",
|
|
1248
|
+
required: false
|
|
1249
|
+
}]
|
|
1250
|
+
}],
|
|
1251
|
+
required: [{
|
|
1252
|
+
type: i0.Input,
|
|
1253
|
+
args: [{
|
|
1254
|
+
isSignal: true,
|
|
1255
|
+
alias: "required",
|
|
1256
|
+
required: false
|
|
1257
|
+
}]
|
|
1258
|
+
}],
|
|
1259
|
+
fluid: [{
|
|
1260
|
+
type: i0.Input,
|
|
1261
|
+
args: [{
|
|
1262
|
+
isSignal: true,
|
|
1263
|
+
alias: "fluid",
|
|
1264
|
+
required: false
|
|
1265
|
+
}]
|
|
1266
|
+
}],
|
|
1267
|
+
clearable: [{
|
|
1268
|
+
type: i0.Input,
|
|
1269
|
+
args: [{
|
|
1270
|
+
isSignal: true,
|
|
1271
|
+
alias: "clearable",
|
|
1272
|
+
required: false
|
|
1273
|
+
}]
|
|
1274
|
+
}],
|
|
1275
|
+
selectBranches: [{
|
|
1276
|
+
type: i0.Input,
|
|
1277
|
+
args: [{
|
|
1278
|
+
isSignal: true,
|
|
1279
|
+
alias: "selectBranches",
|
|
1280
|
+
required: false
|
|
1281
|
+
}]
|
|
1282
|
+
}],
|
|
1283
|
+
changed: [{
|
|
1284
|
+
type: i0.Output,
|
|
1285
|
+
args: ["changed"]
|
|
1286
|
+
}],
|
|
1287
|
+
cleared: [{
|
|
1288
|
+
type: i0.Output,
|
|
1289
|
+
args: ["cleared"]
|
|
1290
|
+
}],
|
|
1291
|
+
opened: [{
|
|
1292
|
+
type: i0.Output,
|
|
1293
|
+
args: ["opened"]
|
|
1294
|
+
}],
|
|
1295
|
+
closed: [{
|
|
1296
|
+
type: i0.Output,
|
|
1297
|
+
args: ["closed"]
|
|
1298
|
+
}],
|
|
1299
|
+
focused: [{
|
|
1300
|
+
type: i0.Output,
|
|
1301
|
+
args: ["focused"]
|
|
1302
|
+
}],
|
|
1303
|
+
blurred: [{
|
|
1304
|
+
type: i0.Output,
|
|
1305
|
+
args: ["blurred"]
|
|
1306
|
+
}],
|
|
1307
|
+
touch: [{
|
|
1308
|
+
type: i0.Output,
|
|
1309
|
+
args: ["touch"]
|
|
1310
|
+
}],
|
|
1311
|
+
optionTemplate: [{
|
|
1312
|
+
type: i0.ContentChild,
|
|
1313
|
+
args: [i0.forwardRef(() => AerisCascadeSelectOptionTemplate), { isSignal: true }]
|
|
1314
|
+
}],
|
|
1315
|
+
emptyTemplate: [{
|
|
1316
|
+
type: i0.ContentChild,
|
|
1317
|
+
args: [i0.forwardRef(() => AerisCascadeSelectEmptyTemplate), { isSignal: true }]
|
|
1318
|
+
}]
|
|
1319
|
+
}
|
|
1320
|
+
});
|
|
672
1321
|
export { AerisCascadeSelect, AerisCascadeSelectEmptyTemplate, AerisCascadeSelectOptionTemplate };
|
|
673
|
-
|
|
1322
|
+
|
|
1323
|
+
//# sourceMappingURL=aeris-ui-core-cascade-select.mjs.map
|