@4sh/ui-kit 0.14.0 → 0.15.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.mjs +2 -2
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +2 -2
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +2 -2
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-base-ui-image.mjs +4 -4
- 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-checkbox.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +2 -2
- 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 +4 -4
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-date.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.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-otp.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-input-otp.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-knob.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +2 -2
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +2 -2
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +2 -2
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +2 -2
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +2 -2
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +4 -4
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +2 -2
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +2 -2
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +4 -4
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +4 -4
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +6 -6
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +2 -2
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs +2 -2
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
- package/mcp/data/text-search-docs.json +16 -6
- package/mcp/data/ui-config.json +317 -23
- package/mcp/package.json +1 -1
- package/package.json +1 -1
- package/styles/base/_motion.scss +16 -16
- package/styles/component-vars.scss +2 -5
- package/styles/generated/_tokens-motion.scss +54 -0
- package/styles/generated/_tokens-transitions.scss +4 -4
- package/styles/generated/_tokens.scss +1 -0
- package/styles/settings/_ui-config.scss +23 -6
- package/styles/utils/_mixins.scss +28 -5
- package/styles/utils/_motion.scss +3 -3
- package/styles.css +1 -1
|
@@ -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 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;;QA1CA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAY,SAAS;iFAAC;;AAElC,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK;6FAAU;;QAEvB,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAExD,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK;+FAAU;AACzB;;;AAGG;QACH,IAAA,CAAA,KAAK,GAAG,KAAK,CAAa,SAAS;kFAAC;;QAEpC,IAAA,CAAA,eAAe,GAAG,KAAK,CAAC,KAAK,uFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAE/D,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAAU;;QAE7B,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,KAAK,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAGrC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;AAE/B,QAAA,IAAA,CAAA,GAAG,GAAG,SAAS,CAAC,QAAQ,CAA0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AAY,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;AAG9C,QAAA,IAAA,CAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACzC,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,SAAS;AAC3D,YAAA,OAAO,IAAI,KAAK,SAAS,GAAG,sBAAsB,GAAG,CAAA,sBAAA,EAAyB,IAAI,EAAE;QACtF,CAAC;oFAAC;AACH,IAAA;8GAZY,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAjB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,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;;"}
|
|
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;;QA1CA,IAAA,CAAA,IAAI,GAAG,KAAK,CAAY,SAAS;iFAAC;;AAElC,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK;6FAAU;;QAEvB,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAExD,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK;+FAAU;AACzB;;;AAGG;QACH,IAAA,CAAA,KAAK,GAAG,KAAK,CAAa,SAAS;kFAAC;;QAEpC,IAAA,CAAA,eAAe,GAAG,KAAK,CAAC,KAAK,uFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAE/D,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAAU;;QAE7B,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,KAAK,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAGrC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;;AAE/B,QAAA,IAAA,CAAA,GAAG,GAAG,SAAS,CAAC,QAAQ,CAA0B,KAAK;gFAAC;;AAGtD,QAAA,IAAA,CAAA,GAAG,GAAG,CAAA,eAAA,EAAkB,OAAO,EA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G,QAAQ,CAAC,MAAK;AACzC,YAAA,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,IAAI,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,SAAS;AAC3D,YAAA,OAAO,IAAI,KAAK,SAAS,GAAG,sBAAsB,GAAG,CAAA,sBAAA,EAAyB,IAAI,EAAE;QACtF,CAAC;oFAAC;AACH,IAAA;8GAZY,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAjB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,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;;"}
|
|
@@ -226,13 +226,13 @@ class UiInputNumber extends BaseFormField {
|
|
|
226
226
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputNumber, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
227
227
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiInputNumber, isStandalone: true, selector: "ui-input-number", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", 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 }, allowDecimals: { classPropertyName: "allowDecimals", publicName: "allowDecimals", isSignal: true, isRequired: false, transformFunction: null }, unit: { classPropertyName: "unit", publicName: "unit", isSignal: true, isRequired: false, transformFunction: null }, showButtons: { classPropertyName: "showButtons", publicName: "showButtons", isSignal: true, isRequired: false, transformFunction: null }, incrementAriaLabel: { classPropertyName: "incrementAriaLabel", publicName: "incrementAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, decrementAriaLabel: { classPropertyName: "decrementAriaLabel", publicName: "decrementAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, currency: { classPropertyName: "currency", publicName: "currency", isSignal: true, isRequired: false, transformFunction: null }, useGrouping: { classPropertyName: "useGrouping", publicName: "useGrouping", isSignal: true, isRequired: false, transformFunction: null }, minFractionDigits: { classPropertyName: "minFractionDigits", publicName: "minFractionDigits", isSignal: true, isRequired: false, transformFunction: null }, maxFractionDigits: { classPropertyName: "maxFractionDigits", publicName: "maxFractionDigits", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", inputFocus: "inputFocus", inputBlur: "inputBlur" }, providers: [
|
|
228
228
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputNumber), multi: true },
|
|
229
|
-
], 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 [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n <input\n #inputEl\n class=\"ui-input-number-native\"\n [class._small]=\"size() === 'small'\"\n type=\"text\"\n inputmode=\"decimal\"\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 role=\"spinbutton\"\n [attr.aria-valuenow]=\"modelValue() ?? null\"\n [attr.aria-valuemin]=\"ariaValueMin()\"\n [attr.aria-valuemax]=\"ariaValueMax()\"\n (input)=\"onInput()\"\n (keydown)=\"onKeydown($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (displayUnit(); as u) {\n <span\n uiFieldSuffix\n class=\"ui-input-number-unit\"\n [class._small]=\"unitSmall()\"\n [class._disabled]=\"isDisabled()\"\n >{{ u }}</span\n >\n }\n\n @if (showButtons()) {\n <span uiFieldSuffix class=\"ui-input-number-spinner\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"incrementAriaLabel()\"\n [disabled]=\"isDisabled() || readonly() || atMax()\"\n (click)=\"stepBy(1)\"\n >\n <ui-icon name=\"angle-up\" size=\"sm\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"decrementAriaLabel()\"\n [disabled]=\"isDisabled() || readonly() || atMin()\"\n (click)=\"stepBy(-1)\"\n >\n <ui-icon name=\"angle-down\" size=\"sm\" />\n </button>\n </span>\n }\n</ui-field>\n", styles: [".ui-input-number-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-number-native:first-child{padding-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-native:last-child{padding-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-number-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-number-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-number-native._small{font-size:var(--ui-input-number-font-size-small, var(--size-typography-text-md))}.ui-input-number-unit{flex-shrink:0;color:var(--ui-form-field-affix-color, var(--form-low-content-default))}.ui-input-number-unit:first-child{margin-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-unit:last-child{margin-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-unit._disabled{color:var(--ui-form-field-affix-color-disabled, var(--form-high-content-disabled))}.ui-input-number-unit{font-family:var(--ui-input-number-font-family, var(--fontfamily-base));font-size:var(--ui-input-number-unit-font-size, var(--size-typography-text-default));white-space:nowrap;-webkit-user-select:none;user-select:none}.ui-input-number-unit._small{font-size:var(--ui-input-number-font-size-small, var(--size-typography-text-md))}.ui-input-number-spinner{display:flex;flex-direction:column;align-self:stretch;flex-shrink:0;width:var(--ui-input-number-spinner-width, 1.875rem);border-left:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-form-field-spinner-stroke, var(--form-high-stroke-default))}.ui-input-number-spinner button{display:flex;flex:1 1 50%;align-items:center;justify-content:center;min-height:0;padding:0;border:none;background:none;line-height:0;color:var(--ui-form-field-spinner-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-number-spinner button:hover:not(:disabled){color:var(--ui-form-field-spinner-color-hover, var(--form-high-content-hover));background-color:var(--ui-form-field-spinner-surface-hover, var(--form-high-surface-hover))}.ui-input-number-spinner button:disabled{cursor:not-allowed;color:var(--ui-form-field-spinner-color-disabled, var(--form-high-content-disabled))}.ui-input-number-spinner button+button{border-top:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-form-field-spinner-stroke, var(--form-high-stroke-default))}\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"] }] }); }
|
|
229
|
+
], 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 [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n <input\n #inputEl\n class=\"ui-input-number-native\"\n [class._small]=\"size() === 'small'\"\n type=\"text\"\n inputmode=\"decimal\"\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 role=\"spinbutton\"\n [attr.aria-valuenow]=\"modelValue() ?? null\"\n [attr.aria-valuemin]=\"ariaValueMin()\"\n [attr.aria-valuemax]=\"ariaValueMax()\"\n (input)=\"onInput()\"\n (keydown)=\"onKeydown($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (displayUnit(); as u) {\n <span\n uiFieldSuffix\n class=\"ui-input-number-unit\"\n [class._small]=\"unitSmall()\"\n [class._disabled]=\"isDisabled()\"\n >{{ u }}</span\n >\n }\n\n @if (showButtons()) {\n <span uiFieldSuffix class=\"ui-input-number-spinner\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"incrementAriaLabel()\"\n [disabled]=\"isDisabled() || readonly() || atMax()\"\n (click)=\"stepBy(1)\"\n >\n <ui-icon name=\"angle-up\" size=\"sm\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"decrementAriaLabel()\"\n [disabled]=\"isDisabled() || readonly() || atMin()\"\n (click)=\"stepBy(-1)\"\n >\n <ui-icon name=\"angle-down\" size=\"sm\" />\n </button>\n </span>\n }\n</ui-field>\n", styles: [".ui-input-number-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-number-native:first-child{padding-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-native:last-child{padding-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-number-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-number-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-number-native._small{font-size:var(--ui-input-number-font-size-small, var(--size-typography-text-md))}.ui-input-number-unit{flex-shrink:0;color:var(--ui-form-field-affix-color, var(--form-low-content-default))}.ui-input-number-unit:first-child{margin-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-unit:last-child{margin-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-unit._disabled{color:var(--ui-form-field-affix-color-disabled, var(--form-high-content-disabled))}.ui-input-number-unit{font-family:var(--ui-input-number-font-family, var(--fontfamily-base));font-size:var(--ui-input-number-unit-font-size, var(--size-typography-text-default));white-space:nowrap;-webkit-user-select:none;user-select:none}.ui-input-number-unit._small{font-size:var(--ui-input-number-font-size-small, var(--size-typography-text-md))}.ui-input-number-spinner{display:flex;flex-direction:column;align-self:stretch;flex-shrink:0;width:var(--ui-input-number-spinner-width, 1.875rem);border-left:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-form-field-spinner-stroke, var(--form-high-stroke-default))}.ui-input-number-spinner button{display:flex;flex:1 1 50%;align-items:center;justify-content:center;min-height:0;padding:0;border:none;background:none;line-height:0;color:var(--ui-form-field-spinner-color, var(--form-low-content-default));cursor:pointer;transition:color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-input-number-spinner button:hover:not(:disabled){color:var(--ui-form-field-spinner-color-hover, var(--form-high-content-hover));background-color:var(--ui-form-field-spinner-surface-hover, var(--form-high-surface-hover))}.ui-input-number-spinner button:disabled{cursor:not-allowed;color:var(--ui-form-field-spinner-color-disabled, var(--form-high-content-disabled))}.ui-input-number-spinner button+button{border-top:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-form-field-spinner-stroke, var(--form-high-stroke-default))}\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"] }] }); }
|
|
230
230
|
}
|
|
231
231
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputNumber, decorators: [{
|
|
232
232
|
type: Component,
|
|
233
233
|
args: [{ selector: 'ui-input-number', imports: [UiField, UiIcon], providers: [
|
|
234
234
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputNumber), multi: true },
|
|
235
|
-
], 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 [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n <input\n #inputEl\n class=\"ui-input-number-native\"\n [class._small]=\"size() === 'small'\"\n type=\"text\"\n inputmode=\"decimal\"\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 role=\"spinbutton\"\n [attr.aria-valuenow]=\"modelValue() ?? null\"\n [attr.aria-valuemin]=\"ariaValueMin()\"\n [attr.aria-valuemax]=\"ariaValueMax()\"\n (input)=\"onInput()\"\n (keydown)=\"onKeydown($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (displayUnit(); as u) {\n <span\n uiFieldSuffix\n class=\"ui-input-number-unit\"\n [class._small]=\"unitSmall()\"\n [class._disabled]=\"isDisabled()\"\n >{{ u }}</span\n >\n }\n\n @if (showButtons()) {\n <span uiFieldSuffix class=\"ui-input-number-spinner\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"incrementAriaLabel()\"\n [disabled]=\"isDisabled() || readonly() || atMax()\"\n (click)=\"stepBy(1)\"\n >\n <ui-icon name=\"angle-up\" size=\"sm\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"decrementAriaLabel()\"\n [disabled]=\"isDisabled() || readonly() || atMin()\"\n (click)=\"stepBy(-1)\"\n >\n <ui-icon name=\"angle-down\" size=\"sm\" />\n </button>\n </span>\n }\n</ui-field>\n", styles: [".ui-input-number-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-number-native:first-child{padding-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-native:last-child{padding-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-number-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-number-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-number-native._small{font-size:var(--ui-input-number-font-size-small, var(--size-typography-text-md))}.ui-input-number-unit{flex-shrink:0;color:var(--ui-form-field-affix-color, var(--form-low-content-default))}.ui-input-number-unit:first-child{margin-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-unit:last-child{margin-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-unit._disabled{color:var(--ui-form-field-affix-color-disabled, var(--form-high-content-disabled))}.ui-input-number-unit{font-family:var(--ui-input-number-font-family, var(--fontfamily-base));font-size:var(--ui-input-number-unit-font-size, var(--size-typography-text-default));white-space:nowrap;-webkit-user-select:none;user-select:none}.ui-input-number-unit._small{font-size:var(--ui-input-number-font-size-small, var(--size-typography-text-md))}.ui-input-number-spinner{display:flex;flex-direction:column;align-self:stretch;flex-shrink:0;width:var(--ui-input-number-spinner-width, 1.875rem);border-left:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-form-field-spinner-stroke, var(--form-high-stroke-default))}.ui-input-number-spinner button{display:flex;flex:1 1 50%;align-items:center;justify-content:center;min-height:0;padding:0;border:none;background:none;line-height:0;color:var(--ui-form-field-spinner-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-number-spinner button:hover:not(:disabled){color:var(--ui-form-field-spinner-color-hover, var(--form-high-content-hover));background-color:var(--ui-form-field-spinner-surface-hover, var(--form-high-surface-hover))}.ui-input-number-spinner button:disabled{cursor:not-allowed;color:var(--ui-form-field-spinner-color-disabled, var(--form-high-content-disabled))}.ui-input-number-spinner button+button{border-top:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-form-field-spinner-stroke, var(--form-high-stroke-default))}\n"] }]
|
|
235
|
+
], 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 [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n <input\n #inputEl\n class=\"ui-input-number-native\"\n [class._small]=\"size() === 'small'\"\n type=\"text\"\n inputmode=\"decimal\"\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 role=\"spinbutton\"\n [attr.aria-valuenow]=\"modelValue() ?? null\"\n [attr.aria-valuemin]=\"ariaValueMin()\"\n [attr.aria-valuemax]=\"ariaValueMax()\"\n (input)=\"onInput()\"\n (keydown)=\"onKeydown($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (displayUnit(); as u) {\n <span\n uiFieldSuffix\n class=\"ui-input-number-unit\"\n [class._small]=\"unitSmall()\"\n [class._disabled]=\"isDisabled()\"\n >{{ u }}</span\n >\n }\n\n @if (showButtons()) {\n <span uiFieldSuffix class=\"ui-input-number-spinner\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"incrementAriaLabel()\"\n [disabled]=\"isDisabled() || readonly() || atMax()\"\n (click)=\"stepBy(1)\"\n >\n <ui-icon name=\"angle-up\" size=\"sm\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"decrementAriaLabel()\"\n [disabled]=\"isDisabled() || readonly() || atMin()\"\n (click)=\"stepBy(-1)\"\n >\n <ui-icon name=\"angle-down\" size=\"sm\" />\n </button>\n </span>\n }\n</ui-field>\n", styles: [".ui-input-number-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-number-native:first-child{padding-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-native:last-child{padding-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-native{padding-block-start:calc(0px + var(--_field-inset-block-start, 0px))}.ui-input-number-native::placeholder{color:var(--ui-form-field-placeholder-color, var(--form-low-content-default));opacity:1}.ui-input-number-native:disabled{cursor:not-allowed;color:var(--ui-form-field-color-disabled, var(--form-high-content-disabled))}.ui-input-number-native._small{font-size:var(--ui-input-number-font-size-small, var(--size-typography-text-md))}.ui-input-number-unit{flex-shrink:0;color:var(--ui-form-field-affix-color, var(--form-low-content-default))}.ui-input-number-unit:first-child{margin-inline-start:var(--_field-inset-inline-start, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-unit:last-child{margin-inline-end:var(--_field-inset-inline-end, var(--ui-form-field-padding-x, var(--units-md)))}.ui-input-number-unit._disabled{color:var(--ui-form-field-affix-color-disabled, var(--form-high-content-disabled))}.ui-input-number-unit{font-family:var(--ui-input-number-font-family, var(--fontfamily-base));font-size:var(--ui-input-number-unit-font-size, var(--size-typography-text-default));white-space:nowrap;-webkit-user-select:none;user-select:none}.ui-input-number-unit._small{font-size:var(--ui-input-number-font-size-small, var(--size-typography-text-md))}.ui-input-number-spinner{display:flex;flex-direction:column;align-self:stretch;flex-shrink:0;width:var(--ui-input-number-spinner-width, 1.875rem);border-left:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-form-field-spinner-stroke, var(--form-high-stroke-default))}.ui-input-number-spinner button{display:flex;flex:1 1 50%;align-items:center;justify-content:center;min-height:0;padding:0;border:none;background:none;line-height:0;color:var(--ui-form-field-spinner-color, var(--form-low-content-default));cursor:pointer;transition:color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-input-number-spinner button:hover:not(:disabled){color:var(--ui-form-field-spinner-color-hover, var(--form-high-content-hover));background-color:var(--ui-form-field-spinner-surface-hover, var(--form-high-surface-hover))}.ui-input-number-spinner button:disabled{cursor:not-allowed;color:var(--ui-form-field-spinner-color-disabled, var(--form-high-content-disabled))}.ui-input-number-spinner button+button{border-top:var(--ui-control-stroke-width, var(--stroke-default)) solid var(--ui-form-field-spinner-stroke, var(--form-high-stroke-default))}\n"] }]
|
|
236
236
|
}], propDecorators: { placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", 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 }] }], allowDecimals: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowDecimals", required: false }] }], unit: [{ type: i0.Input, args: [{ isSignal: true, alias: "unit", required: false }] }], showButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "showButtons", required: false }] }], incrementAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "incrementAriaLabel", required: false }] }], decrementAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "decrementAriaLabel", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], currency: [{ type: i0.Input, args: [{ isSignal: true, alias: "currency", required: false }] }], useGrouping: [{ type: i0.Input, args: [{ isSignal: true, alias: "useGrouping", required: false }] }], minFractionDigits: [{ type: i0.Input, args: [{ isSignal: true, alias: "minFractionDigits", required: false }] }], maxFractionDigits: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxFractionDigits", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], inputFocus: [{ type: i0.Output, args: ["inputFocus"] }], inputBlur: [{ type: i0.Output, args: ["inputBlur"] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }] } });
|
|
237
237
|
|
|
238
238
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4sh-ui-kit-forms-ui-input-number.mjs","sources":["../../../projects/ui-kit/forms/ui-input-number/src/lib/ui-input-number.ts","../../../projects/ui-kit/forms/ui-input-number/src/lib/ui-input-number.html","../../../projects/ui-kit/forms/ui-input-number/src/public-api.ts","../../../projects/ui-kit/forms/ui-input-number/src/4sh-ui-kit-forms-ui-input-number.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n ElementRef,\n forwardRef,\n input,\n numberAttribute,\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 } from '@4sh/ui-kit/base/ui-icon';\n\n/**\n * ui-input-number — headless numeric field (`ui-field` shell).\n *\n * Model value = `number | null`. Lenient input: the text is **not** reformatted\n * while typing (no caret jump) — the field shows an editable form on focus, and\n * the **rich format** (thousands grouping, currency, decimals via\n * `Intl.NumberFormat`) is applied **on blur**. `min`/`max`/`step`, ± spinner,\n * ↑/↓ arrow keys, clamp on blur.\n *\n * Formatting is driven by `locale`/`currency`/`useGrouping`/`*FractionDigits`;\n * for a very specific case, override the protected `format()` method.\n */\n@Component({\n selector: 'ui-input-number',\n imports: [UiField, UiIcon],\n templateUrl: './ui-input-number.html',\n styleUrl: './ui-input-number.scss',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputNumber), multi: true },\n ],\n})\nexport class UiInputNumber extends BaseFormField<number | null> {\n /** Native placeholder. */\n placeholder = input<string>();\n /** Minimum value (clamp on blur + disables \"−\" at the bound). */\n min = input<number, unknown>(undefined, { transform: numberAttribute });\n /** Maximum value (clamp on blur + disables \"+\" at the bound). */\n max = input<number, unknown>(undefined, { transform: numberAttribute });\n /** Increment step (spinner + arrow keys). */\n step = input<number, unknown>(1, { transform: numberAttribute });\n /** Allow decimals. */\n allowDecimals = input(true, { transform: booleanAttribute });\n /** Suffix unit (e.g. \"kg\"). Ignored when `currency` is set. */\n unit = input<string>();\n /** Show the ± spinner. */\n showButtons = input(true, { transform: booleanAttribute });\n /** Accessible label of the increment spinner button. */\n incrementAriaLabel = input<string>('Augmenter');\n /** Accessible label of the decrement spinner button. */\n decrementAriaLabel = input<string>('Diminuer');\n\n // --- Formatting (Intl.NumberFormat) --------------------------------\n /** BCP-47 locale (e.g. `fr-FR`). Defaults to the browser locale. */\n locale = input<string>();\n /** ISO currency code (e.g. `EUR`) → currency formatting on blur. */\n currency = input<string>();\n /** Thousands separators on blur. */\n useGrouping = input(true, { transform: booleanAttribute });\n /** Minimum fraction digits shown on blur. */\n minFractionDigits = input<number, unknown>(undefined, { transform: numberAttribute });\n /** Maximum fraction digits shown on blur. */\n maxFractionDigits = input<number, unknown>(undefined, { transform: numberAttribute });\n\n /** Emitted on each numeric value change. */\n valueChange = output<number | null>();\n /** Emitted when the input receives focus. */\n inputFocus = output<FocusEvent>();\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 Raw displayed text (independent from the model while typing). */\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 Suffix unit, ignored when `currency` is set (the formatted value already carries it). */\n protected readonly displayUnit = computed(() => (this.currency() ? null : (this.unit() ?? null)));\n\n /** @ignore */\n protected readonly unitSmall = computed(() => this.size() === 'small');\n /** @ignore Bounds reached (disable the spinner buttons). */\n protected readonly atMax = computed(() => {\n const v = this.modelValue();\n const max = this.max();\n return v != null && max != null && v >= max;\n });\n protected readonly atMin = computed(() => {\n const v = this.modelValue();\n const min = this.min();\n return v != null && min != null && v <= min;\n });\n /** @ignore `numberAttribute(undefined)` yields NaN, and `aria-valuemin=\"NaN\"` is an invalid\n * ARIA value — omit the attribute entirely rather than advertise a bound that does not exist. */\n protected readonly ariaValueMin = computed(() => (Number.isFinite(this.min()) ? this.min() : null));\n /** @ignore Same as `ariaValueMin`, for the upper bound. */\n protected readonly ariaValueMax = computed(() => (Number.isFinite(this.max()) ? this.max() : null));\n\n /** @ignore Group/decimal separators of the current locale. */\n private readonly separators = computed(() => {\n const parts = new Intl.NumberFormat(this.locale()).formatToParts(11111.1);\n return {\n group: parts.find((p) => p.type === 'group')?.value ?? '',\n decimal: parts.find((p) => p.type === 'decimal')?.value ?? '.',\n };\n });\n\n override writeValue(value: number | null): void {\n this.modelValue.set(value ?? undefined);\n this.text.set(value === null || value === undefined ? '' : this.format(value));\n }\n\n /** Focuses the input. */\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** @ignore Focus: switch to an editable form (no grouping/currency). */\n protected onFocus(event: FocusEvent): void {\n const v = this.modelValue();\n if (v != null) this.text.set(this.editable(v));\n this.inputFocus.emit(event);\n }\n\n /** @ignore Input: parse without reformatting the text (caret preserved). */\n protected onInput(): void {\n const raw = this.inputEl().nativeElement.value;\n this.text.set(raw);\n this.commit(this.parse(raw), { reformat: false });\n }\n\n /** @ignore Blur: clamp + rich reformatting. */\n protected onBlur(event: FocusEvent): void {\n this.commit(this.clamp(this.modelValue() ?? null), { reformat: true });\n this.emitTouch();\n this.inputBlur.emit(event);\n }\n\n /** @ignore ↑/↓ arrow keys. */\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n this.stepBy(1);\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n this.stepBy(-1);\n }\n }\n\n /** @ignore ± spinner. */\n protected stepBy(direction: 1 | -1): void {\n if (this.isDisabled() || this.readonly()) return;\n const base = this.modelValue() ?? 0;\n const next = this.clamp(base + direction * this.step());\n this.commit(next, { reformat: !this.isFocused() });\n if (this.isFocused()) this.text.set(next === null ? '' : this.editable(next));\n this.inputEl().nativeElement.focus();\n }\n\n /** @ignore Does the input currently have focus? */\n private isFocused(): boolean {\n return (\n typeof document !== 'undefined' && document.activeElement === this.inputEl().nativeElement\n );\n }\n\n /** @ignore Update model + emit; reformat the text when requested. */\n private commit(value: number | null, opts: { reformat: boolean }): void {\n this.modelValue.set(value ?? undefined);\n if (opts.reformat) this.text.set(value === null ? '' : this.format(value));\n this.emitChange(value);\n this.valueChange.emit(value);\n }\n\n /** @ignore Parse a lenient (locale-aware) input → number or null. */\n private parse(raw: string): number | null {\n const { group, decimal } = this.separators();\n let s = raw.trim();\n if (group) s = s.split(group).join('');\n s = s\n .replace(/\\s/g, '') // spaces (incl. U+202F/U+00A0 grouping separators)\n .replace(decimal, '.')\n .replace(/[^0-9.-]/g, ''); // strip currency/symbols\n if (s === '' || s === '-' || s === '.' || s === '-.') return null;\n const n = Number(s);\n if (Number.isNaN(n)) return null;\n return this.allowDecimals() ? n : Math.trunc(n);\n }\n\n /** @ignore Clamp the value into [min, max]. */\n private clamp(value: number | null): number | null {\n if (value === null) return null;\n const min = this.min();\n const max = this.max();\n let v = value;\n if (min != null && v < min) v = min;\n if (max != null && v > max) v = max;\n return v;\n }\n\n /** @ignore Editable form on focus: locale decimals, no grouping or currency. */\n private editable(value: number): string {\n return new Intl.NumberFormat(this.locale(), {\n useGrouping: false,\n maximumFractionDigits: 20,\n }).format(value);\n }\n\n /**\n * Display formatting on blur (overridable). Defaults to `Intl.NumberFormat`\n * with `locale`/`currency`/`useGrouping`/`*FractionDigits`.\n */\n protected format(value: number): string {\n const options: Intl.NumberFormatOptions = { useGrouping: this.useGrouping() };\n if (this.currency()) {\n options.style = 'currency';\n options.currency = this.currency();\n }\n if (this.minFractionDigits() != null) options.minimumFractionDigits = this.minFractionDigits();\n if (this.maxFractionDigits() != null) options.maximumFractionDigits = this.maxFractionDigits();\n return new Intl.NumberFormat(this.locale(), options).format(value);\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 [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n <input\n #inputEl\n class=\"ui-input-number-native\"\n [class._small]=\"size() === 'small'\"\n type=\"text\"\n inputmode=\"decimal\"\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 role=\"spinbutton\"\n [attr.aria-valuenow]=\"modelValue() ?? null\"\n [attr.aria-valuemin]=\"ariaValueMin()\"\n [attr.aria-valuemax]=\"ariaValueMax()\"\n (input)=\"onInput()\"\n (keydown)=\"onKeydown($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (displayUnit(); as u) {\n <span\n uiFieldSuffix\n class=\"ui-input-number-unit\"\n [class._small]=\"unitSmall()\"\n [class._disabled]=\"isDisabled()\"\n >{{ u }}</span\n >\n }\n\n @if (showButtons()) {\n <span uiFieldSuffix class=\"ui-input-number-spinner\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"incrementAriaLabel()\"\n [disabled]=\"isDisabled() || readonly() || atMax()\"\n (click)=\"stepBy(1)\"\n >\n <ui-icon name=\"angle-up\" size=\"sm\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"decrementAriaLabel()\"\n [disabled]=\"isDisabled() || readonly() || atMin()\"\n (click)=\"stepBy(-1)\"\n >\n <ui-icon name=\"angle-down\" size=\"sm\" />\n </button>\n </span>\n }\n</ui-field>\n","/*\n * Public API Surface of ui-kit/ui-input-number\n */\n\nexport * from './lib/ui-input-number';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAiBA;;;;;;;;;;;AAWG;AAUG,MAAO,aAAc,SAAQ,aAA4B,CAAA;AAT/D,IAAA,WAAA,GAAA;;;AAWE,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAAU;;QAE7B,IAAA,CAAA,GAAG,GAAG,KAAK,CAAkB,SAAS,2EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;QAEvE,IAAA,CAAA,GAAG,GAAG,KAAK,CAAkB,SAAS,2EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;QAEvE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAkB,CAAC,4EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;QAEhE,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,IAAI,qFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAE5D,QAAA,IAAA,CAAA,IAAI,GAAG,KAA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AM,CAAC,EAAA,SAAA,EAGf;AACT,wBAAA,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,mBAAmB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;AAC1F,qBAAA,EAAA,QAAA,EAAA,+vEAAA,EAAA,MAAA,EAAA,CAAA,kuGAAA,CAAA,EAAA;gnDA0C2E,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE9EvF;;AAEG;;ACFH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"4sh-ui-kit-forms-ui-input-number.mjs","sources":["../../../projects/ui-kit/forms/ui-input-number/src/lib/ui-input-number.ts","../../../projects/ui-kit/forms/ui-input-number/src/lib/ui-input-number.html","../../../projects/ui-kit/forms/ui-input-number/src/public-api.ts","../../../projects/ui-kit/forms/ui-input-number/src/4sh-ui-kit-forms-ui-input-number.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n ElementRef,\n forwardRef,\n input,\n numberAttribute,\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 } from '@4sh/ui-kit/base/ui-icon';\n\n/**\n * ui-input-number — headless numeric field (`ui-field` shell).\n *\n * Model value = `number | null`. Lenient input: the text is **not** reformatted\n * while typing (no caret jump) — the field shows an editable form on focus, and\n * the **rich format** (thousands grouping, currency, decimals via\n * `Intl.NumberFormat`) is applied **on blur**. `min`/`max`/`step`, ± spinner,\n * ↑/↓ arrow keys, clamp on blur.\n *\n * Formatting is driven by `locale`/`currency`/`useGrouping`/`*FractionDigits`;\n * for a very specific case, override the protected `format()` method.\n */\n@Component({\n selector: 'ui-input-number',\n imports: [UiField, UiIcon],\n templateUrl: './ui-input-number.html',\n styleUrl: './ui-input-number.scss',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputNumber), multi: true },\n ],\n})\nexport class UiInputNumber extends BaseFormField<number | null> {\n /** Native placeholder. */\n placeholder = input<string>();\n /** Minimum value (clamp on blur + disables \"−\" at the bound). */\n min = input<number, unknown>(undefined, { transform: numberAttribute });\n /** Maximum value (clamp on blur + disables \"+\" at the bound). */\n max = input<number, unknown>(undefined, { transform: numberAttribute });\n /** Increment step (spinner + arrow keys). */\n step = input<number, unknown>(1, { transform: numberAttribute });\n /** Allow decimals. */\n allowDecimals = input(true, { transform: booleanAttribute });\n /** Suffix unit (e.g. \"kg\"). Ignored when `currency` is set. */\n unit = input<string>();\n /** Show the ± spinner. */\n showButtons = input(true, { transform: booleanAttribute });\n /** Accessible label of the increment spinner button. */\n incrementAriaLabel = input<string>('Augmenter');\n /** Accessible label of the decrement spinner button. */\n decrementAriaLabel = input<string>('Diminuer');\n\n // --- Formatting (Intl.NumberFormat) --------------------------------\n /** BCP-47 locale (e.g. `fr-FR`). Defaults to the browser locale. */\n locale = input<string>();\n /** ISO currency code (e.g. `EUR`) → currency formatting on blur. */\n currency = input<string>();\n /** Thousands separators on blur. */\n useGrouping = input(true, { transform: booleanAttribute });\n /** Minimum fraction digits shown on blur. */\n minFractionDigits = input<number, unknown>(undefined, { transform: numberAttribute });\n /** Maximum fraction digits shown on blur. */\n maxFractionDigits = input<number, unknown>(undefined, { transform: numberAttribute });\n\n /** Emitted on each numeric value change. */\n valueChange = output<number | null>();\n /** Emitted when the input receives focus. */\n inputFocus = output<FocusEvent>();\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 Raw displayed text (independent from the model while typing). */\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 Suffix unit, ignored when `currency` is set (the formatted value already carries it). */\n protected readonly displayUnit = computed(() => (this.currency() ? null : (this.unit() ?? null)));\n\n /** @ignore */\n protected readonly unitSmall = computed(() => this.size() === 'small');\n /** @ignore Bounds reached (disable the spinner buttons). */\n protected readonly atMax = computed(() => {\n const v = this.modelValue();\n const max = this.max();\n return v != null && max != null && v >= max;\n });\n protected readonly atMin = computed(() => {\n const v = this.modelValue();\n const min = this.min();\n return v != null && min != null && v <= min;\n });\n /** @ignore `numberAttribute(undefined)` yields NaN, and `aria-valuemin=\"NaN\"` is an invalid\n * ARIA value — omit the attribute entirely rather than advertise a bound that does not exist. */\n protected readonly ariaValueMin = computed(() => (Number.isFinite(this.min()) ? this.min() : null));\n /** @ignore Same as `ariaValueMin`, for the upper bound. */\n protected readonly ariaValueMax = computed(() => (Number.isFinite(this.max()) ? this.max() : null));\n\n /** @ignore Group/decimal separators of the current locale. */\n private readonly separators = computed(() => {\n const parts = new Intl.NumberFormat(this.locale()).formatToParts(11111.1);\n return {\n group: parts.find((p) => p.type === 'group')?.value ?? '',\n decimal: parts.find((p) => p.type === 'decimal')?.value ?? '.',\n };\n });\n\n override writeValue(value: number | null): void {\n this.modelValue.set(value ?? undefined);\n this.text.set(value === null || value === undefined ? '' : this.format(value));\n }\n\n /** Focuses the input. */\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** @ignore Focus: switch to an editable form (no grouping/currency). */\n protected onFocus(event: FocusEvent): void {\n const v = this.modelValue();\n if (v != null) this.text.set(this.editable(v));\n this.inputFocus.emit(event);\n }\n\n /** @ignore Input: parse without reformatting the text (caret preserved). */\n protected onInput(): void {\n const raw = this.inputEl().nativeElement.value;\n this.text.set(raw);\n this.commit(this.parse(raw), { reformat: false });\n }\n\n /** @ignore Blur: clamp + rich reformatting. */\n protected onBlur(event: FocusEvent): void {\n this.commit(this.clamp(this.modelValue() ?? null), { reformat: true });\n this.emitTouch();\n this.inputBlur.emit(event);\n }\n\n /** @ignore ↑/↓ arrow keys. */\n protected onKeydown(event: KeyboardEvent): void {\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n this.stepBy(1);\n } else if (event.key === 'ArrowDown') {\n event.preventDefault();\n this.stepBy(-1);\n }\n }\n\n /** @ignore ± spinner. */\n protected stepBy(direction: 1 | -1): void {\n if (this.isDisabled() || this.readonly()) return;\n const base = this.modelValue() ?? 0;\n const next = this.clamp(base + direction * this.step());\n this.commit(next, { reformat: !this.isFocused() });\n if (this.isFocused()) this.text.set(next === null ? '' : this.editable(next));\n this.inputEl().nativeElement.focus();\n }\n\n /** @ignore Does the input currently have focus? */\n private isFocused(): boolean {\n return (\n typeof document !== 'undefined' && document.activeElement === this.inputEl().nativeElement\n );\n }\n\n /** @ignore Update model + emit; reformat the text when requested. */\n private commit(value: number | null, opts: { reformat: boolean }): void {\n this.modelValue.set(value ?? undefined);\n if (opts.reformat) this.text.set(value === null ? '' : this.format(value));\n this.emitChange(value);\n this.valueChange.emit(value);\n }\n\n /** @ignore Parse a lenient (locale-aware) input → number or null. */\n private parse(raw: string): number | null {\n const { group, decimal } = this.separators();\n let s = raw.trim();\n if (group) s = s.split(group).join('');\n s = s\n .replace(/\\s/g, '') // spaces (incl. U+202F/U+00A0 grouping separators)\n .replace(decimal, '.')\n .replace(/[^0-9.-]/g, ''); // strip currency/symbols\n if (s === '' || s === '-' || s === '.' || s === '-.') return null;\n const n = Number(s);\n if (Number.isNaN(n)) return null;\n return this.allowDecimals() ? n : Math.trunc(n);\n }\n\n /** @ignore Clamp the value into [min, max]. */\n private clamp(value: number | null): number | null {\n if (value === null) return null;\n const min = this.min();\n const max = this.max();\n let v = value;\n if (min != null && v < min) v = min;\n if (max != null && v > max) v = max;\n return v;\n }\n\n /** @ignore Editable form on focus: locale decimals, no grouping or currency. */\n private editable(value: number): string {\n return new Intl.NumberFormat(this.locale(), {\n useGrouping: false,\n maximumFractionDigits: 20,\n }).format(value);\n }\n\n /**\n * Display formatting on blur (overridable). Defaults to `Intl.NumberFormat`\n * with `locale`/`currency`/`useGrouping`/`*FractionDigits`.\n */\n protected format(value: number): string {\n const options: Intl.NumberFormatOptions = { useGrouping: this.useGrouping() };\n if (this.currency()) {\n options.style = 'currency';\n options.currency = this.currency();\n }\n if (this.minFractionDigits() != null) options.minimumFractionDigits = this.minFractionDigits();\n if (this.maxFractionDigits() != null) options.maximumFractionDigits = this.maxFractionDigits();\n return new Intl.NumberFormat(this.locale(), options).format(value);\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 [disabled]=\"isDisabled()\"\n [readonly]=\"readonly()\"\n [message]=\"displayMessage()\"\n [messageId]=\"messageId()\"\n [showMessageIcon]=\"showMessageIcon()\"\n [messageIcon]=\"messageIcon()\"\n>\n <input\n #inputEl\n class=\"ui-input-number-native\"\n [class._small]=\"size() === 'small'\"\n type=\"text\"\n inputmode=\"decimal\"\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 role=\"spinbutton\"\n [attr.aria-valuenow]=\"modelValue() ?? null\"\n [attr.aria-valuemin]=\"ariaValueMin()\"\n [attr.aria-valuemax]=\"ariaValueMax()\"\n (input)=\"onInput()\"\n (keydown)=\"onKeydown($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n\n @if (displayUnit(); as u) {\n <span\n uiFieldSuffix\n class=\"ui-input-number-unit\"\n [class._small]=\"unitSmall()\"\n [class._disabled]=\"isDisabled()\"\n >{{ u }}</span\n >\n }\n\n @if (showButtons()) {\n <span uiFieldSuffix class=\"ui-input-number-spinner\">\n <button\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"incrementAriaLabel()\"\n [disabled]=\"isDisabled() || readonly() || atMax()\"\n (click)=\"stepBy(1)\"\n >\n <ui-icon name=\"angle-up\" size=\"sm\" />\n </button>\n <button\n type=\"button\"\n tabindex=\"-1\"\n [attr.aria-label]=\"decrementAriaLabel()\"\n [disabled]=\"isDisabled() || readonly() || atMin()\"\n (click)=\"stepBy(-1)\"\n >\n <ui-icon name=\"angle-down\" size=\"sm\" />\n </button>\n </span>\n }\n</ui-field>\n","/*\n * Public API Surface of ui-kit/ui-input-number\n */\n\nexport * from './lib/ui-input-number';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAiBA;;;;;;;;;;;AAWG;AAUG,MAAO,aAAc,SAAQ,aAA4B,CAAA;AAT/D,IAAA,WAAA,GAAA;;;AAWE,QAAA,IAAA,CAAA,WAAW,GAAG,KAAK;mGAAU;;QAE7B,IAAA,CAAA,GAAG,GAAG,KAAK,CAAkB,SAAS,2EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;QAEvE,IAAA,CAAA,GAAG,GAAG,KAAK,CAAkB,SAAS,2EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;QAEvE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAkB,CAAC,4EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;QAEhE,IAAA,CAAA,aAAa,GAAG,KAAK,CAAC,IAAI,qFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAE5D,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK;4FAAU;;QAEtB,IAAA,CAAA,WAAW,GAAG,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AE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,mBAAmB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE;AAC1F,qBAAA,EAAA,QAAA,EAAA,+vEAAA,EAAA,MAAA,EAAA,CAAA,s1GAAA,CAAA,EAAA;gnDA0C2E,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE9EvF;;AAEG;;ACFH;;AAEG;;"}
|
|
@@ -258,7 +258,7 @@ class UiInputOtp extends BaseFieldControl {
|
|
|
258
258
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputOtp, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
259
259
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.7", type: UiInputOtp, isStandalone: true, selector: "ui-input-otp", inputs: { length: { classPropertyName: "length", publicName: "length", isSignal: true, isRequired: false, transformFunction: null }, mask: { classPropertyName: "mask", publicName: "mask", isSignal: true, isRequired: false, transformFunction: null }, integerOnly: { classPropertyName: "integerOnly", publicName: "integerOnly", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, charAriaLabel: { classPropertyName: "charAriaLabel", publicName: "charAriaLabel", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", completed: "completed" }, host: { attributes: { "role": "group" }, listeners: { "focusout": "onFocusOut($event)" }, properties: { "class._small": "size() === 'small'", "class._large": "size() === 'large'", "class._disabled": "isDisabled()", "class._readonly": "readonly()", "class._invalid": "isInvalid()", "attr.aria-label": "ariaLabel() || null", "attr.aria-labelledby": "ariaLabelledBy() || null", "attr.aria-invalid": "isInvalid() ? 'true' : null", "attr.aria-disabled": "isDisabled() ? 'true' : null" }, classAttribute: "ui-input-otp" }, providers: [
|
|
260
260
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputOtp), multi: true },
|
|
261
|
-
], queries: [{ propertyName: "inputTemplate", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@for (cell of cells(); track cell.index) {\n @if (inputTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: cell.value,\n value: cell.value,\n index: cell.index,\n events: cellEvents(cell.index),\n tabindex: tabindexFor(cell.index),\n }\"\n />\n } @else {\n <input\n class=\"ui-input-otp-cell\"\n [id]=\"cell.id\"\n [type]=\"inputType()\"\n [value]=\"cell.value\"\n maxlength=\"1\"\n autocomplete=\"one-time-code\"\n [attr.inputmode]=\"inputMode()\"\n [attr.name]=\"name() ? name() + '-' + cell.index : null\"\n [attr.tabindex]=\"tabindexFor(cell.index)\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [attr.aria-label]=\"(ariaLabel() || charAriaLabel()) + ' ' + (cell.index + 1)\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (input)=\"onInput($event, cell.index)\"\n (keydown)=\"onKeydown($event, cell.index)\"\n (focus)=\"onFocus($event, cell.index)\"\n (paste)=\"onPaste($event, cell.index)\"\n />\n }\n}\n", styles: [":host{display:inline-flex;align-items:center;gap:var(--ui-input-otp-gap, var(--units-sm));font-family:var(--ui-input-otp-font-family, var(--fontfamily-base))}:host .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size, var(--size-components-default));block-size:var(--ui-input-otp-cell-size, var(--size-components-default));font-size:var(--ui-input-otp-font-size, var(--size-typography-text-default))}:host._small .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size-small, var(--size-components-sm));block-size:var(--ui-input-otp-cell-size-small, var(--size-components-sm));font-size:var(--ui-input-otp-font-size-small, var(--size-typography-text-md))}:host._large .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size-large, var(--size-components-xl));block-size:var(--ui-input-otp-cell-size-large, var(--size-components-xl));font-size:var(--ui-input-otp-font-size-large, var(--size-typography-text-lg))}.ui-input-otp-cell{--_stroke: var(--ui-input-otp-cell-stroke, var(--form-high-stroke-default));--_stroke-hover: var(--ui-input-otp-cell-stroke-hover, var(--form-high-stroke-hover));--_stroke-focus: var(--ui-input-otp-cell-stroke-focus, var(--form-high-stroke-focused));box-sizing:border-box;min-inline-size:0;margin:0;padding:0;border:var(--ui-input-otp-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_stroke);border-radius:var(--ui-input-otp-radius, var(--ui-form-field-radius, var(--radius-sm)));background-color:var(--ui-input-otp-cell-surface, var(--form-high-surface-default));color:var(--ui-input-otp-cell-color, var(--form-high-content-default));font-family:inherit;font-weight:var(--ui-input-otp-weight, var(--weight-bold));text-align:center;caret-color:var(--ui-input-otp-cell-color, var(--form-high-content-default));transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),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-otp-cell:hover:not(:disabled):not(:focus){border-color:var(--_stroke-hover)}.ui-input-otp-cell:focus,.ui-input-otp-cell:focus-visible{outline:none;border-color:var(--_stroke-focus);box-shadow:0 0 0 var(--ui-input-otp-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--_stroke-focus) r g b/50%)}.ui-input-otp-cell:disabled{border-color:var(--ui-input-otp-cell-stroke-disabled, var(--form-high-stroke-disabled));background-color:var(--ui-input-otp-cell-surface-disabled, var(--form-high-surface-disabled));color:var(--ui-input-otp-cell-color-disabled, var(--form-high-content-disabled));cursor:not-allowed}:host._readonly .ui-input-otp-cell{cursor:default}:host._invalid .ui-input-otp-cell{--_stroke: var(--ui-input-otp-cell-stroke-invalid, var(--form-error-stroke-default));--_stroke-hover: var(--ui-input-otp-cell-stroke-hover-invalid, var(--form-error-stroke-hover));--_stroke-focus: var(--ui-input-otp-cell-stroke-focus-invalid, var(--form-error-stroke-focused))}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
261
|
+
], queries: [{ propertyName: "inputTemplate", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@for (cell of cells(); track cell.index) {\n @if (inputTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: cell.value,\n value: cell.value,\n index: cell.index,\n events: cellEvents(cell.index),\n tabindex: tabindexFor(cell.index),\n }\"\n />\n } @else {\n <input\n class=\"ui-input-otp-cell\"\n [id]=\"cell.id\"\n [type]=\"inputType()\"\n [value]=\"cell.value\"\n maxlength=\"1\"\n autocomplete=\"one-time-code\"\n [attr.inputmode]=\"inputMode()\"\n [attr.name]=\"name() ? name() + '-' + cell.index : null\"\n [attr.tabindex]=\"tabindexFor(cell.index)\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [attr.aria-label]=\"(ariaLabel() || charAriaLabel()) + ' ' + (cell.index + 1)\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (input)=\"onInput($event, cell.index)\"\n (keydown)=\"onKeydown($event, cell.index)\"\n (focus)=\"onFocus($event, cell.index)\"\n (paste)=\"onPaste($event, cell.index)\"\n />\n }\n}\n", styles: [":host{display:inline-flex;align-items:center;gap:var(--ui-input-otp-gap, var(--units-sm));font-family:var(--ui-input-otp-font-family, var(--fontfamily-base))}:host .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size, var(--size-components-default));block-size:var(--ui-input-otp-cell-size, var(--size-components-default));font-size:var(--ui-input-otp-font-size, var(--size-typography-text-default))}:host._small .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size-small, var(--size-components-sm));block-size:var(--ui-input-otp-cell-size-small, var(--size-components-sm));font-size:var(--ui-input-otp-font-size-small, var(--size-typography-text-md))}:host._large .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size-large, var(--size-components-xl));block-size:var(--ui-input-otp-cell-size-large, var(--size-components-xl));font-size:var(--ui-input-otp-font-size-large, var(--size-typography-text-lg))}.ui-input-otp-cell{--_stroke: var(--ui-input-otp-cell-stroke, var(--form-high-stroke-default));--_stroke-hover: var(--ui-input-otp-cell-stroke-hover, var(--form-high-stroke-hover));--_stroke-focus: var(--ui-input-otp-cell-stroke-focus, var(--form-high-stroke-focused));box-sizing:border-box;min-inline-size:0;margin:0;padding:0;border:var(--ui-input-otp-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_stroke);border-radius:var(--ui-input-otp-radius, var(--ui-form-field-radius, var(--radius-sm)));background-color:var(--ui-input-otp-cell-surface, var(--form-high-surface-default));color:var(--ui-input-otp-cell-color, var(--form-high-content-default));font-family:inherit;font-weight:var(--ui-input-otp-weight, var(--weight-bold));text-align:center;caret-color:var(--ui-input-otp-cell-color, var(--form-high-content-default));transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),border-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),box-shadow var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-input-otp-cell:hover:not(:disabled):not(:focus){border-color:var(--_stroke-hover)}.ui-input-otp-cell:focus,.ui-input-otp-cell:focus-visible{outline:none;border-color:var(--_stroke-focus);box-shadow:0 0 0 var(--ui-input-otp-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--_stroke-focus) r g b/50%)}.ui-input-otp-cell:disabled{border-color:var(--ui-input-otp-cell-stroke-disabled, var(--form-high-stroke-disabled));background-color:var(--ui-input-otp-cell-surface-disabled, var(--form-high-surface-disabled));color:var(--ui-input-otp-cell-color-disabled, var(--form-high-content-disabled));cursor:not-allowed}:host._readonly .ui-input-otp-cell{cursor:default}:host._invalid .ui-input-otp-cell{--_stroke: var(--ui-input-otp-cell-stroke-invalid, var(--form-error-stroke-default));--_stroke-hover: var(--ui-input-otp-cell-stroke-hover-invalid, var(--form-error-stroke-hover));--_stroke-focus: var(--ui-input-otp-cell-stroke-focus-invalid, var(--form-error-stroke-focused))}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
262
262
|
}
|
|
263
263
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: UiInputOtp, decorators: [{
|
|
264
264
|
type: Component,
|
|
@@ -277,7 +277,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
277
277
|
'[attr.aria-invalid]': "isInvalid() ? 'true' : null",
|
|
278
278
|
'[attr.aria-disabled]': "isDisabled() ? 'true' : null",
|
|
279
279
|
'(focusout)': 'onFocusOut($event)',
|
|
280
|
-
}, template: "@for (cell of cells(); track cell.index) {\n @if (inputTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: cell.value,\n value: cell.value,\n index: cell.index,\n events: cellEvents(cell.index),\n tabindex: tabindexFor(cell.index),\n }\"\n />\n } @else {\n <input\n class=\"ui-input-otp-cell\"\n [id]=\"cell.id\"\n [type]=\"inputType()\"\n [value]=\"cell.value\"\n maxlength=\"1\"\n autocomplete=\"one-time-code\"\n [attr.inputmode]=\"inputMode()\"\n [attr.name]=\"name() ? name() + '-' + cell.index : null\"\n [attr.tabindex]=\"tabindexFor(cell.index)\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [attr.aria-label]=\"(ariaLabel() || charAriaLabel()) + ' ' + (cell.index + 1)\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (input)=\"onInput($event, cell.index)\"\n (keydown)=\"onKeydown($event, cell.index)\"\n (focus)=\"onFocus($event, cell.index)\"\n (paste)=\"onPaste($event, cell.index)\"\n />\n }\n}\n", styles: [":host{display:inline-flex;align-items:center;gap:var(--ui-input-otp-gap, var(--units-sm));font-family:var(--ui-input-otp-font-family, var(--fontfamily-base))}:host .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size, var(--size-components-default));block-size:var(--ui-input-otp-cell-size, var(--size-components-default));font-size:var(--ui-input-otp-font-size, var(--size-typography-text-default))}:host._small .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size-small, var(--size-components-sm));block-size:var(--ui-input-otp-cell-size-small, var(--size-components-sm));font-size:var(--ui-input-otp-font-size-small, var(--size-typography-text-md))}:host._large .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size-large, var(--size-components-xl));block-size:var(--ui-input-otp-cell-size-large, var(--size-components-xl));font-size:var(--ui-input-otp-font-size-large, var(--size-typography-text-lg))}.ui-input-otp-cell{--_stroke: var(--ui-input-otp-cell-stroke, var(--form-high-stroke-default));--_stroke-hover: var(--ui-input-otp-cell-stroke-hover, var(--form-high-stroke-hover));--_stroke-focus: var(--ui-input-otp-cell-stroke-focus, var(--form-high-stroke-focused));box-sizing:border-box;min-inline-size:0;margin:0;padding:0;border:var(--ui-input-otp-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_stroke);border-radius:var(--ui-input-otp-radius, var(--ui-form-field-radius, var(--radius-sm)));background-color:var(--ui-input-otp-cell-surface, var(--form-high-surface-default));color:var(--ui-input-otp-cell-color, var(--form-high-content-default));font-family:inherit;font-weight:var(--ui-input-otp-weight, var(--weight-bold));text-align:center;caret-color:var(--ui-input-otp-cell-color, var(--form-high-content-default));transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),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-otp-cell:hover:not(:disabled):not(:focus){border-color:var(--_stroke-hover)}.ui-input-otp-cell:focus,.ui-input-otp-cell:focus-visible{outline:none;border-color:var(--_stroke-focus);box-shadow:0 0 0 var(--ui-input-otp-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--_stroke-focus) r g b/50%)}.ui-input-otp-cell:disabled{border-color:var(--ui-input-otp-cell-stroke-disabled, var(--form-high-stroke-disabled));background-color:var(--ui-input-otp-cell-surface-disabled, var(--form-high-surface-disabled));color:var(--ui-input-otp-cell-color-disabled, var(--form-high-content-disabled));cursor:not-allowed}:host._readonly .ui-input-otp-cell{cursor:default}:host._invalid .ui-input-otp-cell{--_stroke: var(--ui-input-otp-cell-stroke-invalid, var(--form-error-stroke-default));--_stroke-hover: var(--ui-input-otp-cell-stroke-hover-invalid, var(--form-error-stroke-hover));--_stroke-focus: var(--ui-input-otp-cell-stroke-focus-invalid, var(--form-error-stroke-focused))}\n"] }]
|
|
280
|
+
}, template: "@for (cell of cells(); track cell.index) {\n @if (inputTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: cell.value,\n value: cell.value,\n index: cell.index,\n events: cellEvents(cell.index),\n tabindex: tabindexFor(cell.index),\n }\"\n />\n } @else {\n <input\n class=\"ui-input-otp-cell\"\n [id]=\"cell.id\"\n [type]=\"inputType()\"\n [value]=\"cell.value\"\n maxlength=\"1\"\n autocomplete=\"one-time-code\"\n [attr.inputmode]=\"inputMode()\"\n [attr.name]=\"name() ? name() + '-' + cell.index : null\"\n [attr.tabindex]=\"tabindexFor(cell.index)\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [attr.aria-label]=\"(ariaLabel() || charAriaLabel()) + ' ' + (cell.index + 1)\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (input)=\"onInput($event, cell.index)\"\n (keydown)=\"onKeydown($event, cell.index)\"\n (focus)=\"onFocus($event, cell.index)\"\n (paste)=\"onPaste($event, cell.index)\"\n />\n }\n}\n", styles: [":host{display:inline-flex;align-items:center;gap:var(--ui-input-otp-gap, var(--units-sm));font-family:var(--ui-input-otp-font-family, var(--fontfamily-base))}:host .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size, var(--size-components-default));block-size:var(--ui-input-otp-cell-size, var(--size-components-default));font-size:var(--ui-input-otp-font-size, var(--size-typography-text-default))}:host._small .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size-small, var(--size-components-sm));block-size:var(--ui-input-otp-cell-size-small, var(--size-components-sm));font-size:var(--ui-input-otp-font-size-small, var(--size-typography-text-md))}:host._large .ui-input-otp-cell{inline-size:var(--ui-input-otp-cell-size-large, var(--size-components-xl));block-size:var(--ui-input-otp-cell-size-large, var(--size-components-xl));font-size:var(--ui-input-otp-font-size-large, var(--size-typography-text-lg))}.ui-input-otp-cell{--_stroke: var(--ui-input-otp-cell-stroke, var(--form-high-stroke-default));--_stroke-hover: var(--ui-input-otp-cell-stroke-hover, var(--form-high-stroke-hover));--_stroke-focus: var(--ui-input-otp-cell-stroke-focus, var(--form-high-stroke-focused));box-sizing:border-box;min-inline-size:0;margin:0;padding:0;border:var(--ui-input-otp-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_stroke);border-radius:var(--ui-input-otp-radius, var(--ui-form-field-radius, var(--radius-sm)));background-color:var(--ui-input-otp-cell-surface, var(--form-high-surface-default));color:var(--ui-input-otp-cell-color, var(--form-high-content-default));font-family:inherit;font-weight:var(--ui-input-otp-weight, var(--weight-bold));text-align:center;caret-color:var(--ui-input-otp-cell-color, var(--form-high-content-default));transition:background-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),border-color var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout))),box-shadow var(--ui-control-transition-duration, var(--motion-hover-duration, var(--transition-default))) var(--ui-control-transition-easing, var(--motion-hover-easing, var(--transition-easeinout)))}.ui-input-otp-cell:hover:not(:disabled):not(:focus){border-color:var(--_stroke-hover)}.ui-input-otp-cell:focus,.ui-input-otp-cell:focus-visible{outline:none;border-color:var(--_stroke-focus);box-shadow:0 0 0 var(--ui-input-otp-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) rgb(from var(--_stroke-focus) r g b/50%)}.ui-input-otp-cell:disabled{border-color:var(--ui-input-otp-cell-stroke-disabled, var(--form-high-stroke-disabled));background-color:var(--ui-input-otp-cell-surface-disabled, var(--form-high-surface-disabled));color:var(--ui-input-otp-cell-color-disabled, var(--form-high-content-disabled));cursor:not-allowed}:host._readonly .ui-input-otp-cell{cursor:default}:host._invalid .ui-input-otp-cell{--_stroke: var(--ui-input-otp-cell-stroke-invalid, var(--form-error-stroke-default));--_stroke-hover: var(--ui-input-otp-cell-stroke-hover-invalid, var(--form-error-stroke-hover));--_stroke-focus: var(--ui-input-otp-cell-stroke-focus-invalid, var(--form-error-stroke-focused))}\n"] }]
|
|
281
281
|
}], ctorParameters: () => [], propDecorators: { length: [{ type: i0.Input, args: [{ isSignal: true, alias: "length", required: false }] }], mask: [{ type: i0.Input, args: [{ isSignal: true, alias: "mask", required: false }] }], integerOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "integerOnly", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], charAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "charAriaLabel", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], completed: [{ type: i0.Output, args: ["completed"] }], inputTemplate: [{ type: i0.ContentChild, args: ['input', { isSignal: true }] }] } });
|
|
282
282
|
|
|
283
283
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4sh-ui-kit-forms-ui-input-otp.mjs","sources":["../../../projects/ui-kit/forms/ui-input-otp/src/lib/ui-input-otp.ts","../../../projects/ui-kit/forms/ui-input-otp/src/lib/ui-input-otp.html","../../../projects/ui-kit/forms/ui-input-otp/src/public-api.ts","../../../projects/ui-kit/forms/ui-input-otp/src/4sh-ui-kit-forms-ui-input-otp.ts"],"sourcesContent":["import {\n afterNextRender,\n booleanAttribute,\n Component,\n computed,\n contentChild,\n effect,\n ElementRef,\n forwardRef,\n inject,\n input,\n isDevMode,\n numberAttribute,\n output,\n signal,\n TemplateRef,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseFieldControl } from '@4sh/ui-kit/forms';\nimport { warnMissingAccessibleName } from '@4sh/ui-kit/forms';\n\n/** Size of the OTP cells. `default` is the base. */\nexport type InputOtpSize = 'small' | 'default' | 'large';\n\n/** DOM event handlers handed to a custom `#input` cell template. */\nexport interface InputOtpCellEvents {\n /** Wire on `(input)`. */\n input: (event: Event) => void;\n /** Wire on `(keydown)`. */\n keydown: (event: KeyboardEvent) => void;\n /** Wire on `(focus)`. */\n focus: (event: FocusEvent) => void;\n /** Wire on `(blur)`. */\n blur: (event: FocusEvent) => void;\n /** Wire on `(paste)`. */\n paste: (event: ClipboardEvent) => void;\n}\n\n/** Context handed to the `#input` template (one per cell). */\nexport interface InputOtpCellContext {\n /** Current value of this cell (default `$implicit`). */\n $implicit: string;\n /** Same as `$implicit`, named for readability. */\n value: string;\n /** Zero-based index of the cell. */\n index: number;\n /** Event handlers to bind on the custom control (keeps the OTP behaviour). */\n events: InputOtpCellEvents;\n /** Roving tabindex for this cell (`0` for the active one, `-1` otherwise). */\n tabindex: number;\n}\n\n/**\n * ui-input-otp — headless one-time-password field: a row of single-character\n * cells backing a single string value.\n *\n * Each cell is a real native `<input maxlength=\"1\">`; the group carries\n * `role=\"group\"` and a **roving tabindex** so `Tab` enters/leaves the field as a\n * whole while `←`/`→` move between cells (`Backspace` clears and steps\n * back). Typing auto-advances, and pasting a code distributes it across the\n * cells. Interactive states (hover/focus/disabled) are pure CSS driven by the\n * `form.*` design tokens.\n *\n * - `mask` hides the characters (`type=\"password\"`).\n * - `integerOnly` restricts input to digits (`inputmode=\"numeric\"`).\n * - a `#input` template replaces the default cell with your own control (it\n * receives the value, index, roving tabindex and the event handlers to bind).\n *\n * Works standalone, with `[(ngModel)]`, reactive forms, or signal forms\n * (`[formField]`, Angular 22) — it is a `ControlValueAccessor` (interop handled by\n * `BaseControlValueAccessor`).\n *\n * @example\n * ```html\n * <ui-input-otp [(ngModel)]=\"code\" [length]=\"6\" [integerOnly]=\"true\" ariaLabel=\"Code de vérification\" />\n * ```\n */\n@Component({\n selector: 'ui-input-otp',\n imports: [NgTemplateOutlet],\n templateUrl: './ui-input-otp.html',\n styleUrl: './ui-input-otp.scss',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputOtp), multi: true },\n ],\n host: {\n class: 'ui-input-otp',\n role: 'group',\n '[class._small]': \"size() === 'small'\",\n '[class._large]': \"size() === 'large'\",\n '[class._disabled]': 'isDisabled()',\n '[class._readonly]': 'readonly()',\n '[class._invalid]': 'isInvalid()',\n '[attr.aria-label]': 'ariaLabel() || null',\n '[attr.aria-labelledby]': 'ariaLabelledBy() || null',\n '[attr.aria-invalid]': \"isInvalid() ? 'true' : null\",\n '[attr.aria-disabled]': \"isDisabled() ? 'true' : null\",\n '(focusout)': 'onFocusOut($event)',\n },\n})\nexport class UiInputOtp extends BaseFieldControl<string> {\n /** Number of cells (characters) to enter. */\n length = input(4, { transform: numberAttribute });\n /** Hide the characters (renders `type=\"password\"`). */\n mask = input(false, { transform: booleanAttribute });\n /** Restrict input to integers (`inputmode=\"numeric\"`, non-digits rejected). */\n integerOnly = input(false, { transform: booleanAttribute });\n /** Cell size. */\n size = input<InputOtpSize>('default');\n /** Accessible-name prefix of each cell (\"<prefix> N\"). Falls back to `ariaLabel`. */\n charAriaLabel = input<string>('Caractère');\n /** Focus the first cell on init. */\n autofocus = input(false, { transform: booleanAttribute });\n\n /** Emitted with the joined value on every change. */\n valueChange = output<string>();\n /** Emitted with the value once every cell is filled. */\n completed = output<string>();\n\n /** Custom cell template (`<ng-template #input let-value let-i=\"index\" let-events=\"events\">`). */\n protected readonly inputTemplate = contentChild<TemplateRef<InputOtpCellContext>>('input');\n\n /** @ignore */\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n /** @ignore Per-cell characters (source of truth for the view). */\n private readonly tokens = signal<string[]>([]);\n /** @ignore Cell that owns the group's single tab stop (roving tabindex). */\n private readonly focusedIndex = signal(0);\n\n constructor() {\n super();\n\n // Optional autofocus on the first cell after the view exists.\n afterNextRender(() => {\n if (this.autofocus() && !this.isDisabled()) this.focusCell(0);\n });\n\n // A11y safeguard (dev only): the group needs an accessible name.\n if (isDevMode()) {\n effect(() => {\n if (!this.ariaLabel() && !this.ariaLabelledBy()) {\n warnMissingAccessibleName(\n 'ui-input-otp',\n 'Group has no accessible name: provide `ariaLabel` (or `ariaLabelledBy`).',\n );\n }\n });\n }\n }\n\n /** @ignore Native input type (masked → password). */\n protected readonly inputType = computed(() => (this.mask() ? 'password' : 'text'));\n /** @ignore Hint for the on-screen keyboard. */\n protected readonly inputMode = computed(() => (this.integerOnly() ? 'numeric' : 'text'));\n\n /** @ignore Render-ready list of cells (index + current value). */\n protected readonly cells = computed(() => {\n const tokens = this.tokens();\n return Array.from({ length: Math.max(0, this.length()) }, (_, index) => ({\n index,\n id: `${this.uid}-${index}`,\n value: tokens[index] ?? '',\n }));\n });\n\n override writeValue(value: string | number | null): void {\n this.tokens.set(this.toTokens(value));\n }\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-input-otp';\n }\n\n /** Move focus to the first cell. */\n focus(options?: FocusOptions): void {\n this.focusCell(0, options);\n }\n\n /** @ignore Roving tabindex for a given cell (one `0`, the rest `-1`). */\n protected tabindexFor(index: number): number {\n const active = Math.min(this.focusedIndex(), this.length() - 1);\n return index === Math.max(0, active) ? 0 : -1;\n }\n\n /** @ignore Value shown in a cell. */\n protected cellValue(index: number): string {\n return this.tokens()[index] ?? '';\n }\n\n /** @ignore Handlers exposed to a custom `#input` template. */\n protected cellEvents(index: number): InputOtpCellEvents {\n return {\n input: (event: Event) => this.onInput(event, index),\n keydown: (event: KeyboardEvent) => this.onKeydown(event, index),\n focus: (event: FocusEvent) => this.onFocus(event, index),\n blur: () => {\n /* touched is emitted on group focusout */\n },\n paste: (event: ClipboardEvent) => this.onPaste(event, index),\n };\n }\n\n /** @ignore Cell input: single source of the per-cell value (view → form). */\n protected onInput(event: Event, index: number): void {\n if (this.readonly()) return;\n const target = event.target as HTMLInputElement;\n const raw = this.sanitize(target.value);\n\n // Multi-char (autofill / paste into a cell) → distribute across cells.\n if (raw.length > 1) {\n this.setFromIndex(index, raw);\n return;\n }\n\n const tokens = [...this.tokens()];\n tokens[index] = raw;\n target.value = raw; // reflect the sanitised value\n this.commit(tokens);\n\n const inputType = (event as InputEvent).inputType;\n if (raw) this.focusCell(index + 1);\n else if (inputType === 'deleteContentBackward') this.focusCell(index - 1);\n }\n\n /** @ignore Keyboard navigation + input guards. */\n protected onKeydown(event: KeyboardEvent, index: number): void {\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n const target = event.target as HTMLInputElement;\n\n switch (event.key) {\n case 'ArrowLeft':\n event.preventDefault();\n this.focusCell(index - 1);\n return;\n case 'ArrowRight':\n event.preventDefault();\n this.focusCell(index + 1);\n return;\n case 'Home':\n event.preventDefault();\n this.focusCell(0);\n return;\n case 'End':\n event.preventDefault();\n this.focusCell(this.length() - 1);\n return;\n case 'ArrowUp':\n case 'ArrowDown':\n event.preventDefault();\n return;\n case 'Backspace':\n // Empty cell → clear + step back (a filled cell clears via native input).\n if (!target.value && !this.readonly()) {\n event.preventDefault();\n const tokens = [...this.tokens()];\n if (tokens[index - 1] !== undefined) tokens[index - 1] = '';\n this.commit(tokens);\n this.focusCell(index - 1);\n }\n return;\n default: {\n if (event.key.length !== 1) return; // let control keys through\n // Reject non-digits when integer-only.\n if (this.integerOnly() && !/^\\d$/.test(event.key)) event.preventDefault();\n }\n }\n }\n\n /** @ignore Select the cell content on focus + track the roving index. */\n protected onFocus(event: FocusEvent, index: number): void {\n this.focusedIndex.set(index);\n (event.target as HTMLInputElement).select?.();\n }\n\n /** @ignore Distribute a pasted code across the cells from `index`. */\n protected onPaste(event: ClipboardEvent, index: number): void {\n if (this.isDisabled() || this.readonly()) return;\n event.preventDefault();\n const pasted = this.sanitize(event.clipboardData?.getData('text') ?? '');\n if (pasted) this.setFromIndex(index, pasted);\n }\n\n /** @ignore Mark touched when focus leaves the whole group. */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (!next || !this.host.nativeElement.contains(next)) this.emitTouch();\n }\n\n /** @ignore Write `chars` into the cells starting at `from`, then commit + focus. */\n private setFromIndex(from: number, chars: string): void {\n const tokens = [...this.tokens()];\n const max = this.length();\n let i = from;\n for (const ch of chars) {\n if (i >= max) break;\n tokens[i++] = ch;\n }\n this.commit(tokens);\n this.focusCell(Math.min(i, max - 1));\n }\n\n /** @ignore Persist the tokens, emit the joined value (+ `completed` when full). */\n private commit(tokens: string[]): void {\n const trimmed = tokens.slice(0, this.length());\n this.tokens.set(trimmed);\n const value = trimmed.join('');\n this.emitChange(value);\n this.valueChange.emit(value);\n if (value.length === this.length() && trimmed.every((c) => c !== '')) {\n this.completed.emit(value);\n }\n }\n\n /** @ignore Focus (and select) the cell at `index`, if it exists. */\n private focusCell(index: number, options?: FocusOptions): void {\n if (index < 0 || index >= this.length()) return;\n this.focusedIndex.set(index);\n const el = this.host.nativeElement.querySelectorAll<HTMLInputElement>('input')[index];\n if (el) {\n el.focus(options);\n el.select();\n }\n }\n\n /** @ignore Split a form value into an array of single characters (bounded). */\n private toTokens(value: string | number | null | undefined): string[] {\n if (value === null || value === undefined || value === '') return [];\n return String(value).split('').slice(0, this.length());\n }\n\n /** @ignore Drop non-digits when integer-only, otherwise pass through. */\n private sanitize(value: string): string {\n return this.integerOnly() ? value.replace(/\\D/g, '') : value;\n }\n}\n","@for (cell of cells(); track cell.index) {\n @if (inputTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: cell.value,\n value: cell.value,\n index: cell.index,\n events: cellEvents(cell.index),\n tabindex: tabindexFor(cell.index),\n }\"\n />\n } @else {\n <input\n class=\"ui-input-otp-cell\"\n [id]=\"cell.id\"\n [type]=\"inputType()\"\n [value]=\"cell.value\"\n maxlength=\"1\"\n autocomplete=\"one-time-code\"\n [attr.inputmode]=\"inputMode()\"\n [attr.name]=\"name() ? name() + '-' + cell.index : null\"\n [attr.tabindex]=\"tabindexFor(cell.index)\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [attr.aria-label]=\"(ariaLabel() || charAriaLabel()) + ' ' + (cell.index + 1)\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (input)=\"onInput($event, cell.index)\"\n (keydown)=\"onKeydown($event, cell.index)\"\n (focus)=\"onFocus($event, cell.index)\"\n (paste)=\"onPaste($event, cell.index)\"\n />\n }\n}\n","/*\n * Public API Surface of ui-kit/ui-input-otp\n */\n\nexport * from './lib/ui-input-otp';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAqDA;;;;;;;;;;;;;;;;;;;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AA,MAAA,EAAA,CAAA,mqGAAA,CAAA,EAAA;wxBAsBiF,OAAO,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEzH3F;;AAEG;;ACFH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"4sh-ui-kit-forms-ui-input-otp.mjs","sources":["../../../projects/ui-kit/forms/ui-input-otp/src/lib/ui-input-otp.ts","../../../projects/ui-kit/forms/ui-input-otp/src/lib/ui-input-otp.html","../../../projects/ui-kit/forms/ui-input-otp/src/public-api.ts","../../../projects/ui-kit/forms/ui-input-otp/src/4sh-ui-kit-forms-ui-input-otp.ts"],"sourcesContent":["import {\n afterNextRender,\n booleanAttribute,\n Component,\n computed,\n contentChild,\n effect,\n ElementRef,\n forwardRef,\n inject,\n input,\n isDevMode,\n numberAttribute,\n output,\n signal,\n TemplateRef,\n} from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseFieldControl } from '@4sh/ui-kit/forms';\nimport { warnMissingAccessibleName } from '@4sh/ui-kit/forms';\n\n/** Size of the OTP cells. `default` is the base. */\nexport type InputOtpSize = 'small' | 'default' | 'large';\n\n/** DOM event handlers handed to a custom `#input` cell template. */\nexport interface InputOtpCellEvents {\n /** Wire on `(input)`. */\n input: (event: Event) => void;\n /** Wire on `(keydown)`. */\n keydown: (event: KeyboardEvent) => void;\n /** Wire on `(focus)`. */\n focus: (event: FocusEvent) => void;\n /** Wire on `(blur)`. */\n blur: (event: FocusEvent) => void;\n /** Wire on `(paste)`. */\n paste: (event: ClipboardEvent) => void;\n}\n\n/** Context handed to the `#input` template (one per cell). */\nexport interface InputOtpCellContext {\n /** Current value of this cell (default `$implicit`). */\n $implicit: string;\n /** Same as `$implicit`, named for readability. */\n value: string;\n /** Zero-based index of the cell. */\n index: number;\n /** Event handlers to bind on the custom control (keeps the OTP behaviour). */\n events: InputOtpCellEvents;\n /** Roving tabindex for this cell (`0` for the active one, `-1` otherwise). */\n tabindex: number;\n}\n\n/**\n * ui-input-otp — headless one-time-password field: a row of single-character\n * cells backing a single string value.\n *\n * Each cell is a real native `<input maxlength=\"1\">`; the group carries\n * `role=\"group\"` and a **roving tabindex** so `Tab` enters/leaves the field as a\n * whole while `←`/`→` move between cells (`Backspace` clears and steps\n * back). Typing auto-advances, and pasting a code distributes it across the\n * cells. Interactive states (hover/focus/disabled) are pure CSS driven by the\n * `form.*` design tokens.\n *\n * - `mask` hides the characters (`type=\"password\"`).\n * - `integerOnly` restricts input to digits (`inputmode=\"numeric\"`).\n * - a `#input` template replaces the default cell with your own control (it\n * receives the value, index, roving tabindex and the event handlers to bind).\n *\n * Works standalone, with `[(ngModel)]`, reactive forms, or signal forms\n * (`[formField]`, Angular 22) — it is a `ControlValueAccessor` (interop handled by\n * `BaseControlValueAccessor`).\n *\n * @example\n * ```html\n * <ui-input-otp [(ngModel)]=\"code\" [length]=\"6\" [integerOnly]=\"true\" ariaLabel=\"Code de vérification\" />\n * ```\n */\n@Component({\n selector: 'ui-input-otp',\n imports: [NgTemplateOutlet],\n templateUrl: './ui-input-otp.html',\n styleUrl: './ui-input-otp.scss',\n providers: [\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiInputOtp), multi: true },\n ],\n host: {\n class: 'ui-input-otp',\n role: 'group',\n '[class._small]': \"size() === 'small'\",\n '[class._large]': \"size() === 'large'\",\n '[class._disabled]': 'isDisabled()',\n '[class._readonly]': 'readonly()',\n '[class._invalid]': 'isInvalid()',\n '[attr.aria-label]': 'ariaLabel() || null',\n '[attr.aria-labelledby]': 'ariaLabelledBy() || null',\n '[attr.aria-invalid]': \"isInvalid() ? 'true' : null\",\n '[attr.aria-disabled]': \"isDisabled() ? 'true' : null\",\n '(focusout)': 'onFocusOut($event)',\n },\n})\nexport class UiInputOtp extends BaseFieldControl<string> {\n /** Number of cells (characters) to enter. */\n length = input(4, { transform: numberAttribute });\n /** Hide the characters (renders `type=\"password\"`). */\n mask = input(false, { transform: booleanAttribute });\n /** Restrict input to integers (`inputmode=\"numeric\"`, non-digits rejected). */\n integerOnly = input(false, { transform: booleanAttribute });\n /** Cell size. */\n size = input<InputOtpSize>('default');\n /** Accessible-name prefix of each cell (\"<prefix> N\"). Falls back to `ariaLabel`. */\n charAriaLabel = input<string>('Caractère');\n /** Focus the first cell on init. */\n autofocus = input(false, { transform: booleanAttribute });\n\n /** Emitted with the joined value on every change. */\n valueChange = output<string>();\n /** Emitted with the value once every cell is filled. */\n completed = output<string>();\n\n /** Custom cell template (`<ng-template #input let-value let-i=\"index\" let-events=\"events\">`). */\n protected readonly inputTemplate = contentChild<TemplateRef<InputOtpCellContext>>('input');\n\n /** @ignore */\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef);\n /** @ignore Per-cell characters (source of truth for the view). */\n private readonly tokens = signal<string[]>([]);\n /** @ignore Cell that owns the group's single tab stop (roving tabindex). */\n private readonly focusedIndex = signal(0);\n\n constructor() {\n super();\n\n // Optional autofocus on the first cell after the view exists.\n afterNextRender(() => {\n if (this.autofocus() && !this.isDisabled()) this.focusCell(0);\n });\n\n // A11y safeguard (dev only): the group needs an accessible name.\n if (isDevMode()) {\n effect(() => {\n if (!this.ariaLabel() && !this.ariaLabelledBy()) {\n warnMissingAccessibleName(\n 'ui-input-otp',\n 'Group has no accessible name: provide `ariaLabel` (or `ariaLabelledBy`).',\n );\n }\n });\n }\n }\n\n /** @ignore Native input type (masked → password). */\n protected readonly inputType = computed(() => (this.mask() ? 'password' : 'text'));\n /** @ignore Hint for the on-screen keyboard. */\n protected readonly inputMode = computed(() => (this.integerOnly() ? 'numeric' : 'text'));\n\n /** @ignore Render-ready list of cells (index + current value). */\n protected readonly cells = computed(() => {\n const tokens = this.tokens();\n return Array.from({ length: Math.max(0, this.length()) }, (_, index) => ({\n index,\n id: `${this.uid}-${index}`,\n value: tokens[index] ?? '',\n }));\n });\n\n override writeValue(value: string | number | null): void {\n this.tokens.set(this.toTokens(value));\n }\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-input-otp';\n }\n\n /** Move focus to the first cell. */\n focus(options?: FocusOptions): void {\n this.focusCell(0, options);\n }\n\n /** @ignore Roving tabindex for a given cell (one `0`, the rest `-1`). */\n protected tabindexFor(index: number): number {\n const active = Math.min(this.focusedIndex(), this.length() - 1);\n return index === Math.max(0, active) ? 0 : -1;\n }\n\n /** @ignore Value shown in a cell. */\n protected cellValue(index: number): string {\n return this.tokens()[index] ?? '';\n }\n\n /** @ignore Handlers exposed to a custom `#input` template. */\n protected cellEvents(index: number): InputOtpCellEvents {\n return {\n input: (event: Event) => this.onInput(event, index),\n keydown: (event: KeyboardEvent) => this.onKeydown(event, index),\n focus: (event: FocusEvent) => this.onFocus(event, index),\n blur: () => {\n /* touched is emitted on group focusout */\n },\n paste: (event: ClipboardEvent) => this.onPaste(event, index),\n };\n }\n\n /** @ignore Cell input: single source of the per-cell value (view → form). */\n protected onInput(event: Event, index: number): void {\n if (this.readonly()) return;\n const target = event.target as HTMLInputElement;\n const raw = this.sanitize(target.value);\n\n // Multi-char (autofill / paste into a cell) → distribute across cells.\n if (raw.length > 1) {\n this.setFromIndex(index, raw);\n return;\n }\n\n const tokens = [...this.tokens()];\n tokens[index] = raw;\n target.value = raw; // reflect the sanitised value\n this.commit(tokens);\n\n const inputType = (event as InputEvent).inputType;\n if (raw) this.focusCell(index + 1);\n else if (inputType === 'deleteContentBackward') this.focusCell(index - 1);\n }\n\n /** @ignore Keyboard navigation + input guards. */\n protected onKeydown(event: KeyboardEvent, index: number): void {\n if (event.altKey || event.ctrlKey || event.metaKey) return;\n const target = event.target as HTMLInputElement;\n\n switch (event.key) {\n case 'ArrowLeft':\n event.preventDefault();\n this.focusCell(index - 1);\n return;\n case 'ArrowRight':\n event.preventDefault();\n this.focusCell(index + 1);\n return;\n case 'Home':\n event.preventDefault();\n this.focusCell(0);\n return;\n case 'End':\n event.preventDefault();\n this.focusCell(this.length() - 1);\n return;\n case 'ArrowUp':\n case 'ArrowDown':\n event.preventDefault();\n return;\n case 'Backspace':\n // Empty cell → clear + step back (a filled cell clears via native input).\n if (!target.value && !this.readonly()) {\n event.preventDefault();\n const tokens = [...this.tokens()];\n if (tokens[index - 1] !== undefined) tokens[index - 1] = '';\n this.commit(tokens);\n this.focusCell(index - 1);\n }\n return;\n default: {\n if (event.key.length !== 1) return; // let control keys through\n // Reject non-digits when integer-only.\n if (this.integerOnly() && !/^\\d$/.test(event.key)) event.preventDefault();\n }\n }\n }\n\n /** @ignore Select the cell content on focus + track the roving index. */\n protected onFocus(event: FocusEvent, index: number): void {\n this.focusedIndex.set(index);\n (event.target as HTMLInputElement).select?.();\n }\n\n /** @ignore Distribute a pasted code across the cells from `index`. */\n protected onPaste(event: ClipboardEvent, index: number): void {\n if (this.isDisabled() || this.readonly()) return;\n event.preventDefault();\n const pasted = this.sanitize(event.clipboardData?.getData('text') ?? '');\n if (pasted) this.setFromIndex(index, pasted);\n }\n\n /** @ignore Mark touched when focus leaves the whole group. */\n protected onFocusOut(event: FocusEvent): void {\n const next = event.relatedTarget as Node | null;\n if (!next || !this.host.nativeElement.contains(next)) this.emitTouch();\n }\n\n /** @ignore Write `chars` into the cells starting at `from`, then commit + focus. */\n private setFromIndex(from: number, chars: string): void {\n const tokens = [...this.tokens()];\n const max = this.length();\n let i = from;\n for (const ch of chars) {\n if (i >= max) break;\n tokens[i++] = ch;\n }\n this.commit(tokens);\n this.focusCell(Math.min(i, max - 1));\n }\n\n /** @ignore Persist the tokens, emit the joined value (+ `completed` when full). */\n private commit(tokens: string[]): void {\n const trimmed = tokens.slice(0, this.length());\n this.tokens.set(trimmed);\n const value = trimmed.join('');\n this.emitChange(value);\n this.valueChange.emit(value);\n if (value.length === this.length() && trimmed.every((c) => c !== '')) {\n this.completed.emit(value);\n }\n }\n\n /** @ignore Focus (and select) the cell at `index`, if it exists. */\n private focusCell(index: number, options?: FocusOptions): void {\n if (index < 0 || index >= this.length()) return;\n this.focusedIndex.set(index);\n const el = this.host.nativeElement.querySelectorAll<HTMLInputElement>('input')[index];\n if (el) {\n el.focus(options);\n el.select();\n }\n }\n\n /** @ignore Split a form value into an array of single characters (bounded). */\n private toTokens(value: string | number | null | undefined): string[] {\n if (value === null || value === undefined || value === '') return [];\n return String(value).split('').slice(0, this.length());\n }\n\n /** @ignore Drop non-digits when integer-only, otherwise pass through. */\n private sanitize(value: string): string {\n return this.integerOnly() ? value.replace(/\\D/g, '') : value;\n }\n}\n","@for (cell of cells(); track cell.index) {\n @if (inputTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: cell.value,\n value: cell.value,\n index: cell.index,\n events: cellEvents(cell.index),\n tabindex: tabindexFor(cell.index),\n }\"\n />\n } @else {\n <input\n class=\"ui-input-otp-cell\"\n [id]=\"cell.id\"\n [type]=\"inputType()\"\n [value]=\"cell.value\"\n maxlength=\"1\"\n autocomplete=\"one-time-code\"\n [attr.inputmode]=\"inputMode()\"\n [attr.name]=\"name() ? name() + '-' + cell.index : null\"\n [attr.tabindex]=\"tabindexFor(cell.index)\"\n [disabled]=\"isDisabled()\"\n [readOnly]=\"readonly()\"\n [attr.aria-label]=\"(ariaLabel() || charAriaLabel()) + ' ' + (cell.index + 1)\"\n [attr.aria-invalid]=\"isInvalid() ? 'true' : null\"\n (input)=\"onInput($event, cell.index)\"\n (keydown)=\"onKeydown($event, cell.index)\"\n (focus)=\"onFocus($event, cell.index)\"\n (paste)=\"onPaste($event, cell.index)\"\n />\n }\n}\n","/*\n * Public API Surface of ui-kit/ui-input-otp\n */\n\nexport * from './lib/ui-input-otp';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAqDA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AAwBG,MAAO,UAAW,SAAQ,gBAAwB,CAAA;AA6BtD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK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