@memberjunction/ng-ui-components 6.1.0-edge.5 → 6.1.0-edge.7
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/dist/lib/alert/alert.component.d.ts.map +1 -1
- package/dist/lib/alert/alert.component.js +1 -1
- package/dist/lib/applied-filters/applied-filters.component.js +1 -1
- package/dist/lib/bottom-sheet/bottom-sheet.component.js +1 -1
- package/dist/lib/combobox/combobox.component.d.ts +32 -1
- package/dist/lib/combobox/combobox.component.d.ts.map +1 -1
- package/dist/lib/combobox/combobox.component.js +73 -28
- package/dist/lib/combobox/combobox.component.js.map +1 -1
- package/dist/lib/confirm-dialog/confirm-dialog.component.d.ts.map +1 -1
- package/dist/lib/datepicker/datepicker.component.d.ts +25 -1
- package/dist/lib/datepicker/datepicker.component.d.ts.map +1 -1
- package/dist/lib/datepicker/datepicker.component.js +59 -28
- package/dist/lib/datepicker/datepicker.component.js.map +1 -1
- package/dist/lib/dialog/dialog.component.js +1 -1
- package/dist/lib/dialog/dialog.component.js.map +1 -1
- package/dist/lib/dialog/dialog.service.d.ts.map +1 -1
- package/dist/lib/dialog/dialog.service.js +18 -19
- package/dist/lib/dialog/dialog.service.js.map +1 -1
- package/dist/lib/dropdown/dropdown.component.d.ts +36 -1
- package/dist/lib/dropdown/dropdown.component.d.ts.map +1 -1
- package/dist/lib/dropdown/dropdown.component.js +91 -40
- package/dist/lib/dropdown/dropdown.component.js.map +1 -1
- package/dist/lib/empty-state/empty-state.component.js +1 -1
- package/dist/lib/filter-popover/filter-popover.component.js +27 -28
- package/dist/lib/filter-popover/filter-popover.component.js.map +1 -1
- package/dist/lib/left-nav/left-nav-content.component.js +1 -1
- package/dist/lib/left-nav/left-nav.component.js +72 -73
- package/dist/lib/left-nav/left-nav.component.js.map +1 -1
- package/dist/lib/numeric-input/numeric-input.component.d.ts +22 -1
- package/dist/lib/numeric-input/numeric-input.component.d.ts.map +1 -1
- package/dist/lib/numeric-input/numeric-input.component.js +30 -3
- package/dist/lib/numeric-input/numeric-input.component.js.map +1 -1
- package/dist/lib/page-body/page-body.component.js +1 -1
- package/dist/lib/page-body-interior/page-body-interior.component.js +1 -1
- package/dist/lib/page-header/page-header.component.js +1 -1
- package/dist/lib/page-header-interior/page-header-interior.component.js +1 -1
- package/dist/lib/page-search/page-search.component.js +1 -1
- package/dist/lib/refresh-button/refresh-button.component.js +1 -1
- package/dist/lib/slide-panel/slide-panel.component.js +1 -1
- package/dist/lib/stat-badge/stat-badge.component.js +1 -1
- package/dist/lib/switch/switch.component.d.ts +22 -1
- package/dist/lib/switch/switch.component.d.ts.map +1 -1
- package/dist/lib/switch/switch.component.js +30 -3
- package/dist/lib/switch/switch.component.js.map +1 -1
- package/dist/lib/tab-nav/tab-nav.component.js +1 -1
- package/dist/lib/view-toggle/view-toggle.component.js +1 -1
- package/dist/lib/window/window.component.js +1 -1
- package/dist/lib/window/window.component.js.map +1 -1
- package/dist/lib/workspace-tabs/workspace-card.component.js +1 -1
- package/dist/lib/workspace-tabs/workspace-tab-strip.component.js +1 -1
- package/package.json +8 -8
|
@@ -68,7 +68,14 @@ export declare class MJDropdownComponent implements ControlValueAccessor, OnDest
|
|
|
68
68
|
ValueField: string;
|
|
69
69
|
Filterable: boolean;
|
|
70
70
|
ValuePrimitive: boolean;
|
|
71
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Host-driven disable. Composed with Angular Forms' `setDisabledState()` into `IsDisabled`
|
|
73
|
+
* (the actual gate) — see `syncDisabled`. A setter, not a bare field, because this input is
|
|
74
|
+
* routinely bound to an expression that changes over the control's lifetime
|
|
75
|
+
* (`[Disabled]="!draft.CompanyID"`), and the gate has to follow it every time.
|
|
76
|
+
*/
|
|
77
|
+
set Disabled(value: boolean);
|
|
78
|
+
get Disabled(): boolean;
|
|
72
79
|
Placeholder: string;
|
|
73
80
|
DefaultItem: Record<string, unknown> | string | null;
|
|
74
81
|
FilterChange: EventEmitter<string>;
|
|
@@ -106,6 +113,11 @@ export declare class MJDropdownComponent implements ControlValueAccessor, OnDest
|
|
|
106
113
|
*/
|
|
107
114
|
get FilterLabel(): string;
|
|
108
115
|
IsOpen: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* The single gate on `Toggle()` / `Open()` — true when EITHER the `Disabled` input or Angular
|
|
118
|
+
* Forms says so. Never assign it directly; go through `syncDisabled()` so both sources are
|
|
119
|
+
* always composed and a lock closes an open panel.
|
|
120
|
+
*/
|
|
109
121
|
IsDisabled: boolean;
|
|
110
122
|
HighlightedIndex: number;
|
|
111
123
|
SelectedValue: unknown;
|
|
@@ -114,12 +126,35 @@ export declare class MJDropdownComponent implements ControlValueAccessor, OnDest
|
|
|
114
126
|
Positions: ConnectedPosition[];
|
|
115
127
|
private onChange;
|
|
116
128
|
private onTouched;
|
|
129
|
+
/** Backing field for the `Disabled` input. */
|
|
130
|
+
private disabledInput;
|
|
131
|
+
/** The forms-driven disabled state, kept SEPARATE so neither source can stomp the other. */
|
|
132
|
+
private formDisabled;
|
|
133
|
+
/**
|
|
134
|
+
* Recompute the gate from both of its sources. Called whenever either changes.
|
|
135
|
+
*
|
|
136
|
+
* `IsDisabled` is derived state, and the only thing that assigned it was `setDisabledState()`.
|
|
137
|
+
* The forms-driven half was in fact fine — `setUpControl` also wires `registerOnDisabledChange`,
|
|
138
|
+
* so that hook fires on every `control.disable()`/`enable()`, not just at registration. What had
|
|
139
|
+
* no recompute path at all was the `Disabled` @Input: a plain field, so the gate froze at
|
|
140
|
+
* whatever the first compose produced and every later change to the input was dropped.
|
|
141
|
+
*
|
|
142
|
+
* That is how a `[Disabled]="!draft.CompanyID"` picker stayed dead for the life of the
|
|
143
|
+
* component after the company was finally chosen.
|
|
144
|
+
*/
|
|
145
|
+
private syncDisabled;
|
|
117
146
|
get FilteredItems(): unknown[];
|
|
118
147
|
get HasValue(): boolean;
|
|
119
148
|
get DisplayText(): string;
|
|
120
149
|
Toggle(): void;
|
|
121
150
|
Open(): void;
|
|
122
151
|
Close(): void;
|
|
152
|
+
/**
|
|
153
|
+
* Panel state only — no change detection. Split out of `Close()` because `syncDisabled()` can
|
|
154
|
+
* run from an @Input setter, i.e. DURING the parent's change-detection pass, where a nested
|
|
155
|
+
* `detectChanges()` re-enters CD and trips NG0100 on the parent's own bindings.
|
|
156
|
+
*/
|
|
157
|
+
private resetPanelState;
|
|
123
158
|
SelectItem(item: unknown | null, event?: Event): void;
|
|
124
159
|
IsItemSelected(item: unknown): boolean;
|
|
125
160
|
OnFilterInput(event: Event): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.component.d.ts","sourceRoot":"","sources":["../../../src/lib/dropdown/dropdown.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAMZ,WAAW,EACX,SAAS,EAGV,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAqB,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAiB,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,qBA0Ga,mBAAoB,YAAW,oBAAoB,EAAE,SAAS;IACzE;;;;;OAKG;IACM,SAAS,SAAM;IAExB;;;;;;OAMG;IACM,cAAc,SAAM;IAE7B;;;;;OAKG;IACM,OAAO,SAAM;IAEtB,0FAA0F;IACjF,eAAe,SAAM;IAErB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,MAAM,EAAE,GAAG,SAAS,OAAO,EAAE,GAAG,IAAI,CAAM;IAC5E,SAAS,SAAM;IACf,UAAU,SAAM;IAChB,UAAU,UAAS;IACnB,cAAc,UAAS;
|
|
1
|
+
{"version":3,"file":"dropdown.component.d.ts","sourceRoot":"","sources":["../../../src/lib/dropdown/dropdown.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,YAAY,EAMZ,WAAW,EACX,SAAS,EAGV,MAAM,eAAe,CAAC;AAEvB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,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI;IACvC,gBAAgB,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI;IAC3C,WAAW,IAAI,IAAI;IAEnB,OAAO,CAAC,gBAAgB;yCApRb,mBAAmB;2CAAnB,mBAAmB;CAwR/B"}
|
|
@@ -9,33 +9,33 @@ const _c1 = ["trigger"];
|
|
|
9
9
|
const _c2 = ["filterInput"];
|
|
10
10
|
const _c3 = a0 => ({ $implicit: a0 });
|
|
11
11
|
function MJDropdownComponent_ng_template_6_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
12
|
-
const
|
|
12
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
13
13
|
i0.ɵɵelementStart(0, "div", 7)(1, "span", 11);
|
|
14
14
|
i0.ɵɵtext(2, "Filter");
|
|
15
15
|
i0.ɵɵelementEnd();
|
|
16
16
|
i0.ɵɵelementStart(3, "input", 12, 1);
|
|
17
|
-
i0.ɵɵlistener("input", function MJDropdownComponent_ng_template_6_Conditional_1_Template_input_input_3_listener($event) { i0.ɵɵrestoreView(
|
|
17
|
+
i0.ɵɵlistener("input", function MJDropdownComponent_ng_template_6_Conditional_1_Template_input_input_3_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnFilterInput($event)); })("keydown", function MJDropdownComponent_ng_template_6_Conditional_1_Template_input_keydown_3_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.OnKeyDown($event)); });
|
|
18
18
|
i0.ɵɵelementEnd()();
|
|
19
19
|
} if (rf & 2) {
|
|
20
|
-
const
|
|
20
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
21
21
|
i0.ɵɵadvance();
|
|
22
|
-
i0.ɵɵattribute("id",
|
|
22
|
+
i0.ɵɵattribute("id", ctx_r1.FilterWordId);
|
|
23
23
|
i0.ɵɵadvance(2);
|
|
24
|
-
i0.ɵɵproperty("value",
|
|
25
|
-
i0.ɵɵattribute("aria-labelledby",
|
|
24
|
+
i0.ɵɵproperty("value", ctx_r1.filterText);
|
|
25
|
+
i0.ɵɵattribute("aria-labelledby", ctx_r1.FilterLabelledBy)("aria-label", ctx_r1.FilterLabelledBy ? null : ctx_r1.FilterLabel);
|
|
26
26
|
} }
|
|
27
27
|
function MJDropdownComponent_ng_template_6_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
28
|
-
const
|
|
28
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
29
29
|
i0.ɵɵelementStart(0, "div", 13);
|
|
30
|
-
i0.ɵɵlistener("click", function MJDropdownComponent_ng_template_6_Conditional_2_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(
|
|
30
|
+
i0.ɵɵlistener("click", function MJDropdownComponent_ng_template_6_Conditional_2_Template_div_click_0_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.SelectItem(null, $event)); });
|
|
31
31
|
i0.ɵɵtext(1);
|
|
32
32
|
i0.ɵɵelementEnd();
|
|
33
33
|
} if (rf & 2) {
|
|
34
|
-
const
|
|
35
|
-
i0.ɵɵclassProp("mj-dropdown-option--selected",
|
|
36
|
-
i0.ɵɵattribute("aria-selected",
|
|
34
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
35
|
+
i0.ɵɵclassProp("mj-dropdown-option--selected", ctx_r1.SelectedValue == null)("mj-dropdown-option--highlighted", ctx_r1.HighlightedIndex === -1);
|
|
36
|
+
i0.ɵɵattribute("aria-selected", ctx_r1.SelectedValue == null);
|
|
37
37
|
i0.ɵɵadvance();
|
|
38
|
-
i0.ɵɵtextInterpolate1(" ",
|
|
38
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r1.GetItemText(ctx_r1.DefaultItem), " ");
|
|
39
39
|
} }
|
|
40
40
|
function MJDropdownComponent_ng_template_6_For_4_Conditional_1_ng_container_0_Template(rf, ctx) { if (rf & 1) {
|
|
41
41
|
i0.ɵɵelementContainer(0);
|
|
@@ -43,31 +43,31 @@ function MJDropdownComponent_ng_template_6_For_4_Conditional_1_ng_container_0_Te
|
|
|
43
43
|
function MJDropdownComponent_ng_template_6_For_4_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
44
44
|
i0.ɵɵtemplate(0, MJDropdownComponent_ng_template_6_For_4_Conditional_1_ng_container_0_Template, 1, 0, "ng-container", 15);
|
|
45
45
|
} if (rf & 2) {
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
i0.ɵɵproperty("ngTemplateOutlet",
|
|
46
|
+
const item_r5 = i0.ɵɵnextContext().$implicit;
|
|
47
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
48
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx_r1.itemTemplate)("ngTemplateOutletContext", i0.ɵɵpureFunction1(2, _c3, item_r5));
|
|
49
49
|
} }
|
|
50
50
|
function MJDropdownComponent_ng_template_6_For_4_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
51
51
|
i0.ɵɵtext(0);
|
|
52
52
|
} if (rf & 2) {
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
i0.ɵɵtextInterpolate1(" ",
|
|
53
|
+
const item_r5 = i0.ɵɵnextContext().$implicit;
|
|
54
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
55
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r1.GetItemText(item_r5), " ");
|
|
56
56
|
} }
|
|
57
57
|
function MJDropdownComponent_ng_template_6_For_4_Template(rf, ctx) { if (rf & 1) {
|
|
58
|
-
const
|
|
58
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
59
59
|
i0.ɵɵelementStart(0, "div", 14);
|
|
60
|
-
i0.ɵɵlistener("click", function MJDropdownComponent_ng_template_6_For_4_Template_div_click_0_listener($event) { const
|
|
60
|
+
i0.ɵɵlistener("click", function MJDropdownComponent_ng_template_6_For_4_Template_div_click_0_listener($event) { const item_r5 = i0.ɵɵrestoreView(_r4).$implicit; const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.SelectItem(item_r5, $event)); });
|
|
61
61
|
i0.ɵɵconditionalCreate(1, MJDropdownComponent_ng_template_6_For_4_Conditional_1_Template, 1, 4, "ng-container")(2, MJDropdownComponent_ng_template_6_For_4_Conditional_2_Template, 1, 1);
|
|
62
62
|
i0.ɵɵelementEnd();
|
|
63
63
|
} if (rf & 2) {
|
|
64
|
-
const
|
|
65
|
-
const $
|
|
66
|
-
const
|
|
67
|
-
i0.ɵɵclassProp("mj-dropdown-option--selected",
|
|
68
|
-
i0.ɵɵattribute("aria-selected",
|
|
64
|
+
const item_r5 = ctx.$implicit;
|
|
65
|
+
const $index_r6 = ctx.$index;
|
|
66
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
67
|
+
i0.ɵɵclassProp("mj-dropdown-option--selected", ctx_r1.IsItemSelected(item_r5))("mj-dropdown-option--highlighted", ctx_r1.HighlightedIndex === $index_r6);
|
|
68
|
+
i0.ɵɵattribute("aria-selected", ctx_r1.IsItemSelected(item_r5));
|
|
69
69
|
i0.ɵɵadvance();
|
|
70
|
-
i0.ɵɵconditional(
|
|
70
|
+
i0.ɵɵconditional(ctx_r1.itemTemplate ? 1 : 2);
|
|
71
71
|
} }
|
|
72
72
|
function MJDropdownComponent_ng_template_6_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
73
73
|
i0.ɵɵelementStart(0, "div", 10);
|
|
@@ -82,16 +82,16 @@ function MJDropdownComponent_ng_template_6_Template(rf, ctx) { if (rf & 1) {
|
|
|
82
82
|
i0.ɵɵconditionalCreate(5, MJDropdownComponent_ng_template_6_Conditional_5_Template, 2, 0, "div", 10);
|
|
83
83
|
i0.ɵɵelementEnd();
|
|
84
84
|
} if (rf & 2) {
|
|
85
|
-
const
|
|
86
|
-
i0.ɵɵattribute("id",
|
|
85
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
86
|
+
i0.ɵɵattribute("id", ctx_r1.ListboxId)("aria-label", ctx_r1.AriaLabel || null)("aria-labelledby", ctx_r1.AriaLabelledBy || null);
|
|
87
87
|
i0.ɵɵadvance();
|
|
88
|
-
i0.ɵɵconditional(
|
|
88
|
+
i0.ɵɵconditional(ctx_r1.Filterable ? 1 : -1);
|
|
89
89
|
i0.ɵɵadvance();
|
|
90
|
-
i0.ɵɵconditional(
|
|
90
|
+
i0.ɵɵconditional(ctx_r1.DefaultItem != null ? 2 : -1);
|
|
91
91
|
i0.ɵɵadvance();
|
|
92
|
-
i0.ɵɵrepeater(
|
|
92
|
+
i0.ɵɵrepeater(ctx_r1.FilteredItems);
|
|
93
93
|
i0.ɵɵadvance(2);
|
|
94
|
-
i0.ɵɵconditional(
|
|
94
|
+
i0.ɵɵconditional(ctx_r1.FilteredItems.length === 0 ? 5 : -1);
|
|
95
95
|
} }
|
|
96
96
|
/**
|
|
97
97
|
* mj-dropdown — Dropdown select component using CDK Overlay.
|
|
@@ -159,7 +159,19 @@ export class MJDropdownComponent {
|
|
|
159
159
|
ValueField = '';
|
|
160
160
|
Filterable = false;
|
|
161
161
|
ValuePrimitive = false;
|
|
162
|
-
|
|
162
|
+
/**
|
|
163
|
+
* Host-driven disable. Composed with Angular Forms' `setDisabledState()` into `IsDisabled`
|
|
164
|
+
* (the actual gate) — see `syncDisabled`. A setter, not a bare field, because this input is
|
|
165
|
+
* routinely bound to an expression that changes over the control's lifetime
|
|
166
|
+
* (`[Disabled]="!draft.CompanyID"`), and the gate has to follow it every time.
|
|
167
|
+
*/
|
|
168
|
+
set Disabled(value) {
|
|
169
|
+
this.disabledInput = value;
|
|
170
|
+
this.syncDisabled();
|
|
171
|
+
}
|
|
172
|
+
get Disabled() {
|
|
173
|
+
return this.disabledInput;
|
|
174
|
+
}
|
|
163
175
|
Placeholder = 'Select...';
|
|
164
176
|
DefaultItem = null;
|
|
165
177
|
FilterChange = new EventEmitter();
|
|
@@ -200,6 +212,11 @@ export class MJDropdownComponent {
|
|
|
200
212
|
return /^filter\b/i.test(name) ? name : `Filter ${name}`;
|
|
201
213
|
}
|
|
202
214
|
IsOpen = false;
|
|
215
|
+
/**
|
|
216
|
+
* The single gate on `Toggle()` / `Open()` — true when EITHER the `Disabled` input or Angular
|
|
217
|
+
* Forms says so. Never assign it directly; go through `syncDisabled()` so both sources are
|
|
218
|
+
* always composed and a lock closes an open panel.
|
|
219
|
+
*/
|
|
203
220
|
IsDisabled = false;
|
|
204
221
|
HighlightedIndex = -1;
|
|
205
222
|
SelectedValue = null;
|
|
@@ -211,6 +228,33 @@ export class MJDropdownComponent {
|
|
|
211
228
|
];
|
|
212
229
|
onChange = () => { };
|
|
213
230
|
onTouched = () => { };
|
|
231
|
+
/** Backing field for the `Disabled` input. */
|
|
232
|
+
disabledInput = false;
|
|
233
|
+
/** The forms-driven disabled state, kept SEPARATE so neither source can stomp the other. */
|
|
234
|
+
formDisabled = false;
|
|
235
|
+
/**
|
|
236
|
+
* Recompute the gate from both of its sources. Called whenever either changes.
|
|
237
|
+
*
|
|
238
|
+
* `IsDisabled` is derived state, and the only thing that assigned it was `setDisabledState()`.
|
|
239
|
+
* The forms-driven half was in fact fine — `setUpControl` also wires `registerOnDisabledChange`,
|
|
240
|
+
* so that hook fires on every `control.disable()`/`enable()`, not just at registration. What had
|
|
241
|
+
* no recompute path at all was the `Disabled` @Input: a plain field, so the gate froze at
|
|
242
|
+
* whatever the first compose produced and every later change to the input was dropped.
|
|
243
|
+
*
|
|
244
|
+
* That is how a `[Disabled]="!draft.CompanyID"` picker stayed dead for the life of the
|
|
245
|
+
* component after the company was finally chosen.
|
|
246
|
+
*/
|
|
247
|
+
syncDisabled() {
|
|
248
|
+
const disabled = this.disabledInput || this.formDisabled;
|
|
249
|
+
if (disabled === this.IsDisabled)
|
|
250
|
+
return;
|
|
251
|
+
this.IsDisabled = disabled;
|
|
252
|
+
// Becoming disabled while the panel is open would otherwise leave an interactive list
|
|
253
|
+
// hanging off a control the user can no longer operate.
|
|
254
|
+
if (disabled)
|
|
255
|
+
this.resetPanelState();
|
|
256
|
+
this.cdr.markForCheck();
|
|
257
|
+
}
|
|
214
258
|
get FilteredItems() {
|
|
215
259
|
const data = (this.Data ?? []);
|
|
216
260
|
if (!this.Filterable || !this.filterText)
|
|
@@ -249,10 +293,18 @@ export class MJDropdownComponent {
|
|
|
249
293
|
Close() {
|
|
250
294
|
if (!this.IsOpen)
|
|
251
295
|
return;
|
|
296
|
+
this.resetPanelState();
|
|
297
|
+
this.cdr.detectChanges();
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Panel state only — no change detection. Split out of `Close()` because `syncDisabled()` can
|
|
301
|
+
* run from an @Input setter, i.e. DURING the parent's change-detection pass, where a nested
|
|
302
|
+
* `detectChanges()` re-enters CD and trips NG0100 on the parent's own bindings.
|
|
303
|
+
*/
|
|
304
|
+
resetPanelState() {
|
|
252
305
|
this.IsOpen = false;
|
|
253
306
|
this.filterText = '';
|
|
254
307
|
this.HighlightedIndex = -1;
|
|
255
|
-
this.cdr.detectChanges();
|
|
256
308
|
}
|
|
257
309
|
SelectItem(item, event) {
|
|
258
310
|
event?.stopPropagation();
|
|
@@ -349,7 +401,7 @@ export class MJDropdownComponent {
|
|
|
349
401
|
writeValue(value) { this.SelectedValue = value; }
|
|
350
402
|
registerOnChange(fn) { this.onChange = fn; }
|
|
351
403
|
registerOnTouched(fn) { this.onTouched = fn; }
|
|
352
|
-
setDisabledState(isDisabled) { this.
|
|
404
|
+
setDisabledState(isDisabled) { this.formDisabled = isDisabled; this.syncDisabled(); }
|
|
353
405
|
ngOnDestroy() { this.Close(); }
|
|
354
406
|
getSelectedIndex() {
|
|
355
407
|
if (this.SelectedValue == null)
|
|
@@ -375,18 +427,17 @@ export class MJDropdownComponent {
|
|
|
375
427
|
useExisting: forwardRef(() => MJDropdownComponent),
|
|
376
428
|
multi: true
|
|
377
429
|
}])], decls: 7, vars: 20, consts: [["trigger", "", "overlayOrigin", "cdkOverlayOrigin"], ["filterInput", ""], ["cdkOverlayOrigin", "", "role", "combobox", "aria-haspopup", "listbox", 1, "mj-dropdown", 3, "click", "keydown", "blur"], [1, "mj-dropdown-value"], [1, "fa-solid", "fa-chevron-down", "mj-dropdown-arrow"], ["cdkConnectedOverlay", "", "cdkConnectedOverlayBackdropClass", "mj-dropdown-backdrop", 3, "backdropClick", "detach", "cdkConnectedOverlayOrigin", "cdkConnectedOverlayOpen", "cdkConnectedOverlayPositions", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHasBackdrop"], ["role", "listbox", 1, "mj-dropdown-panel"], [1, "mj-dropdown-filter-wrap"], ["role", "option", 1, "mj-dropdown-option", "mj-dropdown-option--default", 3, "mj-dropdown-option--selected", "mj-dropdown-option--highlighted"], ["role", "option", 1, "mj-dropdown-option", 3, "mj-dropdown-option--selected", "mj-dropdown-option--highlighted"], [1, "mj-dropdown-no-data"], [1, "mj-dropdown-sr-only"], ["type", "text", "placeholder", "Filter...", 1, "mj-input", "mj-dropdown-filter", 3, "input", "keydown", "value"], ["role", "option", 1, "mj-dropdown-option", "mj-dropdown-option--default", 3, "click"], ["role", "option", 1, "mj-dropdown-option", 3, "click"], [4, "ngTemplateOutlet", "ngTemplateOutletContext"]], template: function MJDropdownComponent_Template(rf, ctx) { if (rf & 1) {
|
|
378
|
-
const _r1 = i0.ɵɵgetCurrentView();
|
|
379
430
|
i0.ɵɵelementStart(0, "div", 2, 0);
|
|
380
|
-
i0.ɵɵlistener("click", function MJDropdownComponent_Template_div_click_0_listener() {
|
|
431
|
+
i0.ɵɵlistener("click", function MJDropdownComponent_Template_div_click_0_listener() { return ctx.Toggle(); })("keydown", function MJDropdownComponent_Template_div_keydown_0_listener($event) { return ctx.OnKeyDown($event); })("blur", function MJDropdownComponent_Template_div_blur_0_listener() { return ctx.OnBlur(); });
|
|
381
432
|
i0.ɵɵelementStart(3, "span", 3);
|
|
382
433
|
i0.ɵɵtext(4);
|
|
383
434
|
i0.ɵɵelementEnd();
|
|
384
435
|
i0.ɵɵelement(5, "i", 4);
|
|
385
436
|
i0.ɵɵelementEnd();
|
|
386
437
|
i0.ɵɵtemplate(6, MJDropdownComponent_ng_template_6_Template, 6, 6, "ng-template", 5);
|
|
387
|
-
i0.ɵɵlistener("backdropClick", function MJDropdownComponent_Template_ng_template_backdropClick_6_listener() {
|
|
438
|
+
i0.ɵɵlistener("backdropClick", function MJDropdownComponent_Template_ng_template_backdropClick_6_listener() { return ctx.Close(); })("detach", function MJDropdownComponent_Template_ng_template_detach_6_listener() { return ctx.Close(); });
|
|
388
439
|
} if (rf & 2) {
|
|
389
|
-
const
|
|
440
|
+
const overlayOrigin_r7 = i0.ɵɵreference(2);
|
|
390
441
|
i0.ɵɵclassProp("mj-dropdown--open", ctx.IsOpen)("mj-dropdown--disabled", ctx.IsDisabled);
|
|
391
442
|
i0.ɵɵattribute("id", ctx.InputId || null)("aria-label", ctx.AriaLabel || null)("aria-labelledby", ctx.AriaLabelledBy || null)("aria-describedby", ctx.AriaDescribedBy || null)("aria-expanded", ctx.IsOpen)("aria-controls", ctx.IsOpen ? ctx.ListboxId : null)("aria-disabled", ctx.IsDisabled ? "true" : null)("tabindex", ctx.IsDisabled ? -1 : 0);
|
|
392
443
|
i0.ɵɵadvance(3);
|
|
@@ -394,7 +445,7 @@ export class MJDropdownComponent {
|
|
|
394
445
|
i0.ɵɵadvance();
|
|
395
446
|
i0.ɵɵtextInterpolate1(" ", ctx.DisplayText, " ");
|
|
396
447
|
i0.ɵɵadvance(2);
|
|
397
|
-
i0.ɵɵproperty("cdkConnectedOverlayOrigin",
|
|
448
|
+
i0.ɵɵproperty("cdkConnectedOverlayOrigin", overlayOrigin_r7)("cdkConnectedOverlayOpen", ctx.IsOpen)("cdkConnectedOverlayPositions", ctx.Positions)("cdkConnectedOverlayWidth", ctx.TriggerWidth)("cdkConnectedOverlayHasBackdrop", true);
|
|
398
449
|
} }, dependencies: [NgTemplateOutlet, OverlayModule, i1.CdkConnectedOverlay, i1.CdkOverlayOrigin], encapsulation: 2 });
|
|
399
450
|
}
|
|
400
451
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MJDropdownComponent, [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.component.js","sourceRoot":"","sources":["../../../src/lib/dropdown/dropdown.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EACV,WAAW,EAEX,SAAS,EACT,YAAY,EAGZ,MAAM,EACN,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAwB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAqB,MAAM,sBAAsB,CAAC;;;;;;;;;IA6F5D,AATF,8BAAqC,eASwB;IAAA,sBAAM;IAAA,iBAAO;IACxE,oCASkC;IAAhC,AADA,2MAAS,4BAAqB,KAAC,kMACpB,wBAAiB,KAAC;IACjC,AAVE,iBASkC,EAC9B;;;IAX8B,cAAwB;;IAQxD,eAAoB;IAApB,yCAAoB;;;;;IAMxB,+BAMqC;IAAnC,yMAAS,kBAAW,IAAI,SAAS,KAAC;IAClC,YACF;IAAA,iBAAM;;;IALJ,AADA,4EAA4D,mEACK;;IAIjE,cACF;IADE,uEACF;;;IAWI,wBAA4F;;;IAA5F,yHAA6E;;;;IAA9B,AAAhC,sDAAgC,gEAA4B;;;IAE3E,YACF;;;;IADE,4DACF;;;;IAXF,+BAMqC;IAAnC,2NAAS,kCAAwB,KAAC;IAGhC,AAFF,+GAAoB,yEAEX;IAGX,iBAAM;;;;;IATJ,AADA,8EAA2D,0EACU;;IAIrE,cAIC;IAJD,6CAIC;;;IAIH,+BAAiC;IAAA,6BAAa;IAAA,iBAAM;;;IA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;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kBAEN,YAAY;mBAAC,gBAAgB;;kBAE7B,SAAS;mBAAC,SAAS;;kBACnB,SAAS;mBAAC,aAAa;;kBAEvB,WAAW;mBAAC,wBAAwB;;kFA9C1B,mBAAmB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n forwardRef,\n HostBinding,\n ElementRef,\n ViewChild,\n ContentChild,\n TemplateRef,\n OnDestroy,\n inject,\n ChangeDetectorRef\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { OverlayModule, ConnectedPosition } from '@angular/cdk/overlay';\n\n/**\n * mj-dropdown — Dropdown select component using CDK Overlay.\n *\n * Replaces `<kendo-dropdownlist>`.\n *\n * Every dropdown needs an ACCESSIBLE NAME, or it announces as \"combobox, collapsed\" with no hint of\n * what it selects (WCAG 2.1 4.1.2). Use {@link AriaLabelledBy} when a visible label already exists —\n * `<label for>` cannot name a `div[role=combobox]` — and {@link AriaLabel} when none does.\n *\n * @example With a visible label (preferred)\n * ```html\n * <span id=\"persona-label\">Interview persona</span>\n * <mj-dropdown\n * AriaLabelledBy=\"persona-label\"\n * [Data]=\"items\"\n * TextField=\"name\"\n * ValueField=\"id\"\n * [(ngModel)]=\"selectedId\"\n * [ValuePrimitive]=\"true\">\n * </mj-dropdown>\n * ```\n *\n * @example With no visible label\n * ```html\n * <mj-dropdown\n * AriaLabel=\"Interview persona\"\n * [Data]=\"items\"\n * TextField=\"name\"\n * ValueField=\"id\"\n * [(ngModel)]=\"selectedId\"\n * [ValuePrimitive]=\"true\"\n * [Filterable]=\"true\"\n * (FilterChange)=\"onFilter($event)\">\n * </mj-dropdown>\n * ```\n */\n@Component({\n selector: 'mj-dropdown',\n standalone: true,\n imports: [NgTemplateOutlet, OverlayModule],\n template: `\n <div\n class=\"mj-dropdown\"\n #trigger\n cdkOverlayOrigin\n #overlayOrigin=\"cdkOverlayOrigin\"\n [class.mj-dropdown--open]=\"IsOpen\"\n [class.mj-dropdown--disabled]=\"IsDisabled\"\n role=\"combobox\"\n [attr.id]=\"InputId || null\"\n [attr.aria-label]=\"AriaLabel || null\"\n [attr.aria-labelledby]=\"AriaLabelledBy || null\"\n [attr.aria-describedby]=\"AriaDescribedBy || null\"\n [attr.aria-expanded]=\"IsOpen\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"IsOpen ? ListboxId : null\"\n [attr.aria-disabled]=\"IsDisabled ? 'true' : null\"\n [attr.tabindex]=\"IsDisabled ? -1 : 0\"\n (click)=\"Toggle()\"\n (keydown)=\"OnKeyDown($event)\"\n (blur)=\"OnBlur()\">\n <span class=\"mj-dropdown-value\" [class.mj-dropdown-placeholder]=\"!HasValue\">\n {{ DisplayText }}\n </span>\n <i class=\"fa-solid fa-chevron-down mj-dropdown-arrow\"></i>\n </div>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"IsOpen\"\n [cdkConnectedOverlayPositions]=\"Positions\"\n [cdkConnectedOverlayWidth]=\"TriggerWidth\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"mj-dropdown-backdrop\"\n (backdropClick)=\"Close()\"\n (detach)=\"Close()\">\n <div class=\"mj-dropdown-panel\" role=\"listbox\"\n [attr.id]=\"ListboxId\"\n [attr.aria-label]=\"AriaLabel || null\"\n [attr.aria-labelledby]=\"AriaLabelledBy || null\">\n @if (Filterable) {\n <div class=\"mj-dropdown-filter-wrap\">\n <!--\n The word \"Filter\" lives in a hidden span rather than in a concatenated string so the\n AriaLabelledBy path can NAME this box from the same visible label that names the\n dropdown: aria-labelledby takes an ID LIST, so \"Filter\" plus the label's own text is\n composed by the accessibility tree without this component ever seeing that text.\n Without it, every filterable dropdown on a form named this way announces as an\n identical \"Filter options\".\n -->\n <span class=\"mj-dropdown-sr-only\" [attr.id]=\"FilterWordId\">Filter</span>\n <input\n #filterInput\n class=\"mj-input mj-dropdown-filter\"\n type=\"text\"\n placeholder=\"Filter...\"\n [attr.aria-labelledby]=\"FilterLabelledBy\"\n [attr.aria-label]=\"FilterLabelledBy ? null : FilterLabel\"\n [value]=\"filterText\"\n (input)=\"OnFilterInput($event)\"\n (keydown)=\"OnKeyDown($event)\" />\n </div>\n }\n @if (DefaultItem != null) {\n <div\n class=\"mj-dropdown-option mj-dropdown-option--default\"\n [class.mj-dropdown-option--selected]=\"SelectedValue == null\"\n [class.mj-dropdown-option--highlighted]=\"HighlightedIndex === -1\"\n role=\"option\"\n [attr.aria-selected]=\"SelectedValue == null\"\n (click)=\"SelectItem(null, $event)\">\n {{ GetItemText(DefaultItem) }}\n </div>\n }\n @for (item of FilteredItems; track TrackByIndex($index)) {\n <div\n class=\"mj-dropdown-option\"\n [class.mj-dropdown-option--selected]=\"IsItemSelected(item)\"\n [class.mj-dropdown-option--highlighted]=\"HighlightedIndex === $index\"\n role=\"option\"\n [attr.aria-selected]=\"IsItemSelected(item)\"\n (click)=\"SelectItem(item, $event)\">\n @if (itemTemplate) {\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n } @else {\n {{ GetItemText(item) }}\n }\n </div>\n }\n @if (FilteredItems.length === 0) {\n <div class=\"mj-dropdown-no-data\">No data found</div>\n }\n </div>\n </ng-template>\n `,\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MJDropdownComponent),\n multi: true\n }]\n})\nexport class MJDropdownComponent implements ControlValueAccessor, OnDestroy {\n /**\n * Accessible name for the combobox (#3860). Without one — and with no visible label wired via\n * {@link AriaLabelledBy} — the control announces as an UNNAMED combobox, which fails WCAG 2.1\n * 4.1.2 (Name, Role, Value): \"combobox, collapsed\" with no hint of what it selects. Applied as\n * `aria-label` on the trigger AND on the popup listbox, so both halves announce the same name.\n */\n @Input() AriaLabel = '';\n\n /**\n * The id of a VISIBLE label element that names this control — the preferred wiring when a label\n * already exists on screen (an `aria-label` would duplicate its text and drift on rename). This,\n * not `<label for>`, is the visible-label path: the trigger is a `div[role=combobox]`, and the\n * label-for association only names labelable form elements. `aria-labelledby` beats `AriaLabel`\n * in the accessible-name computation where both are present. Applied to trigger AND listbox.\n */\n @Input() AriaLabelledBy = '';\n\n /**\n * `id` for the combobox trigger, so other markup can REFERENCE it — `aria-controls`, hint text,\n * test hooks. It is deliberately not documented as a `<label for>` target: the trigger is a div,\n * which `label[for]` neither names nor focuses. To name the control from a visible label, put an\n * id on the LABEL and pass it as {@link AriaLabelledBy}.\n */\n @Input() InputId = '';\n\n /** `aria-describedby` passthrough for hint/error text — same shape of gap as the name. */\n @Input() AriaDescribedBy = '';\n\n @Input() Data: Record<string, unknown>[] | string[] | readonly unknown[] | null = [];\n @Input() TextField = '';\n @Input() ValueField = '';\n @Input() Filterable = false;\n @Input() ValuePrimitive = false;\n @Input() Disabled = false;\n @Input() Placeholder = 'Select...';\n @Input() DefaultItem: Record<string, unknown> | string | null = null;\n\n @Output() FilterChange = new EventEmitter<string>();\n @Output() ValueChange = new EventEmitter<unknown>();\n\n @ContentChild('mjDropdownItem') itemTemplate: TemplateRef<{ $implicit: unknown }> | null = null;\n\n @ViewChild('trigger') private triggerEl!: ElementRef<HTMLElement>;\n @ViewChild('filterInput') private filterInputEl: ElementRef<HTMLInputElement> | undefined;\n\n @HostBinding('class.mj-dropdown-host') readonly hostClass = true;\n\n private cdr = inject(ChangeDetectorRef);\n private static nextId = 0;\n\n DropdownId = MJDropdownComponent.nextId++;\n\n /**\n * Id of the popup listbox, so the trigger can point `aria-controls` at it while open — the half of\n * the combobox pattern that makes \"collapsed/expanded\" refer to something a screen reader can\n * find. Generated per instance from the same `static nextId` counter `dialog`, `window` and\n * `accordion` use in this package.\n */\n get ListboxId(): string { return `mj-dropdown-listbox-${this.DropdownId}`; }\n\n /** Id of the hidden \"Filter\" word, composed into the filter box's name via an id list. */\n get FilterWordId(): string { return `mj-dropdown-filter-word-${this.DropdownId}`; }\n\n /**\n * `aria-labelledby` for the filter box when the dropdown is named by a VISIBLE label: \"Filter\"\n * plus that label's own text, composed by the accessibility tree. Empty when there is no such\n * label, in which case {@link FilterLabel} supplies a string instead.\n */\n get FilterLabelledBy(): string { return this.AriaLabelledBy ? `${this.FilterWordId} ${this.AriaLabelledBy}` : ''; }\n\n /**\n * `aria-label` for the filter box in the no-visible-label case.\n *\n * The \"filter\" guard is not cosmetic: this repo's house habit is `AriaLabel=\"Filter roles\"`, and\n * an unconditional prefix announces that box as \"Filter Filter roles\". A name that already begins\n * with the word is used as-is.\n */\n get FilterLabel(): string {\n const name = this.AriaLabel.trim();\n if (!name) return 'Filter options';\n return /^filter\\b/i.test(name) ? name : `Filter ${name}`;\n }\n IsOpen = false;\n IsDisabled = false;\n HighlightedIndex = -1;\n SelectedValue: unknown = null;\n TriggerWidth = 0;\n\n filterText = '';\n\n Positions: ConnectedPosition[] = [\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' }\n ];\n\n private onChange: (value: unknown) => void = () => {};\n private onTouched: () => void = () => {};\n\n get FilteredItems(): unknown[] {\n const data = (this.Data ?? []) as unknown[];\n if (!this.Filterable || !this.filterText) return data;\n const search = this.filterText.toLowerCase();\n return data.filter(item => this.GetItemText(item).toLowerCase().includes(search));\n }\n\n get HasValue(): boolean { return this.SelectedValue != null; }\n\n get DisplayText(): string {\n if (this.SelectedValue == null) {\n if (this.DefaultItem != null) return this.GetItemText(this.DefaultItem);\n return this.Placeholder;\n }\n if (this.ValuePrimitive && this.ValueField) {\n const found = ((this.Data ?? []) as unknown[]).find(item => this.GetItemValue(item) === this.SelectedValue);\n return found ? this.GetItemText(found) : String(this.SelectedValue);\n }\n return this.GetItemText(this.SelectedValue as Record<string, unknown> | string);\n }\n\n Toggle(): void {\n if (this.IsDisabled) return;\n this.IsOpen ? this.Close() : this.Open();\n }\n\n Open(): void {\n if (this.IsDisabled || this.IsOpen) return;\n this.TriggerWidth = this.triggerEl?.nativeElement.offsetWidth ?? 200;\n this.IsOpen = true;\n this.HighlightedIndex = this.getSelectedIndex();\n this.cdr.detectChanges();\n if (this.Filterable) setTimeout(() => this.filterInputEl?.nativeElement.focus(), 0);\n }\n\n Close(): void {\n if (!this.IsOpen) return;\n this.IsOpen = false;\n this.filterText = '';\n this.HighlightedIndex = -1;\n this.cdr.detectChanges();\n }\n\n SelectItem(item: unknown | null, event?: Event): void {\n event?.stopPropagation();\n if (item == null) {\n this.SelectedValue = null;\n this.onChange(null);\n this.ValueChange.emit(null);\n } else if (this.ValuePrimitive && this.ValueField) {\n const value = this.GetItemValue(item);\n this.SelectedValue = value;\n this.onChange(value);\n this.ValueChange.emit(value);\n } else {\n this.SelectedValue = item;\n this.onChange(item);\n this.ValueChange.emit(item);\n }\n this.Close();\n }\n\n IsItemSelected(item: unknown): boolean {\n if (this.SelectedValue == null) return false;\n if (this.ValuePrimitive && this.ValueField) return this.GetItemValue(item) === this.SelectedValue;\n if (this.ValueField && typeof item === 'object' && typeof this.SelectedValue === 'object')\n return this.GetItemValue(item) === this.GetItemValue(this.SelectedValue);\n return item === this.SelectedValue;\n }\n\n OnFilterInput(event: Event): void {\n this.filterText = (event.target as HTMLInputElement).value;\n this.HighlightedIndex = 0;\n this.FilterChange.emit(this.filterText);\n }\n\n OnKeyDown(event: KeyboardEvent): void {\n const items = this.FilteredItems;\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (!this.IsOpen) this.Open();\n else this.HighlightedIndex = Math.min(this.HighlightedIndex + 1, items.length - 1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (this.IsOpen) this.HighlightedIndex = Math.max(this.HighlightedIndex - 1, 0);\n break;\n case 'Enter':\n event.preventDefault();\n if (this.IsOpen && this.HighlightedIndex >= 0 && this.HighlightedIndex < items.length)\n this.SelectItem(items[this.HighlightedIndex]);\n else if (!this.IsOpen) this.Open();\n break;\n case 'Escape': event.preventDefault(); this.Close(); break;\n case 'Home': if (this.IsOpen) { event.preventDefault(); this.HighlightedIndex = 0; } break;\n case 'End': if (this.IsOpen) { event.preventDefault(); this.HighlightedIndex = items.length - 1; } break;\n }\n }\n\n OnBlur(): void { this.onTouched(); }\n\n GetItemText(item: unknown): string {\n if (item == null) return '';\n if (typeof item === 'string') return item;\n if (this.TextField && typeof item === 'object') return String((item as Record<string, unknown>)[this.TextField] ?? '');\n return String(item);\n }\n\n GetItemValue(item: unknown): unknown {\n if (typeof item === 'string') return item;\n if (this.ValueField && typeof item === 'object' && item != null) return (item as Record<string, unknown>)[this.ValueField];\n return item;\n }\n\n TrackByIndex(index: number): number { return index; }\n\n writeValue(value: unknown): void { this.SelectedValue = value; }\n registerOnChange(fn: (value: unknown) => void): void { this.onChange = fn; }\n registerOnTouched(fn: () => void): void { this.onTouched = fn; }\n setDisabledState(isDisabled: boolean): void { this.IsDisabled = isDisabled || this.Disabled; }\n ngOnDestroy(): void { this.Close(); }\n\n private getSelectedIndex(): number {\n if (this.SelectedValue == null) return -1;\n return this.FilteredItems.findIndex(item => this.IsItemSelected(item));\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"dropdown.component.js","sourceRoot":"","sources":["../../../src/lib/dropdown/dropdown.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,UAAU,EACV,WAAW,EAEX,SAAS,EACT,YAAY,EAGZ,MAAM,EACN,iBAAiB,EAClB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAwB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAqB,MAAM,sBAAsB,CAAC;;;;;;;;;IA6F5D,AATF,8BAAqC,eASwB;IAAA,sBAA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;kBAGL,KAAK;;kBAEL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAOL,KAAK;;kBAQL,KAAK;;kBACL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kBAEN,YAAY;mBAAC,gBAAgB;;kBAE7B,SAAS;mBAAC,SAAS;;kBACnB,SAAS;mBAAC,aAAa;;kBAEvB,WAAW;mBAAC,wBAAwB;;kFA3D1B,mBAAmB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n forwardRef,\n HostBinding,\n ElementRef,\n ViewChild,\n ContentChild,\n TemplateRef,\n OnDestroy,\n inject,\n ChangeDetectorRef\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NG_VALUE_ACCESSOR, ControlValueAccessor } from '@angular/forms';\nimport { OverlayModule, ConnectedPosition } from '@angular/cdk/overlay';\n\n/**\n * mj-dropdown — Dropdown select component using CDK Overlay.\n *\n * Replaces `<kendo-dropdownlist>`.\n *\n * Every dropdown needs an ACCESSIBLE NAME, or it announces as \"combobox, collapsed\" with no hint of\n * what it selects (WCAG 2.1 4.1.2). Use {@link AriaLabelledBy} when a visible label already exists —\n * `<label for>` cannot name a `div[role=combobox]` — and {@link AriaLabel} when none does.\n *\n * @example With a visible label (preferred)\n * ```html\n * <span id=\"persona-label\">Interview persona</span>\n * <mj-dropdown\n * AriaLabelledBy=\"persona-label\"\n * [Data]=\"items\"\n * TextField=\"name\"\n * ValueField=\"id\"\n * [(ngModel)]=\"selectedId\"\n * [ValuePrimitive]=\"true\">\n * </mj-dropdown>\n * ```\n *\n * @example With no visible label\n * ```html\n * <mj-dropdown\n * AriaLabel=\"Interview persona\"\n * [Data]=\"items\"\n * TextField=\"name\"\n * ValueField=\"id\"\n * [(ngModel)]=\"selectedId\"\n * [ValuePrimitive]=\"true\"\n * [Filterable]=\"true\"\n * (FilterChange)=\"onFilter($event)\">\n * </mj-dropdown>\n * ```\n */\n@Component({\n selector: 'mj-dropdown',\n standalone: true,\n imports: [NgTemplateOutlet, OverlayModule],\n template: `\n <div\n class=\"mj-dropdown\"\n #trigger\n cdkOverlayOrigin\n #overlayOrigin=\"cdkOverlayOrigin\"\n [class.mj-dropdown--open]=\"IsOpen\"\n [class.mj-dropdown--disabled]=\"IsDisabled\"\n role=\"combobox\"\n [attr.id]=\"InputId || null\"\n [attr.aria-label]=\"AriaLabel || null\"\n [attr.aria-labelledby]=\"AriaLabelledBy || null\"\n [attr.aria-describedby]=\"AriaDescribedBy || null\"\n [attr.aria-expanded]=\"IsOpen\"\n aria-haspopup=\"listbox\"\n [attr.aria-controls]=\"IsOpen ? ListboxId : null\"\n [attr.aria-disabled]=\"IsDisabled ? 'true' : null\"\n [attr.tabindex]=\"IsDisabled ? -1 : 0\"\n (click)=\"Toggle()\"\n (keydown)=\"OnKeyDown($event)\"\n (blur)=\"OnBlur()\">\n <span class=\"mj-dropdown-value\" [class.mj-dropdown-placeholder]=\"!HasValue\">\n {{ DisplayText }}\n </span>\n <i class=\"fa-solid fa-chevron-down mj-dropdown-arrow\"></i>\n </div>\n\n <ng-template\n cdkConnectedOverlay\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"IsOpen\"\n [cdkConnectedOverlayPositions]=\"Positions\"\n [cdkConnectedOverlayWidth]=\"TriggerWidth\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n cdkConnectedOverlayBackdropClass=\"mj-dropdown-backdrop\"\n (backdropClick)=\"Close()\"\n (detach)=\"Close()\">\n <div class=\"mj-dropdown-panel\" role=\"listbox\"\n [attr.id]=\"ListboxId\"\n [attr.aria-label]=\"AriaLabel || null\"\n [attr.aria-labelledby]=\"AriaLabelledBy || null\">\n @if (Filterable) {\n <div class=\"mj-dropdown-filter-wrap\">\n <!--\n The word \"Filter\" lives in a hidden span rather than in a concatenated string so the\n AriaLabelledBy path can NAME this box from the same visible label that names the\n dropdown: aria-labelledby takes an ID LIST, so \"Filter\" plus the label's own text is\n composed by the accessibility tree without this component ever seeing that text.\n Without it, every filterable dropdown on a form named this way announces as an\n identical \"Filter options\".\n -->\n <span class=\"mj-dropdown-sr-only\" [attr.id]=\"FilterWordId\">Filter</span>\n <input\n #filterInput\n class=\"mj-input mj-dropdown-filter\"\n type=\"text\"\n placeholder=\"Filter...\"\n [attr.aria-labelledby]=\"FilterLabelledBy\"\n [attr.aria-label]=\"FilterLabelledBy ? null : FilterLabel\"\n [value]=\"filterText\"\n (input)=\"OnFilterInput($event)\"\n (keydown)=\"OnKeyDown($event)\" />\n </div>\n }\n @if (DefaultItem != null) {\n <div\n class=\"mj-dropdown-option mj-dropdown-option--default\"\n [class.mj-dropdown-option--selected]=\"SelectedValue == null\"\n [class.mj-dropdown-option--highlighted]=\"HighlightedIndex === -1\"\n role=\"option\"\n [attr.aria-selected]=\"SelectedValue == null\"\n (click)=\"SelectItem(null, $event)\">\n {{ GetItemText(DefaultItem) }}\n </div>\n }\n @for (item of FilteredItems; track TrackByIndex($index)) {\n <div\n class=\"mj-dropdown-option\"\n [class.mj-dropdown-option--selected]=\"IsItemSelected(item)\"\n [class.mj-dropdown-option--highlighted]=\"HighlightedIndex === $index\"\n role=\"option\"\n [attr.aria-selected]=\"IsItemSelected(item)\"\n (click)=\"SelectItem(item, $event)\">\n @if (itemTemplate) {\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: item }\"></ng-container>\n } @else {\n {{ GetItemText(item) }}\n }\n </div>\n }\n @if (FilteredItems.length === 0) {\n <div class=\"mj-dropdown-no-data\">No data found</div>\n }\n </div>\n </ng-template>\n `,\n providers: [{\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MJDropdownComponent),\n multi: true\n }]\n})\nexport class MJDropdownComponent implements ControlValueAccessor, OnDestroy {\n /**\n * Accessible name for the combobox (#3860). Without one — and with no visible label wired via\n * {@link AriaLabelledBy} — the control announces as an UNNAMED combobox, which fails WCAG 2.1\n * 4.1.2 (Name, Role, Value): \"combobox, collapsed\" with no hint of what it selects. Applied as\n * `aria-label` on the trigger AND on the popup listbox, so both halves announce the same name.\n */\n @Input() AriaLabel = '';\n\n /**\n * The id of a VISIBLE label element that names this control — the preferred wiring when a label\n * already exists on screen (an `aria-label` would duplicate its text and drift on rename). This,\n * not `<label for>`, is the visible-label path: the trigger is a `div[role=combobox]`, and the\n * label-for association only names labelable form elements. `aria-labelledby` beats `AriaLabel`\n * in the accessible-name computation where both are present. Applied to trigger AND listbox.\n */\n @Input() AriaLabelledBy = '';\n\n /**\n * `id` for the combobox trigger, so other markup can REFERENCE it — `aria-controls`, hint text,\n * test hooks. It is deliberately not documented as a `<label for>` target: the trigger is a div,\n * which `label[for]` neither names nor focuses. To name the control from a visible label, put an\n * id on the LABEL and pass it as {@link AriaLabelledBy}.\n */\n @Input() InputId = '';\n\n /** `aria-describedby` passthrough for hint/error text — same shape of gap as the name. */\n @Input() AriaDescribedBy = '';\n\n @Input() Data: Record<string, unknown>[] | string[] | readonly unknown[] | null = [];\n @Input() TextField = '';\n @Input() ValueField = '';\n @Input() Filterable = false;\n @Input() ValuePrimitive = false;\n /**\n * Host-driven disable. Composed with Angular Forms' `setDisabledState()` into `IsDisabled`\n * (the actual gate) — see `syncDisabled`. A setter, not a bare field, because this input is\n * routinely bound to an expression that changes over the control's lifetime\n * (`[Disabled]=\"!draft.CompanyID\"`), and the gate has to follow it every time.\n */\n @Input()\n set Disabled(value: boolean) {\n this.disabledInput = value;\n this.syncDisabled();\n }\n get Disabled(): boolean {\n return this.disabledInput;\n }\n @Input() Placeholder = 'Select...';\n @Input() DefaultItem: Record<string, unknown> | string | null = null;\n\n @Output() FilterChange = new EventEmitter<string>();\n @Output() ValueChange = new EventEmitter<unknown>();\n\n @ContentChild('mjDropdownItem') itemTemplate: TemplateRef<{ $implicit: unknown }> | null = null;\n\n @ViewChild('trigger') private triggerEl!: ElementRef<HTMLElement>;\n @ViewChild('filterInput') private filterInputEl: ElementRef<HTMLInputElement> | undefined;\n\n @HostBinding('class.mj-dropdown-host') readonly hostClass = true;\n\n private cdr = inject(ChangeDetectorRef);\n private static nextId = 0;\n\n DropdownId = MJDropdownComponent.nextId++;\n\n /**\n * Id of the popup listbox, so the trigger can point `aria-controls` at it while open — the half of\n * the combobox pattern that makes \"collapsed/expanded\" refer to something a screen reader can\n * find. Generated per instance from the same `static nextId` counter `dialog`, `window` and\n * `accordion` use in this package.\n */\n get ListboxId(): string { return `mj-dropdown-listbox-${this.DropdownId}`; }\n\n /** Id of the hidden \"Filter\" word, composed into the filter box's name via an id list. */\n get FilterWordId(): string { return `mj-dropdown-filter-word-${this.DropdownId}`; }\n\n /**\n * `aria-labelledby` for the filter box when the dropdown is named by a VISIBLE label: \"Filter\"\n * plus that label's own text, composed by the accessibility tree. Empty when there is no such\n * label, in which case {@link FilterLabel} supplies a string instead.\n */\n get FilterLabelledBy(): string { return this.AriaLabelledBy ? `${this.FilterWordId} ${this.AriaLabelledBy}` : ''; }\n\n /**\n * `aria-label` for the filter box in the no-visible-label case.\n *\n * The \"filter\" guard is not cosmetic: this repo's house habit is `AriaLabel=\"Filter roles\"`, and\n * an unconditional prefix announces that box as \"Filter Filter roles\". A name that already begins\n * with the word is used as-is.\n */\n get FilterLabel(): string {\n const name = this.AriaLabel.trim();\n if (!name) return 'Filter options';\n return /^filter\\b/i.test(name) ? name : `Filter ${name}`;\n }\n IsOpen = false;\n /**\n * The single gate on `Toggle()` / `Open()` — true when EITHER the `Disabled` input or Angular\n * Forms says so. Never assign it directly; go through `syncDisabled()` so both sources are\n * always composed and a lock closes an open panel.\n */\n IsDisabled = false;\n HighlightedIndex = -1;\n SelectedValue: unknown = null;\n TriggerWidth = 0;\n\n filterText = '';\n\n Positions: ConnectedPosition[] = [\n { originX: 'start', originY: 'bottom', overlayX: 'start', overlayY: 'top' },\n { originX: 'start', originY: 'top', overlayX: 'start', overlayY: 'bottom' }\n ];\n\n private onChange: (value: unknown) => void = () => {};\n private onTouched: () => void = () => {};\n\n /** Backing field for the `Disabled` input. */\n private disabledInput = false;\n /** The forms-driven disabled state, kept SEPARATE so neither source can stomp the other. */\n private formDisabled = false;\n\n /**\n * Recompute the gate from both of its sources. Called whenever either changes.\n *\n * `IsDisabled` is derived state, and the only thing that assigned it was `setDisabledState()`.\n * The forms-driven half was in fact fine — `setUpControl` also wires `registerOnDisabledChange`,\n * so that hook fires on every `control.disable()`/`enable()`, not just at registration. What had\n * no recompute path at all was the `Disabled` @Input: a plain field, so the gate froze at\n * whatever the first compose produced and every later change to the input was dropped.\n *\n * That is how a `[Disabled]=\"!draft.CompanyID\"` picker stayed dead for the life of the\n * component after the company was finally chosen.\n */\n private syncDisabled(): void {\n const disabled = this.disabledInput || this.formDisabled;\n if (disabled === this.IsDisabled) return;\n this.IsDisabled = disabled;\n // Becoming disabled while the panel is open would otherwise leave an interactive list\n // hanging off a control the user can no longer operate.\n if (disabled) this.resetPanelState();\n this.cdr.markForCheck();\n }\n\n get FilteredItems(): unknown[] {\n const data = (this.Data ?? []) as unknown[];\n if (!this.Filterable || !this.filterText) return data;\n const search = this.filterText.toLowerCase();\n return data.filter(item => this.GetItemText(item).toLowerCase().includes(search));\n }\n\n get HasValue(): boolean { return this.SelectedValue != null; }\n\n get DisplayText(): string {\n if (this.SelectedValue == null) {\n if (this.DefaultItem != null) return this.GetItemText(this.DefaultItem);\n return this.Placeholder;\n }\n if (this.ValuePrimitive && this.ValueField) {\n const found = ((this.Data ?? []) as unknown[]).find(item => this.GetItemValue(item) === this.SelectedValue);\n return found ? this.GetItemText(found) : String(this.SelectedValue);\n }\n return this.GetItemText(this.SelectedValue as Record<string, unknown> | string);\n }\n\n Toggle(): void {\n if (this.IsDisabled) return;\n this.IsOpen ? this.Close() : this.Open();\n }\n\n Open(): void {\n if (this.IsDisabled || this.IsOpen) return;\n this.TriggerWidth = this.triggerEl?.nativeElement.offsetWidth ?? 200;\n this.IsOpen = true;\n this.HighlightedIndex = this.getSelectedIndex();\n this.cdr.detectChanges();\n if (this.Filterable) setTimeout(() => this.filterInputEl?.nativeElement.focus(), 0);\n }\n\n Close(): void {\n if (!this.IsOpen) return;\n this.resetPanelState();\n this.cdr.detectChanges();\n }\n\n /**\n * Panel state only — no change detection. Split out of `Close()` because `syncDisabled()` can\n * run from an @Input setter, i.e. DURING the parent's change-detection pass, where a nested\n * `detectChanges()` re-enters CD and trips NG0100 on the parent's own bindings.\n */\n private resetPanelState(): void {\n this.IsOpen = false;\n this.filterText = '';\n this.HighlightedIndex = -1;\n }\n\n SelectItem(item: unknown | null, event?: Event): void {\n event?.stopPropagation();\n if (item == null) {\n this.SelectedValue = null;\n this.onChange(null);\n this.ValueChange.emit(null);\n } else if (this.ValuePrimitive && this.ValueField) {\n const value = this.GetItemValue(item);\n this.SelectedValue = value;\n this.onChange(value);\n this.ValueChange.emit(value);\n } else {\n this.SelectedValue = item;\n this.onChange(item);\n this.ValueChange.emit(item);\n }\n this.Close();\n }\n\n IsItemSelected(item: unknown): boolean {\n if (this.SelectedValue == null) return false;\n if (this.ValuePrimitive && this.ValueField) return this.GetItemValue(item) === this.SelectedValue;\n if (this.ValueField && typeof item === 'object' && typeof this.SelectedValue === 'object')\n return this.GetItemValue(item) === this.GetItemValue(this.SelectedValue);\n return item === this.SelectedValue;\n }\n\n OnFilterInput(event: Event): void {\n this.filterText = (event.target as HTMLInputElement).value;\n this.HighlightedIndex = 0;\n this.FilterChange.emit(this.filterText);\n }\n\n OnKeyDown(event: KeyboardEvent): void {\n const items = this.FilteredItems;\n switch (event.key) {\n case 'ArrowDown':\n event.preventDefault();\n if (!this.IsOpen) this.Open();\n else this.HighlightedIndex = Math.min(this.HighlightedIndex + 1, items.length - 1);\n break;\n case 'ArrowUp':\n event.preventDefault();\n if (this.IsOpen) this.HighlightedIndex = Math.max(this.HighlightedIndex - 1, 0);\n break;\n case 'Enter':\n event.preventDefault();\n if (this.IsOpen && this.HighlightedIndex >= 0 && this.HighlightedIndex < items.length)\n this.SelectItem(items[this.HighlightedIndex]);\n else if (!this.IsOpen) this.Open();\n break;\n case 'Escape': event.preventDefault(); this.Close(); break;\n case 'Home': if (this.IsOpen) { event.preventDefault(); this.HighlightedIndex = 0; } break;\n case 'End': if (this.IsOpen) { event.preventDefault(); this.HighlightedIndex = items.length - 1; } break;\n }\n }\n\n OnBlur(): void { this.onTouched(); }\n\n GetItemText(item: unknown): string {\n if (item == null) return '';\n if (typeof item === 'string') return item;\n if (this.TextField && typeof item === 'object') return String((item as Record<string, unknown>)[this.TextField] ?? '');\n return String(item);\n }\n\n GetItemValue(item: unknown): unknown {\n if (typeof item === 'string') return item;\n if (this.ValueField && typeof item === 'object' && item != null) return (item as Record<string, unknown>)[this.ValueField];\n return item;\n }\n\n TrackByIndex(index: number): number { return index; }\n\n writeValue(value: unknown): void { this.SelectedValue = value; }\n registerOnChange(fn: (value: unknown) => void): void { this.onChange = fn; }\n registerOnTouched(fn: () => void): void { this.onTouched = fn; }\n setDisabledState(isDisabled: boolean): void { this.formDisabled = isDisabled; this.syncDisabled(); }\n ngOnDestroy(): void { this.Close(); }\n\n private getSelectedIndex(): number {\n if (this.SelectedValue == null) return -1;\n return this.FilteredItems.findIndex(item => this.IsItemSelected(item));\n }\n}\n"]}
|
|
@@ -191,7 +191,7 @@ export class MJEmptyStateComponent {
|
|
|
191
191
|
i0.ɵɵconditional(ctx.Message ? 2 : -1);
|
|
192
192
|
i0.ɵɵadvance(3);
|
|
193
193
|
i0.ɵɵconditional(ctx.ActionText ? 5 : -1);
|
|
194
|
-
} }, dependencies: [MJButtonDirective], styles: ["[_nghost-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: var(--mj-space-12);\n color: var(--mj-text-secondary);\n }\n\n .mj-empty-state__icon[_ngcontent-%COMP%] {\n font-size: 3rem;\n line-height: 1;\n margin-bottom: var(--mj-space-4);\n color: var(--mj-text-disabled);\n }\n\n .mj-empty-state__title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--mj-text-lg);\n font-weight: 600;\n color: var(--mj-text-primary);\n }\n\n .mj-empty-state__message[_ngcontent-%COMP%] {\n margin: var(--mj-space-2) 0 0;\n font-size: var(--mj-text-sm);\n color: var(--mj-text-muted);\n max-width: 420px;\n }\n\n .mj-empty-state__actions[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n gap: var(--mj-space-2);\n margin-top: var(--mj-space-6);\n }\n \n\n
|
|
194
|
+
} }, dependencies: [MJButtonDirective], styles: ["[_nghost-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: var(--mj-space-12);\n color: var(--mj-text-secondary);\n }\n\n .mj-empty-state__icon[_ngcontent-%COMP%] {\n font-size: 3rem;\n line-height: 1;\n margin-bottom: var(--mj-space-4);\n color: var(--mj-text-disabled);\n }\n\n .mj-empty-state__title[_ngcontent-%COMP%] {\n margin: 0;\n font-size: var(--mj-text-lg);\n font-weight: 600;\n color: var(--mj-text-primary);\n }\n\n .mj-empty-state__message[_ngcontent-%COMP%] {\n margin: var(--mj-space-2) 0 0;\n font-size: var(--mj-text-sm);\n color: var(--mj-text-muted);\n max-width: 420px;\n }\n\n .mj-empty-state__actions[_ngcontent-%COMP%] {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: center;\n gap: var(--mj-space-2);\n margin-top: var(--mj-space-6);\n }\n \n\n .mj-empty-state__actions[_ngcontent-%COMP%]:empty {\n display: none;\n }\n\n \n .mj-empty-state--inline[_nghost-%COMP%] {\n padding: 8px 12px;\n justify-content: flex-start;\n }\n .mj-empty-state--inline[_nghost-%COMP%] .mj-empty-state__icon[_ngcontent-%COMP%] {\n font-size: 1.25rem;\n margin-bottom: 4px;\n }\n .mj-empty-state--inline[_nghost-%COMP%] .mj-empty-state__title[_ngcontent-%COMP%] {\n font-size: var(--mj-text-sm);\n font-weight: 500;\n }\n\n .mj-empty-state--compact[_nghost-%COMP%] {\n padding: var(--mj-space-8);\n }\n .mj-empty-state--compact[_nghost-%COMP%] .mj-empty-state__icon[_ngcontent-%COMP%] {\n font-size: 2rem;\n margin-bottom: var(--mj-space-3);\n }\n\n .mj-empty-state--large[_nghost-%COMP%] {\n padding: var(--mj-space-16) var(--mj-space-10);\n }\n .mj-empty-state--large[_nghost-%COMP%] .mj-empty-state__icon[_ngcontent-%COMP%] {\n font-size: 4rem;\n }\n\n \n .mj-empty-state--no-results[_nghost-%COMP%] .mj-empty-state__icon[_ngcontent-%COMP%] {\n color: var(--mj-text-muted);\n }\n .mj-empty-state--success[_nghost-%COMP%] .mj-empty-state__icon[_ngcontent-%COMP%] {\n color: var(--mj-status-success);\n }\n .mj-empty-state--warning[_nghost-%COMP%] .mj-empty-state__icon[_ngcontent-%COMP%] {\n color: var(--mj-status-warning);\n }\n .mj-empty-state--error[_nghost-%COMP%] .mj-empty-state__icon[_ngcontent-%COMP%] {\n color: var(--mj-status-error);\n }"] });
|
|
195
195
|
}
|
|
196
196
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MJEmptyStateComponent, [{
|
|
197
197
|
type: Component,
|