@molecule/app-ui-angular 1.0.6 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11710 -1117
- package/dist/components/accordion.component.d.ts +114 -0
- package/dist/components/accordion.component.d.ts.map +1 -0
- package/dist/components/accordion.component.js +286 -0
- package/dist/components/accordion.component.js.map +1 -0
- package/dist/components/alert.component.d.ts +81 -37
- package/dist/components/alert.component.d.ts.map +1 -1
- package/dist/components/alert.component.js +232 -146
- package/dist/components/alert.component.js.map +1 -1
- package/dist/components/auth-guard.component.d.ts +94 -0
- package/dist/components/auth-guard.component.d.ts.map +1 -0
- package/dist/components/auth-guard.component.js +212 -0
- package/dist/components/auth-guard.component.js.map +1 -0
- package/dist/components/avatar.component.d.ts +97 -0
- package/dist/components/avatar.component.d.ts.map +1 -0
- package/dist/components/avatar.component.js +216 -0
- package/dist/components/avatar.component.js.map +1 -0
- package/dist/components/badge.component.d.ts +27 -12
- package/dist/components/badge.component.d.ts.map +1 -1
- package/dist/components/badge.component.js +47 -47
- package/dist/components/badge.component.js.map +1 -1
- package/dist/components/button.component.d.ts +96 -14
- package/dist/components/button.component.d.ts.map +1 -1
- package/dist/components/button.component.js +232 -87
- package/dist/components/button.component.js.map +1 -1
- package/dist/components/card.component.d.ts +135 -0
- package/dist/components/card.component.d.ts.map +1 -0
- package/dist/components/card.component.js +291 -0
- package/dist/components/card.component.js.map +1 -0
- package/dist/components/checkbox.component.d.ts +97 -29
- package/dist/components/checkbox.component.d.ts.map +1 -1
- package/dist/components/checkbox.component.js +222 -117
- package/dist/components/checkbox.component.js.map +1 -1
- package/dist/components/confirm-button.component.d.ts +130 -0
- package/dist/components/confirm-button.component.d.ts.map +1 -0
- package/dist/components/confirm-button.component.js +322 -0
- package/dist/components/confirm-button.component.js.map +1 -0
- package/dist/components/confirm-dialog.component.d.ts +60 -0
- package/dist/components/confirm-dialog.component.d.ts.map +1 -0
- package/dist/components/confirm-dialog.component.js +152 -0
- package/dist/components/confirm-dialog.component.js.map +1 -0
- package/dist/components/controlled-checked.directive.d.ts +45 -0
- package/dist/components/controlled-checked.directive.d.ts.map +1 -0
- package/dist/components/controlled-checked.directive.js +74 -0
- package/dist/components/controlled-checked.directive.js.map +1 -0
- package/dist/components/dropdown.component.d.ts +313 -0
- package/dist/components/dropdown.component.d.ts.map +1 -0
- package/dist/components/dropdown.component.js +919 -0
- package/dist/components/dropdown.component.js.map +1 -0
- package/dist/components/empty-state.component.d.ts +73 -0
- package/dist/components/empty-state.component.d.ts.map +1 -0
- package/dist/components/empty-state.component.js +180 -0
- package/dist/components/empty-state.component.js.map +1 -0
- package/dist/components/floating-input.component.d.ts +86 -0
- package/dist/components/floating-input.component.d.ts.map +1 -0
- package/dist/components/floating-input.component.js +167 -0
- package/dist/components/floating-input.component.js.map +1 -0
- package/dist/components/form-field.component.d.ts +111 -0
- package/dist/components/form-field.component.d.ts.map +1 -0
- package/dist/components/form-field.component.js +300 -0
- package/dist/components/form-field.component.js.map +1 -0
- package/dist/components/form.component.d.ts +77 -0
- package/dist/components/form.component.d.ts.map +1 -0
- package/dist/components/form.component.js +222 -0
- package/dist/components/form.component.js.map +1 -0
- package/dist/components/icon.component.d.ts +85 -0
- package/dist/components/icon.component.d.ts.map +1 -0
- package/dist/components/icon.component.js +187 -0
- package/dist/components/icon.component.js.map +1 -0
- package/dist/components/index.d.ts +49 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +49 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/input.component.d.ts +157 -54
- package/dist/components/input.component.d.ts.map +1 -1
- package/dist/components/input.component.js +437 -222
- package/dist/components/input.component.js.map +1 -1
- package/dist/components/label.component.d.ts +29 -0
- package/dist/components/label.component.d.ts.map +1 -0
- package/dist/components/label.component.js +60 -0
- package/dist/components/label.component.js.map +1 -0
- package/dist/components/language-picker.component.d.ts +124 -0
- package/dist/components/language-picker.component.d.ts.map +1 -0
- package/dist/components/language-picker.component.js +305 -0
- package/dist/components/language-picker.component.js.map +1 -0
- package/dist/components/layout.component.d.ts +167 -0
- package/dist/components/layout.component.d.ts.map +1 -0
- package/dist/components/layout.component.js +364 -0
- package/dist/components/layout.component.js.map +1 -0
- package/dist/components/load-error-banner.component.d.ts +103 -0
- package/dist/components/load-error-banner.component.d.ts.map +1 -0
- package/dist/components/load-error-banner.component.js +263 -0
- package/dist/components/load-error-banner.component.js.map +1 -0
- package/dist/components/modal.component.d.ts +125 -95
- package/dist/components/modal.component.d.ts.map +1 -1
- package/dist/components/modal.component.js +458 -271
- package/dist/components/modal.component.js.map +1 -1
- package/dist/components/molecule/alert.component.d.ts +77 -0
- package/dist/components/molecule/alert.component.d.ts.map +1 -0
- package/dist/components/molecule/alert.component.js +229 -0
- package/dist/components/molecule/alert.component.js.map +1 -0
- package/dist/components/molecule/badge.component.d.ts +27 -0
- package/dist/components/molecule/badge.component.d.ts.map +1 -0
- package/dist/components/molecule/badge.component.js +79 -0
- package/dist/components/molecule/badge.component.js.map +1 -0
- package/dist/components/molecule/button.component.d.ts +38 -0
- package/dist/components/molecule/button.component.d.ts.map +1 -0
- package/dist/components/molecule/button.component.js +137 -0
- package/dist/components/molecule/button.component.js.map +1 -0
- package/dist/components/molecule/checkbox.component.d.ts +53 -0
- package/dist/components/molecule/checkbox.component.d.ts.map +1 -0
- package/dist/components/molecule/checkbox.component.js +166 -0
- package/dist/components/molecule/checkbox.component.js.map +1 -0
- package/dist/components/molecule/index.d.ts +18 -0
- package/dist/components/molecule/index.d.ts.map +1 -0
- package/dist/components/molecule/index.js +18 -0
- package/dist/components/molecule/index.js.map +1 -0
- package/dist/components/molecule/input.component.d.ts +93 -0
- package/dist/components/molecule/input.component.d.ts.map +1 -0
- package/dist/components/molecule/input.component.js +314 -0
- package/dist/components/molecule/input.component.js.map +1 -0
- package/dist/components/molecule/modal.component.d.ts +148 -0
- package/dist/components/molecule/modal.component.d.ts.map +1 -0
- package/dist/components/molecule/modal.component.js +382 -0
- package/dist/components/molecule/modal.component.js.map +1 -0
- package/dist/components/molecule/radio-group.component.d.ts +63 -0
- package/dist/components/molecule/radio-group.component.d.ts.map +1 -0
- package/dist/components/molecule/radio-group.component.js +208 -0
- package/dist/components/molecule/radio-group.component.js.map +1 -0
- package/dist/components/molecule/select.component.d.ts +72 -0
- package/dist/components/molecule/select.component.d.ts.map +1 -0
- package/dist/components/molecule/select.component.js +274 -0
- package/dist/components/molecule/select.component.js.map +1 -0
- package/dist/components/molecule/spinner.component.d.ts +42 -0
- package/dist/components/molecule/spinner.component.d.ts.map +1 -0
- package/dist/components/molecule/spinner.component.js +122 -0
- package/dist/components/molecule/spinner.component.js.map +1 -0
- package/dist/components/molecule/switch.component.d.ts +54 -0
- package/dist/components/molecule/switch.component.d.ts.map +1 -0
- package/dist/components/molecule/switch.component.js +148 -0
- package/dist/components/molecule/switch.component.js.map +1 -0
- package/dist/components/molecule/toast.component.d.ts +98 -0
- package/dist/components/molecule/toast.component.d.ts.map +1 -0
- package/dist/components/molecule/toast.component.js +305 -0
- package/dist/components/molecule/toast.component.js.map +1 -0
- package/dist/components/molecule/tooltip.component.d.ts +77 -0
- package/dist/components/molecule/tooltip.component.d.ts.map +1 -0
- package/dist/components/molecule/tooltip.component.js +316 -0
- package/dist/components/molecule/tooltip.component.js.map +1 -0
- package/dist/components/optimistic-toggle-button.component.d.ts +125 -0
- package/dist/components/optimistic-toggle-button.component.d.ts.map +1 -0
- package/dist/components/optimistic-toggle-button.component.js +296 -0
- package/dist/components/optimistic-toggle-button.component.js.map +1 -0
- package/dist/components/page-header.component.d.ts +77 -0
- package/dist/components/page-header.component.d.ts.map +1 -0
- package/dist/components/page-header.component.js +225 -0
- package/dist/components/page-header.component.js.map +1 -0
- package/dist/components/page-shell.component.d.ts +101 -0
- package/dist/components/page-shell.component.d.ts.map +1 -0
- package/dist/components/page-shell.component.js +221 -0
- package/dist/components/page-shell.component.js.map +1 -0
- package/dist/components/pagination.component.d.ts +137 -0
- package/dist/components/pagination.component.d.ts.map +1 -0
- package/dist/components/pagination.component.js +419 -0
- package/dist/components/pagination.component.js.map +1 -0
- package/dist/components/panel-close.component.d.ts +43 -0
- package/dist/components/panel-close.component.d.ts.map +1 -0
- package/dist/components/panel-close.component.js +75 -0
- package/dist/components/panel-close.component.js.map +1 -0
- package/dist/components/progress.component.d.ts +84 -0
- package/dist/components/progress.component.d.ts.map +1 -0
- package/dist/components/progress.component.js +219 -0
- package/dist/components/progress.component.js.map +1 -0
- package/dist/components/prompt-dialog.component.d.ts +121 -0
- package/dist/components/prompt-dialog.component.d.ts.map +1 -0
- package/dist/components/prompt-dialog.component.js +332 -0
- package/dist/components/prompt-dialog.component.js.map +1 -0
- package/dist/components/radio-group.component.d.ts +66 -34
- package/dist/components/radio-group.component.d.ts.map +1 -1
- package/dist/components/radio-group.component.js +157 -134
- package/dist/components/radio-group.component.js.map +1 -1
- package/dist/components/responsive-app-shell.component.d.ts +408 -0
- package/dist/components/responsive-app-shell.component.d.ts.map +1 -0
- package/dist/components/responsive-app-shell.component.js +1144 -0
- package/dist/components/responsive-app-shell.component.js.map +1 -0
- package/dist/components/select.component.d.ts +135 -38
- package/dist/components/select.component.d.ts.map +1 -1
- package/dist/components/select.component.js +373 -181
- package/dist/components/select.component.js.map +1 -1
- package/dist/components/separator.component.d.ts +39 -0
- package/dist/components/separator.component.d.ts.map +1 -0
- package/dist/components/separator.component.js +73 -0
- package/dist/components/separator.component.js.map +1 -0
- package/dist/components/sidebar-user-card.component.d.ts +106 -0
- package/dist/components/sidebar-user-card.component.d.ts.map +1 -0
- package/dist/components/sidebar-user-card.component.js +277 -0
- package/dist/components/sidebar-user-card.component.js.map +1 -0
- package/dist/components/skeleton.component.d.ts +100 -0
- package/dist/components/skeleton.component.d.ts.map +1 -0
- package/dist/components/skeleton.component.js +214 -0
- package/dist/components/skeleton.component.js.map +1 -0
- package/dist/components/spinner.component.d.ts +36 -19
- package/dist/components/spinner.component.d.ts.map +1 -1
- package/dist/components/spinner.component.js +69 -71
- package/dist/components/spinner.component.js.map +1 -1
- package/dist/components/switch.component.d.ts +72 -29
- package/dist/components/switch.component.d.ts.map +1 -1
- package/dist/components/switch.component.js +168 -95
- package/dist/components/switch.component.js.map +1 -1
- package/dist/components/table.component.d.ts +193 -0
- package/dist/components/table.component.d.ts.map +1 -0
- package/dist/components/table.component.js +550 -0
- package/dist/components/table.component.js.map +1 -0
- package/dist/components/tabs.component.d.ts +140 -0
- package/dist/components/tabs.component.d.ts.map +1 -0
- package/dist/components/tabs.component.js +390 -0
- package/dist/components/tabs.component.js.map +1 -0
- package/dist/components/template-outlet.directive.d.ts +50 -0
- package/dist/components/template-outlet.directive.d.ts.map +1 -0
- package/dist/components/template-outlet.directive.js +81 -0
- package/dist/components/template-outlet.directive.js.map +1 -0
- package/dist/components/textarea.component.d.ts +151 -0
- package/dist/components/textarea.component.d.ts.map +1 -0
- package/dist/components/textarea.component.js +340 -0
- package/dist/components/textarea.component.js.map +1 -0
- package/dist/components/theme-toggle.component.d.ts +58 -0
- package/dist/components/theme-toggle.component.d.ts.map +1 -0
- package/dist/components/theme-toggle.component.js +124 -0
- package/dist/components/theme-toggle.component.js.map +1 -0
- package/dist/components/toast.component.d.ts +237 -49
- package/dist/components/toast.component.d.ts.map +1 -1
- package/dist/components/toast.component.js +636 -201
- package/dist/components/toast.component.js.map +1 -1
- package/dist/components/tooltip.component.d.ts +95 -45
- package/dist/components/tooltip.component.d.ts.map +1 -1
- package/dist/components/tooltip.component.js +372 -221
- package/dist/components/tooltip.component.js.map +1 -1
- package/dist/components/user-menu-popover.component.d.ts +283 -0
- package/dist/components/user-menu-popover.component.d.ts.map +1 -0
- package/dist/components/user-menu-popover.component.js +646 -0
- package/dist/components/user-menu-popover.component.js.map +1 -0
- package/dist/components/user-menu.component.d.ts +95 -0
- package/dist/components/user-menu.component.d.ts.map +1 -0
- package/dist/components/user-menu.component.js +218 -0
- package/dist/components/user-menu.component.js.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-is-desktop.d.ts +22 -0
- package/dist/hooks/use-is-desktop.d.ts.map +1 -0
- package/dist/hooks/use-is-desktop.js +37 -0
- package/dist/hooks/use-is-desktop.js.map +1 -0
- package/dist/index.d.ts +32 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -17
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utilities/dom-context.d.ts +42 -0
- package/dist/utilities/dom-context.d.ts.map +1 -0
- package/dist/utilities/dom-context.js +66 -0
- package/dist/utilities/dom-context.js.map +1 -0
- package/dist/utilities/focus.d.ts +32 -0
- package/dist/utilities/focus.d.ts.map +1 -0
- package/dist/utilities/focus.js +47 -0
- package/dist/utilities/focus.js.map +1 -0
- package/dist/utilities/form-field-context.d.ts +34 -0
- package/dist/utilities/form-field-context.d.ts.map +1 -0
- package/dist/utilities/form-field-context.js +28 -0
- package/dist/utilities/form-field-context.js.map +1 -0
- package/dist/utilities/form-submit-error.d.ts +17 -0
- package/dist/utilities/form-submit-error.d.ts.map +1 -0
- package/dist/utilities/form-submit-error.js +42 -0
- package/dist/utilities/form-submit-error.js.map +1 -0
- package/dist/utilities/icon-markup.d.ts +17 -0
- package/dist/utilities/icon-markup.d.ts.map +1 -0
- package/dist/utilities/icon-markup.js +46 -0
- package/dist/utilities/icon-markup.js.map +1 -0
- package/dist/utilities/ids.d.ts +15 -0
- package/dist/utilities/ids.d.ts.map +1 -0
- package/dist/utilities/ids.js +19 -0
- package/dist/utilities/ids.js.map +1 -0
- package/dist/utilities/index.d.ts +11 -0
- package/dist/utilities/index.d.ts.map +1 -1
- package/dist/utilities/index.js +11 -0
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/initials.d.ts +13 -0
- package/dist/utilities/initials.d.ts.map +1 -0
- package/dist/utilities/initials.js +23 -0
- package/dist/utilities/initials.js.map +1 -0
- package/dist/utilities/node-value.d.ts +31 -0
- package/dist/utilities/node-value.d.ts.map +1 -0
- package/dist/utilities/node-value.js +37 -0
- package/dist/utilities/node-value.js.map +1 -0
- package/dist/utilities/optimistic-value.d.ts +81 -0
- package/dist/utilities/optimistic-value.d.ts.map +1 -0
- package/dist/utilities/optimistic-value.js +154 -0
- package/dist/utilities/optimistic-value.js.map +1 -0
- package/dist/utilities/render-icon.d.ts +77 -7
- package/dist/utilities/render-icon.d.ts.map +1 -1
- package/dist/utilities/render-icon.js +123 -33
- package/dist/utilities/render-icon.js.map +1 -1
- package/dist/utilities/rest-attrs.d.ts +21 -0
- package/dist/utilities/rest-attrs.d.ts.map +1 -0
- package/dist/utilities/rest-attrs.js +37 -0
- package/dist/utilities/rest-attrs.js.map +1 -0
- package/dist/utilities/style.d.ts +23 -0
- package/dist/utilities/style.d.ts.map +1 -0
- package/dist/utilities/style.js +86 -0
- package/dist/utilities/style.js.map +1 -0
- package/package.json +6 -4
|
@@ -1,273 +1,465 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Select component (React parity).
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { Component, ElementRef, EventEmitter, inject, Output, ViewChild, } from '@angular/core';
|
|
7
|
+
import { useTranslation } from '@molecule/app-angular';
|
|
7
8
|
import { getClassMap } from '@molecule/app-ui';
|
|
9
|
+
import { fieldContext } from '../utilities/form-field-context.js';
|
|
10
|
+
import { MolIconSvg, resolveIcon } from '../utilities/render-icon.js';
|
|
11
|
+
import { moveRestAttributes } from '../utilities/rest-attrs.js';
|
|
12
|
+
import { styleText } from '../utilities/style.js';
|
|
8
13
|
import * as i0 from "@angular/core";
|
|
14
|
+
const _c0 = ["selectEl"];
|
|
15
|
+
const _c1 = a0 => ({ required: a0 });
|
|
9
16
|
const _forTrack0 = ($index, $item) => $item.value;
|
|
10
|
-
function
|
|
11
|
-
i0.ɵɵ
|
|
17
|
+
function Select_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
18
|
+
i0.ɵɵelementStart(0, "label");
|
|
12
19
|
i0.ɵɵtext(1);
|
|
13
|
-
i0.ɵɵ
|
|
20
|
+
i0.ɵɵelementEnd();
|
|
14
21
|
} if (rf & 2) {
|
|
15
22
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
16
|
-
i0.ɵɵclassMap(ctx_r0.
|
|
17
|
-
i0.ɵɵattribute("for", ctx_r0.selectId);
|
|
23
|
+
i0.ɵɵclassMap(ctx_r0.cm().cn(ctx_r0.cm().label(i0.ɵɵpureFunction1(4, _c1, !!ctx_r0.required)), ctx_r0.cm().labelBlock));
|
|
24
|
+
i0.ɵɵattribute("for", ctx_r0.selectId());
|
|
18
25
|
i0.ɵɵadvance();
|
|
19
|
-
i0.ɵɵ
|
|
26
|
+
i0.ɵɵtextInterpolate(ctx_r0.label);
|
|
20
27
|
} }
|
|
21
|
-
function
|
|
22
|
-
i0.ɵɵ
|
|
28
|
+
function Select_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
29
|
+
i0.ɵɵelementStart(0, "option", 3);
|
|
23
30
|
i0.ɵɵtext(1);
|
|
24
|
-
i0.ɵɵ
|
|
31
|
+
i0.ɵɵelementEnd();
|
|
25
32
|
} if (rf & 2) {
|
|
26
33
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
27
34
|
i0.ɵɵadvance();
|
|
28
35
|
i0.ɵɵtextInterpolate(ctx_r0.placeholder);
|
|
29
36
|
} }
|
|
30
|
-
function
|
|
31
|
-
i0.ɵɵ
|
|
32
|
-
i0.ɵɵtext(1
|
|
33
|
-
i0.ɵɵ
|
|
37
|
+
function Select_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
38
|
+
i0.ɵɵelementStart(0, "option", 4);
|
|
39
|
+
i0.ɵɵtext(1);
|
|
40
|
+
i0.ɵɵelementEnd();
|
|
41
|
+
} if (rf & 2) {
|
|
42
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
43
|
+
i0.ɵɵadvance();
|
|
44
|
+
i0.ɵɵtextInterpolate(ctx_r0.clearText());
|
|
34
45
|
} }
|
|
35
|
-
function
|
|
36
|
-
i0.ɵɵ
|
|
46
|
+
function Select_For_7_Conditional_0_For_1_Template(rf, ctx) { if (rf & 1) {
|
|
47
|
+
i0.ɵɵelementStart(0, "option");
|
|
37
48
|
i0.ɵɵtext(1);
|
|
38
|
-
i0.ɵɵ
|
|
49
|
+
i0.ɵɵelementEnd();
|
|
39
50
|
} if (rf & 2) {
|
|
40
51
|
const option_r2 = ctx.$implicit;
|
|
41
|
-
i0.ɵɵ
|
|
52
|
+
i0.ɵɵattribute("value", option_r2.value)("disabled", option_r2.disabled ? "" : null);
|
|
42
53
|
i0.ɵɵadvance();
|
|
43
54
|
i0.ɵɵtextInterpolate1(" ", option_r2.label, " ");
|
|
44
55
|
} }
|
|
45
|
-
function
|
|
46
|
-
i0.ɵɵ
|
|
56
|
+
function Select_For_7_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
57
|
+
i0.ɵɵrepeaterCreate(0, Select_For_7_Conditional_0_For_1_Template, 2, 3, "option", null, _forTrack0);
|
|
58
|
+
} if (rf & 2) {
|
|
59
|
+
const entry_r3 = i0.ɵɵnextContext().$implicit;
|
|
60
|
+
i0.ɵɵrepeater(entry_r3.options);
|
|
61
|
+
} }
|
|
62
|
+
function Select_For_7_Conditional_1_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
63
|
+
i0.ɵɵelementStart(0, "option");
|
|
64
|
+
i0.ɵɵtext(1);
|
|
65
|
+
i0.ɵɵelementEnd();
|
|
66
|
+
} if (rf & 2) {
|
|
67
|
+
const option_r4 = ctx.$implicit;
|
|
68
|
+
i0.ɵɵattribute("value", option_r4.value)("disabled", option_r4.disabled ? "" : null);
|
|
69
|
+
i0.ɵɵadvance();
|
|
70
|
+
i0.ɵɵtextInterpolate1(" ", option_r4.label, " ");
|
|
71
|
+
} }
|
|
72
|
+
function Select_For_7_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
73
|
+
i0.ɵɵelementStart(0, "optgroup");
|
|
74
|
+
i0.ɵɵrepeaterCreate(1, Select_For_7_Conditional_1_For_2_Template, 2, 3, "option", null, _forTrack0);
|
|
75
|
+
i0.ɵɵelementEnd();
|
|
76
|
+
} if (rf & 2) {
|
|
77
|
+
const entry_r3 = i0.ɵɵnextContext().$implicit;
|
|
78
|
+
i0.ɵɵattribute("label", entry_r3.group);
|
|
79
|
+
i0.ɵɵadvance();
|
|
80
|
+
i0.ɵɵrepeater(entry_r3.options);
|
|
81
|
+
} }
|
|
82
|
+
function Select_For_7_Template(rf, ctx) { if (rf & 1) {
|
|
83
|
+
i0.ɵɵconditionalCreate(0, Select_For_7_Conditional_0_Template, 2, 0)(1, Select_For_7_Conditional_1_Template, 3, 1, "optgroup");
|
|
84
|
+
} if (rf & 2) {
|
|
85
|
+
const entry_r3 = ctx.$implicit;
|
|
86
|
+
i0.ɵɵconditional(entry_r3.group === "" ? 0 : 1);
|
|
87
|
+
} }
|
|
88
|
+
function Select_Conditional_10_Template(rf, ctx) { if (rf & 1) {
|
|
89
|
+
i0.ɵɵelementStart(0, "p");
|
|
47
90
|
i0.ɵɵtext(1);
|
|
48
|
-
i0.ɵɵ
|
|
91
|
+
i0.ɵɵelementEnd();
|
|
49
92
|
} if (rf & 2) {
|
|
50
93
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
51
|
-
i0.ɵɵclassMap(ctx_r0.
|
|
52
|
-
i0.ɵɵ
|
|
94
|
+
i0.ɵɵclassMap(ctx_r0.cm().formError);
|
|
95
|
+
i0.ɵɵattribute("id", ctx_r0.selectId() + "-error");
|
|
53
96
|
i0.ɵɵadvance();
|
|
54
|
-
i0.ɵɵ
|
|
97
|
+
i0.ɵɵtextInterpolate(ctx_r0.error);
|
|
55
98
|
} }
|
|
56
|
-
function
|
|
57
|
-
i0.ɵɵ
|
|
99
|
+
function Select_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
100
|
+
i0.ɵɵelementStart(0, "p");
|
|
58
101
|
i0.ɵɵtext(1);
|
|
59
|
-
i0.ɵɵ
|
|
102
|
+
i0.ɵɵelementEnd();
|
|
60
103
|
} if (rf & 2) {
|
|
61
104
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
62
|
-
i0.ɵɵclassMap(ctx_r0.
|
|
63
|
-
i0.ɵɵ
|
|
105
|
+
i0.ɵɵclassMap(ctx_r0.cm().formHint);
|
|
106
|
+
i0.ɵɵattribute("id", ctx_r0.selectId() + "-hint");
|
|
64
107
|
i0.ɵɵadvance();
|
|
65
|
-
i0.ɵɵ
|
|
108
|
+
i0.ɵɵtextInterpolate(ctx_r0.hint);
|
|
66
109
|
} }
|
|
67
110
|
/**
|
|
68
|
-
*
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
*
|
|
111
|
+
* Select component.
|
|
112
|
+
*
|
|
113
|
+
* The host is the `div.inputWrapper` React renders. React's select value is
|
|
114
|
+
* written through the value PROPERTY (a `select` has no value attribute);
|
|
115
|
+
* a controlled `value` is restored after a change exactly like React's
|
|
116
|
+
* controlled-input state restore.
|
|
72
117
|
*/
|
|
73
|
-
export class
|
|
74
|
-
options
|
|
118
|
+
export class Select {
|
|
119
|
+
/** The options to render. */
|
|
120
|
+
options;
|
|
121
|
+
/** Controlled value. */
|
|
75
122
|
value;
|
|
76
|
-
|
|
123
|
+
/** Uncontrolled initial value. */
|
|
124
|
+
defaultValue;
|
|
125
|
+
/** Select size. */
|
|
126
|
+
size;
|
|
127
|
+
/** Field label. */
|
|
77
128
|
label;
|
|
129
|
+
/** Placeholder option (disabled, empty value). */
|
|
78
130
|
placeholder;
|
|
131
|
+
/** Error message (associates via aria-describedby). */
|
|
79
132
|
error;
|
|
133
|
+
/** Hint text (shown without an error). */
|
|
80
134
|
hint;
|
|
81
|
-
|
|
135
|
+
/** Whether a "no selection" option is added (suppressed by a placeholder). */
|
|
136
|
+
clearable;
|
|
137
|
+
/** Extra classes joined onto the select classes. */
|
|
82
138
|
className;
|
|
139
|
+
/** Inline style object (React camelCase). */
|
|
140
|
+
style;
|
|
141
|
+
/** `data-testid` for the select. */
|
|
83
142
|
testId;
|
|
84
|
-
|
|
85
|
-
|
|
143
|
+
/** Disables the select. */
|
|
144
|
+
disabled;
|
|
145
|
+
/** Marks the select required (label styling). */
|
|
146
|
+
required;
|
|
147
|
+
/** Form field name. */
|
|
86
148
|
name;
|
|
149
|
+
/** Explicit select id. */
|
|
87
150
|
id;
|
|
151
|
+
/** Fires the raw `change` event (React's onChange). */
|
|
152
|
+
change = new EventEmitter();
|
|
153
|
+
/** Fires the selected option's value. */
|
|
88
154
|
valueChange = new EventEmitter();
|
|
89
|
-
|
|
155
|
+
/** The native select (React's `...rest` spread target). */
|
|
156
|
+
selectEl;
|
|
157
|
+
host = inject(ElementRef);
|
|
90
158
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
159
|
+
* Reactive translation, read in the injection context. Its `t` reads the
|
|
160
|
+
* locale, so the view re-renders the text on a locale switch (the static `t`
|
|
161
|
+
* does not).
|
|
93
162
|
*/
|
|
94
|
-
|
|
163
|
+
i18n = useTranslation();
|
|
164
|
+
/** The `aria-describedby` the caller spread onto the host (React's rest). */
|
|
165
|
+
restDescribedBy = null;
|
|
166
|
+
/** Whether the rest-describedby value was captured. */
|
|
167
|
+
restDescribedByCaptured = false;
|
|
168
|
+
/**
|
|
169
|
+
* The current class map.
|
|
170
|
+
* @returns The UIClassMap.
|
|
171
|
+
*/
|
|
172
|
+
cm() {
|
|
95
173
|
return getClassMap();
|
|
96
174
|
}
|
|
97
175
|
/**
|
|
98
|
-
*
|
|
99
|
-
*
|
|
176
|
+
* The select id (`id`, `name`, or a stable generated id; the DOM normalizer
|
|
177
|
+
* renumbers generated ids in order of appearance, like React's `useId`).
|
|
178
|
+
* @returns The id value.
|
|
100
179
|
*/
|
|
101
|
-
|
|
102
|
-
return this.
|
|
180
|
+
selectId() {
|
|
181
|
+
return this.id || this.fieldContext()?.id || this.name || 'r0';
|
|
103
182
|
}
|
|
104
183
|
/**
|
|
105
|
-
*
|
|
106
|
-
* @returns The
|
|
184
|
+
* The aria-describedby target (error or hint paragraph).
|
|
185
|
+
* @returns The id or null.
|
|
107
186
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
187
|
+
describedBy() {
|
|
188
|
+
if (this.error)
|
|
189
|
+
return `${this.selectId()}-error`;
|
|
190
|
+
if (this.hint)
|
|
191
|
+
return `${this.selectId()}-hint`;
|
|
192
|
+
return null;
|
|
110
193
|
}
|
|
111
194
|
/**
|
|
112
|
-
*
|
|
113
|
-
* @returns The
|
|
195
|
+
* The nearest enclosing `FormField` context (React's cloned props).
|
|
196
|
+
* @returns The context, or null.
|
|
114
197
|
*/
|
|
115
|
-
|
|
116
|
-
return this.
|
|
198
|
+
fieldContext() {
|
|
199
|
+
return fieldContext(this.host.nativeElement);
|
|
117
200
|
}
|
|
118
201
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
202
|
+
* The final `aria-describedby`: a rest-provided value first, then the
|
|
203
|
+
* enclosing FormField's error/hint target (React's cloneElement join).
|
|
204
|
+
* @returns The attribute value, or null.
|
|
121
205
|
*/
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
206
|
+
mergedDescribedBy() {
|
|
207
|
+
const target = this.fieldContext()?.describedBy;
|
|
208
|
+
if (target)
|
|
209
|
+
return [this.restDescribedBy, target].filter(Boolean).join(' ');
|
|
210
|
+
return this.restDescribedBy ?? this.describedBy();
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Computes the select class list.
|
|
214
|
+
* @returns The class string.
|
|
215
|
+
*/
|
|
216
|
+
classes() {
|
|
217
|
+
return this.cm().cn(this.cm().select({ error: !!this.error, size: this.size ?? 'md' }), this.cm().selectNative, this.cm().inputPadRight, this.className);
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* The clear option's label.
|
|
221
|
+
* @returns The label text.
|
|
222
|
+
*/
|
|
223
|
+
clearText() {
|
|
224
|
+
return this.i18n.t('ui.select.clear', undefined, { defaultValue: '--' });
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The chevron glyph, classed like React's inline icon.
|
|
228
|
+
* @returns The resolved icon.
|
|
229
|
+
*/
|
|
230
|
+
chevron() {
|
|
231
|
+
return resolveIcon('chevron-down', this.cm().cn(this.cm().iconSm, this.cm().textMuted));
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Groups the options by their `group` property, preserving insertion order
|
|
235
|
+
* (ungrouped options land under the `''` key, exactly like React's reduce).
|
|
236
|
+
* @returns The ordered group entries.
|
|
237
|
+
*/
|
|
238
|
+
optionGroups() {
|
|
239
|
+
const acc = new Map();
|
|
240
|
+
for (const option of this.options ?? []) {
|
|
241
|
+
const group = option.group || '';
|
|
242
|
+
const list = acc.get(group);
|
|
243
|
+
if (list)
|
|
244
|
+
list.push(option);
|
|
245
|
+
else
|
|
246
|
+
acc.set(group, [option]);
|
|
247
|
+
}
|
|
248
|
+
return [...acc.entries()].map(([group, options]) => ({ group, options }));
|
|
249
|
+
}
|
|
250
|
+
/**
|
|
251
|
+
* Serializes the inline style for the select.
|
|
252
|
+
* @returns The style attribute text.
|
|
253
|
+
*/
|
|
254
|
+
hostStyle() {
|
|
255
|
+
return styleText(this.style);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* React's change handler: the raw event first, then the selected value; the
|
|
259
|
+
* event never reaches the host, where the `change` output binding would
|
|
260
|
+
* record it a second time. A controlled select is restored afterwards.
|
|
261
|
+
*
|
|
262
|
+
* @param event - The native change event.
|
|
263
|
+
*/
|
|
264
|
+
handleChange(event) {
|
|
265
|
+
event.stopPropagation();
|
|
266
|
+
this.change.emit(event);
|
|
267
|
+
this.valueChange.emit(event.target.value);
|
|
268
|
+
this.applyValue(false);
|
|
128
269
|
}
|
|
129
270
|
/**
|
|
130
|
-
*
|
|
131
|
-
*
|
|
271
|
+
* Moves rest attributes onto the select and applies the initial value (a
|
|
272
|
+
* select's value lives on the PROPERTY; the options must exist first).
|
|
132
273
|
*/
|
|
133
|
-
|
|
134
|
-
|
|
274
|
+
ngAfterViewInit() {
|
|
275
|
+
if (!this.restDescribedByCaptured) {
|
|
276
|
+
this.restDescribedBy = this.host.nativeElement.getAttribute('aria-describedby');
|
|
277
|
+
this.restDescribedByCaptured = true;
|
|
278
|
+
}
|
|
279
|
+
moveRestAttributes(this.host.nativeElement, this.selectEl?.nativeElement);
|
|
280
|
+
this.applyValue(true);
|
|
135
281
|
}
|
|
136
282
|
/**
|
|
137
|
-
*
|
|
138
|
-
*
|
|
283
|
+
* Re-applies a controlled value after every check (React re-renders the
|
|
284
|
+
* value prop whenever it changes).
|
|
139
285
|
*/
|
|
140
|
-
|
|
141
|
-
|
|
286
|
+
ngAfterViewChecked() {
|
|
287
|
+
this.applyValue(false);
|
|
142
288
|
}
|
|
143
289
|
/**
|
|
144
|
-
*
|
|
145
|
-
*
|
|
290
|
+
* Writes the value to the select: the controlled `value` through the value
|
|
291
|
+
* property every check — but ONLY when an option carries it (a value with
|
|
292
|
+
* no matching option leaves the default first-option selection, matching
|
|
293
|
+
* React's goldens; the bare property setter would clear the selection) —
|
|
294
|
+
* and the `defaultValue` at mount through the matching option's `selected`
|
|
295
|
+
* attribute (React renders defaultSelected as the attribute). A `multiple`
|
|
296
|
+
* select with neither prop renders with nothing selected.
|
|
297
|
+
*
|
|
298
|
+
* @param initial - Whether this is the mount pass.
|
|
146
299
|
*/
|
|
147
|
-
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
300
|
+
applyValue(initial) {
|
|
301
|
+
const select = this.selectEl?.nativeElement;
|
|
302
|
+
if (!select)
|
|
303
|
+
return;
|
|
304
|
+
if (this.value !== undefined) {
|
|
305
|
+
const next = String(this.value);
|
|
306
|
+
if (select.value !== next && Array.from(select.options).some((o) => o.value === next))
|
|
307
|
+
select.value = next;
|
|
308
|
+
}
|
|
309
|
+
else if (initial) {
|
|
310
|
+
if (this.defaultValue !== undefined) {
|
|
311
|
+
const target = String(this.defaultValue);
|
|
312
|
+
for (const option of Array.from(select.options)) {
|
|
313
|
+
if (option.value === target)
|
|
314
|
+
option.setAttribute('selected', '');
|
|
315
|
+
else
|
|
316
|
+
option.removeAttribute('selected');
|
|
317
|
+
}
|
|
318
|
+
if (select.value !== target)
|
|
319
|
+
select.value = target;
|
|
320
|
+
}
|
|
321
|
+
else if (select.multiple) {
|
|
322
|
+
select.selectedIndex = -1;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
151
325
|
}
|
|
152
|
-
static ɵfac = function
|
|
153
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
154
|
-
i0.ɵɵ
|
|
155
|
-
i0.ɵɵconditionalCreate(1, MoleculeSelect_Conditional_1_Template, 2, 4, "label", 0);
|
|
156
|
-
i0.ɵɵdomElementStart(2, "div")(3, "select", 1);
|
|
157
|
-
i0.ɵɵdomListener("change", function MoleculeSelect_Template_select_change_3_listener($event) { return ctx.onSelectChange($event); });
|
|
158
|
-
i0.ɵɵconditionalCreate(4, MoleculeSelect_Conditional_4_Template, 2, 1, "option", 2);
|
|
159
|
-
i0.ɵɵconditionalCreate(5, MoleculeSelect_Conditional_5_Template, 2, 0, "option", 3);
|
|
160
|
-
i0.ɵɵrepeaterCreate(6, MoleculeSelect_For_7_Template, 2, 3, "option", 4, _forTrack0);
|
|
161
|
-
i0.ɵɵdomElementEnd()();
|
|
162
|
-
i0.ɵɵconditionalCreate(8, MoleculeSelect_Conditional_8_Template, 2, 4, "p", 5);
|
|
163
|
-
i0.ɵɵconditionalCreate(9, MoleculeSelect_Conditional_9_Template, 2, 4, "p", 5);
|
|
164
|
-
i0.ɵɵdomElementEnd();
|
|
326
|
+
static ɵfac = function Select_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Select)(); };
|
|
327
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Select, selectors: [["div", "mol-select", ""]], viewQuery: function Select_Query(rf, ctx) { if (rf & 1) {
|
|
328
|
+
i0.ɵɵviewQuery(_c0, 5);
|
|
165
329
|
} if (rf & 2) {
|
|
166
|
-
|
|
167
|
-
i0.ɵɵ
|
|
168
|
-
|
|
169
|
-
i0.ɵɵ
|
|
170
|
-
|
|
330
|
+
let _t;
|
|
331
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.selectEl = _t.first);
|
|
332
|
+
} }, hostVars: 2, hostBindings: function Select_HostBindings(rf, ctx) { if (rf & 2) {
|
|
333
|
+
i0.ɵɵclassMap(ctx.cm().inputWrapper);
|
|
334
|
+
} }, inputs: { options: "options", value: "value", defaultValue: "defaultValue", size: "size", label: "label", placeholder: "placeholder", error: "error", hint: "hint", clearable: "clearable", className: "className", style: "style", testId: "testId", disabled: "disabled", required: "required", name: "name", id: "id" }, outputs: { change: "change", valueChange: "valueChange" }, decls: 12, vars: 21, consts: [["selectEl", ""], [3, "class"], [3, "change", "disabled"], ["value", "", "disabled", ""], ["value", ""], ["mol-icon", "", 3, "data"]], template: function Select_Template(rf, ctx) { if (rf & 1) {
|
|
335
|
+
i0.ɵɵconditionalCreate(0, Select_Conditional_0_Template, 2, 6, "label", 1);
|
|
336
|
+
i0.ɵɵelementStart(1, "div")(2, "select", 2, 0);
|
|
337
|
+
i0.ɵɵlistener("change", function Select_Template_select_change_2_listener($event) { return ctx.handleChange($event); });
|
|
338
|
+
i0.ɵɵconditionalCreate(4, Select_Conditional_4_Template, 2, 1, "option", 3);
|
|
339
|
+
i0.ɵɵconditionalCreate(5, Select_Conditional_5_Template, 2, 1, "option", 4);
|
|
340
|
+
i0.ɵɵrepeaterCreate(6, Select_For_7_Template, 2, 1, null, null, i0.ɵɵrepeaterTrackByIndex);
|
|
341
|
+
i0.ɵɵelementEnd();
|
|
342
|
+
i0.ɵɵelementStart(8, "div");
|
|
343
|
+
i0.ɵɵnamespaceSVG();
|
|
344
|
+
i0.ɵɵelement(9, "svg", 5);
|
|
345
|
+
i0.ɵɵelementEnd()();
|
|
346
|
+
i0.ɵɵconditionalCreate(10, Select_Conditional_10_Template, 2, 4, "p", 1);
|
|
347
|
+
i0.ɵɵconditionalCreate(11, Select_Conditional_11_Template, 2, 4, "p", 1);
|
|
348
|
+
} if (rf & 2) {
|
|
349
|
+
i0.ɵɵconditional(ctx.label ? 0 : -1);
|
|
171
350
|
i0.ɵɵadvance();
|
|
172
|
-
i0.ɵɵclassMap(ctx.
|
|
173
|
-
i0.ɵɵdomProperty("id", ctx.selectId)("name", ctx.name)("value", ctx.value)("disabled", ctx.disabled)("required", ctx.required);
|
|
174
|
-
i0.ɵɵattribute("aria-invalid", !!ctx.error)("aria-describedby", ctx.ariaDescribedBy)("data-testid", ctx.testId);
|
|
351
|
+
i0.ɵɵclassMap(ctx.cm().inputInner);
|
|
175
352
|
i0.ɵɵadvance();
|
|
353
|
+
i0.ɵɵclassMap(ctx.classes());
|
|
354
|
+
i0.ɵɵproperty("disabled", ctx.disabled);
|
|
355
|
+
i0.ɵɵattribute("id", ctx.selectId())("name", ctx.name)("required", ctx.required ? "" : null)("aria-invalid", ctx.error || ctx.fieldContext()?.invalid ? "true" : "false")("aria-describedby", ctx.mergedDescribedBy())("style", ctx.hostStyle(), i0.ɵɵsanitizeStyle)("data-testid", ctx.testId);
|
|
356
|
+
i0.ɵɵadvance(2);
|
|
176
357
|
i0.ɵɵconditional(ctx.placeholder ? 4 : -1);
|
|
177
358
|
i0.ɵɵadvance();
|
|
178
|
-
i0.ɵɵconditional(ctx.clearable ? 5 : -1);
|
|
359
|
+
i0.ɵɵconditional(ctx.clearable && !ctx.placeholder ? 5 : -1);
|
|
179
360
|
i0.ɵɵadvance();
|
|
180
|
-
i0.ɵɵrepeater(ctx.
|
|
361
|
+
i0.ɵɵrepeater(ctx.optionGroups());
|
|
181
362
|
i0.ɵɵadvance(2);
|
|
182
|
-
i0.ɵɵ
|
|
363
|
+
i0.ɵɵclassMap(ctx.cm().inputRightElement);
|
|
364
|
+
i0.ɵɵattribute("style", "pointer-events: none", i0.ɵɵsanitizeStyle);
|
|
365
|
+
i0.ɵɵadvance();
|
|
366
|
+
i0.ɵɵproperty("data", ctx.chevron());
|
|
183
367
|
i0.ɵɵadvance();
|
|
184
|
-
i0.ɵɵconditional(ctx.
|
|
185
|
-
|
|
368
|
+
i0.ɵɵconditional(ctx.error ? 10 : -1);
|
|
369
|
+
i0.ɵɵadvance();
|
|
370
|
+
i0.ɵɵconditional(ctx.hint && !ctx.error ? 11 : -1);
|
|
371
|
+
} }, dependencies: [MolIconSvg], encapsulation: 2 });
|
|
186
372
|
}
|
|
187
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(
|
|
373
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Select, [{
|
|
188
374
|
type: Component,
|
|
189
375
|
args: [{
|
|
190
|
-
selector: 'mol-select',
|
|
376
|
+
selector: 'div[mol-select]',
|
|
191
377
|
standalone: true,
|
|
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
|
-
|
|
378
|
+
imports: [MolIconSvg],
|
|
379
|
+
inputs: [
|
|
380
|
+
'options',
|
|
381
|
+
'value',
|
|
382
|
+
'defaultValue',
|
|
383
|
+
'size',
|
|
384
|
+
'label',
|
|
385
|
+
'placeholder',
|
|
386
|
+
'error',
|
|
387
|
+
'hint',
|
|
388
|
+
'clearable',
|
|
389
|
+
'className',
|
|
390
|
+
'style',
|
|
391
|
+
'testId',
|
|
392
|
+
'disabled',
|
|
393
|
+
'required',
|
|
394
|
+
'name',
|
|
395
|
+
'id',
|
|
396
|
+
],
|
|
397
|
+
host: {
|
|
398
|
+
'[class]': 'cm().inputWrapper',
|
|
399
|
+
},
|
|
400
|
+
template: `@if (label) {
|
|
401
|
+
<label
|
|
402
|
+
[attr.for]="selectId()"
|
|
403
|
+
[class]="cm().cn(cm().label({ required: !!required }), cm().labelBlock)"
|
|
404
|
+
>{{ label }}</label
|
|
405
|
+
>
|
|
406
|
+
}
|
|
407
|
+
<div [class]="cm().inputInner">
|
|
408
|
+
<select
|
|
409
|
+
[attr.id]="selectId()"
|
|
410
|
+
[attr.name]="name"
|
|
411
|
+
[disabled]="disabled"
|
|
412
|
+
[attr.required]="required ? '' : null"
|
|
413
|
+
[attr.aria-invalid]="error || fieldContext()?.invalid ? 'true' : 'false'"
|
|
414
|
+
[attr.aria-describedby]="mergedDescribedBy()"
|
|
415
|
+
[class]="classes()"
|
|
416
|
+
[attr.style]="hostStyle()"
|
|
417
|
+
[attr.data-testid]="testId"
|
|
418
|
+
(change)="handleChange($event)"
|
|
419
|
+
#selectEl
|
|
420
|
+
>
|
|
421
|
+
@if (placeholder) {
|
|
422
|
+
<option value="" disabled>{{ placeholder }}</option>
|
|
423
|
+
}
|
|
424
|
+
@if (clearable && !placeholder) {
|
|
425
|
+
<option value="">{{ clearText() }}</option>
|
|
426
|
+
}
|
|
427
|
+
@for (entry of optionGroups(); track $index) {
|
|
428
|
+
@if (entry.group === '') {
|
|
429
|
+
@for (option of entry.options; track option.value) {
|
|
430
|
+
<option [attr.value]="option.value" [attr.disabled]="option.disabled ? '' : null">
|
|
431
|
+
{{ option.label }}
|
|
432
|
+
</option>
|
|
433
|
+
}
|
|
434
|
+
} @else {
|
|
435
|
+
<optgroup [attr.label]="entry.group">
|
|
436
|
+
@for (option of entry.options; track option.value) {
|
|
437
|
+
<option [attr.value]="option.value" [attr.disabled]="option.disabled ? '' : null">
|
|
438
|
+
{{ option.label }}
|
|
439
|
+
</option>
|
|
440
|
+
}
|
|
441
|
+
</optgroup>
|
|
223
442
|
}
|
|
224
|
-
|
|
443
|
+
}
|
|
444
|
+
</select>
|
|
445
|
+
<div [class]="cm().inputRightElement" [attr.style]="'pointer-events: none'">
|
|
446
|
+
<svg mol-icon [data]="chevron()" />
|
|
225
447
|
</div>
|
|
226
|
-
@if (error) {
|
|
227
|
-
<p [id]="selectId + '-error'" [class]="formErrorClass">
|
|
228
|
-
{{ error }}
|
|
229
|
-
</p>
|
|
230
|
-
}
|
|
231
|
-
@if (hint && !error) {
|
|
232
|
-
<p [id]="selectId + '-hint'" [class]="formHintClass">
|
|
233
|
-
{{ hint }}
|
|
234
|
-
</p>
|
|
235
|
-
}
|
|
236
448
|
</div>
|
|
237
|
-
|
|
449
|
+
@if (error) {
|
|
450
|
+
<p [attr.id]="selectId() + '-error'" [class]="cm().formError">{{ error }}</p>
|
|
451
|
+
}
|
|
452
|
+
@if (hint && !error) {
|
|
453
|
+
<p [attr.id]="selectId() + '-hint'" [class]="cm().formHint">{{ hint }}</p>
|
|
454
|
+
}`,
|
|
238
455
|
}]
|
|
239
|
-
}], null, {
|
|
240
|
-
type: Input
|
|
241
|
-
}], value: [{
|
|
242
|
-
type: Input
|
|
243
|
-
}], size: [{
|
|
244
|
-
type: Input
|
|
245
|
-
}], label: [{
|
|
246
|
-
type: Input
|
|
247
|
-
}], placeholder: [{
|
|
248
|
-
type: Input
|
|
249
|
-
}], error: [{
|
|
250
|
-
type: Input
|
|
251
|
-
}], hint: [{
|
|
252
|
-
type: Input
|
|
253
|
-
}], clearable: [{
|
|
254
|
-
type: Input
|
|
255
|
-
}], className: [{
|
|
256
|
-
type: Input
|
|
257
|
-
}], testId: [{
|
|
258
|
-
type: Input
|
|
259
|
-
}], disabled: [{
|
|
260
|
-
type: Input
|
|
261
|
-
}], required: [{
|
|
262
|
-
type: Input
|
|
263
|
-
}], name: [{
|
|
264
|
-
type: Input
|
|
265
|
-
}], id: [{
|
|
266
|
-
type: Input
|
|
267
|
-
}], valueChange: [{
|
|
456
|
+
}], null, { change: [{
|
|
268
457
|
type: Output
|
|
269
|
-
}],
|
|
458
|
+
}], valueChange: [{
|
|
270
459
|
type: Output
|
|
460
|
+
}], selectEl: [{
|
|
461
|
+
type: ViewChild,
|
|
462
|
+
args: ['selectEl']
|
|
271
463
|
}] }); })();
|
|
272
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(
|
|
464
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Select, { className: "Select", filePath: "components/select.component.ts", lineNumber: 129 }); })();
|
|
273
465
|
//# sourceMappingURL=select.component.js.map
|