@molecule/app-ui-angular 1.2.0 → 1.3.0
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 +2796 -800
- package/dist/components/accordion.component.d.ts +17 -2
- package/dist/components/accordion.component.d.ts.map +1 -1
- package/dist/components/accordion.component.js +31 -7
- package/dist/components/accordion.component.js.map +1 -1
- package/dist/components/alert.component.d.ts +15 -2
- package/dist/components/alert.component.d.ts.map +1 -1
- package/dist/components/alert.component.js +25 -4
- package/dist/components/alert.component.js.map +1 -1
- package/dist/components/auth-guard.component.d.ts +41 -9
- package/dist/components/auth-guard.component.d.ts.map +1 -1
- package/dist/components/auth-guard.component.js +58 -23
- package/dist/components/auth-guard.component.js.map +1 -1
- package/dist/components/avatar.component.d.ts +15 -2
- package/dist/components/avatar.component.d.ts.map +1 -1
- package/dist/components/avatar.component.js +35 -5
- package/dist/components/avatar.component.js.map +1 -1
- package/dist/components/badge.component.d.ts +15 -2
- package/dist/components/badge.component.d.ts.map +1 -1
- package/dist/components/badge.component.js +35 -6
- package/dist/components/badge.component.js.map +1 -1
- package/dist/components/button.component.d.ts +20 -2
- package/dist/components/button.component.d.ts.map +1 -1
- package/dist/components/button.component.js +30 -4
- package/dist/components/button.component.js.map +1 -1
- package/dist/components/card.component.d.ts +67 -9
- package/dist/components/card.component.d.ts.map +1 -1
- package/dist/components/card.component.js +99 -17
- package/dist/components/card.component.js.map +1 -1
- package/dist/components/checkbox.component.d.ts +35 -5
- package/dist/components/checkbox.component.d.ts.map +1 -1
- package/dist/components/checkbox.component.js +59 -9
- package/dist/components/checkbox.component.js.map +1 -1
- package/dist/components/confirm-button.component.d.ts +85 -17
- package/dist/components/confirm-button.component.d.ts.map +1 -1
- package/dist/components/confirm-button.component.js +112 -25
- package/dist/components/confirm-button.component.js.map +1 -1
- package/dist/components/confirm-dialog.component.d.ts +50 -13
- package/dist/components/confirm-dialog.component.d.ts.map +1 -1
- package/dist/components/confirm-dialog.component.js +118 -31
- package/dist/components/confirm-dialog.component.js.map +1 -1
- package/dist/components/dropdown.component.d.ts +32 -5
- package/dist/components/dropdown.component.d.ts.map +1 -1
- package/dist/components/dropdown.component.js +86 -17
- package/dist/components/dropdown.component.js.map +1 -1
- package/dist/components/empty-state.component.d.ts +5 -1
- package/dist/components/empty-state.component.d.ts.map +1 -1
- package/dist/components/empty-state.component.js +5 -1
- package/dist/components/empty-state.component.js.map +1 -1
- package/dist/components/floating-input.component.d.ts +18 -4
- package/dist/components/floating-input.component.d.ts.map +1 -1
- package/dist/components/floating-input.component.js +38 -8
- package/dist/components/floating-input.component.js.map +1 -1
- package/dist/components/form-field.component.d.ts +14 -2
- package/dist/components/form-field.component.d.ts.map +1 -1
- package/dist/components/form-field.component.js +34 -5
- package/dist/components/form-field.component.js.map +1 -1
- package/dist/components/form.component.d.ts +61 -15
- package/dist/components/form.component.d.ts.map +1 -1
- package/dist/components/form.component.js +65 -14
- package/dist/components/form.component.js.map +1 -1
- package/dist/components/icon.component.d.ts +22 -4
- package/dist/components/icon.component.d.ts.map +1 -1
- package/dist/components/icon.component.js +1 -1
- package/dist/components/icon.component.js.map +1 -1
- package/dist/components/input.component.d.ts +34 -4
- package/dist/components/input.component.d.ts.map +1 -1
- package/dist/components/input.component.js +66 -11
- package/dist/components/input.component.js.map +1 -1
- package/dist/components/label.component.d.ts +5 -1
- package/dist/components/label.component.d.ts.map +1 -1
- package/dist/components/label.component.js +6 -2
- package/dist/components/label.component.js.map +1 -1
- package/dist/components/language-picker.component.d.ts +44 -8
- package/dist/components/language-picker.component.d.ts.map +1 -1
- package/dist/components/language-picker.component.js +29 -17
- package/dist/components/language-picker.component.js.map +1 -1
- package/dist/components/layout.component.d.ts +57 -8
- package/dist/components/layout.component.d.ts.map +1 -1
- package/dist/components/layout.component.js +134 -21
- package/dist/components/layout.component.js.map +1 -1
- package/dist/components/load-error-banner.component.d.ts +39 -7
- package/dist/components/load-error-banner.component.d.ts.map +1 -1
- package/dist/components/load-error-banner.component.js +68 -21
- package/dist/components/load-error-banner.component.js.map +1 -1
- package/dist/components/modal.component.d.ts +20 -3
- package/dist/components/modal.component.d.ts.map +1 -1
- package/dist/components/modal.component.js +40 -6
- package/dist/components/modal.component.js.map +1 -1
- package/dist/components/optimistic-toggle-button.component.d.ts +80 -19
- package/dist/components/optimistic-toggle-button.component.d.ts.map +1 -1
- package/dist/components/optimistic-toggle-button.component.js +86 -25
- package/dist/components/optimistic-toggle-button.component.js.map +1 -1
- package/dist/components/page-header.component.d.ts +5 -1
- package/dist/components/page-header.component.d.ts.map +1 -1
- package/dist/components/page-header.component.js +5 -1
- package/dist/components/page-header.component.js.map +1 -1
- package/dist/components/page-shell.component.d.ts +5 -1
- package/dist/components/page-shell.component.d.ts.map +1 -1
- package/dist/components/page-shell.component.js +5 -1
- package/dist/components/page-shell.component.js.map +1 -1
- package/dist/components/pagination.component.d.ts +15 -2
- package/dist/components/pagination.component.d.ts.map +1 -1
- package/dist/components/pagination.component.js +26 -5
- package/dist/components/pagination.component.js.map +1 -1
- package/dist/components/panel-close.component.d.ts +10 -1
- package/dist/components/panel-close.component.d.ts.map +1 -1
- package/dist/components/panel-close.component.js +1 -1
- package/dist/components/panel-close.component.js.map +1 -1
- package/dist/components/progress.component.d.ts +51 -8
- package/dist/components/progress.component.d.ts.map +1 -1
- package/dist/components/progress.component.js +26 -5
- package/dist/components/progress.component.js.map +1 -1
- package/dist/components/prompt-dialog.component.d.ts +59 -16
- package/dist/components/prompt-dialog.component.d.ts.map +1 -1
- package/dist/components/prompt-dialog.component.js +129 -41
- package/dist/components/prompt-dialog.component.js.map +1 -1
- package/dist/components/radio-group.component.d.ts +16 -2
- package/dist/components/radio-group.component.d.ts.map +1 -1
- package/dist/components/radio-group.component.js +28 -5
- package/dist/components/radio-group.component.js.map +1 -1
- package/dist/components/responsive-app-shell.component.d.ts +155 -31
- package/dist/components/responsive-app-shell.component.d.ts.map +1 -1
- package/dist/components/responsive-app-shell.component.js +163 -54
- package/dist/components/responsive-app-shell.component.js.map +1 -1
- package/dist/components/select.component.d.ts +29 -4
- package/dist/components/select.component.d.ts.map +1 -1
- package/dist/components/select.component.js +55 -9
- package/dist/components/select.component.js.map +1 -1
- package/dist/components/separator.component.d.ts +37 -7
- package/dist/components/separator.component.d.ts.map +1 -1
- package/dist/components/separator.component.js +33 -6
- package/dist/components/separator.component.js.map +1 -1
- package/dist/components/sidebar-user-card.component.d.ts +28 -7
- package/dist/components/sidebar-user-card.component.d.ts.map +1 -1
- package/dist/components/sidebar-user-card.component.js +1 -1
- package/dist/components/sidebar-user-card.component.js.map +1 -1
- package/dist/components/skeleton.component.d.ts +23 -4
- package/dist/components/skeleton.component.d.ts.map +1 -1
- package/dist/components/skeleton.component.js +34 -7
- package/dist/components/skeleton.component.js.map +1 -1
- package/dist/components/spinner.component.d.ts +15 -2
- package/dist/components/spinner.component.d.ts.map +1 -1
- package/dist/components/spinner.component.js +34 -6
- package/dist/components/spinner.component.js.map +1 -1
- package/dist/components/switch.component.d.ts +30 -7
- package/dist/components/switch.component.d.ts.map +1 -1
- package/dist/components/switch.component.js +56 -11
- package/dist/components/switch.component.js.map +1 -1
- package/dist/components/table.component.d.ts +29 -3
- package/dist/components/table.component.d.ts.map +1 -1
- package/dist/components/table.component.js +63 -8
- package/dist/components/table.component.js.map +1 -1
- package/dist/components/tabs.component.d.ts +18 -3
- package/dist/components/tabs.component.d.ts.map +1 -1
- package/dist/components/tabs.component.js +74 -39
- package/dist/components/tabs.component.js.map +1 -1
- package/dist/components/textarea.component.d.ts +29 -4
- package/dist/components/textarea.component.d.ts.map +1 -1
- package/dist/components/textarea.component.js +55 -9
- package/dist/components/textarea.component.js.map +1 -1
- package/dist/components/theme-toggle.component.d.ts +25 -6
- package/dist/components/theme-toggle.component.d.ts.map +1 -1
- package/dist/components/theme-toggle.component.js +1 -1
- package/dist/components/theme-toggle.component.js.map +1 -1
- package/dist/components/toast.component.d.ts +27 -6
- package/dist/components/toast.component.d.ts.map +1 -1
- package/dist/components/toast.component.js +48 -14
- package/dist/components/toast.component.js.map +1 -1
- package/dist/components/tooltip.component.d.ts +57 -5
- package/dist/components/tooltip.component.d.ts.map +1 -1
- package/dist/components/tooltip.component.js +103 -11
- package/dist/components/tooltip.component.js.map +1 -1
- package/dist/components/user-menu-popover.component.d.ts +68 -14
- package/dist/components/user-menu-popover.component.d.ts.map +1 -1
- package/dist/components/user-menu-popover.component.js +4 -4
- package/dist/components/user-menu-popover.component.js.map +1 -1
- package/dist/components/user-menu.component.d.ts +33 -9
- package/dist/components/user-menu.component.d.ts.map +1 -1
- package/dist/components/user-menu.component.js +1 -1
- package/dist/components/user-menu.component.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- 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/element-props.d.ts +78 -0
- package/dist/utilities/element-props.d.ts.map +1 -0
- package/dist/utilities/element-props.js +166 -0
- package/dist/utilities/element-props.js.map +1 -0
- package/dist/utilities/element.d.ts +34 -0
- package/dist/utilities/element.d.ts.map +1 -0
- package/dist/utilities/element.js +24 -0
- package/dist/utilities/element.js.map +1 -0
- package/dist/utilities/index.d.ts +2 -0
- package/dist/utilities/index.d.ts.map +1 -1
- package/dist/utilities/index.js +2 -0
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/node-value.d.ts +1 -1
- package/dist/utilities/node-value.d.ts.map +1 -1
- package/dist/utilities/node-value.js +6 -2
- package/dist/utilities/node-value.js.map +1 -1
- package/dist/utilities/render-icon.d.ts +3 -2
- package/dist/utilities/render-icon.d.ts.map +1 -1
- package/dist/utilities/render-icon.js +6 -3
- package/dist/utilities/render-icon.js.map +1 -1
- package/dist/utilities/rest-attrs.d.ts +26 -2
- package/dist/utilities/rest-attrs.d.ts.map +1 -1
- package/dist/utilities/rest-attrs.js +37 -0
- package/dist/utilities/rest-attrs.js.map +1 -1
- package/package.json +4 -3
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { Component, EventEmitter, Output, signal, TemplateRef, ViewChildren, } from '@angular/core';
|
|
6
|
+
import { Component, ElementRef, EventEmitter, inject, Output, signal, TemplateRef, ViewChildren, } from '@angular/core';
|
|
7
7
|
import { getClassMap } from '@molecule/app-ui';
|
|
8
|
+
import { hostElement } from '../utilities/element.js';
|
|
8
9
|
import { nextInstanceId } from '../utilities/ids.js';
|
|
9
10
|
import { styleText } from '../utilities/style.js';
|
|
10
11
|
import { MolTemplateOutlet } from './template-outlet.directive.js';
|
|
@@ -12,7 +13,7 @@ import * as i0 from "@angular/core";
|
|
|
12
13
|
const _c0 = ["tabBtn"];
|
|
13
14
|
const _forTrack0 = ($index, $item) => $item.value;
|
|
14
15
|
function Tabs_For_2_Conditional_2_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
15
|
-
i0.ɵɵelementContainer(0,
|
|
16
|
+
i0.ɵɵelementContainer(0, 5);
|
|
16
17
|
} if (rf & 2) {
|
|
17
18
|
i0.ɵɵproperty("molTemplateOutlet", ctx);
|
|
18
19
|
} }
|
|
@@ -25,7 +26,7 @@ function Tabs_For_2_Conditional_2_Conditional_2_Template(rf, ctx) { if (rf & 1)
|
|
|
25
26
|
} }
|
|
26
27
|
function Tabs_For_2_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
27
28
|
i0.ɵɵelementStart(0, "span");
|
|
28
|
-
i0.ɵɵconditionalCreate(1, Tabs_For_2_Conditional_2_Conditional_1_Template, 1, 1, "ng-container",
|
|
29
|
+
i0.ɵɵconditionalCreate(1, Tabs_For_2_Conditional_2_Conditional_1_Template, 1, 1, "ng-container", 5)(2, Tabs_For_2_Conditional_2_Conditional_2_Template, 1, 1);
|
|
29
30
|
i0.ɵɵelementEnd();
|
|
30
31
|
} if (rf & 2) {
|
|
31
32
|
let tmp_13_0;
|
|
@@ -36,7 +37,7 @@ function Tabs_For_2_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
|
36
37
|
i0.ɵɵconditional((tmp_13_0 = ctx_r2.asTemplate(item_r2.icon)) ? 1 : 2, tmp_13_0);
|
|
37
38
|
} }
|
|
38
39
|
function Tabs_For_2_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
39
|
-
i0.ɵɵelementContainer(0,
|
|
40
|
+
i0.ɵɵelementContainer(0, 5);
|
|
40
41
|
} if (rf & 2) {
|
|
41
42
|
i0.ɵɵproperty("molTemplateOutlet", ctx);
|
|
42
43
|
} }
|
|
@@ -49,46 +50,49 @@ function Tabs_For_2_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
49
50
|
} }
|
|
50
51
|
function Tabs_For_2_Template(rf, ctx) { if (rf & 1) {
|
|
51
52
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
52
|
-
i0.ɵɵelementStart(0, "button",
|
|
53
|
+
i0.ɵɵelementStart(0, "button", 3, 0);
|
|
53
54
|
i0.ɵɵlistener("click", function Tabs_For_2_Template_button_click_0_listener() { const item_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.selectTab(item_r2.value)); })("keydown", function Tabs_For_2_Template_button_keydown_0_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.handleKeyDown($event)); });
|
|
54
|
-
i0.ɵɵconditionalCreate(2, Tabs_For_2_Conditional_2_Template, 3, 3, "span",
|
|
55
|
-
i0.ɵɵconditionalCreate(3, Tabs_For_2_Conditional_3_Template, 1, 1, "ng-container",
|
|
55
|
+
i0.ɵɵconditionalCreate(2, Tabs_For_2_Conditional_2_Template, 3, 3, "span", 4);
|
|
56
|
+
i0.ɵɵconditionalCreate(3, Tabs_For_2_Conditional_3_Template, 1, 1, "ng-container", 5)(4, Tabs_For_2_Conditional_4_Template, 1, 1);
|
|
56
57
|
i0.ɵɵelementEnd();
|
|
57
58
|
} if (rf & 2) {
|
|
58
59
|
let tmp_19_0;
|
|
59
60
|
const item_r2 = ctx.$implicit;
|
|
60
61
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
61
62
|
i0.ɵɵclassMap(ctx_r2.triggerClasses());
|
|
62
|
-
i0.ɵɵproperty("id", ctx_r2.tabId(item_r2.value))("disabled", !!item_r2.disabled);
|
|
63
|
+
i0.ɵɵproperty("id", ctx_r2.tabId(item_r2.value))("disabled", !!item_r2.disabled || ctx_r2.disabled);
|
|
63
64
|
i0.ɵɵattribute("aria-selected", item_r2.value === ctx_r2.activeValue() ? "true" : "false")("aria-controls", ctx_r2.controlsId(item_r2))("data-state", item_r2.value === ctx_r2.activeValue() ? "active" : "inactive")("tabindex", item_r2.value === ctx_r2.activeValue() ? 0 : -1);
|
|
64
65
|
i0.ɵɵadvance(2);
|
|
65
66
|
i0.ɵɵconditional(item_r2.icon ? 2 : -1);
|
|
66
67
|
i0.ɵɵadvance();
|
|
67
68
|
i0.ɵɵconditional((tmp_19_0 = ctx_r2.asTemplate(item_r2.label)) ? 3 : 4, tmp_19_0);
|
|
68
69
|
} }
|
|
69
|
-
function
|
|
70
|
-
i0.ɵɵ
|
|
70
|
+
function Tabs_Conditional_3_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
71
|
+
i0.ɵɵelementStart(0, "div", 8);
|
|
72
|
+
i0.ɵɵelementContainer(1, 5);
|
|
73
|
+
i0.ɵɵelementEnd();
|
|
71
74
|
} if (rf & 2) {
|
|
75
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
76
|
+
i0.ɵɵclassMap(ctx_r2.contentClasses());
|
|
77
|
+
i0.ɵɵproperty("id", ctx_r2.panelId(ctx_r2.activeValue() ?? ""));
|
|
78
|
+
i0.ɵɵattribute("aria-labelledby", ctx_r2.tabId(ctx_r2.activeValue() ?? ""));
|
|
79
|
+
i0.ɵɵadvance();
|
|
72
80
|
i0.ɵɵproperty("molTemplateOutlet", ctx);
|
|
73
81
|
} }
|
|
74
|
-
function
|
|
75
|
-
i0.ɵɵ
|
|
82
|
+
function Tabs_Conditional_3_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
83
|
+
i0.ɵɵelement(0, "div", 9);
|
|
76
84
|
} if (rf & 2) {
|
|
77
85
|
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
78
|
-
i0.ɵɵ
|
|
86
|
+
i0.ɵɵclassMap(ctx_r2.contentClasses());
|
|
87
|
+
i0.ɵɵproperty("id", ctx_r2.panelId(ctx_r2.activeValue() ?? ""))("textContent", ctx_r2.contentText());
|
|
88
|
+
i0.ɵɵattribute("aria-labelledby", ctx_r2.tabId(ctx_r2.activeValue() ?? ""));
|
|
79
89
|
} }
|
|
80
90
|
function Tabs_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
81
|
-
i0.ɵɵ
|
|
82
|
-
i0.ɵɵconditionalCreate(1, Tabs_Conditional_3_Conditional_1_Template, 1, 1, "ng-container", 6)(2, Tabs_Conditional_3_Conditional_2_Template, 1, 1);
|
|
83
|
-
i0.ɵɵelementEnd();
|
|
91
|
+
i0.ɵɵconditionalCreate(0, Tabs_Conditional_3_Conditional_0_Template, 2, 5, "div", 6)(1, Tabs_Conditional_3_Conditional_1_Template, 1, 5, "div", 7);
|
|
84
92
|
} if (rf & 2) {
|
|
85
|
-
let
|
|
93
|
+
let tmp_1_0;
|
|
86
94
|
const ctx_r2 = i0.ɵɵnextContext();
|
|
87
|
-
i0.ɵɵ
|
|
88
|
-
i0.ɵɵproperty("id", ctx_r2.panelId(ctx_r2.activeValue() ?? ""));
|
|
89
|
-
i0.ɵɵattribute("aria-labelledby", ctx_r2.tabId(ctx_r2.activeValue() ?? ""));
|
|
90
|
-
i0.ɵɵadvance();
|
|
91
|
-
i0.ɵɵconditional((tmp_4_0 = ctx_r2.activeContent()) ? 1 : 2, tmp_4_0);
|
|
95
|
+
i0.ɵɵconditional((tmp_1_0 = ctx_r2.activeContent()) ? 0 : 1, tmp_1_0);
|
|
92
96
|
} }
|
|
93
97
|
/**
|
|
94
98
|
* Tabs component.
|
|
@@ -118,8 +122,17 @@ export class Tabs {
|
|
|
118
122
|
style;
|
|
119
123
|
/** `data-testid`. */
|
|
120
124
|
testId;
|
|
125
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
126
|
+
automationId;
|
|
127
|
+
/** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
|
|
128
|
+
dataMolId;
|
|
129
|
+
/** Disables every tab, whatever an item says (React's `disabled`). */
|
|
130
|
+
disabled;
|
|
121
131
|
/** Fires with the selected tab's value (React's `onChange`). */
|
|
122
132
|
change = new EventEmitter();
|
|
133
|
+
host = inject(ElementRef);
|
|
134
|
+
/** The element a caller's ref receives: the host `<div>`. */
|
|
135
|
+
element = hostElement(this.host);
|
|
123
136
|
/** The tab buttons (for focus movement). */
|
|
124
137
|
tabButtons;
|
|
125
138
|
/** The per-instance id base (the normalizer renumbers ids). */
|
|
@@ -207,6 +220,16 @@ export class Tabs {
|
|
|
207
220
|
hostStyle() {
|
|
208
221
|
return styleText(this.style);
|
|
209
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
|
|
225
|
+
* @returns The attribute value.
|
|
226
|
+
*/
|
|
227
|
+
molId() {
|
|
228
|
+
return (this.automationId ??
|
|
229
|
+
this.dataMolId ??
|
|
230
|
+
this.host.nativeElement.getAttribute('data-mol-id') ??
|
|
231
|
+
undefined);
|
|
232
|
+
}
|
|
210
233
|
/**
|
|
211
234
|
* Narrows a node-valued prop to a TemplateRef.
|
|
212
235
|
*
|
|
@@ -263,6 +286,8 @@ export class Tabs {
|
|
|
263
286
|
* @param event - The key event.
|
|
264
287
|
*/
|
|
265
288
|
handleKeyDown(event) {
|
|
289
|
+
if (this.disabled)
|
|
290
|
+
return;
|
|
266
291
|
const enabled = this.items.filter((item) => !item.disabled);
|
|
267
292
|
if (enabled.length === 0)
|
|
268
293
|
return;
|
|
@@ -304,15 +329,15 @@ export class Tabs {
|
|
|
304
329
|
} if (rf & 2) {
|
|
305
330
|
let _t;
|
|
306
331
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tabButtons = _t);
|
|
307
|
-
} }, hostVars:
|
|
308
|
-
i0.ɵɵattribute("data-testid", ctx.testId);
|
|
332
|
+
} }, hostVars: 6, hostBindings: function Tabs_HostBindings(rf, ctx) { if (rf & 2) {
|
|
333
|
+
i0.ɵɵattribute("data-testid", ctx.testId)("data-mol-id", ctx.molId());
|
|
309
334
|
i0.ɵɵstyleMap(ctx.hostStyle());
|
|
310
335
|
i0.ɵɵclassMap(ctx.className);
|
|
311
|
-
} }, inputs: { items: "items", value: "value", defaultValue: "defaultValue", variant: "variant", size: "size", fitted: "fitted", className: "className", style: "style", testId: "testId" }, outputs: { change: "change" }, decls: 4, vars: 3, consts: [["tabBtn", ""], ["role", "tablist"], ["type", "button", "role", "tab", 3, "id", "disabled", "class"], ["role", "
|
|
336
|
+
} }, inputs: { items: "items", value: "value", defaultValue: "defaultValue", variant: "variant", size: "size", fitted: "fitted", className: "className", style: "style", testId: "testId", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"], disabled: "disabled" }, outputs: { change: "change" }, decls: 4, vars: 3, consts: [["tabBtn", ""], ["role", "tablist"], ["type", "button", "role", "tab", 3, "id", "disabled", "class"], ["type", "button", "role", "tab", 3, "click", "keydown", "id", "disabled"], [3, "class"], [3, "molTemplateOutlet"], ["role", "tabpanel", 3, "id", "class"], ["role", "tabpanel", 3, "id", "class", "textContent"], ["role", "tabpanel", 3, "id"], ["role", "tabpanel", 3, "id", "textContent"]], template: function Tabs_Template(rf, ctx) { if (rf & 1) {
|
|
312
337
|
i0.ɵɵelementStart(0, "div", 1);
|
|
313
338
|
i0.ɵɵrepeaterCreate(1, Tabs_For_2_Template, 5, 10, "button", 2, _forTrack0);
|
|
314
339
|
i0.ɵɵelementEnd();
|
|
315
|
-
i0.ɵɵconditionalCreate(3, Tabs_Conditional_3_Template,
|
|
340
|
+
i0.ɵɵconditionalCreate(3, Tabs_Conditional_3_Template, 2, 1);
|
|
316
341
|
} if (rf & 2) {
|
|
317
342
|
i0.ɵɵclassMap(ctx.listClasses());
|
|
318
343
|
i0.ɵɵadvance();
|
|
@@ -337,12 +362,16 @@ export class Tabs {
|
|
|
337
362
|
'className',
|
|
338
363
|
'style',
|
|
339
364
|
'testId',
|
|
365
|
+
'automationId',
|
|
366
|
+
'dataMolId: data-mol-id',
|
|
367
|
+
'disabled',
|
|
340
368
|
],
|
|
341
369
|
outputs: ['change'],
|
|
342
370
|
host: {
|
|
343
371
|
'[class]': 'className',
|
|
344
372
|
'[style]': 'hostStyle()',
|
|
345
373
|
'[attr.data-testid]': 'testId',
|
|
374
|
+
'[attr.data-mol-id]': 'molId()',
|
|
346
375
|
},
|
|
347
376
|
template: `<div [class]="listClasses()" role="tablist">
|
|
348
377
|
@for (item of items; track item.value) {
|
|
@@ -355,7 +384,7 @@ export class Tabs {
|
|
|
355
384
|
[attr.aria-controls]="controlsId(item)"
|
|
356
385
|
[attr.data-state]="item.value === activeValue() ? 'active' : 'inactive'"
|
|
357
386
|
[attr.tabindex]="item.value === activeValue() ? 0 : -1"
|
|
358
|
-
[disabled]="!!item.disabled"
|
|
387
|
+
[disabled]="!!item.disabled || disabled"
|
|
359
388
|
(click)="selectTab(item.value)"
|
|
360
389
|
(keydown)="handleKeyDown($event)"
|
|
361
390
|
[class]="triggerClasses()"
|
|
@@ -378,18 +407,24 @@ export class Tabs {
|
|
|
378
407
|
}
|
|
379
408
|
</div>
|
|
380
409
|
@if (hasContent()) {
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
410
|
+
@if (activeContent(); as contentTpl) {
|
|
411
|
+
<div
|
|
412
|
+
role="tabpanel"
|
|
413
|
+
[id]="panelId(activeValue() ?? '')"
|
|
414
|
+
[attr.aria-labelledby]="tabId(activeValue() ?? '')"
|
|
415
|
+
[class]="contentClasses()"
|
|
416
|
+
>
|
|
388
417
|
<ng-container [molTemplateOutlet]="contentTpl"></ng-container>
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
418
|
+
</div>
|
|
419
|
+
} @else {
|
|
420
|
+
<div
|
|
421
|
+
role="tabpanel"
|
|
422
|
+
[id]="panelId(activeValue() ?? '')"
|
|
423
|
+
[attr.aria-labelledby]="tabId(activeValue() ?? '')"
|
|
424
|
+
[class]="contentClasses()"
|
|
425
|
+
[textContent]="contentText()"
|
|
426
|
+
></div>
|
|
427
|
+
}
|
|
393
428
|
}`,
|
|
394
429
|
}]
|
|
395
430
|
}], null, { change: [{
|
|
@@ -398,5 +433,5 @@ export class Tabs {
|
|
|
398
433
|
type: ViewChildren,
|
|
399
434
|
args: ['tabBtn']
|
|
400
435
|
}] }); })();
|
|
401
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Tabs, { className: "Tabs", filePath: "components/tabs.component.ts", lineNumber:
|
|
436
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Tabs, { className: "Tabs", filePath: "components/tabs.component.ts", lineNumber: 116 }); })();
|
|
402
437
|
//# sourceMappingURL=tabs.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.component.js","sourceRoot":"","sources":["../../src/components/tabs.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,SAAS,
|
|
1
|
+
{"version":3,"file":"tabs.component.js","sourceRoot":"","sources":["../../src/components/tabs.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,MAAM,EAEN,MAAM,EAEN,MAAM,EACN,WAAW,EACX,YA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
|
* @module
|
|
5
5
|
*/
|
|
6
6
|
import { type AfterViewChecked, type AfterViewInit, ElementRef, EventEmitter } from '@angular/core';
|
|
7
|
-
import type { Size, UIClassMap } from '@molecule/app-ui';
|
|
7
|
+
import type { FocusEventHandler, KeyboardEventHandler, Size, UIClassMap } from '@molecule/app-ui';
|
|
8
|
+
import type { HasElement } from '../utilities/element.js';
|
|
8
9
|
import type { FormFieldContext } from '../utilities/form-field-context.js';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
/**
|
|
@@ -16,7 +17,7 @@ import * as i0 from "@angular/core";
|
|
|
16
17
|
* `autoResize` recomputes the inline height after every check and on real
|
|
17
18
|
* `input` events (matching React's effect + native listener pair).
|
|
18
19
|
*/
|
|
19
|
-
export declare class Textarea implements AfterViewInit, AfterViewChecked {
|
|
20
|
+
export declare class Textarea implements AfterViewInit, AfterViewChecked, HasElement<HTMLTextAreaElement> {
|
|
20
21
|
/** Textarea size. */
|
|
21
22
|
size?: Size;
|
|
22
23
|
/** Field label. */
|
|
@@ -53,11 +54,28 @@ export declare class Textarea implements AfterViewInit, AfterViewChecked {
|
|
|
53
54
|
id?: string;
|
|
54
55
|
/** Explicit rows attribute. */
|
|
55
56
|
rows?: number;
|
|
57
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
58
|
+
automationId?: string;
|
|
59
|
+
/** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
|
|
60
|
+
dataMolId?: string;
|
|
61
|
+
/** React's `onFocus`, which React spreads onto the <textarea>: its `currentTarget` is that element. */
|
|
62
|
+
onFocus?: FocusEventHandler;
|
|
63
|
+
/** React's `onBlur`, which React spreads onto the <textarea>: its `currentTarget` is that element. */
|
|
64
|
+
onBlur?: FocusEventHandler;
|
|
65
|
+
/** React's `onKeyDown`, which React spreads onto the <textarea>: its `currentTarget` is that element. */
|
|
66
|
+
onKeyDown?: KeyboardEventHandler;
|
|
56
67
|
/** Fires the raw `input` event (React's textarea onChange). */
|
|
57
68
|
readonly change: EventEmitter<Event>;
|
|
58
69
|
/** The native textarea (React's `...rest` spread target). */
|
|
59
|
-
textareaEl
|
|
70
|
+
private textareaEl?;
|
|
71
|
+
/** The native textarea view query; also feeds the caller's ref element. */
|
|
72
|
+
set textareaElQuery(ref: ElementRef<HTMLTextAreaElement> | undefined);
|
|
73
|
+
private readonly inner;
|
|
74
|
+
/** The element a caller's ref receives: the native `<textarea>`. */
|
|
75
|
+
readonly element: import("@angular/core").Signal<HTMLTextAreaElement | null>;
|
|
60
76
|
private readonly host;
|
|
77
|
+
/** The per-instance id used when the caller gives no `id` or `name` (React's `useId`). */
|
|
78
|
+
private readonly generatedId;
|
|
61
79
|
/**
|
|
62
80
|
* Reactive translation, read in the injection context. Its `locale` marks
|
|
63
81
|
* this view for check on a locale switch (see {@link ngAfterViewChecked}).
|
|
@@ -67,6 +85,8 @@ export declare class Textarea implements AfterViewInit, AfterViewChecked {
|
|
|
67
85
|
private restDescribedBy;
|
|
68
86
|
/** Whether the rest-describedby value was captured. */
|
|
69
87
|
private restDescribedByCaptured;
|
|
88
|
+
/** The `data-mol-id` a caller bound on the host (React spreads it onto the textarea). */
|
|
89
|
+
private externalMolId;
|
|
70
90
|
/**
|
|
71
91
|
* The current class map.
|
|
72
92
|
* @returns The UIClassMap.
|
|
@@ -107,6 +127,11 @@ export declare class Textarea implements AfterViewInit, AfterViewChecked {
|
|
|
107
127
|
* @returns The style attribute text.
|
|
108
128
|
*/
|
|
109
129
|
hostStyle(): string | null;
|
|
130
|
+
/**
|
|
131
|
+
* The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
|
|
132
|
+
* @returns The attribute value.
|
|
133
|
+
*/
|
|
134
|
+
molId(): string | undefined;
|
|
110
135
|
/**
|
|
111
136
|
* React's textarea onChange: the `input` event, with the controlled value
|
|
112
137
|
* restored afterwards and the autoResize height recomputed (React listens
|
|
@@ -153,6 +178,6 @@ export declare class Textarea implements AfterViewInit, AfterViewChecked {
|
|
|
153
178
|
*/
|
|
154
179
|
private applyValue;
|
|
155
180
|
static ɵfac: i0.ɵɵFactoryDeclaration<Textarea, never>;
|
|
156
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<Textarea, "div[mol-textarea]", never, { "size": { "alias": "size"; "required": false; }; "label": { "alias": "label"; "required": false; }; "error": { "alias": "error"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "autoResize": { "alias": "autoResize"; "required": false; }; "minRows": { "alias": "minRows"; "required": false; }; "maxRows": { "alias": "maxRows"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "value": { "alias": "value"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; }, { "change": "change"; }, never, never, true, never>;
|
|
181
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<Textarea, "div[mol-textarea]", never, { "size": { "alias": "size"; "required": false; }; "label": { "alias": "label"; "required": false; }; "error": { "alias": "error"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "autoResize": { "alias": "autoResize"; "required": false; }; "minRows": { "alias": "minRows"; "required": false; }; "maxRows": { "alias": "maxRows"; "required": false; }; "className": { "alias": "className"; "required": false; }; "style": { "alias": "style"; "required": false; }; "testId": { "alias": "testId"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; "value": { "alias": "value"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "name": { "alias": "name"; "required": false; }; "id": { "alias": "id"; "required": false; }; "rows": { "alias": "rows"; "required": false; }; "automationId": { "alias": "automationId"; "required": false; }; "dataMolId": { "alias": "data-mol-id"; "required": false; }; "onFocus": { "alias": "onFocus"; "required": false; }; "onBlur": { "alias": "onBlur"; "required": false; }; "onKeyDown": { "alias": "onKeyDown"; "required": false; }; }, { "change": "change"; }, never, never, true, never>;
|
|
157
182
|
}
|
|
158
183
|
//# sourceMappingURL=textarea.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.component.d.ts","sourceRoot":"","sources":["../../src/components/textarea.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAElB,UAAU,EACV,YAAY,
|
|
1
|
+
{"version":3,"file":"textarea.component.d.ts","sourceRoot":"","sources":["../../src/components/textarea.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAElB,UAAU,EACV,YAAY,EAKb,MAAM,eAAe,CAAA;AAGtB,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGjG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACzD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAA;;AAU1E;;;;;;;;GAQG;AACH,qBAiEa,QAAS,YAAW,aAAa,EAAE,gBAAgB,EAAE,UAAU,CAAC,mBAAmB,CAAC;IAC/F,qBAAqB;IACrB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,mBAAmB;IACnB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,8CAA8C;IAC9C,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,sD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,CAAmB;IAE/C;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;IAExC,6EAA6E;IAC7E,OAAO,CAAC,eAAe,CAAsB;IAC7C,uDAAuD;IACvD,OAAO,CAAC,uBAAuB,CAAQ;IACvC,yFAAyF;IACzF,OAAO,CAAC,aAAa,CAAoB;IAEzC;;;OAGG;IACH,EAAE,IAAI,UAAU;IAIhB;;;;;OAKG;IACH,UAAU,IAAI,MAAM;IAIpB;;;OAGG;IACH,WAAW,IAAI,MAAM,GAAG,IAAI;IAK5B;;;OAGG;IACH,YAAY,IAAI,gBAAgB,GAAG,IAAI;IAIvC;;;;OAIG;IACH,iBAAiB,IAAI,MAAM,GAAG,IAAI;IAMlC;;;OAGG;IACH,OAAO,IAAI,MAAM;IAOjB;;;;;OAKG;IACH,SAAS,IAAI,MAAM,GAAG,IAAI;IAI1B;;;OAGG;IACH,KAAK,IAAI,MAAM,GAAG,SAAS;IAI3B;;;;;;OAMG;IACH,WAAW,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAS/B;;;;;;OAMG;IACH,YAAY,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAIhC;;;;;OAKG;IACH,MAAM,IAAI,IAAI;IAWd;;;;OAIG;IACH,eAAe,IAAI,IAAI;IAkBvB;;;;;;OAMG;IACH,kBAAkB,IAAI,IAAI;IAoB1B;;;;;;OAMG;IACH,OAAO,CAAC,UAAU;yCAnQP,QAAQ;2CAAR,QAAQ;CA6QpB"}
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { Component, ElementRef, EventEmitter, inject, Output, ViewChild, } from '@angular/core';
|
|
6
|
+
import { Component, ElementRef, EventEmitter, inject, Output, signal, ViewChild, } from '@angular/core';
|
|
7
7
|
import { useTranslation } from '@molecule/app-angular';
|
|
8
8
|
import { getClassMap } from '@molecule/app-ui';
|
|
9
9
|
import { fieldContext } from '../utilities/form-field-context.js';
|
|
10
|
-
import {
|
|
10
|
+
import { nextInstanceId } from '../utilities/ids.js';
|
|
11
|
+
import { adoptHostDataMolId, moveRestAttributes, reapplyRestAttributes, } from '../utilities/rest-attrs.js';
|
|
11
12
|
import { styleText } from '../utilities/style.js';
|
|
12
13
|
import * as i0 from "@angular/core";
|
|
13
14
|
const _c0 = ["textareaEl"];
|
|
@@ -91,11 +92,32 @@ export class Textarea {
|
|
|
91
92
|
id;
|
|
92
93
|
/** Explicit rows attribute. */
|
|
93
94
|
rows;
|
|
95
|
+
/** `data-mol-id` automation id (React's `automationId`). */
|
|
96
|
+
automationId;
|
|
97
|
+
/** A `data-mol-id` given as a plain rest attribute (React's `rootProps` precedence). */
|
|
98
|
+
dataMolId;
|
|
99
|
+
/** React's `onFocus`, which React spreads onto the <textarea>: its `currentTarget` is that element. */
|
|
100
|
+
onFocus;
|
|
101
|
+
/** React's `onBlur`, which React spreads onto the <textarea>: its `currentTarget` is that element. */
|
|
102
|
+
onBlur;
|
|
103
|
+
/** React's `onKeyDown`, which React spreads onto the <textarea>: its `currentTarget` is that element. */
|
|
104
|
+
onKeyDown;
|
|
94
105
|
/** Fires the raw `input` event (React's textarea onChange). */
|
|
95
106
|
change = new EventEmitter();
|
|
96
107
|
/** The native textarea (React's `...rest` spread target). */
|
|
97
108
|
textareaEl;
|
|
109
|
+
/** The native textarea view query; also feeds the caller's ref element. */
|
|
110
|
+
set textareaElQuery(ref) {
|
|
111
|
+
this.textareaEl = ref;
|
|
112
|
+
this.inner.set(ref?.nativeElement ?? null);
|
|
113
|
+
}
|
|
114
|
+
inner = signal(null, /* @ts-ignore */
|
|
115
|
+
...(ngDevMode ? [{ debugName: "inner" }] : /* istanbul ignore next */ []));
|
|
116
|
+
/** The element a caller's ref receives: the native `<textarea>`. */
|
|
117
|
+
element = this.inner.asReadonly();
|
|
98
118
|
host = inject(ElementRef);
|
|
119
|
+
/** The per-instance id used when the caller gives no `id` or `name` (React's `useId`). */
|
|
120
|
+
generatedId = nextInstanceId();
|
|
99
121
|
/**
|
|
100
122
|
* Reactive translation, read in the injection context. Its `locale` marks
|
|
101
123
|
* this view for check on a locale switch (see {@link ngAfterViewChecked}).
|
|
@@ -105,6 +127,8 @@ export class Textarea {
|
|
|
105
127
|
restDescribedBy = null;
|
|
106
128
|
/** Whether the rest-describedby value was captured. */
|
|
107
129
|
restDescribedByCaptured = false;
|
|
130
|
+
/** The `data-mol-id` a caller bound on the host (React spreads it onto the textarea). */
|
|
131
|
+
externalMolId;
|
|
108
132
|
/**
|
|
109
133
|
* The current class map.
|
|
110
134
|
* @returns The UIClassMap.
|
|
@@ -119,7 +143,7 @@ export class Textarea {
|
|
|
119
143
|
* @returns The id value.
|
|
120
144
|
*/
|
|
121
145
|
textareaId() {
|
|
122
|
-
return this.id || this.fieldContext()?.id || this.name ||
|
|
146
|
+
return this.id || this.fieldContext()?.id || this.name || this.generatedId;
|
|
123
147
|
}
|
|
124
148
|
/**
|
|
125
149
|
* The aria-describedby target (error or hint paragraph).
|
|
@@ -166,6 +190,13 @@ export class Textarea {
|
|
|
166
190
|
hostStyle() {
|
|
167
191
|
return styleText(this.autoResize ? { minHeight: 0, resize: 'none', ...this.style } : this.style);
|
|
168
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* The `data-mol-id` value (`automationId` wins over a rest `data-mol-id`).
|
|
195
|
+
* @returns The attribute value.
|
|
196
|
+
*/
|
|
197
|
+
molId() {
|
|
198
|
+
return this.automationId ?? this.dataMolId ?? this.externalMolId;
|
|
199
|
+
}
|
|
169
200
|
/**
|
|
170
201
|
* React's textarea onChange: the `input` event, with the controlled value
|
|
171
202
|
* restored afterwards and the autoResize height recomputed (React listens
|
|
@@ -218,6 +249,9 @@ export class Textarea {
|
|
|
218
249
|
this.restDescribedBy = this.host.nativeElement.getAttribute('aria-describedby');
|
|
219
250
|
this.restDescribedByCaptured = true;
|
|
220
251
|
}
|
|
252
|
+
adoptHostDataMolId(this.host.nativeElement, this.textareaEl?.nativeElement, (id) => {
|
|
253
|
+
this.externalMolId = id;
|
|
254
|
+
}, () => this.molId());
|
|
221
255
|
moveRestAttributes(this.host.nativeElement, this.textareaEl?.nativeElement);
|
|
222
256
|
this.applyValue(true);
|
|
223
257
|
this.resize();
|
|
@@ -236,6 +270,9 @@ export class Textarea {
|
|
|
236
270
|
// detection never re-checks this view — the parent's re-bound
|
|
237
271
|
// `[attr.aria-label]` would land on the host and stay there.
|
|
238
272
|
void this.i18n.locale();
|
|
273
|
+
adoptHostDataMolId(this.host.nativeElement, this.textareaEl?.nativeElement, (id) => {
|
|
274
|
+
this.externalMolId = id;
|
|
275
|
+
}, () => this.molId());
|
|
239
276
|
reapplyRestAttributes(this.host.nativeElement, this.textareaEl?.nativeElement);
|
|
240
277
|
this.applyValue(false);
|
|
241
278
|
this.resize();
|
|
@@ -265,13 +302,13 @@ export class Textarea {
|
|
|
265
302
|
i0.ɵɵviewQuery(_c0, 5);
|
|
266
303
|
} if (rf & 2) {
|
|
267
304
|
let _t;
|
|
268
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
305
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.textareaElQuery = _t.first);
|
|
269
306
|
} }, hostVars: 2, hostBindings: function Textarea_HostBindings(rf, ctx) { if (rf & 2) {
|
|
270
307
|
i0.ɵɵclassMap(ctx.cm().inputWrapper);
|
|
271
|
-
} }, inputs: { size: "size", label: "label", error: "error", hint: "hint", autoResize: "autoResize", minRows: "minRows", maxRows: "maxRows", className: "className", style: "style", testId: "testId", disabled: "disabled", required: "required", value: "value", defaultValue: "defaultValue", placeholder: "placeholder", name: "name", id: "id", rows: "rows" }, outputs: { change: "change" }, decls: 5, vars:
|
|
308
|
+
} }, inputs: { size: "size", label: "label", error: "error", hint: "hint", autoResize: "autoResize", minRows: "minRows", maxRows: "maxRows", className: "className", style: "style", testId: "testId", disabled: "disabled", required: "required", value: "value", defaultValue: "defaultValue", placeholder: "placeholder", name: "name", id: "id", rows: "rows", automationId: "automationId", dataMolId: [0, "data-mol-id", "dataMolId"], onFocus: "onFocus", onBlur: "onBlur", onKeyDown: "onKeyDown" }, outputs: { change: "change" }, decls: 5, vars: 16, consts: [["textareaEl", ""], [3, "class"], [3, "input", "change", "focusin", "focusout", "keydown", "disabled"]], template: function Textarea_Template(rf, ctx) { if (rf & 1) {
|
|
272
309
|
i0.ɵɵconditionalCreate(0, Textarea_Conditional_0_Template, 2, 6, "label", 1);
|
|
273
310
|
i0.ɵɵdomElementStart(1, "textarea", 2, 0);
|
|
274
|
-
i0.ɵɵdomListener("input", function Textarea_Template_textarea_input_1_listener($event) { return ctx.handleInput($event); })("change", function Textarea_Template_textarea_change_1_listener($event) { return ctx.handleChange($event); });
|
|
311
|
+
i0.ɵɵdomListener("input", function Textarea_Template_textarea_input_1_listener($event) { return ctx.handleInput($event); })("change", function Textarea_Template_textarea_change_1_listener($event) { return ctx.handleChange($event); })("focusin", function Textarea_Template_textarea_focusin_1_listener($event) { return ctx.onFocus?.($event); })("focusout", function Textarea_Template_textarea_focusout_1_listener($event) { return ctx.onBlur?.($event); })("keydown", function Textarea_Template_textarea_keydown_1_listener($event) { return ctx.onKeyDown?.($event); });
|
|
275
312
|
i0.ɵɵdomElementEnd();
|
|
276
313
|
i0.ɵɵconditionalCreate(3, Textarea_Conditional_3_Template, 2, 4, "p", 1);
|
|
277
314
|
i0.ɵɵconditionalCreate(4, Textarea_Conditional_4_Template, 2, 4, "p", 1);
|
|
@@ -280,7 +317,7 @@ export class Textarea {
|
|
|
280
317
|
i0.ɵɵadvance();
|
|
281
318
|
i0.ɵɵclassMap(ctx.classes());
|
|
282
319
|
i0.ɵɵdomProperty("disabled", ctx.disabled);
|
|
283
|
-
i0.ɵɵattribute("id", ctx.textareaId())("name", ctx.name)("placeholder", ctx.placeholder)("required", ctx.required ? "" : null)("rows", ctx.rows || ctx.minRows || 3)("aria-invalid", ctx.error || ctx.fieldContext()?.invalid ? "true" : "false")("aria-describedby", ctx.mergedDescribedBy())("style", ctx.hostStyle(), i0.ɵɵsanitizeStyle)("data-testid", ctx.testId);
|
|
320
|
+
i0.ɵɵattribute("id", ctx.textareaId())("name", ctx.name)("placeholder", ctx.placeholder)("required", ctx.required ? "" : null)("rows", ctx.rows || ctx.minRows || 3)("aria-invalid", ctx.error || ctx.fieldContext()?.invalid ? "true" : "false")("aria-describedby", ctx.mergedDescribedBy())("style", ctx.hostStyle(), i0.ɵɵsanitizeStyle)("data-testid", ctx.testId)("data-mol-id", ctx.molId());
|
|
284
321
|
i0.ɵɵadvance(2);
|
|
285
322
|
i0.ɵɵconditional(ctx.error ? 3 : -1);
|
|
286
323
|
i0.ɵɵadvance();
|
|
@@ -311,6 +348,11 @@ export class Textarea {
|
|
|
311
348
|
'name',
|
|
312
349
|
'id',
|
|
313
350
|
'rows',
|
|
351
|
+
'automationId',
|
|
352
|
+
'dataMolId: data-mol-id',
|
|
353
|
+
'onFocus',
|
|
354
|
+
'onBlur',
|
|
355
|
+
'onKeyDown',
|
|
314
356
|
],
|
|
315
357
|
host: {
|
|
316
358
|
'[class]': 'cm().inputWrapper',
|
|
@@ -334,8 +376,12 @@ export class Textarea {
|
|
|
334
376
|
[class]="classes()"
|
|
335
377
|
[attr.style]="hostStyle()"
|
|
336
378
|
[attr.data-testid]="testId"
|
|
379
|
+
[attr.data-mol-id]="molId()"
|
|
337
380
|
(input)="handleInput($event)"
|
|
338
381
|
(change)="handleChange($event)"
|
|
382
|
+
(focusin)="onFocus?.($event)"
|
|
383
|
+
(focusout)="onBlur?.($event)"
|
|
384
|
+
(keydown)="onKeyDown?.($event)"
|
|
339
385
|
#textareaEl
|
|
340
386
|
></textarea>
|
|
341
387
|
@if (error) {
|
|
@@ -347,9 +393,9 @@ export class Textarea {
|
|
|
347
393
|
}]
|
|
348
394
|
}], null, { change: [{
|
|
349
395
|
type: Output
|
|
350
|
-
}],
|
|
396
|
+
}], textareaElQuery: [{
|
|
351
397
|
type: ViewChild,
|
|
352
398
|
args: ['textareaEl']
|
|
353
399
|
}] }); })();
|
|
354
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Textarea, { className: "Textarea", filePath: "components/textarea.component.ts", lineNumber:
|
|
400
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Textarea, { className: "Textarea", filePath: "components/textarea.component.ts", lineNumber: 108 }); })();
|
|
355
401
|
//# sourceMappingURL=textarea.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textarea.component.js","sourceRoot":"","sources":["../../src/components/textarea.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,MAAM,EACN,MAAM,EACN,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"textarea.component.js","sourceRoot":"","sources":["../../src/components/textarea.component.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAGL,SAAS,EACT,UAAU,EACV,YAAY,EACZ,MAAM,EACN,MAAM,EACN,MAAM,EACN,SAAS,GACV,MAAM,eAAe,CAAA;AAEtB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAEtD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAI9C,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAA;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;;;;;IA2C3C,gCAGG;IAAA,YAAW;IA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AC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAC5C,CAAC;IACH,CAAC;kGA5QU,QAAQ;6DAAR,QAAQ;;;;;;YAAR,cAAA,QAAI,cAAI;;YAlCR,4EAAa;YAOtB,yCAmBC;YAFC,AADA,AADA,AADA,AADA,gGAAS,uBAAmB,IAAC,kFACnB,wBAAoB,IAAC,oFACpB,qBAAiB,IAAC,sFACjB,oBAAgB,IAAC,oFAClB,uBAAmB,IAAC;YAEhC,oBAAW;YACZ,wEAAa;YAGb,wEAAsB;;YA9Bb,oCAMR;YAUC,cAAmB;YAAnB,4BAAmB;YALnB,0CAAqB;;YAgBvB,eAEC;YAFD,oCAEC;YACD,cAEC;YAFD,iDAEC;;;iFAEQ,QAAQ;cAjEpB,SAAS;eAAC;gBACT,QAAQ,EAAE,mBAAmB;gBAC7B,UAAU,EAAE,IAAI;gBAChB,MAAM,EAAE;oBACN,MAAM;oBACN,OAAO;oBACP,OAAO;oBACP,MAAM;oBACN,YAAY;oBACZ,SAAS;oBACT,SAAS;oBACT,WAAW;oBACX,OAAO;oBACP,QAAQ;oBACR,UAAU;oBACV,UAAU;oBACV,OAAO;oBACP,cAAc;oBACd,aAAa;oBACb,MAAM;oBACN,IAAI;oBACJ,MAAM;oBACN,cAAc;oBACd,wBAAwB;oBACxB,SAAS;oBACT,QAAQ;oBACR,WAAW;iBACZ;gBACD,IAAI,EAAE;oBACJ,SAAS,EAAE,mBAAmB;iBAC/B;gBACD,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAgCN;aACL;;kBAmDE,MAAM;;kBAKN,SAAS;mBAAC,YAAY;;kFAvDZ,QAAQ"}
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import type { IconName } from '@molecule/app-icons';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* Props for {@link ThemeToggle} (React's `ThemeToggleProps`, in Angular's
|
|
5
|
+
* form). Extra `<button>` attributes (`data-*`, `title`, `disabled`, …) land
|
|
6
|
+
* on the host element, exactly React's spread target.
|
|
7
|
+
*/
|
|
8
|
+
export interface ThemeToggleProps {
|
|
9
|
+
/** i18n key for the `aria-label` (default `theme.toggle`). */
|
|
10
|
+
ariaLabelKey?: string;
|
|
11
|
+
/** Fallback `aria-label` if the i18n key is missing. */
|
|
12
|
+
ariaLabelDefault?: string;
|
|
13
|
+
/** Icon name rendered in dark mode (default `moon`). */
|
|
14
|
+
darkIcon?: IconName;
|
|
15
|
+
/** Icon name rendered in light mode (default `sun`). */
|
|
16
|
+
lightIcon?: IconName;
|
|
17
|
+
/** Pixel size for the rendered icon (default 20). */
|
|
18
|
+
iconSize?: number;
|
|
19
|
+
/** Extra classes joined onto the toggle classes. */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
3
22
|
/**
|
|
4
23
|
* ThemeToggle component.
|
|
5
24
|
*
|
|
@@ -13,17 +32,17 @@ import * as i0 from "@angular/core";
|
|
|
13
32
|
*/
|
|
14
33
|
export declare class ThemeToggle {
|
|
15
34
|
/** i18n key for the `aria-label` (default `theme.toggle`). */
|
|
16
|
-
ariaLabelKey?:
|
|
35
|
+
ariaLabelKey?: ThemeToggleProps['ariaLabelKey'];
|
|
17
36
|
/** Fallback `aria-label` if the i18n key is missing. */
|
|
18
|
-
ariaLabelDefault?:
|
|
37
|
+
ariaLabelDefault?: ThemeToggleProps['ariaLabelDefault'];
|
|
19
38
|
/** Icon name rendered in dark mode (default `moon`). */
|
|
20
|
-
darkIcon?:
|
|
39
|
+
darkIcon?: ThemeToggleProps['darkIcon'];
|
|
21
40
|
/** Icon name rendered in light mode (default `sun`). */
|
|
22
|
-
lightIcon?:
|
|
41
|
+
lightIcon?: ThemeToggleProps['lightIcon'];
|
|
23
42
|
/** Pixel size for the rendered icon (default 20). */
|
|
24
|
-
iconSize?:
|
|
43
|
+
iconSize?: ThemeToggleProps['iconSize'];
|
|
25
44
|
/** Extra classes joined onto the toggle classes. */
|
|
26
|
-
className?:
|
|
45
|
+
className?: ThemeToggleProps['className'];
|
|
27
46
|
/** Theme state and actions, read in the component's injection context. */
|
|
28
47
|
readonly theme: import("@molecule/app-angular").UseThemeResult;
|
|
29
48
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-toggle.component.d.ts","sourceRoot":"","sources":["../../src/components/theme-toggle.component.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;;AAMnD
|
|
1
|
+
{"version":3,"file":"theme-toggle.component.d.ts","sourceRoot":"","sources":["../../src/components/theme-toggle.component.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;;AAMnD;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,QAAQ,CAAA;IACnB,wDAAwD;IACxD,SAAS,CAAC,EAAE,QAAQ,CAAA;IACpB,qDAAqD;IACrD,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;;;GAUG;AACH,qBAoBa,WAAW;IACtB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,gBAAgB,CAAC,cAAc,CAAC,CAAA;IAC/C,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,gBAAgB,CAAC,kBAAkB,CAAC,CAAA;IACvD,wDAAwD;IACxD,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAA;IACvC,wDAAwD;IACxD,SAAS,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAA;IACzC,qDAAqD;IACrD,QAAQ,CAAC,EAAE,gBAAgB,CAAC,UAAU,CAAC,CAAA;IACvC,oDAAoD;IACpD,SAAS,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,CAAA;IAEzC,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,iDAAa;IAE3B;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;IAExC;;;OAGG;IACH,IAAI,IAAI,OAAO,GAAG,MAAM;IAIxB;;;OAGG;IACH,SAAS,IAAI,MAAM;IAUnB;;;OAGG;IACH,OAAO,IAAI,MAAM;IAKjB;;;OAGG;IACH,UAAU,IAAI,MAAM;yCA3DT,WAAW;2CAAX,WAAW;CA8DvB"}
|
|
@@ -120,5 +120,5 @@ export class ThemeToggle {
|
|
|
120
120
|
}`,
|
|
121
121
|
}]
|
|
122
122
|
}], null, null); })();
|
|
123
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ThemeToggle, { className: "ThemeToggle", filePath: "components/theme-toggle.component.ts", lineNumber:
|
|
123
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ThemeToggle, { className: "ThemeToggle", filePath: "components/theme-toggle.component.ts", lineNumber: 67 }); })();
|
|
124
124
|
//# sourceMappingURL=theme-toggle.component.js.map
|