@4sh/ui-kit 0.1.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/LICENSE +201 -0
- package/NOTICE +7 -0
- package/README.md +229 -0
- package/fesm2022/4sh-ui-kit-forms.mjs +501 -0
- package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-motion.mjs +155 -0
- package/fesm2022/4sh-ui-kit-motion.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-overlay.mjs +61 -0
- package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-theming.mjs +120 -0
- package/fesm2022/4sh-ui-kit-theming.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-types.mjs +12 -0
- package/fesm2022/4sh-ui-kit-types.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-accordion.mjs +244 -0
- package/fesm2022/4sh-ui-kit-ui-accordion.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-alert.mjs +160 -0
- package/fesm2022/4sh-ui-kit-ui-alert.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-autocomplete.mjs +926 -0
- package/fesm2022/4sh-ui-kit-ui-autocomplete.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-avatar-group.mjs +34 -0
- package/fesm2022/4sh-ui-kit-ui-avatar-group.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-avatar.mjs +122 -0
- package/fesm2022/4sh-ui-kit-ui-avatar.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-badge.mjs +95 -0
- package/fesm2022/4sh-ui-kit-ui-badge.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-breadcrumb.mjs +190 -0
- package/fesm2022/4sh-ui-kit-ui-breadcrumb.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-button-split.mjs +151 -0
- package/fesm2022/4sh-ui-kit-ui-button-split.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-button.mjs +222 -0
- package/fesm2022/4sh-ui-kit-ui-button.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-card.mjs +164 -0
- package/fesm2022/4sh-ui-kit-ui-card.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-checkbox.mjs +118 -0
- package/fesm2022/4sh-ui-kit-ui-checkbox.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-chip.mjs +205 -0
- package/fesm2022/4sh-ui-kit-ui-chip.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-context-menu.mjs +219 -0
- package/fesm2022/4sh-ui-kit-ui-context-menu.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-datepicker.mjs +1508 -0
- package/fesm2022/4sh-ui-kit-ui-datepicker.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-drawer.mjs +300 -0
- package/fesm2022/4sh-ui-kit-ui-drawer.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-empty-state.mjs +148 -0
- package/fesm2022/4sh-ui-kit-ui-empty-state.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-field.mjs +102 -0
- package/fesm2022/4sh-ui-kit-ui-field.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-file-upload.mjs +568 -0
- package/fesm2022/4sh-ui-kit-ui-file-upload.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-helper.mjs +85 -0
- package/fesm2022/4sh-ui-kit-ui-helper.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-icon.mjs +98 -0
- package/fesm2022/4sh-ui-kit-ui-icon.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-image.mjs +201 -0
- package/fesm2022/4sh-ui-kit-ui-image.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-group.mjs +119 -0
- package/fesm2022/4sh-ui-kit-ui-input-group.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-mask.mjs +125 -0
- package/fesm2022/4sh-ui-kit-ui-input-mask.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-number.mjs +234 -0
- package/fesm2022/4sh-ui-kit-ui-input-number.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-otp.mjs +288 -0
- package/fesm2022/4sh-ui-kit-ui-input-otp.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input-tags.mjs +679 -0
- package/fesm2022/4sh-ui-kit-ui-input-tags.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-input.mjs +121 -0
- package/fesm2022/4sh-ui-kit-ui-input.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-label.mjs +61 -0
- package/fesm2022/4sh-ui-kit-ui-label.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-link.mjs +147 -0
- package/fesm2022/4sh-ui-kit-ui-link.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-menu.mjs +484 -0
- package/fesm2022/4sh-ui-kit-ui-menu.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-modal.mjs +555 -0
- package/fesm2022/4sh-ui-kit-ui-modal.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-nudger.mjs +168 -0
- package/fesm2022/4sh-ui-kit-ui-nudger.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-paginator.mjs +245 -0
- package/fesm2022/4sh-ui-kit-ui-paginator.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-popover.mjs +296 -0
- package/fesm2022/4sh-ui-kit-ui-popover.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-progress-bar.mjs +124 -0
- package/fesm2022/4sh-ui-kit-ui-progress-bar.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-radio.mjs +92 -0
- package/fesm2022/4sh-ui-kit-ui-radio.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-rating.mjs +185 -0
- package/fesm2022/4sh-ui-kit-ui-rating.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-read-only.mjs +146 -0
- package/fesm2022/4sh-ui-kit-ui-read-only.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-segment-control.mjs +386 -0
- package/fesm2022/4sh-ui-kit-ui-segment-control.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-select.mjs +868 -0
- package/fesm2022/4sh-ui-kit-ui-select.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-separator.mjs +77 -0
- package/fesm2022/4sh-ui-kit-ui-separator.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-sidebar.mjs +577 -0
- package/fesm2022/4sh-ui-kit-ui-sidebar.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-skeleton.mjs +81 -0
- package/fesm2022/4sh-ui-kit-ui-skeleton.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-slider.mjs +340 -0
- package/fesm2022/4sh-ui-kit-ui-slider.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-spinner.mjs +132 -0
- package/fesm2022/4sh-ui-kit-ui-spinner.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-stepper.mjs +389 -0
- package/fesm2022/4sh-ui-kit-ui-stepper.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-table.mjs +1406 -0
- package/fesm2022/4sh-ui-kit-ui-table.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-tabs.mjs +503 -0
- package/fesm2022/4sh-ui-kit-ui-tabs.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-tag.mjs +84 -0
- package/fesm2022/4sh-ui-kit-ui-tag.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-textarea.mjs +119 -0
- package/fesm2022/4sh-ui-kit-ui-textarea.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-toast.mjs +424 -0
- package/fesm2022/4sh-ui-kit-ui-toast.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-toggle.mjs +120 -0
- package/fesm2022/4sh-ui-kit-ui-toggle.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-ui-tooltip.mjs +445 -0
- package/fesm2022/4sh-ui-kit-ui-tooltip.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit.mjs +16 -0
- package/fesm2022/4sh-ui-kit.mjs.map +1 -0
- package/package.json +287 -0
- package/styles/base/_base.scss +19 -0
- package/styles/base/_motion.scss +144 -0
- package/styles/base/_typography.scss +99 -0
- package/styles/generated/_tokens-breakpoint.scss +8 -0
- package/styles/generated/_tokens-metrics.scss +37 -0
- package/styles/generated/_tokens-primitives.scss +284 -0
- package/styles/generated/_tokens-responsive.scss +99 -0
- package/styles/generated/_tokens-semantics.scss +1274 -0
- package/styles/generated/_tokens-styles.scss +35 -0
- package/styles/generated/_tokens-transitions.scss +11 -0
- package/styles/generated/_tokens-typography.scss +14 -0
- package/styles/generated/_tokens.scss +10 -0
- package/styles/index.scss +25 -0
- package/styles/settings/_ui-config.scss +67 -0
- package/styles/utils/_functions.scss +67 -0
- package/styles/utils/_helpers.scss +129 -0
- package/styles/utils/_mixins.scss +186 -0
- package/styles/utils/_motion.scss +47 -0
- package/styles/utils/_overlay.scss +26 -0
- package/styles/utils.scss +15 -0
- package/styles.css +1 -0
- package/types/4sh-ui-kit-forms.d.ts +259 -0
- package/types/4sh-ui-kit-motion.d.ts +111 -0
- package/types/4sh-ui-kit-overlay.d.ts +31 -0
- package/types/4sh-ui-kit-theming.d.ts +54 -0
- package/types/4sh-ui-kit-types.d.ts +13 -0
- package/types/4sh-ui-kit-ui-accordion.d.ts +140 -0
- package/types/4sh-ui-kit-ui-alert.d.ts +89 -0
- package/types/4sh-ui-kit-ui-autocomplete.d.ts +411 -0
- package/types/4sh-ui-kit-ui-avatar-group.d.ts +17 -0
- package/types/4sh-ui-kit-ui-avatar.d.ts +55 -0
- package/types/4sh-ui-kit-ui-badge.d.ts +38 -0
- package/types/4sh-ui-kit-ui-breadcrumb.d.ts +131 -0
- package/types/4sh-ui-kit-ui-button-split.d.ts +102 -0
- package/types/4sh-ui-kit-ui-button.d.ts +91 -0
- package/types/4sh-ui-kit-ui-card.d.ts +102 -0
- package/types/4sh-ui-kit-ui-checkbox.d.ts +54 -0
- package/types/4sh-ui-kit-ui-chip.d.ts +114 -0
- package/types/4sh-ui-kit-ui-context-menu.d.ts +105 -0
- package/types/4sh-ui-kit-ui-datepicker.d.ts +539 -0
- package/types/4sh-ui-kit-ui-drawer.d.ts +147 -0
- package/types/4sh-ui-kit-ui-empty-state.d.ts +93 -0
- package/types/4sh-ui-kit-ui-field.d.ts +53 -0
- package/types/4sh-ui-kit-ui-file-upload.d.ts +268 -0
- package/types/4sh-ui-kit-ui-helper.d.ts +46 -0
- package/types/4sh-ui-kit-ui-icon.d.ts +69 -0
- package/types/4sh-ui-kit-ui-image.d.ts +88 -0
- package/types/4sh-ui-kit-ui-input-group.d.ts +54 -0
- package/types/4sh-ui-kit-ui-input-mask.d.ts +63 -0
- package/types/4sh-ui-kit-ui-input-number.d.ts +96 -0
- package/types/4sh-ui-kit-ui-input-otp.d.ts +130 -0
- package/types/4sh-ui-kit-ui-input-tags.d.ts +350 -0
- package/types/4sh-ui-kit-ui-input.d.ts +78 -0
- package/types/4sh-ui-kit-ui-label.d.ts +36 -0
- package/types/4sh-ui-kit-ui-link.d.ts +72 -0
- package/types/4sh-ui-kit-ui-menu.d.ts +235 -0
- package/types/4sh-ui-kit-ui-modal.d.ts +241 -0
- package/types/4sh-ui-kit-ui-nudger.d.ts +79 -0
- package/types/4sh-ui-kit-ui-paginator.d.ts +150 -0
- package/types/4sh-ui-kit-ui-popover.d.ts +125 -0
- package/types/4sh-ui-kit-ui-progress-bar.d.ts +82 -0
- package/types/4sh-ui-kit-ui-radio.d.ts +44 -0
- package/types/4sh-ui-kit-ui-rating.d.ts +90 -0
- package/types/4sh-ui-kit-ui-read-only.d.ts +70 -0
- package/types/4sh-ui-kit-ui-segment-control.d.ts +184 -0
- package/types/4sh-ui-kit-ui-select.d.ts +392 -0
- package/types/4sh-ui-kit-ui-separator.d.ts +43 -0
- package/types/4sh-ui-kit-ui-sidebar.d.ts +358 -0
- package/types/4sh-ui-kit-ui-skeleton.d.ts +52 -0
- package/types/4sh-ui-kit-ui-slider.d.ts +127 -0
- package/types/4sh-ui-kit-ui-spinner.d.ts +67 -0
- package/types/4sh-ui-kit-ui-stepper.d.ts +220 -0
- package/types/4sh-ui-kit-ui-table.d.ts +570 -0
- package/types/4sh-ui-kit-ui-tabs.d.ts +225 -0
- package/types/4sh-ui-kit-ui-tag.d.ts +46 -0
- package/types/4sh-ui-kit-ui-textarea.d.ts +61 -0
- package/types/4sh-ui-kit-ui-toast.d.ts +247 -0
- package/types/4sh-ui-kit-ui-toggle.d.ts +67 -0
- package/types/4sh-ui-kit-ui-tooltip.d.ts +167 -0
- package/types/4sh-ui-kit.d.ts +4 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InjectionToken, EnvironmentProviders } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
/** Visual variant of an icon, interpreted by each family (filled vs outlined). */
|
|
5
|
+
type UiIconType = 'solid' | 'outline';
|
|
6
|
+
/**
|
|
7
|
+
* Describes how an icon font family turns a name + variant into markup, so
|
|
8
|
+
* ui-icon can render any font (FontAwesome, Material Symbols, Bootstrap Icons…).
|
|
9
|
+
*/
|
|
10
|
+
interface UiIconFamily {
|
|
11
|
+
/** CSS classes applied to the `<i>`. */
|
|
12
|
+
classes: (name: string, type: UiIconType) => string;
|
|
13
|
+
/** Text content of the `<i>` — ligature fonts (e.g. Material Symbols) put the name here. */
|
|
14
|
+
content?: (name: string, type: UiIconType) => string | null;
|
|
15
|
+
}
|
|
16
|
+
/** Built-in FontAwesome Free family (the default). */
|
|
17
|
+
declare const fontAwesomeFamily: UiIconFamily;
|
|
18
|
+
/** Families always available, keyed by name. Registered families are merged on top. */
|
|
19
|
+
declare const UI_ICON_BUILTIN_FAMILIES: Record<string, UiIconFamily>;
|
|
20
|
+
/** Registered icon families (multi provider). Merged over the built-ins. */
|
|
21
|
+
declare const UI_ICON_FAMILIES: InjectionToken<Record<string, UiIconFamily>[]>;
|
|
22
|
+
/** Family key used when a `ui-icon` does not set `family`. */
|
|
23
|
+
declare const UI_ICON_DEFAULT_FAMILY: InjectionToken<string>;
|
|
24
|
+
declare function provideUiIconFamilies(families: Record<string, UiIconFamily>, options?: {
|
|
25
|
+
default?: string;
|
|
26
|
+
}): EnvironmentProviders;
|
|
27
|
+
|
|
28
|
+
type UiIconSize = 'sm' | 'md' | 'default' | 'lg' | 'xl';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* ui-icon — renders an icon from a configurable font family.
|
|
32
|
+
*
|
|
33
|
+
* FontAwesome is the built-in default. Register other families (Material Symbols,
|
|
34
|
+
* Bootstrap Icons, a custom font…) with `provideUiIconFamilies()` and pick one per
|
|
35
|
+
* icon via `family`, or change the app-wide default.
|
|
36
|
+
*
|
|
37
|
+
* Accessible: decorative by default (aria-hidden); pass `decorative=false` + `ariaLabel`
|
|
38
|
+
* when the icon conveys meaning on its own.
|
|
39
|
+
*/
|
|
40
|
+
declare class UiIcon {
|
|
41
|
+
/** Icon name for the selected family (e.g. "circle-user"). */
|
|
42
|
+
name: _angular_core.InputSignal<string>;
|
|
43
|
+
/** Icon size. */
|
|
44
|
+
size: _angular_core.InputSignal<UiIconSize>;
|
|
45
|
+
/** Visual variant, interpreted by the family (filled vs outlined). */
|
|
46
|
+
type: _angular_core.InputSignal<UiIconType>;
|
|
47
|
+
/** Family key (default: configured default, else "fontawesome"). */
|
|
48
|
+
family: _angular_core.InputSignal<string | undefined>;
|
|
49
|
+
/** Purely decorative icon (hidden from screen readers). */
|
|
50
|
+
decorative: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
51
|
+
/** Accessible label (required when not decorative). */
|
|
52
|
+
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
53
|
+
private readonly registered;
|
|
54
|
+
private readonly configuredDefault;
|
|
55
|
+
/** Built-in families + registered ones (registered win on key clash). */
|
|
56
|
+
private readonly families;
|
|
57
|
+
/** @ignore Resolved family, falling back to FontAwesome on unknown key. */
|
|
58
|
+
private readonly resolvedFamily;
|
|
59
|
+
/** @ignore */
|
|
60
|
+
protected readonly classes: _angular_core.Signal<string>;
|
|
61
|
+
/** @ignore Text content for ligature fonts (null for class-based fonts like FontAwesome). */
|
|
62
|
+
protected readonly content: _angular_core.Signal<string | null>;
|
|
63
|
+
constructor();
|
|
64
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiIcon, never>;
|
|
65
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiIcon, "ui-icon", never, { "name": { "alias": "name"; "required": true; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "family": { "alias": "family"; "required": false; "isSignal": true; }; "decorative": { "alias": "decorative"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export { UI_ICON_BUILTIN_FAMILIES, UI_ICON_DEFAULT_FAMILY, UI_ICON_FAMILIES, UiIcon, fontAwesomeFamily, provideUiIconFamilies };
|
|
69
|
+
export type { UiIconFamily, UiIconSize, UiIconType };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InjectionToken, Provider } from '@angular/core';
|
|
3
|
+
import { SafeHtml } from '@angular/platform-browser';
|
|
4
|
+
|
|
5
|
+
interface ModeMap {
|
|
6
|
+
base?: string;
|
|
7
|
+
light?: string;
|
|
8
|
+
dark?: string;
|
|
9
|
+
}
|
|
10
|
+
type ThemeMap = Record<string, ModeMap>;
|
|
11
|
+
/** filename → { brand|'common' → { base|light|dark → extension } }. */
|
|
12
|
+
type UiImageAssetsMap = Record<string, ThemeMap>;
|
|
13
|
+
/**
|
|
14
|
+
* Map of the LOCAL assets available to `ui-image` (its `name` input).
|
|
15
|
+
*
|
|
16
|
+
* The kit cannot know a project's assets, so the map is injected rather than
|
|
17
|
+
* bundled: generate it in your app (see `npm run generate:assets` in the
|
|
18
|
+
* starter, which writes `src/assets/assets-map.json`) and provide it with
|
|
19
|
+
* `provideUiImageAssets()`. Without it, `name` resolves to nothing and the
|
|
20
|
+
* component falls back to its placeholder — `src` (remote URLs) still works.
|
|
21
|
+
*/
|
|
22
|
+
declare const UI_IMAGE_ASSETS: InjectionToken<UiImageAssetsMap>;
|
|
23
|
+
/**
|
|
24
|
+
* Registers the local asset map consumed by `ui-image`.
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* import assetsMap from './assets/assets-map.json';
|
|
28
|
+
* providers: [provideUiImageAssets(assetsMap)]
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
declare function provideUiImageAssets(map: UiImageAssetsMap): Provider;
|
|
32
|
+
/**
|
|
33
|
+
* ui-image — theme/brand-aware image.
|
|
34
|
+
*
|
|
35
|
+
* Two sources: `name` (local asset key resolved through `assets-map.json`,
|
|
36
|
+
* theme/brand variants) or `src` (remote/absolute URL — takes precedence).
|
|
37
|
+
* Local `.svg` assets are inlined (`innerHTML`) so they can inherit CSS;
|
|
38
|
+
* remote URLs always render through `<img [ngSrc]>` (never inlined).
|
|
39
|
+
* On load failure the `fallback` local asset is shown, then a token-styled
|
|
40
|
+
* placeholder if the fallback also fails (or none is provided).
|
|
41
|
+
*/
|
|
42
|
+
declare class UiImage {
|
|
43
|
+
private readonly sanitizer;
|
|
44
|
+
private readonly assetsMap;
|
|
45
|
+
private readonly themeService;
|
|
46
|
+
private readonly brandService;
|
|
47
|
+
/** Local asset key in `assets-map.json` (theme/brand-aware resolution). */
|
|
48
|
+
name: _angular_core.InputSignal<string | undefined>;
|
|
49
|
+
/** Remote/absolute URL, rendered via `NgOptimizedImage` — takes precedence over `name`. */
|
|
50
|
+
src: _angular_core.InputSignal<string | undefined>;
|
|
51
|
+
/** Local asset name (`assets-map.json` key) displayed when the main image fails to load. */
|
|
52
|
+
fallback: _angular_core.InputSignal<string | undefined>;
|
|
53
|
+
priority: _angular_core.InputSignal<boolean>;
|
|
54
|
+
fill: _angular_core.InputSignal<boolean>;
|
|
55
|
+
width: _angular_core.InputSignal<string | number | undefined>;
|
|
56
|
+
widthUnit: _angular_core.InputSignal<string | undefined>;
|
|
57
|
+
height: _angular_core.InputSignal<string | number | undefined>;
|
|
58
|
+
heightUnit: _angular_core.InputSignal<string | undefined>;
|
|
59
|
+
alt: _angular_core.InputSignal<string | undefined>;
|
|
60
|
+
/** Emitted with the failed URL when an image fails to load. */
|
|
61
|
+
loadFailed: _angular_core.OutputEmitterRef<string>;
|
|
62
|
+
protected readonly isRemote: _angular_core.Signal<boolean>;
|
|
63
|
+
/** Inline SVG is reserved for LOCAL assets — a remote `.svg` renders through `<img>` (no XSS surface). */
|
|
64
|
+
protected readonly isInlineSvg: _angular_core.Signal<boolean>;
|
|
65
|
+
protected readonly localSrc: _angular_core.Signal<string>;
|
|
66
|
+
protected readonly fallbackSrc: _angular_core.Signal<string>;
|
|
67
|
+
protected readonly primarySrc: _angular_core.Signal<string>;
|
|
68
|
+
private readonly primaryImgFailed;
|
|
69
|
+
private readonly fallbackImgFailed;
|
|
70
|
+
private readonly svgResource;
|
|
71
|
+
protected readonly svgContent: _angular_core.Signal<SafeHtml | null>;
|
|
72
|
+
protected readonly primaryFailed: _angular_core.Signal<boolean>;
|
|
73
|
+
protected readonly showFallback: _angular_core.Signal<boolean>;
|
|
74
|
+
protected readonly showPlaceholder: _angular_core.Signal<boolean>;
|
|
75
|
+
protected readonly displayedSrc: _angular_core.Signal<string>;
|
|
76
|
+
protected readonly cssWidth: _angular_core.Signal<string | null>;
|
|
77
|
+
protected readonly cssHeight: _angular_core.Signal<string | null>;
|
|
78
|
+
constructor();
|
|
79
|
+
protected onImgError(): void;
|
|
80
|
+
private resolveLocal;
|
|
81
|
+
private resolvePath;
|
|
82
|
+
private buildPath;
|
|
83
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiImage, never>;
|
|
84
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiImage, "ui-image", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "src": { "alias": "src"; "required": false; "isSignal": true; }; "fallback": { "alias": "fallback"; "required": false; "isSignal": true; }; "priority": { "alias": "priority"; "required": false; "isSignal": true; }; "fill": { "alias": "fill"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "widthUnit": { "alias": "widthUnit"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "heightUnit": { "alias": "heightUnit"; "required": false; "isSignal": true; }; "alt": { "alias": "alt"; "required": false; "isSignal": true; }; }, { "loadFailed": "loadFailed"; }, never, never, true, never>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export { UI_IMAGE_ASSETS, UiImage, provideUiImageAssets };
|
|
88
|
+
export type { UiImageAssetsMap };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { FieldSize } from '@4sh/ui-kit/forms';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ui-input-group-addon — non-interactive cell of a `ui-input-group`
|
|
6
|
+
* (text, icon, checkbox, radio…).
|
|
7
|
+
*
|
|
8
|
+
* Projects its content in a box aligned on the field height. `size` falls back
|
|
9
|
+
* to the parent group's when it is not set.
|
|
10
|
+
*/
|
|
11
|
+
declare class UiInputGroupAddon {
|
|
12
|
+
/** Size (defaults to the parent `ui-input-group` size). */
|
|
13
|
+
size: i0.InputSignal<FieldSize | undefined>;
|
|
14
|
+
/** @ignore */
|
|
15
|
+
private readonly group;
|
|
16
|
+
/** @ignore */
|
|
17
|
+
protected readonly classes: i0.Signal<string>;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UiInputGroupAddon, never>;
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UiInputGroupAddon, "ui-input-group-addon", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* ui-input-group — glues a control and its add-ons into a single visual field.
|
|
24
|
+
*
|
|
25
|
+
* Purely presentational: each child keeps its own API and states; the group
|
|
26
|
+
* only lays them out on one row, squares the inner corners and collapses the
|
|
27
|
+
* shared borders. The children are **projected**, so that shaping is applied
|
|
28
|
+
* on the DOM (custom properties + flex), not through scoped selectors which
|
|
29
|
+
* cannot reach projected content.
|
|
30
|
+
*
|
|
31
|
+
* Add-ons (text, icon, checkbox…) go through `ui-input-group-addon`; controls
|
|
32
|
+
* (`ui-input`, `ui-select`, `ui-button`…) are placed directly in the group.
|
|
33
|
+
*/
|
|
34
|
+
declare class UiInputGroup {
|
|
35
|
+
/** Size shared with the projected `ui-input-group-addon` (controls keep their own `size`). */
|
|
36
|
+
size: i0.InputSignal<FieldSize>;
|
|
37
|
+
/** @ignore */
|
|
38
|
+
private readonly destroyRef;
|
|
39
|
+
/** @ignore */
|
|
40
|
+
private readonly row;
|
|
41
|
+
constructor();
|
|
42
|
+
/** @ignore Direct items of the row. */
|
|
43
|
+
private items;
|
|
44
|
+
/** @ignore Only the edges keep a rounded corner, and shared borders overlap instead of doubling. */
|
|
45
|
+
private shape;
|
|
46
|
+
/** @ignore Raises the focused item so its focus ring is not covered by the overlap. */
|
|
47
|
+
protected onFocusIn(event: FocusEvent): void;
|
|
48
|
+
/** @ignore */
|
|
49
|
+
protected onFocusOut(): void;
|
|
50
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<UiInputGroup, never>;
|
|
51
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<UiInputGroup, "ui-input-group", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export { UiInputGroup, UiInputGroupAddon };
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { BaseFormField } from '@4sh/ui-kit/forms';
|
|
3
|
+
import { UiIconSize } from '@4sh/ui-kit/ui-icon';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* ui-input-mask — headless masked field (`ui-field` shell).
|
|
7
|
+
*
|
|
8
|
+
* `mask` describes the template: `9` digit, `a` letter, `*` alphanumeric; any
|
|
9
|
+
* other character is a literal inserted automatically (e.g. `99/99/9999`,
|
|
10
|
+
* `(999) 999-9999`). Empty positions show `slotChar`.
|
|
11
|
+
*
|
|
12
|
+
* Model value = string: masked (`12/09/2024`) by default, or raw (`12092024`)
|
|
13
|
+
* when `unmask`. Standalone, `[(ngModel)]` or reactive forms.
|
|
14
|
+
*/
|
|
15
|
+
declare class UiInputMask extends BaseFormField<string> {
|
|
16
|
+
/** Mask template (9 digit · a letter · * alphanumeric · other = literal). */
|
|
17
|
+
mask: _angular_core.InputSignal<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Inclusive bounds of each numeric segment (run of consecutive `9` tokens),
|
|
20
|
+
* in mask order and space-separated: `"0-23 0-59"` for `99:99`,
|
|
21
|
+
* `"1-31 1-12 1900-2100"` for `99/99/9999`. `*` leaves a segment unbounded.
|
|
22
|
+
* A character that could not lead to an in-range segment is rejected.
|
|
23
|
+
*/
|
|
24
|
+
ranges: _angular_core.InputSignal<string>;
|
|
25
|
+
/** Fill character for empty positions. */
|
|
26
|
+
slotChar: _angular_core.InputSignal<string>;
|
|
27
|
+
/** Emit the raw value (without literals) instead of the masked value. */
|
|
28
|
+
unmask: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
29
|
+
/** Native placeholder (shown when the field is empty). */
|
|
30
|
+
placeholder: _angular_core.InputSignal<string | undefined>;
|
|
31
|
+
/** Left FontAwesome icon name (decorative). */
|
|
32
|
+
iconLeft: _angular_core.InputSignal<string | undefined>;
|
|
33
|
+
/** Emitted on each value change. */
|
|
34
|
+
valueChange: _angular_core.OutputEmitterRef<string>;
|
|
35
|
+
/** Emitted when the input loses focus. */
|
|
36
|
+
inputBlur: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
37
|
+
/** @ignore */
|
|
38
|
+
private readonly inputEl;
|
|
39
|
+
/** @ignore Masked displayed text. */
|
|
40
|
+
protected readonly text: _angular_core.WritableSignal<string>;
|
|
41
|
+
/** @ignore */
|
|
42
|
+
protected readonly iconSize: _angular_core.Signal<UiIconSize>;
|
|
43
|
+
/** @ignore Bounds declared by `ranges`, one entry per numeric segment (`null` = unbounded). */
|
|
44
|
+
private readonly parsedRanges;
|
|
45
|
+
/**
|
|
46
|
+
* @ignore The mask resolved once per template: literals, input slots, and the
|
|
47
|
+
* `ranges` bounds attached to every slot of the numeric segment it belongs to.
|
|
48
|
+
*/
|
|
49
|
+
private readonly slots;
|
|
50
|
+
writeValue(value: string | null): void;
|
|
51
|
+
/** Focuses the input. */
|
|
52
|
+
focus(options?: FocusOptions): void;
|
|
53
|
+
/** @ignore Input: apply the mask, update model + display + caret. */
|
|
54
|
+
protected onInput(): void;
|
|
55
|
+
/** @ignore */
|
|
56
|
+
protected onBlur(event: FocusEvent): void;
|
|
57
|
+
/** @ignore Emitted value depending on `unmask`. */
|
|
58
|
+
private emitValue;
|
|
59
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiInputMask, never>;
|
|
60
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiInputMask, "ui-input-mask", never, { "mask": { "alias": "mask"; "required": true; "isSignal": true; }; "ranges": { "alias": "ranges"; "required": false; "isSignal": true; }; "slotChar": { "alias": "slotChar"; "required": false; "isSignal": true; }; "unmask": { "alias": "unmask"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "iconLeft": { "alias": "iconLeft"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "inputBlur": "inputBlur"; }, never, never, true, never>;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export { UiInputMask };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { BaseFormField } from '@4sh/ui-kit/forms';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ui-input-number — headless numeric field (`ui-field` shell).
|
|
6
|
+
*
|
|
7
|
+
* Model value = `number | null`. Lenient input: the text is **not** reformatted
|
|
8
|
+
* while typing (no caret jump) — the field shows an editable form on focus, and
|
|
9
|
+
* the **rich format** (thousands grouping, currency, decimals via
|
|
10
|
+
* `Intl.NumberFormat`) is applied **on blur**. `min`/`max`/`step`, ± spinner,
|
|
11
|
+
* ↑/↓ arrow keys, clamp on blur.
|
|
12
|
+
*
|
|
13
|
+
* Formatting is driven by `locale`/`currency`/`useGrouping`/`*FractionDigits`;
|
|
14
|
+
* for a very specific case, override the protected `format()` method.
|
|
15
|
+
*/
|
|
16
|
+
declare class UiInputNumber extends BaseFormField<number | null> {
|
|
17
|
+
/** Native placeholder. */
|
|
18
|
+
placeholder: _angular_core.InputSignal<string | undefined>;
|
|
19
|
+
/** Minimum value (clamp on blur + disables "−" at the bound). */
|
|
20
|
+
min: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
21
|
+
/** Maximum value (clamp on blur + disables "+" at the bound). */
|
|
22
|
+
max: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
23
|
+
/** Increment step (spinner + arrow keys). */
|
|
24
|
+
step: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
25
|
+
/** Allow decimals. */
|
|
26
|
+
allowDecimals: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
27
|
+
/** Suffix unit (e.g. "kg"). Ignored when `currency` is set. */
|
|
28
|
+
unit: _angular_core.InputSignal<string | undefined>;
|
|
29
|
+
/** Show the ± spinner. */
|
|
30
|
+
showButtons: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
31
|
+
/** Accessible label of the increment spinner button. */
|
|
32
|
+
incrementAriaLabel: _angular_core.InputSignal<string>;
|
|
33
|
+
/** Accessible label of the decrement spinner button. */
|
|
34
|
+
decrementAriaLabel: _angular_core.InputSignal<string>;
|
|
35
|
+
/** BCP-47 locale (e.g. `fr-FR`). Defaults to the browser locale. */
|
|
36
|
+
locale: _angular_core.InputSignal<string | undefined>;
|
|
37
|
+
/** ISO currency code (e.g. `EUR`) → currency formatting on blur. */
|
|
38
|
+
currency: _angular_core.InputSignal<string | undefined>;
|
|
39
|
+
/** Thousands separators on blur. */
|
|
40
|
+
useGrouping: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
41
|
+
/** Minimum fraction digits shown on blur. */
|
|
42
|
+
minFractionDigits: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
43
|
+
/** Maximum fraction digits shown on blur. */
|
|
44
|
+
maxFractionDigits: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
45
|
+
/** Emitted on each numeric value change. */
|
|
46
|
+
valueChange: _angular_core.OutputEmitterRef<number | null>;
|
|
47
|
+
/** Emitted when the input receives focus. */
|
|
48
|
+
inputFocus: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
49
|
+
/** Emitted when the input loses focus. */
|
|
50
|
+
inputBlur: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
51
|
+
/** @ignore */
|
|
52
|
+
private readonly inputEl;
|
|
53
|
+
/** @ignore Raw displayed text (independent from the model while typing). */
|
|
54
|
+
protected readonly text: _angular_core.WritableSignal<string>;
|
|
55
|
+
/** @ignore Suffix unit, ignored when `currency` is set (the formatted value already carries it). */
|
|
56
|
+
protected readonly displayUnit: _angular_core.Signal<string | null>;
|
|
57
|
+
/** @ignore */
|
|
58
|
+
protected readonly unitSmall: _angular_core.Signal<boolean>;
|
|
59
|
+
/** @ignore Bounds reached (disable the spinner buttons). */
|
|
60
|
+
protected readonly atMax: _angular_core.Signal<boolean>;
|
|
61
|
+
protected readonly atMin: _angular_core.Signal<boolean>;
|
|
62
|
+
/** @ignore Group/decimal separators of the current locale. */
|
|
63
|
+
private readonly separators;
|
|
64
|
+
writeValue(value: number | null): void;
|
|
65
|
+
/** Focuses the input. */
|
|
66
|
+
focus(options?: FocusOptions): void;
|
|
67
|
+
/** @ignore Focus: switch to an editable form (no grouping/currency). */
|
|
68
|
+
protected onFocus(event: FocusEvent): void;
|
|
69
|
+
/** @ignore Input: parse without reformatting the text (caret preserved). */
|
|
70
|
+
protected onInput(): void;
|
|
71
|
+
/** @ignore Blur: clamp + rich reformatting. */
|
|
72
|
+
protected onBlur(event: FocusEvent): void;
|
|
73
|
+
/** @ignore ↑/↓ arrow keys. */
|
|
74
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
75
|
+
/** @ignore ± spinner. */
|
|
76
|
+
protected stepBy(direction: 1 | -1): void;
|
|
77
|
+
/** @ignore Does the input currently have focus? */
|
|
78
|
+
private isFocused;
|
|
79
|
+
/** @ignore Update model + emit; reformat the text when requested. */
|
|
80
|
+
private commit;
|
|
81
|
+
/** @ignore Parse a lenient (locale-aware) input → number or null. */
|
|
82
|
+
private parse;
|
|
83
|
+
/** @ignore Clamp the value into [min, max]. */
|
|
84
|
+
private clamp;
|
|
85
|
+
/** @ignore Editable form on focus: locale decimals, no grouping or currency. */
|
|
86
|
+
private editable;
|
|
87
|
+
/**
|
|
88
|
+
* Display formatting on blur (overridable). Defaults to `Intl.NumberFormat`
|
|
89
|
+
* with `locale`/`currency`/`useGrouping`/`*FractionDigits`.
|
|
90
|
+
*/
|
|
91
|
+
protected format(value: number): string;
|
|
92
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiInputNumber, never>;
|
|
93
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiInputNumber, "ui-input-number", never, { "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "min": { "alias": "min"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "step": { "alias": "step"; "required": false; "isSignal": true; }; "allowDecimals": { "alias": "allowDecimals"; "required": false; "isSignal": true; }; "unit": { "alias": "unit"; "required": false; "isSignal": true; }; "showButtons": { "alias": "showButtons"; "required": false; "isSignal": true; }; "incrementAriaLabel": { "alias": "incrementAriaLabel"; "required": false; "isSignal": true; }; "decrementAriaLabel": { "alias": "decrementAriaLabel"; "required": false; "isSignal": true; }; "locale": { "alias": "locale"; "required": false; "isSignal": true; }; "currency": { "alias": "currency"; "required": false; "isSignal": true; }; "useGrouping": { "alias": "useGrouping"; "required": false; "isSignal": true; }; "minFractionDigits": { "alias": "minFractionDigits"; "required": false; "isSignal": true; }; "maxFractionDigits": { "alias": "maxFractionDigits"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "inputFocus": "inputFocus"; "inputBlur": "inputBlur"; }, never, never, true, never>;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export { UiInputNumber };
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { BaseFieldControl } from '@4sh/ui-kit/forms';
|
|
4
|
+
|
|
5
|
+
/** Size of the OTP cells. `default` is the base. */
|
|
6
|
+
type InputOtpSize = 'small' | 'default' | 'large';
|
|
7
|
+
/** DOM event handlers handed to a custom `#input` cell template. */
|
|
8
|
+
interface InputOtpCellEvents {
|
|
9
|
+
/** Wire on `(input)`. */
|
|
10
|
+
input: (event: Event) => void;
|
|
11
|
+
/** Wire on `(keydown)`. */
|
|
12
|
+
keydown: (event: KeyboardEvent) => void;
|
|
13
|
+
/** Wire on `(focus)`. */
|
|
14
|
+
focus: (event: FocusEvent) => void;
|
|
15
|
+
/** Wire on `(blur)`. */
|
|
16
|
+
blur: (event: FocusEvent) => void;
|
|
17
|
+
/** Wire on `(paste)`. */
|
|
18
|
+
paste: (event: ClipboardEvent) => void;
|
|
19
|
+
}
|
|
20
|
+
/** Context handed to the `#input` template (one per cell). */
|
|
21
|
+
interface InputOtpCellContext {
|
|
22
|
+
/** Current value of this cell (default `$implicit`). */
|
|
23
|
+
$implicit: string;
|
|
24
|
+
/** Same as `$implicit`, named for readability. */
|
|
25
|
+
value: string;
|
|
26
|
+
/** Zero-based index of the cell. */
|
|
27
|
+
index: number;
|
|
28
|
+
/** Event handlers to bind on the custom control (keeps the OTP behaviour). */
|
|
29
|
+
events: InputOtpCellEvents;
|
|
30
|
+
/** Roving tabindex for this cell (`0` for the active one, `-1` otherwise). */
|
|
31
|
+
tabindex: number;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* ui-input-otp — headless one-time-password field: a row of single-character
|
|
35
|
+
* cells backing a single string value.
|
|
36
|
+
*
|
|
37
|
+
* Each cell is a real native `<input maxlength="1">`; the group carries
|
|
38
|
+
* `role="group"` and a **roving tabindex** so `Tab` enters/leaves the field as a
|
|
39
|
+
* whole while `←`/`→` move between cells (`Backspace` clears and steps
|
|
40
|
+
* back). Typing auto-advances, and pasting a code distributes it across the
|
|
41
|
+
* cells. Interactive states (hover/focus/disabled) are pure CSS driven by the
|
|
42
|
+
* `form.*` design tokens.
|
|
43
|
+
*
|
|
44
|
+
* - `mask` hides the characters (`type="password"`).
|
|
45
|
+
* - `integerOnly` restricts input to digits (`inputmode="numeric"`).
|
|
46
|
+
* - a `#input` template replaces the default cell with your own control (it
|
|
47
|
+
* receives the value, index, roving tabindex and the event handlers to bind).
|
|
48
|
+
*
|
|
49
|
+
* Works standalone, with `[(ngModel)]`, reactive forms, or signal forms
|
|
50
|
+
* (`[formField]`, Angular 22) — it is a `ControlValueAccessor` (interop handled by
|
|
51
|
+
* `BaseControlValueAccessor`).
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```html
|
|
55
|
+
* <ui-input-otp [(ngModel)]="code" [length]="6" [integerOnly]="true" ariaLabel="Code de vérification" />
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
declare class UiInputOtp extends BaseFieldControl<string> {
|
|
59
|
+
/** Number of cells (characters) to enter. */
|
|
60
|
+
length: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
61
|
+
/** Hide the characters (renders `type="password"`). */
|
|
62
|
+
mask: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
63
|
+
/** Restrict input to integers (`inputmode="numeric"`, non-digits rejected). */
|
|
64
|
+
integerOnly: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
65
|
+
/** Cell size. */
|
|
66
|
+
size: _angular_core.InputSignal<InputOtpSize>;
|
|
67
|
+
/** Accessible-name prefix of each cell ("<prefix> N"). Falls back to `ariaLabel`. */
|
|
68
|
+
charAriaLabel: _angular_core.InputSignal<string>;
|
|
69
|
+
/** Focus the first cell on init. */
|
|
70
|
+
autofocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
71
|
+
/** Emitted with the joined value on every change. */
|
|
72
|
+
valueChange: _angular_core.OutputEmitterRef<string>;
|
|
73
|
+
/** Emitted with the value once every cell is filled. */
|
|
74
|
+
completed: _angular_core.OutputEmitterRef<string>;
|
|
75
|
+
/** Custom cell template (`<ng-template #input let-value let-i="index" let-events="events">`). */
|
|
76
|
+
protected readonly inputTemplate: _angular_core.Signal<TemplateRef<InputOtpCellContext> | undefined>;
|
|
77
|
+
/** @ignore */
|
|
78
|
+
private readonly host;
|
|
79
|
+
/** @ignore Per-cell characters (source of truth for the view). */
|
|
80
|
+
private readonly tokens;
|
|
81
|
+
/** @ignore Cell that owns the group's single tab stop (roving tabindex). */
|
|
82
|
+
private readonly focusedIndex;
|
|
83
|
+
constructor();
|
|
84
|
+
/** @ignore Native input type (masked → password). */
|
|
85
|
+
protected readonly inputType: _angular_core.Signal<"password" | "text">;
|
|
86
|
+
/** @ignore Hint for the on-screen keyboard. */
|
|
87
|
+
protected readonly inputMode: _angular_core.Signal<"text" | "numeric">;
|
|
88
|
+
/** @ignore Render-ready list of cells (index + current value). */
|
|
89
|
+
protected readonly cells: _angular_core.Signal<{
|
|
90
|
+
index: number;
|
|
91
|
+
id: string;
|
|
92
|
+
value: string;
|
|
93
|
+
}[]>;
|
|
94
|
+
writeValue(value: string | number | null): void;
|
|
95
|
+
/** @ignore */
|
|
96
|
+
protected uidPrefix(): string;
|
|
97
|
+
/** Move focus to the first cell. */
|
|
98
|
+
focus(options?: FocusOptions): void;
|
|
99
|
+
/** @ignore Roving tabindex for a given cell (one `0`, the rest `-1`). */
|
|
100
|
+
protected tabindexFor(index: number): number;
|
|
101
|
+
/** @ignore Value shown in a cell. */
|
|
102
|
+
protected cellValue(index: number): string;
|
|
103
|
+
/** @ignore Handlers exposed to a custom `#input` template. */
|
|
104
|
+
protected cellEvents(index: number): InputOtpCellEvents;
|
|
105
|
+
/** @ignore Cell input: single source of the per-cell value (view → form). */
|
|
106
|
+
protected onInput(event: Event, index: number): void;
|
|
107
|
+
/** @ignore Keyboard navigation + input guards. */
|
|
108
|
+
protected onKeydown(event: KeyboardEvent, index: number): void;
|
|
109
|
+
/** @ignore Select the cell content on focus + track the roving index. */
|
|
110
|
+
protected onFocus(event: FocusEvent, index: number): void;
|
|
111
|
+
/** @ignore Distribute a pasted code across the cells from `index`. */
|
|
112
|
+
protected onPaste(event: ClipboardEvent, index: number): void;
|
|
113
|
+
/** @ignore Mark touched when focus leaves the whole group. */
|
|
114
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
115
|
+
/** @ignore Write `chars` into the cells starting at `from`, then commit + focus. */
|
|
116
|
+
private setFromIndex;
|
|
117
|
+
/** @ignore Persist the tokens, emit the joined value (+ `completed` when full). */
|
|
118
|
+
private commit;
|
|
119
|
+
/** @ignore Focus (and select) the cell at `index`, if it exists. */
|
|
120
|
+
private focusCell;
|
|
121
|
+
/** @ignore Split a form value into an array of single characters (bounded). */
|
|
122
|
+
private toTokens;
|
|
123
|
+
/** @ignore Drop non-digits when integer-only, otherwise pass through. */
|
|
124
|
+
private sanitize;
|
|
125
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiInputOtp, never>;
|
|
126
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiInputOtp, "ui-input-otp", never, { "length": { "alias": "length"; "required": false; "isSignal": true; }; "mask": { "alias": "mask"; "required": false; "isSignal": true; }; "integerOnly": { "alias": "integerOnly"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "charAriaLabel": { "alias": "charAriaLabel"; "required": false; "isSignal": true; }; "autofocus": { "alias": "autofocus"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "completed": "completed"; }, ["inputTemplate"], never, true, never>;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export { UiInputOtp };
|
|
130
|
+
export type { InputOtpCellContext, InputOtpCellEvents, InputOtpSize };
|