@4sh/ui-kit 0.9.0 → 0.10.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.
@@ -0,0 +1,179 @@
1
+ import * as i0 from '@angular/core';
2
+ import { input, numberAttribute, output, viewChild, computed, forwardRef, Component } from '@angular/core';
3
+ import { NG_VALUE_ACCESSOR } from '@angular/forms';
4
+ import { BaseFormField, startOfDay, toIsoTime, toIsoDateTime, toIsoDate, parseIsoTime, parseIsoDateTime, parseIsoDate } from '@4sh/ui-kit/forms';
5
+ import { UiField } from '@4sh/ui-kit/forms/ui-field';
6
+
7
+ /** `mode` → the native `type` that draws the OS picker. */
8
+ const NATIVE_TYPE = {
9
+ date: 'date',
10
+ time: 'time',
11
+ datetime: 'datetime-local',
12
+ };
13
+ /**
14
+ * ui-input-date — **native** date/time field on the `ui-field` shell (label + box + helper).
15
+ *
16
+ * The picker belongs to the OS: the system wheel on mobile — which no overlay matches —
17
+ * and the browser's own calendar on desktop. That is the whole reason this component
18
+ * exists next to [`ui-datepicker`](../ui-datepicker), which owns the opposite trade: a
19
+ * calendar carried by the design system, with ranges, multi-month and inline modes.
20
+ *
21
+ * It is a sibling of `ui-input`, not a variant of it: three things a text field cannot do
22
+ * are settled here.
23
+ *
24
+ * 1. **The value is a date, not a string.** `valueType` commits to `Date` or to an ISO
25
+ * string, exactly as `ui-datepicker` does — that alignment is what lets a host branch
26
+ * between the two on viewport without converting anything.
27
+ * 2. **It emits on `change`, never on `input`.** A native temporal control blanks its own
28
+ * value while the entry is incomplete, so an `input`-driven field fires a burst of
29
+ * empty values as the user types — indistinguishable from clearing the field, and quite
30
+ * visible on an autosave or a dependent control.
31
+ * 3. **The label stays raised.** The browser draws its own `jj/mm/aaaa` template in the
32
+ * box, so a floating label at rest would land on top of it.
33
+ *
34
+ * No `placeholder`: the browser ignores it on these types, that template holding the spot.
35
+ *
36
+ * Standalone, `[(ngModel)]` or reactive forms (ControlValueAccessor via BaseFormField).
37
+ */
38
+ class UiInputDate extends BaseFormField {
39
+ constructor() {
40
+ super(...arguments);
41
+ /** Granularity: a day, a time of day, or both. */
42
+ this.mode = input('date', /* @ts-ignore */
43
+ ...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
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
+ this.valueType = input('date', /* @ts-ignore */
50
+ ...(ngDevMode ? [{ debugName: "valueType" }] : /* istanbul ignore next */ []));
51
+ /** Earliest accepted value, as a `Date` or in the ISO shape of the current `mode`. */
52
+ this.min = input(/* @ts-ignore */
53
+ ...(ngDevMode ? [undefined, { debugName: "min" }] : /* istanbul ignore next */ []));
54
+ /** Latest accepted value, same two shapes as {@link min}. */
55
+ this.max = input(/* @ts-ignore */
56
+ ...(ngDevMode ? [undefined, { debugName: "max" }] : /* istanbul ignore next */ []));
57
+ /**
58
+ * Native `step`: days on `date`, **seconds** on `time` / `datetime` (`900` = quarters of
59
+ * an hour; the browser's own default is `60`, i.e. whole minutes).
60
+ */
61
+ this.step = input(undefined, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: numberAttribute });
62
+ /** Emitted when the browser commits a value — never mid-entry. */
63
+ this.valueChange = output();
64
+ /** Emitted when the field receives focus. */
65
+ this.inputFocus = output();
66
+ /** Emitted when the field loses focus. */
67
+ this.inputBlur = output();
68
+ /** @ignore */
69
+ this.inputEl = viewChild.required('inputEl', /* @ts-ignore */
70
+ ...(ngDevMode ? [{ debugName: "inputEl" }] : /* istanbul ignore next */ []));
71
+ /** @ignore The native `type` the OS picker hangs off. */
72
+ this.nativeType = computed(() => NATIVE_TYPE[this.mode()], /* @ts-ignore */
73
+ ...(ngDevMode ? [{ debugName: "nativeType" }] : /* istanbul ignore next */ []));
74
+ /** @ignore Whether the value carries a time — decides both serializers. */
75
+ this.hasTimeComponent = computed(() => this.mode() !== 'date', /* @ts-ignore */
76
+ ...(ngDevMode ? [{ debugName: "hasTimeComponent" }] : /* istanbul ignore next */ []));
77
+ /** @ignore Model → the string the native control reads, `''` when there is no value. */
78
+ this.nativeValue = computed(() => {
79
+ const date = this.parseValue(this.modelValue() ?? null);
80
+ return date ? this.toNative(date) : '';
81
+ }, /* @ts-ignore */
82
+ ...(ngDevMode ? [{ debugName: "nativeValue" }] : /* istanbul ignore next */ []));
83
+ /** @ignore Bounds go through the same serializer as the value: a caller may hand a `Date`
84
+ * or an already-native string, the attribute only ever sees the latter. */
85
+ this.nativeMin = computed(() => this.toNativeBound(this.min()), /* @ts-ignore */
86
+ ...(ngDevMode ? [{ debugName: "nativeMin" }] : /* istanbul ignore next */ []));
87
+ /** @ignore */
88
+ this.nativeMax = computed(() => this.toNativeBound(this.max()), /* @ts-ignore */
89
+ ...(ngDevMode ? [{ debugName: "nativeMax" }] : /* istanbul ignore next */ []));
90
+ /** @ignore Full `aria-describedby`: the message id, only when a message is rendered. */
91
+ this.resolvedAriaDescribedBy = computed(() => this.displayMessage() ? this.messageId() : null, /* @ts-ignore */
92
+ ...(ngDevMode ? [{ debugName: "resolvedAriaDescribedBy" }] : /* istanbul ignore next */ []));
93
+ }
94
+ /** Focuses the field. */
95
+ focus(options) {
96
+ this.inputEl().nativeElement.focus(options);
97
+ }
98
+ /** Native `<input>` element, for a composite host that needs direct DOM access. */
99
+ nativeInputElement() {
100
+ return this.inputEl().nativeElement;
101
+ }
102
+ /** @ignore */
103
+ uidPrefix() {
104
+ return 'ui-input-date';
105
+ }
106
+ /**
107
+ * @ignore The browser committed a value — a complete one, or an empty one because the
108
+ * field was cleared. This is the only place a value leaves the component: `input` fires
109
+ * on every keystroke with the blanks in between, and is deliberately not listened to.
110
+ */
111
+ onNativeChange() {
112
+ const raw = this.inputEl().nativeElement.value;
113
+ const date = raw ? this.fromNative(raw) : null;
114
+ const value = date ? this.serializeValue(date) : null;
115
+ this.modelValue.set(value);
116
+ this.emitChange(value);
117
+ this.valueChange.emit(value);
118
+ }
119
+ /** @ignore */
120
+ onBlur(event) {
121
+ this.emitTouch();
122
+ this.inputBlur.emit(event);
123
+ }
124
+ /** @ignore Internal `Date` → the shape `valueType` commits to. Mirrors `ui-datepicker`'s
125
+ * own `serializeValue`, down to the fresh instance: the caller never gets a reference it
126
+ * could mutate behind our back. */
127
+ serializeValue(date) {
128
+ if (this.valueType() === 'iso')
129
+ return this.toNative(date);
130
+ return this.hasTimeComponent() ? new Date(date) : startOfDay(date);
131
+ }
132
+ /** @ignore Incoming value, `Date` or ISO string, auto-detected — cloned when already a
133
+ * `Date`, symmetric with {@link serializeValue}. */
134
+ parseValue(value) {
135
+ if (value === undefined || value === null || value === '')
136
+ return null;
137
+ return value instanceof Date ? new Date(value) : this.fromNative(value);
138
+ }
139
+ /** @ignore `Date` → the exact string the native control of this `mode` accepts. */
140
+ toNative(date) {
141
+ if (this.mode() === 'time')
142
+ return toIsoTime(date);
143
+ return this.hasTimeComponent() ? toIsoDateTime(date) : toIsoDate(date);
144
+ }
145
+ /** @ignore The reverse. `null` on anything malformed — a bad value degrades to "no value"
146
+ * rather than throwing, the browser being the one that produced it. */
147
+ fromNative(value) {
148
+ if (this.mode() === 'time')
149
+ return parseIsoTime(value);
150
+ return this.hasTimeComponent() ? parseIsoDateTime(value) : parseIsoDate(value);
151
+ }
152
+ /** @ignore A bound is optional, and a string one is already native. */
153
+ toNativeBound(bound) {
154
+ if (!bound)
155
+ return null;
156
+ return bound instanceof Date ? this.toNative(bound) : bound;
157
+ }
158
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: UiInputDate, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
159
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.1.5", type: UiInputDate, isStandalone: true, selector: "ui-input-date", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null }, valueType: { classPropertyName: "valueType", publicName: "valueType", isSignal: true, isRequired: false, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", inputFocus: "inputFocus", inputBlur: "inputBlur" }, providers: [
160
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputDate), multi: true },
161
+ ], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"true\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n <!-- `filled` is hard-coded above, and it is not a shortcut: the browser draws its own\n `jj/mm/aaaa` template in the box, so this field is never visually empty. A floating\n label at rest would sit on top of that template. -->\n <input\n #inputEl\n class=\"ui-input-date-native\"\n [class._small]=\"size() === 'small'\"\n [type]=\"nativeType()\"\n [id]=\"resolvedId()\"\n [value]=\"nativeValue()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.min]=\"nativeMin()\"\n [attr.max]=\"nativeMax()\"\n [attr.step]=\"step() ?? null\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"resolvedAriaDescribedBy()\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"inputFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n</ui-field>\n", styles: [".ui-input-date-native{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--ui-form-field-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-form-field-color, var(--form-high-content-default))}.ui-input-date-native:first-child{padding-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-date-native:last-child{padding-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-date-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-date-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-date-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-date-native._small{font-size:var(--ui-input-date-font-size-small, var(--size-typography-text-md))}.ui-input-date-native{-webkit-appearance:none;appearance:none}.ui-input-date-native::-webkit-date-and-time-value{text-align:left;margin:0}.ui-input-date-native::-webkit-calendar-picker-indicator{cursor:pointer}:host-context([data-theme=dark]) .ui-input-date-native{color-scheme:dark}\n"], dependencies: [{ kind: "component", type: UiField, selector: "ui-field", inputs: ["label", "for", "required", "size", "level", "floatLabel", "filled", "disabled", "readonly", "multiline", "autoHeight", "message", "messageId", "showMessageIcon", "messageIcon", "hasFooter", "hasPrefix"] }] }); }
162
+ }
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: UiInputDate, decorators: [{
164
+ type: Component,
165
+ args: [{ selector: 'ui-input-date', imports: [UiField], providers: [
166
+ { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputDate), multi: true },
167
+ ], template: "<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"true\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n <!-- `filled` is hard-coded above, and it is not a shortcut: the browser draws its own\n `jj/mm/aaaa` template in the box, so this field is never visually empty. A floating\n label at rest would sit on top of that template. -->\n <input\n #inputEl\n class=\"ui-input-date-native\"\n [class._small]=\"size() === 'small'\"\n [type]=\"nativeType()\"\n [id]=\"resolvedId()\"\n [value]=\"nativeValue()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.min]=\"nativeMin()\"\n [attr.max]=\"nativeMax()\"\n [attr.step]=\"step() ?? null\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"resolvedAriaDescribedBy()\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"inputFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n</ui-field>\n", styles: [".ui-input-date-native{flex:1 1 auto;align-self:stretch;min-width:0;margin:0;padding:0;border:none;border-radius:inherit;background:transparent;outline:none;font-family:var(--ui-form-field-font-family, var(--fontfamily-base));font-size:var(--size-typography-text-default);color:var(--ui-form-field-color, var(--form-high-content-default))}.ui-input-date-native:first-child{padding-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-date-native:last-child{padding-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-date-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-date-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-date-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-date-native._small{font-size:var(--ui-input-date-font-size-small, var(--size-typography-text-md))}.ui-input-date-native{-webkit-appearance:none;appearance:none}.ui-input-date-native::-webkit-date-and-time-value{text-align:left;margin:0}.ui-input-date-native::-webkit-calendar-picker-indicator{cursor:pointer}:host-context([data-theme=dark]) .ui-input-date-native{color-scheme:dark}\n"] }]
168
+ }], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], valueType: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueType", required: false }] }], min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }] } });
169
+
170
+ /*
171
+ * Public API Surface of ui-kit/ui-input-date
172
+ */
173
+
174
+ /**
175
+ * Generated bundle index. Do not edit.
176
+ */
177
+
178
+ export { UiInputDate };
179
+ //# sourceMappingURL=4sh-ui-kit-forms-ui-input-date.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"4sh-ui-kit-forms-ui-input-date.mjs","sources":["../../../projects/ui-kit/forms/ui-input-date/src/lib/ui-input-date.ts","../../../projects/ui-kit/forms/ui-input-date/src/lib/ui-input-date.html","../../../projects/ui-kit/forms/ui-input-date/src/public-api.ts","../../../projects/ui-kit/forms/ui-input-date/src/4sh-ui-kit-forms-ui-input-date.ts"],"sourcesContent":["import {\n Component,\n computed,\n ElementRef,\n forwardRef,\n input,\n numberAttribute,\n output,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport {\n BaseFormField,\n parseIsoDate,\n parseIsoDateTime,\n parseIsoTime,\n startOfDay,\n toIsoDate,\n toIsoDateTime,\n toIsoTime,\n} from '@4sh/ui-kit/forms';\nimport { UiField } from '@4sh/ui-kit/forms/ui-field';\n\n/** Granularity of the field — picks which native control the browser renders. */\nexport type InputDateMode = 'date' | 'time' | 'datetime';\n\n/**\n * Shape of the emitted value. **Identical to `ui-datepicker`'s**, so a host can swap one for\n * the other (native picker on mobile, overlay on desktop) without converting anything.\n */\nexport type InputDateValueType = 'date' | 'iso';\n\n/** Value carried by the field, whichever `valueType` is in force. */\nexport type InputDateValue = Date | string | null;\n\n/** `mode` → the native `type` that draws the OS picker. */\nconst NATIVE_TYPE: Record<InputDateMode, string> = {\n date: 'date',\n time: 'time',\n datetime: 'datetime-local',\n};\n\n/**\n * ui-input-date — **native** date/time field on the `ui-field` shell (label + box + helper).\n *\n * The picker belongs to the OS: the system wheel on mobile — which no overlay matches —\n * and the browser's own calendar on desktop. That is the whole reason this component\n * exists next to [`ui-datepicker`](../ui-datepicker), which owns the opposite trade: a\n * calendar carried by the design system, with ranges, multi-month and inline modes.\n *\n * It is a sibling of `ui-input`, not a variant of it: three things a text field cannot do\n * are settled here.\n *\n * 1. **The value is a date, not a string.** `valueType` commits to `Date` or to an ISO\n * string, exactly as `ui-datepicker` does — that alignment is what lets a host branch\n * between the two on viewport without converting anything.\n * 2. **It emits on `change`, never on `input`.** A native temporal control blanks its own\n * value while the entry is incomplete, so an `input`-driven field fires a burst of\n * empty values as the user types — indistinguishable from clearing the field, and quite\n * visible on an autosave or a dependent control.\n * 3. **The label stays raised.** The browser draws its own `jj/mm/aaaa` template in the\n * box, so a floating label at rest would land on top of it.\n *\n * No `placeholder`: the browser ignores it on these types, that template holding the spot.\n *\n * Standalone, `[(ngModel)]` or reactive forms (ControlValueAccessor via BaseFormField).\n */\n@Component({\n selector: 'ui-input-date',\n imports: [UiField],\n templateUrl: './ui-input-date.html',\n styleUrl: './ui-input-date.scss',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputDate), multi: true },\n ],\n})\nexport class UiInputDate extends BaseFormField<InputDateValue> {\n /** Granularity: a day, a time of day, or both. */\n mode = input<InputDateMode>('date');\n /**\n * Shape of the emitted value: `'date'` (a plain `Date`) or `'iso'` (`yyyy-MM-dd`, or\n * `yyyy-MM-ddTHH:mm` as soon as a time is part of it). Incoming values are accepted in\n * **either** shape whatever this says — only the emitted side commits.\n */\n valueType = input<InputDateValueType>('date');\n /** Earliest accepted value, as a `Date` or in the ISO shape of the current `mode`. */\n min = input<Date | string>();\n /** Latest accepted value, same two shapes as {@link min}. */\n max = input<Date | string>();\n /**\n * Native `step`: days on `date`, **seconds** on `time` / `datetime` (`900` = quarters of\n * an hour; the browser's own default is `60`, i.e. whole minutes).\n */\n step = input<number, unknown>(undefined, { transform: numberAttribute });\n\n /** Emitted when the browser commits a value — never mid-entry. */\n valueChange = output<InputDateValue>();\n /** Emitted when the field receives focus. */\n inputFocus = output<FocusEvent>();\n /** Emitted when the field loses focus. */\n inputBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n\n /** @ignore The native `type` the OS picker hangs off. */\n protected readonly nativeType = computed(() => NATIVE_TYPE[this.mode()]);\n /** @ignore Whether the value carries a time — decides both serializers. */\n private readonly hasTimeComponent = computed(() => this.mode() !== 'date');\n\n /** @ignore Model → the string the native control reads, `''` when there is no value. */\n protected readonly nativeValue = computed(() => {\n const date = this.parseValue(this.modelValue() ?? null);\n return date ? this.toNative(date) : '';\n });\n /** @ignore Bounds go through the same serializer as the value: a caller may hand a `Date`\n * or an already-native string, the attribute only ever sees the latter. */\n protected readonly nativeMin = computed(() => this.toNativeBound(this.min()));\n /** @ignore */\n protected readonly nativeMax = computed(() => this.toNativeBound(this.max()));\n\n /** @ignore Full `aria-describedby`: the message id, only when a message is rendered. */\n protected readonly resolvedAriaDescribedBy = computed(() =>\n this.displayMessage() ? this.messageId() : null,\n );\n\n /** Focuses the field. */\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** Native `<input>` element, for a composite host that needs direct DOM access. */\n nativeInputElement(): HTMLInputElement {\n return this.inputEl().nativeElement;\n }\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-input-date';\n }\n\n /**\n * @ignore The browser committed a value — a complete one, or an empty one because the\n * field was cleared. This is the only place a value leaves the component: `input` fires\n * on every keystroke with the blanks in between, and is deliberately not listened to.\n */\n protected onNativeChange(): void {\n const raw = this.inputEl().nativeElement.value;\n const date = raw ? this.fromNative(raw) : null;\n const value = date ? this.serializeValue(date) : null;\n this.modelValue.set(value);\n this.emitChange(value);\n this.valueChange.emit(value);\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.inputBlur.emit(event);\n }\n\n /** @ignore Internal `Date` → the shape `valueType` commits to. Mirrors `ui-datepicker`'s\n * own `serializeValue`, down to the fresh instance: the caller never gets a reference it\n * could mutate behind our back. */\n private serializeValue(date: Date): InputDateValue {\n if (this.valueType() === 'iso') return this.toNative(date);\n return this.hasTimeComponent() ? new Date(date) : startOfDay(date);\n }\n\n /** @ignore Incoming value, `Date` or ISO string, auto-detected — cloned when already a\n * `Date`, symmetric with {@link serializeValue}. */\n private parseValue(value: InputDateValue | undefined): Date | null {\n if (value === undefined || value === null || value === '') return null;\n return value instanceof Date ? new Date(value) : this.fromNative(value);\n }\n\n /** @ignore `Date` → the exact string the native control of this `mode` accepts. */\n private toNative(date: Date): string {\n if (this.mode() === 'time') return toIsoTime(date);\n return this.hasTimeComponent() ? toIsoDateTime(date) : toIsoDate(date);\n }\n\n /** @ignore The reverse. `null` on anything malformed — a bad value degrades to \"no value\"\n * rather than throwing, the browser being the one that produced it. */\n private fromNative(value: string): Date | null {\n if (this.mode() === 'time') return parseIsoTime(value);\n return this.hasTimeComponent() ? parseIsoDateTime(value) : parseIsoDate(value);\n }\n\n /** @ignore A bound is optional, and a string one is already native. */\n private toNativeBound(bound: Date | string | undefined): string | null {\n if (!bound) return null;\n return bound instanceof Date ? this.toNative(bound) : bound;\n }\n}\n","<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"true\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n <!-- `filled` is hard-coded above, and it is not a shortcut: the browser draws its own\n `jj/mm/aaaa` template in the box, so this field is never visually empty. A floating\n label at rest would sit on top of that template. -->\n <input\n #inputEl\n class=\"ui-input-date-native\"\n [class._small]=\"size() === 'small'\"\n [type]=\"nativeType()\"\n [id]=\"resolvedId()\"\n [value]=\"nativeValue()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.min]=\"nativeMin()\"\n [attr.max]=\"nativeMax()\"\n [attr.step]=\"step() ?? null\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"resolvedAriaDescribedBy()\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"inputFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n</ui-field>\n","/*\n * Public API Surface of ui-kit/ui-input-date\n */\n\nexport * from './lib/ui-input-date';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAmCA;AACA,MAAM,WAAW,GAAkC;AACjD,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,IAAI,E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;SACxF,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,SAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,SAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC1EH,48CA0CA,qzCD2BY,OAAO,EAAA,QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,KAAA,EAAA,UAAA,EAAA,MAAA,EAAA,OAAA,EAAA,YAAA,EAAA,QAAA,EAAA,UAAA,EAAA,UAAA,EAAA,WAAA,EAAA,YAAA,EAAA,SAAA,EAAA,WAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,WAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAON,WAAW,EAAA,UAAA,EAAA,CAAA;kBATvB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,EAAA,OAAA,EAChB,CAAC,OAAO,CAAC,EAAA,SAAA,EAGP;AACT,wBAAA,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;AACxF,qBAAA,EAAA,QAAA,EAAA,48CAAA,EAAA,MAAA,EAAA,CAAA,6vCAAA,CAAA,EAAA;8qBA6B2E,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEvGvF;;AAEG;;ACFH;;AAEG;;"}
@@ -462,6 +462,104 @@ function autoFormatSegments(slots, data, { enforceBounds = true } = {}) {
462
462
  return { text, tokenIndices, dataEnd };
463
463
  }
464
464
 
465
+ /**
466
+ * Pure date helpers (no framework dependency), shared by every field that has to cross
467
+ * the `Date` ↔ ISO-string boundary — `ui-datepicker`, which parses what the user types,
468
+ * and `ui-input-date`, which reads what the browser's native picker hands back.
469
+ *
470
+ * They lived inside `ui-datepicker`'s entry point while it was the only caller (FSHSP-209
471
+ * moved them here). Two entry points must never import each other, so the second caller
472
+ * left one choice: the shared `forms/` entry point, which exists for exactly this — the
473
+ * helpers a field is built on. Serializing a `Date` from its LOCAL components rather than
474
+ * through `toISOString()` is the subtle part, and it must not be re-derived twice.
475
+ */
476
+ function startOfDay(d) {
477
+ const x = new Date(d);
478
+ x.setHours(0, 0, 0, 0);
479
+ return x;
480
+ }
481
+ function firstOfMonth(d) {
482
+ return new Date(d.getFullYear(), d.getMonth(), 1);
483
+ }
484
+ function isSameDay(a, b) {
485
+ if (!a || !b)
486
+ return false;
487
+ return (a.getFullYear() === b.getFullYear() &&
488
+ a.getMonth() === b.getMonth() &&
489
+ a.getDate() === b.getDate());
490
+ }
491
+ function addDays(d, n) {
492
+ const x = new Date(d);
493
+ x.setDate(x.getDate() + n);
494
+ return x;
495
+ }
496
+ function addMonths(d, n) {
497
+ return new Date(d.getFullYear(), d.getMonth() + n, 1);
498
+ }
499
+ /** Build a Date and reject overflowed components (e.g. 31 Feb). */
500
+ function finalizeParsed(year, month, day, h, min) {
501
+ if (month < 0 || month > 11 || day < 1 || day > 31 || h > 23 || min > 59)
502
+ return null;
503
+ const d = new Date(year, month, day, h, min, 0, 0);
504
+ if (d.getFullYear() !== year || d.getMonth() !== month || d.getDate() !== day)
505
+ return null;
506
+ return d;
507
+ }
508
+ const ISO_DATE_RE = /^(\d{4})-(\d{2})-(\d{2})$/;
509
+ const ISO_DATETIME_RE = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/;
510
+ const ISO_TIME_RE = /^(\d{2}):(\d{2})$/;
511
+ function pad2(n) {
512
+ return String(n).padStart(2, '0');
513
+ }
514
+ /** Serialize a `Date` to `"yyyy-MM-dd"` from its LOCAL components — never `toISOString()`
515
+ * (which converts to UTC and can shift the day by ±1 depending on the timezone). */
516
+ function toIsoDate(d) {
517
+ return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;
518
+ }
519
+ /** `"HH:mm"` — the shape a native `<input type="time">` reads and writes. */
520
+ function toIsoTime(d) {
521
+ return `${pad2(d.getHours())}:${pad2(d.getMinutes())}`;
522
+ }
523
+ /** `"yyyy-MM-ddTHH:mm"` — date part built the same local, never-UTC way as {@link toIsoDate}. */
524
+ function toIsoDateTime(d) {
525
+ return `${toIsoDate(d)}T${pad2(d.getHours())}:${pad2(d.getMinutes())}`;
526
+ }
527
+ /** Strict `"yyyy-MM-dd"` parser (rejects anything else, incl. overflowed dates via `finalizeParsed`). */
528
+ function parseIsoDate(s) {
529
+ const m = ISO_DATE_RE.exec(s);
530
+ if (!m)
531
+ return null;
532
+ return finalizeParsed(Number(m[1]), Number(m[2]) - 1, Number(m[3]), 0, 0);
533
+ }
534
+ /** Strict `"yyyy-MM-ddTHH:mm"` parser (`showTime`/`timeOnly` round-trip). */
535
+ function parseIsoDateTime(s) {
536
+ const m = ISO_DATETIME_RE.exec(s);
537
+ if (!m)
538
+ return null;
539
+ return finalizeParsed(Number(m[1]), Number(m[2]) - 1, Number(m[3]), Number(m[4]), Number(m[5]));
540
+ }
541
+ /**
542
+ * Strict `"HH:mm"` parser, anchored on `reference` (default: today).
543
+ *
544
+ * A bare time is not a point in time; the caller has to say on which day it lands. Mirrors
545
+ * what `ui-datepicker` does in `timeOnly` mode — it too carries a full `Date` — so both
546
+ * components hand back the same shape.
547
+ */
548
+ function parseIsoTime(s, reference = new Date()) {
549
+ const m = ISO_TIME_RE.exec(s);
550
+ if (!m)
551
+ return null;
552
+ return finalizeParsed(reference.getFullYear(), reference.getMonth(), reference.getDate(), Number(m[1]), Number(m[2]));
553
+ }
554
+ /** Accepts a `Date` as-is, or parses a `"yyyy-MM-dd"` string — used to let config inputs
555
+ * (`minDate`/`maxDate`/`disabledDates`) take either shape. Invalid strings degrade to `null`
556
+ * (no constraint) rather than throwing: a malformed config shouldn't crash the picker. */
557
+ function normalizeDateInput(v) {
558
+ if (!v)
559
+ return null;
560
+ return v instanceof Date ? v : parseIsoDate(v);
561
+ }
562
+
465
563
  /**
466
564
  * Shared option-resolution helpers for list-based form fields
467
565
  * (`ui-select`, `ui-autocomplete`, `ui-input-tags`).
@@ -549,5 +647,5 @@ function warnMissingAccessibleName(componentTag, message) {
549
647
  * Generated bundle index. Do not edit.
550
648
  */
551
649
 
552
- export { BaseControlValueAccessor, BaseFieldControl, BaseFormField, MASK_TOKENS, acceptsMaskChar, applyMaskTemplate, autoFormatSegments, buildMaskSlots, caretForMask, createOptionResolver, dropdownOverlayPositions, extractMaskData, formatLabel, parseMaskRanges, warnMissingAccessibleName };
650
+ 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 };
553
651
  //# sourceMappingURL=4sh-ui-kit-forms.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"4sh-ui-kit-forms.mjs","sources":["../../../projects/ui-kit/forms/src/lib/base-control-value-accessor.ts","../../../projects/ui-kit/forms/src/lib/base-form-field.ts","../../../projects/ui-kit/forms/src/lib/overlay-positions.ts","../../../projects/ui-kit/forms/src/lib/mask-engine.ts","../../../projects/ui-kit/forms/src/lib/option-resolver.ts","../../../projects/ui-kit/forms/src/lib/format-label.ts","../../../projects/ui-kit/forms/src/lib/warn-missing-accessible-name.ts","../../../projects/ui-kit/forms/src/public-api.ts","../../../projects/ui-kit/forms/src/4sh-ui-kit-forms.ts"],"sourcesContent":["import {\n afterNextRender,\n computed,\n DestroyRef,\n effect,\n inject,\n Injector,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n ControlValueAccessor,\n NgControl,\n PristineChangeEvent,\n StatusChangeEvent,\n TouchedChangeEvent,\n ValidationErrors,\n} from '@angular/forms';\n\n/**\n * Base class for form components (`ui-checkbox`, `ui-radio`, `ui-input`…).\n *\n * Implements `ControlValueAccessor` and mirrors the attached `NgControl` state\n * into signals, so templates/styles can react to it declaratively:\n *\n * - `touched` / `dirty` / `pristine` / `untouched` — interaction state\n * - `controlInvalid` / `controlErrors` — validation state\n * - `controlDisabled` — driven by `control.disable()`\n * - `showError` — invalid AND (touched or dirty),\n * the usual \"when to paint red\" rule\n *\n * The subscription is wired automatically after first render and cleaned up on\n * destroy. Subclasses only have to:\n * 1. implement `writeValue()` (form → view),\n * 2. call `emitChange(value)` on user interaction (view → form),\n * 3. call `emitTouch()` on blur,\n * 4. declare the DI provider:\n * `{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MyComponent), multi: true }`.\n *\n * Works with reactive forms, template-driven forms, or standalone (no form at\n * all — the signals simply keep their defaults).\n */\nexport abstract class BaseControlValueAccessor<T> implements ControlValueAccessor {\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n readonly dirty = signal(false);\n readonly pristine = signal(true);\n readonly touched = signal(false);\n readonly untouched = signal(true);\n /** Validation state of the attached control (false when no control). */\n readonly controlInvalid = signal(false);\n /** Validation errors of the attached control (null when valid / no control). */\n readonly controlErrors = signal<ValidationErrors | null>(null);\n /** Disabled state driven by the forms API (`control.disable()`), not by the `disabled` input. */\n readonly controlDisabled = signal(false);\n /** True when the error state should be surfaced to the user. */\n readonly showError = computed(() => this.controlInvalid() && (this.touched() || this.dirty()));\n\n protected onChange: (value: T) => void = () => {\n /* noop until registered */\n };\n protected onTouched: () => void = () => {\n /* noop until registered */\n };\n\n constructor() {\n // NgControl injects lazily (after the directive tree is built) to avoid\n // the classic NgControl ↔ value-accessor circular dependency.\n afterNextRender(() => this.watchNgControlEvents());\n }\n\n /** Write the form value into the component state (form → view). */\n abstract writeValue(value: T): void;\n\n registerOnChange(fn: (value: T) => 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.controlDisabled.set(isDisabled);\n }\n\n /** Propagate a user-driven value change to the form (view → form). */\n protected emitChange(value: T): void {\n this.onChange(value);\n }\n\n /** Mark the control as touched (call on blur). */\n protected emitTouch(): void {\n this.onTouched();\n this.touched.set(true);\n this.untouched.set(false);\n }\n\n /** Mirror the NgControl state into the signals. Wired automatically; safe to call once manually if needed. */\n protected watchNgControlEvents(): void {\n const control = this.injector.get(NgControl, null, { optional: true, self: true })?.control;\n if (!control) return;\n\n const mirror = () => {\n this.pristine.set(control.pristine);\n this.dirty.set(control.dirty);\n this.touched.set(control.touched);\n this.untouched.set(control.untouched);\n this.controlInvalid.set(control.invalid);\n this.controlErrors.set(control.errors);\n };\n\n // Signal-forms interop provides a fake NgControl without an `events`\n // stream, but its getters read the field's signals: mirroring inside\n // an effect tracks them and keeps the state live.\n if (!control.events) {\n effect(mirror, { injector: this.injector });\n return;\n }\n\n // Seed with the current state (events only fire on transitions).\n mirror();\n\n control.events.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {\n if (event instanceof PristineChangeEvent) {\n this.pristine.set(event.pristine);\n this.dirty.set(!event.pristine);\n } else if (event instanceof TouchedChangeEvent) {\n this.touched.set(event.touched);\n this.untouched.set(!event.touched);\n } else if (event instanceof StatusChangeEvent) {\n this.controlInvalid.set(event.status === 'INVALID');\n this.controlErrors.set(control.errors);\n }\n });\n }\n}\n","import { booleanAttribute, computed, Directive, input, signal } from '@angular/core';\nimport { BaseControlValueAccessor } from './base-control-value-accessor';\nimport { UiFeedbackLevel } from '@4sh/ui-kit/types';\n\nexport type FieldSize = 'default' | 'small';\n/** Visual validation status (subset of `UiFeedbackLevel`, shared with `ui-helper`). */\nexport type FieldLevel = Extract<UiFeedbackLevel, 'default' | 'success' | 'error'>;\n/**\n * Placement of the floating label (\"float label\" mode):\n * - `over`: rises above the box, where a classic label sits,\n * - `in`: rises to a band reserved at the top **inside** the box,\n * - `on`: rises **onto** the top border, notching it.\n */\nexport type FieldFloatLabel = 'over' | 'in' | 'on';\n\nlet nextUid = 0;\n\n/**\n * Base class for every standalone form control (`ui-checkbox`, `ui-toggle`,\n * `ui-slider`, `ui-nudger`…): the CVA plumbing shared by all of them, without\n * any \"box\" chrome (no label/helper/error message rendering).\n *\n * Provides the common inputs (aria*, id/name, required/disabled/readonly/\n * invalid, tabindex), the auto-generated id machinery (`resolvedId`,\n * `messageId`), the `modelValue` signal with the default `writeValue`, and the\n * derived `isDisabled` / `isInvalid` states. Extends `BaseControlValueAccessor`:\n * subclasses call `emitChange` / `emitTouch` on user interaction.\n *\n * Decorated with `@Directive()` (no selector) so the signal inputs are inherited\n * correctly by the concrete components.\n */\n@Directive()\nexport abstract class BaseFieldControl<T> extends BaseControlValueAccessor<T> {\n /** Accessible name when no visible label is provided. */\n ariaLabel = input<string>();\n /** id of an external element that labels this control. */\n ariaLabelledBy = input<string>();\n /** id forwarded to the native input (auto-generated when omitted). */\n inputId = input<string>();\n /** name forwarded to the native input. */\n name = input<string>();\n /** Required marker (*) + native required attribute. */\n required = input(false, { transform: booleanAttribute });\n /** Disables the field (native attribute). */\n disabled = input(false, { transform: booleanAttribute });\n /** Read-only (native attribute). */\n readonly = input(false, { transform: booleanAttribute });\n /** Forces the error styling (automatic when the attached control is invalid and touched/dirty). */\n invalid = input(false, { transform: booleanAttribute });\n /** tabindex forwarded to the native input. */\n tabindex = input<number>();\n\n /** @ignore Auto-generated unique id (prefix branded via `uidPrefix`). */\n protected readonly uid = `${this.uidPrefix()}-${nextUid++}`;\n /** @ignore Current value (written by the form or by user input). */\n protected readonly modelValue = signal<T | undefined>(undefined);\n\n /** @ignore */\n protected readonly resolvedId = computed(() => this.inputId() ?? this.uid);\n /** @ignore id of the message (for aria-describedby). */\n protected readonly messageId = computed(() => `${this.resolvedId()}-message`);\n /** @ignore Input disabled OR control disabled (form API). */\n protected readonly isDisabled = computed(() => this.disabled() || this.controlDisabled());\n /** @ignore Explicit error OR invalid control worth surfacing. */\n protected readonly isInvalid = computed(() => this.invalid() || this.showError());\n\n writeValue(value: T): void {\n this.modelValue.set(value);\n }\n\n /** @ignore Prefix of the auto-generated id — override to brand it per component. */\n protected uidPrefix(): string {\n return 'ui-field';\n }\n}\n\n/**\n * Base class for \"box\" form fields (`ui-input`, `ui-input-number`,\n * `ui-input-mask`, `ui-textarea`…).\n *\n * Extends `BaseFieldControl` with the box-specific inputs (label, helper,\n * error, size, level) and the derived state (effective level, displayed\n * message/value). Subclasses only handle their own `<input>` (specific\n * parsing/formatting) and call `emitChange` / `emitTouch`.\n */\n@Directive()\nexport abstract class BaseFormField<T> extends BaseFieldControl<T> {\n /** Label (rendered via `ui-label`). */\n label = input<string>();\n /** Helper text under the field (rendered via `ui-helper`). */\n helperText = input<string>();\n /** Error message shown in place of the helper when the field is in error. */\n errorText = input<string>();\n /** Prefixes the message under the field (helper or error) with a decorative icon. */\n showMessageIcon = input(false, { transform: booleanAttribute });\n /** Overrides the glyph shown by `showMessageIcon`. */\n messageIcon = input<string>();\n /** Size. */\n size = input<FieldSize>('default');\n /** Explicit validation status (`error` is forced when the control is invalid + touched). */\n level = input<FieldLevel>('default');\n /**\n * Floating label placement. Unset = classic label above the box.\n *\n * The label then plays the placeholder role while at rest, so the native\n * `placeholder` is neutralised (see `hasFloatLabel`).\n */\n floatLabel = input<FieldFloatLabel>();\n\n /** @ignore There is a label to float: a `floatLabel` alone has nothing to move. */\n protected readonly hasFloatLabel = computed(() => !!this.floatLabel() && !!this.label());\n\n /** @ignore Effective level: error when invalid, otherwise the requested `level`. */\n protected readonly effectiveLevel = computed<FieldLevel>(() =>\n this.isInvalid() ? 'error' : this.level(),\n );\n /** @ignore Displayed message: errorText when in error (if provided), otherwise helperText. */\n protected readonly displayMessage = computed(() =>\n this.isInvalid() && this.errorText() ? this.errorText() : this.helperText(),\n );\n /** @ignore Value shown in the input (string). Override for specific formatting. */\n protected readonly displayValue = computed(() => {\n const v = this.modelValue();\n return v === undefined || v === null ? '' : String(v);\n });\n}\n","import { ConnectedPosition } from '@angular/cdk/overlay';\n\n/**\n * Standard dropdown-panel anchoring shared by the overlay form fields\n * (`ui-select`, `ui-autocomplete`, `ui-input-tags`, `ui-datepicker`):\n * below the field, flipped above when `autoFlip`, flipped horizontally\n * (right-aligned) whenever there isn't enough room on the right.\n */\nexport function dropdownOverlayPositions(autoFlip: boolean): ConnectedPosition[] {\n const belowStart: ConnectedPosition = {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: 8,\n };\n const belowEnd: ConnectedPosition = {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: 8,\n };\n const aboveStart: ConnectedPosition = {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n offsetY: -8,\n };\n const aboveEnd: ConnectedPosition = {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetY: -8,\n };\n return autoFlip ? [belowStart, belowEnd, aboveStart, aboveEnd] : [belowStart, belowEnd];\n}\n","/**\n * Pure masking engine shared by `ui-input-mask` and `ui-datepicker` (auto-formatting the typed\n * date). Same precedent as `overlay-positions.ts` in this folder: framework-free functions, no\n * class/Directive/Component, reusable by any form component that needs literal-inserting input\n * masking. Extracted from `ui-input-mask.ts` — behavior is a byte-for-byte copy, only `this.mask()`\n * /`this.ranges()`/`this.slotChar()` become explicit parameters.\n */\n\n/** Mask tokens → accepted character class. */\nexport const MASK_TOKENS: Record<string, RegExp> = {\n '9': /[0-9]/, // digit\n a: /[a-zA-Z]/, // letter\n '*': /[a-zA-Z0-9]/, // alphanumeric\n};\n\nexport interface MaskBounds {\n min: number;\n max: number;\n}\n\nexport interface MaskSlot {\n char: string | null;\n rgx?: RegExp;\n bound?: MaskBounds & { pos: number; len: number };\n}\n\nexport interface MaskBuildResult {\n display: string;\n masked: string;\n data: string;\n tokenIndices: number[];\n}\n\n/** Parse the `ranges` input (`\"1-31 1-12 1900-2100\"`) into one bound per numeric segment. */\nexport function parseMaskRanges(ranges: string): (MaskBounds | null)[] {\n return ranges\n .trim()\n .split(/\\s+/)\n .map((part) => {\n const m = /^(\\d+)-(\\d+)$/.exec(part);\n return m ? { min: Number(m[1]), max: Number(m[2]) } : null;\n });\n}\n\n/**\n * Resolve the mask template into slots: literals, input slots, and the `ranges` bounds attached\n * to every slot of the numeric segment (consecutive `9` tokens) it belongs to.\n */\nexport function buildMaskSlots(\n mask: string,\n bounds: (MaskBounds | null)[],\n tokens: Record<string, RegExp> = MASK_TOKENS,\n): MaskSlot[] {\n const slots: MaskSlot[] = [];\n const segments: MaskSlot[][] = [];\n let segment: MaskSlot[] | null = null;\n\n for (const m of mask) {\n const rgx = tokens[m];\n const slot: MaskSlot = rgx ? { char: null, rgx } : { char: m };\n slots.push(slot);\n if (rgx && m === '9') {\n if (!segment) segments.push((segment = []));\n segment.push(slot);\n } else {\n segment = null;\n }\n }\n\n // Every segment gets a `.bound`, even unranged ones (±Infinity = no-op range): `pos`/`len` are\n // needed for `atSegmentEnd` regardless, else an unranged segment (e.g. ui-datepicker's year)\n // never auto-inserts its own following literal (FSHSP-118).\n segments.forEach((seg, i) => {\n const range = bounds[i] ?? { min: -Infinity, max: Infinity };\n seg.forEach((slot, pos) => (slot.bound = { ...range, pos, len: seg.length }));\n });\n\n return slots;\n}\n\n/** Keep only the data characters (alphanumeric) of a raw input string. */\nexport function extractMaskData(raw: string): string {\n return raw.replace(/[^a-zA-Z0-9]/g, '');\n}\n\n/**\n * Can `ch` fill this slot? It must match the token class and — when the segment is bounded\n * AND `enforceBounds` — the digits typed so far plus `ch` must still admit at least one in-range\n * completion of the remaining positions (`2` then `4` is refused on `0-23`, `2` then `3` is\n * accepted).\n *\n * `enforceBounds = false` skips that second check (still requires the token class to match):\n * meant for re-deriving the mask after characters were REMOVED, not typed. The bounds check\n * exists to reject an invalid *new* leading digit while typing forward (e.g. `8` can never start\n * a valid `1-31` day, so it's skipped rather than accepted) — applied instead to the digits left\n * over after a deletion, that same skip can discard a still-valid residual digit and misalign\n * every segment after it. See `autoFormatSegments`.\n */\nexport function acceptsMaskChar(\n slot: MaskSlot,\n segment: string,\n ch: string,\n enforceBounds = true,\n): boolean {\n if (!slot.rgx?.test(ch)) return false;\n const bound = slot.bound;\n if (!enforceBounds || !bound) return true;\n const scale = 10 ** (bound.len - bound.pos - 1);\n const low = Number(segment + ch) * scale;\n return low <= bound.max && low + scale - 1 >= bound.min;\n}\n\n/** Apply the mask template to a sequence of data characters (fills empty positions with `slotChar`). */\nexport function applyMaskTemplate(\n slots: MaskSlot[],\n data: string,\n slotChar: string,\n): MaskBuildResult {\n let di = 0;\n let display = '';\n let masked = '';\n let lastFilled = 0;\n let used = '';\n const tokenIndices: number[] = [];\n // Characters already accepted in the current numeric segment (drives the bounds check).\n let segment = '';\n\n for (const slot of slots) {\n if (slot.char !== null) {\n display += slot.char;\n masked += slot.char;\n continue;\n }\n tokenIndices.push(display.length); // index of this token position in `display`\n if (!slot.bound || slot.bound.pos === 0) segment = '';\n while (di < data.length && !acceptsMaskChar(slot, segment, data[di])) di++;\n if (di < data.length) {\n display += data[di];\n masked += data[di];\n used += data[di];\n if (slot.bound) segment += data[di];\n di++;\n lastFilled = masked.length;\n } else {\n display += slotChar;\n }\n }\n // Masked value = up to the last typed character (no trailing literals/slots).\n return { display, masked: masked.slice(0, lastFilled), data: used, tokenIndices };\n}\n\n/** Caret position for `n` typed data characters (literals skipped, end-of-text once all filled). */\nexport function caretForMask(tokenIndices: number[], n: number, length: number): number {\n if (n <= 0) return tokenIndices[0] ?? 0;\n if (n >= tokenIndices.length) return length; // all filled → end\n return tokenIndices[n]; // next input position (literals skipped)\n}\n\n/**\n * Auto-format-as-you-type variant of {@link applyMaskTemplate}: inserts a literal separator as\n * soon as the segment right before it is complete, without ever padding unfilled positions with\n * a filler character (unlike `applyMaskTemplate`, meant for a field that displays the full\n * template at rest). Used by `ui-datepicker`'s typeable trigger to auto-insert \"/\" as digits are\n * typed, the same way a card-expiry field auto-inserts its \"/\".\n */\nexport function autoFormatSegments(\n slots: MaskSlot[],\n data: string,\n { enforceBounds = true }: { enforceBounds?: boolean } = {},\n): { text: string; tokenIndices: number[]; dataEnd: number } {\n let di = 0;\n let text = '';\n let segment = '';\n let atSegmentEnd = false;\n const tokenIndices: number[] = [];\n // Position right after the last DATA character appended — unlike `text.length`, never lands\n // after a separator inserted eagerly (see the \"auto-insert\" doc above) with nothing typed past\n // it yet. Landing the caret there instead (see call sites) means a Backspace right after a\n // just-completed segment removes that segment's last digit, not the decorative separator —\n // which would otherwise be silently re-inserted next render, making Backspace look like it did\n // nothing (FSHSP-118).\n let dataEnd = 0;\n\n for (const slot of slots) {\n if (slot.char !== null) {\n // Append EVERY consecutive literal after a completed segment, not just the first — needed\n // for a multi-char separator like range's \" - \" (FSHSP-118). `atSegmentEnd` is left as-is\n // here; the next digit slot always resets it before it's read again.\n if (atSegmentEnd) text += slot.char;\n continue;\n }\n tokenIndices.push(text.length);\n if (!slot.bound || slot.bound.pos === 0) segment = '';\n while (di < data.length && !acceptsMaskChar(slot, segment, data[di], enforceBounds)) di++;\n if (di >= data.length) break; // no more data: stop, no filler\n text += data[di];\n dataEnd = text.length;\n if (slot.bound) segment += data[di];\n atSegmentEnd = !!slot.bound && slot.bound.pos === slot.bound.len - 1;\n di++;\n }\n return { text, tokenIndices, dataEnd };\n}\n","/**\n * Shared option-resolution helpers for list-based form fields\n * (`ui-select`, `ui-autocomplete`, `ui-input-tags`).\n *\n * Options can be primitives or objects; `optionValue` / `optionLabel` /\n * `optionDisabled` are (dot-path) fields read on object options, and `dataKey`\n * drives object equality. The accessors are passed as thunks so the resolver\n * stays reactive when bound to signal inputs.\n */\n\n/** Normalized option: resolved value/label/disabled + the original option. */\nexport interface OptionEntry {\n value: unknown;\n label: string;\n disabled: boolean;\n original: unknown;\n}\n\n/** Field accessors (typically the component's signal inputs). */\nexport interface OptionResolverFields {\n optionValue: () => string | undefined;\n optionLabel: () => string | undefined;\n optionDisabled: () => string | undefined;\n dataKey: () => string | undefined;\n}\n\nexport interface OptionResolver {\n /** Normalizes an option into an {@link OptionEntry}. */\n toEntry(option: unknown): OptionEntry;\n\n /** Reads a (dot-path) field from an object (`undefined` otherwise). */\n getField(target: unknown, path: string | undefined): unknown;\n\n /** Model value of an option (`optionValue` field, or the option itself). */\n resolveValue(option: unknown): unknown;\n\n /** Display label of an option (`optionLabel` field, `label` key, or text). */\n resolveLabel(option: unknown): string | null;\n\n /** Disabled flag of an option (`optionDisabled` field, or `disabled` key). */\n resolveDisabled(option: unknown): boolean;\n\n /** `String(value)`, or `null` for null/undefined. */\n asText(value: unknown): string | null;\n\n /** Value equality — by `dataKey` for objects, strict otherwise. */\n equals(a: unknown, b: unknown): boolean;\n}\n\nexport function createOptionResolver(fields: OptionResolverFields): OptionResolver {\n const isObject = (option: unknown): option is Record<string, unknown> =>\n typeof option === 'object' && option !== null;\n\n const getField = (target: unknown, path: string | undefined): unknown => {\n if (!path || !isObject(target)) return undefined;\n return path\n .split('.')\n .reduce<unknown>((acc, key) => (isObject(acc) ? acc[key] : undefined), target);\n };\n\n const asText = (value: unknown): string | null =>\n value === null || value === undefined ? null : String(value);\n\n const resolveValue = (option: unknown): unknown => {\n const field = fields.optionValue();\n if (field && isObject(option)) return getField(option, field);\n return option;\n };\n\n const resolveLabel = (option: unknown): string | null => {\n const field = fields.optionLabel();\n if (field && isObject(option)) return asText(getField(option, field));\n if (isObject(option) && 'label' in option) return asText(option['label']);\n return asText(option);\n };\n\n const resolveDisabled = (option: unknown): boolean => {\n const field = fields.optionDisabled();\n if (field && isObject(option)) return !!getField(option, field);\n if (isObject(option) && 'disabled' in option) return !!option['disabled'];\n return false;\n };\n\n const equals = (a: unknown, b: unknown): boolean => {\n const key = fields.dataKey();\n if (key && isObject(a) && isObject(b)) return a[key] === b[key];\n return a === b;\n };\n\n const toEntry = (option: unknown): OptionEntry => ({\n value: resolveValue(option),\n label: resolveLabel(option) ?? '',\n disabled: resolveDisabled(option),\n original: option,\n });\n\n return { toEntry, getField, resolveValue, resolveLabel, resolveDisabled, asText, equals };\n}\n","/**\n * Substitutes the `{0}` token of a (possibly user-overridden) label with a value.\n * Plain split/join — never interprets `$` sequences in `value` (unlike `String.replace`).\n */\nexport function formatLabel(template: string, value: string | number): string {\n return template.split('{0}').join(String(value));\n}\n","import { isDevMode } from '@angular/core';\n\n// Dev-only a11y guard shared by form controls that require an accessible name\n// (`ariaLabel`/`ariaLabelledBy`/`label`). Centralizes the \"how to warn\" (console + dev-mode\n// gating) so each component only supplies its own trigger condition and message text.\nexport function warnMissingAccessibleName(componentTag: string, message: string): void {\n if (isDevMode()) {\n console.warn(`[${componentTag}] ${message}`);\n }\n}\n","/*\n * Public API Surface of ui-kit/forms\n *\n * Shared form infrastructure: the base classes every `ui-*` field inherits\n * from, plus the helpers those fields rely on. Importing a field component\n * (e.g. `@4sh/ui-kit/forms/ui-input`) pulls this in automatically — you only import\n * from here directly when building your OWN field on top of the kit's\n * conventions.\n */\n\nexport * from './lib/base-control-value-accessor';\nexport * from './lib/base-form-field';\nexport * from './lib/overlay-positions';\nexport * from './lib/mask-engine';\nexport * from './lib/option-resolver';\nexport * from './lib/format-label';\nexport * from './lib/warn-missing-accessible-name';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAmBA;;;;;;;;;;;;;;;;;;;;;;AAsBG;MACmB,wBAAwB,CAAA;AAwB5C,IAAA,WAAA,GAAA;AAvBiB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAEvC,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,KA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;ACjGA;;;AAGG;AACG,SAAU,WAAW,CAAC,QAAgB,EAAE,KAAsB,EAAA;AAClE,IAAA,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAClD;;ACJA;AACA;AACA;AACM,SAAU,yBAAyB,CAAC,YAAoB,EAAE,OAAe,EAAA;IAC7E,IAAI,SAAS,EAAE,EAAE;QACf,OAAO,CAAC,IAAI,CAAC,CAAA,CAAA,EAAI,YAAY,CAAA,EAAA,EAAK,OAAO,CAAA,CAAE,CAAC;IAC9C;AACF;;ACTA;;;;;;;;AAQG;;ACRH;;AAEG;;"}
1
+ {"version":3,"file":"4sh-ui-kit-forms.mjs","sources":["../../../projects/ui-kit/forms/src/lib/base-control-value-accessor.ts","../../../projects/ui-kit/forms/src/lib/base-form-field.ts","../../../projects/ui-kit/forms/src/lib/overlay-positions.ts","../../../projects/ui-kit/forms/src/lib/mask-engine.ts","../../../projects/ui-kit/forms/src/lib/date-utils.ts","../../../projects/ui-kit/forms/src/lib/option-resolver.ts","../../../projects/ui-kit/forms/src/lib/format-label.ts","../../../projects/ui-kit/forms/src/lib/warn-missing-accessible-name.ts","../../../projects/ui-kit/forms/src/public-api.ts","../../../projects/ui-kit/forms/src/4sh-ui-kit-forms.ts"],"sourcesContent":["import {\n afterNextRender,\n computed,\n DestroyRef,\n effect,\n inject,\n Injector,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport {\n ControlValueAccessor,\n NgControl,\n PristineChangeEvent,\n StatusChangeEvent,\n TouchedChangeEvent,\n ValidationErrors,\n} from '@angular/forms';\n\n/**\n * Base class for form components (`ui-checkbox`, `ui-radio`, `ui-input`…).\n *\n * Implements `ControlValueAccessor` and mirrors the attached `NgControl` state\n * into signals, so templates/styles can react to it declaratively:\n *\n * - `touched` / `dirty` / `pristine` / `untouched` — interaction state\n * - `controlInvalid` / `controlErrors` — validation state\n * - `controlDisabled` — driven by `control.disable()`\n * - `showError` — invalid AND (touched or dirty),\n * the usual \"when to paint red\" rule\n *\n * The subscription is wired automatically after first render and cleaned up on\n * destroy. Subclasses only have to:\n * 1. implement `writeValue()` (form → view),\n * 2. call `emitChange(value)` on user interaction (view → form),\n * 3. call `emitTouch()` on blur,\n * 4. declare the DI provider:\n * `{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => MyComponent), multi: true }`.\n *\n * Works with reactive forms, template-driven forms, or standalone (no form at\n * all — the signals simply keep their defaults).\n */\nexport abstract class BaseControlValueAccessor<T> implements ControlValueAccessor {\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n\n readonly dirty = signal(false);\n readonly pristine = signal(true);\n readonly touched = signal(false);\n readonly untouched = signal(true);\n /** Validation state of the attached control (false when no control). */\n readonly controlInvalid = signal(false);\n /** Validation errors of the attached control (null when valid / no control). */\n readonly controlErrors = signal<ValidationErrors | null>(null);\n /** Disabled state driven by the forms API (`control.disable()`), not by the `disabled` input. */\n readonly controlDisabled = signal(false);\n /** True when the error state should be surfaced to the user. */\n readonly showError = computed(() => this.controlInvalid() && (this.touched() || this.dirty()));\n\n protected onChange: (value: T) => void = () => {\n /* noop until registered */\n };\n protected onTouched: () => void = () => {\n /* noop until registered */\n };\n\n constructor() {\n // NgControl injects lazily (after the directive tree is built) to avoid\n // the classic NgControl ↔ value-accessor circular dependency.\n afterNextRender(() => this.watchNgControlEvents());\n }\n\n /** Write the form value into the component state (form → view). */\n abstract writeValue(value: T): void;\n\n registerOnChange(fn: (value: T) => 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.controlDisabled.set(isDisabled);\n }\n\n /** Propagate a user-driven value change to the form (view → form). */\n protected emitChange(value: T): void {\n this.onChange(value);\n }\n\n /** Mark the control as touched (call on blur). */\n protected emitTouch(): void {\n this.onTouched();\n this.touched.set(true);\n this.untouched.set(false);\n }\n\n /** Mirror the NgControl state into the signals. Wired automatically; safe to call once manually if needed. */\n protected watchNgControlEvents(): void {\n const control = this.injector.get(NgControl, null, { optional: true, self: true })?.control;\n if (!control) return;\n\n const mirror = () => {\n this.pristine.set(control.pristine);\n this.dirty.set(control.dirty);\n this.touched.set(control.touched);\n this.untouched.set(control.untouched);\n this.controlInvalid.set(control.invalid);\n this.controlErrors.set(control.errors);\n };\n\n // Signal-forms interop provides a fake NgControl without an `events`\n // stream, but its getters read the field's signals: mirroring inside\n // an effect tracks them and keeps the state live.\n if (!control.events) {\n effect(mirror, { injector: this.injector });\n return;\n }\n\n // Seed with the current state (events only fire on transitions).\n mirror();\n\n control.events.pipe(takeUntilDestroyed(this.destroyRef)).subscribe((event) => {\n if (event instanceof PristineChangeEvent) {\n this.pristine.set(event.pristine);\n this.dirty.set(!event.pristine);\n } else if (event instanceof TouchedChangeEvent) {\n this.touched.set(event.touched);\n this.untouched.set(!event.touched);\n } else if (event instanceof StatusChangeEvent) {\n this.controlInvalid.set(event.status === 'INVALID');\n this.controlErrors.set(control.errors);\n }\n });\n }\n}\n","import { booleanAttribute, computed, Directive, input, signal } from '@angular/core';\nimport { BaseControlValueAccessor } from './base-control-value-accessor';\nimport { UiFeedbackLevel } from '@4sh/ui-kit/types';\n\nexport type FieldSize = 'default' | 'small';\n/** Visual validation status (subset of `UiFeedbackLevel`, shared with `ui-helper`). */\nexport type FieldLevel = Extract<UiFeedbackLevel, 'default' | 'success' | 'error'>;\n/**\n * Placement of the floating label (\"float label\" mode):\n * - `over`: rises above the box, where a classic label sits,\n * - `in`: rises to a band reserved at the top **inside** the box,\n * - `on`: rises **onto** the top border, notching it.\n */\nexport type FieldFloatLabel = 'over' | 'in' | 'on';\n\nlet nextUid = 0;\n\n/**\n * Base class for every standalone form control (`ui-checkbox`, `ui-toggle`,\n * `ui-slider`, `ui-nudger`…): the CVA plumbing shared by all of them, without\n * any \"box\" chrome (no label/helper/error message rendering).\n *\n * Provides the common inputs (aria*, id/name, required/disabled/readonly/\n * invalid, tabindex), the auto-generated id machinery (`resolvedId`,\n * `messageId`), the `modelValue` signal with the default `writeValue`, and the\n * derived `isDisabled` / `isInvalid` states. Extends `BaseControlValueAccessor`:\n * subclasses call `emitChange` / `emitTouch` on user interaction.\n *\n * Decorated with `@Directive()` (no selector) so the signal inputs are inherited\n * correctly by the concrete components.\n */\n@Directive()\nexport abstract class BaseFieldControl<T> extends BaseControlValueAccessor<T> {\n /** Accessible name when no visible label is provided. */\n ariaLabel = input<string>();\n /** id of an external element that labels this control. */\n ariaLabelledBy = input<string>();\n /** id forwarded to the native input (auto-generated when omitted). */\n inputId = input<string>();\n /** name forwarded to the native input. */\n name = input<string>();\n /** Required marker (*) + native required attribute. */\n required = input(false, { transform: booleanAttribute });\n /** Disables the field (native attribute). */\n disabled = input(false, { transform: booleanAttribute });\n /** Read-only (native attribute). */\n readonly = input(false, { transform: booleanAttribute });\n /** Forces the error styling (automatic when the attached control is invalid and touched/dirty). */\n invalid = input(false, { transform: booleanAttribute });\n /** tabindex forwarded to the native input. */\n tabindex = input<number>();\n\n /** @ignore Auto-generated unique id (prefix branded via `uidPrefix`). */\n protected readonly uid = `${this.uidPrefix()}-${nextUid++}`;\n /** @ignore Current value (written by the form or by user input). */\n protected readonly modelValue = signal<T | undefined>(undefined);\n\n /** @ignore */\n protected readonly resolvedId = computed(() => this.inputId() ?? this.uid);\n /** @ignore id of the message (for aria-describedby). */\n protected readonly messageId = computed(() => `${this.resolvedId()}-message`);\n /** @ignore Input disabled OR control disabled (form API). */\n protected readonly isDisabled = computed(() => this.disabled() || this.controlDisabled());\n /** @ignore Explicit error OR invalid control worth surfacing. */\n protected readonly isInvalid = computed(() => this.invalid() || this.showError());\n\n writeValue(value: T): void {\n this.modelValue.set(value);\n }\n\n /** @ignore Prefix of the auto-generated id — override to brand it per component. */\n protected uidPrefix(): string {\n return 'ui-field';\n }\n}\n\n/**\n * Base class for \"box\" form fields (`ui-input`, `ui-input-number`,\n * `ui-input-mask`, `ui-textarea`…).\n *\n * Extends `BaseFieldControl` with the box-specific inputs (label, helper,\n * error, size, level) and the derived state (effective level, displayed\n * message/value). Subclasses only handle their own `<input>` (specific\n * parsing/formatting) and call `emitChange` / `emitTouch`.\n */\n@Directive()\nexport abstract class BaseFormField<T> extends BaseFieldControl<T> {\n /** Label (rendered via `ui-label`). */\n label = input<string>();\n /** Helper text under the field (rendered via `ui-helper`). */\n helperText = input<string>();\n /** Error message shown in place of the helper when the field is in error. */\n errorText = input<string>();\n /** Prefixes the message under the field (helper or error) with a decorative icon. */\n showMessageIcon = input(false, { transform: booleanAttribute });\n /** Overrides the glyph shown by `showMessageIcon`. */\n messageIcon = input<string>();\n /** Size. */\n size = input<FieldSize>('default');\n /** Explicit validation status (`error` is forced when the control is invalid + touched). */\n level = input<FieldLevel>('default');\n /**\n * Floating label placement. Unset = classic label above the box.\n *\n * The label then plays the placeholder role while at rest, so the native\n * `placeholder` is neutralised (see `hasFloatLabel`).\n */\n floatLabel = input<FieldFloatLabel>();\n\n /** @ignore There is a label to float: a `floatLabel` alone has nothing to move. */\n protected readonly hasFloatLabel = computed(() => !!this.floatLabel() && !!this.label());\n\n /** @ignore Effective level: error when invalid, otherwise the requested `level`. */\n protected readonly effectiveLevel = computed<FieldLevel>(() =>\n this.isInvalid() ? 'error' : this.level(),\n );\n /** @ignore Displayed message: errorText when in error (if provided), otherwise helperText. */\n protected readonly displayMessage = computed(() =>\n this.isInvalid() && this.errorText() ? this.errorText() : this.helperText(),\n );\n /** @ignore Value shown in the input (string). Override for specific formatting. */\n protected readonly displayValue = computed(() => {\n const v = this.modelValue();\n return v === undefined || v === null ? '' : String(v);\n });\n}\n","import { ConnectedPosition } from '@angular/cdk/overlay';\n\n/**\n * Standard dropdown-panel anchoring shared by the overlay form fields\n * (`ui-select`, `ui-autocomplete`, `ui-input-tags`, `ui-datepicker`):\n * below the field, flipped above when `autoFlip`, flipped horizontally\n * (right-aligned) whenever there isn't enough room on the right.\n */\nexport function dropdownOverlayPositions(autoFlip: boolean): ConnectedPosition[] {\n const belowStart: ConnectedPosition = {\n originX: 'start',\n originY: 'bottom',\n overlayX: 'start',\n overlayY: 'top',\n offsetY: 8,\n };\n const belowEnd: ConnectedPosition = {\n originX: 'end',\n originY: 'bottom',\n overlayX: 'end',\n overlayY: 'top',\n offsetY: 8,\n };\n const aboveStart: ConnectedPosition = {\n originX: 'start',\n originY: 'top',\n overlayX: 'start',\n overlayY: 'bottom',\n offsetY: -8,\n };\n const aboveEnd: ConnectedPosition = {\n originX: 'end',\n originY: 'top',\n overlayX: 'end',\n overlayY: 'bottom',\n offsetY: -8,\n };\n return autoFlip ? [belowStart, belowEnd, aboveStart, aboveEnd] : [belowStart, belowEnd];\n}\n","/**\n * Pure masking engine shared by `ui-input-mask` and `ui-datepicker` (auto-formatting the typed\n * date). Same precedent as `overlay-positions.ts` in this folder: framework-free functions, no\n * class/Directive/Component, reusable by any form component that needs literal-inserting input\n * masking. Extracted from `ui-input-mask.ts` — behavior is a byte-for-byte copy, only `this.mask()`\n * /`this.ranges()`/`this.slotChar()` become explicit parameters.\n */\n\n/** Mask tokens → accepted character class. */\nexport const MASK_TOKENS: Record<string, RegExp> = {\n '9': /[0-9]/, // digit\n a: /[a-zA-Z]/, // letter\n '*': /[a-zA-Z0-9]/, // alphanumeric\n};\n\nexport interface MaskBounds {\n min: number;\n max: number;\n}\n\nexport interface MaskSlot {\n char: string | null;\n rgx?: RegExp;\n bound?: MaskBounds & { pos: number; len: number };\n}\n\nexport interface MaskBuildResult {\n display: string;\n masked: string;\n data: string;\n tokenIndices: number[];\n}\n\n/** Parse the `ranges` input (`\"1-31 1-12 1900-2100\"`) into one bound per numeric segment. */\nexport function parseMaskRanges(ranges: string): (MaskBounds | null)[] {\n return ranges\n .trim()\n .split(/\\s+/)\n .map((part) => {\n const m = /^(\\d+)-(\\d+)$/.exec(part);\n return m ? { min: Number(m[1]), max: Number(m[2]) } : null;\n });\n}\n\n/**\n * Resolve the mask template into slots: literals, input slots, and the `ranges` bounds attached\n * to every slot of the numeric segment (consecutive `9` tokens) it belongs to.\n */\nexport function buildMaskSlots(\n mask: string,\n bounds: (MaskBounds | null)[],\n tokens: Record<string, RegExp> = MASK_TOKENS,\n): MaskSlot[] {\n const slots: MaskSlot[] = [];\n const segments: MaskSlot[][] = [];\n let segment: MaskSlot[] | null = null;\n\n for (const m of mask) {\n const rgx = tokens[m];\n const slot: MaskSlot = rgx ? { char: null, rgx } : { char: m };\n slots.push(slot);\n if (rgx && m === '9') {\n if (!segment) segments.push((segment = []));\n segment.push(slot);\n } else {\n segment = null;\n }\n }\n\n // Every segment gets a `.bound`, even unranged ones (±Infinity = no-op range): `pos`/`len` are\n // needed for `atSegmentEnd` regardless, else an unranged segment (e.g. ui-datepicker's year)\n // never auto-inserts its own following literal (FSHSP-118).\n segments.forEach((seg, i) => {\n const range = bounds[i] ?? { min: -Infinity, max: Infinity };\n seg.forEach((slot, pos) => (slot.bound = { ...range, pos, len: seg.length }));\n });\n\n return slots;\n}\n\n/** Keep only the data characters (alphanumeric) of a raw input string. */\nexport function extractMaskData(raw: string): string {\n return raw.replace(/[^a-zA-Z0-9]/g, '');\n}\n\n/**\n * Can `ch` fill this slot? It must match the token class and — when the segment is bounded\n * AND `enforceBounds` — the digits typed so far plus `ch` must still admit at least one in-range\n * completion of the remaining positions (`2` then `4` is refused on `0-23`, `2` then `3` is\n * accepted).\n *\n * `enforceBounds = false` skips that second check (still requires the token class to match):\n * meant for re-deriving the mask after characters were REMOVED, not typed. The bounds check\n * exists to reject an invalid *new* leading digit while typing forward (e.g. `8` can never start\n * a valid `1-31` day, so it's skipped rather than accepted) — applied instead to the digits left\n * over after a deletion, that same skip can discard a still-valid residual digit and misalign\n * every segment after it. See `autoFormatSegments`.\n */\nexport function acceptsMaskChar(\n slot: MaskSlot,\n segment: string,\n ch: string,\n enforceBounds = true,\n): boolean {\n if (!slot.rgx?.test(ch)) return false;\n const bound = slot.bound;\n if (!enforceBounds || !bound) return true;\n const scale = 10 ** (bound.len - bound.pos - 1);\n const low = Number(segment + ch) * scale;\n return low <= bound.max && low + scale - 1 >= bound.min;\n}\n\n/** Apply the mask template to a sequence of data characters (fills empty positions with `slotChar`). */\nexport function applyMaskTemplate(\n slots: MaskSlot[],\n data: string,\n slotChar: string,\n): MaskBuildResult {\n let di = 0;\n let display = '';\n let masked = '';\n let lastFilled = 0;\n let used = '';\n const tokenIndices: number[] = [];\n // Characters already accepted in the current numeric segment (drives the bounds check).\n let segment = '';\n\n for (const slot of slots) {\n if (slot.char !== null) {\n display += slot.char;\n masked += slot.char;\n continue;\n }\n tokenIndices.push(display.length); // index of this token position in `display`\n if (!slot.bound || slot.bound.pos === 0) segment = '';\n while (di < data.length && !acceptsMaskChar(slot, segment, data[di])) di++;\n if (di < data.length) {\n display += data[di];\n masked += data[di];\n used += data[di];\n if (slot.bound) segment += data[di];\n di++;\n lastFilled = masked.length;\n } else {\n display += slotChar;\n }\n }\n // Masked value = up to the last typed character (no trailing literals/slots).\n return { display, masked: masked.slice(0, lastFilled), data: used, tokenIndices };\n}\n\n/** Caret position for `n` typed data characters (literals skipped, end-of-text once all filled). */\nexport function caretForMask(tokenIndices: number[], n: number, length: number): number {\n if (n <= 0) return tokenIndices[0] ?? 0;\n if (n >= tokenIndices.length) return length; // all filled → end\n return tokenIndices[n]; // next input position (literals skipped)\n}\n\n/**\n * Auto-format-as-you-type variant of {@link applyMaskTemplate}: inserts a literal separator as\n * soon as the segment right before it is complete, without ever padding unfilled positions with\n * a filler character (unlike `applyMaskTemplate`, meant for a field that displays the full\n * template at rest). Used by `ui-datepicker`'s typeable trigger to auto-insert \"/\" as digits are\n * typed, the same way a card-expiry field auto-inserts its \"/\".\n */\nexport function autoFormatSegments(\n slots: MaskSlot[],\n data: string,\n { enforceBounds = true }: { enforceBounds?: boolean } = {},\n): { text: string; tokenIndices: number[]; dataEnd: number } {\n let di = 0;\n let text = '';\n let segment = '';\n let atSegmentEnd = false;\n const tokenIndices: number[] = [];\n // Position right after the last DATA character appended — unlike `text.length`, never lands\n // after a separator inserted eagerly (see the \"auto-insert\" doc above) with nothing typed past\n // it yet. Landing the caret there instead (see call sites) means a Backspace right after a\n // just-completed segment removes that segment's last digit, not the decorative separator —\n // which would otherwise be silently re-inserted next render, making Backspace look like it did\n // nothing (FSHSP-118).\n let dataEnd = 0;\n\n for (const slot of slots) {\n if (slot.char !== null) {\n // Append EVERY consecutive literal after a completed segment, not just the first — needed\n // for a multi-char separator like range's \" - \" (FSHSP-118). `atSegmentEnd` is left as-is\n // here; the next digit slot always resets it before it's read again.\n if (atSegmentEnd) text += slot.char;\n continue;\n }\n tokenIndices.push(text.length);\n if (!slot.bound || slot.bound.pos === 0) segment = '';\n while (di < data.length && !acceptsMaskChar(slot, segment, data[di], enforceBounds)) di++;\n if (di >= data.length) break; // no more data: stop, no filler\n text += data[di];\n dataEnd = text.length;\n if (slot.bound) segment += data[di];\n atSegmentEnd = !!slot.bound && slot.bound.pos === slot.bound.len - 1;\n di++;\n }\n return { text, tokenIndices, dataEnd };\n}\n","/**\n * Pure date helpers (no framework dependency), shared by every field that has to cross\n * the `Date` ↔ ISO-string boundary — `ui-datepicker`, which parses what the user types,\n * and `ui-input-date`, which reads what the browser's native picker hands back.\n *\n * They lived inside `ui-datepicker`'s entry point while it was the only caller (FSHSP-209\n * moved them here). Two entry points must never import each other, so the second caller\n * left one choice: the shared `forms/` entry point, which exists for exactly this — the\n * helpers a field is built on. Serializing a `Date` from its LOCAL components rather than\n * through `toISOString()` is the subtle part, and it must not be re-derived twice.\n */\n\nexport function startOfDay(d: Date): Date {\n const x = new Date(d);\n x.setHours(0, 0, 0, 0);\n return x;\n}\nexport function firstOfMonth(d: Date): Date {\n return new Date(d.getFullYear(), d.getMonth(), 1);\n}\nexport function isSameDay(a: Date | null | undefined, b: Date | null | undefined): boolean {\n if (!a || !b) return false;\n return (\n a.getFullYear() === b.getFullYear() &&\n a.getMonth() === b.getMonth() &&\n a.getDate() === b.getDate()\n );\n}\nexport function addDays(d: Date, n: number): Date {\n const x = new Date(d);\n x.setDate(x.getDate() + n);\n return x;\n}\nexport function addMonths(d: Date, n: number): Date {\n return new Date(d.getFullYear(), d.getMonth() + n, 1);\n}\n/** Build a Date and reject overflowed components (e.g. 31 Feb). */\nexport function finalizeParsed(\n year: number,\n month: number,\n day: number,\n h: number,\n min: number,\n): Date | null {\n if (month < 0 || month > 11 || day < 1 || day > 31 || h > 23 || min > 59) return null;\n const d = new Date(year, month, day, h, min, 0, 0);\n if (d.getFullYear() !== year || d.getMonth() !== month || d.getDate() !== day) return null;\n return d;\n}\n\nconst ISO_DATE_RE = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nconst ISO_DATETIME_RE = /^(\\d{4})-(\\d{2})-(\\d{2})T(\\d{2}):(\\d{2})$/;\nconst ISO_TIME_RE = /^(\\d{2}):(\\d{2})$/;\n\nfunction pad2(n: number): string {\n return String(n).padStart(2, '0');\n}\n/** Serialize a `Date` to `\"yyyy-MM-dd\"` from its LOCAL components — never `toISOString()`\n * (which converts to UTC and can shift the day by ±1 depending on the timezone). */\nexport function toIsoDate(d: Date): string {\n return `${d.getFullYear()}-${pad2(d.getMonth() + 1)}-${pad2(d.getDate())}`;\n}\n/** `\"HH:mm\"` — the shape a native `<input type=\"time\">` reads and writes. */\nexport function toIsoTime(d: Date): string {\n return `${pad2(d.getHours())}:${pad2(d.getMinutes())}`;\n}\n/** `\"yyyy-MM-ddTHH:mm\"` — date part built the same local, never-UTC way as {@link toIsoDate}. */\nexport function toIsoDateTime(d: Date): string {\n return `${toIsoDate(d)}T${pad2(d.getHours())}:${pad2(d.getMinutes())}`;\n}\n/** Strict `\"yyyy-MM-dd\"` parser (rejects anything else, incl. overflowed dates via `finalizeParsed`). */\nexport function parseIsoDate(s: string): Date | null {\n const m = ISO_DATE_RE.exec(s);\n if (!m) return null;\n return finalizeParsed(Number(m[1]), Number(m[2]) - 1, Number(m[3]), 0, 0);\n}\n/** Strict `\"yyyy-MM-ddTHH:mm\"` parser (`showTime`/`timeOnly` round-trip). */\nexport function parseIsoDateTime(s: string): Date | null {\n const m = ISO_DATETIME_RE.exec(s);\n if (!m) return null;\n return finalizeParsed(Number(m[1]), Number(m[2]) - 1, Number(m[3]), Number(m[4]), Number(m[5]));\n}\n/**\n * Strict `\"HH:mm\"` parser, anchored on `reference` (default: today).\n *\n * A bare time is not a point in time; the caller has to say on which day it lands. Mirrors\n * what `ui-datepicker` does in `timeOnly` mode — it too carries a full `Date` — so both\n * components hand back the same shape.\n */\nexport function parseIsoTime(s: string, reference: Date = new Date()): Date | null {\n const m = ISO_TIME_RE.exec(s);\n if (!m) return null;\n return finalizeParsed(\n reference.getFullYear(),\n reference.getMonth(),\n reference.getDate(),\n Number(m[1]),\n Number(m[2]),\n );\n}\n/** Accepts a `Date` as-is, or parses a `\"yyyy-MM-dd\"` string — used to let config inputs\n * (`minDate`/`maxDate`/`disabledDates`) take either shape. Invalid strings degrade to `null`\n * (no constraint) rather than throwing: a malformed config shouldn't crash the picker. */\nexport function normalizeDateInput(v: Date | string | null | undefined): Date | null {\n if (!v) return null;\n return v instanceof Date ? v : parseIsoDate(v);\n}\n","/**\n * Shared option-resolution helpers for list-based form fields\n * (`ui-select`, `ui-autocomplete`, `ui-input-tags`).\n *\n * Options can be primitives or objects; `optionValue` / `optionLabel` /\n * `optionDisabled` are (dot-path) fields read on object options, and `dataKey`\n * drives object equality. The accessors are passed as thunks so the resolver\n * stays reactive when bound to signal inputs.\n */\n\n/** Normalized option: resolved value/label/disabled + the original option. */\nexport interface OptionEntry {\n value: unknown;\n label: string;\n disabled: boolean;\n original: unknown;\n}\n\n/** Field accessors (typically the component's signal inputs). */\nexport interface OptionResolverFields {\n optionValue: () => string | undefined;\n optionLabel: () => string | undefined;\n optionDisabled: () => string | undefined;\n dataKey: () => string | undefined;\n}\n\nexport interface OptionResolver {\n /** Normalizes an option into an {@link OptionEntry}. */\n toEntry(option: unknown): OptionEntry;\n\n /** Reads a (dot-path) field from an object (`undefined` otherwise). */\n getField(target: unknown, path: string | undefined): unknown;\n\n /** Model value of an option (`optionValue` field, or the option itself). */\n resolveValue(option: unknown): unknown;\n\n /** Display label of an option (`optionLabel` field, `label` key, or text). */\n resolveLabel(option: unknown): string | null;\n\n /** Disabled flag of an option (`optionDisabled` field, or `disabled` key). */\n resolveDisabled(option: unknown): boolean;\n\n /** `String(value)`, or `null` for null/undefined. */\n asText(value: unknown): string | null;\n\n /** Value equality — by `dataKey` for objects, strict otherwise. */\n equals(a: unknown, b: unknown): boolean;\n}\n\nexport function createOptionResolver(fields: OptionResolverFields): OptionResolver {\n const isObject = (option: unknown): option is Record<string, unknown> =>\n typeof option === 'object' && option !== null;\n\n const getField = (target: unknown, path: string | undefined): unknown => {\n if (!path || !isObject(target)) return undefined;\n return path\n .split('.')\n .reduce<unknown>((acc, key) => (isObject(acc) ? acc[key] : undefined), target);\n };\n\n const asText = (value: unknown): string | null =>\n value === null || value === undefined ? null : String(value);\n\n const resolveValue = (option: unknown): unknown => {\n const field = fields.optionValue();\n if (field && isObject(option)) return getField(option, field);\n return option;\n };\n\n const resolveLabel = (option: unknown): string | null => {\n const field = fields.optionLabel();\n if (field && isObject(option)) return asText(getField(option, field));\n if (isObject(option) && 'label' in option) return asText(option['label']);\n return asText(option);\n };\n\n const resolveDisabled = (option: unknown): boolean => {\n const field = fields.optionDisabled();\n if (field && isObject(option)) return !!getField(option, field);\n if (isObject(option) && 'disabled' in option) return !!option['disabled'];\n return false;\n };\n\n const equals = (a: unknown, b: unknown): boolean => {\n const key = fields.dataKey();\n if (key && isObject(a) && isObject(b)) return a[key] === b[key];\n return a === b;\n };\n\n const toEntry = (option: unknown): OptionEntry => ({\n value: resolveValue(option),\n label: resolveLabel(option) ?? '',\n disabled: resolveDisabled(option),\n original: option,\n });\n\n return { toEntry, getField, resolveValue, resolveLabel, resolveDisabled, asText, equals };\n}\n","/**\n * Substitutes the `{0}` token of a (possibly user-overridden) label with a value.\n * Plain split/join — never interprets `$` sequences in `value` (unlike `String.replace`).\n */\nexport function formatLabel(template: string, value: string | number): string {\n return template.split('{0}').join(String(value));\n}\n","import { isDevMode } from '@angular/core';\n\n// Dev-only a11y guard shared by form controls that require an accessible name\n// (`ariaLabel`/`ariaLabelledBy`/`label`). Centralizes the \"how to warn\" (console + dev-mode\n// gating) so each component only supplies its own trigger condition and message text.\nexport function warnMissingAccessibleName(componentTag: string, message: string): void {\n if (isDevMode()) {\n console.warn(`[${componentTag}] ${message}`);\n }\n}\n","/*\n * Public API Surface of ui-kit/forms\n *\n * Shared form infrastructure: the base classes every `ui-*` field inherits\n * from, plus the helpers those fields rely on. Importing a field component\n * (e.g. `@4sh/ui-kit/forms/ui-input`) pulls this in automatically — you only import\n * from here directly when building your OWN field on top of the kit's\n * conventions.\n */\n\nexport * from './lib/base-control-value-accessor';\nexport * from './lib/base-form-field';\nexport * from './lib/overlay-positions';\nexport * from './lib/mask-engine';\nexport * from './lib/date-utils';\nexport * from './lib/option-resolver';\nexport * from './lib/format-label';\nexport * from './lib/warn-missing-accessible-name';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAmBA;;;;;;;;;;;;;;;;;;;;;;AAsBG;MACmB,wBAAwB,CAAA;AAwB5C,IAAA,WAAA,GAAA;AAvBiB,QAAA,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AAC3B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QAEvC,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,KAAK;kFAAC;QACrB,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,IAAI;qFAAC;QACvB,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,KAAK;oFAAC;QACvB,IAAA,CAAA,SAAS,GAAG,MAAM,CAAC,IAAI;sFAAC;;QAExB,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,KAAK;2F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AAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAE;AAC3F;;ACjGA;;;AAGG;AACG,SAAU,WAAW,CAAC,QAAgB,EAAE,KAAsB,EAAA;AAClE,IAAA,OAAO,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAClD;;ACJA;AACA;AACA;AACM,SAAU,yBAAyB,CAAC,YAAoB,EAAE,OAAe,EAAA;IAC7E,IAAI,SAAS,EAAE,EAAE;QACf,OAAO,CAAC,IAAI,CAAC,CAAA,CAAA,EAAI,YAAY,CAAA,EAAA,EAAK,OAAO,CAAA,CAAE,CAAC;IAC9C;AACF;;ACTA;;;;;;;;AAQG;;ACRH;;AAEG;;"}
@@ -4,6 +4,7 @@ import { DOCUMENT, isPlatformBrowser } from '@angular/common';
4
4
  import * as i1 from '@angular/cdk/a11y';
5
5
  import { A11yModule } from '@angular/cdk/a11y';
6
6
  import { UiIcon } from '@4sh/ui-kit/base/ui-icon';
7
+ import { lockBodyScroll, unlockBodyScroll } from '@4sh/ui-kit/overlay';
7
8
 
8
9
  /** The preset detents, for the runtime discrimination `height` needs. */
9
10
  const HEIGHT_PRESETS = ['auto', 'half', 'full'];
@@ -21,31 +22,6 @@ const HANDLE_CLASS = 'ui-bottom-sheet-handle';
21
22
  let zIndexSeq = 0;
22
23
  /** Process-wide unique id source (aria wiring). */
23
24
  let nextUid = 0;
24
- // --- Body scroll lock (ref-counted, shared across nested sheets) --------
25
- let scrollLockCount = 0;
26
- let savedOverflow = '';
27
- let savedPaddingRight = '';
28
- /** Freeze background scroll, compensating the scrollbar gutter to avoid a shift. */
29
- function lockBodyScroll(doc) {
30
- if (scrollLockCount === 0) {
31
- const body = doc.body;
32
- const gap = (doc.defaultView?.innerWidth ?? 0) - doc.documentElement.clientWidth;
33
- savedOverflow = body.style.overflow;
34
- savedPaddingRight = body.style.paddingRight;
35
- body.style.overflow = 'hidden';
36
- if (gap > 0)
37
- body.style.paddingRight = `${gap}px`;
38
- }
39
- scrollLockCount++;
40
- }
41
- /** Release one scroll lock; restore the body when the last sheet closes. */
42
- function unlockBodyScroll(doc) {
43
- scrollLockCount = Math.max(0, scrollLockCount - 1);
44
- if (scrollLockCount === 0) {
45
- doc.body.style.overflow = savedOverflow;
46
- doc.body.style.paddingRight = savedPaddingRight;
47
- }
48
- }
49
25
  /**
50
26
  * Slot markers routing projected content to a region. No behaviour: the sheet
51
27
  * only queries their presence. Each accepts the kebab attribute and the kit's