@4sh/ui-kit 0.12.1 → 0.14.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/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +2 -2
- package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +26 -2
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +6 -0
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs +14 -0
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +7 -0
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +4 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +75 -15
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +5 -3
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +6 -0
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +101 -10
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +4 -1
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
- package/mcp/data/component-api.json +11710 -0
- package/mcp/data/text-search-docs.json +111 -71
- package/mcp/data/ui-config.json +6984 -379
- package/mcp/index.js +24 -2
- package/mcp/package.json +1 -1
- package/package.json +1 -1
- package/styles/component-vars.scss +13 -1
- package/styles/utils/_mixins.scss +9 -10
- package/types/4sh-ui-kit-actions-ui-button.d.ts +24 -0
- package/types/4sh-ui-kit-actions-ui-link.d.ts +6 -0
- package/types/4sh-ui-kit-base-ui-image.d.ts +14 -0
- package/types/4sh-ui-kit-forms-ui-file-upload.d.ts +7 -0
- package/types/4sh-ui-kit-forms-ui-input-date.d.ts +2 -0
- package/types/4sh-ui-kit-forms-ui-input-group.d.ts +47 -15
- package/types/4sh-ui-kit-forms-ui-select.d.ts +3 -1
- package/types/4sh-ui-kit-informative-ui-badge.d.ts +6 -0
- package/types/4sh-ui-kit-navigation-ui-stepper.d.ts +42 -3
- package/types/4sh-ui-kit-table-ui-paginator.d.ts +3 -0
|
@@ -61,8 +61,10 @@ class UiInputDate extends BaseFormField {
|
|
|
61
61
|
* an hour; the browser's own default is `60`, i.e. whole minutes).
|
|
62
62
|
*/
|
|
63
63
|
this.step = input(undefined, { ...(ngDevMode ? { debugName: "step" } : /* istanbul ignore next */ {}), transform: numberAttribute });
|
|
64
|
+
/** Icon of the button that opens the picker: `clock` by default in `mode="time"`. */
|
|
64
65
|
this.icon = input(/* @ts-ignore */
|
|
65
66
|
...(ngDevMode ? [undefined, { debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
67
|
+
/** Renders the button that opens the picker. */
|
|
66
68
|
this.showIcon = input(true, { ...(ngDevMode ? { debugName: "showIcon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
67
69
|
/** Accessible name of the picker button. Defaults per {@link mode}. */
|
|
68
70
|
this.iconAriaLabel = input(/* @ts-ignore */
|
|
@@ -204,13 +206,13 @@ class UiInputDate extends BaseFormField {
|
|
|
204
206
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputDate, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
205
207
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", 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 }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null }, iconAriaLabel: { classPropertyName: "iconAriaLabel", publicName: "iconAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, iconTemplate: { classPropertyName: "iconTemplate", publicName: "iconTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", inputFocus: "inputFocus", inputBlur: "inputBlur" }, providers: [
|
|
206
208
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputDate), multi: true },
|
|
207
|
-
], queries: [{ propertyName: "iconTemplateContent", first: true, predicate: ["icon"], descendants: true, isSignal: true }], 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\n @if (showIcon()) {\n <button\n uiFieldSuffix\n type=\"button\"\n tabindex=\"-1\"\n class=\"ui-input-date-action\"\n [attr.aria-label]=\"resolvedIconAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"openPicker()\"\n >\n @if (resolvedIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else {\n <ui-icon [name]=\"resolvedIcon()\" [size]=\"iconSize()\" />\n }\n </button>\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{display:none}.ui-input-date-native{margin-inline-end:-2.5rem;clip-path:inset(0 2.5rem 0 0)}.ui-input-date-action{display:flex;align-items:center;justify-content:center;align-self:stretch;aspect-ratio:1;flex-shrink:0;padding:0;border:none;background:none;
|
|
209
|
+
], queries: [{ propertyName: "iconTemplateContent", first: true, predicate: ["icon"], descendants: true, isSignal: true }], 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\n @if (showIcon()) {\n <button\n uiFieldSuffix\n type=\"button\"\n tabindex=\"-1\"\n class=\"ui-input-date-action\"\n [attr.aria-label]=\"resolvedIconAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"openPicker()\"\n >\n @if (resolvedIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else {\n <ui-icon [name]=\"resolvedIcon()\" [size]=\"iconSize()\" />\n }\n </button>\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(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-date-native:last-child{padding-inline-end:var(--_field-inset-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{display:none}.ui-input-date-native{margin-inline-end:-2.5rem;clip-path:inset(0 2.5rem 0 0)}.ui-input-date-action{display:flex;align-items:center;justify-content:center;align-self:stretch;aspect-ratio:1;flex-shrink:0;padding:0;border:none;background:none;color:var(--ui-form-field-action-color, var(--form-low-content-default));cursor:pointer;transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-input-date-action:hover:not(:disabled){color:var(--ui-form-field-action-color-hover, var(--form-high-content-hover));background-color:var(--ui-form-field-action-surface-hover, var(--form-high-surface-hover))}.ui-input-date-action:focus-visible{outline:none;color:var(--ui-form-field-action-color-focus, var(--form-high-content-focused));background-color:var(--ui-form-field-action-surface-focus, var(--form-high-surface-focused))}.ui-input-date-action:disabled{cursor:not-allowed;color:var(--ui-form-field-action-color-disabled, var(--form-high-content-disabled))}:host-context([dir=rtl]) .ui-input-date-native{clip-path:inset(0 0 0 2.5rem)}: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"] }, { kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
208
210
|
}
|
|
209
211
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputDate, decorators: [{
|
|
210
212
|
type: Component,
|
|
211
213
|
args: [{ selector: 'ui-input-date', imports: [UiField, UiIcon, NgTemplateOutlet], providers: [
|
|
212
214
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputDate), multi: true },
|
|
213
|
-
], 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\n @if (showIcon()) {\n <button\n uiFieldSuffix\n type=\"button\"\n tabindex=\"-1\"\n class=\"ui-input-date-action\"\n [attr.aria-label]=\"resolvedIconAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"openPicker()\"\n >\n @if (resolvedIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else {\n <ui-icon [name]=\"resolvedIcon()\" [size]=\"iconSize()\" />\n }\n </button>\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{display:none}.ui-input-date-native{margin-inline-end:-2.5rem;clip-path:inset(0 2.5rem 0 0)}.ui-input-date-action{display:flex;align-items:center;justify-content:center;align-self:stretch;aspect-ratio:1;flex-shrink:0;padding:0;border:none;background:none;
|
|
215
|
+
], 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\n @if (showIcon()) {\n <button\n uiFieldSuffix\n type=\"button\"\n tabindex=\"-1\"\n class=\"ui-input-date-action\"\n [attr.aria-label]=\"resolvedIconAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"openPicker()\"\n >\n @if (resolvedIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else {\n <ui-icon [name]=\"resolvedIcon()\" [size]=\"iconSize()\" />\n }\n </button>\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(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-date-native:last-child{padding-inline-end:var(--_field-inset-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{display:none}.ui-input-date-native{margin-inline-end:-2.5rem;clip-path:inset(0 2.5rem 0 0)}.ui-input-date-action{display:flex;align-items:center;justify-content:center;align-self:stretch;aspect-ratio:1;flex-shrink:0;padding:0;border:none;background:none;color:var(--ui-form-field-action-color, var(--form-low-content-default));cursor:pointer;transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-input-date-action:hover:not(:disabled){color:var(--ui-form-field-action-color-hover, var(--form-high-content-hover));background-color:var(--ui-form-field-action-surface-hover, var(--form-high-surface-hover))}.ui-input-date-action:focus-visible{outline:none;color:var(--ui-form-field-action-color-focus, var(--form-high-content-focused));background-color:var(--ui-form-field-action-surface-focus, var(--form-high-surface-focused))}.ui-input-date-action:disabled{cursor:not-allowed;color:var(--ui-form-field-action-color-disabled, var(--form-high-content-disabled))}:host-context([dir=rtl]) .ui-input-date-native{clip-path:inset(0 0 0 2.5rem)}:host-context([data-theme=dark]) .ui-input-date-native{color-scheme:dark}\n"] }]
|
|
214
216
|
}], 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 }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }], showIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showIcon", required: false }] }], iconAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconAriaLabel", required: false }] }], iconTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconTemplate", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], iconTemplateContent: [{ type: i0.ContentChild, args: ['icon', { isSignal: true }] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }] } });
|
|
215
217
|
|
|
216
218
|
/*
|
|
@@ -1 +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 booleanAttribute,\n Component,\n computed,\n contentChild,\n ElementRef,\n forwardRef,\n input,\n numberAttribute,\n output,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\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';\nimport type { UiInputIconContext } from '@4sh/ui-kit/forms/ui-input';\nimport { UiIcon, type UiIconSize } from '@4sh/ui-kit/base/ui-icon';\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, UiIcon, NgTemplateOutlet],\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 icon = input<string>();\n showIcon = input(true, { transform: booleanAttribute });\n /** Accessible name of the picker button. Defaults per {@link mode}. */\n iconAriaLabel = input<string>();\n /** Custom icon, as an input: same context as `ui-input`'s / `ui-datepicker`'s. */\n iconTemplate = input<TemplateRef<UiInputIconContext>>();\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 /** Custom icon: `<ng-template #icon let-name let-size=\"size\">`. */\n private readonly iconTemplateContent = contentChild<TemplateRef<UiInputIconContext>>('icon');\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n\n /** @ignore Icon size aligned with the field size, same pairing as `ui-input`. */\n protected readonly iconSize = computed<UiIconSize>(() => (this.size() === 'small' ? 'sm' : 'md'));\n /** @ignore Calendar, or clock when the field only carries a time. */\n protected readonly resolvedIcon = computed(\n () => this.icon() ?? (this.mode() === 'time' ? 'clock' : 'calendar'),\n );\n /** @ignore */\n protected readonly resolvedIconAriaLabel = computed(\n () =>\n this.iconAriaLabel() ??\n (this.mode() === 'time' ? \"Ouvrir le sélecteur d'heure\" : 'Ouvrir le calendrier'),\n );\n /** @ignore Input wins over the projected `#icon` template. */\n protected readonly resolvedIconTemplate = computed(\n () => this.iconTemplate() ?? this.iconTemplateContent(),\n );\n /** @ignore */\n protected readonly iconContext = computed<UiInputIconContext>(() => ({\n $implicit: this.resolvedIcon(),\n size: this.iconSize(),\n disabled: this.isDisabled(),\n }));\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 openPicker(): void {\n if (this.isDisabled() || this.readonly()) return;\n const el = this.inputEl().nativeElement;\n el.focus();\n try {\n el.showPicker();\n } catch {\n /* no picker to show */\n }\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\n @if (showIcon()) {\n <button\n uiFieldSuffix\n type=\"button\"\n tabindex=\"-1\"\n class=\"ui-input-date-action\"\n [attr.aria-label]=\"resolvedIconAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"openPicker()\"\n >\n @if (resolvedIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else {\n <ui-icon [name]=\"resolvedIcon()\" [size]=\"iconSize()\" />\n }\n </button>\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":";;;;;;;;AAyCA;AACA,MAAM,WAAW,GAAkC;AACjD,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,QAAQ,EAAE,gBAAgB;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AAUG,MAAO,WAAY,SAAQ,aAA6B,CAAA;AAT9D,IAAA,WAAA,GAAA;;;QAWE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAgB,MAAM;iFAAC;AACnC;;;;AAIG;QACH,IAAA,CAAA,SAAS,GAAG,KAAK,CAAqB,MAAM;sFAAC;;AAE7C,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK;2FAAiB;;AAE5B,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK;2FAAiB;AAC5B;;;AAGG;QACH,IAAA,CAAA,IAAI,GAAG,KAAK,CAAkB,SAAS,4EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AAExE,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK;4FAAU;QACtB,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,IAAI,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAEvD,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK;qGAAU;;AAE/B,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK;oGAAmC;;QAGvD,IAAA,CAAA,WAAW,GAAG,MAAM,EAAkB;;QAEtC,IAAA,CAAA,UAAU,GAAG,MAAM,EAAc;;QAEjC,IAAA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A,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,aAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,eAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,mBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,MAAM,iEAGf,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEvHvF;;AAEG;;ACFH;;AAEG;;"}
|
|
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 booleanAttribute,\n Component,\n computed,\n contentChild,\n ElementRef,\n forwardRef,\n input,\n numberAttribute,\n output,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\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';\nimport type { UiInputIconContext } from '@4sh/ui-kit/forms/ui-input';\nimport { UiIcon, type UiIconSize } from '@4sh/ui-kit/base/ui-icon';\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, UiIcon, NgTemplateOutlet],\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 /** Icon of the button that opens the picker: `clock` by default in `mode=\"time\"`. */\n icon = input<string>();\n /** Renders the button that opens the picker. */\n showIcon = input(true, { transform: booleanAttribute });\n /** Accessible name of the picker button. Defaults per {@link mode}. */\n iconAriaLabel = input<string>();\n /** Custom icon, as an input: same context as `ui-input`'s / `ui-datepicker`'s. */\n iconTemplate = input<TemplateRef<UiInputIconContext>>();\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 /** Custom icon: `<ng-template #icon let-name let-size=\"size\">`. */\n private readonly iconTemplateContent = contentChild<TemplateRef<UiInputIconContext>>('icon');\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n\n /** @ignore Icon size aligned with the field size, same pairing as `ui-input`. */\n protected readonly iconSize = computed<UiIconSize>(() => (this.size() === 'small' ? 'sm' : 'md'));\n /** @ignore Calendar, or clock when the field only carries a time. */\n protected readonly resolvedIcon = computed(\n () => this.icon() ?? (this.mode() === 'time' ? 'clock' : 'calendar'),\n );\n /** @ignore */\n protected readonly resolvedIconAriaLabel = computed(\n () =>\n this.iconAriaLabel() ??\n (this.mode() === 'time' ? \"Ouvrir le sélecteur d'heure\" : 'Ouvrir le calendrier'),\n );\n /** @ignore Input wins over the projected `#icon` template. */\n protected readonly resolvedIconTemplate = computed(\n () => this.iconTemplate() ?? this.iconTemplateContent(),\n );\n /** @ignore */\n protected readonly iconContext = computed<UiInputIconContext>(() => ({\n $implicit: this.resolvedIcon(),\n size: this.iconSize(),\n disabled: this.isDisabled(),\n }));\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 openPicker(): void {\n if (this.isDisabled() || this.readonly()) return;\n const el = this.inputEl().nativeElement;\n el.focus();\n try {\n el.showPicker();\n } catch {\n /* no picker to show */\n }\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\n @if (showIcon()) {\n <button\n uiFieldSuffix\n type=\"button\"\n tabindex=\"-1\"\n class=\"ui-input-date-action\"\n [attr.aria-label]=\"resolvedIconAriaLabel()\"\n [disabled]=\"isDisabled()\"\n (click)=\"openPicker()\"\n >\n @if (resolvedIconTemplate(); as tpl) {\n <ng-container [ngTemplateOutlet]=\"tpl\" [ngTemplateOutletContext]=\"iconContext()\" />\n } @else {\n <ui-icon [name]=\"resolvedIcon()\" [size]=\"iconSize()\" />\n }\n </button>\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":";;;;;;;;AAyCA;AACA,MAAM,WAAW,GAAkC;AACjD,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,IAAI,EAAE,MAAM;AACZ,IAAA,QAAQ,EAAE,gBAAgB;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AAUG,MAAO,WAAY,SAAQ,aAA6B,CAAA;AAT9D,IAAA,WAAA,GAAA;;;QAWE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAgB,MAAM;iFAAC;AACnC;;;;AAIG;QACH,IAAA,CAAA,SAAS,GAAG,KAAK,CAAqB,MAAM;sFAAC;;AAE7C,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK;2FAAiB;;AAE5B,QAAA,IAAA,CAAA,GAAG,GAAG,KAAK;2FAAiB;AAC5B;;;AAGG;QACH,IAAA,CAAA,IAAI,GAAG,KAAK,CAAkB,SAAS,4EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;AAGxE,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK;4FAAU;;QAEtB,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,IAAI,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAEvD,QAAA,IAAA,CAAA,aAAa,GAAG,KAAK;qGAAU;;AAE/B,QAAA,IAAA,CAAA,YAAY,GAAG,KAAK;oGAAmC;;QAGvD,IAAA,CAAA,WAAW,GAAG,MAAM,EAAkB;;QAEtC,IAAA,CAAA,UAAU,GAAG,MAAM,EAAc;;QAEjC,IAAA,CAAA,SAAS,GAAG,MAAM,EAAc;;QAGf,IAAA,CAAA,mBAAmB,GAAG,YAAY,CAAkC,MAAM;gGAA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AA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,eAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,cAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,aAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,EAAA,SAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,WAAA,CAAA,EAAA,CAAA,EAAA,mBAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAAA,MAAM,iEAGf,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEzHvF;;AAEG;;ACFH;;AAEG;;"}
|
|
@@ -1,28 +1,74 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, inject, DestroyRef, viewChild, afterNextRender, Component
|
|
2
|
+
import { input, booleanAttribute, inject, DestroyRef, viewChild, computed, afterNextRender, Component } from '@angular/core';
|
|
3
|
+
import { UiLabel } from '@4sh/ui-kit/forms/ui-label';
|
|
4
|
+
import { UiHelper } from '@4sh/ui-kit/informative/ui-helper';
|
|
3
5
|
|
|
6
|
+
let nextUid = 0;
|
|
4
7
|
/**
|
|
5
8
|
* ui-input-group — glues a control and its add-ons into a single visual field.
|
|
6
9
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* cannot reach projected content.
|
|
10
|
+
* Each child keeps its own API and states; the group lays them out on one row,
|
|
11
|
+
* squares the inner corners and collapses the shared borders. The children are
|
|
12
|
+
* **projected**, so that shaping is applied on the DOM (custom properties +
|
|
13
|
+
* flex), not through scoped selectors which cannot reach projected content.
|
|
12
14
|
*
|
|
13
15
|
* Add-ons (text, icon, checkbox…) go through `ui-input-group-addon`; controls
|
|
14
16
|
* (`ui-input`, `ui-select`, `ui-button`…) are placed directly in the group.
|
|
17
|
+
*
|
|
18
|
+
* `label` / `message` render like `ui-field` and turn the group into a
|
|
19
|
+
* `role="group"`. `level` also tints the projected borders: the validity of a
|
|
20
|
+
* composite value belongs to the group. `merged` draws one box around the row.
|
|
15
21
|
*/
|
|
16
22
|
class UiInputGroup {
|
|
17
23
|
constructor() {
|
|
18
|
-
/** Size shared with the projected `ui-input-group-addon` (controls keep their own `size`). */
|
|
24
|
+
/** Size shared with the label and the projected `ui-input-group-addon` (controls keep their own `size`). */
|
|
19
25
|
this.size = input('default', /* @ts-ignore */
|
|
20
26
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
27
|
+
/** Label above the group (rendered via `ui-label`). Names the group, not its controls. */
|
|
28
|
+
this.label = input(/* @ts-ignore */
|
|
29
|
+
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
30
|
+
/** Required marker (*) on the label. Visual only: the mandatory controls carry `required` themselves. */
|
|
31
|
+
this.required = input(false, { ...(ngDevMode ? { debugName: "required" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
32
|
+
/** Message under the group (helper or error, rendered via `ui-helper`). */
|
|
33
|
+
this.message = input(/* @ts-ignore */
|
|
34
|
+
...(ngDevMode ? [undefined, { debugName: "message" }] : /* istanbul ignore next */ []));
|
|
35
|
+
/**
|
|
36
|
+
* Validation status: tints the message and the borders of the projected
|
|
37
|
+
* fields and add-ons. Prevails over a control's own level when set.
|
|
38
|
+
*/
|
|
39
|
+
this.level = input('default', /* @ts-ignore */
|
|
40
|
+
...(ngDevMode ? [{ debugName: "level" }] : /* istanbul ignore next */ []));
|
|
41
|
+
/** Prefixes the message with a decorative icon (off by default). */
|
|
42
|
+
this.showMessageIcon = input(false, { ...(ngDevMode ? { debugName: "showMessageIcon" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
43
|
+
/** Overrides the glyph shown by `showMessageIcon`. Unset = the icon derived from the level. */
|
|
44
|
+
this.messageIcon = input(/* @ts-ignore */
|
|
45
|
+
...(ngDevMode ? [undefined, { debugName: "messageIcon" }] : /* istanbul ignore next */ []));
|
|
46
|
+
/** One box around the whole row: no border nor gap between the items, a single focus ring. */
|
|
47
|
+
this.merged = input(false, { ...(ngDevMode ? { debugName: "merged" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
21
48
|
/** @ignore */
|
|
22
49
|
this.destroyRef = inject(DestroyRef);
|
|
23
50
|
/** @ignore */
|
|
24
51
|
this.row = viewChild.required('row', /* @ts-ignore */
|
|
25
52
|
...(ngDevMode ? [{ debugName: "row" }] : /* istanbul ignore next */ []));
|
|
53
|
+
/** @ignore */
|
|
54
|
+
this.uid = `ui-input-group-${nextUid++}`;
|
|
55
|
+
/** @ignore */
|
|
56
|
+
this.labelId = `${this.uid}-label`;
|
|
57
|
+
/** @ignore */
|
|
58
|
+
this.messageId = `${this.uid}-message`;
|
|
59
|
+
/** @ignore Without label nor message the group stays a plain layout wrapper, with no role. */
|
|
60
|
+
this.isField = computed(() => !!this.label() || !!this.message(), /* @ts-ignore */
|
|
61
|
+
...(ngDevMode ? [{ debugName: "isField" }] : /* istanbul ignore next */ []));
|
|
62
|
+
/** @ignore */
|
|
63
|
+
this.classes = computed(() => {
|
|
64
|
+
const c = ['ui-input-group', `_${this.level()}`];
|
|
65
|
+
if (this.size() !== 'default')
|
|
66
|
+
c.push(`_${this.size()}`);
|
|
67
|
+
if (this.merged())
|
|
68
|
+
c.push('_merged');
|
|
69
|
+
return c.join(' ');
|
|
70
|
+
}, /* @ts-ignore */
|
|
71
|
+
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
26
72
|
afterNextRender(() => {
|
|
27
73
|
this.shape();
|
|
28
74
|
// Items are projected: follow the `@if`/`@for` of the consumer template.
|
|
@@ -39,6 +85,8 @@ class UiInputGroup {
|
|
|
39
85
|
shape() {
|
|
40
86
|
const items = this.items();
|
|
41
87
|
const last = items.length - 1;
|
|
88
|
+
// An add-on, a button, or past the end of the row.
|
|
89
|
+
const isCell = (el) => !el || el.matches('ui-input-group-addon, ui-button');
|
|
42
90
|
items.forEach((el, index) => {
|
|
43
91
|
const start = index === 0 ? 'var(--_radius)' : '0';
|
|
44
92
|
const end = index === last ? 'var(--_radius)' : '0';
|
|
@@ -51,11 +99,23 @@ class UiInputGroup {
|
|
|
51
99
|
el.style.position = 'relative'; // lets the focused item paint above its neighbours
|
|
52
100
|
el.style.marginInlineStart = index === 0 ? '' : 'var(--_overlap)';
|
|
53
101
|
// Add-ons and buttons keep their natural width; the controls take the rest.
|
|
54
|
-
const fixed = el
|
|
55
|
-
el.style.flex = fixed ? '0 0 auto' : '1 1 0'
|
|
102
|
+
const fixed = isCell(el);
|
|
103
|
+
el.style.flex = `var(--ui-input-group-item-flex, ${fixed ? '0 0 auto' : '1 1 0'})`;
|
|
56
104
|
el.style.minWidth = fixed ? '' : '0';
|
|
105
|
+
// Merged only: `--_group-item-inset` is undefined elsewhere, so the field
|
|
106
|
+
// falls back to its own inset.
|
|
107
|
+
this.setInset(el, 'start', !fixed && !isCell(items[index - 1]));
|
|
108
|
+
this.setInset(el, 'end', !fixed && !isCell(items[index + 1]));
|
|
57
109
|
});
|
|
58
110
|
}
|
|
111
|
+
/** @ignore */
|
|
112
|
+
setInset(el, side, tighten) {
|
|
113
|
+
const name = `--_field-inset-inline-${side}`;
|
|
114
|
+
if (tighten)
|
|
115
|
+
el.style.setProperty(name, 'var(--_group-item-inset)');
|
|
116
|
+
else
|
|
117
|
+
el.style.removeProperty(name);
|
|
118
|
+
}
|
|
59
119
|
/** @ignore Raises the focused item so its focus ring is not covered by the overlap. */
|
|
60
120
|
onFocusIn(event) {
|
|
61
121
|
for (const el of this.items()) {
|
|
@@ -68,15 +128,15 @@ class UiInputGroup {
|
|
|
68
128
|
el.style.zIndex = '';
|
|
69
129
|
}
|
|
70
130
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputGroup, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
71
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
131
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiInputGroup, isStandalone: true, selector: "ui-input-group", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, level: { classPropertyName: "level", publicName: "level", isSignal: true, isRequired: false, transformFunction: null }, showMessageIcon: { classPropertyName: "showMessageIcon", publicName: "showMessageIcon", isSignal: true, isRequired: false, transformFunction: null }, messageIcon: { classPropertyName: "messageIcon", publicName: "messageIcon", isSignal: true, isRequired: false, transformFunction: null }, merged: { classPropertyName: "merged", publicName: "merged", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "focusin": "onFocusIn($event)", "focusout": "onFocusOut()" } }, viewQueries: [{ propertyName: "row", first: true, predicate: ["row"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n [class]=\"classes()\"\n [attr.role]=\"isField() ? 'group' : null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-describedby]=\"message() ? messageId : null\"\n>\n @if (label()) {\n <ui-label\n class=\"ui-input-group-label\"\n [attr.id]=\"labelId\"\n [label]=\"label()!\"\n [required]=\"required()\"\n [size]=\"size()\"\n />\n }\n\n <div #row class=\"ui-input-group-row\">\n <ng-content />\n </div>\n\n @if (message()) {\n <ui-helper\n class=\"ui-input-group-message\"\n [attr.id]=\"messageId\"\n [message]=\"message()!\"\n [level]=\"level()\"\n [showIcon]=\"showMessageIcon()\"\n [icon]=\"messageIcon()\"\n size=\"small\"\n />\n }\n</div>\n", styles: [":host{display:block}.ui-input-group{--_radius: var(--ui-input-group-radius, var(--ui-form-field-radius, var(--radius-sm)));--_overlap: calc(-1 * var(--ui-input-group-overlap, var(--ui-control-stroke-width, var(--stroke-default))));--_group-stroke: var(--form-high-stroke-default);--_group-stroke-hover: var(--form-high-stroke-hover);--_group-stroke-focus: var(--form-high-stroke-focused);display:flex;flex-direction:column;gap:var(--ui-input-group-gap, var(--units-xs))}.ui-input-group._small{gap:var(--ui-input-group-gap-small, var(--units-xs))}.ui-input-group-row{display:flex;align-items:stretch;width:100%}.ui-input-group._success{--ui-field-stroke: var(--form-success-stroke-default);--ui-field-stroke-hover: var(--form-success-stroke-hover);--ui-field-stroke-focus: var(--form-success-stroke-focused);--_input-group-stroke: var(--form-success-stroke-default);--_group-stroke: var(--form-success-stroke-default);--_group-stroke-hover: var(--form-success-stroke-hover);--_group-stroke-focus: var(--form-success-stroke-focused)}.ui-input-group._error{--ui-field-stroke: var(--form-error-stroke-default);--ui-field-stroke-hover: var(--form-error-stroke-hover);--ui-field-stroke-focus: var(--form-error-stroke-focused);--_input-group-stroke: var(--form-error-stroke-default);--_group-stroke: var(--form-error-stroke-default);--_group-stroke-hover: var(--form-error-stroke-hover);--_group-stroke-focus: var(--form-error-stroke-focused)}.ui-input-group._merged{--_group-item-inset: var(--ui-input-group-item-padding-x, calc((var(--ui-form-field-gap, var(--units-sm)) - var(--ui-control-stroke-width, var(--stroke-default))) / 2));--ui-field-stroke: transparent;--ui-field-stroke-hover: transparent;--ui-field-stroke-focus: transparent;--ui-field-stroke-disabled: transparent;--ui-field-focus-ring-width: 0px;--_input-group-stroke: transparent}.ui-input-group._merged .ui-input-group-row{position:relative;isolation:isolate}.ui-input-group._merged .ui-input-group-row:after{content:\"\";position:absolute;inset:0;z-index:2;border:var(--ui-input-group-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_group-stroke);border-radius:var(--_radius);pointer-events:none;transition:border-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-input-group._merged .ui-input-group-row:hover:not(:focus-within):after{border-color:var(--_group-stroke-hover)}.ui-input-group._merged .ui-input-group-row:focus-within:after,.ui-input-group._merged .ui-input-group-row:has([aria-expanded=true]):after{border-color:var(--_group-stroke-focus);box-shadow:0 0 0 var(--ui-input-group-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--_group-stroke-focus) r g b/var(--ui-input-group-focus-ring-opacity, 50%))}\n"], dependencies: [{ kind: "component", type: UiLabel, selector: "ui-label", inputs: ["label", "required", "size", "for", "disabled"] }, { kind: "component", type: UiHelper, selector: "ui-helper", inputs: ["message", "level", "size", "showIcon", "icon", "ariaLive"] }] }); }
|
|
72
132
|
}
|
|
73
133
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputGroup, decorators: [{
|
|
74
134
|
type: Component,
|
|
75
|
-
args: [{ selector: 'ui-input-group', host: {
|
|
135
|
+
args: [{ selector: 'ui-input-group', imports: [UiLabel, UiHelper], host: {
|
|
76
136
|
'(focusin)': 'onFocusIn($event)',
|
|
77
137
|
'(focusout)': 'onFocusOut()',
|
|
78
|
-
}, template: "<div #row class=\"ui-input-group\">\n
|
|
79
|
-
}], ctorParameters: () => [], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], row: [{ type: i0.ViewChild, args: ['row', { isSignal: true }] }] } });
|
|
138
|
+
}, template: "<div\n [class]=\"classes()\"\n [attr.role]=\"isField() ? 'group' : null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-describedby]=\"message() ? messageId : null\"\n>\n @if (label()) {\n <ui-label\n class=\"ui-input-group-label\"\n [attr.id]=\"labelId\"\n [label]=\"label()!\"\n [required]=\"required()\"\n [size]=\"size()\"\n />\n }\n\n <div #row class=\"ui-input-group-row\">\n <ng-content />\n </div>\n\n @if (message()) {\n <ui-helper\n class=\"ui-input-group-message\"\n [attr.id]=\"messageId\"\n [message]=\"message()!\"\n [level]=\"level()\"\n [showIcon]=\"showMessageIcon()\"\n [icon]=\"messageIcon()\"\n size=\"small\"\n />\n }\n</div>\n", styles: [":host{display:block}.ui-input-group{--_radius: var(--ui-input-group-radius, var(--ui-form-field-radius, var(--radius-sm)));--_overlap: calc(-1 * var(--ui-input-group-overlap, var(--ui-control-stroke-width, var(--stroke-default))));--_group-stroke: var(--form-high-stroke-default);--_group-stroke-hover: var(--form-high-stroke-hover);--_group-stroke-focus: var(--form-high-stroke-focused);display:flex;flex-direction:column;gap:var(--ui-input-group-gap, var(--units-xs))}.ui-input-group._small{gap:var(--ui-input-group-gap-small, var(--units-xs))}.ui-input-group-row{display:flex;align-items:stretch;width:100%}.ui-input-group._success{--ui-field-stroke: var(--form-success-stroke-default);--ui-field-stroke-hover: var(--form-success-stroke-hover);--ui-field-stroke-focus: var(--form-success-stroke-focused);--_input-group-stroke: var(--form-success-stroke-default);--_group-stroke: var(--form-success-stroke-default);--_group-stroke-hover: var(--form-success-stroke-hover);--_group-stroke-focus: var(--form-success-stroke-focused)}.ui-input-group._error{--ui-field-stroke: var(--form-error-stroke-default);--ui-field-stroke-hover: var(--form-error-stroke-hover);--ui-field-stroke-focus: var(--form-error-stroke-focused);--_input-group-stroke: var(--form-error-stroke-default);--_group-stroke: var(--form-error-stroke-default);--_group-stroke-hover: var(--form-error-stroke-hover);--_group-stroke-focus: var(--form-error-stroke-focused)}.ui-input-group._merged{--_group-item-inset: var(--ui-input-group-item-padding-x, calc((var(--ui-form-field-gap, var(--units-sm)) - var(--ui-control-stroke-width, var(--stroke-default))) / 2));--ui-field-stroke: transparent;--ui-field-stroke-hover: transparent;--ui-field-stroke-focus: transparent;--ui-field-stroke-disabled: transparent;--ui-field-focus-ring-width: 0px;--_input-group-stroke: transparent}.ui-input-group._merged .ui-input-group-row{position:relative;isolation:isolate}.ui-input-group._merged .ui-input-group-row:after{content:\"\";position:absolute;inset:0;z-index:2;border:var(--ui-input-group-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_group-stroke);border-radius:var(--_radius);pointer-events:none;transition:border-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),box-shadow var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-input-group._merged .ui-input-group-row:hover:not(:focus-within):after{border-color:var(--_group-stroke-hover)}.ui-input-group._merged .ui-input-group-row:focus-within:after,.ui-input-group._merged .ui-input-group-row:has([aria-expanded=true]):after{border-color:var(--_group-stroke-focus);box-shadow:0 0 0 var(--ui-input-group-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--_group-stroke-focus) r g b/var(--ui-input-group-focus-ring-opacity, 50%))}\n"] }]
|
|
139
|
+
}], ctorParameters: () => [], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], level: [{ type: i0.Input, args: [{ isSignal: true, alias: "level", required: false }] }], showMessageIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "showMessageIcon", required: false }] }], messageIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "messageIcon", required: false }] }], merged: [{ type: i0.Input, args: [{ isSignal: true, alias: "merged", required: false }] }], row: [{ type: i0.ViewChild, args: ['row', { isSignal: true }] }] } });
|
|
80
140
|
|
|
81
141
|
/**
|
|
82
142
|
* ui-input-group-addon — non-interactive cell of a `ui-input-group`
|
|
@@ -100,11 +160,11 @@ class UiInputGroupAddon {
|
|
|
100
160
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
101
161
|
}
|
|
102
162
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputGroupAddon, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
103
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: UiInputGroupAddon, isStandalone: true, selector: "ui-input-group-addon", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"classes()\">\n <ng-content />\n</div>\n", styles: [":host{display:flex}.ui-input-group-addon{display:flex;align-items:center;justify-content:center;gap:var(--ui-input-group-addon-gap, var(--ui-form-field-gap, var(--units-sm)));box-sizing:border-box;min-width:var(--ui-input-group-addon-height, var(--ui-form-field-height, var(--size-components-default)));min-height:var(--ui-input-group-addon-height, var(--ui-form-field-height, var(--size-components-default)));padding:0 var(--ui-input-group-addon-padding-x, var(--ui-form-field-padding-x, var(--units-md)));border:var(--ui-input-group-addon-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--
|
|
163
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: UiInputGroupAddon, isStandalone: true, selector: "ui-input-group-addon", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"classes()\">\n <ng-content />\n</div>\n", styles: [":host{display:flex}.ui-input-group-addon{--_stroke: var(--ui-input-group-addon-stroke, var(--form-high-stroke-default));display:flex;align-items:center;justify-content:center;gap:var(--ui-input-group-addon-gap, var(--ui-form-field-gap, var(--units-sm)));box-sizing:border-box;min-width:var(--ui-input-group-addon-height, var(--ui-form-field-height, var(--size-components-default)));min-height:var(--ui-input-group-addon-height, var(--ui-form-field-height, var(--size-components-default)));padding:0 var(--ui-input-group-addon-padding-x, var(--ui-form-field-padding-x, var(--units-md)));border:var(--ui-input-group-addon-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_input-group-stroke, var(--_stroke));border-radius:var(--ui-input-group-item-radius, var(--ui-form-field-radius, var(--radius-sm)));background-color:var(--ui-input-group-addon-surface, var(--global-background-muted));color:var(--ui-input-group-addon-color, var(--global-text-muted));font-family:var(--ui-input-group-font-family, var(--fontfamily-base));font-size:var(--ui-input-group-addon-font-size, var(--size-typography-text-default));line-height:1.2;white-space:nowrap;-webkit-user-select:none;user-select:none}.ui-input-group-addon._small{min-width:var(--ui-input-group-addon-height-small, var(--ui-form-field-height-small, var(--size-components-sm)));min-height:var(--ui-input-group-addon-height-small, var(--ui-form-field-height-small, var(--size-components-sm)));font-size:var(--ui-input-group-addon-font-size-small, var(--size-typography-text-md))}\n"] }); }
|
|
104
164
|
}
|
|
105
165
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputGroupAddon, decorators: [{
|
|
106
166
|
type: Component,
|
|
107
|
-
args: [{ selector: 'ui-input-group-addon', template: "<div [class]=\"classes()\">\n <ng-content />\n</div>\n", styles: [":host{display:flex}.ui-input-group-addon{display:flex;align-items:center;justify-content:center;gap:var(--ui-input-group-addon-gap, var(--ui-form-field-gap, var(--units-sm)));box-sizing:border-box;min-width:var(--ui-input-group-addon-height, var(--ui-form-field-height, var(--size-components-default)));min-height:var(--ui-input-group-addon-height, var(--ui-form-field-height, var(--size-components-default)));padding:0 var(--ui-input-group-addon-padding-x, var(--ui-form-field-padding-x, var(--units-md)));border:var(--ui-input-group-addon-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--
|
|
167
|
+
args: [{ selector: 'ui-input-group-addon', template: "<div [class]=\"classes()\">\n <ng-content />\n</div>\n", styles: [":host{display:flex}.ui-input-group-addon{--_stroke: var(--ui-input-group-addon-stroke, var(--form-high-stroke-default));display:flex;align-items:center;justify-content:center;gap:var(--ui-input-group-addon-gap, var(--ui-form-field-gap, var(--units-sm)));box-sizing:border-box;min-width:var(--ui-input-group-addon-height, var(--ui-form-field-height, var(--size-components-default)));min-height:var(--ui-input-group-addon-height, var(--ui-form-field-height, var(--size-components-default)));padding:0 var(--ui-input-group-addon-padding-x, var(--ui-form-field-padding-x, var(--units-md)));border:var(--ui-input-group-addon-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_input-group-stroke, var(--_stroke));border-radius:var(--ui-input-group-item-radius, var(--ui-form-field-radius, var(--radius-sm)));background-color:var(--ui-input-group-addon-surface, var(--global-background-muted));color:var(--ui-input-group-addon-color, var(--global-text-muted));font-family:var(--ui-input-group-font-family, var(--fontfamily-base));font-size:var(--ui-input-group-addon-font-size, var(--size-typography-text-default));line-height:1.2;white-space:nowrap;-webkit-user-select:none;user-select:none}.ui-input-group-addon._small{min-width:var(--ui-input-group-addon-height-small, var(--ui-form-field-height-small, var(--size-components-sm)));min-height:var(--ui-input-group-addon-height-small, var(--ui-form-field-height-small, var(--size-components-sm)));font-size:var(--ui-input-group-addon-font-size-small, var(--size-typography-text-md))}\n"] }]
|
|
108
168
|
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
109
169
|
|
|
110
170
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4sh-ui-kit-forms-ui-input-group.mjs","sources":["../../../projects/ui-kit/forms/ui-input-group/src/lib/ui-input-group.ts","../../../projects/ui-kit/forms/ui-input-group/src/lib/ui-input-group.html","../../../projects/ui-kit/forms/ui-input-group/src/lib/ui-input-group-addon.ts","../../../projects/ui-kit/forms/ui-input-group/src/lib/ui-input-group-addon.html","../../../projects/ui-kit/forms/ui-input-group/src/public-api.ts","../../../projects/ui-kit/forms/ui-input-group/src/4sh-ui-kit-forms-ui-input-group.ts"],"sourcesContent":["import {\n afterNextRender,\n Component,\n DestroyRef,\n ElementRef,\n inject,\n input,\n viewChild,\n} from '@angular/core';\nimport { FieldSize } from '@4sh/ui-kit/forms';\n\n/**\n * ui-input-group — glues a control and its add-ons into a single visual field.\n *\n * Purely presentational: each child keeps its own API and states; the group\n * only lays them out on one row, squares the inner corners and collapses the\n * shared borders. The children are **projected**, so that shaping is applied\n * on the DOM (custom properties + flex), not through scoped selectors which\n * cannot reach projected content.\n *\n * Add-ons (text, icon, checkbox…) go through `ui-input-group-addon`; controls\n * (`ui-input`, `ui-select`, `ui-button`…) are placed directly in the group.\n */\n@Component({\n selector: 'ui-input-group',\n templateUrl: './ui-input-group.html',\n styleUrl: './ui-input-group.scss',\n host: {\n '(focusin)': 'onFocusIn($event)',\n '(focusout)': 'onFocusOut()',\n },\n})\nexport class UiInputGroup {\n /** Size shared with the projected `ui-input-group-addon` (controls keep their own `size`). */\n size = input<FieldSize>('default');\n\n /** @ignore */\n private readonly destroyRef = inject(DestroyRef);\n /** @ignore */\n private readonly row = viewChild.required<ElementRef<HTMLElement>>('row');\n\n constructor() {\n afterNextRender(() => {\n this.shape();\n // Items are projected: follow the `@if`/`@for` of the consumer template.\n const observer = new MutationObserver(() => this.shape());\n observer.observe(this.row().nativeElement, { childList: true });\n this.destroyRef.onDestroy(() => observer.disconnect());\n });\n }\n\n /** @ignore Direct items of the row. */\n private items(): HTMLElement[] {\n return Array.from(this.row().nativeElement.children) as HTMLElement[];\n }\n\n /** @ignore Only the edges keep a rounded corner, and shared borders overlap instead of doubling. */\n private shape(): void {\n const items = this.items();\n const last = items.length - 1;\n items.forEach((el, index) => {\n const start = index === 0 ? 'var(--_radius)' : '0';\n const end = index === last ? 'var(--_radius)' : '0';\n const radius = `${start} ${end} ${end} ${start}`;\n // Radius hooks exposed by the children (custom properties inherit\n // across the component boundary — no ::ng-deep).\n el.style.setProperty('--ui-field-radius', radius);\n el.style.setProperty('--ui-button-radius', radius);\n el.style.setProperty('--ui-input-group-item-radius', radius);\n el.style.position = 'relative'; // lets the focused item paint above its neighbours\n el.style.marginInlineStart = index === 0 ? '' : 'var(--_overlap)';\n // Add-ons and buttons keep their natural width; the controls take the rest.\n const fixed = el.matches('ui-input-group-addon, ui-button');\n el.style.flex = fixed ? '0 0 auto' : '1 1 0';\n el.style.minWidth = fixed ? '' : '0';\n });\n }\n\n /** @ignore Raises the focused item so its focus ring is not covered by the overlap. */\n protected onFocusIn(event: FocusEvent): void {\n for (const el of this.items()) {\n el.style.zIndex = el.contains(event.target as Node) ? '1' : '';\n }\n }\n\n /** @ignore */\n protected onFocusOut(): void {\n for (const el of this.items()) el.style.zIndex = '';\n }\n}\n","<div #row class=\"ui-input-group\">\n <ng-content />\n</div>\n","import { Component, computed, inject, input } from '@angular/core';\nimport { FieldSize } from '@4sh/ui-kit/forms';\nimport { UiInputGroup } from './ui-input-group';\n\n/**\n * ui-input-group-addon — non-interactive cell of a `ui-input-group`\n * (text, icon, checkbox, radio…).\n *\n * Projects its content in a box aligned on the field height. `size` falls back\n * to the parent group's when it is not set.\n */\n@Component({\n selector: 'ui-input-group-addon',\n templateUrl: './ui-input-group-addon.html',\n styleUrl: './ui-input-group-addon.scss',\n})\nexport class UiInputGroupAddon {\n /** Size (defaults to the parent `ui-input-group` size). */\n size = input<FieldSize>();\n\n /** @ignore */\n private readonly group = inject(UiInputGroup, { optional: true });\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const size = this.size() ?? this.group?.size() ?? 'default';\n return size === 'default' ? 'ui-input-group-addon' : `ui-input-group-addon _${size}`;\n });\n}\n","<div [class]=\"classes()\">\n <ng-content />\n</div>\n","/*\n * Public API Surface of ui-kit/ui-input-group\n */\n\nexport * from './lib/ui-input-group-addon';\nexport * from './lib/ui-input-group';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAWA;;;;;;;;;;;AAWG;MAUU,YAAY,CAAA;AASvB,IAAA,WAAA,GAAA;;QAPA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAY,SAAS;iFAAC;;AAGjB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;AAE/B,QAAA,IAAA,CAAA,GAAG,GAAG,SAAS,CAAC,QAAQ,CAA0B,KAAK;gFAAC;QAGvE,eAAe,CAAC,MAAK;YACnB,IAAI,CAAC,KAAK,EAAE;;AAEZ,YAAA,MAAM,QAAQ,GAAG,IAAI,gBAAgB,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;AACzD,YAAA,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,aAAa,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC/D,YAAA,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,QAAQ,CAAC,UAAU,EAAE,CAAC;AACxD,QAAA,CAAC,CAAC;IACJ;;IAGQ,KAAK,GAAA;AACX,QAAA,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,QAAQ,CAAkB;IACvE;;IAGQ,KAAK,GAAA;AACX,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE;AAC1B,QAAA,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC;QAC7B,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,KAAK,KAAI;AAC1B,YAAA,MAAM,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,gBAAgB,GAAG,GAAG;AAClD,YAAA,MAAM,GAAG,GAAG,KAAK,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A,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,iBAAiB,iNChB9B,yDAGA,EAAA,MAAA,EAAA,CAAA,o+CAAA,CAAA,EAAA,CAAA,CAAA;;2FDaa,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAL7B,SAAS;+BACE,sBAAsB,EAAA,QAAA,EAAA,yDAAA,EAAA,MAAA,EAAA,CAAA,o+CAAA,CAAA,EAAA;;;AEZlC;;AAEG;;ACFH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"4sh-ui-kit-forms-ui-input-group.mjs","sources":["../../../projects/ui-kit/forms/ui-input-group/src/lib/ui-input-group.ts","../../../projects/ui-kit/forms/ui-input-group/src/lib/ui-input-group.html","../../../projects/ui-kit/forms/ui-input-group/src/lib/ui-input-group-addon.ts","../../../projects/ui-kit/forms/ui-input-group/src/lib/ui-input-group-addon.html","../../../projects/ui-kit/forms/ui-input-group/src/public-api.ts","../../../projects/ui-kit/forms/ui-input-group/src/4sh-ui-kit-forms-ui-input-group.ts"],"sourcesContent":["import {\n afterNextRender,\n booleanAttribute,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n viewChild,\n} from '@angular/core';\nimport { UiLabel } from '@4sh/ui-kit/forms/ui-label';\nimport { UiHelper } from '@4sh/ui-kit/informative/ui-helper';\nimport { FieldLevel, FieldSize } from '@4sh/ui-kit/forms';\n\nlet nextUid = 0;\n\n/**\n * ui-input-group — glues a control and its add-ons into a single visual field.\n *\n * Each child keeps its own API and states; the group lays them out on one row,\n * squares the inner corners and collapses the shared borders. The children are\n * **projected**, so that shaping is applied on the DOM (custom properties +\n * flex), not through scoped selectors which cannot reach projected content.\n *\n * Add-ons (text, icon, checkbox…) go through `ui-input-group-addon`; controls\n * (`ui-input`, `ui-select`, `ui-button`…) are placed directly in the group.\n *\n * `label` / `message` render like `ui-field` and turn the group into a\n * `role=\"group\"`. `level` also tints the projected borders: the validity of a\n * composite value belongs to the group. `merged` draws one box around the row.\n */\n@Component({\n selector: 'ui-input-group',\n imports: [UiLabel, UiHelper],\n templateUrl: './ui-input-group.html',\n styleUrl: './ui-input-group.scss',\n host: {\n '(focusin)': 'onFocusIn($event)',\n '(focusout)': 'onFocusOut()',\n },\n})\nexport class UiInputGroup {\n /** Size shared with the label and the projected `ui-input-group-addon` (controls keep their own `size`). */\n size = input<FieldSize>('default');\n /** Label above the group (rendered via `ui-label`). Names the group, not its controls. */\n label = input<string>();\n /** Required marker (*) on the label. Visual only: the mandatory controls carry `required` themselves. */\n required = input(false, { transform: booleanAttribute });\n /** Message under the group (helper or error, rendered via `ui-helper`). */\n message = input<string>();\n /**\n * Validation status: tints the message and the borders of the projected\n * fields and add-ons. Prevails over a control's own level when set.\n */\n level = input<FieldLevel>('default');\n /** Prefixes the message with a decorative icon (off by default). */\n showMessageIcon = input(false, { transform: booleanAttribute });\n /** Overrides the glyph shown by `showMessageIcon`. Unset = the icon derived from the level. */\n messageIcon = input<string>();\n /** One box around the whole row: no border nor gap between the items, a single focus ring. */\n merged = input(false, { transform: booleanAttribute });\n\n /** @ignore */\n private readonly destroyRef = inject(DestroyRef);\n /** @ignore */\n private readonly row = viewChild.required<ElementRef<HTMLElement>>('row');\n\n /** @ignore */\n protected readonly uid = `ui-input-group-${nextUid++}`;\n /** @ignore */\n protected readonly labelId = `${this.uid}-label`;\n /** @ignore */\n protected readonly messageId = `${this.uid}-message`;\n\n /** @ignore Without label nor message the group stays a plain layout wrapper, with no role. */\n protected readonly isField = computed(() => !!this.label() || !!this.message());\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-input-group', `_${this.level()}`];\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n if (this.merged()) c.push('_merged');\n return c.join(' ');\n });\n\n constructor() {\n afterNextRender(() => {\n this.shape();\n // Items are projected: follow the `@if`/`@for` of the consumer template.\n const observer = new MutationObserver(() => this.shape());\n observer.observe(this.row().nativeElement, { childList: true });\n this.destroyRef.onDestroy(() => observer.disconnect());\n });\n }\n\n /** @ignore Direct items of the row. */\n private items(): HTMLElement[] {\n return Array.from(this.row().nativeElement.children) as HTMLElement[];\n }\n\n /** @ignore Only the edges keep a rounded corner, and shared borders overlap instead of doubling. */\n private shape(): void {\n const items = this.items();\n const last = items.length - 1;\n // An add-on, a button, or past the end of the row.\n const isCell = (el?: HTMLElement) => !el || el.matches('ui-input-group-addon, ui-button');\n items.forEach((el, index) => {\n const start = index === 0 ? 'var(--_radius)' : '0';\n const end = index === last ? 'var(--_radius)' : '0';\n const radius = `${start} ${end} ${end} ${start}`;\n // Radius hooks exposed by the children (custom properties inherit\n // across the component boundary — no ::ng-deep).\n el.style.setProperty('--ui-field-radius', radius);\n el.style.setProperty('--ui-button-radius', radius);\n el.style.setProperty('--ui-input-group-item-radius', radius);\n el.style.position = 'relative'; // lets the focused item paint above its neighbours\n el.style.marginInlineStart = index === 0 ? '' : 'var(--_overlap)';\n // Add-ons and buttons keep their natural width; the controls take the rest.\n const fixed = isCell(el);\n el.style.flex = `var(--ui-input-group-item-flex, ${fixed ? '0 0 auto' : '1 1 0'})`;\n el.style.minWidth = fixed ? '' : '0';\n // Merged only: `--_group-item-inset` is undefined elsewhere, so the field\n // falls back to its own inset.\n this.setInset(el, 'start', !fixed && !isCell(items[index - 1]));\n this.setInset(el, 'end', !fixed && !isCell(items[index + 1]));\n });\n }\n\n /** @ignore */\n private setInset(el: HTMLElement, side: 'start' | 'end', tighten: boolean): void {\n const name = `--_field-inset-inline-${side}`;\n if (tighten) el.style.setProperty(name, 'var(--_group-item-inset)');\n else el.style.removeProperty(name);\n }\n\n /** @ignore Raises the focused item so its focus ring is not covered by the overlap. */\n protected onFocusIn(event: FocusEvent): void {\n for (const el of this.items()) {\n el.style.zIndex = el.contains(event.target as Node) ? '1' : '';\n }\n }\n\n /** @ignore */\n protected onFocusOut(): void {\n for (const el of this.items()) el.style.zIndex = '';\n }\n}\n","<div\n [class]=\"classes()\"\n [attr.role]=\"isField() ? 'group' : null\"\n [attr.aria-labelledby]=\"label() ? labelId : null\"\n [attr.aria-describedby]=\"message() ? messageId : null\"\n>\n @if (label()) {\n <ui-label\n class=\"ui-input-group-label\"\n [attr.id]=\"labelId\"\n [label]=\"label()!\"\n [required]=\"required()\"\n [size]=\"size()\"\n />\n }\n\n <div #row class=\"ui-input-group-row\">\n <ng-content />\n </div>\n\n @if (message()) {\n <ui-helper\n class=\"ui-input-group-message\"\n [attr.id]=\"messageId\"\n [message]=\"message()!\"\n [level]=\"level()\"\n [showIcon]=\"showMessageIcon()\"\n [icon]=\"messageIcon()\"\n size=\"small\"\n />\n }\n</div>\n","import { Component, computed, inject, input } from '@angular/core';\nimport { FieldSize } from '@4sh/ui-kit/forms';\nimport { UiInputGroup } from './ui-input-group';\n\n/**\n * ui-input-group-addon — non-interactive cell of a `ui-input-group`\n * (text, icon, checkbox, radio…).\n *\n * Projects its content in a box aligned on the field height. `size` falls back\n * to the parent group's when it is not set.\n */\n@Component({\n selector: 'ui-input-group-addon',\n templateUrl: './ui-input-group-addon.html',\n styleUrl: './ui-input-group-addon.scss',\n})\nexport class UiInputGroupAddon {\n /** Size (defaults to the parent `ui-input-group` size). */\n size = input<FieldSize>();\n\n /** @ignore */\n private readonly group = inject(UiInputGroup, { optional: true });\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const size = this.size() ?? this.group?.size() ?? 'default';\n return size === 'default' ? 'ui-input-group-addon' : `ui-input-group-addon _${size}`;\n });\n}\n","<div [class]=\"classes()\">\n <ng-content />\n</div>\n","/*\n * Public API Surface of ui-kit/ui-input-group\n */\n\nexport * from './lib/ui-input-group-addon';\nexport * from './lib/ui-input-group';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAeA,IAAI,OAAO,GAAG,CAAC;AAEf;;;;;;;;;;;;;;AAcG;MAWU,YAAY,CAAA;AA4CvB,IAAA,WAAA,GAAA;;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EAAA,IAAA,EAAA,iBAAiB,iNChB9B,yDAGA,EAAA,MAAA,EAAA,CAAA,0hDAAA,CAAA,EAAA,CAAA,CAAA;;2FDaa,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAL7B,SAAS;+BACE,sBAAsB,EAAA,QAAA,EAAA,yDAAA,EAAA,MAAA,EAAA,CAAA,0hDAAA,CAAA,EAAA;;;AEZlC;;AAEG;;ACFH;;AAEG;;"}
|
|
@@ -110,13 +110,13 @@ class UiInputMask extends BaseFormField {
|
|
|
110
110
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputMask, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
111
111
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiInputMask, isStandalone: true, selector: "ui-input-mask", inputs: { mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: true, transformFunction: null }, ranges: { classPropertyName: "ranges", publicName: "ranges", isSignal: true, isRequired: false, transformFunction: null }, slotChar: { classPropertyName: "slotChar", publicName: "slotChar", isSignal: true, isRequired: false, transformFunction: null }, unmask: { classPropertyName: "unmask", publicName: "unmask", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, iconLeft: { classPropertyName: "iconLeft", publicName: "iconLeft", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", inputBlur: "inputBlur" }, providers: [
|
|
112
112
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputMask), multi: true },
|
|
113
|
-
], 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]=\"isFilled()\"\n [hasPrefix]=\"!!iconLeft()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n @if (iconLeft(); as name) {\n <ui-icon\n uiFieldPrefix\n class=\"ui-input-mask-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"name\"\n [size]=\"iconSize()\"\n />\n }\n\n <input\n #inputEl\n class=\"ui-input-mask-native\"\n [class._small]=\"size() === 'small'\"\n type=\"text\"\n [id]=\"resolvedId()\"\n [value]=\"text()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"displayMessage() ? messageId() : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (blur)=\"onBlur($event)\"\n />\n</ui-field>\n", styles: [".ui-input-mask-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-mask-native:first-child{padding-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-mask-native:last-child{padding-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-mask-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-mask-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-mask-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-mask-native._small{font-size:var(--ui-input-mask-font-size-small, var(--size-typography-text-md))}.ui-input-mask-icon{flex-shrink:0;color:var(--ui-form-field-affix-color, var(--form-low-content-default))}.ui-input-mask-icon:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-mask-icon:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-mask-icon._disabled{color:var(--ui-form-field-affix-color-disabled, var(--form-high-content-disabled))}\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"] }, { kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }] }); }
|
|
113
|
+
], 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]=\"isFilled()\"\n [hasPrefix]=\"!!iconLeft()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n @if (iconLeft(); as name) {\n <ui-icon\n uiFieldPrefix\n class=\"ui-input-mask-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"name\"\n [size]=\"iconSize()\"\n />\n }\n\n <input\n #inputEl\n class=\"ui-input-mask-native\"\n [class._small]=\"size() === 'small'\"\n type=\"text\"\n [id]=\"resolvedId()\"\n [value]=\"text()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"displayMessage() ? messageId() : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (blur)=\"onBlur($event)\"\n />\n</ui-field>\n", styles: [".ui-input-mask-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-mask-native:first-child{padding-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-mask-native:last-child{padding-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-mask-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-mask-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-mask-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-mask-native._small{font-size:var(--ui-input-mask-font-size-small, var(--size-typography-text-md))}.ui-input-mask-icon{flex-shrink:0;color:var(--ui-form-field-affix-color, var(--form-low-content-default))}.ui-input-mask-icon:first-child{margin-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-mask-icon:last-child{margin-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-mask-icon._disabled{color:var(--ui-form-field-affix-color-disabled, var(--form-high-content-disabled))}\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"] }, { kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }] }); }
|
|
114
114
|
}
|
|
115
115
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputMask, decorators: [{
|
|
116
116
|
type: Component,
|
|
117
117
|
args: [{ selector: 'ui-input-mask', imports: [UiField, UiIcon], providers: [
|
|
118
118
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputMask), multi: true },
|
|
119
|
-
], template: "<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"isFilled()\"\n [hasPrefix]=\"!!iconLeft()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n @if (iconLeft(); as name) {\n <ui-icon\n uiFieldPrefix\n class=\"ui-input-mask-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"name\"\n [size]=\"iconSize()\"\n />\n }\n\n <input\n #inputEl\n class=\"ui-input-mask-native\"\n [class._small]=\"size() === 'small'\"\n type=\"text\"\n [id]=\"resolvedId()\"\n [value]=\"text()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"displayMessage() ? messageId() : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (blur)=\"onBlur($event)\"\n />\n</ui-field>\n", styles: [".ui-input-mask-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-mask-native:first-child{padding-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-mask-native:last-child{padding-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-mask-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-mask-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-mask-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-mask-native._small{font-size:var(--ui-input-mask-font-size-small, var(--size-typography-text-md))}.ui-input-mask-icon{flex-shrink:0;color:var(--ui-form-field-affix-color, var(--form-low-content-default))}.ui-input-mask-icon:first-child{margin-inline-start:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-mask-icon:last-child{margin-inline-end:var(--ui-form-field-padding-x, var(--units-md))}.ui-input-mask-icon._disabled{color:var(--ui-form-field-affix-color-disabled, var(--form-high-content-disabled))}\n"] }]
|
|
119
|
+
], template: "<ui-field\n [label]=\"label()\"\n [for]=\"resolvedId()\"\n [required]=\"required()\"\n [size]=\"size()\"\n [level]=\"effectiveLevel()\"\n [floatLabel]=\"floatLabel()\"\n [filled]=\"isFilled()\"\n [hasPrefix]=\"!!iconLeft()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n @if (iconLeft(); as name) {\n <ui-icon\n uiFieldPrefix\n class=\"ui-input-mask-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"name\"\n [size]=\"iconSize()\"\n />\n }\n\n <input\n #inputEl\n class=\"ui-input-mask-native\"\n [class._small]=\"size() === 'small'\"\n type=\"text\"\n [id]=\"resolvedId()\"\n [value]=\"text()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"displayMessage() ? messageId() : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (blur)=\"onBlur($event)\"\n />\n</ui-field>\n", styles: [".ui-input-mask-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-mask-native:first-child{padding-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-mask-native:last-child{padding-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-mask-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-mask-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-mask-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-mask-native._small{font-size:var(--ui-input-mask-font-size-small, var(--size-typography-text-md))}.ui-input-mask-icon{flex-shrink:0;color:var(--ui-form-field-affix-color, var(--form-low-content-default))}.ui-input-mask-icon:first-child{margin-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-mask-icon:last-child{margin-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-mask-icon._disabled{color:var(--ui-form-field-affix-color-disabled, var(--form-high-content-disabled))}\n"] }]
|
|
120
120
|
}], propDecorators: { mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: true }] }], ranges: [{ type: i0.Input, args: [{ isSignal: true, alias: "ranges", required: false }] }], slotChar: [{ type: i0.Input, args: [{ isSignal: true, alias: "slotChar", required: false }] }], unmask: [{ type: i0.Input, args: [{ isSignal: true, alias: "unmask", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], iconLeft: [{ type: i0.Input, args: [{ isSignal: true, alias: "iconLeft", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }] } });
|
|
121
121
|
|
|
122
122
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4sh-ui-kit-forms-ui-input-mask.mjs","sources":["../../../projects/ui-kit/forms/ui-input-mask/src/lib/ui-input-mask.ts","../../../projects/ui-kit/forms/ui-input-mask/src/lib/ui-input-mask.html","../../../projects/ui-kit/forms/ui-input-mask/src/public-api.ts","../../../projects/ui-kit/forms/ui-input-mask/src/4sh-ui-kit-forms-ui-input-mask.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n ElementRef,\n forwardRef,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseFormField } from '@4sh/ui-kit/forms';\nimport { UiField } from '@4sh/ui-kit/forms/ui-field';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/base/ui-icon';\nimport {\n applyMaskTemplate,\n buildMaskSlots,\n caretForMask,\n extractMaskData,\n MaskBounds,\n MaskSlot,\n parseMaskRanges,\n} from '@4sh/ui-kit/forms';\n\n/**\n * ui-input-mask — headless masked field (`ui-field` shell).\n *\n * `mask` describes the template: `9` digit, `a` letter, `*` alphanumeric; any\n * other character is a literal inserted automatically (e.g. `99/99/9999`,\n * `(999) 999-9999`). Empty positions show `slotChar`.\n *\n * Model value = string: masked (`12/09/2024`) by default, or raw (`12092024`)\n * when `unmask`. Standalone, `[(ngModel)]` or reactive forms.\n */\n@Component({\n selector: 'ui-input-mask',\n imports: [UiField, UiIcon],\n templateUrl: './ui-input-mask.html',\n styleUrl: './ui-input-mask.scss',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputMask), multi: true },\n ],\n})\nexport class UiInputMask extends BaseFormField<string> {\n /** Mask template (9 digit · a letter · * alphanumeric · other = literal). */\n mask = input.required<string>();\n /**\n * Inclusive bounds of each numeric segment (run of consecutive `9` tokens),\n * in mask order and space-separated: `\"0-23 0-59\"` for `99:99`,\n * `\"1-31 1-12 1900-2100\"` for `99/99/9999`. `*` leaves a segment unbounded.\n * A character that could not lead to an in-range segment is rejected.\n */\n ranges = input('');\n /** Fill character for empty positions. */\n slotChar = input('_');\n /** Emit the raw value (without literals) instead of the masked value. */\n unmask = input(false, { transform: booleanAttribute });\n /** Native placeholder (shown when the field is empty). */\n placeholder = input<string>();\n /** Left FontAwesome icon name (decorative). */\n iconLeft = input<string>();\n\n /** Emitted on each value change. */\n valueChange = output<string>();\n /** Emitted when the input loses focus. */\n inputBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n /** @ignore Masked displayed text. */\n protected readonly text = signal('');\n /** @ignore Keeps a floating label raised once focus leaves. */\n protected readonly isFilled = computed(() => this.text() !== '');\n /** @ignore At rest the floating label already holds that spot. */\n protected readonly effectivePlaceholder = computed(() =>\n this.hasFloatLabel() ? '' : (this.placeholder() ?? ''),\n );\n\n /** @ignore */\n protected readonly iconSize = computed<UiIconSize>(() => (this.size() === 'small' ? 'sm' : 'md'));\n\n /** @ignore Bounds declared by `ranges`, one entry per numeric segment (`null` = unbounded). */\n private readonly parsedRanges = computed<(MaskBounds | null)[]>(() =>\n parseMaskRanges(this.ranges()),\n );\n\n /**\n * @ignore The mask resolved once per template: literals, input slots, and the\n * `ranges` bounds attached to every slot of the numeric segment it belongs to.\n */\n private readonly slots = computed<MaskSlot[]>(() =>\n buildMaskSlots(this.mask(), this.parsedRanges()),\n );\n\n override writeValue(value: string | null): void {\n const built = applyMaskTemplate(this.slots(), extractMaskData(value ?? ''), this.slotChar());\n this.modelValue.set(this.emitValue(built));\n this.text.set(built.data.length ? built.display : '');\n }\n\n /** Focuses the input. */\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** @ignore Input: apply the mask, update model + display + caret. */\n protected onInput(): void {\n const el = this.inputEl().nativeElement;\n const raw = el.value;\n const caret = el.selectionStart ?? raw.length;\n // Number of data characters located BEFORE the caret (stable anchor).\n const dataBeforeCaret = extractMaskData(raw.slice(0, caret)).length;\n\n const built = applyMaskTemplate(this.slots(), extractMaskData(raw), this.slotChar());\n const value = this.emitValue(built);\n const display = built.data.length ? built.display : '';\n\n this.text.set(display);\n this.modelValue.set(value);\n this.emitChange(value);\n this.valueChange.emit(value);\n\n // Apply synchronously + restore the caret after the Nth typed character\n // (auto-inserted literals skipped). The [value] binding becomes a no-op.\n el.value = display;\n const pos = caretForMask(built.tokenIndices, dataBeforeCaret, display.length);\n el.setSelectionRange(pos, pos);\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.inputBlur.emit(event);\n }\n\n /** @ignore Emitted value depending on `unmask`. */\n private emitValue(built: { masked: string; data: string }): string {\n return this.unmask() ? built.data : built.masked;\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]=\"isFilled()\"\n [hasPrefix]=\"!!iconLeft()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n @if (iconLeft(); as name) {\n <ui-icon\n uiFieldPrefix\n class=\"ui-input-mask-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"name\"\n [size]=\"iconSize()\"\n />\n }\n\n <input\n #inputEl\n class=\"ui-input-mask-native\"\n [class._small]=\"size() === 'small'\"\n type=\"text\"\n [id]=\"resolvedId()\"\n [value]=\"text()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"displayMessage() ? messageId() : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (blur)=\"onBlur($event)\"\n />\n</ui-field>\n","/*\n * Public API Surface of ui-kit/ui-input-mask\n */\n\nexport * from './lib/ui-input-mask';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAyBA;;;;;;;;;AASG;AAUG,MAAO,WAAY,SAAQ,aAAqB,CAAA;AATtD,IAAA,WAAA,GAAA;;;QAWE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,QAAQ;iFAAU;AAC/B;;;;;AAKG;QACH,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,EAAE;mFAAC;;QAElB,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,GAAG;qFAAC;;QAErB,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,KAAK,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAEtD,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAAU;;AAE7B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK;gGAAU;;QAG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AOd,WAAW,EAAA,UAAA,EAAA,CAAA;kBATvB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,eAAe,WAChB,CAAC,OAAO,EAAE,MAAM,CAAC,EAAA,SAAA,EAGf;AACT,wBAAA,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;AACxF,qBAAA,EAAA,QAAA,EAAA,s2CAAA,EAAA,MAAA,EAAA,CAAA,k4CAAA,CAAA,EAAA;4uBA2B2E,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AErEvF;;AAEG;;ACFH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"4sh-ui-kit-forms-ui-input-mask.mjs","sources":["../../../projects/ui-kit/forms/ui-input-mask/src/lib/ui-input-mask.ts","../../../projects/ui-kit/forms/ui-input-mask/src/lib/ui-input-mask.html","../../../projects/ui-kit/forms/ui-input-mask/src/public-api.ts","../../../projects/ui-kit/forms/ui-input-mask/src/4sh-ui-kit-forms-ui-input-mask.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n ElementRef,\n forwardRef,\n input,\n output,\n signal,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseFormField } from '@4sh/ui-kit/forms';\nimport { UiField } from '@4sh/ui-kit/forms/ui-field';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/base/ui-icon';\nimport {\n applyMaskTemplate,\n buildMaskSlots,\n caretForMask,\n extractMaskData,\n MaskBounds,\n MaskSlot,\n parseMaskRanges,\n} from '@4sh/ui-kit/forms';\n\n/**\n * ui-input-mask — headless masked field (`ui-field` shell).\n *\n * `mask` describes the template: `9` digit, `a` letter, `*` alphanumeric; any\n * other character is a literal inserted automatically (e.g. `99/99/9999`,\n * `(999) 999-9999`). Empty positions show `slotChar`.\n *\n * Model value = string: masked (`12/09/2024`) by default, or raw (`12092024`)\n * when `unmask`. Standalone, `[(ngModel)]` or reactive forms.\n */\n@Component({\n selector: 'ui-input-mask',\n imports: [UiField, UiIcon],\n templateUrl: './ui-input-mask.html',\n styleUrl: './ui-input-mask.scss',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputMask), multi: true },\n ],\n})\nexport class UiInputMask extends BaseFormField<string> {\n /** Mask template (9 digit · a letter · * alphanumeric · other = literal). */\n mask = input.required<string>();\n /**\n * Inclusive bounds of each numeric segment (run of consecutive `9` tokens),\n * in mask order and space-separated: `\"0-23 0-59\"` for `99:99`,\n * `\"1-31 1-12 1900-2100\"` for `99/99/9999`. `*` leaves a segment unbounded.\n * A character that could not lead to an in-range segment is rejected.\n */\n ranges = input('');\n /** Fill character for empty positions. */\n slotChar = input('_');\n /** Emit the raw value (without literals) instead of the masked value. */\n unmask = input(false, { transform: booleanAttribute });\n /** Native placeholder (shown when the field is empty). */\n placeholder = input<string>();\n /** Left FontAwesome icon name (decorative). */\n iconLeft = input<string>();\n\n /** Emitted on each value change. */\n valueChange = output<string>();\n /** Emitted when the input loses focus. */\n inputBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n /** @ignore Masked displayed text. */\n protected readonly text = signal('');\n /** @ignore Keeps a floating label raised once focus leaves. */\n protected readonly isFilled = computed(() => this.text() !== '');\n /** @ignore At rest the floating label already holds that spot. */\n protected readonly effectivePlaceholder = computed(() =>\n this.hasFloatLabel() ? '' : (this.placeholder() ?? ''),\n );\n\n /** @ignore */\n protected readonly iconSize = computed<UiIconSize>(() => (this.size() === 'small' ? 'sm' : 'md'));\n\n /** @ignore Bounds declared by `ranges`, one entry per numeric segment (`null` = unbounded). */\n private readonly parsedRanges = computed<(MaskBounds | null)[]>(() =>\n parseMaskRanges(this.ranges()),\n );\n\n /**\n * @ignore The mask resolved once per template: literals, input slots, and the\n * `ranges` bounds attached to every slot of the numeric segment it belongs to.\n */\n private readonly slots = computed<MaskSlot[]>(() =>\n buildMaskSlots(this.mask(), this.parsedRanges()),\n );\n\n override writeValue(value: string | null): void {\n const built = applyMaskTemplate(this.slots(), extractMaskData(value ?? ''), this.slotChar());\n this.modelValue.set(this.emitValue(built));\n this.text.set(built.data.length ? built.display : '');\n }\n\n /** Focuses the input. */\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** @ignore Input: apply the mask, update model + display + caret. */\n protected onInput(): void {\n const el = this.inputEl().nativeElement;\n const raw = el.value;\n const caret = el.selectionStart ?? raw.length;\n // Number of data characters located BEFORE the caret (stable anchor).\n const dataBeforeCaret = extractMaskData(raw.slice(0, caret)).length;\n\n const built = applyMaskTemplate(this.slots(), extractMaskData(raw), this.slotChar());\n const value = this.emitValue(built);\n const display = built.data.length ? built.display : '';\n\n this.text.set(display);\n this.modelValue.set(value);\n this.emitChange(value);\n this.valueChange.emit(value);\n\n // Apply synchronously + restore the caret after the Nth typed character\n // (auto-inserted literals skipped). The [value] binding becomes a no-op.\n el.value = display;\n const pos = caretForMask(built.tokenIndices, dataBeforeCaret, display.length);\n el.setSelectionRange(pos, pos);\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.inputBlur.emit(event);\n }\n\n /** @ignore Emitted value depending on `unmask`. */\n private emitValue(built: { masked: string; data: string }): string {\n return this.unmask() ? built.data : built.masked;\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]=\"isFilled()\"\n [hasPrefix]=\"!!iconLeft()\"\n [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n @if (iconLeft(); as name) {\n <ui-icon\n uiFieldPrefix\n class=\"ui-input-mask-icon\"\n [class._disabled]=\"isDisabled()\"\n [name]=\"name\"\n [size]=\"iconSize()\"\n />\n }\n\n <input\n #inputEl\n class=\"ui-input-mask-native\"\n [class._small]=\"size() === 'small'\"\n type=\"text\"\n [id]=\"resolvedId()\"\n [value]=\"text()\"\n [placeholder]=\"effectivePlaceholder()\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [required]=\"required()\"\n [attr.name]=\"name() || null\"\n [attr.tabindex]=\"tabindex()\"\n [attr.aria-label]=\"label() ? null : ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [attr.aria-describedby]=\"displayMessage() ? messageId() : null\"\n [attr.aria-invalid]=\"effectiveLevel() === 'error' ? 'true' : null\"\n (input)=\"onInput()\"\n (blur)=\"onBlur($event)\"\n />\n</ui-field>\n","/*\n * Public API Surface of ui-kit/ui-input-mask\n */\n\nexport * from './lib/ui-input-mask';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAyBA;;;;;;;;;AASG;AAUG,MAAO,WAAY,SAAQ,aAAqB,CAAA;AATtD,IAAA,WAAA,GAAA;;;QAWE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAC,QAAQ;iFAAU;AAC/B;;;;;AAKG;QACH,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,EAAE;mFAAC;;QAElB,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,GAAG;qFAAC;;QAErB,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,KAAK,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAEtD,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAAU;;AAE7B,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK;gGAAU;;QAG1B,IAAA,CAAA,WAAW,GAAG,MAAM,EAAU;;QAE9B,IAAA,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