@4sh/ui-kit 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.fr.md +10 -10
- package/README.md +10 -10
- package/fesm2022/4sh-ui-kit-actions-ui-button-split.mjs +3 -3
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs +4 -4
- package/fesm2022/4sh-ui-kit-actions-ui-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs +4 -4
- package/fesm2022/4sh-ui-kit-actions-ui-link.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-actions-ui-speed-dial.mjs +3 -3
- package/fesm2022/4sh-ui-kit-base-ui-icon.mjs +6 -6
- 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 +5 -5
- package/fesm2022/4sh-ui-kit-forms-ui-autocomplete.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs +5 -5
- package/fesm2022/4sh-ui-kit-forms-ui-checkbox.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs +9 -6
- package/fesm2022/4sh-ui-kit-forms-ui-datepicker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs +4 -4
- package/fesm2022/4sh-ui-kit-forms-ui-editor.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs +4 -4
- package/fesm2022/4sh-ui-kit-forms-ui-field.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs +8 -8
- package/fesm2022/4sh-ui-kit-forms-ui-file-upload.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs +7 -7
- package/fesm2022/4sh-ui-kit-forms-ui-input-group.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs +5 -5
- package/fesm2022/4sh-ui-kit-forms-ui-input-mask.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs +5 -5
- package/fesm2022/4sh-ui-kit-forms-ui-input-number.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs +5 -5
- package/fesm2022/4sh-ui-kit-forms-ui-input-otp.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs +5 -5
- package/fesm2022/4sh-ui-kit-forms-ui-input-tags.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs +4 -4
- package/fesm2022/4sh-ui-kit-forms-ui-input.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs +4 -4
- package/fesm2022/4sh-ui-kit-forms-ui-knob.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-label.mjs +4 -4
- package/fesm2022/4sh-ui-kit-forms-ui-label.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs +4 -4
- package/fesm2022/4sh-ui-kit-forms-ui-nudger.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs +4 -4
- package/fesm2022/4sh-ui-kit-forms-ui-radio.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs +4 -4
- package/fesm2022/4sh-ui-kit-forms-ui-rating.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs +5 -5
- package/fesm2022/4sh-ui-kit-forms-ui-segment-control.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs +4 -4
- package/fesm2022/4sh-ui-kit-forms-ui-select.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs +4 -4
- package/fesm2022/4sh-ui-kit-forms-ui-slider.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs +4 -4
- package/fesm2022/4sh-ui-kit-forms-ui-swatch-picker.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs +5 -5
- package/fesm2022/4sh-ui-kit-forms-ui-textarea.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs +215 -0
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-block.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs +5 -5
- package/fesm2022/4sh-ui-kit-forms-ui-toggle-button.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs +4 -4
- package/fesm2022/4sh-ui-kit-forms-ui-toggle.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-forms.mjs +6 -6
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs +13 -13
- package/fesm2022/4sh-ui-kit-informative-ui-accordion.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs +4 -4
- package/fesm2022/4sh-ui-kit-informative-ui-alert.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-avatar-group.mjs +3 -3
- package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs +4 -4
- package/fesm2022/4sh-ui-kit-informative-ui-avatar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs +4 -4
- package/fesm2022/4sh-ui-kit-informative-ui-badge.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs +4 -4
- package/fesm2022/4sh-ui-kit-informative-ui-chip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs +10 -10
- package/fesm2022/4sh-ui-kit-informative-ui-empty-state.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs +4 -4
- package/fesm2022/4sh-ui-kit-informative-ui-helper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs +4 -4
- package/fesm2022/4sh-ui-kit-informative-ui-progress-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs +4 -4
- package/fesm2022/4sh-ui-kit-informative-ui-read-only.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs +4 -4
- package/fesm2022/4sh-ui-kit-informative-ui-separator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-skeleton.mjs +3 -3
- package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs +4 -4
- package/fesm2022/4sh-ui-kit-informative-ui-spinner.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs +4 -4
- package/fesm2022/4sh-ui-kit-informative-ui-tag.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs +10 -10
- package/fesm2022/4sh-ui-kit-informative-ui-toast.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs +45 -26
- package/fesm2022/4sh-ui-kit-informative-ui-tooltip.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs +629 -0
- package/fesm2022/4sh-ui-kit-layout-ui-bottom-sheet.mjs.map +1 -0
- package/fesm2022/4sh-ui-kit-layout-ui-card.mjs +16 -16
- package/fesm2022/4sh-ui-kit-layout-ui-card.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs +4 -4
- package/fesm2022/4sh-ui-kit-layout-ui-drawer.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs +4 -4
- package/fesm2022/4sh-ui-kit-layout-ui-modal.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs +4 -4
- package/fesm2022/4sh-ui-kit-layout-ui-popover.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-motion.mjs +3 -3
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs +12 -12
- package/fesm2022/4sh-ui-kit-navigation-ui-bottom-tab-bar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs +4 -4
- package/fesm2022/4sh-ui-kit-navigation-ui-breadcrumb.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-context-menu.mjs +3 -3
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs +4 -4
- package/fesm2022/4sh-ui-kit-navigation-ui-menu.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs +11 -11
- package/fesm2022/4sh-ui-kit-navigation-ui-sidebar.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs +22 -22
- package/fesm2022/4sh-ui-kit-navigation-ui-stepper.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs +20 -20
- package/fesm2022/4sh-ui-kit-navigation-ui-tabs.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-ripple.mjs +9 -9
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs +4 -4
- package/fesm2022/4sh-ui-kit-table-ui-paginator.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs +34 -34
- package/fesm2022/4sh-ui-kit-table-ui-table.mjs.map +1 -1
- package/fesm2022/4sh-ui-kit-theming.mjs +6 -6
- package/mcp/data/text-search-docs.json +311 -61
- package/mcp/data/ui-config.json +26059 -12458
- package/mcp/package.json +1 -1
- package/package.json +9 -1
- package/styles/component-vars.scss +1402 -721
- package/styles/settings/_ui-config.scss +45 -2
- package/styles/utils/_mixins.scss +32 -30
- package/styles/utils/_overlay.scss +1 -1
- package/types/4sh-ui-kit-forms-ui-datepicker.d.ts +3 -1
- package/types/4sh-ui-kit-forms-ui-toggle-block.d.ts +114 -0
- package/types/4sh-ui-kit-informative-ui-tooltip.d.ts +4 -4
- package/types/4sh-ui-kit-layout-ui-bottom-sheet.d.ts +256 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4sh-ui-kit-forms-ui-nudger.mjs","sources":["../../../projects/ui-kit/forms/ui-nudger/src/lib/ui-nudger.ts","../../../projects/ui-kit/forms/ui-nudger/src/lib/ui-nudger.html","../../../projects/ui-kit/forms/ui-nudger/src/public-api.ts","../../../projects/ui-kit/forms/ui-nudger/src/4sh-ui-kit-forms-ui-nudger.ts"],"sourcesContent":["import {\n Component,\n computed,\n effect,\n forwardRef,\n input,\n isDevMode,\n numberAttribute,\n output,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseFieldControl } from '@4sh/ui-kit/forms';\nimport { UiLevel } from '@4sh/ui-kit/types';\nimport { ButtonOnColor, ButtonVariant, UiButton } from '@4sh/ui-kit/actions/ui-button';\n\nexport type NudgerSize = 'default' | 'small';\n\n/**\n * ui-nudger : headless numeric stepper (`[−] value [+]`).\n *\n * Composes two icon-only `ui-button` instances around a read-only value\n * display. Holds a `number` value via `ControlValueAccessor` (standalone,\n * `[(ngModel)]`, Reactive Forms, Signal Forms). `min`/`max` disable the\n * relevant button at the bound (the Figma `interaction` states Min/Max are\n * **derived** from the value here, never a prop); `step` sizes each nudge.\n *\n * Keyboard: each button is a real `<button>` (Tab + Enter/Space). The value\n * is a live region announced on change.\n */\n@Component({\n selector: 'ui-nudger',\n imports: [UiButton],\n templateUrl: './ui-nudger.html',\n styleUrl: './ui-nudger.scss',\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiNudger), multi: true }],\n})\nexport class UiNudger extends BaseFieldControl<number> {\n /** Minimum value (disables \"−\" at the bound). */\n min = input<number, unknown>(undefined, { transform: numberAttribute });\n /** Maximum value (disables \"+\" at the bound). */\n max = input<number, unknown>(undefined, { transform: numberAttribute });\n /** Increment/decrement step. */\n step = input<number, unknown>(1, { transform: numberAttribute });\n /** Value used when the model is empty (also the standalone default). */\n defaultValue = input<number, unknown>(0, { transform: numberAttribute });\n\n /** Size. */\n size = input<NudgerSize>('default');\n /** Color family of the two buttons. */\n level = input<UiLevel>('high');\n /** Appearance applied to the two buttons. */\n variant = input<ButtonVariant>('filled');\n /** Luminosité du fond de couleur sur lequel le nudger est posé (voir `ui-button.onColor`). */\n onColor = input<ButtonOnColor | null>(null);\n\n /** Accessible label of the decrement button. */\n decrementAriaLabel = input<string>('Diminuer');\n /** Accessible label of the increment button. */\n incrementAriaLabel = input<string>('Augmenter');\n /** FontAwesome icon name of the decrement button. */\n decrementIcon = input<string>('minus');\n /** FontAwesome icon name of the increment button. */\n incrementIcon = input<string>('plus');\n /** Optional display formatter for the value (e.g. `(v) => v + ' kg'`). */\n formatValue = input<(value: number) => string>();\n\n /** Emitted on each value change. */\n valueChange = output<number>();\n\n constructor() {\n super();\n // A11y safeguard: a stepper needs an accessible name.\n if (isDevMode()) {\n effect(() => {\n if (!this.ariaLabel() && !this.ariaLabelledBy()) {\n console.warn(\n '[ui-nudger] No accessible name: provide `ariaLabel` (or `ariaLabelledBy`).',\n );\n }\n });\n }\n }\n\n /** @ignore Effective numeric value (falls back to `defaultValue`). */\n protected readonly currentValue = computed(() => this.modelValue() ?? this.defaultValue());\n\n /** @ignore Bounds reached. */\n protected readonly atMin = computed(() => {\n const min = this.min();\n return min != null && this.currentValue() <= min;\n });\n protected readonly atMax = computed(() => {\n const max = this.max();\n return max != null && this.currentValue() >= max;\n });\n\n /** @ignore Per-button disabled state. */\n protected readonly decrementDisabled = computed(\n () => this.isDisabled() || this.readonly() || this.atMin(),\n );\n protected readonly incrementDisabled = computed(\n () => this.isDisabled() || this.readonly() || this.atMax(),\n );\n\n /** @ignore Value shown (custom formatter or plain number). */\n protected readonly displayValue = computed(() => {\n const v = this.currentValue();\n return this.formatValue()?.(v) ?? String(v);\n });\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-nudger'];\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n if (this.isDisabled()) c.push('_disabled');\n if (this.isInvalid()) c.push('_invalid');\n return c.join(' ');\n });\n\n override writeValue(value: number | null): void {\n this.modelValue.set(value ?? undefined);\n }\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-nudger';\n }\n\n /** Increments the value by one `step` (clamped to `max`). */\n increment(): void {\n this.stepBy(1);\n }\n\n /** Decrements the value by one `step` (clamped to `min`). */\n decrement(): void {\n this.stepBy(-1);\n }\n\n /** @ignore Apply a signed step, clamp, emit. */\n protected stepBy(direction: 1 | -1): void {\n if (this.isDisabled() || this.readonly()) return;\n const next = this.clamp(this.currentValue() + direction * this.step());\n if (next === this.modelValue()) return;\n this.modelValue.set(next);\n this.emitChange(next);\n this.valueChange.emit(next);\n }\n\n /** @ignore Mark as touched when focus leaves the stepper. */\n protected onBlur(event: FocusEvent): void {\n // Ignore focus moving between the two internal buttons.\n const next = event.relatedTarget as Node | null;\n const root = event.currentTarget as HTMLElement;\n if (next && root.contains(next)) return;\n this.emitTouch();\n }\n\n /** @ignore Clamp a value into [min, max]. */\n private clamp(value: number): number {\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","<div\n [class]=\"classes()\"\n [id]=\"resolvedId()\"\n role=\"group\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n (focusout)=\"onBlur($event)\"\n>\n <ui-button\n class=\"ui-nudger-button\"\n [level]=\"level()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [onColor]=\"onColor()\"\n [icon]=\"decrementIcon()\"\n [ariaLabel]=\"decrementAriaLabel()\"\n [disabled]=\"decrementDisabled()\"\n [tabindex]=\"tabindex()\"\n iconOnly\n (buttonClick)=\"decrement()\"\n />\n\n <span class=\"ui-nudger-value\" aria-live=\"polite\" [attr.aria-hidden]=\"null\">{{\n displayValue()\n }}</span>\n\n <ui-button\n class=\"ui-nudger-button\"\n [level]=\"level()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [onColor]=\"onColor()\"\n [icon]=\"incrementIcon()\"\n [ariaLabel]=\"incrementAriaLabel()\"\n [disabled]=\"incrementDisabled()\"\n [tabindex]=\"tabindex()\"\n iconOnly\n (buttonClick)=\"increment()\"\n />\n\n <!-- Hidden holder so a native `name` participates in form submission. -->\n @if (name(); as n) {\n <input type=\"hidden\" [name]=\"n\" [value]=\"currentValue()\" />\n }\n</div>\n","/*\n * Public API Surface of ui-kit/ui-nudger\n */\n\nexport * from './lib/ui-nudger';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAiBA;;;;;;;;;;;AAWG;AAQG,MAAO,QAAS,SAAQ,gBAAwB,CAAA;AAiCpD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;QAhCT,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,YAAY,GAAG,KAAK,CAAkB,CAAC,oFAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;QAGxE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAa,SAAS;iFAAC;;QAEnC,IAAA,CAAA,KAAK,GAAG,KAAK,CAAU,MAAM;kFAAC;;QAE9B,IAAA,CAAA,OAAO,GAAG,KAAK,CAAgB,QAAQ;oFAAC;;QAExC,IAAA,CAAA,OAAO,GAAG,KAAK,CAAuB,IAAI;oFAAC;;QAG3C,IAAA,CAAA,kBAAkB,GAAG,KAAK,CAAS,UAAU;+FAAC;;QAE9C,IAAA,CAAA,kBAAkB,GAAG,KAAK,CAAS,WAAW;+FAAC;;QAE/C,IAAA,CAAA,aAAa,GAAG,KAAK,CAAS,OAAO;0FAAC;;QAEt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AAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,EAAA,aAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAKP,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAPpB,SAAS;+BACE,WAAW,EAAA,OAAA,EACZ,CAAC,QAAQ,CAAC,EAAA,SAAA,EAGR,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,MAAK,QAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAA,QAAA,EAAA,4sCAAA,EAAA,MAAA,EAAA,CAAA,u6BAAA,CAAA,EAAA;;;AElCnG;;AAEG;;ACFH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"4sh-ui-kit-forms-ui-nudger.mjs","sources":["../../../projects/ui-kit/forms/ui-nudger/src/lib/ui-nudger.ts","../../../projects/ui-kit/forms/ui-nudger/src/lib/ui-nudger.html","../../../projects/ui-kit/forms/ui-nudger/src/public-api.ts","../../../projects/ui-kit/forms/ui-nudger/src/4sh-ui-kit-forms-ui-nudger.ts"],"sourcesContent":["import {\n Component,\n computed,\n effect,\n forwardRef,\n input,\n isDevMode,\n numberAttribute,\n output,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseFieldControl } from '@4sh/ui-kit/forms';\nimport { UiLevel } from '@4sh/ui-kit/types';\nimport { ButtonOnColor, ButtonVariant, UiButton } from '@4sh/ui-kit/actions/ui-button';\n\nexport type NudgerSize = 'default' | 'small';\n\n/**\n * ui-nudger : headless numeric stepper (`[−] value [+]`).\n *\n * Composes two icon-only `ui-button` instances around a read-only value\n * display. Holds a `number` value via `ControlValueAccessor` (standalone,\n * `[(ngModel)]`, Reactive Forms, Signal Forms). `min`/`max` disable the\n * relevant button at the bound (the Figma `interaction` states Min/Max are\n * **derived** from the value here, never a prop); `step` sizes each nudge.\n *\n * Keyboard: each button is a real `<button>` (Tab + Enter/Space). The value\n * is a live region announced on change.\n */\n@Component({\n selector: 'ui-nudger',\n imports: [UiButton],\n templateUrl: './ui-nudger.html',\n styleUrl: './ui-nudger.scss',\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiNudger), multi: true }],\n})\nexport class UiNudger extends BaseFieldControl<number> {\n /** Minimum value (disables \"−\" at the bound). */\n min = input<number, unknown>(undefined, { transform: numberAttribute });\n /** Maximum value (disables \"+\" at the bound). */\n max = input<number, unknown>(undefined, { transform: numberAttribute });\n /** Increment/decrement step. */\n step = input<number, unknown>(1, { transform: numberAttribute });\n /** Value used when the model is empty (also the standalone default). */\n defaultValue = input<number, unknown>(0, { transform: numberAttribute });\n\n /** Size. */\n size = input<NudgerSize>('default');\n /** Color family of the two buttons. */\n level = input<UiLevel>('high');\n /** Appearance applied to the two buttons. */\n variant = input<ButtonVariant>('filled');\n /** Luminosité du fond de couleur sur lequel le nudger est posé (voir `ui-button.onColor`). */\n onColor = input<ButtonOnColor | null>(null);\n\n /** Accessible label of the decrement button. */\n decrementAriaLabel = input<string>('Diminuer');\n /** Accessible label of the increment button. */\n incrementAriaLabel = input<string>('Augmenter');\n /** FontAwesome icon name of the decrement button. */\n decrementIcon = input<string>('minus');\n /** FontAwesome icon name of the increment button. */\n incrementIcon = input<string>('plus');\n /** Optional display formatter for the value (e.g. `(v) => v + ' kg'`). */\n formatValue = input<(value: number) => string>();\n\n /** Emitted on each value change. */\n valueChange = output<number>();\n\n constructor() {\n super();\n // A11y safeguard: a stepper needs an accessible name.\n if (isDevMode()) {\n effect(() => {\n if (!this.ariaLabel() && !this.ariaLabelledBy()) {\n console.warn(\n '[ui-nudger] No accessible name: provide `ariaLabel` (or `ariaLabelledBy`).',\n );\n }\n });\n }\n }\n\n /** @ignore Effective numeric value (falls back to `defaultValue`). */\n protected readonly currentValue = computed(() => this.modelValue() ?? this.defaultValue());\n\n /** @ignore Bounds reached. */\n protected readonly atMin = computed(() => {\n const min = this.min();\n return min != null && this.currentValue() <= min;\n });\n protected readonly atMax = computed(() => {\n const max = this.max();\n return max != null && this.currentValue() >= max;\n });\n\n /** @ignore Per-button disabled state. */\n protected readonly decrementDisabled = computed(\n () => this.isDisabled() || this.readonly() || this.atMin(),\n );\n protected readonly incrementDisabled = computed(\n () => this.isDisabled() || this.readonly() || this.atMax(),\n );\n\n /** @ignore Value shown (custom formatter or plain number). */\n protected readonly displayValue = computed(() => {\n const v = this.currentValue();\n return this.formatValue()?.(v) ?? String(v);\n });\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-nudger'];\n if (this.size() !== 'default') c.push(`_${this.size()}`);\n if (this.isDisabled()) c.push('_disabled');\n if (this.isInvalid()) c.push('_invalid');\n return c.join(' ');\n });\n\n override writeValue(value: number | null): void {\n this.modelValue.set(value ?? undefined);\n }\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-nudger';\n }\n\n /** Increments the value by one `step` (clamped to `max`). */\n increment(): void {\n this.stepBy(1);\n }\n\n /** Decrements the value by one `step` (clamped to `min`). */\n decrement(): void {\n this.stepBy(-1);\n }\n\n /** @ignore Apply a signed step, clamp, emit. */\n protected stepBy(direction: 1 | -1): void {\n if (this.isDisabled() || this.readonly()) return;\n const next = this.clamp(this.currentValue() + direction * this.step());\n if (next === this.modelValue()) return;\n this.modelValue.set(next);\n this.emitChange(next);\n this.valueChange.emit(next);\n }\n\n /** @ignore Mark as touched when focus leaves the stepper. */\n protected onBlur(event: FocusEvent): void {\n // Ignore focus moving between the two internal buttons.\n const next = event.relatedTarget as Node | null;\n const root = event.currentTarget as HTMLElement;\n if (next && root.contains(next)) return;\n this.emitTouch();\n }\n\n /** @ignore Clamp a value into [min, max]. */\n private clamp(value: number): number {\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","<div\n [class]=\"classes()\"\n [id]=\"resolvedId()\"\n role=\"group\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n (focusout)=\"onBlur($event)\"\n>\n <ui-button\n class=\"ui-nudger-button\"\n [level]=\"level()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [onColor]=\"onColor()\"\n [icon]=\"decrementIcon()\"\n [ariaLabel]=\"decrementAriaLabel()\"\n [disabled]=\"decrementDisabled()\"\n [tabindex]=\"tabindex()\"\n iconOnly\n (buttonClick)=\"decrement()\"\n />\n\n <span class=\"ui-nudger-value\" aria-live=\"polite\" [attr.aria-hidden]=\"null\">{{\n displayValue()\n }}</span>\n\n <ui-button\n class=\"ui-nudger-button\"\n [level]=\"level()\"\n [size]=\"size()\"\n [variant]=\"variant()\"\n [onColor]=\"onColor()\"\n [icon]=\"incrementIcon()\"\n [ariaLabel]=\"incrementAriaLabel()\"\n [disabled]=\"incrementDisabled()\"\n [tabindex]=\"tabindex()\"\n iconOnly\n (buttonClick)=\"increment()\"\n />\n\n <!-- Hidden holder so a native `name` participates in form submission. -->\n @if (name(); as n) {\n <input type=\"hidden\" [name]=\"n\" [value]=\"currentValue()\" />\n }\n</div>\n","/*\n * Public API Surface of ui-kit/ui-nudger\n */\n\nexport * from './lib/ui-nudger';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAiBA;;;;;;;;;;;AAWG;AAQG,MAAO,QAAS,SAAQ,gBAAwB,CAAA;AAiCpD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;;QAhCT,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,YAAY,GAAG,KAAK,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EAAA,QAAA,EClCnG,4sCA6CA,EAAA,MAAA,EAAA,CAAA,ykCAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDdY,QAAQ,EAAA,QAAA,EAAA,WAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,WAAA,EAAA,MAAA,EAAA,OAAA,EAAA,SAAA,EAAA,SAAA,EAAA,MAAA,EAAA,MAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,aAAA,EAAA,UAAA,EAAA,SAAA,EAAA,UAAA,EAAA,QAAA,EAAA,UAAA,EAAA,aAAA,EAAA,cAAA,EAAA,qBAAA,EAAA,MAAA,EAAA,YAAA,EAAA,QAAA,EAAA,KAAA,CAAA,EAAA,OAAA,EAAA,CAAA,aAAA,EAAA,aAAA,EAAA,YAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAKP,QAAQ,EAAA,UAAA,EAAA,CAAA;kBAPpB,SAAS;+BACE,WAAW,EAAA,OAAA,EACZ,CAAC,QAAQ,CAAC,EAAA,SAAA,EAGR,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,MAAK,QAAS,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAA,QAAA,EAAA,4sCAAA,EAAA,MAAA,EAAA,CAAA,ykCAAA,CAAA,EAAA;;;AElCnG;;AAEG;;ACFH;;AAEG;;"}
|
|
@@ -68,12 +68,12 @@ class UiRadio extends BaseFieldControl {
|
|
|
68
68
|
this.emitTouch();
|
|
69
69
|
this.radioBlur.emit(event);
|
|
70
70
|
}
|
|
71
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
72
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
71
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: UiRadio, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
72
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: UiRadio, isStandalone: true, selector: "ui-radio", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { radioChange: "radioChange", radioFocus: "radioFocus", radioBlur: "radioBlur" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRadio), multi: true }], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<label [class]=\"classes()\">\n <span class=\"ui-radio-control\">\n <input\n #inputEl\n type=\"radio\"\n class=\"ui-radio-input\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\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-invalid]=\"isInvalid() ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"radioFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-radio-box\" aria-hidden=\"true\">\n <span class=\"ui-radio-dot\"></span>\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-radio-label\">\n <span class=\"ui-radio-text\">{{ label() }}</span>\n @if (required()) {\n <span class=\"ui-radio-required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n</label>\n", styles: [".ui-radio{display:inline-flex;align-items:center;gap:var(--ui-radio-gap, var(--ui-form-control-gap, var(--units-sm)));cursor:pointer;--_surface: var(--ui-form-control-surface, var(--form-high-surface-default));--_stroke: var(--ui-form-control-stroke, var(--form-high-stroke-default));--_content: var(--ui-form-control-marker-color, var(--form-high-content-checked))}.ui-radio:hover:not(._disabled):not(._readonly){--_surface: var(--ui-form-control-surface-hover, var(--form-high-surface-hover));--_stroke: var(--ui-form-control-stroke-hover, var(--form-high-stroke-hover));--ui-label-color: var(--form-high-content-hover)}.ui-radio._checked:not(._disabled),.ui-radio._indeterminate:not(._disabled){--_surface: var(--ui-form-control-surface-checked, var(--form-high-surface-checked));--_stroke: var(--ui-form-control-stroke-checked, var(--form-high-stroke-checked))}.ui-radio:has(.ui-radio-input:focus-visible){--_stroke: var(--ui-form-control-stroke-focus, var(--form-high-stroke-focused));--_focus-ring: rgb(from var(--ui-form-control-stroke-focus, var(--form-high-stroke-focused)) r g b / 50%)}.ui-radio._disabled{--_surface: var(--ui-form-control-surface-disabled, var(--form-high-surface-disabled));--_stroke: var(--ui-form-control-stroke-disabled, var(--form-high-stroke-disabled));--_content: var(--ui-form-control-marker-color-disabled, var(--form-high-content-disabled))}.ui-radio._invalid{--_surface: var(--ui-form-control-surface, var(--form-error-surface-default));--_stroke: var(--ui-form-control-stroke, var(--form-error-stroke-default));--_content: var(--ui-form-control-marker-color, var(--form-error-content-checked))}.ui-radio._invalid:hover:not(._disabled):not(._readonly){--_surface: var(--ui-form-control-surface-hover, var(--form-error-surface-hover));--_stroke: var(--ui-form-control-stroke-hover, var(--form-error-stroke-hover));--ui-label-color: var(--form-error-content-hover)}.ui-radio._invalid._checked:not(._disabled),.ui-radio._invalid._indeterminate:not(._disabled){--_surface: var(--ui-form-control-surface-checked, var(--form-error-surface-checked));--_stroke: var(--ui-form-control-stroke-checked, var(--form-error-stroke-checked))}.ui-radio._invalid:has(.ui-radio-input:focus-visible){--_stroke: var(--ui-form-control-stroke-focus, var(--form-error-stroke-focused));--_focus-ring: rgb(from var(--ui-form-control-stroke-focus, var(--form-error-stroke-focused)) r g b / 50%)}.ui-radio._invalid._disabled{--_surface: var(--ui-form-control-surface-disabled, var(--form-error-surface-disabled));--_stroke: var(--ui-form-control-stroke-disabled, var(--form-error-stroke-disabled));--_content: var(--ui-form-control-marker-color-disabled, var(--form-error-content-disabled))}.ui-radio-control{position:relative;display:inline-flex;width:var(--ui-radio-box-size, var(--ui-form-control-size, var(--size-components-2xs)));height:var(--ui-radio-box-size, var(--ui-form-control-size, var(--size-components-2xs)));flex-shrink:0}.ui-radio-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}.ui-radio-box{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%;background-color:var(--_surface);border:var(--ui-radio-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_stroke);border-radius:var(--ui-radio-box-radius, var(--radius-full));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-radio:has(.ui-radio-input:focus-visible) .ui-radio-box{box-shadow:0 0 0 var(--ui-radio-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--_focus-ring)}.ui-radio-dot{width:var(--ui-radio-dot-size, var(--units-md));height:var(--ui-radio-dot-size, var(--units-md));background-color:var(--_content);border-radius:var(--ui-radio-dot-radius, var(--radius-full));transform:scale(0);transition:transform var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-radio._checked .ui-radio-dot{transform:scale(1)}.ui-radio-label{display:inline-flex;align-items:center;gap:var(--ui-radio-label-gap, var(--units-2xs));font-family:var(--ui-radio-font-family, var(--fontfamily-base));font-size:var(--ui-radio-font-size, var(--size-typography-text-default));color:var(--ui-label-color, var(--form-high-content-default));cursor:inherit;-webkit-user-select:none;user-select:none}.ui-radio-required{color:var(--ui-radio-required-color, var(--informative-errorlow-content-default))}.ui-radio._disabled{cursor:not-allowed}.ui-radio._disabled .ui-radio-label{color:var(--ui-label-color-disabled, var(--form-high-content-disabled))}\n"] }); }
|
|
73
73
|
}
|
|
74
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: UiRadio, decorators: [{
|
|
75
75
|
type: Component,
|
|
76
|
-
args: [{ selector: 'ui-radio', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRadio), multi: true }], template: "<label [class]=\"classes()\">\n <span class=\"ui-radio-control\">\n <input\n #inputEl\n type=\"radio\"\n class=\"ui-radio-input\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\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-invalid]=\"isInvalid() ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"radioFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-radio-box\" aria-hidden=\"true\">\n <span class=\"ui-radio-dot\"></span>\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-radio-label\">\n <span class=\"ui-radio-text\">{{ label() }}</span>\n @if (required()) {\n <span class=\"ui-radio-required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n</label>\n", styles: [".ui-radio{display:inline-flex;align-items:center;gap:var(--ui-radio-gap, var(--ui-form-control-gap, var(--units-sm)));cursor:pointer;--_surface: var(--form-high-surface-default);--_stroke: var(--form-high-stroke-default);--_content: var(--form-high-content-checked)}.ui-radio:hover:not(._disabled):not(._readonly){--_surface: var(--form-high-surface-hover);--_stroke: var(--form-high-stroke-hover);--ui-label-color: var(--form-high-content-hover)}.ui-radio._checked:not(._disabled),.ui-radio._indeterminate:not(._disabled){--_surface: var(--form-high-surface-checked);--_stroke: var(--form-high-stroke-checked)}.ui-radio:has(.ui-radio-input:focus-visible){--_stroke: var(--form-high-stroke-focused);--_focus-ring: rgb(from var(--form-high-stroke-focused) r g b / 50%)}.ui-radio._disabled{--_surface: var(--form-high-surface-disabled);--_stroke: var(--form-high-stroke-disabled);--_content: var(--form-high-content-disabled)}.ui-radio._invalid{--_surface: var(--form-error-surface-default);--_stroke: var(--form-error-stroke-default);--_content: var(--form-error-content-checked)}.ui-radio._invalid:hover:not(._disabled):not(._readonly){--_surface: var(--form-error-surface-hover);--_stroke: var(--form-error-stroke-hover);--ui-label-color: var(--form-error-content-hover)}.ui-radio._invalid._checked:not(._disabled),.ui-radio._invalid._indeterminate:not(._disabled){--_surface: var(--form-error-surface-checked);--_stroke: var(--form-error-stroke-checked)}.ui-radio._invalid:has(.ui-radio-input:focus-visible){--_stroke: var(--form-error-stroke-focused);--_focus-ring: rgb(from var(--form-error-stroke-focused) r g b / 50%)}.ui-radio._invalid._disabled{--_surface: var(--form-error-surface-disabled);--_stroke: var(--form-error-stroke-disabled);--_content: var(--form-error-content-disabled)}.ui-radio-control{position:relative;display:inline-flex;width:var(--ui-radio-box-size, var(--ui-form-control-size, var(--size-components-2xs)));height:var(--ui-radio-box-size, var(--ui-form-control-size, var(--size-components-2xs)));flex-shrink:0}.ui-radio-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}.ui-radio-box{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%;background-color:var(--_surface);border:var(--ui-radio-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_stroke);border-radius:var(--ui-radio-box-radius, var(--radius-full));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-radio:has(.ui-radio-input:focus-visible) .ui-radio-box{box-shadow:0 0 0 var(--ui-radio-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--_focus-ring)}.ui-radio-dot{width:var(--ui-radio-dot-size, var(--units-md));height:var(--ui-radio-dot-size, var(--units-md));background-color:var(--_content);border-radius:var(--ui-radio-dot-radius, var(--radius-full));transform:scale(0);transition:transform var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-radio._checked .ui-radio-dot{transform:scale(1)}.ui-radio-label{display:inline-flex;align-items:center;gap:var(--ui-radio-label-gap, var(--units-2xs));font-family:var(--fontfamily-base);font-size:var(--ui-radio-font-size, var(--size-typography-text-default));color:var(--ui-label-color, var(--form-high-content-default));cursor:inherit;-webkit-user-select:none;user-select:none}.ui-radio-required{color:var(--informative-errorlow-content-default)}.ui-radio._disabled{cursor:not-allowed}.ui-radio._disabled .ui-radio-label{color:var(--form-high-content-disabled)}\n"] }]
|
|
76
|
+
args: [{ selector: 'ui-radio', providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRadio), multi: true }], template: "<label [class]=\"classes()\">\n <span class=\"ui-radio-control\">\n <input\n #inputEl\n type=\"radio\"\n class=\"ui-radio-input\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\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-invalid]=\"isInvalid() ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"radioFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-radio-box\" aria-hidden=\"true\">\n <span class=\"ui-radio-dot\"></span>\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-radio-label\">\n <span class=\"ui-radio-text\">{{ label() }}</span>\n @if (required()) {\n <span class=\"ui-radio-required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n</label>\n", styles: [".ui-radio{display:inline-flex;align-items:center;gap:var(--ui-radio-gap, var(--ui-form-control-gap, var(--units-sm)));cursor:pointer;--_surface: var(--ui-form-control-surface, var(--form-high-surface-default));--_stroke: var(--ui-form-control-stroke, var(--form-high-stroke-default));--_content: var(--ui-form-control-marker-color, var(--form-high-content-checked))}.ui-radio:hover:not(._disabled):not(._readonly){--_surface: var(--ui-form-control-surface-hover, var(--form-high-surface-hover));--_stroke: var(--ui-form-control-stroke-hover, var(--form-high-stroke-hover));--ui-label-color: var(--form-high-content-hover)}.ui-radio._checked:not(._disabled),.ui-radio._indeterminate:not(._disabled){--_surface: var(--ui-form-control-surface-checked, var(--form-high-surface-checked));--_stroke: var(--ui-form-control-stroke-checked, var(--form-high-stroke-checked))}.ui-radio:has(.ui-radio-input:focus-visible){--_stroke: var(--ui-form-control-stroke-focus, var(--form-high-stroke-focused));--_focus-ring: rgb(from var(--ui-form-control-stroke-focus, var(--form-high-stroke-focused)) r g b / 50%)}.ui-radio._disabled{--_surface: var(--ui-form-control-surface-disabled, var(--form-high-surface-disabled));--_stroke: var(--ui-form-control-stroke-disabled, var(--form-high-stroke-disabled));--_content: var(--ui-form-control-marker-color-disabled, var(--form-high-content-disabled))}.ui-radio._invalid{--_surface: var(--ui-form-control-surface, var(--form-error-surface-default));--_stroke: var(--ui-form-control-stroke, var(--form-error-stroke-default));--_content: var(--ui-form-control-marker-color, var(--form-error-content-checked))}.ui-radio._invalid:hover:not(._disabled):not(._readonly){--_surface: var(--ui-form-control-surface-hover, var(--form-error-surface-hover));--_stroke: var(--ui-form-control-stroke-hover, var(--form-error-stroke-hover));--ui-label-color: var(--form-error-content-hover)}.ui-radio._invalid._checked:not(._disabled),.ui-radio._invalid._indeterminate:not(._disabled){--_surface: var(--ui-form-control-surface-checked, var(--form-error-surface-checked));--_stroke: var(--ui-form-control-stroke-checked, var(--form-error-stroke-checked))}.ui-radio._invalid:has(.ui-radio-input:focus-visible){--_stroke: var(--ui-form-control-stroke-focus, var(--form-error-stroke-focused));--_focus-ring: rgb(from var(--ui-form-control-stroke-focus, var(--form-error-stroke-focused)) r g b / 50%)}.ui-radio._invalid._disabled{--_surface: var(--ui-form-control-surface-disabled, var(--form-error-surface-disabled));--_stroke: var(--ui-form-control-stroke-disabled, var(--form-error-stroke-disabled));--_content: var(--ui-form-control-marker-color-disabled, var(--form-error-content-disabled))}.ui-radio-control{position:relative;display:inline-flex;width:var(--ui-radio-box-size, var(--ui-form-control-size, var(--size-components-2xs)));height:var(--ui-radio-box-size, var(--ui-form-control-size, var(--size-components-2xs)));flex-shrink:0}.ui-radio-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit}.ui-radio-box{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:100%;height:100%;background-color:var(--_surface);border:var(--ui-radio-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) solid var(--_stroke);border-radius:var(--ui-radio-box-radius, var(--radius-full));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-radio:has(.ui-radio-input:focus-visible) .ui-radio-box{box-shadow:0 0 0 var(--ui-radio-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--_focus-ring)}.ui-radio-dot{width:var(--ui-radio-dot-size, var(--units-md));height:var(--ui-radio-dot-size, var(--units-md));background-color:var(--_content);border-radius:var(--ui-radio-dot-radius, var(--radius-full));transform:scale(0);transition:transform var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-radio._checked .ui-radio-dot{transform:scale(1)}.ui-radio-label{display:inline-flex;align-items:center;gap:var(--ui-radio-label-gap, var(--units-2xs));font-family:var(--ui-radio-font-family, var(--fontfamily-base));font-size:var(--ui-radio-font-size, var(--size-typography-text-default));color:var(--ui-label-color, var(--form-high-content-default));cursor:inherit;-webkit-user-select:none;user-select:none}.ui-radio-required{color:var(--ui-radio-required-color, var(--informative-errorlow-content-default))}.ui-radio._disabled{cursor:not-allowed}.ui-radio._disabled .ui-radio-label{color:var(--ui-label-color-disabled, var(--form-high-content-disabled))}\n"] }]
|
|
77
77
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], radioChange: [{ type: i0.Output, args: ["radioChange"] }], radioFocus: [{ type: i0.Output, args: ["radioFocus"] }], radioBlur: [{ type: i0.Output, args: ["radioBlur"] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }] } });
|
|
78
78
|
|
|
79
79
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4sh-ui-kit-forms-ui-radio.mjs","sources":["../../../projects/ui-kit/forms/ui-radio/src/lib/ui-radio.ts","../../../projects/ui-kit/forms/ui-radio/src/lib/ui-radio.html","../../../projects/ui-kit/forms/ui-radio/src/public-api.ts","../../../projects/ui-kit/forms/ui-radio/src/4sh-ui-kit-forms-ui-radio.ts"],"sourcesContent":["import {\n Component,\n computed,\n ElementRef,\n forwardRef,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseFieldControl } from '@4sh/ui-kit/forms';\n\n/**\n * ui-radio — headless radio button built on a real native <input type=\"radio\">.\n *\n * Each ui-radio holds one `value`; the group is formed by binding every member\n * to the same form control (same `formControlName` / `[(ngModel)]`) AND giving\n * them the same `name` (native grouping = roving arrow-key navigation for free).\n * The one whose `value` equals the model value is checked.\n *\n * Interactive states (hover/focus/disabled/checked) are pure CSS driven by\n * `form.*` design tokens.\n */\n@Component({\n selector: 'ui-radio',\n templateUrl: './ui-radio.html',\n styleUrl: './ui-radio.scss',\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRadio), multi: true }],\n})\nexport class UiRadio<T = unknown> extends BaseFieldControl<T> {\n /** Value carried by this radio (the model takes it when selected). */\n value = input.required<T>();\n /** Label displayed next to the radio (clicking it selects it). */\n label = input<string>();\n\n /** Emitted when this radio becomes selected by user interaction, with its value. */\n radioChange = output<T>();\n /** Emitted when the native input receives focus. */\n radioFocus = output<FocusEvent>();\n /** Emitted when the native input loses focus. */\n radioBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n\n /** @ignore */\n protected readonly checked = computed(() => this.modelValue() === this.value());\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-radio'];\n if (this.checked()) c.push('_checked');\n if (this.isDisabled()) c.push('_disabled');\n if (this.isInvalid()) c.push('_invalid');\n return c.join(' ');\n });\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-radio';\n }\n\n /** Focus the native input programmatically. */\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** @ignore Native change fires only when this radio becomes checked. */\n protected onNativeChange(): void {\n const value = this.value();\n this.modelValue.set(value);\n this.emitChange(value);\n this.radioChange.emit(value);\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.radioBlur.emit(event);\n }\n}\n","<label [class]=\"classes()\">\n <span class=\"ui-radio-control\">\n <input\n #inputEl\n type=\"radio\"\n class=\"ui-radio-input\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\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-invalid]=\"isInvalid() ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"radioFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-radio-box\" aria-hidden=\"true\">\n <span class=\"ui-radio-dot\"></span>\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-radio-label\">\n <span class=\"ui-radio-text\">{{ label() }}</span>\n @if (required()) {\n <span class=\"ui-radio-required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n</label>\n","/*\n * Public API Surface of ui-kit/ui-radio\n */\n\nexport * from './lib/ui-radio';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAYA;;;;;;;;;;AAUG;AAOG,MAAO,OAAqB,SAAQ,gBAAmB,CAAA;AAN7D,IAAA,WAAA,GAAA;;;QAQE,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ;kFAAK;;AAE3B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK;6FAAU;;QAGvB,IAAA,CAAA,WAAW,GAAG,MAAM,EAAK;;QAEzB,IAAA,CAAA,UAAU,GAAG,MAAM,EAAc;;QAEjC,IAAA,CAAA,SAAS,GAAG,MAAM,EAAc;;AAGf,QAAA,IAAA,CAAA,OAAO,GAAG,SAAS,CAAC,QAAQ,CAA+B,SAAS;oFAAC;;AAGnE,QAAA,IAAA,CAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE;oFAAC;;AAG5D,QAAA,IAAA,CAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACzC,YAAA,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC;YACtB,IAAI,IAAI,CAAC,OAAO,EAAE;AAAE,gBAAA,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;YACtC,IAAI,IAAI,CAAC,UAAU,EAAE;AAAE,gBAAA,CAAC,CAAC,IAAI,CAAC,WAAW,CAA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AAA,EAAA,WAAA,EAAA,aAAA,EAAA,UAAA,EAAA,YAAA,EAAA,SAAA,EAAA,WAAA,EAAA,EAAA,SAAA,EAFP,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,MAAM,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,SAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,SAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC3BlG,6gCAiCA,EAAA,MAAA,EAAA,CAAA,
|
|
1
|
+
{"version":3,"file":"4sh-ui-kit-forms-ui-radio.mjs","sources":["../../../projects/ui-kit/forms/ui-radio/src/lib/ui-radio.ts","../../../projects/ui-kit/forms/ui-radio/src/lib/ui-radio.html","../../../projects/ui-kit/forms/ui-radio/src/public-api.ts","../../../projects/ui-kit/forms/ui-radio/src/4sh-ui-kit-forms-ui-radio.ts"],"sourcesContent":["import {\n Component,\n computed,\n ElementRef,\n forwardRef,\n input,\n output,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { BaseFieldControl } from '@4sh/ui-kit/forms';\n\n/**\n * ui-radio — headless radio button built on a real native <input type=\"radio\">.\n *\n * Each ui-radio holds one `value`; the group is formed by binding every member\n * to the same form control (same `formControlName` / `[(ngModel)]`) AND giving\n * them the same `name` (native grouping = roving arrow-key navigation for free).\n * The one whose `value` equals the model value is checked.\n *\n * Interactive states (hover/focus/disabled/checked) are pure CSS driven by\n * `form.*` design tokens.\n */\n@Component({\n selector: 'ui-radio',\n templateUrl: './ui-radio.html',\n styleUrl: './ui-radio.scss',\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRadio), multi: true }],\n})\nexport class UiRadio<T = unknown> extends BaseFieldControl<T> {\n /** Value carried by this radio (the model takes it when selected). */\n value = input.required<T>();\n /** Label displayed next to the radio (clicking it selects it). */\n label = input<string>();\n\n /** Emitted when this radio becomes selected by user interaction, with its value. */\n radioChange = output<T>();\n /** Emitted when the native input receives focus. */\n radioFocus = output<FocusEvent>();\n /** Emitted when the native input loses focus. */\n radioBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n\n /** @ignore */\n protected readonly checked = computed(() => this.modelValue() === this.value());\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-radio'];\n if (this.checked()) c.push('_checked');\n if (this.isDisabled()) c.push('_disabled');\n if (this.isInvalid()) c.push('_invalid');\n return c.join(' ');\n });\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-radio';\n }\n\n /** Focus the native input programmatically. */\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** @ignore Native change fires only when this radio becomes checked. */\n protected onNativeChange(): void {\n const value = this.value();\n this.modelValue.set(value);\n this.emitChange(value);\n this.radioChange.emit(value);\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.radioBlur.emit(event);\n }\n}\n","<label [class]=\"classes()\">\n <span class=\"ui-radio-control\">\n <input\n #inputEl\n type=\"radio\"\n class=\"ui-radio-input\"\n [id]=\"resolvedId()\"\n [checked]=\"checked()\"\n [disabled]=\"isDisabled()\"\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-invalid]=\"isInvalid() ? 'true' : null\"\n (change)=\"onNativeChange()\"\n (focus)=\"radioFocus.emit($event)\"\n (blur)=\"onBlur($event)\"\n />\n <span class=\"ui-radio-box\" aria-hidden=\"true\">\n <span class=\"ui-radio-dot\"></span>\n </span>\n </span>\n\n @if (label()) {\n <span class=\"ui-radio-label\">\n <span class=\"ui-radio-text\">{{ label() }}</span>\n @if (required()) {\n <span class=\"ui-radio-required\" aria-hidden=\"true\">*</span>\n }\n </span>\n }\n</label>\n","/*\n * Public API Surface of ui-kit/ui-radio\n */\n\nexport * from './lib/ui-radio';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAYA;;;;;;;;;;AAUG;AAOG,MAAO,OAAqB,SAAQ,gBAAmB,CAAA;AAN7D,IAAA,WAAA,GAAA;;;QAQE,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,QAAQ;kFAAK;;AAE3B,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK;6FAAU;;QAGvB,IAAA,CAAA,WAAW,GAAG,MAAM,EAAK;;QAEzB,IAAA,CAAA,UAAU,GAAG,MAAM,EAAc;;QAEjC,IAAA,CAAA,SAAS,GAAG,MAAM,EAAc;;AAGf,QAAA,IAAA,CAAA,OAAO,GAAG,SAAS,CAAC,QAAQ,CAA+B,SAAS;oFAAC;;AAGnE,QAAA,IAAA,CAAA,OAAO,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,UAAU,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE;oFAAC;;AAG5D,QAAA,IAAA,CAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;AACzC,YAAA,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC;YACtB,IAAI,IAAI,CAAC,OAAO,EAAE;AAAE,gBAAA,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;YACtC,IAAI,IAAI,CAAC,UAAU,EAAE;AAAE,gBAAA,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;YAC1C,IAAI,IAAI,CAAC,SAAS,EAAE;AAAE,gBAAA,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;AACxC,YAAA,OAAO,CAAC,CAAC,IAAI,CAAC,GAA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AAE,WAAW,EAAE,UAAU,CAAC,MAAM,OAAO,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,SAAA,EAAA,KAAA,EAAA,IAAA,EAAA,SAAA,EAAA,CAAA,SAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EC3BlG,6gCAiCA,EAAA,MAAA,EAAA,CAAA,w6JAAA,CAAA,EAAA,CAAA,CAAA;;2FDJa,OAAO,EAAA,UAAA,EAAA,CAAA;kBANnB,SAAS;+BACE,UAAU,EAAA,SAAA,EAGT,CAAC,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAA,QAAA,EAAA,6gCAAA,EAAA,MAAA,EAAA,CAAA,w6JAAA,CAAA,EAAA;maAgBpB,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE3CvF;;AAEG;;ACFH;;AAEG;;"}
|
|
@@ -161,12 +161,12 @@ class UiRating extends BaseFieldControl {
|
|
|
161
161
|
this.emitTouch();
|
|
162
162
|
this.ratingBlur.emit(event);
|
|
163
163
|
}
|
|
164
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
165
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
164
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: UiRating, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
165
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: UiRating, isStandalone: true, selector: "ui-rating", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, stars: { classPropertyName: "stars", publicName: "stars", isSignal: true, isRequired: false, transformFunction: null }, allowHalf: { classPropertyName: "allowHalf", publicName: "allowHalf", isSignal: true, isRequired: false, transformFunction: null }, cancel: { classPropertyName: "cancel", publicName: "cancel", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { rateChange: "rateChange", ratingFocus: "ratingFocus", ratingBlur: "ratingBlur" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRating), multi: true }], queries: [{ propertyName: "onIconTemplate", first: true, predicate: ["onIcon"], descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "offIconTemplate", first: true, predicate: ["offIcon"], descendants: true, read: TemplateRef, isSignal: true }], viewQueries: [{ propertyName: "inputEl", first: true, predicate: ["inputEl"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"classes()\" (mouseleave)=\"clearHover()\">\n <!-- autofocus is a deliberate opt-in input of the component (default false). -->\n <!-- eslint-disable @angular-eslint/template/no-autofocus -->\n <input\n #inputEl\n type=\"range\"\n class=\"ui-rating-input\"\n min=\"0\"\n [max]=\"stars()\"\n [step]=\"step()\"\n [id]=\"resolvedId()\"\n [name]=\"name()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.autofocus]=\"autofocus() ? true : null\"\n [attr.readonly]=\"readonly() ? true : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [tabindex]=\"tabindex() ?? 0\"\n [value]=\"currentValue()\"\n (input)=\"onNativeChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- eslint-enable @angular-eslint/template/no-autofocus -->\n\n <div class=\"ui-rating-stars\">\n @for (star of starList(); track star.index) {\n <!-- Purely visual stars: focus and keyboard are carried by\n the native <input type=\"range\"> above. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-rating-icon\"\n (click)=\"rate(star.index, $event)\"\n (mousemove)=\"setHover(star.index, $event)\"\n >\n <!-- The \"on\" icon is stacked over the \"off\" one and clipped to `fill`:\n a half star works with any icon family and any projected template. -->\n <span class=\"ui-rating-icon-stack\">\n <span class=\"ui-rating-icon-base\">\n <ng-container\n *ngTemplateOutlet=\"\n offIconTemplate() || defaultOffIcon;\n context: { $implicit: star.index, active: star.active, fill: star.fill }\n \"\n />\n </span>\n @if (star.fill > 0) {\n <span class=\"ui-rating-icon-fill\" [style.--ui-rating-fill]=\"star.fill\">\n <ng-container\n *ngTemplateOutlet=\"\n onIconTemplate() || defaultOnIcon;\n context: { $implicit: star.index, active: star.active, fill: star.fill }\n \"\n />\n </span>\n }\n </span>\n </div>\n }\n </div>\n</div>\n\n<ng-template #defaultOnIcon>\n <ui-icon name=\"star\" type=\"solid\" [size]=\"size()\" />\n</ng-template>\n\n<ng-template #defaultOffIcon>\n <ui-icon name=\"star\" type=\"outline\" [size]=\"size()\" />\n</ng-template>\n", styles: [".ui-rating{position:relative;display:inline-flex;align-items:center}.ui-rating-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit;pointer-events:none}.ui-rating-stars{display:flex;gap:var(--ui-rating-gap, var(--units-2xs))}.ui-rating._size-sm .ui-rating-stars{gap:var(--ui-rating-gap-sm, var(--units-2xs))}.ui-rating._size-md .ui-rating-stars{gap:var(--ui-rating-gap-md, var(--units-2xs))}.ui-rating._size-default .ui-rating-stars{gap:var(--ui-rating-gap, var(--units-2xs))}.ui-rating._size-lg .ui-rating-stars{gap:var(--ui-rating-gap-lg, var(--units-2xs))}.ui-rating._size-xl .ui-rating-stars{gap:var(--ui-rating-gap-xl, var(--units-2xs))}.ui-rating._vertical .ui-rating-stars{flex-direction:column}.ui-rating-icon{display:flex;align-items:center;justify-content:center;padding:var(--ui-rating-icon-padding, var(--units-2xs));cursor:pointer;border-radius:var(--ui-rating-icon-radius, var(--radius-full));pointer-events:auto}.ui-rating-icon-stack{position:relative;display:flex;line-height:1;color:var(--ui-rating-icon-color, var(--form-low-content-default));transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-rating-icon-base,.ui-rating-icon-fill{display:flex;align-items:center;justify-content:center}.ui-rating-icon-fill{position:absolute;inset:0;color:var(--ui-rating-icon-fill-color, var(--form-high-content-checked));clip-path:inset(0 calc((1 - var(--ui-rating-fill, 1)) * 100%) 0 0);transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-rating._disabled,.ui-rating._disabled .ui-rating-icon{cursor:not-allowed}.ui-rating._disabled .ui-rating-icon-stack{color:var(--ui-rating-icon-color-disabled, var(--form-low-content-disabled))}.ui-rating._disabled .ui-rating-icon-fill{color:var(--ui-rating-icon-fill-color-disabled, var(--form-high-content-disabled))}.ui-rating._readonly .ui-rating-icon{cursor:default}.ui-rating._invalid .ui-rating-icon-stack{color:var(--ui-rating-icon-color-invalid, var(--form-error-content-default))}.ui-rating._invalid .ui-rating-icon-fill{color:var(--ui-rating-icon-fill-color-invalid, var(--form-error-content-checked))}:host-context([dir=rtl]) .ui-rating-icon-fill{clip-path:inset(0 0 0 calc((1 - var(--ui-rating-fill, 1)) * 100%))}\n"], dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
166
166
|
}
|
|
167
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
167
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: UiRating, decorators: [{
|
|
168
168
|
type: Component,
|
|
169
|
-
args: [{ selector: 'ui-rating', standalone: true, imports: [UiIcon, NgTemplateOutlet], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRating), multi: true }], template: "<div [class]=\"classes()\" (mouseleave)=\"clearHover()\">\n <!-- autofocus is a deliberate opt-in input of the component (default false). -->\n <!-- eslint-disable @angular-eslint/template/no-autofocus -->\n <input\n #inputEl\n type=\"range\"\n class=\"ui-rating-input\"\n min=\"0\"\n [max]=\"stars()\"\n [step]=\"step()\"\n [id]=\"resolvedId()\"\n [name]=\"name()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.autofocus]=\"autofocus() ? true : null\"\n [attr.readonly]=\"readonly() ? true : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [tabindex]=\"tabindex() ?? 0\"\n [value]=\"currentValue()\"\n (input)=\"onNativeChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- eslint-enable @angular-eslint/template/no-autofocus -->\n\n <div class=\"ui-rating-stars\">\n @for (star of starList(); track star.index) {\n <!-- Purely visual stars: focus and keyboard are carried by\n the native <input type=\"range\"> above. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-rating-icon\"\n (click)=\"rate(star.index, $event)\"\n (mousemove)=\"setHover(star.index, $event)\"\n >\n <!-- The \"on\" icon is stacked over the \"off\" one and clipped to `fill`:\n a half star works with any icon family and any projected template. -->\n <span class=\"ui-rating-icon-stack\">\n <span class=\"ui-rating-icon-base\">\n <ng-container\n *ngTemplateOutlet=\"\n offIconTemplate() || defaultOffIcon;\n context: { $implicit: star.index, active: star.active, fill: star.fill }\n \"\n />\n </span>\n @if (star.fill > 0) {\n <span class=\"ui-rating-icon-fill\" [style.--ui-rating-fill]=\"star.fill\">\n <ng-container\n *ngTemplateOutlet=\"\n onIconTemplate() || defaultOnIcon;\n context: { $implicit: star.index, active: star.active, fill: star.fill }\n \"\n />\n </span>\n }\n </span>\n </div>\n }\n </div>\n</div>\n\n<ng-template #defaultOnIcon>\n <ui-icon name=\"star\" type=\"solid\" [size]=\"size()\" />\n</ng-template>\n\n<ng-template #defaultOffIcon>\n <ui-icon name=\"star\" type=\"outline\" [size]=\"size()\" />\n</ng-template>\n", styles: [".ui-rating{position:relative;display:inline-flex;align-items:center}.ui-rating-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit;pointer-events:none}.ui-rating-stars{display:flex;gap:var(--ui-rating-gap, var(--units-2xs))}.ui-rating._size-sm .ui-rating-stars{gap:var(--ui-rating-gap-sm, var(--units-2xs))}.ui-rating._size-md .ui-rating-stars{gap:var(--ui-rating-gap-md, var(--units-2xs))}.ui-rating._size-default .ui-rating-stars{gap:var(--ui-rating-gap, var(--units-2xs))}.ui-rating._size-lg .ui-rating-stars{gap:var(--ui-rating-gap-lg, var(--units-2xs))}.ui-rating._size-xl .ui-rating-stars{gap:var(--ui-rating-gap-xl, var(--units-2xs))}.ui-rating._vertical .ui-rating-stars{flex-direction:column}.ui-rating-icon{display:flex;align-items:center;justify-content:center;padding:var(--ui-rating-icon-padding, var(--units-2xs));cursor:pointer;border-radius:var(--ui-rating-icon-radius, var(--radius-full));pointer-events:auto}.ui-rating-icon-stack{position:relative;display:flex;line-height:1;color:var(--ui-rating-icon-color, var(--form-low-content-default));transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-rating-icon-base,.ui-rating-icon-fill{display:flex;align-items:center;justify-content:center}.ui-rating-icon-fill{position:absolute;inset:0;color:var(--ui-rating-icon-fill-color, var(--form-high-content-checked));clip-path:inset(0 calc((1 - var(--ui-rating-fill, 1)) * 100%) 0 0);transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-rating._disabled,.ui-rating._disabled .ui-rating-icon{cursor:not-allowed}.ui-rating._disabled .ui-rating-icon-stack{color:var(--form-low-content-disabled)}.ui-rating._disabled .ui-rating-icon-fill{color:var(--form-high-content-disabled)}.ui-rating._readonly .ui-rating-icon{cursor:default}.ui-rating._invalid .ui-rating-icon-stack{color:var(--form-error-content-default)}.ui-rating._invalid .ui-rating-icon-fill{color:var(--form-error-content-checked)}:host-context([dir=rtl]) .ui-rating-icon-fill{clip-path:inset(0 0 0 calc((1 - var(--ui-rating-fill, 1)) * 100%))}\n"] }]
|
|
169
|
+
args: [{ selector: 'ui-rating', standalone: true, imports: [UiIcon, NgTemplateOutlet], providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRating), multi: true }], template: "<div [class]=\"classes()\" (mouseleave)=\"clearHover()\">\n <!-- autofocus is a deliberate opt-in input of the component (default false). -->\n <!-- eslint-disable @angular-eslint/template/no-autofocus -->\n <input\n #inputEl\n type=\"range\"\n class=\"ui-rating-input\"\n min=\"0\"\n [max]=\"stars()\"\n [step]=\"step()\"\n [id]=\"resolvedId()\"\n [name]=\"name()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.autofocus]=\"autofocus() ? true : null\"\n [attr.readonly]=\"readonly() ? true : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [tabindex]=\"tabindex() ?? 0\"\n [value]=\"currentValue()\"\n (input)=\"onNativeChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- eslint-enable @angular-eslint/template/no-autofocus -->\n\n <div class=\"ui-rating-stars\">\n @for (star of starList(); track star.index) {\n <!-- Purely visual stars: focus and keyboard are carried by\n the native <input type=\"range\"> above. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-rating-icon\"\n (click)=\"rate(star.index, $event)\"\n (mousemove)=\"setHover(star.index, $event)\"\n >\n <!-- The \"on\" icon is stacked over the \"off\" one and clipped to `fill`:\n a half star works with any icon family and any projected template. -->\n <span class=\"ui-rating-icon-stack\">\n <span class=\"ui-rating-icon-base\">\n <ng-container\n *ngTemplateOutlet=\"\n offIconTemplate() || defaultOffIcon;\n context: { $implicit: star.index, active: star.active, fill: star.fill }\n \"\n />\n </span>\n @if (star.fill > 0) {\n <span class=\"ui-rating-icon-fill\" [style.--ui-rating-fill]=\"star.fill\">\n <ng-container\n *ngTemplateOutlet=\"\n onIconTemplate() || defaultOnIcon;\n context: { $implicit: star.index, active: star.active, fill: star.fill }\n \"\n />\n </span>\n }\n </span>\n </div>\n }\n </div>\n</div>\n\n<ng-template #defaultOnIcon>\n <ui-icon name=\"star\" type=\"solid\" [size]=\"size()\" />\n</ng-template>\n\n<ng-template #defaultOffIcon>\n <ui-icon name=\"star\" type=\"outline\" [size]=\"size()\" />\n</ng-template>\n", styles: [".ui-rating{position:relative;display:inline-flex;align-items:center}.ui-rating-input{position:absolute;inset:0;z-index:1;width:100%;height:100%;margin:0;opacity:0;cursor:inherit;pointer-events:none}.ui-rating-stars{display:flex;gap:var(--ui-rating-gap, var(--units-2xs))}.ui-rating._size-sm .ui-rating-stars{gap:var(--ui-rating-gap-sm, var(--units-2xs))}.ui-rating._size-md .ui-rating-stars{gap:var(--ui-rating-gap-md, var(--units-2xs))}.ui-rating._size-default .ui-rating-stars{gap:var(--ui-rating-gap, var(--units-2xs))}.ui-rating._size-lg .ui-rating-stars{gap:var(--ui-rating-gap-lg, var(--units-2xs))}.ui-rating._size-xl .ui-rating-stars{gap:var(--ui-rating-gap-xl, var(--units-2xs))}.ui-rating._vertical .ui-rating-stars{flex-direction:column}.ui-rating-icon{display:flex;align-items:center;justify-content:center;padding:var(--ui-rating-icon-padding, var(--units-2xs));cursor:pointer;border-radius:var(--ui-rating-icon-radius, var(--radius-full));pointer-events:auto}.ui-rating-icon-stack{position:relative;display:flex;line-height:1;color:var(--ui-rating-icon-color, var(--form-low-content-default));transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-rating-icon-base,.ui-rating-icon-fill{display:flex;align-items:center;justify-content:center}.ui-rating-icon-fill{position:absolute;inset:0;color:var(--ui-rating-icon-fill-color, var(--form-high-content-checked));clip-path:inset(0 calc((1 - var(--ui-rating-fill, 1)) * 100%) 0 0);transition:color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout))}.ui-rating._disabled,.ui-rating._disabled .ui-rating-icon{cursor:not-allowed}.ui-rating._disabled .ui-rating-icon-stack{color:var(--ui-rating-icon-color-disabled, var(--form-low-content-disabled))}.ui-rating._disabled .ui-rating-icon-fill{color:var(--ui-rating-icon-fill-color-disabled, var(--form-high-content-disabled))}.ui-rating._readonly .ui-rating-icon{cursor:default}.ui-rating._invalid .ui-rating-icon-stack{color:var(--ui-rating-icon-color-invalid, var(--form-error-content-default))}.ui-rating._invalid .ui-rating-icon-fill{color:var(--ui-rating-icon-fill-color-invalid, var(--form-error-content-checked))}:host-context([dir=rtl]) .ui-rating-icon-fill{clip-path:inset(0 0 0 calc((1 - var(--ui-rating-fill, 1)) * 100%))}\n"] }]
|
|
170
170
|
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], stars: [{ type: i0.Input, args: [{ isSignal: true, alias: "stars", required: false }] }], allowHalf: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowHalf", required: false }] }], cancel: [{ type: i0.Input, args: [{ isSignal: true, alias: "cancel", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], onIconTemplate: [{ type: i0.ContentChild, args: ['onIcon', { ...{ read: (TemplateRef) }, isSignal: true }] }], offIconTemplate: [{ type: i0.ContentChild, args: ['offIcon', { ...{ read: (TemplateRef) }, isSignal: true }] }], rateChange: [{ type: i0.Output, args: ["rateChange"] }], ratingFocus: [{ type: i0.Output, args: ["ratingFocus"] }], ratingBlur: [{ type: i0.Output, args: ["ratingBlur"] }], inputEl: [{ type: i0.ViewChild, args: ['inputEl', { isSignal: true }] }] } });
|
|
171
171
|
|
|
172
172
|
/*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"4sh-ui-kit-forms-ui-rating.mjs","sources":["../../../projects/ui-kit/forms/ui-rating/src/lib/ui-rating.ts","../../../projects/ui-kit/forms/ui-rating/src/lib/ui-rating.html","../../../projects/ui-kit/forms/ui-rating/src/public-api.ts","../../../projects/ui-kit/forms/ui-rating/src/4sh-ui-kit-forms-ui-rating.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n contentChild,\n ElementRef,\n forwardRef,\n input,\n numberAttribute,\n output,\n signal,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { BaseFieldControl } from '@4sh/ui-kit/forms';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/base/ui-icon';\n\nexport interface UiRatingIconContext {\n /** The current star value (1-based index). */\n $implicit: number;\n /** Whether this star is active (value <= current rating). */\n active: boolean;\n /** Filled portion of this star, `0` to `1` (hover preview included). */\n fill: number;\n}\n\n/**\n * ui-rating — headless rating component built over a native <input type=\"range\">.\n */\n@Component({\n selector: 'ui-rating',\n templateUrl: './ui-rating.html',\n styleUrl: './ui-rating.scss',\n standalone: true,\n imports: [UiIcon, NgTemplateOutlet],\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRating), multi: true }],\n})\nexport class UiRating extends BaseFieldControl<number | null> {\n /** Size of the rating stars. */\n size = input<UiIconSize>('default');\n /** Number of stars to display. */\n stars = input(5, { transform: numberAttribute });\n /** Enables half-star notation: the value moves by 0.5 (click on a half, arrow keys). */\n allowHalf = input(false, { transform: booleanAttribute });\n /** Allows clearing the rating by clicking the current value. */\n cancel = input(true, { transform: booleanAttribute });\n /** Native autofocus attribute. */\n autofocus = input(false, { transform: booleanAttribute });\n /** Orientation of the rating control. */\n orientation = input<'horizontal' | 'vertical'>('horizontal');\n\n /** Custom template for active stars. */\n onIconTemplate = contentChild('onIcon', { read: TemplateRef<UiRatingIconContext> });\n /** Custom template for inactive stars. */\n offIconTemplate = contentChild('offIcon', { read: TemplateRef<UiRatingIconContext> });\n\n /** Emitted when rating changes (`null` = cleared / not rated). */\n rateChange = output<number | null>();\n /** Emitted when the native input receives focus. */\n ratingFocus = output<FocusEvent>();\n /** Emitted when the native input loses focus. */\n ratingBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n /** @ignore Redeclared over the base signal: `null` = not rated (never `undefined`). */\n protected override readonly modelValue = signal<number | null>(null);\n /** @ignore */\n protected readonly hoverValue = signal<number>(0);\n /** @ignore Selection granularity: one star, or a half when `allowHalf`. */\n protected readonly step = computed(() => (this.allowHalf() ? 0.5 : 1));\n /**\n * @ignore Numeric value used for display comparisons (`null` renders as 0 stars).\n * Floored to the granularity so an out-of-step value (an average pushed by the\n * host, e.g. 4.3) never renders a fill the user could not have selected.\n */\n protected readonly currentValue = computed(() => {\n const step = this.step();\n return Math.floor(Math.max(0, this.modelValue() ?? 0) / step) * step;\n });\n\n /** @ignore Per-star render model; `fill` (0 → 1) drives the clipped overlay. */\n protected readonly starList = computed(() => {\n const value = this.currentValue();\n const preview = this.hoverValue() || value;\n return Array.from({ length: this.stars() }, (_, i) => ({\n index: i + 1,\n fill: Math.min(1, Math.max(0, preview - i)),\n active: i + 1 <= value,\n }));\n });\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-rating', `_size-${this.size()}`];\n if (this.orientation() === 'vertical') c.push('_vertical');\n if (this.isDisabled()) c.push('_disabled');\n if (this.readonly()) c.push('_readonly');\n if (this.isInvalid()) c.push('_invalid');\n return c.join(' ');\n });\n\n override writeValue(value: number | null): void {\n this.modelValue.set(value ?? null);\n }\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-rating';\n }\n\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** @ignore Native change is triggered by keyboard or programmatic native actions */\n protected onNativeChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n const value = parseFloat(input.value);\n if (this.isDisabled() || this.readonly() || Number.isNaN(value)) {\n // Revert the native range so its value stays in sync with the model.\n input.value = String(this.currentValue());\n return;\n }\n // The range's 0 means \"not rated\" → null at the public boundary.\n this.updateValue(value === 0 ? null : value);\n }\n\n /** @ignore */\n protected rate(star: number, event: MouseEvent): void {\n if (this.isDisabled() || this.readonly()) return;\n\n const value = this.pointedValue(star, event);\n let newValue: number | null = value;\n if (this.cancel() && this.modelValue() === value) {\n newValue = null;\n }\n\n this.updateValue(newValue);\n this.focus();\n }\n\n /**\n * @ignore Value pointed at by the cursor: the star itself, or its first half\n * when `allowHalf`. Reads the writing direction so the \"first half\" stays the\n * leading one in RTL, like the clip applied by the stylesheet.\n */\n private pointedValue(star: number, event: MouseEvent): number {\n if (!this.allowHalf()) return star;\n const el = event.currentTarget as HTMLElement;\n const { left, width } = el.getBoundingClientRect();\n if (!width) return star;\n const ratio = (event.clientX - left) / width;\n const leadingHalf = getComputedStyle(el).direction === 'rtl' ? ratio > 0.5 : ratio < 0.5;\n return leadingHalf ? star - 0.5 : star;\n }\n\n private updateValue(value: number | null): void {\n if (this.modelValue() !== value) {\n this.modelValue.set(value);\n this.emitChange(value);\n this.rateChange.emit(value);\n }\n }\n\n /** @ignore Bound to `mousemove`: the preview must follow the cursor across the two halves. */\n protected setHover(star: number, event: MouseEvent): void {\n if (this.isDisabled() || this.readonly()) return;\n this.hoverValue.set(this.pointedValue(star, event));\n }\n\n /** @ignore */\n protected clearHover(): void {\n if (this.isDisabled() || this.readonly()) return;\n this.hoverValue.set(0);\n }\n\n /** @ignore */\n protected onFocus(event: FocusEvent): void {\n this.ratingFocus.emit(event);\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.ratingBlur.emit(event);\n }\n}\n","<div [class]=\"classes()\" (mouseleave)=\"clearHover()\">\n <!-- autofocus is a deliberate opt-in input of the component (default false). -->\n <!-- eslint-disable @angular-eslint/template/no-autofocus -->\n <input\n #inputEl\n type=\"range\"\n class=\"ui-rating-input\"\n min=\"0\"\n [max]=\"stars()\"\n [step]=\"step()\"\n [id]=\"resolvedId()\"\n [name]=\"name()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.autofocus]=\"autofocus() ? true : null\"\n [attr.readonly]=\"readonly() ? true : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [tabindex]=\"tabindex() ?? 0\"\n [value]=\"currentValue()\"\n (input)=\"onNativeChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- eslint-enable @angular-eslint/template/no-autofocus -->\n\n <div class=\"ui-rating-stars\">\n @for (star of starList(); track star.index) {\n <!-- Purely visual stars: focus and keyboard are carried by\n the native <input type=\"range\"> above. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-rating-icon\"\n (click)=\"rate(star.index, $event)\"\n (mousemove)=\"setHover(star.index, $event)\"\n >\n <!-- The \"on\" icon is stacked over the \"off\" one and clipped to `fill`:\n a half star works with any icon family and any projected template. -->\n <span class=\"ui-rating-icon-stack\">\n <span class=\"ui-rating-icon-base\">\n <ng-container\n *ngTemplateOutlet=\"\n offIconTemplate() || defaultOffIcon;\n context: { $implicit: star.index, active: star.active, fill: star.fill }\n \"\n />\n </span>\n @if (star.fill > 0) {\n <span class=\"ui-rating-icon-fill\" [style.--ui-rating-fill]=\"star.fill\">\n <ng-container\n *ngTemplateOutlet=\"\n onIconTemplate() || defaultOnIcon;\n context: { $implicit: star.index, active: star.active, fill: star.fill }\n \"\n />\n </span>\n }\n </span>\n </div>\n }\n </div>\n</div>\n\n<ng-template #defaultOnIcon>\n <ui-icon name=\"star\" type=\"solid\" [size]=\"size()\" />\n</ng-template>\n\n<ng-template #defaultOffIcon>\n <ui-icon name=\"star\" type=\"outline\" [size]=\"size()\" />\n</ng-template>\n","/*\n * Public API Surface of ui-kit/ui-rating\n */\n\nexport * from './lib/ui-rating';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AA4BA;;AAEG;AASG,MAAO,QAAS,SAAQ,gBAA+B,CAAA;AAR7D,IAAA,WAAA,GAAA;;;QAUE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAa,SAAS;iFAAC;;QAEnC,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,CAAC,6EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;QAEhD,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,KAAK,iFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;QAEzD,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,IAAI,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;QAErD,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,KAAK,iFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;QAEzD,IAAA,CAAA,WAAW,GAAG,KAAK,CAA4B,YAAY;wFAAC;;QAG5D,IAAA,CAAA,cAAc,GAAG,YAAY,CAAC,QAAQ,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,IAAI,GAAE,WAAgC,CAA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Q,OAAE,EAAE,IAAI,GAAE,WAAgC,CAAA,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAEnD,SAAS,EAAA,EAAA,GAAE,EAAE,IAAI,GAAE,WAAgC,CAAA,EAAE,4OAUR,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AElEvF;;AAEG;;ACFH;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"4sh-ui-kit-forms-ui-rating.mjs","sources":["../../../projects/ui-kit/forms/ui-rating/src/lib/ui-rating.ts","../../../projects/ui-kit/forms/ui-rating/src/lib/ui-rating.html","../../../projects/ui-kit/forms/ui-rating/src/public-api.ts","../../../projects/ui-kit/forms/ui-rating/src/4sh-ui-kit-forms-ui-rating.ts"],"sourcesContent":["import {\n booleanAttribute,\n Component,\n computed,\n contentChild,\n ElementRef,\n forwardRef,\n input,\n numberAttribute,\n output,\n signal,\n TemplateRef,\n viewChild,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { BaseFieldControl } from '@4sh/ui-kit/forms';\nimport { UiIcon, UiIconSize } from '@4sh/ui-kit/base/ui-icon';\n\nexport interface UiRatingIconContext {\n /** The current star value (1-based index). */\n $implicit: number;\n /** Whether this star is active (value <= current rating). */\n active: boolean;\n /** Filled portion of this star, `0` to `1` (hover preview included). */\n fill: number;\n}\n\n/**\n * ui-rating — headless rating component built over a native <input type=\"range\">.\n */\n@Component({\n selector: 'ui-rating',\n templateUrl: './ui-rating.html',\n styleUrl: './ui-rating.scss',\n standalone: true,\n imports: [UiIcon, NgTemplateOutlet],\n providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiRating), multi: true }],\n})\nexport class UiRating extends BaseFieldControl<number | null> {\n /** Size of the rating stars. */\n size = input<UiIconSize>('default');\n /** Number of stars to display. */\n stars = input(5, { transform: numberAttribute });\n /** Enables half-star notation: the value moves by 0.5 (click on a half, arrow keys). */\n allowHalf = input(false, { transform: booleanAttribute });\n /** Allows clearing the rating by clicking the current value. */\n cancel = input(true, { transform: booleanAttribute });\n /** Native autofocus attribute. */\n autofocus = input(false, { transform: booleanAttribute });\n /** Orientation of the rating control. */\n orientation = input<'horizontal' | 'vertical'>('horizontal');\n\n /** Custom template for active stars. */\n onIconTemplate = contentChild('onIcon', { read: TemplateRef<UiRatingIconContext> });\n /** Custom template for inactive stars. */\n offIconTemplate = contentChild('offIcon', { read: TemplateRef<UiRatingIconContext> });\n\n /** Emitted when rating changes (`null` = cleared / not rated). */\n rateChange = output<number | null>();\n /** Emitted when the native input receives focus. */\n ratingFocus = output<FocusEvent>();\n /** Emitted when the native input loses focus. */\n ratingBlur = output<FocusEvent>();\n\n /** @ignore */\n private readonly inputEl = viewChild.required<ElementRef<HTMLInputElement>>('inputEl');\n /** @ignore Redeclared over the base signal: `null` = not rated (never `undefined`). */\n protected override readonly modelValue = signal<number | null>(null);\n /** @ignore */\n protected readonly hoverValue = signal<number>(0);\n /** @ignore Selection granularity: one star, or a half when `allowHalf`. */\n protected readonly step = computed(() => (this.allowHalf() ? 0.5 : 1));\n /**\n * @ignore Numeric value used for display comparisons (`null` renders as 0 stars).\n * Floored to the granularity so an out-of-step value (an average pushed by the\n * host, e.g. 4.3) never renders a fill the user could not have selected.\n */\n protected readonly currentValue = computed(() => {\n const step = this.step();\n return Math.floor(Math.max(0, this.modelValue() ?? 0) / step) * step;\n });\n\n /** @ignore Per-star render model; `fill` (0 → 1) drives the clipped overlay. */\n protected readonly starList = computed(() => {\n const value = this.currentValue();\n const preview = this.hoverValue() || value;\n return Array.from({ length: this.stars() }, (_, i) => ({\n index: i + 1,\n fill: Math.min(1, Math.max(0, preview - i)),\n active: i + 1 <= value,\n }));\n });\n\n /** @ignore */\n protected readonly classes = computed(() => {\n const c = ['ui-rating', `_size-${this.size()}`];\n if (this.orientation() === 'vertical') c.push('_vertical');\n if (this.isDisabled()) c.push('_disabled');\n if (this.readonly()) c.push('_readonly');\n if (this.isInvalid()) c.push('_invalid');\n return c.join(' ');\n });\n\n override writeValue(value: number | null): void {\n this.modelValue.set(value ?? null);\n }\n\n /** @ignore */\n protected override uidPrefix(): string {\n return 'ui-rating';\n }\n\n focus(options?: FocusOptions): void {\n this.inputEl().nativeElement.focus(options);\n }\n\n /** @ignore Native change is triggered by keyboard or programmatic native actions */\n protected onNativeChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n const value = parseFloat(input.value);\n if (this.isDisabled() || this.readonly() || Number.isNaN(value)) {\n // Revert the native range so its value stays in sync with the model.\n input.value = String(this.currentValue());\n return;\n }\n // The range's 0 means \"not rated\" → null at the public boundary.\n this.updateValue(value === 0 ? null : value);\n }\n\n /** @ignore */\n protected rate(star: number, event: MouseEvent): void {\n if (this.isDisabled() || this.readonly()) return;\n\n const value = this.pointedValue(star, event);\n let newValue: number | null = value;\n if (this.cancel() && this.modelValue() === value) {\n newValue = null;\n }\n\n this.updateValue(newValue);\n this.focus();\n }\n\n /**\n * @ignore Value pointed at by the cursor: the star itself, or its first half\n * when `allowHalf`. Reads the writing direction so the \"first half\" stays the\n * leading one in RTL, like the clip applied by the stylesheet.\n */\n private pointedValue(star: number, event: MouseEvent): number {\n if (!this.allowHalf()) return star;\n const el = event.currentTarget as HTMLElement;\n const { left, width } = el.getBoundingClientRect();\n if (!width) return star;\n const ratio = (event.clientX - left) / width;\n const leadingHalf = getComputedStyle(el).direction === 'rtl' ? ratio > 0.5 : ratio < 0.5;\n return leadingHalf ? star - 0.5 : star;\n }\n\n private updateValue(value: number | null): void {\n if (this.modelValue() !== value) {\n this.modelValue.set(value);\n this.emitChange(value);\n this.rateChange.emit(value);\n }\n }\n\n /** @ignore Bound to `mousemove`: the preview must follow the cursor across the two halves. */\n protected setHover(star: number, event: MouseEvent): void {\n if (this.isDisabled() || this.readonly()) return;\n this.hoverValue.set(this.pointedValue(star, event));\n }\n\n /** @ignore */\n protected clearHover(): void {\n if (this.isDisabled() || this.readonly()) return;\n this.hoverValue.set(0);\n }\n\n /** @ignore */\n protected onFocus(event: FocusEvent): void {\n this.ratingFocus.emit(event);\n }\n\n /** @ignore */\n protected onBlur(event: FocusEvent): void {\n this.emitTouch();\n this.ratingBlur.emit(event);\n }\n}\n","<div [class]=\"classes()\" (mouseleave)=\"clearHover()\">\n <!-- autofocus is a deliberate opt-in input of the component (default false). -->\n <!-- eslint-disable @angular-eslint/template/no-autofocus -->\n <input\n #inputEl\n type=\"range\"\n class=\"ui-rating-input\"\n min=\"0\"\n [max]=\"stars()\"\n [step]=\"step()\"\n [id]=\"resolvedId()\"\n [name]=\"name()\"\n [disabled]=\"isDisabled()\"\n [required]=\"required()\"\n [attr.autofocus]=\"autofocus() ? true : null\"\n [attr.readonly]=\"readonly() ? true : null\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-labelledby]=\"ariaLabelledBy() || null\"\n [tabindex]=\"tabindex() ?? 0\"\n [value]=\"currentValue()\"\n (input)=\"onNativeChange($event)\"\n (focus)=\"onFocus($event)\"\n (blur)=\"onBlur($event)\"\n />\n <!-- eslint-enable @angular-eslint/template/no-autofocus -->\n\n <div class=\"ui-rating-stars\">\n @for (star of starList(); track star.index) {\n <!-- Purely visual stars: focus and keyboard are carried by\n the native <input type=\"range\"> above. -->\n <!-- eslint-disable-next-line @angular-eslint/template/click-events-have-key-events, @angular-eslint/template/interactive-supports-focus -->\n <div\n class=\"ui-rating-icon\"\n (click)=\"rate(star.index, $event)\"\n (mousemove)=\"setHover(star.index, $event)\"\n >\n <!-- The \"on\" icon is stacked over the \"off\" one and clipped to `fill`:\n a half star works with any icon family and any projected template. -->\n <span class=\"ui-rating-icon-stack\">\n <span class=\"ui-rating-icon-base\">\n <ng-container\n *ngTemplateOutlet=\"\n offIconTemplate() || defaultOffIcon;\n context: { $implicit: star.index, active: star.active, fill: star.fill }\n \"\n />\n </span>\n @if (star.fill > 0) {\n <span class=\"ui-rating-icon-fill\" [style.--ui-rating-fill]=\"star.fill\">\n <ng-container\n *ngTemplateOutlet=\"\n onIconTemplate() || defaultOnIcon;\n context: { $implicit: star.index, active: star.active, fill: star.fill }\n \"\n />\n </span>\n }\n </span>\n </div>\n }\n </div>\n</div>\n\n<ng-template #defaultOnIcon>\n <ui-icon name=\"star\" type=\"solid\" [size]=\"size()\" />\n</ng-template>\n\n<ng-template #defaultOffIcon>\n <ui-icon name=\"star\" type=\"outline\" [size]=\"size()\" />\n</ng-template>\n","/*\n * Public API Surface of ui-kit/ui-rating\n */\n\nexport * from './lib/ui-rating';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AA4BA;;AAEG;AASG,MAAO,QAAS,SAAQ,gBAA+B,CAAA;AAR7D,IAAA,WAAA,GAAA;;;QAUE,IAAA,CAAA,IAAI,GAAG,KAAK,CAAa,SAAS;iFAAC;;QAEnC,IAAA,CAAA,KAAK,GAAG,KAAK,CAAC,CAAC,6EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;;QAEhD,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,KAAK,iFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;QAEzD,IAAA,CAAA,MAAM,GAAG,KAAK,CAAC,IAAI,8EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;QAErD,IAAA,CAAA,SAAS,GAAG,KAAK,CAAC,KAAK,iFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;QAEzD,IAAA,CAAA,WAAW,GAAG,KAAK,CAA4B,YAAY;wFAAC;;QAG5D,IAAA,CAAA,cAAc,GAAG,YAAY,CAAC,QAAQ,EAAA,EAAA,IAAA,SAAA,GAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,8BAAA,EAAA,CAAA,EAAI,IAAI,GAAE,WAAgC,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QAAQ,OAAE,EAAE,IAAI,GAAE,WAAgC,CAAA,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,YAAA,EAAA,IAAA,EAAA,CAEnD,SAAS,EAAA,EAAA,GAAE,EAAE,IAAI,GAAE,WAAgC,CAAA,EAAE,4OAUR,SAAS,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AElEvF;;AAEG;;ACFH;;AAEG;;"}
|
|
@@ -353,12 +353,12 @@ class UiSegmentControl extends BaseFieldControl {
|
|
|
353
353
|
return a[key] === b[key];
|
|
354
354
|
return a === b;
|
|
355
355
|
}
|
|
356
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
357
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
356
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: UiSegmentControl, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
357
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: UiSegmentControl, isStandalone: true, selector: "ui-segment-control", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionLabel: { classPropertyName: "optionLabel", publicName: "optionLabel", isSignal: true, isRequired: false, transformFunction: null }, optionValue: { classPropertyName: "optionValue", publicName: "optionValue", isSignal: true, isRequired: false, transformFunction: null }, optionDisabled: { classPropertyName: "optionDisabled", publicName: "optionDisabled", isSignal: true, isRequired: false, transformFunction: null }, optionIcon: { classPropertyName: "optionIcon", publicName: "optionIcon", isSignal: true, isRequired: false, transformFunction: null }, dataKey: { classPropertyName: "dataKey", publicName: "dataKey", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, ripple: { classPropertyName: "ripple", publicName: "ripple", isSignal: true, isRequired: false, transformFunction: null }, allowEmpty: { classPropertyName: "allowEmpty", publicName: "allowEmpty", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, fluid: { classPropertyName: "fluid", publicName: "fluid", isSignal: true, isRequired: false, transformFunction: null }, motion: { classPropertyName: "motion", publicName: "motion", isSignal: true, isRequired: false, transformFunction: null }, itemTemplate: { classPropertyName: "itemTemplate", publicName: "itemTemplate", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selectionChange: "selectionChange", optionClick: "optionClick" }, host: { listeners: { "keydown": "onKeydown($event)", "focusout": "onFocusOut($event)" }, properties: { "class._small": "size() === 'small'", "class._vertical": "orientation() === 'vertical'", "class._fluid": "fluid()", "class._multiple": "multiple()", "class._disabled": "isDisabled()", "class._invalid": "isInvalid()", "class._no-motion": "!motion()", "attr.role": "multiple() ? 'group' : 'radiogroup'", "attr.aria-label": "ariaLabel() || null", "attr.aria-labelledby": "ariaLabelledBy() || null", "attr.aria-invalid": "isInvalid() ? 'true' : null", "attr.aria-disabled": "isDisabled() ? 'true' : null" }, classAttribute: "ui-segment-control" }, providers: [
|
|
358
358
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiSegmentControl), multi: true },
|
|
359
|
-
], viewQueries: [{ propertyName: "optionEls", predicate: ["optionBtn"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (showThumb()) {\n <span\n class=\"ui-segment-control-thumb\"\n aria-hidden=\"true\"\n [style.transform]=\"thumbTransform()\"\n [style.width.px]=\"thumb()?.w\"\n [style.height.px]=\"thumb()?.h\"\n ></span>\n}\n\n@for (option of normalizedOptions(); track option.key) {\n <button\n #optionBtn\n type=\"button\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n class=\"ui-segment-control-option\"\n [class._selected]=\"option.selected\"\n [disabled]=\"option.disabled\"\n [attr.role]=\"multiple() ? null : 'radio'\"\n [attr.aria-checked]=\"multiple() ? null : option.selected\"\n [attr.aria-pressed]=\"multiple() ? option.selected : null\"\n [attr.aria-label]=\"option.ariaLabel\"\n [attr.tabindex]=\"tabindexFor(option.index)\"\n (click)=\"select(option, $event)\"\n (focus)=\"onOptionFocus(option.index)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option.original,\n option: option.original,\n selected: option.selected,\n index: option.index,\n }\"\n />\n } @else {\n @if (option.icon) {\n <ui-icon class=\"ui-segment-control-icon\" [name]=\"option.icon\" [size]=\"iconSize()\" />\n }\n @if (option.label) {\n <span class=\"ui-segment-control-label\" [attr.data-label]=\"option.label\">{{\n option.label\n }}</span>\n }\n }\n </button>\n}\n", styles: [":host{position:relative;display:inline-flex;align-items:stretch;box-sizing:border-box;padding:var(--ui-segment-control-padding, var(--units-xs));gap:var(--ui-segment-control-gap, 0);border-radius:var(--ui-segment-control-radius, var(--radius-md));box-shadow:inset 0 0 0 var(--ui-segment-control-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) var(--global-border-default);font-family:var(--fontfamily-base);-webkit-user-select:none;user-select:none;vertical-align:middle;min-height:var(--ui-segment-control-min-height, 2.75rem)}:host .ui-segment-control-option{min-height:var(--ui-segment-control-option-min-height, 2.25rem);min-width:var(--ui-segment-control-option-min-width, 2.25rem);padding:0 var(--ui-segment-control-option-padding-x, var(--units-default));font-size:var(--ui-segment-control-font-size, var(--size-typography-text-default))}:host._small{min-height:var(--ui-segment-control-min-height-small, 2.5rem)}:host._small .ui-segment-control-option{min-height:var(--ui-segment-control-option-min-height-small, 2rem);min-width:var(--ui-segment-control-option-min-width-small, 2rem);padding:0 var(--ui-segment-control-option-padding-x-small, var(--units-md));font-size:var(--ui-segment-control-font-size-small, var(--size-typography-text-md))}.ui-segment-control-thumb{position:absolute;top:0;left:0;z-index:0;border-radius:var(--ui-segment-control-thumb-radius, var(--radius-sm));background-color:var(--actions-high-surface-default);pointer-events:none;transition:transform var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms),width var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms),height var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms)}@media(prefers-reduced-motion:reduce){.ui-segment-control-thumb{transition:none}}:root[data-motion=off] .ui-segment-control-thumb{transition:none}:host._no-motion .ui-segment-control-thumb{transition:none}.ui-segment-control-icon{line-height:0}.ui-segment-control-label{display:inline-flex;flex-direction:column;align-items:center}.ui-segment-control-label:after{content:attr(data-label);height:0;overflow:hidden;font-weight:var(--weight-bold);visibility:hidden;pointer-events:none;-webkit-user-select:none;user-select:none}.ui-segment-control-option{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-segment-control-option-gap, var(--units-sm));box-sizing:border-box;border:0;border-radius:var(--ui-segment-control-option-radius, var(--radius-sm));background-color:transparent;color:var(--actions-low-content-default);font-family:inherit;font-weight:var(--weight-regular);line-height:1.2;white-space:nowrap;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),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-segment-control-option:hover:not(:disabled):not(._selected){background-color:var(--actions-low-surface-hover);color:var(--actions-low-content-hover)}.ui-segment-control-option:active:not(:disabled):not(._selected){background-color:var(--actions-low-surface-pressed);color:var(--actions-low-content-pressed)}.ui-segment-control-option:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-segment-control-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--actions-low-stroke-focused)}.ui-segment-control-option._selected{color:var(--actions-high-content-default);font-weight:var(--weight-bold)}.ui-segment-control-option._selected:focus-visible{box-shadow:0 0 0 var(--ui-segment-control-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--actions-high-stroke-focused)}.ui-segment-control-option:disabled{cursor:not-allowed;color:var(--actions-low-content-disabled)}.ui-segment-control-option:disabled._selected{color:var(--actions-high-content-disabled)}:host._multiple .ui-segment-control-option._selected{background-color:var(--actions-high-surface-default)}:host._multiple .ui-segment-control-option._selected:hover:not(:disabled){background-color:var(--actions-high-surface-hover);color:var(--actions-high-content-hover)}:host._multiple .ui-segment-control-option._selected:active:not(:disabled){background-color:var(--actions-high-surface-pressed);color:var(--actions-high-content-pressed)}:host._multiple .ui-segment-control-option._selected:disabled{background-color:var(--actions-high-surface-disabled)}:host._fluid{display:flex;width:100%}:host._fluid .ui-segment-control-option{flex:1 1 0}:host._vertical{flex-direction:column;align-items:stretch}:host._vertical .ui-segment-control-option{width:100%}:host._invalid{box-shadow:inset 0 0 0 var(--ui-segment-control-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) var(--form-error-stroke-default)}:host._disabled{cursor:not-allowed}:host._disabled .ui-segment-control-thumb{background-color:var(--actions-high-surface-disabled)}\n"], dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
359
|
+
], viewQueries: [{ propertyName: "optionEls", predicate: ["optionBtn"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "@if (showThumb()) {\n <span\n class=\"ui-segment-control-thumb\"\n aria-hidden=\"true\"\n [style.transform]=\"thumbTransform()\"\n [style.width.px]=\"thumb()?.w\"\n [style.height.px]=\"thumb()?.h\"\n ></span>\n}\n\n@for (option of normalizedOptions(); track option.key) {\n <button\n #optionBtn\n type=\"button\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n class=\"ui-segment-control-option\"\n [class._selected]=\"option.selected\"\n [disabled]=\"option.disabled\"\n [attr.role]=\"multiple() ? null : 'radio'\"\n [attr.aria-checked]=\"multiple() ? null : option.selected\"\n [attr.aria-pressed]=\"multiple() ? option.selected : null\"\n [attr.aria-label]=\"option.ariaLabel\"\n [attr.tabindex]=\"tabindexFor(option.index)\"\n (click)=\"select(option, $event)\"\n (focus)=\"onOptionFocus(option.index)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option.original,\n option: option.original,\n selected: option.selected,\n index: option.index,\n }\"\n />\n } @else {\n @if (option.icon) {\n <ui-icon class=\"ui-segment-control-icon\" [name]=\"option.icon\" [size]=\"iconSize()\" />\n }\n @if (option.label) {\n <span class=\"ui-segment-control-label\" [attr.data-label]=\"option.label\">{{\n option.label\n }}</span>\n }\n }\n </button>\n}\n", styles: [":host{position:relative;display:inline-flex;align-items:stretch;box-sizing:border-box;padding:var(--ui-segment-control-padding, var(--units-xs));gap:var(--ui-segment-control-gap, 0);border-radius:var(--ui-segment-control-radius, var(--radius-md));box-shadow:inset 0 0 0 var(--ui-segment-control-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) var(--ui-segment-control-stroke, var(--global-border-default));font-family:var(--ui-segment-control-font-family, var(--fontfamily-base));-webkit-user-select:none;user-select:none;vertical-align:middle;min-height:var(--ui-segment-control-min-height, 2.75rem)}:host .ui-segment-control-option{min-height:var(--ui-segment-control-option-min-height, 2.25rem);min-width:var(--ui-segment-control-option-min-width, 2.25rem);padding:0 var(--ui-segment-control-option-padding-x, var(--units-default));font-size:var(--ui-segment-control-font-size, var(--size-typography-text-default))}:host._small{min-height:var(--ui-segment-control-min-height-small, 2.5rem)}:host._small .ui-segment-control-option{min-height:var(--ui-segment-control-option-min-height-small, 2rem);min-width:var(--ui-segment-control-option-min-width-small, 2rem);padding:0 var(--ui-segment-control-option-padding-x-small, var(--units-md));font-size:var(--ui-segment-control-font-size-small, var(--size-typography-text-md))}.ui-segment-control-thumb{position:absolute;top:0;left:0;z-index:0;border-radius:var(--ui-segment-control-thumb-radius, var(--radius-sm));background-color:var(--ui-segment-control-thumb-surface, var(--actions-high-surface-default));pointer-events:none;transition:transform var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms),width var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms),height var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms)}@media(prefers-reduced-motion:reduce){.ui-segment-control-thumb{transition:none}}:root[data-motion=off] .ui-segment-control-thumb{transition:none}:host._no-motion .ui-segment-control-thumb{transition:none}.ui-segment-control-icon{line-height:0}.ui-segment-control-label{display:inline-flex;flex-direction:column;align-items:center}.ui-segment-control-label:after{content:attr(data-label);height:0;overflow:hidden;font-weight:var(--ui-segment-control-weight-selected, var(--weight-bold));visibility:hidden;pointer-events:none;-webkit-user-select:none;user-select:none}.ui-segment-control-option{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-segment-control-option-gap, var(--units-sm));box-sizing:border-box;border:0;border-radius:var(--ui-segment-control-option-radius, var(--radius-sm));background-color:transparent;color:var(--ui-segment-control-option-color, var(--actions-low-content-default));font-family:inherit;font-weight:var(--ui-segment-control-weight, var(--weight-regular));line-height:1.2;white-space:nowrap;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),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-segment-control-option:hover:not(:disabled):not(._selected){background-color:var(--ui-segment-control-option-surface-hover, var(--actions-low-surface-hover));color:var(--ui-segment-control-option-color-hover, var(--actions-low-content-hover))}.ui-segment-control-option:active:not(:disabled):not(._selected){background-color:var(--ui-segment-control-option-surface-pressed, var(--actions-low-surface-pressed));color:var(--ui-segment-control-option-color-pressed, var(--actions-low-content-pressed))}.ui-segment-control-option:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-segment-control-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-segment-control-option-focus-ring-color, var(--actions-low-stroke-focused))}.ui-segment-control-option._selected{color:var(--ui-segment-control-option-color-selected, var(--actions-high-content-default));font-weight:var(--ui-segment-control-weight-selected, var(--weight-bold))}.ui-segment-control-option._selected:focus-visible{box-shadow:0 0 0 var(--ui-segment-control-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-segment-control-option-focus-ring-color, var(--actions-high-stroke-focused))}.ui-segment-control-option:disabled{cursor:not-allowed;color:var(--ui-segment-control-option-color-disabled, var(--actions-low-content-disabled))}.ui-segment-control-option:disabled._selected{color:var(--ui-segment-control-option-color-selected-disabled, var(--actions-high-content-disabled))}:host._multiple .ui-segment-control-option._selected{background-color:var(--ui-segment-control-option-surface-selected, var(--actions-high-surface-default))}:host._multiple .ui-segment-control-option._selected:hover:not(:disabled){background-color:var(--ui-segment-control-option-surface-hover, var(--actions-high-surface-hover));color:var(--ui-segment-control-option-color-hover, var(--actions-high-content-hover))}:host._multiple .ui-segment-control-option._selected:active:not(:disabled){background-color:var(--ui-segment-control-option-surface-pressed, var(--actions-high-surface-pressed));color:var(--ui-segment-control-option-color-pressed, var(--actions-high-content-pressed))}:host._multiple .ui-segment-control-option._selected:disabled{background-color:var(--ui-segment-control-option-surface-disabled, var(--actions-high-surface-disabled))}:host._fluid{display:flex;width:100%}:host._fluid .ui-segment-control-option{flex:1 1 0}:host._vertical{flex-direction:column;align-items:stretch}:host._vertical .ui-segment-control-option{width:100%}:host._invalid{box-shadow:inset 0 0 0 var(--ui-segment-control-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) var(--ui-segment-control-stroke-invalid, var(--form-error-stroke-default))}:host._disabled{cursor:not-allowed}:host._disabled .ui-segment-control-thumb{background-color:var(--ui-segment-control-thumb-surface-disabled, var(--actions-high-surface-disabled))}\n"], dependencies: [{ kind: "component", type: UiIcon, selector: "ui-icon", inputs: ["name", "size", "type", "family", "decorative", "ariaLabel"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
|
|
360
360
|
}
|
|
361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
361
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: UiSegmentControl, decorators: [{
|
|
362
362
|
type: Component,
|
|
363
363
|
args: [{ selector: 'ui-segment-control', imports: [UiIcon, NgTemplateOutlet], providers: [
|
|
364
364
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => UiSegmentControl), multi: true },
|
|
@@ -378,7 +378,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImpor
|
|
|
378
378
|
'[attr.aria-disabled]': "isDisabled() ? 'true' : null",
|
|
379
379
|
'(keydown)': 'onKeydown($event)',
|
|
380
380
|
'(focusout)': 'onFocusOut($event)',
|
|
381
|
-
}, template: "@if (showThumb()) {\n <span\n class=\"ui-segment-control-thumb\"\n aria-hidden=\"true\"\n [style.transform]=\"thumbTransform()\"\n [style.width.px]=\"thumb()?.w\"\n [style.height.px]=\"thumb()?.h\"\n ></span>\n}\n\n@for (option of normalizedOptions(); track option.key) {\n <button\n #optionBtn\n type=\"button\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n class=\"ui-segment-control-option\"\n [class._selected]=\"option.selected\"\n [disabled]=\"option.disabled\"\n [attr.role]=\"multiple() ? null : 'radio'\"\n [attr.aria-checked]=\"multiple() ? null : option.selected\"\n [attr.aria-pressed]=\"multiple() ? option.selected : null\"\n [attr.aria-label]=\"option.ariaLabel\"\n [attr.tabindex]=\"tabindexFor(option.index)\"\n (click)=\"select(option, $event)\"\n (focus)=\"onOptionFocus(option.index)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option.original,\n option: option.original,\n selected: option.selected,\n index: option.index,\n }\"\n />\n } @else {\n @if (option.icon) {\n <ui-icon class=\"ui-segment-control-icon\" [name]=\"option.icon\" [size]=\"iconSize()\" />\n }\n @if (option.label) {\n <span class=\"ui-segment-control-label\" [attr.data-label]=\"option.label\">{{\n option.label\n }}</span>\n }\n }\n </button>\n}\n", styles: [":host{position:relative;display:inline-flex;align-items:stretch;box-sizing:border-box;padding:var(--ui-segment-control-padding, var(--units-xs));gap:var(--ui-segment-control-gap, 0);border-radius:var(--ui-segment-control-radius, var(--radius-md));box-shadow:inset 0 0 0 var(--ui-segment-control-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) var(--global-border-default);font-family:var(--fontfamily-base);-webkit-user-select:none;user-select:none;vertical-align:middle;min-height:var(--ui-segment-control-min-height, 2.75rem)}:host .ui-segment-control-option{min-height:var(--ui-segment-control-option-min-height, 2.25rem);min-width:var(--ui-segment-control-option-min-width, 2.25rem);padding:0 var(--ui-segment-control-option-padding-x, var(--units-default));font-size:var(--ui-segment-control-font-size, var(--size-typography-text-default))}:host._small{min-height:var(--ui-segment-control-min-height-small, 2.5rem)}:host._small .ui-segment-control-option{min-height:var(--ui-segment-control-option-min-height-small, 2rem);min-width:var(--ui-segment-control-option-min-width-small, 2rem);padding:0 var(--ui-segment-control-option-padding-x-small, var(--units-md));font-size:var(--ui-segment-control-font-size-small, var(--size-typography-text-md))}.ui-segment-control-thumb{position:absolute;top:0;left:0;z-index:0;border-radius:var(--ui-segment-control-thumb-radius, var(--radius-sm));background-color:var(--actions-high-surface-default);pointer-events:none;transition:transform var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms),width var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms),height var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms)}@media(prefers-reduced-motion:reduce){.ui-segment-control-thumb{transition:none}}:root[data-motion=off] .ui-segment-control-thumb{transition:none}:host._no-motion .ui-segment-control-thumb{transition:none}.ui-segment-control-icon{line-height:0}.ui-segment-control-label{display:inline-flex;flex-direction:column;align-items:center}.ui-segment-control-label:after{content:attr(data-label);height:0;overflow:hidden;font-weight:var(--weight-bold);visibility:hidden;pointer-events:none;-webkit-user-select:none;user-select:none}.ui-segment-control-option{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-segment-control-option-gap, var(--units-sm));box-sizing:border-box;border:0;border-radius:var(--ui-segment-control-option-radius, var(--radius-sm));background-color:transparent;color:var(--actions-low-content-default);font-family:inherit;font-weight:var(--weight-regular);line-height:1.2;white-space:nowrap;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),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-segment-control-option:hover:not(:disabled):not(._selected){background-color:var(--actions-low-surface-hover);color:var(--actions-low-content-hover)}.ui-segment-control-option:active:not(:disabled):not(._selected){background-color:var(--actions-low-surface-pressed);color:var(--actions-low-content-pressed)}.ui-segment-control-option:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-segment-control-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--actions-low-stroke-focused)}.ui-segment-control-option._selected{color:var(--actions-high-content-default);font-weight:var(--weight-bold)}.ui-segment-control-option._selected:focus-visible{box-shadow:0 0 0 var(--ui-segment-control-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--actions-high-stroke-focused)}.ui-segment-control-option:disabled{cursor:not-allowed;color:var(--actions-low-content-disabled)}.ui-segment-control-option:disabled._selected{color:var(--actions-high-content-disabled)}:host._multiple .ui-segment-control-option._selected{background-color:var(--actions-high-surface-default)}:host._multiple .ui-segment-control-option._selected:hover:not(:disabled){background-color:var(--actions-high-surface-hover);color:var(--actions-high-content-hover)}:host._multiple .ui-segment-control-option._selected:active:not(:disabled){background-color:var(--actions-high-surface-pressed);color:var(--actions-high-content-pressed)}:host._multiple .ui-segment-control-option._selected:disabled{background-color:var(--actions-high-surface-disabled)}:host._fluid{display:flex;width:100%}:host._fluid .ui-segment-control-option{flex:1 1 0}:host._vertical{flex-direction:column;align-items:stretch}:host._vertical .ui-segment-control-option{width:100%}:host._invalid{box-shadow:inset 0 0 0 var(--ui-segment-control-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) var(--form-error-stroke-default)}:host._disabled{cursor:not-allowed}:host._disabled .ui-segment-control-thumb{background-color:var(--actions-high-surface-disabled)}\n"] }]
|
|
381
|
+
}, template: "@if (showThumb()) {\n <span\n class=\"ui-segment-control-thumb\"\n aria-hidden=\"true\"\n [style.transform]=\"thumbTransform()\"\n [style.width.px]=\"thumb()?.w\"\n [style.height.px]=\"thumb()?.h\"\n ></span>\n}\n\n@for (option of normalizedOptions(); track option.key) {\n <button\n #optionBtn\n type=\"button\"\n [attr.data-ripple]=\"ripple() ? 'on' : 'off'\"\n class=\"ui-segment-control-option\"\n [class._selected]=\"option.selected\"\n [disabled]=\"option.disabled\"\n [attr.role]=\"multiple() ? null : 'radio'\"\n [attr.aria-checked]=\"multiple() ? null : option.selected\"\n [attr.aria-pressed]=\"multiple() ? option.selected : null\"\n [attr.aria-label]=\"option.ariaLabel\"\n [attr.tabindex]=\"tabindexFor(option.index)\"\n (click)=\"select(option, $event)\"\n (focus)=\"onOptionFocus(option.index)\"\n >\n @if (itemTemplate(); as tpl) {\n <ng-container\n [ngTemplateOutlet]=\"tpl\"\n [ngTemplateOutletContext]=\"{\n $implicit: option.original,\n option: option.original,\n selected: option.selected,\n index: option.index,\n }\"\n />\n } @else {\n @if (option.icon) {\n <ui-icon class=\"ui-segment-control-icon\" [name]=\"option.icon\" [size]=\"iconSize()\" />\n }\n @if (option.label) {\n <span class=\"ui-segment-control-label\" [attr.data-label]=\"option.label\">{{\n option.label\n }}</span>\n }\n }\n </button>\n}\n", styles: [":host{position:relative;display:inline-flex;align-items:stretch;box-sizing:border-box;padding:var(--ui-segment-control-padding, var(--units-xs));gap:var(--ui-segment-control-gap, 0);border-radius:var(--ui-segment-control-radius, var(--radius-md));box-shadow:inset 0 0 0 var(--ui-segment-control-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) var(--ui-segment-control-stroke, var(--global-border-default));font-family:var(--ui-segment-control-font-family, var(--fontfamily-base));-webkit-user-select:none;user-select:none;vertical-align:middle;min-height:var(--ui-segment-control-min-height, 2.75rem)}:host .ui-segment-control-option{min-height:var(--ui-segment-control-option-min-height, 2.25rem);min-width:var(--ui-segment-control-option-min-width, 2.25rem);padding:0 var(--ui-segment-control-option-padding-x, var(--units-default));font-size:var(--ui-segment-control-font-size, var(--size-typography-text-default))}:host._small{min-height:var(--ui-segment-control-min-height-small, 2.5rem)}:host._small .ui-segment-control-option{min-height:var(--ui-segment-control-option-min-height-small, 2rem);min-width:var(--ui-segment-control-option-min-width-small, 2rem);padding:0 var(--ui-segment-control-option-padding-x-small, var(--units-md));font-size:var(--ui-segment-control-font-size-small, var(--size-typography-text-md))}.ui-segment-control-thumb{position:absolute;top:0;left:0;z-index:0;border-radius:var(--ui-segment-control-thumb-radius, var(--radius-sm));background-color:var(--ui-segment-control-thumb-surface, var(--actions-high-surface-default));pointer-events:none;transition:transform var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms),width var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms),height var(--ui-motion-duration, var(--transition-default)) var(--ui-motion-easing, var(--transition-easeinout)) var(--ui-motion-delay, 0ms)}@media(prefers-reduced-motion:reduce){.ui-segment-control-thumb{transition:none}}:root[data-motion=off] .ui-segment-control-thumb{transition:none}:host._no-motion .ui-segment-control-thumb{transition:none}.ui-segment-control-icon{line-height:0}.ui-segment-control-label{display:inline-flex;flex-direction:column;align-items:center}.ui-segment-control-label:after{content:attr(data-label);height:0;overflow:hidden;font-weight:var(--ui-segment-control-weight-selected, var(--weight-bold));visibility:hidden;pointer-events:none;-webkit-user-select:none;user-select:none}.ui-segment-control-option{position:relative;z-index:1;display:inline-flex;align-items:center;justify-content:center;gap:var(--ui-segment-control-option-gap, var(--units-sm));box-sizing:border-box;border:0;border-radius:var(--ui-segment-control-option-radius, var(--radius-sm));background-color:transparent;color:var(--ui-segment-control-option-color, var(--actions-low-content-default));font-family:inherit;font-weight:var(--ui-segment-control-weight, var(--weight-regular));line-height:1.2;white-space:nowrap;cursor:pointer;transition:background-color var(--ui-control-transition-duration, var(--transition-default)) var(--ui-control-transition-easing, var(--transition-easeinout)),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-segment-control-option:hover:not(:disabled):not(._selected){background-color:var(--ui-segment-control-option-surface-hover, var(--actions-low-surface-hover));color:var(--ui-segment-control-option-color-hover, var(--actions-low-content-hover))}.ui-segment-control-option:active:not(:disabled):not(._selected){background-color:var(--ui-segment-control-option-surface-pressed, var(--actions-low-surface-pressed));color:var(--ui-segment-control-option-color-pressed, var(--actions-low-content-pressed))}.ui-segment-control-option:focus-visible{outline:none;box-shadow:0 0 0 var(--ui-segment-control-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-segment-control-option-focus-ring-color, var(--actions-low-stroke-focused))}.ui-segment-control-option._selected{color:var(--ui-segment-control-option-color-selected, var(--actions-high-content-default));font-weight:var(--ui-segment-control-weight-selected, var(--weight-bold))}.ui-segment-control-option._selected:focus-visible{box-shadow:0 0 0 var(--ui-segment-control-focus-ring-width, var(--ui-focus-ring-width, var(--units-2xs))) var(--ui-segment-control-option-focus-ring-color, var(--actions-high-stroke-focused))}.ui-segment-control-option:disabled{cursor:not-allowed;color:var(--ui-segment-control-option-color-disabled, var(--actions-low-content-disabled))}.ui-segment-control-option:disabled._selected{color:var(--ui-segment-control-option-color-selected-disabled, var(--actions-high-content-disabled))}:host._multiple .ui-segment-control-option._selected{background-color:var(--ui-segment-control-option-surface-selected, var(--actions-high-surface-default))}:host._multiple .ui-segment-control-option._selected:hover:not(:disabled){background-color:var(--ui-segment-control-option-surface-hover, var(--actions-high-surface-hover));color:var(--ui-segment-control-option-color-hover, var(--actions-high-content-hover))}:host._multiple .ui-segment-control-option._selected:active:not(:disabled){background-color:var(--ui-segment-control-option-surface-pressed, var(--actions-high-surface-pressed));color:var(--ui-segment-control-option-color-pressed, var(--actions-high-content-pressed))}:host._multiple .ui-segment-control-option._selected:disabled{background-color:var(--ui-segment-control-option-surface-disabled, var(--actions-high-surface-disabled))}:host._fluid{display:flex;width:100%}:host._fluid .ui-segment-control-option{flex:1 1 0}:host._vertical{flex-direction:column;align-items:stretch}:host._vertical .ui-segment-control-option{width:100%}:host._invalid{box-shadow:inset 0 0 0 var(--ui-segment-control-stroke-width, var(--ui-control-stroke-width, var(--stroke-default))) var(--ui-segment-control-stroke-invalid, var(--form-error-stroke-default))}:host._disabled{cursor:not-allowed}:host._disabled .ui-segment-control-thumb{background-color:var(--ui-segment-control-thumb-surface-disabled, var(--actions-high-surface-disabled))}\n"] }]
|
|
382
382
|
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], optionLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionLabel", required: false }] }], optionValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionValue", required: false }] }], optionDisabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionDisabled", required: false }] }], optionIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionIcon", required: false }] }], dataKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataKey", required: false }] }], multiple: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiple", required: false }] }], ripple: [{ type: i0.Input, args: [{ isSignal: true, alias: "ripple", required: false }] }], allowEmpty: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowEmpty", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], fluid: [{ type: i0.Input, args: [{ isSignal: true, alias: "fluid", required: false }] }], motion: [{ type: i0.Input, args: [{ isSignal: true, alias: "motion", required: false }] }], itemTemplate: [{ type: i0.Input, args: [{ isSignal: true, alias: "itemTemplate", required: false }] }], selectionChange: [{ type: i0.Output, args: ["selectionChange"] }], optionClick: [{ type: i0.Output, args: ["optionClick"] }], optionEls: [{ type: i0.ViewChildren, args: ['optionBtn', { isSignal: true }] }] } });
|
|
383
383
|
|
|
384
384
|
/*
|