@educarehq/solaris-ui 0.2.0 → 0.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/esm2022/index.js +40 -1
- package/esm2022/index.js.map +1 -1
- package/esm2022/lib/components/actions/button/index.js +3 -0
- package/esm2022/lib/components/actions/button/index.js.map +1 -0
- package/esm2022/lib/components/data-display/badge/index.js +3 -0
- package/esm2022/lib/components/data-display/badge/index.js.map +1 -0
- package/esm2022/lib/components/data-display/divider/component/divider.component.js +46 -0
- package/esm2022/lib/components/data-display/divider/component/divider.component.js.map +1 -0
- package/esm2022/lib/components/data-display/divider/index.js +2 -0
- package/esm2022/lib/components/data-display/divider/index.js.map +1 -0
- package/esm2022/lib/components/data-display/divider/model/divider.types.js +1 -0
- package/esm2022/lib/components/data-display/divider/model/divider.types.js.map +1 -0
- package/esm2022/lib/components/feedback/toast/component/toast.component.js +268 -0
- package/esm2022/lib/components/feedback/toast/component/toast.component.js.map +1 -0
- package/esm2022/lib/components/feedback/toast/container/toast-container.component.js +24 -0
- package/esm2022/lib/components/feedback/toast/container/toast-container.component.js.map +1 -0
- package/esm2022/lib/components/feedback/toast/model/toast.types.js +1 -0
- package/esm2022/lib/components/feedback/toast/model/toast.types.js.map +1 -0
- package/esm2022/lib/components/feedback/toast/provider/provide-solaris-toast.js +17 -0
- package/esm2022/lib/components/feedback/toast/provider/provide-solaris-toast.js.map +1 -0
- package/esm2022/lib/components/feedback/toast/service/toast.service.js +219 -0
- package/esm2022/lib/components/feedback/toast/service/toast.service.js.map +1 -0
- package/esm2022/lib/components/feedback/toast/token/toast.tokens.js +13 -0
- package/esm2022/lib/components/feedback/toast/token/toast.tokens.js.map +1 -0
- package/esm2022/lib/components/forms/email-field/component/email-field.component.js +5 -4
- package/esm2022/lib/components/forms/email-field/component/email-field.component.js.map +1 -1
- package/esm2022/lib/components/forms/form-field/component/form-field.component.js +50 -2
- package/esm2022/lib/components/forms/form-field/component/form-field.component.js.map +1 -1
- package/esm2022/lib/components/forms/form-field/directives/form-field-trigger.directive.js.map +1 -1
- package/esm2022/lib/components/forms/form-field/index.js.map +1 -1
- package/esm2022/lib/components/forms/multi-select/component/multi-select.component.js +11 -28
- package/esm2022/lib/components/forms/multi-select/component/multi-select.component.js.map +1 -1
- package/esm2022/lib/components/forms/multi-select/model/multi-select.types.js.map +1 -1
- package/esm2022/lib/components/forms/option/component/option.component.js +2 -2
- package/esm2022/lib/components/forms/option/component/option.component.js.map +1 -1
- package/esm2022/lib/components/forms/password-field/component/password-field.component.js +2 -2
- package/esm2022/lib/components/forms/password-field/component/password-field.component.js.map +1 -1
- package/esm2022/lib/components/forms/radio/component/radio.component.js +2 -2
- package/esm2022/lib/components/forms/select/component/select.component.js +4 -8
- package/esm2022/lib/components/forms/select/component/select.component.js.map +1 -1
- package/esm2022/lib/components/icon/component/solaris-icon.component.js +2 -2
- package/esm2022/lib/components/icon/component/solaris-icon.component.js.map +1 -1
- package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu-group.component.js +27 -0
- package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu-group.component.js.map +1 -0
- package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu-item.component.js +96 -0
- package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu-item.component.js.map +1 -0
- package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu-label.component.js +22 -0
- package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu-label.component.js.map +1 -0
- package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu.component.js +105 -0
- package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-menu.component.js.map +1 -0
- package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-submenu-trigger.component.js +95 -0
- package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-submenu-trigger.component.js.map +1 -0
- package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-submenu.component.js +631 -0
- package/esm2022/lib/components/interaction/dropdown-menu/component/dropdown-submenu.component.js.map +1 -0
- package/esm2022/lib/components/interaction/dropdown-menu/directives/dropdown-menu-trigger.directive.js +365 -0
- package/esm2022/lib/components/interaction/dropdown-menu/directives/dropdown-menu-trigger.directive.js.map +1 -0
- package/esm2022/lib/components/interaction/dropdown-menu/index.js +8 -0
- package/esm2022/lib/components/interaction/dropdown-menu/index.js.map +1 -0
- package/esm2022/lib/components/interaction/dropdown-menu/model/dropdown-menu-navigation.js +3 -0
- package/esm2022/lib/components/interaction/dropdown-menu/model/dropdown-menu-navigation.js.map +1 -0
- package/esm2022/lib/components/interaction/dropdown-menu/model/dropdown-menu.types.js +1 -0
- package/esm2022/lib/components/interaction/dropdown-menu/model/dropdown-menu.types.js.map +1 -0
- package/esm2022/lib/components/interaction/dropdown-menu/model/dropdown-submenu.types.js +1 -0
- package/esm2022/lib/components/interaction/dropdown-menu/model/dropdown-submenu.types.js.map +1 -0
- package/esm2022/lib/components/interaction/popover/component/popover-panel.component.js +2 -2
- package/esm2022/lib/components/interaction/popover/component/popover-panel.component.js.map +1 -1
- package/esm2022/lib/components/interaction/popover/directives/popover-trigger.directive.js +28 -20
- package/esm2022/lib/components/interaction/popover/directives/popover-trigger.directive.js.map +1 -1
- package/esm2022/lib/components/interaction/tooltip/component/tooltip-panel.component.js.map +1 -1
- package/esm2022/lib/components/interaction/tooltip/directive/tooltip.directive.js.map +1 -1
- package/esm2022/lib/components/interaction/tooltip/model/tooltip-position.js.map +1 -1
- package/esm2022/lib/components/navigation/editable-tabs/component/editable-tabs.component.js +323 -0
- package/esm2022/lib/components/navigation/editable-tabs/component/editable-tabs.component.js.map +1 -0
- package/esm2022/lib/components/navigation/editable-tabs/editable-tab/editable-tab.component.js +34 -0
- package/esm2022/lib/components/navigation/editable-tabs/editable-tab/editable-tab.component.js.map +1 -0
- package/esm2022/lib/components/navigation/editable-tabs/model/editable-tabs.types.js +1 -0
- package/esm2022/lib/components/navigation/editable-tabs/model/editable-tabs.types.js.map +1 -0
- package/esm2022/lib/components/navigation/segmented-control/component/segmented-control.component.js +242 -0
- package/esm2022/lib/components/navigation/segmented-control/component/segmented-control.component.js.map +1 -0
- package/esm2022/lib/components/navigation/segmented-control/item/segmented-item.component.js +197 -0
- package/esm2022/lib/components/navigation/segmented-control/item/segmented-item.component.js.map +1 -0
- package/esm2022/lib/components/navigation/segmented-control/model/segmented-control.types.js +1 -0
- package/esm2022/lib/components/navigation/segmented-control/model/segmented-control.types.js.map +1 -0
- package/esm2022/lib/components/navigation/segmented-control/token/segmented-control.tokens.js +3 -0
- package/esm2022/lib/components/navigation/segmented-control/token/segmented-control.tokens.js.map +1 -0
- package/esm2022/lib/components/navigation/stepper/actions/stepper-actions.component.js +15 -0
- package/esm2022/lib/components/navigation/stepper/actions/stepper-actions.component.js.map +1 -0
- package/esm2022/lib/components/navigation/stepper/component/stepper.component.js +99 -0
- package/esm2022/lib/components/navigation/stepper/component/stepper.component.js.map +1 -0
- package/esm2022/lib/components/navigation/stepper/content/stepper-content.component.js +13 -0
- package/esm2022/lib/components/navigation/stepper/content/stepper-content.component.js.map +1 -0
- package/esm2022/lib/components/navigation/stepper/model/stepper.types.js +1 -0
- package/esm2022/lib/components/navigation/stepper/model/stepper.types.js.map +1 -0
- package/esm2022/lib/components/navigation/stepper/step/step.component.js +91 -0
- package/esm2022/lib/components/navigation/stepper/step/step.component.js.map +1 -0
- package/esm2022/lib/components/navigation/stepper/token/stepper.tokens.js +3 -0
- package/esm2022/lib/components/navigation/stepper/token/stepper.tokens.js.map +1 -0
- package/esm2022/lib/components/navigation/tabs/component/tabs.component.js +169 -0
- package/esm2022/lib/components/navigation/tabs/component/tabs.component.js.map +1 -0
- package/esm2022/lib/components/navigation/tabs/index.js +5 -0
- package/esm2022/lib/components/navigation/tabs/index.js.map +1 -0
- package/esm2022/lib/components/navigation/tabs/model/tabs.types.js +1 -0
- package/esm2022/lib/components/navigation/tabs/model/tabs.types.js.map +1 -0
- package/esm2022/lib/components/navigation/tabs/tab/tab.component.js +195 -0
- package/esm2022/lib/components/navigation/tabs/tab/tab.component.js.map +1 -0
- package/esm2022/lib/components/navigation/tabs/tab-panel/tab-panel.component.js +55 -0
- package/esm2022/lib/components/navigation/tabs/tab-panel/tab-panel.component.js.map +1 -0
- package/esm2022/lib/components/navigation/tabs/token/tabs.tokens.js +3 -0
- package/esm2022/lib/components/navigation/tabs/token/tabs.tokens.js.map +1 -0
- package/esm2022/lib/components/overlay/dialog/component/dialog.component.js +49 -0
- package/esm2022/lib/components/overlay/dialog/component/dialog.component.js.map +1 -0
- package/esm2022/lib/components/overlay/dialog/components/dialog-actions.component.js +37 -0
- package/esm2022/lib/components/overlay/dialog/components/dialog-actions.component.js.map +1 -0
- package/esm2022/lib/components/overlay/dialog/components/dialog-content.component.js +13 -0
- package/esm2022/lib/components/overlay/dialog/components/dialog-content.component.js.map +1 -0
- package/esm2022/lib/components/overlay/dialog/components/dialog-header.component.js +32 -0
- package/esm2022/lib/components/overlay/dialog/components/dialog-header.component.js.map +1 -0
- package/esm2022/lib/components/overlay/dialog/container/dialog-container.component.js +142 -0
- package/esm2022/lib/components/overlay/dialog/container/dialog-container.component.js.map +1 -0
- package/esm2022/lib/components/overlay/dialog/flow/dialog-flow.component.js +56 -0
- package/esm2022/lib/components/overlay/dialog/flow/dialog-flow.component.js.map +1 -0
- package/esm2022/lib/components/overlay/dialog/flow/dialog-step.component.js +20 -0
- package/esm2022/lib/components/overlay/dialog/flow/dialog-step.component.js.map +1 -0
- package/esm2022/lib/components/overlay/dialog/model/dialog.types.js +1 -0
- package/esm2022/lib/components/overlay/dialog/model/dialog.types.js.map +1 -0
- package/esm2022/lib/components/overlay/dialog/provider/provide-solaris-dialog.js +13 -0
- package/esm2022/lib/components/overlay/dialog/provider/provide-solaris-dialog.js.map +1 -0
- package/esm2022/lib/components/overlay/dialog/service/dialog-ref.js +23 -0
- package/esm2022/lib/components/overlay/dialog/service/dialog-ref.js.map +1 -0
- package/esm2022/lib/components/overlay/dialog/service/dialog.service.js +111 -0
- package/esm2022/lib/components/overlay/dialog/service/dialog.service.js.map +1 -0
- package/esm2022/lib/components/overlay/dialog/token/dialog-data.token.js +4 -0
- package/esm2022/lib/components/overlay/dialog/token/dialog-data.token.js.map +1 -0
- package/esm2022/lib/components/overlay/dialog/token/dialog.tokens.js +15 -0
- package/esm2022/lib/components/overlay/dialog/token/dialog.tokens.js.map +1 -0
- package/esm2022/lib/services/icon/icons/groups/actions.js +242 -0
- package/esm2022/lib/services/icon/icons/groups/actions.js.map +1 -0
- package/esm2022/lib/services/icon/icons/groups/data.js +129 -0
- package/esm2022/lib/services/icon/icons/groups/data.js.map +1 -0
- package/esm2022/lib/services/icon/icons/groups/layout.js +50 -0
- package/esm2022/lib/services/icon/icons/groups/layout.js.map +1 -0
- package/esm2022/lib/services/icon/icons/groups/navigation.js +354 -0
- package/esm2022/lib/services/icon/icons/groups/navigation.js.map +1 -0
- package/esm2022/lib/services/icon/icons/groups/status.js +70 -0
- package/esm2022/lib/services/icon/icons/groups/status.js.map +1 -0
- package/esm2022/lib/services/icon/icons/groups/theme.js +49 -0
- package/esm2022/lib/services/icon/icons/groups/theme.js.map +1 -0
- package/esm2022/lib/services/icon/icons/solaris-built-in-icons.js +12 -204
- package/esm2022/lib/services/icon/icons/solaris-built-in-icons.js.map +1 -1
- package/esm2022/lib/services/icon/model/solaris-icon-definition.interface.js.map +1 -1
- package/esm2022/lib/services/icon/model/solaris-icon.types.js.map +1 -1
- package/esm2022/lib/services/translation/model/solaris-translate-defaults.js +56 -0
- package/esm2022/lib/services/translation/model/solaris-translate-defaults.js.map +1 -1
- package/index.d.ts +92 -1
- package/lib/components/actions/button/index.d.ts +3 -0
- package/lib/components/data-display/badge/index.d.ts +3 -0
- package/lib/components/data-display/divider/component/divider.component.d.ts +17 -0
- package/lib/components/data-display/divider/index.d.ts +2 -0
- package/lib/components/data-display/divider/model/divider.types.d.ts +5 -0
- package/lib/components/feedback/toast/component/toast.component.d.ts +62 -0
- package/lib/components/feedback/toast/container/toast-container.component.d.ts +10 -0
- package/lib/components/feedback/toast/model/toast.types.d.ts +106 -0
- package/lib/components/feedback/toast/provider/provide-solaris-toast.d.ts +3 -0
- package/lib/components/feedback/toast/service/toast.service.d.ts +36 -0
- package/lib/components/feedback/toast/token/toast.tokens.d.ts +5 -0
- package/lib/components/forms/email-field/component/email-field.component.d.ts +2 -1
- package/lib/components/forms/form-field/component/form-field.component.d.ts +6 -0
- package/lib/components/forms/multi-select/component/multi-select.component.d.ts +4 -7
- package/lib/components/forms/select/component/select.component.d.ts +2 -2
- package/lib/components/interaction/dropdown-menu/component/dropdown-menu-group.component.d.ts +10 -0
- package/lib/components/interaction/dropdown-menu/component/dropdown-menu-item.component.d.ts +28 -0
- package/lib/components/interaction/dropdown-menu/component/dropdown-menu-label.component.d.ts +7 -0
- package/lib/components/interaction/dropdown-menu/component/dropdown-menu.component.d.ts +21 -0
- package/lib/components/interaction/dropdown-menu/component/dropdown-submenu-trigger.component.d.ts +21 -0
- package/lib/components/interaction/dropdown-menu/component/dropdown-submenu.component.d.ts +68 -0
- package/lib/components/interaction/dropdown-menu/directives/dropdown-menu-trigger.directive.d.ts +61 -0
- package/lib/components/interaction/dropdown-menu/index.d.ts +9 -0
- package/lib/components/interaction/dropdown-menu/model/dropdown-menu-navigation.d.ts +8 -0
- package/lib/components/interaction/dropdown-menu/model/dropdown-menu.types.d.ts +11 -0
- package/lib/components/interaction/dropdown-menu/model/dropdown-submenu.types.d.ts +2 -0
- package/lib/components/navigation/editable-tabs/component/editable-tabs.component.d.ts +69 -0
- package/lib/components/navigation/editable-tabs/editable-tab/editable-tab.component.d.ts +20 -0
- package/lib/components/navigation/editable-tabs/model/editable-tabs.types.d.ts +60 -0
- package/lib/components/navigation/segmented-control/component/segmented-control.component.d.ts +64 -0
- package/lib/components/navigation/segmented-control/item/segmented-item.component.d.ts +35 -0
- package/lib/components/navigation/segmented-control/model/segmented-control.types.d.ts +12 -0
- package/lib/components/navigation/segmented-control/token/segmented-control.tokens.d.ts +22 -0
- package/lib/components/navigation/stepper/actions/stepper-actions.component.d.ts +7 -0
- package/lib/components/navigation/stepper/component/stepper.component.d.ts +36 -0
- package/lib/components/navigation/stepper/content/stepper-content.component.d.ts +5 -0
- package/lib/components/navigation/stepper/model/stepper.types.d.ts +15 -0
- package/lib/components/navigation/stepper/step/step.component.d.ts +27 -0
- package/lib/components/navigation/stepper/token/stepper.tokens.d.ts +13 -0
- package/lib/components/navigation/tabs/component/tabs.component.d.ts +47 -0
- package/lib/components/navigation/tabs/index.d.ts +6 -0
- package/lib/components/navigation/tabs/model/tabs.types.d.ts +17 -0
- package/lib/components/navigation/tabs/tab/tab.component.d.ts +38 -0
- package/lib/components/navigation/tabs/tab-panel/tab-panel.component.d.ts +15 -0
- package/lib/components/navigation/tabs/token/tabs.tokens.d.ts +19 -0
- package/lib/components/overlay/dialog/component/dialog.component.d.ts +29 -0
- package/lib/components/overlay/dialog/components/dialog-actions.component.d.ts +12 -0
- package/lib/components/overlay/dialog/components/dialog-content.component.d.ts +5 -0
- package/lib/components/overlay/dialog/components/dialog-header.component.d.ts +19 -0
- package/lib/components/overlay/dialog/container/dialog-container.component.d.ts +32 -0
- package/lib/components/overlay/dialog/flow/dialog-flow.component.d.ts +19 -0
- package/lib/components/overlay/dialog/flow/dialog-step.component.d.ts +7 -0
- package/lib/components/overlay/dialog/model/dialog.types.d.ts +87 -0
- package/lib/components/overlay/dialog/provider/provide-solaris-dialog.d.ts +3 -0
- package/lib/components/overlay/dialog/service/dialog-ref.d.ts +11 -0
- package/lib/components/overlay/dialog/service/dialog.service.d.ts +20 -0
- package/lib/components/overlay/dialog/token/dialog-data.token.d.ts +4 -0
- package/lib/components/overlay/dialog/token/dialog.tokens.d.ts +4 -0
- package/lib/services/icon/icons/groups/actions.d.ts +2 -0
- package/lib/services/icon/icons/groups/data.d.ts +2 -0
- package/lib/services/icon/icons/groups/layout.d.ts +2 -0
- package/lib/services/icon/icons/groups/navigation.d.ts +2 -0
- package/lib/services/icon/icons/groups/status.d.ts +2 -0
- package/lib/services/icon/icons/groups/theme.d.ts +2 -0
- package/lib/services/icon/model/solaris-icon-definition.interface.d.ts +10 -1
- package/lib/services/icon/model/solaris-icon.types.d.ts +1 -1
- package/package.json +1 -1
- package/styles/_dropdown-menu.scss +72 -0
- package/styles/_popover.scss +24 -19
- package/styles/_toast.scss +9 -0
- package/styles/_tooltip.scss +3 -3
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { Injectable, inject, signal, ApplicationRef, EnvironmentInjector, Injector, createComponent, } from '@angular/core';
|
|
2
|
+
import { SOLARIS_TOAST_CONFIG, SOLARIS_TOAST_DEFAULT_CONFIG, SOLARIS_TOAST_CONTAINER, } from '../token/toast.tokens';
|
|
3
|
+
import { SolarisToastContainerComponent } from '../container/toast-container.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
let nextToastId = 0;
|
|
6
|
+
export class SolarisToastService {
|
|
7
|
+
autoContainer = inject(SOLARIS_TOAST_CONTAINER, { optional: true }) ?? true;
|
|
8
|
+
appRef = inject(ApplicationRef);
|
|
9
|
+
environmentInjector = inject(EnvironmentInjector);
|
|
10
|
+
injector = inject(Injector);
|
|
11
|
+
containerRefs = new Map();
|
|
12
|
+
entriesSignal = signal([], ...(ngDevMode ? [{ debugName: "entriesSignal" }] : /* istanbul ignore next */ []));
|
|
13
|
+
entries = this.entriesSignal.asReadonly();
|
|
14
|
+
_configSignal = signal(SOLARIS_TOAST_DEFAULT_CONFIG, ...(ngDevMode ? [{ debugName: "_configSignal" }] : /* istanbul ignore next */ []));
|
|
15
|
+
configSignal = this._configSignal.asReadonly();
|
|
16
|
+
constructor() {
|
|
17
|
+
const initial = inject(SOLARIS_TOAST_CONFIG, { optional: true }) ??
|
|
18
|
+
SOLARIS_TOAST_DEFAULT_CONFIG;
|
|
19
|
+
this.updateConfig(initial);
|
|
20
|
+
}
|
|
21
|
+
getContainer(position) {
|
|
22
|
+
if (!this.autoContainer)
|
|
23
|
+
return null;
|
|
24
|
+
let ref = this.containerRefs.get(position);
|
|
25
|
+
if (!ref) {
|
|
26
|
+
const componentRef = createComponent(SolarisToastContainerComponent, {
|
|
27
|
+
environmentInjector: this.environmentInjector,
|
|
28
|
+
elementInjector: this.injector,
|
|
29
|
+
});
|
|
30
|
+
componentRef.setInput('position', position);
|
|
31
|
+
this.appRef.attachView(componentRef.hostView);
|
|
32
|
+
// SECURITY_EXCEPTION: nativeElement required for dynamic container. SSR-safe.
|
|
33
|
+
const rootEl = componentRef.location.nativeElement;
|
|
34
|
+
// SECURITY_EXCEPTION: document.body.appendChild for root-level attachment. SSR-safe.
|
|
35
|
+
document.body.appendChild(rootEl);
|
|
36
|
+
this.containerRefs.set(position, componentRef);
|
|
37
|
+
ref = componentRef;
|
|
38
|
+
}
|
|
39
|
+
return ref.instance;
|
|
40
|
+
}
|
|
41
|
+
resolveEntry(options, existingId) {
|
|
42
|
+
const id = existingId ?? options.id ?? `solaris-toast-${++nextToastId}`;
|
|
43
|
+
const variant = options.variant ?? SolarisToastService.toastVariant ?? 'neutral';
|
|
44
|
+
const appearances = this.resolveAppearances();
|
|
45
|
+
const appearance = options.appearance ?? appearances;
|
|
46
|
+
const cfg = this._configSignal();
|
|
47
|
+
const position = options.position ?? cfg.position ?? 'bottom-center';
|
|
48
|
+
const duration = options.duration ?? cfg.duration ?? 5000;
|
|
49
|
+
const effectiveDuration = duration <= 0 || options.persistent ? Infinity : duration;
|
|
50
|
+
const persistent = options.duration === 0 || options.persistent === true;
|
|
51
|
+
const closeable = options.closeable ?? true;
|
|
52
|
+
const resolvedAriaLive = resolveAriaLive(variant, options.ariaLive);
|
|
53
|
+
const resolvedRole = resolveRole(variant, options.role);
|
|
54
|
+
const icon = options.icon ?? resolveDefaultIcon(variant);
|
|
55
|
+
const title = resolveText(options.title, options.titleKey, undefined);
|
|
56
|
+
const description = resolveText(options.description, options.descriptionKey, undefined);
|
|
57
|
+
const closeLabel = resolveCloseLabel(options.closeLabel, options.closeLabelKey);
|
|
58
|
+
const showCountdown = options.showCountdown ?? cfg.showCountdown ?? false;
|
|
59
|
+
const countdownMode = options.countdownMode ?? cfg.countdownMode ?? 'bar';
|
|
60
|
+
const showCountdownText = options.showCountdownText ?? cfg.showCountdownText ?? false;
|
|
61
|
+
return {
|
|
62
|
+
id,
|
|
63
|
+
options,
|
|
64
|
+
createdAt: Date.now(),
|
|
65
|
+
resolvedVariant: variant,
|
|
66
|
+
resolvedAppearance: appearance,
|
|
67
|
+
resolvedPosition: position,
|
|
68
|
+
resolvedDuration: effectiveDuration,
|
|
69
|
+
resolvedPersistent: persistent,
|
|
70
|
+
resolvedCloseable: closeable,
|
|
71
|
+
resolvedAriaLive,
|
|
72
|
+
resolvedRole,
|
|
73
|
+
resolvedIcon: icon,
|
|
74
|
+
resolvedTitle: title,
|
|
75
|
+
resolvedDescription: description,
|
|
76
|
+
resolvedCloseLabel: closeLabel,
|
|
77
|
+
resolvedProgress: options.progress,
|
|
78
|
+
resolvedShowProgress: options.showProgress ?? false,
|
|
79
|
+
resolvedActions: options.actions,
|
|
80
|
+
resolvedExpandable: options.expandable ?? false,
|
|
81
|
+
resolvedDefaultExpanded: options.defaultExpanded ?? false,
|
|
82
|
+
resolvedMaxCollapsedLines: options.maxCollapsedLines ?? 2,
|
|
83
|
+
resolvedExpandLabel: resolveText(options.expandLabel, options.expandLabelKey, '') ?? '',
|
|
84
|
+
resolvedCollapseLabel: resolveText(options.collapseLabel, options.collapseLabelKey, '') ?? '',
|
|
85
|
+
resolvedShowCountdown: showCountdown,
|
|
86
|
+
resolvedShowCountdownText: showCountdownText,
|
|
87
|
+
resolvedCountdownMode: countdownMode,
|
|
88
|
+
resolvedActionsAlign: options.actionsAlign ?? cfg.actionsAlign ?? 'end',
|
|
89
|
+
resolvedIconSize: options.iconSize ?? cfg.iconSize ?? 'md',
|
|
90
|
+
resolvedMediaShape: options.mediaShape ?? cfg.mediaShape ?? 'circle',
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
resolveAppearances() {
|
|
94
|
+
return this._configSignal().appearance ?? 'surface';
|
|
95
|
+
}
|
|
96
|
+
addEntry(options) {
|
|
97
|
+
const entry = this.resolveEntry(options);
|
|
98
|
+
const cfg = this._configSignal();
|
|
99
|
+
this.entriesSignal.update((current) => {
|
|
100
|
+
let next = [...current, entry];
|
|
101
|
+
const limit = cfg.limit ?? 5;
|
|
102
|
+
if (next.length > limit) {
|
|
103
|
+
const removeCount = next.length - limit;
|
|
104
|
+
next = next.slice(removeCount);
|
|
105
|
+
}
|
|
106
|
+
if (cfg.newestOnTop !== false) {
|
|
107
|
+
next = [...next].sort((a, b) => b.createdAt - a.createdAt);
|
|
108
|
+
}
|
|
109
|
+
return next;
|
|
110
|
+
});
|
|
111
|
+
this.getContainer(entry.resolvedPosition);
|
|
112
|
+
return entry;
|
|
113
|
+
}
|
|
114
|
+
removeEntry(id) {
|
|
115
|
+
this.entriesSignal.update((current) => current.filter((e) => e.id !== id));
|
|
116
|
+
}
|
|
117
|
+
updateEntry(id, patch) {
|
|
118
|
+
this.entriesSignal.update((current) => current.map((e) => {
|
|
119
|
+
if (e.id !== id)
|
|
120
|
+
return e;
|
|
121
|
+
const merged = { ...e.options, ...patch };
|
|
122
|
+
return this.resolveEntry(merged, id);
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
createRef(entry) {
|
|
126
|
+
return {
|
|
127
|
+
id: entry.id,
|
|
128
|
+
dismiss: () => this.dismiss(entry.id),
|
|
129
|
+
update: (patch) => this.update(entry.id, patch),
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
show(options) {
|
|
133
|
+
const entry = this.addEntry(options);
|
|
134
|
+
return this.createRef(entry);
|
|
135
|
+
}
|
|
136
|
+
neutral(options) {
|
|
137
|
+
return this.show({ ...options, variant: 'neutral' });
|
|
138
|
+
}
|
|
139
|
+
info(options) {
|
|
140
|
+
return this.show({ ...options, variant: 'info' });
|
|
141
|
+
}
|
|
142
|
+
success(options) {
|
|
143
|
+
return this.show({ ...options, variant: 'success' });
|
|
144
|
+
}
|
|
145
|
+
warning(options) {
|
|
146
|
+
return this.show({ ...options, variant: 'warning' });
|
|
147
|
+
}
|
|
148
|
+
danger(options) {
|
|
149
|
+
return this.show({ ...options, variant: 'danger' });
|
|
150
|
+
}
|
|
151
|
+
loading(options) {
|
|
152
|
+
return this.show({ ...options, variant: 'loading' });
|
|
153
|
+
}
|
|
154
|
+
dismiss(id) {
|
|
155
|
+
this.removeEntry(id);
|
|
156
|
+
}
|
|
157
|
+
dismissAll() {
|
|
158
|
+
this.entriesSignal.set([]);
|
|
159
|
+
}
|
|
160
|
+
updateConfig(patch) {
|
|
161
|
+
this._configSignal.update((current) => ({ ...current, ...patch }));
|
|
162
|
+
}
|
|
163
|
+
update(id, patch) {
|
|
164
|
+
this.updateEntry(id, patch);
|
|
165
|
+
}
|
|
166
|
+
static toastVariant;
|
|
167
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisToastService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
168
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisToastService });
|
|
169
|
+
}
|
|
170
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisToastService, decorators: [{
|
|
171
|
+
type: Injectable
|
|
172
|
+
}], ctorParameters: () => [] });
|
|
173
|
+
function resolveAriaLive(variant, override) {
|
|
174
|
+
if (override)
|
|
175
|
+
return override;
|
|
176
|
+
if (variant === 'warning' || variant === 'danger')
|
|
177
|
+
return 'assertive';
|
|
178
|
+
return 'polite';
|
|
179
|
+
}
|
|
180
|
+
function resolveRole(variant, override) {
|
|
181
|
+
if (override)
|
|
182
|
+
return override;
|
|
183
|
+
if (variant === 'warning' || variant === 'danger')
|
|
184
|
+
return 'alert';
|
|
185
|
+
return 'status';
|
|
186
|
+
}
|
|
187
|
+
function resolveDefaultIcon(variant) {
|
|
188
|
+
switch (variant) {
|
|
189
|
+
case 'neutral':
|
|
190
|
+
return 'info';
|
|
191
|
+
case 'info':
|
|
192
|
+
return 'info';
|
|
193
|
+
case 'success':
|
|
194
|
+
return 'success';
|
|
195
|
+
case 'warning':
|
|
196
|
+
return 'warning';
|
|
197
|
+
case 'danger':
|
|
198
|
+
return 'danger';
|
|
199
|
+
case 'loading':
|
|
200
|
+
return 'loader';
|
|
201
|
+
case 'custom':
|
|
202
|
+
return 'info';
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function resolveText(text, key, defaultText) {
|
|
206
|
+
if (text)
|
|
207
|
+
return text;
|
|
208
|
+
if (key)
|
|
209
|
+
return key;
|
|
210
|
+
return defaultText;
|
|
211
|
+
}
|
|
212
|
+
function resolveCloseLabel(label, key) {
|
|
213
|
+
if (label)
|
|
214
|
+
return label;
|
|
215
|
+
if (key)
|
|
216
|
+
return key;
|
|
217
|
+
return 'Fechar';
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=toast.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.service.js","sourceRoot":"","sources":["../../../../../../../../../packages/angular/src/lib/components/feedback/toast/service/toast.service.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,MAAM,EACN,MAAM,EACN,cAAc,EACd,mBAAmB,EACnB,QAAQ,EACR,eAAe,GAIhB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,wCAAwC,CAAC;;AAYxF,IAAI,WAAW,GAAG,CAAC,CAAC;AAGpB,MAAM,OAAO,mBAAmB;IACb,aAAa,GAC5B,MAAM,CAAC,uBAAuB,EAAE,EAAE,QAAQ,EAAE,IAAI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tB,IAAI,GAAG;QAAE,OAAO,GAAG,CAAC;IACpB,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,SAAS,iBAAiB,CACxB,KAAyB,EACzB,GAAuB;IAEvB,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACxB,IAAI,GAAG;QAAE,OAAO,GAAG,CAAC;IACpB,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["import {\n Injectable,\n inject,\n signal,\n ApplicationRef,\n EnvironmentInjector,\n Injector,\n createComponent,\n type ComponentRef,\n type Signal,\n type WritableSignal,\n} from '@angular/core';\n\nimport {\n SOLARIS_TOAST_CONFIG,\n SOLARIS_TOAST_DEFAULT_CONFIG,\n SOLARIS_TOAST_CONTAINER,\n} from '../token/toast.tokens';\nimport { SolarisToastContainerComponent } from '../container/toast-container.component';\n\nimport type {\n SolarisToastConfig,\n SolarisToastOptions,\n SolarisToastRef,\n SolarisToastVariant,\n SolarisToastAppearance,\n SolarisToastPosition,\n SolarisToastEntry,\n} from '../model/toast.types';\n\nlet nextToastId = 0;\n\n@Injectable()\nexport class SolarisToastService {\n private readonly autoContainer =\n inject(SOLARIS_TOAST_CONTAINER, { optional: true }) ?? true;\n private readonly appRef = inject(ApplicationRef);\n private readonly environmentInjector = inject(EnvironmentInjector);\n private readonly injector = inject(Injector);\n\n private readonly containerRefs = new Map<\n SolarisToastPosition,\n ComponentRef<SolarisToastContainerComponent>\n >();\n\n private readonly entriesSignal = signal<SolarisToastEntry[]>([]);\n\n readonly entries: Signal<SolarisToastEntry[]> =\n this.entriesSignal.asReadonly();\n\n private readonly _configSignal: WritableSignal<SolarisToastConfig> = signal(\n SOLARIS_TOAST_DEFAULT_CONFIG,\n );\n\n readonly configSignal: Signal<SolarisToastConfig> =\n this._configSignal.asReadonly();\n\n constructor() {\n const initial =\n inject(SOLARIS_TOAST_CONFIG, { optional: true }) ??\n SOLARIS_TOAST_DEFAULT_CONFIG;\n this.updateConfig(initial);\n }\n\n private getContainer(\n position: SolarisToastPosition,\n ): SolarisToastContainerComponent | null {\n if (!this.autoContainer) return null;\n let ref = this.containerRefs.get(position);\n if (!ref) {\n const componentRef = createComponent(SolarisToastContainerComponent, {\n environmentInjector: this.environmentInjector,\n elementInjector: this.injector,\n });\n componentRef.setInput('position', position);\n this.appRef.attachView(componentRef.hostView);\n // SECURITY_EXCEPTION: nativeElement required for dynamic container. SSR-safe.\n const rootEl = componentRef.location.nativeElement as HTMLElement;\n // SECURITY_EXCEPTION: document.body.appendChild for root-level attachment. SSR-safe.\n document.body.appendChild(rootEl);\n this.containerRefs.set(position, componentRef);\n ref = componentRef;\n }\n return ref.instance;\n }\n\n private resolveEntry(\n options: SolarisToastOptions,\n existingId?: string,\n ): SolarisToastEntry {\n const id = existingId ?? options.id ?? `solaris-toast-${++nextToastId}`;\n const variant =\n options.variant ?? SolarisToastService.toastVariant ?? 'neutral';\n const appearances = this.resolveAppearances();\n const appearance = options.appearance ?? appearances;\n const cfg = this._configSignal();\n\n const position = options.position ?? cfg.position ?? 'bottom-center';\n\n const duration = options.duration ?? cfg.duration ?? 5000;\n const effectiveDuration =\n duration <= 0 || options.persistent ? Infinity : duration;\n const persistent = options.duration === 0 || options.persistent === true;\n\n const closeable = options.closeable ?? true;\n\n const resolvedAriaLive = resolveAriaLive(variant, options.ariaLive);\n const resolvedRole = resolveRole(variant, options.role);\n\n const icon = options.icon ?? resolveDefaultIcon(variant);\n const title = resolveText(options.title, options.titleKey, undefined);\n const description = resolveText(\n options.description,\n options.descriptionKey,\n undefined,\n );\n const closeLabel = resolveCloseLabel(\n options.closeLabel,\n options.closeLabelKey,\n );\n\n const showCountdown = options.showCountdown ?? cfg.showCountdown ?? false;\n const countdownMode = options.countdownMode ?? cfg.countdownMode ?? 'bar';\n const showCountdownText =\n options.showCountdownText ?? cfg.showCountdownText ?? false;\n\n return {\n id,\n options,\n createdAt: Date.now(),\n resolvedVariant: variant,\n resolvedAppearance: appearance,\n resolvedPosition: position,\n resolvedDuration: effectiveDuration,\n resolvedPersistent: persistent,\n resolvedCloseable: closeable,\n resolvedAriaLive,\n resolvedRole,\n resolvedIcon: icon,\n resolvedTitle: title,\n resolvedDescription: description,\n resolvedCloseLabel: closeLabel,\n resolvedProgress: options.progress,\n resolvedShowProgress: options.showProgress ?? false,\n resolvedActions: options.actions,\n resolvedExpandable: options.expandable ?? false,\n resolvedDefaultExpanded: options.defaultExpanded ?? false,\n resolvedMaxCollapsedLines: options.maxCollapsedLines ?? 2,\n resolvedExpandLabel:\n resolveText(options.expandLabel, options.expandLabelKey, '') ?? '',\n resolvedCollapseLabel:\n resolveText(options.collapseLabel, options.collapseLabelKey, '') ?? '',\n resolvedShowCountdown: showCountdown,\n resolvedShowCountdownText: showCountdownText,\n resolvedCountdownMode: countdownMode,\n resolvedActionsAlign: options.actionsAlign ?? cfg.actionsAlign ?? 'end',\n resolvedIconSize: options.iconSize ?? cfg.iconSize ?? 'md',\n resolvedMediaShape: options.mediaShape ?? cfg.mediaShape ?? 'circle',\n };\n }\n\n private resolveAppearances(): SolarisToastAppearance {\n return this._configSignal().appearance ?? 'surface';\n }\n\n private addEntry(options: SolarisToastOptions): SolarisToastEntry {\n const entry = this.resolveEntry(options);\n const cfg = this._configSignal();\n\n this.entriesSignal.update((current) => {\n let next = [...current, entry];\n const limit = cfg.limit ?? 5;\n if (next.length > limit) {\n const removeCount = next.length - limit;\n next = next.slice(removeCount);\n }\n if (cfg.newestOnTop !== false) {\n next = [...next].sort((a, b) => b.createdAt - a.createdAt);\n }\n return next;\n });\n\n this.getContainer(entry.resolvedPosition);\n\n return entry;\n }\n\n private removeEntry(id: string): void {\n this.entriesSignal.update((current) => current.filter((e) => e.id !== id));\n }\n\n private updateEntry(id: string, patch: Partial<SolarisToastOptions>): void {\n this.entriesSignal.update((current) =>\n current.map((e) => {\n if (e.id !== id) return e;\n const merged: SolarisToastOptions = { ...e.options, ...patch };\n return this.resolveEntry(merged, id);\n }),\n );\n }\n\n private createRef(entry: SolarisToastEntry): SolarisToastRef {\n return {\n id: entry.id,\n dismiss: () => this.dismiss(entry.id),\n update: (patch: Partial<SolarisToastOptions>) =>\n this.update(entry.id, patch),\n };\n }\n\n show(options: SolarisToastOptions): SolarisToastRef {\n const entry = this.addEntry(options);\n return this.createRef(entry);\n }\n\n neutral(options: SolarisToastOptions): SolarisToastRef {\n return this.show({ ...options, variant: 'neutral' });\n }\n\n info(options: SolarisToastOptions): SolarisToastRef {\n return this.show({ ...options, variant: 'info' });\n }\n\n success(options: SolarisToastOptions): SolarisToastRef {\n return this.show({ ...options, variant: 'success' });\n }\n\n warning(options: SolarisToastOptions): SolarisToastRef {\n return this.show({ ...options, variant: 'warning' });\n }\n\n danger(options: SolarisToastOptions): SolarisToastRef {\n return this.show({ ...options, variant: 'danger' });\n }\n\n loading(options: SolarisToastOptions): SolarisToastRef {\n return this.show({ ...options, variant: 'loading' });\n }\n\n dismiss(id: string): void {\n this.removeEntry(id);\n }\n\n dismissAll(): void {\n this.entriesSignal.set([]);\n }\n\n updateConfig(patch: Partial<SolarisToastConfig>): void {\n this._configSignal.update((current) => ({ ...current, ...patch }));\n }\n\n update(id: string, patch: Partial<SolarisToastOptions>): void {\n this.updateEntry(id, patch);\n }\n\n private static readonly toastVariant: SolarisToastVariant | undefined;\n}\n\nfunction resolveAriaLive(\n variant: SolarisToastVariant,\n override?: 'polite' | 'assertive' | 'off',\n): 'polite' | 'assertive' | 'off' {\n if (override) return override;\n if (variant === 'warning' || variant === 'danger') return 'assertive';\n return 'polite';\n}\n\nfunction resolveRole(\n variant: SolarisToastVariant,\n override?: 'status' | 'alert',\n): 'status' | 'alert' {\n if (override) return override;\n if (variant === 'warning' || variant === 'danger') return 'alert';\n return 'status';\n}\n\nfunction resolveDefaultIcon(variant: SolarisToastVariant): string {\n switch (variant) {\n case 'neutral':\n return 'info';\n case 'info':\n return 'info';\n case 'success':\n return 'success';\n case 'warning':\n return 'warning';\n case 'danger':\n return 'danger';\n case 'loading':\n return 'loader';\n case 'custom':\n return 'info';\n }\n}\n\nfunction resolveText(\n text: string | undefined,\n key: string | undefined,\n defaultText: string | undefined,\n): string | undefined {\n if (text) return text;\n if (key) return key;\n return defaultText;\n}\n\nfunction resolveCloseLabel(\n label: string | undefined,\n key: string | undefined,\n): string {\n if (label) return label;\n if (key) return key;\n return 'Fechar';\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
export const SOLARIS_TOAST_CONFIG = new InjectionToken('SolarisToastConfig');
|
|
3
|
+
export const SOLARIS_TOAST_DEFAULT_CONFIG = {
|
|
4
|
+
position: 'bottom-center',
|
|
5
|
+
appearance: 'surface',
|
|
6
|
+
duration: 5000,
|
|
7
|
+
limit: 5,
|
|
8
|
+
pauseOnHover: true,
|
|
9
|
+
pauseOnFocus: true,
|
|
10
|
+
newestOnTop: true,
|
|
11
|
+
};
|
|
12
|
+
export const SOLARIS_TOAST_CONTAINER = new InjectionToken('SolarisToastContainer');
|
|
13
|
+
//# sourceMappingURL=toast.tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.tokens.js","sourceRoot":"","sources":["../../../../../../../../../packages/angular/src/lib/components/feedback/toast/token/toast.tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,cAAc,CACpD,oBAAoB,CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAuB;IAC9D,QAAQ,EAAE,eAAe;IACzB,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,CAAC;IACR,YAAY,EAAE,IAAI;IAClB,YAAY,EAAE,IAAI;IAClB,WAAW,EAAE,IAAI;CAClB,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,cAAc,CACvD,uBAAuB,CACxB,CAAC","sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { SolarisToastConfig } from '../model/toast.types';\n\nexport const SOLARIS_TOAST_CONFIG = new InjectionToken<SolarisToastConfig>(\n 'SolarisToastConfig',\n);\n\nexport const SOLARIS_TOAST_DEFAULT_CONFIG: SolarisToastConfig = {\n position: 'bottom-center',\n appearance: 'surface',\n duration: 5000,\n limit: 5,\n pauseOnHover: true,\n pauseOnFocus: true,\n newestOnTop: true,\n};\n\nexport const SOLARIS_TOAST_CONTAINER = new InjectionToken<boolean>(\n 'SolarisToastContainer',\n);\n"]}
|
|
@@ -41,6 +41,7 @@ export class SolarisEmailFieldComponent {
|
|
|
41
41
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
42
42
|
radius = input('md', ...(ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []));
|
|
43
43
|
appearance = input('outline', ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
|
|
44
|
+
maxLength = input(...(ngDevMode ? [undefined, { debugName: "maxLength" }] : /* istanbul ignore next */ []));
|
|
44
45
|
validateDomain = input(false, { ...(ngDevMode ? { debugName: "validateDomain" } : /* istanbul ignore next */ {}), transform: (v) => v });
|
|
45
46
|
internalValue = signal('', ...(ngDevMode ? [{ debugName: "internalValue" }] : /* istanbul ignore next */ []));
|
|
46
47
|
internalDisabled = signal(false, ...(ngDevMode ? [{ debugName: "internalDisabled" }] : /* istanbul ignore next */ []));
|
|
@@ -190,13 +191,13 @@ export class SolarisEmailFieldComponent {
|
|
|
190
191
|
return undefined;
|
|
191
192
|
}
|
|
192
193
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisEmailFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
193
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: SolarisEmailFieldComponent, isStandalone: true, selector: "solaris-email-field", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, hintKey: { classPropertyName: "hintKey", publicName: "hintKey", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, labelKey: { classPropertyName: "labelKey", publicName: "labelKey", isSignal: true, isRequired: false, transformFunction: null }, errorKey: { classPropertyName: "errorKey", publicName: "errorKey", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, invalidError: { classPropertyName: "invalidError", publicName: "invalidError", isSignal: true, isRequired: false, transformFunction: null }, requiredError: { classPropertyName: "requiredError", publicName: "requiredError", isSignal: true, isRequired: false, transformFunction: null }, placeholderKey: { classPropertyName: "placeholderKey", publicName: "placeholderKey", isSignal: true, isRequired: false, transformFunction: null }, invalidErrorKey: { classPropertyName: "invalidErrorKey", publicName: "invalidErrorKey", isSignal: true, isRequired: false, transformFunction: null }, requiredErrorKey: { classPropertyName: "requiredErrorKey", publicName: "requiredErrorKey", isSignal: true, isRequired: false, transformFunction: null }, allowedDomainError: { classPropertyName: "allowedDomainError", publicName: "allowedDomainError", isSignal: true, isRequired: false, transformFunction: null }, blockedDomainError: { classPropertyName: "blockedDomainError", publicName: "blockedDomainError", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, trimOnBlur: { classPropertyName: "trimOnBlur", publicName: "trimOnBlur", isSignal: true, isRequired: false, transformFunction: null }, allowedDomainErrorKey: { classPropertyName: "allowedDomainErrorKey", publicName: "allowedDomainErrorKey", isSignal: true, isRequired: false, transformFunction: null }, blockedDomainErrorKey: { classPropertyName: "blockedDomainErrorKey", publicName: "blockedDomainErrorKey", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, normalizeLowercase: { classPropertyName: "normalizeLowercase", publicName: "normalizeLowercase", isSignal: true, isRequired: false, transformFunction: null }, allowedDomains: { classPropertyName: "allowedDomains", publicName: "allowedDomains", isSignal: true, isRequired: false, transformFunction: null }, blockedDomains: { classPropertyName: "blockedDomains", publicName: "blockedDomains", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, validateDomain: { classPropertyName: "validateDomain", publicName: "validateDomain", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
194
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.17", type: SolarisEmailFieldComponent, isStandalone: true, selector: "solaris-email-field", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, hintKey: { classPropertyName: "hintKey", publicName: "hintKey", isSignal: true, isRequired: false, transformFunction: null }, hint: { classPropertyName: "hint", publicName: "hint", isSignal: true, isRequired: false, transformFunction: null }, labelKey: { classPropertyName: "labelKey", publicName: "labelKey", isSignal: true, isRequired: false, transformFunction: null }, errorKey: { classPropertyName: "errorKey", publicName: "errorKey", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, error: { classPropertyName: "error", publicName: "error", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, invalidError: { classPropertyName: "invalidError", publicName: "invalidError", isSignal: true, isRequired: false, transformFunction: null }, requiredError: { classPropertyName: "requiredError", publicName: "requiredError", isSignal: true, isRequired: false, transformFunction: null }, placeholderKey: { classPropertyName: "placeholderKey", publicName: "placeholderKey", isSignal: true, isRequired: false, transformFunction: null }, invalidErrorKey: { classPropertyName: "invalidErrorKey", publicName: "invalidErrorKey", isSignal: true, isRequired: false, transformFunction: null }, requiredErrorKey: { classPropertyName: "requiredErrorKey", publicName: "requiredErrorKey", isSignal: true, isRequired: false, transformFunction: null }, allowedDomainError: { classPropertyName: "allowedDomainError", publicName: "allowedDomainError", isSignal: true, isRequired: false, transformFunction: null }, blockedDomainError: { classPropertyName: "blockedDomainError", publicName: "blockedDomainError", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, optional: { classPropertyName: "optional", publicName: "optional", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, trimOnBlur: { classPropertyName: "trimOnBlur", publicName: "trimOnBlur", isSignal: true, isRequired: false, transformFunction: null }, allowedDomainErrorKey: { classPropertyName: "allowedDomainErrorKey", publicName: "allowedDomainErrorKey", isSignal: true, isRequired: false, transformFunction: null }, blockedDomainErrorKey: { classPropertyName: "blockedDomainErrorKey", publicName: "blockedDomainErrorKey", isSignal: true, isRequired: false, transformFunction: null }, autocomplete: { classPropertyName: "autocomplete", publicName: "autocomplete", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, normalizeLowercase: { classPropertyName: "normalizeLowercase", publicName: "normalizeLowercase", isSignal: true, isRequired: false, transformFunction: null }, allowedDomains: { classPropertyName: "allowedDomains", publicName: "allowedDomains", isSignal: true, isRequired: false, transformFunction: null }, blockedDomains: { classPropertyName: "blockedDomains", publicName: "blockedDomains", isSignal: true, isRequired: false, transformFunction: null }, density: { classPropertyName: "density", publicName: "density", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, radius: { classPropertyName: "radius", publicName: "radius", isSignal: true, isRequired: false, transformFunction: null }, appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, validateDomain: { classPropertyName: "validateDomain", publicName: "validateDomain", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
194
195
|
{
|
|
195
196
|
provide: NG_VALUE_ACCESSOR,
|
|
196
197
|
useExisting: forwardRef(() => SolarisEmailFieldComponent),
|
|
197
198
|
multi: true,
|
|
198
199
|
},
|
|
199
|
-
], viewQueries: [{ propertyName: "inputElementRef", first: true, predicate: ["inputElement"], descendants: true, read: ElementRef }], ngImport: i0, template: "<solaris-form-field\n [label]=\"label()\"\n [labelKey]=\"labelKey()\"\n [hint]=\"hint()\"\n [hintKey]=\"hintKey()\"\n [error]=\"error() || computedError()\"\n [errorKey]=\"errorKey()\"\n [invalid]=\"isFieldInvalid()\"\n [required]=\"required()\"\n [optional]=\"optional()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"readonly()\"\n [appearance]=\"appearance()\"\n [size]=\"size()\"\n [density]=\"density()\"\n [radius]=\"radius()\"\n>\n <input\n #inputElement\n solaris-input\n type=\"email\"\n [value]=\"internalValue()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"readonly()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.inputmode]=\"'email'\"\n [attr.autocapitalize]=\"'none'\"\n [attr.spellcheck]=\"'false'\"\n [attr.name]=\"name() ?? null\"\n [attr.id]=\"id() ?? null\"\n [attr.placeholder]=\"placeholderText() || null\"\n (input)=\"onInput($event)\"\n (focus)=\"onInputFocus()\"\n (blur)=\"onInputBlur()\"\n />\n</solaris-form-field>\n", styles: [":host{display:block;box-sizing:border-box}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: SolarisFormFieldComponent, selector: "solaris-form-field", inputs: ["hintKey", "labelKey", "hint", "errorKey", "label", "error", "optionalLabel", "requiredLabel", "optionalLabelKey", "requiredLabelKey", "required", "optional", "invalid", "disabled", "readonly", "density", "size", "radius", "appearance", "control"] }, { kind: "directive", type: SolarisInputDirective, selector: "[solaris-input]", inputs: ["appearance", "radius", "size", "density", "invalid", "fullWidth"] }] });
|
|
200
|
+
], viewQueries: [{ propertyName: "inputElementRef", first: true, predicate: ["inputElement"], descendants: true, read: ElementRef }], ngImport: i0, template: "<solaris-form-field\n [label]=\"label()\"\n [labelKey]=\"labelKey()\"\n [hint]=\"hint()\"\n [hintKey]=\"hintKey()\"\n [error]=\"error() || computedError()\"\n [errorKey]=\"errorKey()\"\n [invalid]=\"isFieldInvalid()\"\n [required]=\"required()\"\n [optional]=\"optional()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"readonly()\"\n [appearance]=\"appearance()\"\n [size]=\"size()\"\n [density]=\"density()\"\n [radius]=\"radius()\"\n>\n <input\n #inputElement\n solaris-input\n type=\"email\"\n [value]=\"internalValue()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"readonly()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.inputmode]=\"'email'\"\n [attr.autocapitalize]=\"'none'\"\n [attr.spellcheck]=\"'false'\"\n [attr.name]=\"name() ?? null\"\n [attr.id]=\"id() ?? null\"\n [attr.placeholder]=\"placeholderText() || null\"\n [attr.maxlength]=\"maxLength() ?? null\"\n (input)=\"onInput($event)\"\n (focus)=\"onInputFocus()\"\n (blur)=\"onInputBlur()\"\n />\n</solaris-form-field>\n", styles: [":host{display:block;box-sizing:border-box}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: SolarisFormFieldComponent, selector: "solaris-form-field", inputs: ["hintKey", "labelKey", "hint", "errorKey", "label", "error", "optionalLabel", "requiredLabel", "optionalLabelKey", "requiredLabelKey", "required", "optional", "invalid", "disabled", "readonly", "density", "size", "radius", "appearance", "control"] }, { kind: "directive", type: SolarisInputDirective, selector: "[solaris-input]", inputs: ["appearance", "radius", "size", "density", "invalid", "fullWidth"] }] });
|
|
200
201
|
}
|
|
201
202
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisEmailFieldComponent, decorators: [{
|
|
202
203
|
type: Component,
|
|
@@ -206,9 +207,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
|
|
|
206
207
|
useExisting: forwardRef(() => SolarisEmailFieldComponent),
|
|
207
208
|
multi: true,
|
|
208
209
|
},
|
|
209
|
-
], template: "<solaris-form-field\n [label]=\"label()\"\n [labelKey]=\"labelKey()\"\n [hint]=\"hint()\"\n [hintKey]=\"hintKey()\"\n [error]=\"error() || computedError()\"\n [errorKey]=\"errorKey()\"\n [invalid]=\"isFieldInvalid()\"\n [required]=\"required()\"\n [optional]=\"optional()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"readonly()\"\n [appearance]=\"appearance()\"\n [size]=\"size()\"\n [density]=\"density()\"\n [radius]=\"radius()\"\n>\n <input\n #inputElement\n solaris-input\n type=\"email\"\n [value]=\"internalValue()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"readonly()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.inputmode]=\"'email'\"\n [attr.autocapitalize]=\"'none'\"\n [attr.spellcheck]=\"'false'\"\n [attr.name]=\"name() ?? null\"\n [attr.id]=\"id() ?? null\"\n [attr.placeholder]=\"placeholderText() || null\"\n (input)=\"onInput($event)\"\n (focus)=\"onInputFocus()\"\n (blur)=\"onInputBlur()\"\n />\n</solaris-form-field>\n", styles: [":host{display:block;box-sizing:border-box}\n"] }]
|
|
210
|
+
], template: "<solaris-form-field\n [label]=\"label()\"\n [labelKey]=\"labelKey()\"\n [hint]=\"hint()\"\n [hintKey]=\"hintKey()\"\n [error]=\"error() || computedError()\"\n [errorKey]=\"errorKey()\"\n [invalid]=\"isFieldInvalid()\"\n [required]=\"required()\"\n [optional]=\"optional()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"readonly()\"\n [appearance]=\"appearance()\"\n [size]=\"size()\"\n [density]=\"density()\"\n [radius]=\"radius()\"\n>\n <input\n #inputElement\n solaris-input\n type=\"email\"\n [value]=\"internalValue()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"readonly()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.inputmode]=\"'email'\"\n [attr.autocapitalize]=\"'none'\"\n [attr.spellcheck]=\"'false'\"\n [attr.name]=\"name() ?? null\"\n [attr.id]=\"id() ?? null\"\n [attr.placeholder]=\"placeholderText() || null\"\n [attr.maxlength]=\"maxLength() ?? null\"\n (input)=\"onInput($event)\"\n (focus)=\"onInputFocus()\"\n (blur)=\"onInputBlur()\"\n />\n</solaris-form-field>\n", styles: [":host{display:block;box-sizing:border-box}\n"] }]
|
|
210
211
|
}], propDecorators: { inputElementRef: [{
|
|
211
212
|
type: ViewChild,
|
|
212
213
|
args: ['inputElement', { read: ElementRef }]
|
|
213
|
-
}], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], hintKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintKey", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], labelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelKey", required: false }] }], errorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorKey", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], invalidError: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidError", required: false }] }], requiredError: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredError", required: false }] }], placeholderKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholderKey", required: false }] }], invalidErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidErrorKey", required: false }] }], requiredErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredErrorKey", required: false }] }], allowedDomainError: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedDomainError", required: false }] }], blockedDomainError: [{ type: i0.Input, args: [{ isSignal: true, alias: "blockedDomainError", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], trimOnBlur: [{ type: i0.Input, args: [{ isSignal: true, alias: "trimOnBlur", required: false }] }], allowedDomainErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedDomainErrorKey", required: false }] }], blockedDomainErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "blockedDomainErrorKey", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], normalizeLowercase: [{ type: i0.Input, args: [{ isSignal: true, alias: "normalizeLowercase", required: false }] }], allowedDomains: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedDomains", required: false }] }], blockedDomains: [{ type: i0.Input, args: [{ isSignal: true, alias: "blockedDomains", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], validateDomain: [{ type: i0.Input, args: [{ isSignal: true, alias: "validateDomain", required: false }] }] } });
|
|
214
|
+
}], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], hintKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "hintKey", required: false }] }], hint: [{ type: i0.Input, args: [{ isSignal: true, alias: "hint", required: false }] }], labelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelKey", required: false }] }], errorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "errorKey", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], error: [{ type: i0.Input, args: [{ isSignal: true, alias: "error", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], invalidError: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidError", required: false }] }], requiredError: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredError", required: false }] }], placeholderKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholderKey", required: false }] }], invalidErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalidErrorKey", required: false }] }], requiredErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "requiredErrorKey", required: false }] }], allowedDomainError: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedDomainError", required: false }] }], blockedDomainError: [{ type: i0.Input, args: [{ isSignal: true, alias: "blockedDomainError", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], optional: [{ type: i0.Input, args: [{ isSignal: true, alias: "optional", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], trimOnBlur: [{ type: i0.Input, args: [{ isSignal: true, alias: "trimOnBlur", required: false }] }], allowedDomainErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedDomainErrorKey", required: false }] }], blockedDomainErrorKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "blockedDomainErrorKey", required: false }] }], autocomplete: [{ type: i0.Input, args: [{ isSignal: true, alias: "autocomplete", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], normalizeLowercase: [{ type: i0.Input, args: [{ isSignal: true, alias: "normalizeLowercase", required: false }] }], allowedDomains: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowedDomains", required: false }] }], blockedDomains: [{ type: i0.Input, args: [{ isSignal: true, alias: "blockedDomains", required: false }] }], density: [{ type: i0.Input, args: [{ isSignal: true, alias: "density", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], radius: [{ type: i0.Input, args: [{ isSignal: true, alias: "radius", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], maxLength: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxLength", required: false }] }], validateDomain: [{ type: i0.Input, args: [{ isSignal: true, alias: "validateDomain", required: false }] }] } });
|
|
214
215
|
//# sourceMappingURL=email-field.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"email-field.component.js","sourceRoot":"","sources":["../../../../../../../../../packages/angular/src/lib/components/forms/email-field/component/email-field.component.ts","../../../../../../../../../packages/angular/src/lib/components/forms/email-field/component/email-field.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,UAAU,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EAEjB,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAQxB,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;;AAgBpD,MAAM,OAAO,0BAA0B;IACpB,gBAAgB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAC;IAG1D,eAAe,CAAgC;IAEhD,EAAE,GAAG,KAAK,mFAAU,CAAC;IACrB,IAAI,GAAG,KAAK,qFAAU,CAAC;IACvB,OAAO,GAAG,KAAK,wFAAU,CAAC;IAC1B,IAAI,GAAG,KAAK,CAAS,EAAE,2EAAC,CAAC;IACzB,QAAQ,GAAG,KAAK,yFAAU,CAAC;IAC3B,QAAQ,GAAG,KAAK,yFAAU,CAAC;IAC3B,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC,CAAC;IAC1B,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC,CAAC;IAC1B,KAAK,GAAG,KAAK,CAAS,EAAE,4EAAC,CAAC;IAC1B,WAAW,GAAG,KA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BAA0B,ymJAV1B;YACT;gBACE,OAAO,EAAE,iBAAiB;gBAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC;gBACzD,KAAK,EAAE,IAAI;aACZ;SACF,sHAOkC,UAAU,6BCnD/C,+gCAoCA,qGDCY,WAAW,+BAAE,yBAAyB,iUAAE,qBAAqB;;4FAW5D,0BAA0B;kBAdtC,SAAS;+BACE,qBAAqB,cACnB,IAAI,WACP,CAAC,WAAW,EAAE,yBAAyB,EAAE,qBAAqB,CAAC,aAC7D;wBACT;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,2BAA2B,CAAC;4BACzD,KAAK,EAAE,IAAI;yBACZ;qBACF;;sBAOA,SAAS;uBAAC,cAAc,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE","sourcesContent":["import {\n Component,\n input,\n computed,\n signal,\n forwardRef,\n inject,\n ViewChild,\n ElementRef,\n isDevMode,\n} from '@angular/core';\nimport {\n NG_VALUE_ACCESSOR,\n ControlValueAccessor,\n FormsModule,\n} from '@angular/forms';\n\nimport type {\n SolarisEmailFieldAppearance,\n SolarisEmailFieldSize,\n SolarisEmailFieldDensity,\n SolarisEmailFieldRadius,\n} from '../model/email-field.types';\nimport {\n isValidEmailFormat,\n extractDomain,\n isDomainAllowed,\n isDomainBlocked,\n} from '../validators/email-field.validators';\nimport type { SolarisTranslateParams } from '../../../../services/translation';\nimport { SolarisTranslateService } from '../../../../services/translation';\nimport { SolarisFormFieldComponent } from '../../form-field';\nimport { SolarisInputDirective } from '../../input';\n\n@Component({\n selector: 'solaris-email-field',\n standalone: true,\n imports: [FormsModule, SolarisFormFieldComponent, SolarisInputDirective],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SolarisEmailFieldComponent),\n multi: true,\n },\n ],\n templateUrl: './email-field.component.html',\n styleUrls: ['./email-field.component.scss'],\n})\nexport class SolarisEmailFieldComponent implements ControlValueAccessor {\n private readonly translateService = inject(SolarisTranslateService);\n\n @ViewChild('inputElement', { read: ElementRef })\n protected inputElementRef?: ElementRef<HTMLInputElement>;\n\n readonly id = input<string>();\n readonly name = input<string>();\n readonly hintKey = input<string>();\n readonly hint = input<string>('');\n readonly labelKey = input<string>();\n readonly errorKey = input<string>();\n readonly value = input<string>('');\n readonly label = input<string>('');\n readonly error = input<string>('');\n readonly placeholder = input<string>();\n readonly invalidError = input<string>();\n readonly requiredError = input<string>();\n readonly placeholderKey = input<string>();\n readonly invalidErrorKey = input<string>();\n readonly requiredErrorKey = input<string>();\n readonly allowedDomainError = input<string>();\n readonly blockedDomainError = input<string>();\n readonly required = input<boolean>(false);\n readonly optional = input<boolean>(false);\n readonly disabled = input<boolean>(false);\n readonly readonly = input<boolean>(false);\n readonly trimOnBlur = input<boolean>(true);\n readonly allowedDomainErrorKey = input<string>();\n readonly blockedDomainErrorKey = input<string>();\n readonly autocomplete = input<string>('email');\n readonly invalid = input<boolean | undefined>();\n readonly normalizeLowercase = input<boolean>(false);\n readonly allowedDomains = input<string[] | undefined>();\n readonly blockedDomains = input<string[] | undefined>();\n readonly density = input<SolarisEmailFieldDensity>();\n readonly size = input<SolarisEmailFieldSize>('md');\n readonly radius = input<SolarisEmailFieldRadius>('md');\n readonly appearance = input<SolarisEmailFieldAppearance>('outline');\n readonly validateDomain = input<boolean, boolean>(false, {\n transform: (v: boolean) => v,\n });\n\n protected readonly internalValue = signal<string>('');\n protected readonly internalDisabled = signal(false);\n protected readonly internalFocused = signal(false);\n protected readonly touched = signal(false);\n protected readonly dirty = signal(false);\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onChange: (value: string) => void = () => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onTouched: () => void = () => {};\n\n protected readonly placeholderText = computed(() => {\n const key = this.placeholderKey();\n if (key) {\n return this.translateService.translate(key);\n }\n return this.placeholder() ?? '';\n });\n\n protected readonly isEffectivelyDisabled = computed(() => {\n return this.disabled() || this.internalDisabled();\n });\n\n protected readonly effectiveValidateDomain = computed(() => {\n const explicit = this.validateDomain();\n if (explicit) return true;\n const allowed = this.allowedDomains();\n const blocked = this.blockedDomains();\n if (allowed && allowed.length > 0) return true;\n return !!(blocked && blocked.length > 0);\n });\n\n protected readonly computedError = computed(() => {\n const manualError = this.error() || this.translateKey(this.errorKey());\n if (manualError) return manualError;\n\n const val = this.internalValue();\n const isTouchedOrDirty = this.touched() || this.dirty();\n if (!isTouchedOrDirty || this.internalFocused()) return '';\n\n if (!val || val.trim().length === 0) {\n if (this.required()) {\n return this.buildError(\n this.requiredError(),\n this.requiredErrorKey(),\n 'solaris.email-field.required',\n 'Email is required.',\n );\n }\n return '';\n }\n\n if (!isValidEmailFormat(val)) {\n return this.buildError(\n this.invalidError(),\n this.invalidErrorKey(),\n 'solaris.email-field.invalid',\n 'Enter a valid email address.',\n );\n }\n\n return this.computeDomainError(val) ?? '';\n });\n\n protected readonly isFieldInvalid = computed(() => {\n const manual = this.invalid();\n if (manual !== undefined) {\n return manual;\n }\n if (this.internalFocused()) {\n return false;\n }\n const isTouchedOrDirty = this.touched() || this.dirty();\n if (!isTouchedOrDirty) {\n return false;\n }\n return !!this.computedError();\n });\n\n writeValue(safe = ''): void {\n this.internalValue.set(safe);\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.internalDisabled.set(isDisabled);\n }\n\n protected onInput(event: Event): void {\n const target = event.target as HTMLInputElement;\n const newValue = target.value;\n\n if (!this.dirty()) {\n this.dirty.set(true);\n }\n\n this.internalValue.set(newValue);\n this.onChange(newValue);\n }\n\n protected onInputFocus(): void {\n this.internalFocused.set(true);\n }\n\n protected onInputBlur(): void {\n this.internalFocused.set(false);\n\n let currentValue = this.internalValue();\n\n if (this.trimOnBlur()) {\n currentValue = currentValue.trim();\n }\n\n if (this.normalizeLowercase()) {\n currentValue = currentValue.toLowerCase();\n }\n\n if (currentValue !== this.internalValue()) {\n this.internalValue.set(currentValue);\n this.onChange(currentValue);\n\n if (this.inputElementRef) {\n try {\n // SECURITY_EXCEPTION: nativeElement.value assignment is required to sync the input element with the normalized value after blur. Angular's data binding may not reflect synchronous value changes to the native input. Same approach is standard for CVA blur normalization.\n this.inputElementRef.nativeElement.value = currentValue;\n } catch {\n if (isDevMode()) {\n console.warn(\n '[SolarisEmailField] Could not update input value after normalization.',\n );\n }\n }\n }\n }\n\n if (!this.touched()) {\n this.touched.set(true);\n }\n\n this.onTouched();\n }\n\n private translateWithDefault(\n key: string,\n defaultText: string,\n params?: SolarisTranslateParams,\n ): string {\n const result = this.translateService.translate(key, params);\n return result !== key ? result : defaultText;\n }\n\n private translateKey(key: string | undefined): string | undefined {\n if (key) {\n const translated = this.translateService.translate(key);\n return translated !== key ? translated : undefined;\n }\n return undefined;\n }\n\n private buildError(\n direct: string | undefined,\n key: string | undefined,\n fallbackKey: string,\n fallbackDefault: string,\n ): string {\n return (\n direct ??\n this.translateKey(key) ??\n this.translateWithDefault(fallbackKey, fallbackDefault)\n );\n }\n\n private computeDomainError(val: string): string | undefined {\n if (!this.effectiveValidateDomain()) return undefined;\n const domain = extractDomain(val);\n if (!domain) return undefined;\n\n const allowed = this.allowedDomains();\n if (allowed && allowed.length > 0 && !isDomainAllowed(domain, allowed)) {\n return this.buildError(\n this.allowedDomainError(),\n this.allowedDomainErrorKey(),\n 'solaris.email-field.allowedDomain',\n 'Email domain is not allowed.',\n );\n }\n\n const blocked = this.blockedDomains();\n if (blocked && blocked.length > 0 && isDomainBlocked(domain, blocked)) {\n return this.buildError(\n this.blockedDomainError(),\n this.blockedDomainErrorKey(),\n 'solaris.email-field.blockedDomain',\n 'Email domain is not allowed.',\n );\n }\n\n return undefined;\n }\n}\n","<solaris-form-field\n [label]=\"label()\"\n [labelKey]=\"labelKey()\"\n [hint]=\"hint()\"\n [hintKey]=\"hintKey()\"\n [error]=\"error() || computedError()\"\n [errorKey]=\"errorKey()\"\n [invalid]=\"isFieldInvalid()\"\n [required]=\"required()\"\n [optional]=\"optional()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"readonly()\"\n [appearance]=\"appearance()\"\n [size]=\"size()\"\n [density]=\"density()\"\n [radius]=\"radius()\"\n>\n <input\n #inputElement\n solaris-input\n type=\"email\"\n [value]=\"internalValue()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"readonly()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.inputmode]=\"'email'\"\n [attr.autocapitalize]=\"'none'\"\n [attr.spellcheck]=\"'false'\"\n [attr.name]=\"name() ?? null\"\n [attr.id]=\"id() ?? null\"\n [attr.placeholder]=\"placeholderText() || null\"\n (input)=\"onInput($event)\"\n (focus)=\"onInputFocus()\"\n (blur)=\"onInputBlur()\"\n />\n</solaris-form-field>\n"]}
|
|
1
|
+
{"version":3,"file":"email-field.component.js","sourceRoot":"","sources":["../../../../../../../../../packages/angular/src/lib/components/forms/email-field/component/email-field.component.ts","../../../../../../../../../packages/angular/src/lib/components/forms/email-field/component/email-field.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,KAAK,EACL,QAAQ,EACR,MAAM,EACN,UAAU,EACV,MAAM,EACN,SAAS,EACT,UAAU,EACV,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,iBAAiB,EAEjB,WAAW,GACZ,MAAM,gBAAgB,CAAC;AAQxB,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,eAAe,GAChB,MAAM,sCAAsC,CAAC;AAE9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;;AAgBpD,MAAM,OAAO,0BAA0B;IACpB,gBAAgB,GAA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AI,CAAC,UAAU,CACpB,IAAI,CAAC,kBAAkB,EAAE,EACzB,IAAI,CAAC,qBAAqB,EAAE,EAC5B,mCAAmC,EACnC,8BAA8B,CAC/B,CAAC;QACJ,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QACtC,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,eAAe,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;YACtE,OAAO,IAAI,CAAC,UAAU,CACpB,IAAI,CAAC,kBAAkB,EAAE,EACzB,IAAI,CAAC,qBAAqB,EAAE,EAC5B,mCAAmC,EACnC,8BAA8B,CAC/B,CAAC;QACJ,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;wGAzPU,0BAA0B;4FAA1B,0BAA0B,6uJAV1B;YACT;gBACE,OAAO,EAAE,iBAAiB;gBAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC;gBACzD,KAAK,EAAE,IAAI;aACZ;SACF,sHAOkC,UAAU,6BCnD/C,6jCAqCA,qGDAY,WAAW,+BAAE,yBAAyB,iUAAE,qBAAqB;;4FAW5D,0BAA0B;kBAdtC,SAAS;+BACE,qBAAqB,cACnB,IAAI,WACP,CAAC,WAAW,EAAE,yBAAyB,EAAE,qBAAqB,CAAC,aAC7D;wBACT;4BACE,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,2BAA2B,CAAC;4BACzD,KAAK,EAAE,IAAI;yBACZ;qBACF;;sBAOA,SAAS;uBAAC,cAAc,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE","sourcesContent":["import {\n Component,\n input,\n computed,\n signal,\n forwardRef,\n inject,\n ViewChild,\n ElementRef,\n isDevMode,\n} from '@angular/core';\nimport {\n NG_VALUE_ACCESSOR,\n ControlValueAccessor,\n FormsModule,\n} from '@angular/forms';\n\nimport type {\n SolarisEmailFieldAppearance,\n SolarisEmailFieldSize,\n SolarisEmailFieldDensity,\n SolarisEmailFieldRadius,\n} from '../model/email-field.types';\nimport {\n isValidEmailFormat,\n extractDomain,\n isDomainAllowed,\n isDomainBlocked,\n} from '../validators/email-field.validators';\nimport type { SolarisTranslateParams } from '../../../../services/translation';\nimport { SolarisTranslateService } from '../../../../services/translation';\nimport { SolarisFormFieldComponent } from '../../form-field';\nimport { SolarisInputDirective } from '../../input';\n\n@Component({\n selector: 'solaris-email-field',\n standalone: true,\n imports: [FormsModule, SolarisFormFieldComponent, SolarisInputDirective],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SolarisEmailFieldComponent),\n multi: true,\n },\n ],\n templateUrl: './email-field.component.html',\n styleUrls: ['./email-field.component.scss'],\n})\nexport class SolarisEmailFieldComponent implements ControlValueAccessor {\n private readonly translateService = inject(SolarisTranslateService);\n\n @ViewChild('inputElement', { read: ElementRef })\n protected inputElementRef?: ElementRef<HTMLInputElement>;\n\n readonly id = input<string>();\n readonly name = input<string>();\n readonly hintKey = input<string>();\n readonly hint = input<string>('');\n readonly labelKey = input<string>();\n readonly errorKey = input<string>();\n readonly value = input<string>('');\n readonly label = input<string>('');\n readonly error = input<string>('');\n readonly placeholder = input<string>();\n readonly invalidError = input<string>();\n readonly requiredError = input<string>();\n readonly placeholderKey = input<string>();\n readonly invalidErrorKey = input<string>();\n readonly requiredErrorKey = input<string>();\n readonly allowedDomainError = input<string>();\n readonly blockedDomainError = input<string>();\n readonly required = input<boolean>(false);\n readonly optional = input<boolean>(false);\n readonly disabled = input<boolean>(false);\n readonly readonly = input<boolean>(false);\n readonly trimOnBlur = input<boolean>(true);\n readonly allowedDomainErrorKey = input<string>();\n readonly blockedDomainErrorKey = input<string>();\n readonly autocomplete = input<string>('email');\n readonly invalid = input<boolean | undefined>();\n readonly normalizeLowercase = input<boolean>(false);\n readonly allowedDomains = input<string[] | undefined>();\n readonly blockedDomains = input<string[] | undefined>();\n readonly density = input<SolarisEmailFieldDensity>();\n readonly size = input<SolarisEmailFieldSize>('md');\n readonly radius = input<SolarisEmailFieldRadius>('md');\n readonly appearance = input<SolarisEmailFieldAppearance>('outline');\n readonly maxLength = input<number | undefined>();\n readonly validateDomain = input<boolean, boolean>(false, {\n transform: (v: boolean) => v,\n });\n\n protected readonly internalValue = signal<string>('');\n protected readonly internalDisabled = signal(false);\n protected readonly internalFocused = signal(false);\n protected readonly touched = signal(false);\n protected readonly dirty = signal(false);\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onChange: (value: string) => void = () => {};\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onTouched: () => void = () => {};\n\n protected readonly placeholderText = computed(() => {\n const key = this.placeholderKey();\n if (key) {\n return this.translateService.translate(key);\n }\n return this.placeholder() ?? '';\n });\n\n protected readonly isEffectivelyDisabled = computed(() => {\n return this.disabled() || this.internalDisabled();\n });\n\n protected readonly effectiveValidateDomain = computed(() => {\n const explicit = this.validateDomain();\n if (explicit) return true;\n const allowed = this.allowedDomains();\n const blocked = this.blockedDomains();\n if (allowed && allowed.length > 0) return true;\n return !!(blocked && blocked.length > 0);\n });\n\n protected readonly computedError = computed(() => {\n const manualError = this.error() || this.translateKey(this.errorKey());\n if (manualError) return manualError;\n\n const val = this.internalValue();\n const isTouchedOrDirty = this.touched() || this.dirty();\n if (!isTouchedOrDirty || this.internalFocused()) return '';\n\n if (!val || val.trim().length === 0) {\n if (this.required()) {\n return this.buildError(\n this.requiredError(),\n this.requiredErrorKey(),\n 'solaris.email-field.required',\n 'Email is required.',\n );\n }\n return '';\n }\n\n if (!isValidEmailFormat(val)) {\n return this.buildError(\n this.invalidError(),\n this.invalidErrorKey(),\n 'solaris.email-field.invalid',\n 'Enter a valid email address.',\n );\n }\n\n return this.computeDomainError(val) ?? '';\n });\n\n protected readonly isFieldInvalid = computed(() => {\n const manual = this.invalid();\n if (manual !== undefined) {\n return manual;\n }\n if (this.internalFocused()) {\n return false;\n }\n const isTouchedOrDirty = this.touched() || this.dirty();\n if (!isTouchedOrDirty) {\n return false;\n }\n return !!this.computedError();\n });\n\n writeValue(safe = ''): void {\n this.internalValue.set(safe);\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.internalDisabled.set(isDisabled);\n }\n\n protected onInput(event: Event): void {\n const target = event.target as HTMLInputElement;\n const newValue = target.value;\n\n if (!this.dirty()) {\n this.dirty.set(true);\n }\n\n this.internalValue.set(newValue);\n this.onChange(newValue);\n }\n\n protected onInputFocus(): void {\n this.internalFocused.set(true);\n }\n\n protected onInputBlur(): void {\n this.internalFocused.set(false);\n\n let currentValue = this.internalValue();\n\n if (this.trimOnBlur()) {\n currentValue = currentValue.trim();\n }\n\n if (this.normalizeLowercase()) {\n currentValue = currentValue.toLowerCase();\n }\n\n if (currentValue !== this.internalValue()) {\n this.internalValue.set(currentValue);\n this.onChange(currentValue);\n\n if (this.inputElementRef) {\n try {\n // SECURITY_EXCEPTION: nativeElement.value assignment is required to sync the input element with the normalized value after blur. Angular's data binding may not reflect synchronous value changes to the native input. Same approach is standard for CVA blur normalization.\n this.inputElementRef.nativeElement.value = currentValue;\n } catch {\n if (isDevMode()) {\n console.warn(\n '[SolarisEmailField] Could not update input value after normalization.',\n );\n }\n }\n }\n }\n\n if (!this.touched()) {\n this.touched.set(true);\n }\n\n this.onTouched();\n }\n\n private translateWithDefault(\n key: string,\n defaultText: string,\n params?: SolarisTranslateParams,\n ): string {\n const result = this.translateService.translate(key, params);\n return result !== key ? result : defaultText;\n }\n\n private translateKey(key: string | undefined): string | undefined {\n if (key) {\n const translated = this.translateService.translate(key);\n return translated !== key ? translated : undefined;\n }\n return undefined;\n }\n\n private buildError(\n direct: string | undefined,\n key: string | undefined,\n fallbackKey: string,\n fallbackDefault: string,\n ): string {\n return (\n direct ??\n this.translateKey(key) ??\n this.translateWithDefault(fallbackKey, fallbackDefault)\n );\n }\n\n private computeDomainError(val: string): string | undefined {\n if (!this.effectiveValidateDomain()) return undefined;\n const domain = extractDomain(val);\n if (!domain) return undefined;\n\n const allowed = this.allowedDomains();\n if (allowed && allowed.length > 0 && !isDomainAllowed(domain, allowed)) {\n return this.buildError(\n this.allowedDomainError(),\n this.allowedDomainErrorKey(),\n 'solaris.email-field.allowedDomain',\n 'Email domain is not allowed.',\n );\n }\n\n const blocked = this.blockedDomains();\n if (blocked && blocked.length > 0 && isDomainBlocked(domain, blocked)) {\n return this.buildError(\n this.blockedDomainError(),\n this.blockedDomainErrorKey(),\n 'solaris.email-field.blockedDomain',\n 'Email domain is not allowed.',\n );\n }\n\n return undefined;\n }\n}\n","<solaris-form-field\n [label]=\"label()\"\n [labelKey]=\"labelKey()\"\n [hint]=\"hint()\"\n [hintKey]=\"hintKey()\"\n [error]=\"error() || computedError()\"\n [errorKey]=\"errorKey()\"\n [invalid]=\"isFieldInvalid()\"\n [required]=\"required()\"\n [optional]=\"optional()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"readonly()\"\n [appearance]=\"appearance()\"\n [size]=\"size()\"\n [density]=\"density()\"\n [radius]=\"radius()\"\n>\n <input\n #inputElement\n solaris-input\n type=\"email\"\n [value]=\"internalValue()\"\n [disabled]=\"isEffectivelyDisabled()\"\n [readonly]=\"readonly()\"\n [attr.autocomplete]=\"autocomplete()\"\n [attr.inputmode]=\"'email'\"\n [attr.autocapitalize]=\"'none'\"\n [attr.spellcheck]=\"'false'\"\n [attr.name]=\"name() ?? null\"\n [attr.id]=\"id() ?? null\"\n [attr.placeholder]=\"placeholderText() || null\"\n [attr.maxlength]=\"maxLength() ?? null\"\n (input)=\"onInput($event)\"\n (focus)=\"onInputFocus()\"\n (blur)=\"onInputBlur()\"\n />\n</solaris-form-field>\n"]}
|