@4sh/ui-kit 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.fr.md +10 -9
- package/README.md +10 -9
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs +338 -14
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +1 -76
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +225 -0
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-forms.mjs +99 -1
- package/fesm2022/4sh-ui-kit-forms.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +3 -27
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +3 -27
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +3 -27
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +1 -25
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-overlay.mjs +60 -2
- package/fesm2022/4sh-ui-kit-overlay.mjs.map +1 -1
- package/mcp/data/text-search-docs.json +240 -10
- package/mcp/data/ui-config.json +835 -41
- package/mcp/package.json +1 -1
- package/package.json +5 -1
- package/styles/component-vars.scss +54 -1
- package/types/4sh-ui-kit-base-ui-image.d.ts +151 -6
- package/types/4sh-ui-kit-forms-ui-input-date.d.ts +132 -0
- package/types/4sh-ui-kit-forms.d.ts +43 -1
- package/types/4sh-ui-kit-overlay.d.ts +35 -1
package/mcp/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4sh/ui-kit-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "MCP server exposing the @4sh/ui-kit design system (components, props, tokens, doc) to AI coding agents. Not published on its own: bundled at build time into @4sh/ui-kit (library mode) and @4sh/ui-kit-schematics (starter mode) — see scripts/mcp-bundle.build.mjs.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4sh/ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Headless Angular components from the 4SH Design System: signals + Angular CDK, styled exclusively through design tokens. Ships a companion MCP server exposing the kit catalog and doc to AI coding agents.",
|
|
5
5
|
"homepage": "https://4sh.github.io/starter-angular/?path=/docs/introduction--docs",
|
|
6
6
|
"repository": {
|
|
@@ -113,6 +113,10 @@
|
|
|
113
113
|
"types": "./types/4sh-ui-kit-forms-ui-input.d.ts",
|
|
114
114
|
"default": "./fesm2022/4sh-ui-kit-forms-ui-input.mjs"
|
|
115
115
|
},
|
|
116
|
+
"./forms/ui-input-date": {
|
|
117
|
+
"types": "./types/4sh-ui-kit-forms-ui-input-date.d.ts",
|
|
118
|
+
"default": "./fesm2022/4sh-ui-kit-forms-ui-input-date.mjs"
|
|
119
|
+
},
|
|
116
120
|
"./forms/ui-input-group": {
|
|
117
121
|
"types": "./types/4sh-ui-kit-forms-ui-input-group.d.ts",
|
|
118
122
|
"default": "./fesm2022/4sh-ui-kit-forms-ui-input-group.mjs"
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// design token instead — it follows brand, light/dark and viewport.
|
|
12
12
|
//
|
|
13
13
|
// Generated by `pnpm docs:config`, values read from the compiled CSS — do not
|
|
14
|
-
// edit here.
|
|
14
|
+
// edit here. 1369 variables; 128 more exist whose value depends on the
|
|
15
15
|
// rendered variant, listed in each component’s “Theming” section in Storybook.
|
|
16
16
|
// =====================================================================
|
|
17
17
|
|
|
@@ -99,12 +99,46 @@
|
|
|
99
99
|
--ui-image-placeholder-min-width: var(--units-xl);
|
|
100
100
|
// Bordures & rayons
|
|
101
101
|
--ui-image-placeholder-radius: var(--radius-default);
|
|
102
|
+
--ui-image-trigger-focus-ring-width: var(--ui-focus-ring-width, var(--units-2xs));
|
|
103
|
+
--ui-image-trigger-radius: 0;
|
|
104
|
+
// Typographie
|
|
105
|
+
--ui-image-indicator-font-size: var(--size-typography-text-lg);
|
|
102
106
|
// Couleurs
|
|
107
|
+
--ui-image-indicator-background: var(--primitives-black-50);
|
|
108
|
+
--ui-image-indicator-color: var(--primitives-white-base);
|
|
103
109
|
--ui-image-placeholder-color: var(--global-text-muted);
|
|
104
110
|
--ui-image-placeholder-surface: var(--global-background-muted);
|
|
111
|
+
--ui-image-trigger-focus-ring-color: var(--global-border-focus);
|
|
105
112
|
// Divers
|
|
106
113
|
--ui-image-object-fit: contain;
|
|
107
114
|
|
|
115
|
+
// ── ui-image-preview ──
|
|
116
|
+
// Dimensions
|
|
117
|
+
--ui-image-preview-action-size: 2.25rem;
|
|
118
|
+
--ui-image-preview-media-max-height: 100%;
|
|
119
|
+
--ui-image-preview-media-max-height-rotated: 100cqw;
|
|
120
|
+
--ui-image-preview-media-max-width: 100%;
|
|
121
|
+
--ui-image-preview-media-max-width-rotated: 100cqh;
|
|
122
|
+
// Espacements
|
|
123
|
+
--ui-image-preview-gap: var(--units-md);
|
|
124
|
+
--ui-image-preview-padding: var(--units-lg);
|
|
125
|
+
--ui-image-preview-toolbar-gap: var(--units-2xs);
|
|
126
|
+
--ui-image-preview-toolbar-padding: var(--units-2xs);
|
|
127
|
+
// Bordures & rayons
|
|
128
|
+
--ui-image-preview-action-radius: var(--radius-full);
|
|
129
|
+
--ui-image-preview-focus-ring-width: var(--ui-focus-ring-width, var(--units-2xs));
|
|
130
|
+
--ui-image-preview-toolbar-radius: var(--radius-full);
|
|
131
|
+
// Couleurs
|
|
132
|
+
--ui-image-preview-action-color: var(--primitives-white-base);
|
|
133
|
+
--ui-image-preview-action-focus-ring-color: var(--global-border-focus);
|
|
134
|
+
--ui-image-preview-action-surface-hover: var(--primitives-white-20);
|
|
135
|
+
--ui-image-preview-mask-background: var(--primitives-black-80);
|
|
136
|
+
--ui-image-preview-toolbar-background: var(--primitives-black-50);
|
|
137
|
+
// Divers
|
|
138
|
+
--ui-image-preview-action-opacity-disabled: 0.4;
|
|
139
|
+
--ui-image-preview-media-shadow: var(--shadow-default-lg);
|
|
140
|
+
--ui-image-preview-z-index: 1100;
|
|
141
|
+
|
|
108
142
|
// ══════════════════════════════════════════════════════════════════
|
|
109
143
|
// Formulaires
|
|
110
144
|
// ══════════════════════════════════════════════════════════════════
|
|
@@ -494,6 +528,10 @@
|
|
|
494
528
|
--ui-input-font-size-small: var(--size-typography-text-md);
|
|
495
529
|
--ui-input-unit-font-size: var(--size-typography-text-default);
|
|
496
530
|
|
|
531
|
+
// ── ui-input-date ──
|
|
532
|
+
// Typographie
|
|
533
|
+
--ui-input-date-font-size-small: var(--size-typography-text-md);
|
|
534
|
+
|
|
497
535
|
// ── ui-input-group ──
|
|
498
536
|
// Espacements
|
|
499
537
|
--ui-input-group-overlap: var(--ui-control-stroke-width, var(--stroke-default));
|
|
@@ -1030,7 +1068,10 @@
|
|
|
1030
1068
|
--ui-alert-title-font-size-large: var(--size-typography-title-md);
|
|
1031
1069
|
--ui-alert-title-weight: var(--weight-bold);
|
|
1032
1070
|
// Divers
|
|
1071
|
+
--ui-alert-align: flex-start;
|
|
1072
|
+
--ui-alert-close-align: auto;
|
|
1033
1073
|
--ui-alert-close-opacity: 0.7;
|
|
1074
|
+
--ui-alert-icon-align: auto;
|
|
1034
1075
|
|
|
1035
1076
|
// ── ui-avatar ──
|
|
1036
1077
|
// Dimensions
|
|
@@ -1242,6 +1283,8 @@
|
|
|
1242
1283
|
--ui-tag-weight: var(--weight-regular);
|
|
1243
1284
|
|
|
1244
1285
|
// ── ui-toast ──
|
|
1286
|
+
// Espacements
|
|
1287
|
+
--ui-toast-icon-padding-top: var(--units-2xs);
|
|
1245
1288
|
// Bordures & rayons
|
|
1246
1289
|
--ui-toast-focus-ring-width: var(--ui-focus-ring-width, var(--units-2xs));
|
|
1247
1290
|
// Typographie
|
|
@@ -1249,6 +1292,10 @@
|
|
|
1249
1292
|
--ui-toast-text-weight: var(--weight-light);
|
|
1250
1293
|
--ui-toast-title-font-family: var(--fontfamily-title);
|
|
1251
1294
|
--ui-toast-title-weight: var(--weight-bold);
|
|
1295
|
+
// Divers
|
|
1296
|
+
--ui-toast-align: flex-start;
|
|
1297
|
+
--ui-toast-close-align: auto;
|
|
1298
|
+
--ui-toast-icon-align: auto;
|
|
1252
1299
|
|
|
1253
1300
|
// ── ui-toast-container ──
|
|
1254
1301
|
// Dimensions
|
|
@@ -1323,6 +1370,8 @@
|
|
|
1323
1370
|
--ui-bottom-sheet-mask-background: var(--primitives-black-50);
|
|
1324
1371
|
--ui-bottom-sheet-surface: var(--global-background-default);
|
|
1325
1372
|
// Divers
|
|
1373
|
+
--ui-bottom-sheet-action-align: auto;
|
|
1374
|
+
--ui-bottom-sheet-header-align: flex-start;
|
|
1326
1375
|
--ui-bottom-sheet-shadow: var(--shadow-default-lg);
|
|
1327
1376
|
--ui-bottom-sheet-z-index: 1100;
|
|
1328
1377
|
|
|
@@ -1372,6 +1421,8 @@
|
|
|
1372
1421
|
--ui-drawer-stroke: var(--global-border-subtle);
|
|
1373
1422
|
--ui-drawer-surface: var(--global-background-default);
|
|
1374
1423
|
// Divers
|
|
1424
|
+
--ui-drawer-action-align: auto;
|
|
1425
|
+
--ui-drawer-header-align: flex-start;
|
|
1375
1426
|
--ui-drawer-z-index: 1100;
|
|
1376
1427
|
|
|
1377
1428
|
// ── ui-modal ──
|
|
@@ -1401,6 +1452,8 @@
|
|
|
1401
1452
|
--ui-modal-stroke: var(--global-border-subtle);
|
|
1402
1453
|
--ui-modal-surface: var(--global-background-default);
|
|
1403
1454
|
// Divers
|
|
1455
|
+
--ui-modal-header-actions-align: auto;
|
|
1456
|
+
--ui-modal-header-align: flex-start;
|
|
1404
1457
|
--ui-modal-z-index: 1100;
|
|
1405
1458
|
|
|
1406
1459
|
// ── ui-popover ──
|
|
@@ -1,7 +1,84 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { InjectionToken, Provider } from '@angular/core';
|
|
2
|
+
import { InjectionToken, TemplateRef, Provider } from '@angular/core';
|
|
3
3
|
import { SafeHtml } from '@angular/platform-browser';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* ui-image-preview — the enlarged view (lightbox) opened by `ui-image`'s
|
|
7
|
+
* `preview` mode.
|
|
8
|
+
*
|
|
9
|
+
* A viewport mask holding a toolbar (zoom in/out, rotate, reset, optional
|
|
10
|
+
* download, close) and the image itself, which the three transforms drive
|
|
11
|
+
* through a single `transform`: pan, scale, rotation. Zoom is reachable at the
|
|
12
|
+
* pointer (toolbar, wheel) and at the keyboard (`+`/`-`/`0`/`r`, arrows to pan)
|
|
13
|
+
* — a zoom a keyboard user cannot pan is a zoom they cannot read.
|
|
14
|
+
*
|
|
15
|
+
* Lives in `ui-image`'s entry point: it renders that component's resolved
|
|
16
|
+
* source, so a separate entry point would be a cycle. Mount it directly only to
|
|
17
|
+
* drive the enlarged view yourself.
|
|
18
|
+
*/
|
|
19
|
+
declare class UiImagePreview {
|
|
20
|
+
private readonly document;
|
|
21
|
+
/** URL of the image to show enlarged (already resolved — `http(s)`, `blob:` or `data:`). */
|
|
22
|
+
src: _angular_core.InputSignal<string>;
|
|
23
|
+
/** Alt text of the enlarged image (empty = decorative). */
|
|
24
|
+
alt: _angular_core.InputSignal<string>;
|
|
25
|
+
/** Accessible name of the dialog. */
|
|
26
|
+
ariaLabel: _angular_core.InputSignal<string>;
|
|
27
|
+
/** Zoom increment applied by one toolbar click, one wheel notch or one `+`/`-` press. */
|
|
28
|
+
zoomStep: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
29
|
+
/** Lower zoom bound. */
|
|
30
|
+
minZoom: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
31
|
+
/** Upper zoom bound. */
|
|
32
|
+
maxZoom: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
33
|
+
/** Offer a download action in the toolbar. */
|
|
34
|
+
downloadable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
35
|
+
/** Filename proposed by the download action (defaults to the browser's choice). */
|
|
36
|
+
downloadName: _angular_core.InputSignal<string | undefined>;
|
|
37
|
+
/** Close when the mask around the image is clicked. */
|
|
38
|
+
dismissableMask: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
39
|
+
zoomInAriaLabel: _angular_core.InputSignal<string>;
|
|
40
|
+
zoomOutAriaLabel: _angular_core.InputSignal<string>;
|
|
41
|
+
rotateLeftAriaLabel: _angular_core.InputSignal<string>;
|
|
42
|
+
rotateRightAriaLabel: _angular_core.InputSignal<string>;
|
|
43
|
+
resetAriaLabel: _angular_core.InputSignal<string>;
|
|
44
|
+
downloadAriaLabel: _angular_core.InputSignal<string>;
|
|
45
|
+
closeAriaLabel: _angular_core.InputSignal<string>;
|
|
46
|
+
/** Emitted when the view asks to be dismissed (Escape, close button, mask click). */
|
|
47
|
+
closed: _angular_core.OutputEmitterRef<void>;
|
|
48
|
+
private readonly stage;
|
|
49
|
+
protected readonly scale: _angular_core.WritableSignal<number>;
|
|
50
|
+
protected readonly rotation: _angular_core.WritableSignal<number>;
|
|
51
|
+
protected readonly panX: _angular_core.WritableSignal<number>;
|
|
52
|
+
protected readonly panY: _angular_core.WritableSignal<number>;
|
|
53
|
+
protected readonly canZoomIn: _angular_core.Signal<boolean>;
|
|
54
|
+
protected readonly canZoomOut: _angular_core.Signal<boolean>;
|
|
55
|
+
/** Nothing to reset while the three transforms are at their neutral value. */
|
|
56
|
+
protected readonly isPristine: _angular_core.Signal<boolean>;
|
|
57
|
+
/** Panning only makes sense once the image overflows its stage. */
|
|
58
|
+
protected readonly canPan: _angular_core.Signal<boolean>;
|
|
59
|
+
/** A quarter turn: what is drawn no longer fits the layout box's axes. */
|
|
60
|
+
protected readonly isQuarterTurned: _angular_core.Signal<boolean>;
|
|
61
|
+
protected readonly transform: _angular_core.Signal<string>;
|
|
62
|
+
constructor();
|
|
63
|
+
protected zoomIn(): void;
|
|
64
|
+
protected zoomOut(): void;
|
|
65
|
+
protected rotateLeft(): void;
|
|
66
|
+
protected rotateRight(): void;
|
|
67
|
+
protected reset(): void;
|
|
68
|
+
protected close(): void;
|
|
69
|
+
/** A press that lands on the stage itself (not on the image) is a press outside. */
|
|
70
|
+
protected onStagePointerDown(event: PointerEvent): void;
|
|
71
|
+
protected onWheel(event: WheelEvent): void;
|
|
72
|
+
protected onKeydown(event: KeyboardEvent): void;
|
|
73
|
+
private dragOrigin;
|
|
74
|
+
protected onPointerDown(event: PointerEvent): void;
|
|
75
|
+
protected onPointerMove(event: PointerEvent): void;
|
|
76
|
+
protected onPointerUp(event: PointerEvent): void;
|
|
77
|
+
private setScale;
|
|
78
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiImagePreview, never>;
|
|
79
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiImagePreview, "ui-image-preview", never, { "src": { "alias": "src"; "required": true; "isSignal": true; }; "alt": { "alias": "alt"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "zoomStep": { "alias": "zoomStep"; "required": false; "isSignal": true; }; "minZoom": { "alias": "minZoom"; "required": false; "isSignal": true; }; "maxZoom": { "alias": "maxZoom"; "required": false; "isSignal": true; }; "downloadable": { "alias": "downloadable"; "required": false; "isSignal": true; }; "downloadName": { "alias": "downloadName"; "required": false; "isSignal": true; }; "dismissableMask": { "alias": "dismissableMask"; "required": false; "isSignal": true; }; "zoomInAriaLabel": { "alias": "zoomInAriaLabel"; "required": false; "isSignal": true; }; "zoomOutAriaLabel": { "alias": "zoomOutAriaLabel"; "required": false; "isSignal": true; }; "rotateLeftAriaLabel": { "alias": "rotateLeftAriaLabel"; "required": false; "isSignal": true; }; "rotateRightAriaLabel": { "alias": "rotateRightAriaLabel"; "required": false; "isSignal": true; }; "resetAriaLabel": { "alias": "resetAriaLabel"; "required": false; "isSignal": true; }; "downloadAriaLabel": { "alias": "downloadAriaLabel"; "required": false; "isSignal": true; }; "closeAriaLabel": { "alias": "closeAriaLabel"; "required": false; "isSignal": true; }; }, { "closed": "closed"; }, never, never, true, never>;
|
|
80
|
+
}
|
|
81
|
+
|
|
5
82
|
interface ModeMap {
|
|
6
83
|
base?: string;
|
|
7
84
|
light?: string;
|
|
@@ -32,19 +109,27 @@ declare function provideUiImageAssets(map: UiImageAssetsMap): Provider;
|
|
|
32
109
|
/**
|
|
33
110
|
* ui-image — theme/brand-aware image.
|
|
34
111
|
*
|
|
35
|
-
*
|
|
36
|
-
* theme/brand variants)
|
|
112
|
+
* Three sources: `name` (local asset key resolved through `assets-map.json`,
|
|
113
|
+
* theme/brand variants), `src` (remote/absolute URL — takes precedence), and
|
|
114
|
+
* `src` + `secured` (the URL is fetched through `HttpClient`, so the app's
|
|
115
|
+
* interceptors authenticate it, and the response `Blob` is shown from an object
|
|
116
|
+
* URL revoked with the component).
|
|
37
117
|
* Local `.svg` assets are inlined (`innerHTML`) so they can inherit CSS — after
|
|
38
118
|
* being scrubbed by `sanitizeInlineSvg()`; remote URLs always render through
|
|
39
|
-
* `<img [ngSrc]>` (never inlined)
|
|
119
|
+
* `<img [ngSrc]>` (never inlined), except `data:`/`blob:` payloads, which
|
|
120
|
+
* `NgOptimizedImage` rejects and a plain `<img>` renders.
|
|
40
121
|
* On load failure the `fallback` local asset is shown, then a token-styled
|
|
41
122
|
* placeholder if the fallback also fails (or none is provided).
|
|
123
|
+
*
|
|
124
|
+
* `preview` turns the image into a trigger for the enlarged view
|
|
125
|
+
* (`ui-image-preview`): zoom, rotation, pan, reset, optional download.
|
|
42
126
|
*/
|
|
43
127
|
declare class UiImage {
|
|
44
128
|
private readonly sanitizer;
|
|
45
129
|
private readonly assetsMap;
|
|
46
130
|
private readonly themeService;
|
|
47
131
|
private readonly brandService;
|
|
132
|
+
private readonly isBrowser;
|
|
48
133
|
/** Local asset key in `assets-map.json` (theme/brand-aware resolution). */
|
|
49
134
|
name: _angular_core.InputSignal<string | undefined>;
|
|
50
135
|
/** Remote/absolute URL, rendered via `NgOptimizedImage` — takes precedence over `name`. */
|
|
@@ -58,13 +143,69 @@ declare class UiImage {
|
|
|
58
143
|
height: _angular_core.InputSignal<string | number | undefined>;
|
|
59
144
|
heightUnit: _angular_core.InputSignal<string | undefined>;
|
|
60
145
|
alt: _angular_core.InputSignal<string | undefined>;
|
|
146
|
+
/**
|
|
147
|
+
* Fetch `src` through `HttpClient` instead of letting the browser load it.
|
|
148
|
+
*
|
|
149
|
+
* That is what an endpoint behind an `Authorization` header needs: an `<img
|
|
150
|
+
* src>` is a plain browser request, which carries no interceptor and no
|
|
151
|
+
* bearer token. The response `Blob` is shown from an object URL, revoked as
|
|
152
|
+
* soon as the source changes or the component goes away.
|
|
153
|
+
*
|
|
154
|
+
* Cross-origin still applies: the endpoint must answer the CORS preflight
|
|
155
|
+
* (`Access-Control-Allow-Origin`, and `Access-Control-Allow-Headers` for the
|
|
156
|
+
* auth header) — an `<img>` would have displayed it without any of that.
|
|
157
|
+
*/
|
|
158
|
+
secured: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
159
|
+
/** Send cookies/TLS credentials with the `secured` request (cross-origin sessions). */
|
|
160
|
+
withCredentials: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
161
|
+
/** Visible text of the loading indicator shown while a `secured` fetch is in flight. */
|
|
162
|
+
loadingLabel: _angular_core.InputSignal<string | undefined>;
|
|
163
|
+
/** Accessible name of that loading indicator. */
|
|
164
|
+
loadingAriaLabel: _angular_core.InputSignal<string>;
|
|
165
|
+
/** Clicking the image opens the enlarged view (`ui-image-preview`). */
|
|
166
|
+
preview: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
167
|
+
/** Enlarged view open state (two-way — set it to open the preview yourself). */
|
|
168
|
+
previewVisible: _angular_core.ModelSignal<boolean>;
|
|
169
|
+
/** Accessible name of the trigger (defaults to the image's own `alt`). */
|
|
170
|
+
previewAriaLabel: _angular_core.InputSignal<string | undefined>;
|
|
171
|
+
/** Accessible name of the enlarged view dialog. */
|
|
172
|
+
previewDialogAriaLabel: _angular_core.InputSignal<string>;
|
|
173
|
+
/** Zoom increment of one toolbar click, wheel notch or `+`/`-` press in the preview. */
|
|
174
|
+
zoomStep: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
175
|
+
/** Lower zoom bound in the preview. */
|
|
176
|
+
minZoom: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
177
|
+
/** Upper zoom bound in the preview. */
|
|
178
|
+
maxZoom: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
179
|
+
/** Offer a download action in the preview toolbar. */
|
|
180
|
+
downloadable: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
181
|
+
/** Filename proposed by that download action. */
|
|
182
|
+
downloadName: _angular_core.InputSignal<string | undefined>;
|
|
61
183
|
/** Emitted with the failed URL when an image fails to load. */
|
|
62
184
|
loadFailed: _angular_core.OutputEmitterRef<string>;
|
|
185
|
+
/**
|
|
186
|
+
* Replaces the hover indicator of the `preview` mode (the magnifier). Rendered
|
|
187
|
+
* over the image, decorative — the accessible name stays on the trigger.
|
|
188
|
+
*
|
|
189
|
+
* ```html
|
|
190
|
+
* <ui-image src="…" preview>
|
|
191
|
+
* <ng-template #previewIndicator>Agrandir</ng-template>
|
|
192
|
+
* </ui-image>
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
protected readonly previewIndicator: _angular_core.Signal<TemplateRef<unknown> | undefined>;
|
|
63
196
|
protected readonly isRemote: _angular_core.Signal<boolean>;
|
|
64
197
|
/** Inline SVG is reserved for LOCAL assets — a remote `.svg` renders through `<img>` (no XSS surface). */
|
|
65
198
|
protected readonly isInlineSvg: _angular_core.Signal<boolean>;
|
|
199
|
+
/** `secured` only means anything with a `src` to fetch. */
|
|
200
|
+
protected readonly isSecured: _angular_core.Signal<boolean>;
|
|
201
|
+
/** A `data:` payload is already the image — `NgOptimizedImage` refuses it. */
|
|
202
|
+
protected readonly isDataUrl: _angular_core.Signal<boolean>;
|
|
66
203
|
protected readonly localSrc: _angular_core.Signal<string>;
|
|
67
204
|
protected readonly fallbackSrc: _angular_core.Signal<string>;
|
|
205
|
+
private readonly blobResource;
|
|
206
|
+
private readonly blobUrl;
|
|
207
|
+
protected readonly securedLoading: _angular_core.Signal<boolean>;
|
|
208
|
+
private readonly securedFailed;
|
|
68
209
|
protected readonly primarySrc: _angular_core.Signal<string>;
|
|
69
210
|
private readonly primaryImgFailed;
|
|
70
211
|
private readonly fallbackImgFailed;
|
|
@@ -86,6 +227,10 @@ declare class UiImage {
|
|
|
86
227
|
protected readonly showFallback: _angular_core.Signal<boolean>;
|
|
87
228
|
protected readonly showPlaceholder: _angular_core.Signal<boolean>;
|
|
88
229
|
protected readonly displayedSrc: _angular_core.Signal<string>;
|
|
230
|
+
/** `blob:`/`data:` bypass `NgOptimizedImage`; a local fallback never does. */
|
|
231
|
+
protected readonly isRawSrc: _angular_core.Signal<boolean>;
|
|
232
|
+
/** The image is a preview trigger only once there is something to enlarge. */
|
|
233
|
+
protected readonly canPreview: _angular_core.Signal<boolean>;
|
|
89
234
|
protected readonly cssWidth: _angular_core.Signal<string | null>;
|
|
90
235
|
protected readonly cssHeight: _angular_core.Signal<string | null>;
|
|
91
236
|
constructor();
|
|
@@ -94,8 +239,8 @@ declare class UiImage {
|
|
|
94
239
|
private resolvePath;
|
|
95
240
|
private buildPath;
|
|
96
241
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiImage, never>;
|
|
97
|
-
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"; },
|
|
242
|
+
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; }; "secured": { "alias": "secured"; "required": false; "isSignal": true; }; "withCredentials": { "alias": "withCredentials"; "required": false; "isSignal": true; }; "loadingLabel": { "alias": "loadingLabel"; "required": false; "isSignal": true; }; "loadingAriaLabel": { "alias": "loadingAriaLabel"; "required": false; "isSignal": true; }; "preview": { "alias": "preview"; "required": false; "isSignal": true; }; "previewVisible": { "alias": "previewVisible"; "required": false; "isSignal": true; }; "previewAriaLabel": { "alias": "previewAriaLabel"; "required": false; "isSignal": true; }; "previewDialogAriaLabel": { "alias": "previewDialogAriaLabel"; "required": false; "isSignal": true; }; "zoomStep": { "alias": "zoomStep"; "required": false; "isSignal": true; }; "minZoom": { "alias": "minZoom"; "required": false; "isSignal": true; }; "maxZoom": { "alias": "maxZoom"; "required": false; "isSignal": true; }; "downloadable": { "alias": "downloadable"; "required": false; "isSignal": true; }; "downloadName": { "alias": "downloadName"; "required": false; "isSignal": true; }; }, { "previewVisible": "previewVisibleChange"; "loadFailed": "loadFailed"; }, ["previewIndicator"], never, true, never>;
|
|
98
243
|
}
|
|
99
244
|
|
|
100
|
-
export { UI_IMAGE_ASSETS, UiImage, provideUiImageAssets };
|
|
245
|
+
export { UI_IMAGE_ASSETS, UiImage, UiImagePreview, provideUiImageAssets };
|
|
101
246
|
export type { UiImageAssetsMap };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { TemplateRef } from '@angular/core';
|
|
3
|
+
import { BaseFormField } from '@4sh/ui-kit/forms';
|
|
4
|
+
import { UiInputIconContext } from '@4sh/ui-kit/forms/ui-input';
|
|
5
|
+
import { UiIconSize } from '@4sh/ui-kit/base/ui-icon';
|
|
6
|
+
|
|
7
|
+
/** Granularity of the field — picks which native control the browser renders. */
|
|
8
|
+
type InputDateMode = 'date' | 'time' | 'datetime';
|
|
9
|
+
/**
|
|
10
|
+
* Shape of the emitted value. **Identical to `ui-datepicker`'s**, so a host can swap one for
|
|
11
|
+
* the other (native picker on mobile, overlay on desktop) without converting anything.
|
|
12
|
+
*/
|
|
13
|
+
type InputDateValueType = 'date' | 'iso';
|
|
14
|
+
/** Value carried by the field, whichever `valueType` is in force. */
|
|
15
|
+
type InputDateValue = Date | string | null;
|
|
16
|
+
/**
|
|
17
|
+
* ui-input-date — **native** date/time field on the `ui-field` shell (label + box + helper).
|
|
18
|
+
*
|
|
19
|
+
* The picker belongs to the OS: the system wheel on mobile — which no overlay matches —
|
|
20
|
+
* and the browser's own calendar on desktop. That is the whole reason this component
|
|
21
|
+
* exists next to [`ui-datepicker`](../ui-datepicker), which owns the opposite trade: a
|
|
22
|
+
* calendar carried by the design system, with ranges, multi-month and inline modes.
|
|
23
|
+
*
|
|
24
|
+
* It is a sibling of `ui-input`, not a variant of it: three things a text field cannot do
|
|
25
|
+
* are settled here.
|
|
26
|
+
*
|
|
27
|
+
* 1. **The value is a date, not a string.** `valueType` commits to `Date` or to an ISO
|
|
28
|
+
* string, exactly as `ui-datepicker` does — that alignment is what lets a host branch
|
|
29
|
+
* between the two on viewport without converting anything.
|
|
30
|
+
* 2. **It emits on `change`, never on `input`.** A native temporal control blanks its own
|
|
31
|
+
* value while the entry is incomplete, so an `input`-driven field fires a burst of
|
|
32
|
+
* empty values as the user types — indistinguishable from clearing the field, and quite
|
|
33
|
+
* visible on an autosave or a dependent control.
|
|
34
|
+
* 3. **The label stays raised.** The browser draws its own `jj/mm/aaaa` template in the
|
|
35
|
+
* box, so a floating label at rest would land on top of it.
|
|
36
|
+
*
|
|
37
|
+
* No `placeholder`: the browser ignores it on these types, that template holding the spot.
|
|
38
|
+
*
|
|
39
|
+
* Standalone, `[(ngModel)]` or reactive forms (ControlValueAccessor via BaseFormField).
|
|
40
|
+
*/
|
|
41
|
+
declare class UiInputDate extends BaseFormField<InputDateValue> {
|
|
42
|
+
/** Granularity: a day, a time of day, or both. */
|
|
43
|
+
mode: _angular_core.InputSignal<InputDateMode>;
|
|
44
|
+
/**
|
|
45
|
+
* Shape of the emitted value: `'date'` (a plain `Date`) or `'iso'` (`yyyy-MM-dd`, or
|
|
46
|
+
* `yyyy-MM-ddTHH:mm` as soon as a time is part of it). Incoming values are accepted in
|
|
47
|
+
* **either** shape whatever this says — only the emitted side commits.
|
|
48
|
+
*/
|
|
49
|
+
valueType: _angular_core.InputSignal<InputDateValueType>;
|
|
50
|
+
/** Earliest accepted value, as a `Date` or in the ISO shape of the current `mode`. */
|
|
51
|
+
min: _angular_core.InputSignal<string | Date | undefined>;
|
|
52
|
+
/** Latest accepted value, same two shapes as {@link min}. */
|
|
53
|
+
max: _angular_core.InputSignal<string | Date | undefined>;
|
|
54
|
+
/**
|
|
55
|
+
* Native `step`: days on `date`, **seconds** on `time` / `datetime` (`900` = quarters of
|
|
56
|
+
* an hour; the browser's own default is `60`, i.e. whole minutes).
|
|
57
|
+
*/
|
|
58
|
+
step: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
59
|
+
icon: _angular_core.InputSignal<string | undefined>;
|
|
60
|
+
showIcon: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
61
|
+
/** Accessible name of the picker button. Defaults per {@link mode}. */
|
|
62
|
+
iconAriaLabel: _angular_core.InputSignal<string | undefined>;
|
|
63
|
+
/** Custom icon, as an input: same context as `ui-input`'s / `ui-datepicker`'s. */
|
|
64
|
+
iconTemplate: _angular_core.InputSignal<TemplateRef<UiInputIconContext> | undefined>;
|
|
65
|
+
/** Emitted when the browser commits a value — never mid-entry. */
|
|
66
|
+
valueChange: _angular_core.OutputEmitterRef<InputDateValue>;
|
|
67
|
+
/** Emitted when the field receives focus. */
|
|
68
|
+
inputFocus: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
69
|
+
/** Emitted when the field loses focus. */
|
|
70
|
+
inputBlur: _angular_core.OutputEmitterRef<FocusEvent>;
|
|
71
|
+
/** Custom icon: `<ng-template #icon let-name let-size="size">`. */
|
|
72
|
+
private readonly iconTemplateContent;
|
|
73
|
+
/** @ignore */
|
|
74
|
+
private readonly inputEl;
|
|
75
|
+
/** @ignore Icon size aligned with the field size, same pairing as `ui-input`. */
|
|
76
|
+
protected readonly iconSize: _angular_core.Signal<UiIconSize>;
|
|
77
|
+
/** @ignore Calendar, or clock when the field only carries a time. */
|
|
78
|
+
protected readonly resolvedIcon: _angular_core.Signal<string>;
|
|
79
|
+
/** @ignore */
|
|
80
|
+
protected readonly resolvedIconAriaLabel: _angular_core.Signal<string>;
|
|
81
|
+
/** @ignore Input wins over the projected `#icon` template. */
|
|
82
|
+
protected readonly resolvedIconTemplate: _angular_core.Signal<TemplateRef<UiInputIconContext> | undefined>;
|
|
83
|
+
/** @ignore */
|
|
84
|
+
protected readonly iconContext: _angular_core.Signal<UiInputIconContext>;
|
|
85
|
+
/** @ignore The native `type` the OS picker hangs off. */
|
|
86
|
+
protected readonly nativeType: _angular_core.Signal<string>;
|
|
87
|
+
/** @ignore Whether the value carries a time — decides both serializers. */
|
|
88
|
+
private readonly hasTimeComponent;
|
|
89
|
+
/** @ignore Model → the string the native control reads, `''` when there is no value. */
|
|
90
|
+
protected readonly nativeValue: _angular_core.Signal<string>;
|
|
91
|
+
/** @ignore Bounds go through the same serializer as the value: a caller may hand a `Date`
|
|
92
|
+
* or an already-native string, the attribute only ever sees the latter. */
|
|
93
|
+
protected readonly nativeMin: _angular_core.Signal<string | null>;
|
|
94
|
+
/** @ignore */
|
|
95
|
+
protected readonly nativeMax: _angular_core.Signal<string | null>;
|
|
96
|
+
/** @ignore Full `aria-describedby`: the message id, only when a message is rendered. */
|
|
97
|
+
protected readonly resolvedAriaDescribedBy: _angular_core.Signal<string | null>;
|
|
98
|
+
/** Focuses the field. */
|
|
99
|
+
focus(options?: FocusOptions): void;
|
|
100
|
+
openPicker(): void;
|
|
101
|
+
/** Native `<input>` element, for a composite host that needs direct DOM access. */
|
|
102
|
+
nativeInputElement(): HTMLInputElement;
|
|
103
|
+
/** @ignore */
|
|
104
|
+
protected uidPrefix(): string;
|
|
105
|
+
/**
|
|
106
|
+
* @ignore The browser committed a value — a complete one, or an empty one because the
|
|
107
|
+
* field was cleared. This is the only place a value leaves the component: `input` fires
|
|
108
|
+
* on every keystroke with the blanks in between, and is deliberately not listened to.
|
|
109
|
+
*/
|
|
110
|
+
protected onNativeChange(): void;
|
|
111
|
+
/** @ignore */
|
|
112
|
+
protected onBlur(event: FocusEvent): void;
|
|
113
|
+
/** @ignore Internal `Date` → the shape `valueType` commits to. Mirrors `ui-datepicker`'s
|
|
114
|
+
* own `serializeValue`, down to the fresh instance: the caller never gets a reference it
|
|
115
|
+
* could mutate behind our back. */
|
|
116
|
+
private serializeValue;
|
|
117
|
+
/** @ignore Incoming value, `Date` or ISO string, auto-detected — cloned when already a
|
|
118
|
+
* `Date`, symmetric with {@link serializeValue}. */
|
|
119
|
+
private parseValue;
|
|
120
|
+
/** @ignore `Date` → the exact string the native control of this `mode` accepts. */
|
|
121
|
+
private toNative;
|
|
122
|
+
/** @ignore The reverse. `null` on anything malformed — a bad value degrades to "no value"
|
|
123
|
+
* rather than throwing, the browser being the one that produced it. */
|
|
124
|
+
private fromNative;
|
|
125
|
+
/** @ignore A bound is optional, and a string one is already native. */
|
|
126
|
+
private toNativeBound;
|
|
127
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<UiInputDate, never>;
|
|
128
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<UiInputDate, "ui-input-date", never, { "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "valueType": { "alias": "valueType"; "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; }; "icon": { "alias": "icon"; "required": false; "isSignal": true; }; "showIcon": { "alias": "showIcon"; "required": false; "isSignal": true; }; "iconAriaLabel": { "alias": "iconAriaLabel"; "required": false; "isSignal": true; }; "iconTemplate": { "alias": "iconTemplate"; "required": false; "isSignal": true; }; }, { "valueChange": "valueChange"; "inputFocus": "inputFocus"; "inputBlur": "inputBlur"; }, ["iconTemplateContent"], never, true, never>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export { UiInputDate };
|
|
132
|
+
export type { InputDateMode, InputDateValue, InputDateValueType };
|
|
@@ -238,6 +238,48 @@ declare function autoFormatSegments(slots: MaskSlot[], data: string, { enforceBo
|
|
|
238
238
|
dataEnd: number;
|
|
239
239
|
};
|
|
240
240
|
|
|
241
|
+
/**
|
|
242
|
+
* Pure date helpers (no framework dependency), shared by every field that has to cross
|
|
243
|
+
* the `Date` ↔ ISO-string boundary — `ui-datepicker`, which parses what the user types,
|
|
244
|
+
* and `ui-input-date`, which reads what the browser's native picker hands back.
|
|
245
|
+
*
|
|
246
|
+
* They lived inside `ui-datepicker`'s entry point while it was the only caller (FSHSP-209
|
|
247
|
+
* moved them here). Two entry points must never import each other, so the second caller
|
|
248
|
+
* left one choice: the shared `forms/` entry point, which exists for exactly this — the
|
|
249
|
+
* helpers a field is built on. Serializing a `Date` from its LOCAL components rather than
|
|
250
|
+
* through `toISOString()` is the subtle part, and it must not be re-derived twice.
|
|
251
|
+
*/
|
|
252
|
+
declare function startOfDay(d: Date): Date;
|
|
253
|
+
declare function firstOfMonth(d: Date): Date;
|
|
254
|
+
declare function isSameDay(a: Date | null | undefined, b: Date | null | undefined): boolean;
|
|
255
|
+
declare function addDays(d: Date, n: number): Date;
|
|
256
|
+
declare function addMonths(d: Date, n: number): Date;
|
|
257
|
+
/** Build a Date and reject overflowed components (e.g. 31 Feb). */
|
|
258
|
+
declare function finalizeParsed(year: number, month: number, day: number, h: number, min: number): Date | null;
|
|
259
|
+
/** Serialize a `Date` to `"yyyy-MM-dd"` from its LOCAL components — never `toISOString()`
|
|
260
|
+
* (which converts to UTC and can shift the day by ±1 depending on the timezone). */
|
|
261
|
+
declare function toIsoDate(d: Date): string;
|
|
262
|
+
/** `"HH:mm"` — the shape a native `<input type="time">` reads and writes. */
|
|
263
|
+
declare function toIsoTime(d: Date): string;
|
|
264
|
+
/** `"yyyy-MM-ddTHH:mm"` — date part built the same local, never-UTC way as {@link toIsoDate}. */
|
|
265
|
+
declare function toIsoDateTime(d: Date): string;
|
|
266
|
+
/** Strict `"yyyy-MM-dd"` parser (rejects anything else, incl. overflowed dates via `finalizeParsed`). */
|
|
267
|
+
declare function parseIsoDate(s: string): Date | null;
|
|
268
|
+
/** Strict `"yyyy-MM-ddTHH:mm"` parser (`showTime`/`timeOnly` round-trip). */
|
|
269
|
+
declare function parseIsoDateTime(s: string): Date | null;
|
|
270
|
+
/**
|
|
271
|
+
* Strict `"HH:mm"` parser, anchored on `reference` (default: today).
|
|
272
|
+
*
|
|
273
|
+
* A bare time is not a point in time; the caller has to say on which day it lands. Mirrors
|
|
274
|
+
* what `ui-datepicker` does in `timeOnly` mode — it too carries a full `Date` — so both
|
|
275
|
+
* components hand back the same shape.
|
|
276
|
+
*/
|
|
277
|
+
declare function parseIsoTime(s: string, reference?: Date): Date | null;
|
|
278
|
+
/** Accepts a `Date` as-is, or parses a `"yyyy-MM-dd"` string — used to let config inputs
|
|
279
|
+
* (`minDate`/`maxDate`/`disabledDates`) take either shape. Invalid strings degrade to `null`
|
|
280
|
+
* (no constraint) rather than throwing: a malformed config shouldn't crash the picker. */
|
|
281
|
+
declare function normalizeDateInput(v: Date | string | null | undefined): Date | null;
|
|
282
|
+
|
|
241
283
|
/**
|
|
242
284
|
* Shared option-resolution helpers for list-based form fields
|
|
243
285
|
* (`ui-select`, `ui-autocomplete`, `ui-input-tags`).
|
|
@@ -287,5 +329,5 @@ declare function formatLabel(template: string, value: string | number): string;
|
|
|
287
329
|
|
|
288
330
|
declare function warnMissingAccessibleName(componentTag: string, message: string): void;
|
|
289
331
|
|
|
290
|
-
export { BaseControlValueAccessor, BaseFieldControl, BaseFormField, MASK_TOKENS, acceptsMaskChar, applyMaskTemplate, autoFormatSegments, buildMaskSlots, caretForMask, createOptionResolver, dropdownOverlayPositions, extractMaskData, formatLabel, parseMaskRanges, warnMissingAccessibleName };
|
|
332
|
+
export { BaseControlValueAccessor, BaseFieldControl, BaseFormField, MASK_TOKENS, acceptsMaskChar, addDays, addMonths, applyMaskTemplate, autoFormatSegments, buildMaskSlots, caretForMask, createOptionResolver, dropdownOverlayPositions, extractMaskData, finalizeParsed, firstOfMonth, formatLabel, isSameDay, normalizeDateInput, parseIsoDate, parseIsoDateTime, parseIsoTime, parseMaskRanges, startOfDay, toIsoDate, toIsoDateTime, toIsoTime, warnMissingAccessibleName };
|
|
291
333
|
export type { FieldFloatLabel, FieldLevel, FieldSize, MaskBounds, MaskBuildResult, MaskSlot, OptionEntry, OptionResolver, OptionResolverFields };
|
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Background scroll lock shared by every full-screen overlay of the kit
|
|
3
|
+
* (modal, drawer, bottom-sheet, sidebar, image preview).
|
|
4
|
+
*
|
|
5
|
+
* The counter below is module state, so it is only shared as long as every
|
|
6
|
+
* caller resolves to **this** module. That is the whole point of the helper
|
|
7
|
+
* living in a cross-cutting entry point: a copy pasted into a component's own
|
|
8
|
+
* entry point is a separate compilation unit, hence a separate counter, and two
|
|
9
|
+
* overlays from two different entry points then release the body independently
|
|
10
|
+
* — the second one to close restores an `overflow` it captured while already
|
|
11
|
+
* locked, unfreezing the page under the overlay that is still open (or leaving
|
|
12
|
+
* a stale scrollbar gutter once the last one closes).
|
|
13
|
+
*
|
|
14
|
+
* Never re-declare these functions inside a component: import them from
|
|
15
|
+
* `@4sh/ui-kit/overlay`.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Freeze background scroll, compensating the scrollbar gutter to avoid a shift.
|
|
19
|
+
*
|
|
20
|
+
* Ref-counted: nested overlays each take a lock, and only the first one touches
|
|
21
|
+
* the body. Every call must be paired with exactly one {@link unlockBodyScroll}
|
|
22
|
+
* — hold the pairing in the caller (a `locked` flag released on close *and* on
|
|
23
|
+
* destroy), since the helper cannot tell one overlay's locks from another's.
|
|
24
|
+
*
|
|
25
|
+
* @param doc The document owning the `body` to freeze (inject `DOCUMENT`).
|
|
26
|
+
*/
|
|
27
|
+
declare function lockBodyScroll(doc: Document): void;
|
|
28
|
+
/**
|
|
29
|
+
* Release one scroll lock; restore the body when the last overlay closes.
|
|
30
|
+
*
|
|
31
|
+
* @param doc The document passed to the matching {@link lockBodyScroll}.
|
|
32
|
+
*/
|
|
33
|
+
declare function unlockBodyScroll(doc: Document): void;
|
|
34
|
+
|
|
1
35
|
/**
|
|
2
36
|
* Auto-dismiss shared by every floating panel of the kit (menu, context menu,
|
|
3
37
|
* popover, select, autocomplete, input-tags, datepicker, tooltip).
|
|
@@ -28,4 +62,4 @@
|
|
|
28
62
|
*/
|
|
29
63
|
declare function closeOnNavigation(close: () => void): void;
|
|
30
64
|
|
|
31
|
-
export { closeOnNavigation };
|
|
65
|
+
export { closeOnNavigation, lockBodyScroll, unlockBodyScroll };
|