@molecule/app-ui-angular 1.0.5 → 1.1.1
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 +11742 -1145
- package/dist/components/accordion.component.d.ts +114 -0
- package/dist/components/accordion.component.d.ts.map +1 -0
- package/dist/components/accordion.component.js +286 -0
- package/dist/components/accordion.component.js.map +1 -0
- package/dist/components/alert.component.d.ts +81 -37
- package/dist/components/alert.component.d.ts.map +1 -1
- package/dist/components/alert.component.js +232 -146
- package/dist/components/alert.component.js.map +1 -1
- package/dist/components/auth-guard.component.d.ts +94 -0
- package/dist/components/auth-guard.component.d.ts.map +1 -0
- package/dist/components/auth-guard.component.js +212 -0
- package/dist/components/auth-guard.component.js.map +1 -0
- package/dist/components/avatar.component.d.ts +97 -0
- package/dist/components/avatar.component.d.ts.map +1 -0
- package/dist/components/avatar.component.js +216 -0
- package/dist/components/avatar.component.js.map +1 -0
- package/dist/components/badge.component.d.ts +27 -12
- package/dist/components/badge.component.d.ts.map +1 -1
- package/dist/components/badge.component.js +47 -47
- package/dist/components/badge.component.js.map +1 -1
- package/dist/components/button.component.d.ts +96 -14
- package/dist/components/button.component.d.ts.map +1 -1
- package/dist/components/button.component.js +232 -87
- package/dist/components/button.component.js.map +1 -1
- package/dist/components/card.component.d.ts +135 -0
- package/dist/components/card.component.d.ts.map +1 -0
- package/dist/components/card.component.js +291 -0
- package/dist/components/card.component.js.map +1 -0
- package/dist/components/checkbox.component.d.ts +102 -29
- package/dist/components/checkbox.component.d.ts.map +1 -1
- package/dist/components/checkbox.component.js +222 -113
- package/dist/components/checkbox.component.js.map +1 -1
- package/dist/components/confirm-button.component.d.ts +130 -0
- package/dist/components/confirm-button.component.d.ts.map +1 -0
- package/dist/components/confirm-button.component.js +322 -0
- package/dist/components/confirm-button.component.js.map +1 -0
- package/dist/components/confirm-dialog.component.d.ts +60 -0
- package/dist/components/confirm-dialog.component.d.ts.map +1 -0
- package/dist/components/confirm-dialog.component.js +152 -0
- package/dist/components/confirm-dialog.component.js.map +1 -0
- package/dist/components/dropdown.component.d.ts +313 -0
- package/dist/components/dropdown.component.d.ts.map +1 -0
- package/dist/components/dropdown.component.js +919 -0
- package/dist/components/dropdown.component.js.map +1 -0
- package/dist/components/empty-state.component.d.ts +73 -0
- package/dist/components/empty-state.component.d.ts.map +1 -0
- package/dist/components/empty-state.component.js +180 -0
- package/dist/components/empty-state.component.js.map +1 -0
- package/dist/components/floating-input.component.d.ts +86 -0
- package/dist/components/floating-input.component.d.ts.map +1 -0
- package/dist/components/floating-input.component.js +167 -0
- package/dist/components/floating-input.component.js.map +1 -0
- package/dist/components/form-field.component.d.ts +111 -0
- package/dist/components/form-field.component.d.ts.map +1 -0
- package/dist/components/form-field.component.js +300 -0
- package/dist/components/form-field.component.js.map +1 -0
- package/dist/components/form.component.d.ts +77 -0
- package/dist/components/form.component.d.ts.map +1 -0
- package/dist/components/form.component.js +222 -0
- package/dist/components/form.component.js.map +1 -0
- package/dist/components/icon.component.d.ts +85 -0
- package/dist/components/icon.component.d.ts.map +1 -0
- package/dist/components/icon.component.js +187 -0
- package/dist/components/icon.component.js.map +1 -0
- package/dist/components/index.d.ts +49 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +49 -0
- package/dist/components/index.js.map +1 -1
- package/dist/components/input.component.d.ts +157 -54
- package/dist/components/input.component.d.ts.map +1 -1
- package/dist/components/input.component.js +437 -222
- package/dist/components/input.component.js.map +1 -1
- package/dist/components/label.component.d.ts +29 -0
- package/dist/components/label.component.d.ts.map +1 -0
- package/dist/components/label.component.js +60 -0
- package/dist/components/label.component.js.map +1 -0
- package/dist/components/language-picker.component.d.ts +124 -0
- package/dist/components/language-picker.component.d.ts.map +1 -0
- package/dist/components/language-picker.component.js +305 -0
- package/dist/components/language-picker.component.js.map +1 -0
- package/dist/components/layout.component.d.ts +167 -0
- package/dist/components/layout.component.d.ts.map +1 -0
- package/dist/components/layout.component.js +364 -0
- package/dist/components/layout.component.js.map +1 -0
- package/dist/components/load-error-banner.component.d.ts +103 -0
- package/dist/components/load-error-banner.component.d.ts.map +1 -0
- package/dist/components/load-error-banner.component.js +263 -0
- package/dist/components/load-error-banner.component.js.map +1 -0
- package/dist/components/modal.component.d.ts +125 -95
- package/dist/components/modal.component.d.ts.map +1 -1
- package/dist/components/modal.component.js +458 -271
- package/dist/components/modal.component.js.map +1 -1
- package/dist/components/molecule/alert.component.d.ts +77 -0
- package/dist/components/molecule/alert.component.d.ts.map +1 -0
- package/dist/components/molecule/alert.component.js +229 -0
- package/dist/components/molecule/alert.component.js.map +1 -0
- package/dist/components/molecule/badge.component.d.ts +27 -0
- package/dist/components/molecule/badge.component.d.ts.map +1 -0
- package/dist/components/molecule/badge.component.js +79 -0
- package/dist/components/molecule/badge.component.js.map +1 -0
- package/dist/components/molecule/button.component.d.ts +38 -0
- package/dist/components/molecule/button.component.d.ts.map +1 -0
- package/dist/components/molecule/button.component.js +137 -0
- package/dist/components/molecule/button.component.js.map +1 -0
- package/dist/components/molecule/checkbox.component.d.ts +53 -0
- package/dist/components/molecule/checkbox.component.d.ts.map +1 -0
- package/dist/components/molecule/checkbox.component.js +166 -0
- package/dist/components/molecule/checkbox.component.js.map +1 -0
- package/dist/components/molecule/index.d.ts +18 -0
- package/dist/components/molecule/index.d.ts.map +1 -0
- package/dist/components/molecule/index.js +18 -0
- package/dist/components/molecule/index.js.map +1 -0
- package/dist/components/molecule/input.component.d.ts +93 -0
- package/dist/components/molecule/input.component.d.ts.map +1 -0
- package/dist/components/molecule/input.component.js +314 -0
- package/dist/components/molecule/input.component.js.map +1 -0
- package/dist/components/molecule/modal.component.d.ts +148 -0
- package/dist/components/molecule/modal.component.d.ts.map +1 -0
- package/dist/components/molecule/modal.component.js +382 -0
- package/dist/components/molecule/modal.component.js.map +1 -0
- package/dist/components/molecule/radio-group.component.d.ts +63 -0
- package/dist/components/molecule/radio-group.component.d.ts.map +1 -0
- package/dist/components/molecule/radio-group.component.js +208 -0
- package/dist/components/molecule/radio-group.component.js.map +1 -0
- package/dist/components/molecule/select.component.d.ts +72 -0
- package/dist/components/molecule/select.component.d.ts.map +1 -0
- package/dist/components/molecule/select.component.js +274 -0
- package/dist/components/molecule/select.component.js.map +1 -0
- package/dist/components/molecule/spinner.component.d.ts +42 -0
- package/dist/components/molecule/spinner.component.d.ts.map +1 -0
- package/dist/components/molecule/spinner.component.js +122 -0
- package/dist/components/molecule/spinner.component.js.map +1 -0
- package/dist/components/molecule/switch.component.d.ts +54 -0
- package/dist/components/molecule/switch.component.d.ts.map +1 -0
- package/dist/components/molecule/switch.component.js +148 -0
- package/dist/components/molecule/switch.component.js.map +1 -0
- package/dist/components/molecule/toast.component.d.ts +98 -0
- package/dist/components/molecule/toast.component.d.ts.map +1 -0
- package/dist/components/molecule/toast.component.js +305 -0
- package/dist/components/molecule/toast.component.js.map +1 -0
- package/dist/components/molecule/tooltip.component.d.ts +77 -0
- package/dist/components/molecule/tooltip.component.d.ts.map +1 -0
- package/dist/components/molecule/tooltip.component.js +316 -0
- package/dist/components/molecule/tooltip.component.js.map +1 -0
- package/dist/components/optimistic-toggle-button.component.d.ts +125 -0
- package/dist/components/optimistic-toggle-button.component.d.ts.map +1 -0
- package/dist/components/optimistic-toggle-button.component.js +296 -0
- package/dist/components/optimistic-toggle-button.component.js.map +1 -0
- package/dist/components/page-header.component.d.ts +77 -0
- package/dist/components/page-header.component.d.ts.map +1 -0
- package/dist/components/page-header.component.js +225 -0
- package/dist/components/page-header.component.js.map +1 -0
- package/dist/components/page-shell.component.d.ts +101 -0
- package/dist/components/page-shell.component.d.ts.map +1 -0
- package/dist/components/page-shell.component.js +221 -0
- package/dist/components/page-shell.component.js.map +1 -0
- package/dist/components/pagination.component.d.ts +137 -0
- package/dist/components/pagination.component.d.ts.map +1 -0
- package/dist/components/pagination.component.js +419 -0
- package/dist/components/pagination.component.js.map +1 -0
- package/dist/components/panel-close.component.d.ts +43 -0
- package/dist/components/panel-close.component.d.ts.map +1 -0
- package/dist/components/panel-close.component.js +75 -0
- package/dist/components/panel-close.component.js.map +1 -0
- package/dist/components/progress.component.d.ts +84 -0
- package/dist/components/progress.component.d.ts.map +1 -0
- package/dist/components/progress.component.js +219 -0
- package/dist/components/progress.component.js.map +1 -0
- package/dist/components/prompt-dialog.component.d.ts +121 -0
- package/dist/components/prompt-dialog.component.d.ts.map +1 -0
- package/dist/components/prompt-dialog.component.js +332 -0
- package/dist/components/prompt-dialog.component.js.map +1 -0
- package/dist/components/radio-group.component.d.ts +66 -34
- package/dist/components/radio-group.component.d.ts.map +1 -1
- package/dist/components/radio-group.component.js +146 -125
- package/dist/components/radio-group.component.js.map +1 -1
- package/dist/components/responsive-app-shell.component.d.ts +408 -0
- package/dist/components/responsive-app-shell.component.d.ts.map +1 -0
- package/dist/components/responsive-app-shell.component.js +1144 -0
- package/dist/components/responsive-app-shell.component.js.map +1 -0
- package/dist/components/select.component.d.ts +135 -38
- package/dist/components/select.component.d.ts.map +1 -1
- package/dist/components/select.component.js +373 -181
- package/dist/components/select.component.js.map +1 -1
- package/dist/components/separator.component.d.ts +39 -0
- package/dist/components/separator.component.d.ts.map +1 -0
- package/dist/components/separator.component.js +73 -0
- package/dist/components/separator.component.js.map +1 -0
- package/dist/components/sidebar-user-card.component.d.ts +106 -0
- package/dist/components/sidebar-user-card.component.d.ts.map +1 -0
- package/dist/components/sidebar-user-card.component.js +277 -0
- package/dist/components/sidebar-user-card.component.js.map +1 -0
- package/dist/components/skeleton.component.d.ts +100 -0
- package/dist/components/skeleton.component.d.ts.map +1 -0
- package/dist/components/skeleton.component.js +214 -0
- package/dist/components/skeleton.component.js.map +1 -0
- package/dist/components/spinner.component.d.ts +36 -19
- package/dist/components/spinner.component.d.ts.map +1 -1
- package/dist/components/spinner.component.js +69 -71
- package/dist/components/spinner.component.js.map +1 -1
- package/dist/components/switch.component.d.ts +72 -29
- package/dist/components/switch.component.d.ts.map +1 -1
- package/dist/components/switch.component.js +163 -91
- package/dist/components/switch.component.js.map +1 -1
- package/dist/components/table.component.d.ts +193 -0
- package/dist/components/table.component.d.ts.map +1 -0
- package/dist/components/table.component.js +550 -0
- package/dist/components/table.component.js.map +1 -0
- package/dist/components/tabs.component.d.ts +140 -0
- package/dist/components/tabs.component.d.ts.map +1 -0
- package/dist/components/tabs.component.js +390 -0
- package/dist/components/tabs.component.js.map +1 -0
- package/dist/components/template-outlet.directive.d.ts +50 -0
- package/dist/components/template-outlet.directive.d.ts.map +1 -0
- package/dist/components/template-outlet.directive.js +81 -0
- package/dist/components/template-outlet.directive.js.map +1 -0
- package/dist/components/textarea.component.d.ts +151 -0
- package/dist/components/textarea.component.d.ts.map +1 -0
- package/dist/components/textarea.component.js +340 -0
- package/dist/components/textarea.component.js.map +1 -0
- package/dist/components/theme-toggle.component.d.ts +58 -0
- package/dist/components/theme-toggle.component.d.ts.map +1 -0
- package/dist/components/theme-toggle.component.js +124 -0
- package/dist/components/theme-toggle.component.js.map +1 -0
- package/dist/components/toast.component.d.ts +237 -49
- package/dist/components/toast.component.d.ts.map +1 -1
- package/dist/components/toast.component.js +636 -201
- package/dist/components/toast.component.js.map +1 -1
- package/dist/components/tooltip.component.d.ts +95 -45
- package/dist/components/tooltip.component.d.ts.map +1 -1
- package/dist/components/tooltip.component.js +372 -221
- package/dist/components/tooltip.component.js.map +1 -1
- package/dist/components/user-menu-popover.component.d.ts +283 -0
- package/dist/components/user-menu-popover.component.d.ts.map +1 -0
- package/dist/components/user-menu-popover.component.js +646 -0
- package/dist/components/user-menu-popover.component.js.map +1 -0
- package/dist/components/user-menu.component.d.ts +95 -0
- package/dist/components/user-menu.component.d.ts.map +1 -0
- package/dist/components/user-menu.component.js +218 -0
- package/dist/components/user-menu.component.js.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +7 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/use-is-desktop.d.ts +22 -0
- package/dist/hooks/use-is-desktop.d.ts.map +1 -0
- package/dist/hooks/use-is-desktop.js +37 -0
- package/dist/hooks/use-is-desktop.js.map +1 -0
- package/dist/index.d.ts +32 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -17
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utilities/dom-context.d.ts +42 -0
- package/dist/utilities/dom-context.d.ts.map +1 -0
- package/dist/utilities/dom-context.js +66 -0
- package/dist/utilities/dom-context.js.map +1 -0
- package/dist/utilities/focus.d.ts +32 -0
- package/dist/utilities/focus.d.ts.map +1 -0
- package/dist/utilities/focus.js +47 -0
- package/dist/utilities/focus.js.map +1 -0
- package/dist/utilities/form-field-context.d.ts +34 -0
- package/dist/utilities/form-field-context.d.ts.map +1 -0
- package/dist/utilities/form-field-context.js +28 -0
- package/dist/utilities/form-field-context.js.map +1 -0
- package/dist/utilities/form-submit-error.d.ts +17 -0
- package/dist/utilities/form-submit-error.d.ts.map +1 -0
- package/dist/utilities/form-submit-error.js +42 -0
- package/dist/utilities/form-submit-error.js.map +1 -0
- package/dist/utilities/icon-markup.d.ts +17 -0
- package/dist/utilities/icon-markup.d.ts.map +1 -0
- package/dist/utilities/icon-markup.js +46 -0
- package/dist/utilities/icon-markup.js.map +1 -0
- package/dist/utilities/ids.d.ts +15 -0
- package/dist/utilities/ids.d.ts.map +1 -0
- package/dist/utilities/ids.js +19 -0
- package/dist/utilities/ids.js.map +1 -0
- package/dist/utilities/index.d.ts +11 -0
- package/dist/utilities/index.d.ts.map +1 -1
- package/dist/utilities/index.js +11 -0
- package/dist/utilities/index.js.map +1 -1
- package/dist/utilities/initials.d.ts +13 -0
- package/dist/utilities/initials.d.ts.map +1 -0
- package/dist/utilities/initials.js +23 -0
- package/dist/utilities/initials.js.map +1 -0
- package/dist/utilities/node-value.d.ts +31 -0
- package/dist/utilities/node-value.d.ts.map +1 -0
- package/dist/utilities/node-value.js +37 -0
- package/dist/utilities/node-value.js.map +1 -0
- package/dist/utilities/optimistic-value.d.ts +81 -0
- package/dist/utilities/optimistic-value.d.ts.map +1 -0
- package/dist/utilities/optimistic-value.js +154 -0
- package/dist/utilities/optimistic-value.js.map +1 -0
- package/dist/utilities/render-icon.d.ts +77 -7
- package/dist/utilities/render-icon.d.ts.map +1 -1
- package/dist/utilities/render-icon.js +123 -33
- package/dist/utilities/render-icon.js.map +1 -1
- package/dist/utilities/rest-attrs.d.ts +21 -0
- package/dist/utilities/rest-attrs.d.ts.map +1 -0
- package/dist/utilities/rest-attrs.js +37 -0
- package/dist/utilities/rest-attrs.js.map +1 -0
- package/dist/utilities/style.d.ts +23 -0
- package/dist/utilities/style.d.ts.map +1 -0
- package/dist/utilities/style.js +86 -0
- package/dist/utilities/style.js.map +1 -0
- package/package.json +10 -5
|
@@ -1,307 +1,522 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Input component (React parity).
|
|
3
3
|
*
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
7
|
+
import { Component, ElementRef, EventEmitter, inject, Output, Renderer2, TemplateRef, ViewChild, } from '@angular/core';
|
|
8
|
+
import { useTranslation } from '@molecule/app-angular';
|
|
8
9
|
import { getClassMap } from '@molecule/app-ui';
|
|
9
|
-
import {
|
|
10
|
+
import { fieldContext } from '../utilities/form-field-context.js';
|
|
11
|
+
import { MolIconSvg, resolveIcon } from '../utilities/render-icon.js';
|
|
12
|
+
import { moveRestAttributes } from '../utilities/rest-attrs.js';
|
|
13
|
+
import { styleText } from '../utilities/style.js';
|
|
14
|
+
import { hasNodes, SlotWrapper } from './button.component.js';
|
|
10
15
|
import * as i0 from "@angular/core";
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
const _c0 = ["inputEl"];
|
|
17
|
+
const _c1 = ["leftSlot"];
|
|
18
|
+
const _c2 = ["rightSlot"];
|
|
19
|
+
const _c3 = ["rightInner"];
|
|
20
|
+
const _c4 = [[["", "slot", "leftelement"]], [["", "slot", "rightelement"]]];
|
|
21
|
+
const _c5 = ["[slot=leftElement]", "[slot=rightElement]"];
|
|
22
|
+
const _c6 = a0 => ({ required: a0 });
|
|
23
|
+
function Input_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
24
|
+
i0.ɵɵelementStart(0, "label");
|
|
13
25
|
i0.ɵɵtext(1);
|
|
14
|
-
i0.ɵɵ
|
|
26
|
+
i0.ɵɵelementEnd();
|
|
15
27
|
} if (rf & 2) {
|
|
16
28
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
17
|
-
i0.ɵɵclassMap(ctx_r0.
|
|
18
|
-
i0.ɵɵattribute("for", ctx_r0.inputId);
|
|
29
|
+
i0.ɵɵclassMap(ctx_r0.cm().cn(ctx_r0.cm().label(i0.ɵɵpureFunction1(4, _c6, !!ctx_r0.required)), ctx_r0.cm().labelBlock));
|
|
30
|
+
i0.ɵɵattribute("for", ctx_r0.inputId());
|
|
19
31
|
i0.ɵɵadvance();
|
|
20
|
-
i0.ɵɵ
|
|
32
|
+
i0.ɵɵtextInterpolate(ctx_r0.label);
|
|
21
33
|
} }
|
|
22
|
-
function
|
|
34
|
+
function Input_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
35
|
+
i0.ɵɵelementContainer(0, 5);
|
|
36
|
+
} if (rf & 2) {
|
|
37
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx);
|
|
38
|
+
} }
|
|
39
|
+
function Input_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
40
|
+
i0.ɵɵtext(0);
|
|
41
|
+
} if (rf & 2) {
|
|
42
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
43
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.asText(ctx_r0.leftElement), " ");
|
|
44
|
+
} }
|
|
45
|
+
function Input_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
23
46
|
const _r2 = i0.ɵɵgetCurrentView();
|
|
24
|
-
i0.ɵɵ
|
|
25
|
-
i0.ɵɵ
|
|
26
|
-
i0.ɵɵ
|
|
27
|
-
i0.ɵɵ
|
|
47
|
+
i0.ɵɵelementStart(0, "button", 8);
|
|
48
|
+
i0.ɵɵlistener("click", function Input_Conditional_11_Template_button_click_0_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.clear.emit($event)); });
|
|
49
|
+
i0.ɵɵnamespaceSVG();
|
|
50
|
+
i0.ɵɵelement(1, "svg", 9);
|
|
51
|
+
i0.ɵɵelementEnd();
|
|
28
52
|
} if (rf & 2) {
|
|
29
53
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
30
|
-
i0.ɵɵclassMap(ctx_r0.cm.inputClearButton);
|
|
31
|
-
i0.ɵɵ
|
|
32
|
-
i0.ɵɵclassMap(ctx_r0.cm.inputClearButton);
|
|
33
|
-
i0.ɵɵattribute("aria-label", ctx_r0.clearAriaLabel);
|
|
54
|
+
i0.ɵɵclassMap(ctx_r0.cm().inputClearButton);
|
|
55
|
+
i0.ɵɵattribute("aria-label", ctx_r0.clearText());
|
|
34
56
|
i0.ɵɵadvance();
|
|
35
|
-
i0.ɵɵ
|
|
57
|
+
i0.ɵɵproperty("data", ctx_r0.clearIcon());
|
|
58
|
+
} }
|
|
59
|
+
function Input_Conditional_15_Template(rf, ctx) { if (rf & 1) {
|
|
60
|
+
i0.ɵɵelementContainer(0, 5);
|
|
61
|
+
} if (rf & 2) {
|
|
62
|
+
i0.ɵɵproperty("ngTemplateOutlet", ctx);
|
|
63
|
+
} }
|
|
64
|
+
function Input_Conditional_16_Template(rf, ctx) { if (rf & 1) {
|
|
65
|
+
i0.ɵɵtext(0);
|
|
66
|
+
} if (rf & 2) {
|
|
67
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
68
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.asText(ctx_r0.rightElement), " ");
|
|
36
69
|
} }
|
|
37
|
-
function
|
|
38
|
-
i0.ɵɵ
|
|
70
|
+
function Input_Conditional_17_Template(rf, ctx) { if (rf & 1) {
|
|
71
|
+
i0.ɵɵelementStart(0, "p");
|
|
39
72
|
i0.ɵɵtext(1);
|
|
40
|
-
i0.ɵɵ
|
|
73
|
+
i0.ɵɵelementEnd();
|
|
41
74
|
} if (rf & 2) {
|
|
42
75
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
43
|
-
i0.ɵɵclassMap(ctx_r0.
|
|
44
|
-
i0.ɵɵ
|
|
76
|
+
i0.ɵɵclassMap(ctx_r0.cm().formError);
|
|
77
|
+
i0.ɵɵattribute("id", ctx_r0.inputId() + "-error");
|
|
45
78
|
i0.ɵɵadvance();
|
|
46
|
-
i0.ɵɵ
|
|
79
|
+
i0.ɵɵtextInterpolate(ctx_r0.error);
|
|
47
80
|
} }
|
|
48
|
-
function
|
|
49
|
-
i0.ɵɵ
|
|
81
|
+
function Input_Conditional_18_Template(rf, ctx) { if (rf & 1) {
|
|
82
|
+
i0.ɵɵelementStart(0, "p");
|
|
50
83
|
i0.ɵɵtext(1);
|
|
51
|
-
i0.ɵɵ
|
|
84
|
+
i0.ɵɵelementEnd();
|
|
52
85
|
} if (rf & 2) {
|
|
53
86
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
54
|
-
i0.ɵɵclassMap(ctx_r0.
|
|
55
|
-
i0.ɵɵ
|
|
87
|
+
i0.ɵɵclassMap(ctx_r0.cm().formHint);
|
|
88
|
+
i0.ɵɵattribute("id", ctx_r0.inputId() + "-hint");
|
|
56
89
|
i0.ɵɵadvance();
|
|
57
|
-
i0.ɵɵ
|
|
90
|
+
i0.ɵɵtextInterpolate(ctx_r0.hint);
|
|
58
91
|
} }
|
|
59
92
|
/**
|
|
60
|
-
*
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
*
|
|
93
|
+
* Input component.
|
|
94
|
+
*
|
|
95
|
+
* The host is the `div.inputWrapper` React renders. React's text-input
|
|
96
|
+
* `onChange` fires on `input` events; a controlled `value` is restored after
|
|
97
|
+
* user input exactly like React's controlled-input state restore.
|
|
98
|
+
*
|
|
99
|
+
* The adornment wrappers React renders conditionally
|
|
100
|
+
* (`{!!leftElement && <div …>}` / `{(rightElement || (clearable && value)) && …}`)
|
|
101
|
+
* are always-mounted `<ng-content>` capture points that are detached from the
|
|
102
|
+
* DOM whenever React would render nothing (see {@link SlotWrapper}).
|
|
64
103
|
*/
|
|
65
|
-
export class
|
|
66
|
-
type
|
|
67
|
-
|
|
104
|
+
export class Input {
|
|
105
|
+
/** Input type. */
|
|
106
|
+
type;
|
|
107
|
+
/** Input size. */
|
|
108
|
+
size;
|
|
109
|
+
/** Text alignment. */
|
|
110
|
+
align;
|
|
111
|
+
/** Field label. */
|
|
68
112
|
label;
|
|
113
|
+
/** Error message (associates via aria-describedby). */
|
|
69
114
|
error;
|
|
115
|
+
/** Hint text (shown without an error). */
|
|
70
116
|
hint;
|
|
71
|
-
|
|
117
|
+
/** Left adornment (a TemplateRef input, or projected `[slot=leftElement]`). */
|
|
118
|
+
leftElement;
|
|
119
|
+
/** Right adornment (a TemplateRef input, or projected `[slot=rightElement]`). */
|
|
120
|
+
rightElement;
|
|
121
|
+
/** Whether the clear button may render while a value exists. */
|
|
122
|
+
clearable;
|
|
123
|
+
/** Accessible label of the clear button. */
|
|
72
124
|
clearLabel;
|
|
125
|
+
/** Extra classes joined onto the input classes. */
|
|
73
126
|
className;
|
|
127
|
+
/** Inline style object (React camelCase). */
|
|
74
128
|
style;
|
|
129
|
+
/** `data-testid` for the input. */
|
|
75
130
|
testId;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
131
|
+
/** Disables the input. */
|
|
132
|
+
disabled;
|
|
133
|
+
/** Marks the input required (label styling). */
|
|
134
|
+
required;
|
|
135
|
+
/** Controlled value. */
|
|
79
136
|
value;
|
|
137
|
+
/** Uncontrolled initial value. */
|
|
138
|
+
defaultValue;
|
|
139
|
+
/** Placeholder text. */
|
|
80
140
|
placeholder;
|
|
141
|
+
/** Form field name. */
|
|
81
142
|
name;
|
|
143
|
+
/** Explicit input id. */
|
|
82
144
|
id;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
145
|
+
/** Fires the raw `input` event (React's text-input onChange). */
|
|
146
|
+
change = new EventEmitter();
|
|
147
|
+
/** Fires the clear button's click event. */
|
|
148
|
+
clear = new EventEmitter();
|
|
149
|
+
/** The native input (React's `...rest` spread target). */
|
|
150
|
+
inputEl;
|
|
151
|
+
/** The left adornment wrapper. */
|
|
152
|
+
leftSlot;
|
|
153
|
+
/** The right adornment wrapper. */
|
|
154
|
+
rightSlot;
|
|
155
|
+
/** The right adornment inner span (React's ternary else branch). */
|
|
156
|
+
rightInner;
|
|
157
|
+
host = inject(ElementRef);
|
|
158
|
+
/**
|
|
159
|
+
* Reactive translation, read in the injection context. Its `t` reads the
|
|
160
|
+
* locale, so the view re-renders the text on a locale switch (the static `t`
|
|
161
|
+
* does not).
|
|
162
|
+
*/
|
|
163
|
+
i18n = useTranslation();
|
|
164
|
+
sync = new SlotWrapper(inject(ElementRef), inject(Renderer2));
|
|
165
|
+
parents = new Map();
|
|
166
|
+
hasLeft = false;
|
|
167
|
+
hasRight = false;
|
|
168
|
+
movedRest = false;
|
|
169
|
+
/** The `aria-describedby` the caller spread onto the host (React's rest). */
|
|
170
|
+
restDescribedBy = null;
|
|
92
171
|
/**
|
|
93
|
-
*
|
|
94
|
-
* @returns The UIClassMap
|
|
172
|
+
* The current class map.
|
|
173
|
+
* @returns The UIClassMap.
|
|
95
174
|
*/
|
|
96
|
-
|
|
175
|
+
cm() {
|
|
97
176
|
return getClassMap();
|
|
98
177
|
}
|
|
99
178
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
179
|
+
* The input id (`id`, `name`, or a stable generated id; the DOM normalizer
|
|
180
|
+
* renumbers generated ids in order of appearance, like React's `useId`).
|
|
181
|
+
* @returns The id value.
|
|
102
182
|
*/
|
|
103
|
-
|
|
104
|
-
return this.
|
|
183
|
+
inputId() {
|
|
184
|
+
return this.id || this.fieldContext()?.id || this.name || 'r0';
|
|
105
185
|
}
|
|
106
186
|
/**
|
|
107
|
-
*
|
|
108
|
-
* @returns The
|
|
187
|
+
* The aria-describedby target (error or hint paragraph).
|
|
188
|
+
* @returns The id or null.
|
|
109
189
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
190
|
+
describedBy() {
|
|
191
|
+
if (this.error)
|
|
192
|
+
return `${this.inputId()}-error`;
|
|
193
|
+
if (this.hint)
|
|
194
|
+
return `${this.inputId()}-hint`;
|
|
195
|
+
return null;
|
|
112
196
|
}
|
|
113
197
|
/**
|
|
114
|
-
*
|
|
115
|
-
* @returns The
|
|
198
|
+
* The nearest enclosing `FormField` context (React's cloned props).
|
|
199
|
+
* @returns The context, or null.
|
|
116
200
|
*/
|
|
117
|
-
|
|
118
|
-
return this.
|
|
201
|
+
fieldContext() {
|
|
202
|
+
return fieldContext(this.host.nativeElement);
|
|
119
203
|
}
|
|
120
204
|
/**
|
|
121
|
-
*
|
|
122
|
-
*
|
|
205
|
+
* The final `aria-describedby`: a rest-provided value first, then the
|
|
206
|
+
* enclosing FormField's error/hint target (React's cloneElement join).
|
|
207
|
+
* @returns The attribute value, or null.
|
|
123
208
|
*/
|
|
124
|
-
|
|
125
|
-
|
|
209
|
+
mergedDescribedBy() {
|
|
210
|
+
const target = this.fieldContext()?.describedBy;
|
|
211
|
+
if (target)
|
|
212
|
+
return [this.restDescribedBy, target].filter(Boolean).join(' ');
|
|
213
|
+
return this.restDescribedBy ?? this.describedBy();
|
|
126
214
|
}
|
|
127
215
|
/**
|
|
128
|
-
* Computes the
|
|
129
|
-
* @returns The
|
|
216
|
+
* Computes the input class list.
|
|
217
|
+
* @returns The class string.
|
|
130
218
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
219
|
+
classes() {
|
|
220
|
+
return this.cm().cn(this.cm().input({
|
|
221
|
+
error: !!this.error,
|
|
222
|
+
size: this.size ?? 'md',
|
|
223
|
+
align: this.align === 'right' ? undefined : this.align,
|
|
224
|
+
}), this.hasLeft && this.cm().inputPadLeft, (this.hasRight || this.clearable) && this.cm().inputPadRight, this.className);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* The clear button's accessible label.
|
|
228
|
+
* @returns The label text.
|
|
229
|
+
*/
|
|
230
|
+
clearText() {
|
|
231
|
+
return this.clearLabel ?? this.i18n.t('ui.input.clear', undefined, { defaultValue: 'Clear' });
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* The clear button's X glyph.
|
|
235
|
+
* @returns The resolved icon.
|
|
236
|
+
*/
|
|
237
|
+
clearIcon() {
|
|
238
|
+
return resolveIcon('x-mark', this.cm().iconSm);
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Serializes the inline style for the input.
|
|
242
|
+
* @returns The style attribute text.
|
|
243
|
+
*/
|
|
244
|
+
hostStyle() {
|
|
245
|
+
return styleText(this.style);
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* React's text-input onChange: the `input` event, with the controlled value
|
|
249
|
+
* restored afterwards.
|
|
250
|
+
*
|
|
251
|
+
* @param event - The native input event.
|
|
252
|
+
*/
|
|
253
|
+
handleInput(event) {
|
|
254
|
+
event.stopPropagation();
|
|
255
|
+
this.change.emit(event);
|
|
256
|
+
const input = this.inputEl?.nativeElement;
|
|
257
|
+
if (this.value !== undefined && input && input.value !== String(this.value))
|
|
258
|
+
input.value = String(this.value);
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* The native change event never reaches the host (its `change` output
|
|
262
|
+
* binding would record it a second time; React's onChange already fired on
|
|
263
|
+
* the input event).
|
|
264
|
+
*
|
|
265
|
+
* @param event - The native change event.
|
|
266
|
+
*/
|
|
267
|
+
handleChange(event) {
|
|
268
|
+
event.stopPropagation();
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Reconciles the adornment wrappers every check: detects projected slot
|
|
272
|
+
* content (view queries resolve only at view init, so the very first pass —
|
|
273
|
+
* which runs before the view's bindings — falls back to structural sibling
|
|
274
|
+
* lookup), then attaches/detaches each wrapper exactly when React renders
|
|
275
|
+
* it. The input's class list depends on this detection, and `ngDoCheck`
|
|
276
|
+
* runs before the template bindings of the same pass, so the first render
|
|
277
|
+
* already carries the right padding classes.
|
|
278
|
+
*/
|
|
279
|
+
ngDoCheck() {
|
|
280
|
+
const host = this.host.nativeElement;
|
|
281
|
+
const input = this.inputEl?.nativeElement ?? host.querySelector('input');
|
|
282
|
+
const left = this.leftSlot?.nativeElement ??
|
|
283
|
+
input?.previousElementSibling ??
|
|
284
|
+
undefined;
|
|
285
|
+
const right = this.rightSlot?.nativeElement ??
|
|
286
|
+
input?.nextElementSibling ??
|
|
287
|
+
undefined;
|
|
288
|
+
const inner = this.rightInner?.nativeElement ??
|
|
289
|
+
(right ? right.querySelector('span') : null) ??
|
|
290
|
+
undefined;
|
|
291
|
+
this.hasLeft = this.isGiven(this.leftElement) || hasNodes(left);
|
|
292
|
+
this.hasRight = this.isGiven(this.rightElement) || hasNodes(inner);
|
|
293
|
+
const clear = !!(this.clearable && this.value);
|
|
294
|
+
this.sync.sync(left, this.hasLeft, this.parentOf(left));
|
|
295
|
+
this.sync.sync(inner, this.hasRight && !clear, this.parentOf(inner));
|
|
296
|
+
this.sync.sync(right, this.hasRight || clear, this.parentOf(right));
|
|
297
|
+
if (!this.movedRest && input) {
|
|
298
|
+
this.restDescribedBy = host.getAttribute('aria-describedby');
|
|
299
|
+
moveRestAttributes(host, input);
|
|
300
|
+
this.movedRest = true;
|
|
301
|
+
}
|
|
302
|
+
// React's controlled input: the live value always follows the `value` prop
|
|
303
|
+
// after a re-render (the binding sets the attribute; the property is only
|
|
304
|
+
// moved by the browser on an uncontrolled edit).
|
|
305
|
+
if (this.value !== undefined && input && input.value !== String(this.value))
|
|
306
|
+
input.value = String(this.value);
|
|
137
307
|
}
|
|
138
308
|
/**
|
|
139
|
-
*
|
|
140
|
-
*
|
|
309
|
+
* Remembers where an element lives while connected, so a re-attach after a
|
|
310
|
+
* detach lands in the original parent (never the component host).
|
|
311
|
+
*
|
|
312
|
+
* @param el - The wrapper element.
|
|
313
|
+
* @returns The original parent, if known.
|
|
141
314
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
315
|
+
parentOf(el) {
|
|
316
|
+
if (!el)
|
|
317
|
+
return undefined;
|
|
318
|
+
const cached = this.parents.get(el);
|
|
319
|
+
if (cached)
|
|
320
|
+
return cached;
|
|
321
|
+
if (el.parentElement) {
|
|
322
|
+
this.parents.set(el, el.parentElement);
|
|
323
|
+
return el.parentElement;
|
|
324
|
+
}
|
|
325
|
+
return undefined;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Casts a node-valued input to its TemplateRef form (the adapter projects
|
|
329
|
+
* node props as templates).
|
|
330
|
+
*
|
|
331
|
+
* @param value - The prop value.
|
|
332
|
+
* @returns The TemplateRef, or null.
|
|
333
|
+
*/
|
|
334
|
+
asTemplate(value) {
|
|
335
|
+
return value instanceof TemplateRef ? value : null;
|
|
144
336
|
}
|
|
145
337
|
/**
|
|
146
|
-
*
|
|
147
|
-
*
|
|
338
|
+
* Renders a plain-string node value (React renders strings as text).
|
|
339
|
+
*
|
|
340
|
+
* @param value - The prop value.
|
|
341
|
+
* @returns The text, or empty.
|
|
148
342
|
*/
|
|
149
|
-
|
|
150
|
-
return
|
|
343
|
+
asText(value) {
|
|
344
|
+
return typeof value === 'string' ? value : '';
|
|
151
345
|
}
|
|
152
346
|
/**
|
|
153
|
-
*
|
|
154
|
-
*
|
|
347
|
+
* Whether a node prop was passed (a TemplateRef or any non-null value).
|
|
348
|
+
*
|
|
349
|
+
* @param value - The prop value.
|
|
350
|
+
* @returns True when given.
|
|
155
351
|
*/
|
|
156
|
-
|
|
157
|
-
return
|
|
352
|
+
isGiven(value) {
|
|
353
|
+
return value !== undefined && value !== null;
|
|
158
354
|
}
|
|
159
|
-
static ɵfac = function
|
|
160
|
-
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type:
|
|
161
|
-
i0.ɵɵ
|
|
162
|
-
i0.ɵɵconditionalCreate(1, MoleculeInput_Conditional_1_Template, 2, 4, "label", 0);
|
|
163
|
-
i0.ɵɵdomElementStart(2, "div")(3, "input", 1);
|
|
164
|
-
i0.ɵɵdomListener("input", function MoleculeInput_Template_input_input_3_listener($event) { return ctx.handleInput.emit($event); })("change", function MoleculeInput_Template_input_change_3_listener($event) { return ctx.handleChange.emit($event); })("focus", function MoleculeInput_Template_input_focus_3_listener($event) { return ctx.handleFocus.emit($event); })("blur", function MoleculeInput_Template_input_blur_3_listener($event) { return ctx.handleBlur.emit($event); });
|
|
165
|
-
i0.ɵɵdomElementEnd();
|
|
166
|
-
i0.ɵɵconditionalCreate(4, MoleculeInput_Conditional_4_Template, 3, 6, "div", 0);
|
|
167
|
-
i0.ɵɵdomElementEnd();
|
|
168
|
-
i0.ɵɵconditionalCreate(5, MoleculeInput_Conditional_5_Template, 2, 4, "p", 2);
|
|
169
|
-
i0.ɵɵconditionalCreate(6, MoleculeInput_Conditional_6_Template, 2, 4, "p", 2);
|
|
170
|
-
i0.ɵɵdomElementEnd();
|
|
355
|
+
static ɵfac = function Input_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || Input)(); };
|
|
356
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: Input, selectors: [["div", "mol-input", ""]], viewQuery: function Input_Query(rf, ctx) { if (rf & 1) {
|
|
357
|
+
i0.ɵɵviewQuery(_c0, 5)(_c1, 5)(_c2, 5)(_c3, 5);
|
|
171
358
|
} if (rf & 2) {
|
|
172
|
-
|
|
173
|
-
i0.ɵɵ
|
|
174
|
-
i0.ɵɵ
|
|
175
|
-
i0.ɵɵ
|
|
176
|
-
i0.ɵɵ
|
|
359
|
+
let _t;
|
|
360
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.inputEl = _t.first);
|
|
361
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.leftSlot = _t.first);
|
|
362
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.rightSlot = _t.first);
|
|
363
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.rightInner = _t.first);
|
|
364
|
+
} }, hostVars: 2, hostBindings: function Input_HostBindings(rf, ctx) { if (rf & 2) {
|
|
365
|
+
i0.ɵɵclassMap(ctx.cm().inputWrapper);
|
|
366
|
+
} }, inputs: { type: "type", size: "size", align: "align", label: "label", error: "error", hint: "hint", leftElement: "leftElement", rightElement: "rightElement", clearable: "clearable", clearLabel: "clearLabel", className: "className", style: "style", testId: "testId", disabled: "disabled", required: "required", value: "value", defaultValue: "defaultValue", placeholder: "placeholder", name: "name", id: "id" }, outputs: { change: "change", clear: "clear" }, ngContentSelectors: _c5, decls: 19, vars: 27, consts: [["leftSlot", ""], ["inputEl", ""], ["rightSlot", ""], ["rightInner", ""], [3, "class"], [3, "ngTemplateOutlet"], [3, "input", "change", "disabled"], ["type", "button", 3, "class"], ["type", "button", 3, "click"], ["mol-icon", "", 3, "data"]], template: function Input_Template(rf, ctx) { if (rf & 1) {
|
|
367
|
+
i0.ɵɵprojectionDef(_c4);
|
|
368
|
+
i0.ɵɵconditionalCreate(0, Input_Conditional_0_Template, 2, 6, "label", 4);
|
|
369
|
+
i0.ɵɵelementStart(1, "div")(2, "div", null, 0);
|
|
370
|
+
i0.ɵɵprojection(4);
|
|
371
|
+
i0.ɵɵconditionalCreate(5, Input_Conditional_5_Template, 1, 1, "ng-container", 5)(6, Input_Conditional_6_Template, 1, 1);
|
|
372
|
+
i0.ɵɵelementEnd();
|
|
373
|
+
i0.ɵɵelementStart(7, "input", 6, 1);
|
|
374
|
+
i0.ɵɵlistener("input", function Input_Template_input_input_7_listener($event) { return ctx.handleInput($event); })("change", function Input_Template_input_change_7_listener($event) { return ctx.handleChange($event); });
|
|
375
|
+
i0.ɵɵelementEnd();
|
|
376
|
+
i0.ɵɵelementStart(9, "div", null, 2);
|
|
377
|
+
i0.ɵɵconditionalCreate(11, Input_Conditional_11_Template, 2, 4, "button", 7);
|
|
378
|
+
i0.ɵɵelementStart(12, "span", null, 3);
|
|
379
|
+
i0.ɵɵprojection(14, 1);
|
|
380
|
+
i0.ɵɵconditionalCreate(15, Input_Conditional_15_Template, 1, 1, "ng-container", 5)(16, Input_Conditional_16_Template, 1, 1);
|
|
381
|
+
i0.ɵɵelementEnd()()();
|
|
382
|
+
i0.ɵɵconditionalCreate(17, Input_Conditional_17_Template, 2, 4, "p", 4);
|
|
383
|
+
i0.ɵɵconditionalCreate(18, Input_Conditional_18_Template, 2, 4, "p", 4);
|
|
384
|
+
} if (rf & 2) {
|
|
385
|
+
let tmp_7_0;
|
|
386
|
+
let tmp_23_0;
|
|
387
|
+
i0.ɵɵconditional(ctx.label ? 0 : -1);
|
|
177
388
|
i0.ɵɵadvance();
|
|
178
|
-
i0.ɵɵ
|
|
179
|
-
i0.ɵɵclassMap(ctx.inputClasses);
|
|
180
|
-
i0.ɵɵdomProperty("type", ctx.type)("id", ctx.inputId)("name", ctx.name)("value", ctx.value)("placeholder", ctx.placeholder)("disabled", ctx.disabled)("required", ctx.required)("readOnly", ctx.readOnly);
|
|
181
|
-
i0.ɵɵattribute("aria-invalid", !!ctx.error)("aria-describedby", ctx.ariaDescribedBy)("data-testid", ctx.testId)("maxlength", ctx.maxLength)("minlength", ctx.minLength)("pattern", ctx.pattern)("autocomplete", ctx.autoComplete);
|
|
389
|
+
i0.ɵɵclassMap(ctx.cm().inputInner);
|
|
182
390
|
i0.ɵɵadvance();
|
|
183
|
-
i0.ɵɵ
|
|
391
|
+
i0.ɵɵclassMap(ctx.cm().inputLeftElement);
|
|
392
|
+
i0.ɵɵadvance(3);
|
|
393
|
+
i0.ɵɵconditional((tmp_7_0 = ctx.asTemplate(ctx.leftElement)) ? 5 : 6, tmp_7_0);
|
|
394
|
+
i0.ɵɵadvance(2);
|
|
395
|
+
i0.ɵɵclassMap(ctx.classes());
|
|
396
|
+
i0.ɵɵproperty("disabled", ctx.disabled);
|
|
397
|
+
i0.ɵɵattribute("type", ctx.type ?? "text")("id", ctx.inputId())("name", ctx.name)("value", ctx.value ?? ctx.defaultValue)("placeholder", ctx.placeholder)("required", ctx.required ? "" : null)("aria-invalid", ctx.error || ctx.fieldContext()?.invalid ? "true" : "false")("aria-describedby", ctx.mergedDescribedBy())("style", ctx.hostStyle(), i0.ɵɵsanitizeStyle)("data-testid", ctx.testId);
|
|
398
|
+
i0.ɵɵadvance(2);
|
|
399
|
+
i0.ɵɵclassMap(ctx.cm().inputRightElement);
|
|
400
|
+
i0.ɵɵadvance(2);
|
|
401
|
+
i0.ɵɵconditional(ctx.clearable && ctx.value ? 11 : -1);
|
|
184
402
|
i0.ɵɵadvance();
|
|
185
|
-
i0.ɵɵ
|
|
403
|
+
i0.ɵɵclassMap(ctx.cm().textMuted);
|
|
404
|
+
i0.ɵɵadvance(3);
|
|
405
|
+
i0.ɵɵconditional((tmp_23_0 = ctx.asTemplate(ctx.rightElement)) ? 15 : 16, tmp_23_0);
|
|
406
|
+
i0.ɵɵadvance(2);
|
|
407
|
+
i0.ɵɵconditional(ctx.error ? 17 : -1);
|
|
186
408
|
i0.ɵɵadvance();
|
|
187
|
-
i0.ɵɵconditional(ctx.hint && !ctx.error ?
|
|
188
|
-
} }, encapsulation: 2 });
|
|
409
|
+
i0.ɵɵconditional(ctx.hint && !ctx.error ? 18 : -1);
|
|
410
|
+
} }, dependencies: [MolIconSvg, NgTemplateOutlet], encapsulation: 2 });
|
|
189
411
|
}
|
|
190
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(
|
|
412
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(Input, [{
|
|
191
413
|
type: Component,
|
|
192
414
|
args: [{
|
|
193
|
-
selector: 'mol-input',
|
|
415
|
+
selector: 'div[mol-input]',
|
|
194
416
|
standalone: true,
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
417
|
+
imports: [MolIconSvg, NgTemplateOutlet],
|
|
418
|
+
inputs: [
|
|
419
|
+
'type',
|
|
420
|
+
'size',
|
|
421
|
+
'align',
|
|
422
|
+
'label',
|
|
423
|
+
'error',
|
|
424
|
+
'hint',
|
|
425
|
+
'leftElement',
|
|
426
|
+
'rightElement',
|
|
427
|
+
'clearable',
|
|
428
|
+
'clearLabel',
|
|
429
|
+
'className',
|
|
430
|
+
'style',
|
|
431
|
+
'testId',
|
|
432
|
+
'disabled',
|
|
433
|
+
'required',
|
|
434
|
+
'value',
|
|
435
|
+
'defaultValue',
|
|
436
|
+
'placeholder',
|
|
437
|
+
'name',
|
|
438
|
+
'id',
|
|
439
|
+
],
|
|
440
|
+
host: {
|
|
441
|
+
'[class]': 'cm().inputWrapper',
|
|
442
|
+
},
|
|
443
|
+
template: `@if (label) {
|
|
444
|
+
<label
|
|
445
|
+
[attr.for]="inputId()"
|
|
446
|
+
[class]="cm().cn(cm().label({ required: !!required }), cm().labelBlock)"
|
|
447
|
+
>{{ label }}</label
|
|
448
|
+
>
|
|
449
|
+
}
|
|
450
|
+
<div [class]="cm().inputInner">
|
|
451
|
+
<div [class]="cm().inputLeftElement" #leftSlot>
|
|
452
|
+
<ng-content select="[slot=leftElement]"></ng-content>
|
|
453
|
+
@if (asTemplate(leftElement); as tpl) {
|
|
454
|
+
<ng-container [ngTemplateOutlet]="tpl" />
|
|
455
|
+
} @else {
|
|
456
|
+
{{ asText(leftElement) }}
|
|
457
|
+
}
|
|
458
|
+
</div>
|
|
459
|
+
<input
|
|
460
|
+
[attr.type]="type ?? 'text'"
|
|
461
|
+
[attr.id]="inputId()"
|
|
462
|
+
[attr.name]="name"
|
|
463
|
+
[attr.value]="value ?? defaultValue"
|
|
464
|
+
[attr.placeholder]="placeholder"
|
|
465
|
+
[disabled]="disabled"
|
|
466
|
+
[attr.required]="required ? '' : null"
|
|
467
|
+
[attr.aria-invalid]="error || fieldContext()?.invalid ? 'true' : 'false'"
|
|
468
|
+
[attr.aria-describedby]="mergedDescribedBy()"
|
|
469
|
+
[class]="classes()"
|
|
470
|
+
[attr.style]="hostStyle()"
|
|
471
|
+
[attr.data-testid]="testId"
|
|
472
|
+
(input)="handleInput($event)"
|
|
473
|
+
(change)="handleChange($event)"
|
|
474
|
+
#inputEl
|
|
475
|
+
/>
|
|
476
|
+
<div [class]="cm().inputRightElement" #rightSlot>
|
|
227
477
|
@if (clearable && value) {
|
|
228
|
-
<
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
</button>
|
|
237
|
-
</div>
|
|
478
|
+
<button
|
|
479
|
+
type="button"
|
|
480
|
+
(click)="clear.emit($event)"
|
|
481
|
+
[class]="cm().inputClearButton"
|
|
482
|
+
[attr.aria-label]="clearText()"
|
|
483
|
+
>
|
|
484
|
+
<svg mol-icon [data]="clearIcon()" />
|
|
485
|
+
</button>
|
|
238
486
|
}
|
|
487
|
+
<span [class]="cm().textMuted" #rightInner
|
|
488
|
+
><ng-content select="[slot=rightElement]"></ng-content>
|
|
489
|
+
@if (asTemplate(rightElement); as tpl) {
|
|
490
|
+
<ng-container [ngTemplateOutlet]="tpl" />
|
|
491
|
+
} @else {
|
|
492
|
+
{{ asText(rightElement) }}
|
|
493
|
+
}
|
|
494
|
+
</span>
|
|
239
495
|
</div>
|
|
240
|
-
@if (error) {
|
|
241
|
-
<p [id]="inputId + '-error'" [class]="formErrorClass">
|
|
242
|
-
{{ error }}
|
|
243
|
-
</p>
|
|
244
|
-
}
|
|
245
|
-
@if (hint && !error) {
|
|
246
|
-
<p [id]="inputId + '-hint'" [class]="formHintClass">
|
|
247
|
-
{{ hint }}
|
|
248
|
-
</p>
|
|
249
|
-
}
|
|
250
496
|
</div>
|
|
251
|
-
|
|
497
|
+
@if (error) {
|
|
498
|
+
<p [attr.id]="inputId() + '-error'" [class]="cm().formError">{{ error }}</p>
|
|
499
|
+
}
|
|
500
|
+
@if (hint && !error) {
|
|
501
|
+
<p [attr.id]="inputId() + '-hint'" [class]="cm().formHint">{{ hint }}</p>
|
|
502
|
+
}`,
|
|
252
503
|
}]
|
|
253
|
-
}], null, {
|
|
254
|
-
type: Input
|
|
255
|
-
}], size: [{
|
|
256
|
-
type: Input
|
|
257
|
-
}], label: [{
|
|
258
|
-
type: Input
|
|
259
|
-
}], error: [{
|
|
260
|
-
type: Input
|
|
261
|
-
}], hint: [{
|
|
262
|
-
type: Input
|
|
263
|
-
}], clearable: [{
|
|
264
|
-
type: Input
|
|
265
|
-
}], clearLabel: [{
|
|
266
|
-
type: Input
|
|
267
|
-
}], className: [{
|
|
268
|
-
type: Input
|
|
269
|
-
}], style: [{
|
|
270
|
-
type: Input
|
|
271
|
-
}], testId: [{
|
|
272
|
-
type: Input
|
|
273
|
-
}], disabled: [{
|
|
274
|
-
type: Input
|
|
275
|
-
}], required: [{
|
|
276
|
-
type: Input
|
|
277
|
-
}], readOnly: [{
|
|
278
|
-
type: Input
|
|
279
|
-
}], value: [{
|
|
280
|
-
type: Input
|
|
281
|
-
}], placeholder: [{
|
|
282
|
-
type: Input
|
|
283
|
-
}], name: [{
|
|
284
|
-
type: Input
|
|
285
|
-
}], id: [{
|
|
286
|
-
type: Input
|
|
287
|
-
}], maxLength: [{
|
|
288
|
-
type: Input
|
|
289
|
-
}], minLength: [{
|
|
290
|
-
type: Input
|
|
291
|
-
}], pattern: [{
|
|
292
|
-
type: Input
|
|
293
|
-
}], autoComplete: [{
|
|
294
|
-
type: Input
|
|
295
|
-
}], handleInput: [{
|
|
296
|
-
type: Output
|
|
297
|
-
}], handleChange: [{
|
|
298
|
-
type: Output
|
|
299
|
-
}], handleFocus: [{
|
|
300
|
-
type: Output
|
|
301
|
-
}], handleBlur: [{
|
|
504
|
+
}], null, { change: [{
|
|
302
505
|
type: Output
|
|
303
|
-
}],
|
|
506
|
+
}], clear: [{
|
|
304
507
|
type: Output
|
|
508
|
+
}], inputEl: [{
|
|
509
|
+
type: ViewChild,
|
|
510
|
+
args: ['inputEl']
|
|
511
|
+
}], leftSlot: [{
|
|
512
|
+
type: ViewChild,
|
|
513
|
+
args: ['leftSlot']
|
|
514
|
+
}], rightSlot: [{
|
|
515
|
+
type: ViewChild,
|
|
516
|
+
args: ['rightSlot']
|
|
517
|
+
}], rightInner: [{
|
|
518
|
+
type: ViewChild,
|
|
519
|
+
args: ['rightInner']
|
|
305
520
|
}] }); })();
|
|
306
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(
|
|
521
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(Input, { className: "Input", filePath: "components/input.component.ts", lineNumber: 133 }); })();
|
|
307
522
|
//# sourceMappingURL=input.component.js.map
|