ngx-com 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/ngx-com-components-checkbox.mjs +16 -7
- package/fesm2022/ngx-com-components-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-com-components-dropdown.mjs +18 -10
- package/fesm2022/ngx-com-components-dropdown.mjs.map +1 -1
- package/fesm2022/ngx-com-components-form-field.mjs +48 -8
- package/fesm2022/ngx-com-components-form-field.mjs.map +1 -1
- package/fesm2022/ngx-com-components-radio.mjs +15 -8
- package/fesm2022/ngx-com-components-radio.mjs.map +1 -1
- package/fesm2022/ngx-com-components-separator.mjs +102 -0
- package/fesm2022/ngx-com-components-separator.mjs.map +1 -0
- package/package.json +5 -1
- package/types/ngx-com-components-checkbox.d.ts +7 -2
- package/types/ngx-com-components-dropdown.d.ts +8 -5
- package/types/ngx-com-components-form-field.d.ts +19 -3
- package/types/ngx-com-components-radio.d.ts +5 -3
- package/types/ngx-com-components-separator.d.ts +75 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-com-components-radio.mjs","sources":["../../../projects/com/components/radio/radio.variants.ts","../../../projects/com/components/radio/radio.utils.ts","../../../projects/com/components/radio/radio-group.component.ts","../../../projects/com/components/radio/radio.component.ts","../../../projects/com/components/radio/index.ts","../../../projects/com/components/radio/ngx-com-components-radio.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\n/** Radio size variants. */\nexport type RadioSize = 'sm' | 'md' | 'lg';\n\n/** Radio color variants. */\nexport type RadioVariant = 'primary' | 'accent' | 'warn';\n\n/** Radio group orientation. */\nexport type RadioOrientation = 'vertical' | 'horizontal';\n\n/**\n * CVA variants for the visual radio circle.\n *\n * Uses `peer` selectors to style based on native input state:\n * - `peer-checked:` for checked state\n * - `peer-focus-visible:` for keyboard focus\n * - `peer-disabled:` for disabled state\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-hover`,\n * `--color-disabled`, `--color-ring`\n */\nexport const radioCircleVariants: (props?: {\n variant?: RadioVariant;\n size?: RadioSize;\n}) => string = cva(\n [\n 'com-radio__circle',\n 'inline-flex shrink-0 items-center justify-center',\n 'rounded-full border-2 border-border',\n 'transition-colors duration-150',\n 'peer-focus-visible:outline-[1px] peer-focus-visible:outline-offset-2 peer-focus-visible:outline-ring',\n 'peer-disabled:cursor-not-allowed peer-disabled:border-disabled peer-disabled:bg-disabled',\n ],\n {\n variants: {\n variant: {\n primary: [\n 'peer-checked:border-primary peer-checked:bg-primary peer-checked:text-primary-foreground',\n 'group-hover:border-primary-hover',\n 'peer-checked:group-hover:bg-primary-hover peer-checked:group-hover:border-primary-hover',\n ],\n accent: [\n 'peer-checked:border-accent peer-checked:bg-accent peer-checked:text-accent-foreground',\n 'group-hover:border-accent-hover',\n 'peer-checked:group-hover:bg-accent-hover peer-checked:group-hover:border-accent-hover',\n ],\n warn: [\n 'peer-checked:border-warn peer-checked:bg-warn peer-checked:text-warn-foreground',\n 'group-hover:border-warn-hover',\n 'peer-checked:group-hover:bg-warn-hover peer-checked:group-hover:border-warn-hover',\n ],\n },\n size: {\n sm: 'size-4',\n md: 'size-5',\n lg: 'size-6',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n }\n);\n\n/** Size-based classes for the inner dot indicator. */\nexport const RADIO_DOT_SIZES: Record<RadioSize, string> = {\n sm: 'size-1.5',\n md: 'size-2',\n lg: 'size-2.5',\n};\n\n/** Size-based classes for the label content. */\nexport const RADIO_LABEL_SIZES: Record<RadioSize, string> = {\n sm: 'text-sm ms-2',\n md: 'text-base ms-2.5',\n lg: 'text-lg ms-3',\n};\n\n/** Base classes for the radio group container. */\nconst RADIO_GROUP_BASE = 'com-radio-group__container flex';\n\n/** Orientation-based classes for the radio group container. */\nexport const RADIO_GROUP_ORIENTATIONS: Record<RadioOrientation, string> = {\n vertical: `${RADIO_GROUP_BASE} flex-col gap-2`,\n horizontal: `${RADIO_GROUP_BASE} flex-row flex-wrap gap-4`,\n};\n","/** Auto-incrementing ID counter for unique radio IDs. */\nlet nextRadioId = 0;\n\n/** Generates a unique radio ID. */\nexport function generateRadioId(): string {\n return `com-radio-${nextRadioId++}`;\n}\n\n/** Auto-incrementing ID counter for unique radio group IDs. */\nlet nextGroupId = 0;\n\n/** Generates a unique radio group ID. */\nexport function generateRadioGroupId(): string {\n return `com-radio-group-${nextGroupId++}`;\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n InjectionToken,\n input,\n linkedSignal,\n model,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport type {\n InputSignal,\n InputSignalWithTransform,\n ModelSignal,\n OutputEmitterRef,\n Signal,\n WritableSignal,\n} from '@angular/core';\nimport { FormGroupDirective, NgControl, NgForm } from '@angular/forms';\nimport type { ControlValueAccessor } from '@angular/forms';\nimport { ErrorStateMatcher } from 'ngx-com/components/form-field';\nimport { RADIO_GROUP_ORIENTATIONS } from './radio.variants';\nimport type { RadioOrientation, RadioSize, RadioVariant } from './radio.variants';\nimport { generateRadioGroupId } from './radio.utils';\n\n/** Event emitted when radio group value changes. */\nexport interface RadioGroupChange {\n value: string | null;\n}\n\n/** Interface for radio items that register with the group. */\nexport interface RadioItem {\n value: () => string;\n isDisabled: () => boolean;\n focus: () => void;\n}\n\n/** Context provided to child radio components via DI. */\nexport interface ComRadioGroupContext {\n name: Signal<string>;\n value: Signal<string | null>;\n disabled: Signal<boolean>;\n size: Signal<RadioSize>;\n variant: Signal<RadioVariant>;\n orientation: Signal<RadioOrientation>;\n focusedValue: Signal<string | null>;\n select: (value: string) => void;\n focusNext: (currentValue: string) => void;\n focusPrevious: (currentValue: string) => void;\n register: (radio: RadioItem) => void;\n unregister: (radio: RadioItem) => void;\n onTouched?: () => void;\n}\n\n/** Injection token for radio group context. */\nexport const COM_RADIO_GROUP: InjectionToken<ComRadioGroupContext> = new InjectionToken<ComRadioGroupContext>('COM_RADIO_GROUP');\n\n/**\n * Radio group component that manages a set of radio buttons.\n *\n * Provides mutual exclusion, shared name, and roving tabindex keyboard navigation.\n * Implements `ControlValueAccessor` for Reactive Forms integration.\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-foreground`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-foreground`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-foreground`, `--color-warn-hover`,\n * `--color-disabled`, `--color-disabled-foreground`, `--color-ring`\n *\n * @example Basic usage\n * ```html\n * <com-radio-group [(value)]=\"selectedFruit\" aria-label=\"Select a fruit\">\n * <com-radio value=\"apple\">Apple</com-radio>\n * <com-radio value=\"banana\">Banana</com-radio>\n * <com-radio value=\"cherry\">Cherry</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example With reactive forms\n * ```html\n * <com-radio-group formControlName=\"size\" aria-label=\"Select size\">\n * <com-radio value=\"sm\">Small</com-radio>\n * <com-radio value=\"md\">Medium</com-radio>\n * <com-radio value=\"lg\">Large</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example Horizontal orientation\n * ```html\n * <com-radio-group [(value)]=\"color\" orientation=\"horizontal\">\n * <com-radio value=\"red\">Red</com-radio>\n * <com-radio value=\"green\">Green</com-radio>\n * <com-radio value=\"blue\">Blue</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example With variants\n * ```html\n * <com-radio-group [(value)]=\"priority\" variant=\"warn\" size=\"lg\">\n * <com-radio value=\"low\">Low</com-radio>\n * <com-radio value=\"medium\">Medium</com-radio>\n * <com-radio value=\"high\">High</com-radio>\n * </com-radio-group>\n * ```\n */\n@Component({\n selector: 'com-radio-group',\n exportAs: 'comRadioGroup',\n template: `\n <div\n role=\"radiogroup\"\n [class]=\"groupClasses()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"computedAriaDescribedby()\"\n [attr.aria-required]=\"required() || null\"\n [attr.aria-invalid]=\"errorState() || null\"\n >\n <ng-content />\n </div>\n @if (errorState() && errorMessage()) {\n <div\n [id]=\"errorId\"\n class=\"com-radio-group__error mt-1.5 text-sm text-warn\"\n role=\"alert\"\n >\n {{ errorMessage() }}\n </div>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: COM_RADIO_GROUP,\n useFactory: () => {\n const group = inject(ComRadioGroup);\n return group.createContext();\n },\n },\n ],\n host: {\n class: 'com-radio-group block',\n '[class.com-radio-group--disabled]': 'disabled()',\n '[class.com-radio-group--error]': 'errorState()',\n },\n})\nexport class ComRadioGroup implements ControlValueAccessor {\n /** Optional NgControl for reactive forms integration. */\n readonly ngControl: NgControl | null = inject(NgControl, { optional: true, self: true });\n\n /** Error state matcher for determining when to show validation errors. */\n private readonly defaultErrorStateMatcher: ErrorStateMatcher = inject(ErrorStateMatcher);\n private readonly parentForm: NgForm | null = inject(NgForm, { optional: true });\n private readonly parentFormGroup: FormGroupDirective | null = inject(FormGroupDirective, { optional: true });\n\n /** Unique ID for this radio group instance. */\n private readonly uniqueId: string = generateRadioGroupId();\n\n /** ID for the error message element. */\n readonly errorId: string = `${this.uniqueId}-error`;\n\n /** Registered radio items. */\n private readonly registeredRadios: WritableSignal<RadioItem[]> = signal([]);\n\n // Inputs\n readonly name: InputSignal<string> = input<string>(this.uniqueId);\n readonly value: ModelSignal<string | null> = model<string | null>(null);\n readonly disabled: ModelSignal<boolean> = model<boolean>(false);\n readonly required: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n });\n readonly orientation: InputSignal<RadioOrientation> = input<RadioOrientation>('vertical');\n readonly size: InputSignal<RadioSize> = input<RadioSize>('md');\n readonly variant: InputSignal<RadioVariant> = input<RadioVariant>('primary');\n readonly errorMessage: InputSignal<string> = input<string>('');\n readonly errorStateMatcher: InputSignal<ErrorStateMatcher | undefined> = input<ErrorStateMatcher>();\n\n /** Internal signal to track when control is touched, used to trigger error state re-evaluation. */\n private readonly _touched: WritableSignal<boolean> = signal(false);\n readonly ariaLabel: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-label' });\n readonly ariaLabelledby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-labelledby' });\n readonly ariaDescribedby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-describedby' });\n\n // Outputs\n /** Emits when the selection changes, with full event details. */\n readonly selectionChange: OutputEmitterRef<RadioGroupChange> = output<RadioGroupChange>();\n\n /**\n * Tracks the currently focused radio value for roving tabindex.\n * Resets to the current selection (or first focusable) when value or radios change.\n */\n private readonly focusedValueSignal: WritableSignal<string | null> = linkedSignal({\n source: () => ({ value: this.value(), radios: this.registeredRadios() }),\n computation: ({ value, radios }) => {\n if (value && radios.some((r) => r.value() === value && !r.isDisabled())) {\n return value;\n }\n const firstFocusable = radios.find((r) => !r.isDisabled());\n return firstFocusable?.value() ?? null;\n },\n });\n\n // Computed\n /**\n * Computed error state derived from form validation.\n * Shows errors when control is invalid and touched/submitted.\n */\n readonly errorState: Signal<boolean> = computed(() => {\n // Read _touched to trigger re-evaluation when touched changes\n this._touched();\n const matcher = this.errorStateMatcher() ?? this.defaultErrorStateMatcher;\n const form = this.parentFormGroup ?? this.parentForm;\n return matcher.isErrorState(this.ngControl?.control ?? null, form);\n });\n\n readonly computedAriaDescribedby: Signal<string | null> = computed(() => {\n const userDescribedby = this.ariaDescribedby();\n if (this.errorState() && this.errorMessage()) {\n return userDescribedby ? `${userDescribedby} ${this.errorId}` : this.errorId;\n }\n return userDescribedby;\n });\n\n protected readonly groupClasses: Signal<string> = computed(() =>\n RADIO_GROUP_ORIENTATIONS[this.orientation()]\n );\n\n // CVA callbacks\n private onChange: (value: string | null) => void = () => {};\n private onTouchedCallback: () => void = () => {};\n\n constructor() {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n /** Creates the context object for child radios. */\n createContext(): ComRadioGroupContext {\n return {\n name: this.name,\n value: this.value,\n disabled: this.disabled,\n size: this.size,\n variant: this.variant,\n orientation: this.orientation,\n focusedValue: this.focusedValueSignal,\n select: this.select.bind(this),\n focusNext: this.focusNext.bind(this),\n focusPrevious: this.focusPrevious.bind(this),\n register: this.register.bind(this),\n unregister: this.unregister.bind(this),\n onTouched: () => this.onTouchedCallback(),\n };\n }\n\n /** Register a radio item with the group. */\n private register(radio: RadioItem): void {\n this.registeredRadios.update((radios) => [...radios, radio]);\n }\n\n /** Unregister a radio item from the group. */\n private unregister(radio: RadioItem): void {\n this.registeredRadios.update((radios) => radios.filter((r) => r !== radio));\n }\n\n // ControlValueAccessor implementation\n writeValue(value: string | null): void {\n this.value.set(value);\n }\n\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouchedCallback = () => {\n this._touched.set(true);\n fn();\n };\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n }\n\n // Public API\n /** Selects a radio by value. */\n select(newValue: string): void {\n if (this.disabled()) {\n return;\n }\n this.value.set(newValue);\n this.focusedValueSignal.set(newValue);\n this.onChange(newValue);\n this.selectionChange.emit({ value: newValue });\n }\n\n /** Focuses the next non-disabled radio (with cyclic wrap). */\n focusNext(currentValue: string): void {\n const allRadios = this.registeredRadios();\n const focusableRadios = allRadios.filter((r) => !r.isDisabled());\n\n if (focusableRadios.length === 0) {\n return;\n }\n\n const currentIndex = focusableRadios.findIndex((r) => r.value() === currentValue);\n const nextIndex = (currentIndex + 1) % focusableRadios.length;\n const nextRadio = focusableRadios[nextIndex];\n\n if (nextRadio) {\n this.focusedValueSignal.set(nextRadio.value());\n this.select(nextRadio.value());\n nextRadio.focus();\n }\n }\n\n /** Focuses the previous non-disabled radio (with cyclic wrap). */\n focusPrevious(currentValue: string): void {\n const allRadios = this.registeredRadios();\n const focusableRadios = allRadios.filter((r) => !r.isDisabled());\n\n if (focusableRadios.length === 0) {\n return;\n }\n\n const currentIndex = focusableRadios.findIndex((r) => r.value() === currentValue);\n const prevIndex = (currentIndex - 1 + focusableRadios.length) % focusableRadios.length;\n const prevRadio = focusableRadios[prevIndex];\n\n if (prevRadio) {\n this.focusedValueSignal.set(prevRadio.value());\n this.select(prevRadio.value());\n prevRadio.focus();\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n model,\n output,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type {\n InputSignal,\n ModelSignal,\n OnInit,\n OutputEmitterRef,\n Signal,\n} from '@angular/core';\nimport {\n radioCircleVariants,\n RADIO_DOT_SIZES,\n RADIO_LABEL_SIZES,\n} from './radio.variants';\nimport type { RadioSize, RadioVariant } from './radio.variants';\nimport { generateRadioId } from './radio.utils';\nimport { COM_RADIO_GROUP, type ComRadioGroupContext, type RadioItem } from './radio-group.component';\n\n/** Event emitted when a radio is selected. */\nexport interface RadioChange {\n value: string;\n source: ComRadio;\n}\n\n/**\n * Production-grade radio component with full accessibility support.\n *\n * Uses a native `<input type=\"radio\">` for built-in keyboard handling,\n * `:checked` pseudo-class, and screen reader support.\n *\n * Must be used within a `ComRadioGroup` which manages the selected value\n * and provides the shared `name` attribute.\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-foreground`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-foreground`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-foreground`, `--color-warn-hover`,\n * `--color-disabled`, `--color-disabled-foreground`, `--color-ring`\n *\n * @example Basic usage within a group\n * ```html\n * <com-radio-group [(value)]=\"selectedOption\">\n * <com-radio value=\"option1\">Option 1</com-radio>\n * <com-radio value=\"option2\">Option 2</com-radio>\n * <com-radio value=\"option3\">Option 3</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example Disabled option\n * ```html\n * <com-radio-group [(value)]=\"selected\">\n * <com-radio value=\"enabled\">Enabled option</com-radio>\n * <com-radio value=\"disabled\" [disabled]=\"true\">Disabled option</com-radio>\n * </com-radio-group>\n * ```\n */\n@Component({\n selector: 'com-radio',\n exportAs: 'comRadio',\n template: `\n <label\n class=\"group relative inline-flex items-center\"\n [class.cursor-pointer]=\"!isDisabled()\"\n [class.cursor-not-allowed]=\"isDisabled()\"\n >\n <span><input\n #inputElement\n type=\"radio\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [checked]=\"isChecked()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"groupName()\"\n [attr.value]=\"value()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.tabindex]=\"tabIndex()\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n /></span>\n <div [class]=\"circleClasses()\">\n <div\n class=\"com-radio__dot rounded-full bg-current transition-transform duration-150 peer-disabled:bg-disabled-foreground\"\n [class]=\"dotSizeClass()\"\n [class.scale-100]=\"isChecked()\"\n [class.scale-0]=\"!isChecked()\"\n ></div>\n </div>\n <span\n class=\"com-radio__label select-none peer-disabled:cursor-not-allowed peer-disabled:text-disabled-foreground\"\n [class]=\"labelSizeClass()\"\n >\n <ng-content />\n </span>\n </label>\n `,\n styles: `\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'com-radio inline-block align-middle',\n '[class.com-radio--disabled]': 'isDisabled()',\n '[class.com-radio--checked]': 'isChecked()',\n },\n})\nexport class ComRadio implements OnInit, RadioItem {\n /** Optional parent radio group context. */\n private readonly group: ComRadioGroupContext | null = inject(COM_RADIO_GROUP, {\n optional: true,\n });\n\n /** DestroyRef for cleanup. */\n private readonly destroyRef: DestroyRef = inject(DestroyRef);\n\n /** Reference to the native input element. */\n readonly inputRef: Signal<ElementRef<HTMLInputElement> | undefined> =\n viewChild<ElementRef<HTMLInputElement>>('inputElement');\n\n /** Unique ID for this radio instance. */\n private readonly uniqueId: string = generateRadioId();\n\n // Inputs\n readonly value: InputSignal<string> = input.required<string>();\n readonly size: InputSignal<RadioSize> = input<RadioSize>('md');\n readonly variant: InputSignal<RadioVariant> = input<RadioVariant>('primary');\n readonly disabled: ModelSignal<boolean> = model<boolean>(false);\n readonly id: InputSignal<string | undefined> = input<string>();\n readonly ariaLabel: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-label' });\n readonly ariaLabelledby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-labelledby' });\n readonly ariaDescribedby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-describedby' });\n\n // Outputs\n readonly changed: OutputEmitterRef<RadioChange> = output<RadioChange>();\n\n // Computed state\n readonly inputId: Signal<string> = computed(() => this.id() ?? this.uniqueId);\n\n /** Resolve size from group or local input. */\n readonly resolvedSize: Signal<RadioSize> = computed(\n () => this.group?.size() ?? this.size()\n );\n\n /** Resolve variant from group or local input. */\n readonly resolvedVariant: Signal<RadioVariant> = computed(\n () => this.group?.variant() ?? this.variant()\n );\n\n /** Whether this radio is checked based on group value. */\n readonly isChecked: Signal<boolean> = computed(() => {\n if (!this.group) {\n return false;\n }\n return this.group.value() === this.value();\n });\n\n /** Whether this radio is disabled (from local or group). */\n readonly isDisabled: Signal<boolean> = computed(\n () => this.disabled() || (this.group?.disabled() ?? false)\n );\n\n /** Get name from group. */\n readonly groupName: Signal<string | undefined> = computed(() => this.group?.name());\n\n /** Tab index for roving tabindex pattern. */\n readonly tabIndex: Signal<number> = computed(() => {\n if (this.isDisabled()) {\n return -1;\n }\n if (!this.group) {\n return 0;\n }\n // Roving tabindex: only the selected or first focusable item gets tabindex 0\n const isSelected = this.isChecked();\n const isFocusTarget = this.group.focusedValue() === this.value();\n\n if (isSelected || isFocusTarget) {\n return 0;\n }\n return -1;\n });\n\n protected readonly circleClasses: Signal<string> = computed(() =>\n radioCircleVariants({ variant: this.resolvedVariant(), size: this.resolvedSize() })\n );\n\n protected readonly dotSizeClass: Signal<string> = computed(() => RADIO_DOT_SIZES[this.resolvedSize()]);\n protected readonly labelSizeClass: Signal<string> = computed(() => RADIO_LABEL_SIZES[this.resolvedSize()]);\n\n ngOnInit(): void {\n // Register with the group\n this.group?.register(this);\n\n // Unregister on destroy\n this.destroyRef.onDestroy(() => {\n this.group?.unregister(this);\n });\n }\n\n // Event handlers\n protected onInputChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n if (input.checked && this.group) {\n this.group.select(this.value());\n this.changed.emit({ value: this.value(), source: this });\n }\n }\n\n protected onBlur(): void {\n this.group?.onTouched?.();\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (!this.group) {\n return;\n }\n\n const { key } = event;\n const isVertical = this.group.orientation() === 'vertical';\n const isHorizontal = this.group.orientation() === 'horizontal';\n\n let handled = false;\n\n if (\n (isVertical && key === 'ArrowDown') ||\n (isHorizontal && key === 'ArrowRight')\n ) {\n this.group.focusNext(this.value());\n handled = true;\n } else if (\n (isVertical && key === 'ArrowUp') ||\n (isHorizontal && key === 'ArrowLeft')\n ) {\n this.group.focusPrevious(this.value());\n handled = true;\n } else if (key === ' ') {\n // Space selects the focused radio\n if (!this.isChecked()) {\n this.group.select(this.value());\n this.changed.emit({ value: this.value(), source: this });\n }\n handled = true;\n }\n\n if (handled) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n // Public API\n /** Focuses this radio's input element. */\n focus(): void {\n this.inputRef()?.nativeElement.focus();\n }\n\n /** Selects this radio programmatically. */\n select(): void {\n if (this.isDisabled() || !this.group) {\n return;\n }\n this.group.select(this.value());\n this.changed.emit({ value: this.value(), source: this });\n }\n}\n","// Public API for the radio component\n\n// Main components\nexport { ComRadio } from './radio.component';\nexport { ComRadioGroup, COM_RADIO_GROUP } from './radio-group.component';\n\n// Types\nexport type { RadioChange } from './radio.component';\nexport type { RadioGroupChange, ComRadioGroupContext, RadioItem } from './radio-group.component';\n\n// Variants (for advanced customization)\nexport {\n radioCircleVariants,\n RADIO_GROUP_ORIENTATIONS,\n RADIO_DOT_SIZES,\n RADIO_LABEL_SIZES,\n} from './radio.variants';\n\nexport type { RadioSize, RadioVariant, RadioOrientation } from './radio.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAWA;;;;;;;;;;;;AAYG;AACI,MAAM,mBAAmB,GAGjB,GAAG,CAChB;IACE,mBAAmB;IACnB,kDAAkD;IAClD,qCAAqC;IACrC,gCAAgC;IAChC,sGAAsG;IACtG,0FAA0F;CAC3F,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE;gBACP,0FAA0F;gBAC1F,kCAAkC;gBAClC,yFAAyF;AAC1F,aAAA;AACD,YAAA,MAAM,EAAE;gBACN,uFAAuF;gBACvF,iCAAiC;gBACjC,uFAAuF;AACxF,aAAA;AACD,YAAA,IAAI,EAAE;gBACJ,iFAAiF;gBACjF,+BAA+B;gBAC/B,mFAAmF;AACpF,aAAA;AACF,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,EAAE,EAAE,QAAQ;AACZ,YAAA,EAAE,EAAE,QAAQ;AACZ,YAAA,EAAE,EAAE,QAAQ;AACb,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,OAAO,EAAE,SAAS;AAClB,QAAA,IAAI,EAAE,IAAI;AACX,KAAA;AACF,CAAA;AAGH;AACO,MAAM,eAAe,GAA8B;AACxD,IAAA,EAAE,EAAE,UAAU;AACd,IAAA,EAAE,EAAE,QAAQ;AACZ,IAAA,EAAE,EAAE,UAAU;;AAGhB;AACO,MAAM,iBAAiB,GAA8B;AAC1D,IAAA,EAAE,EAAE,cAAc;AAClB,IAA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EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC5I1D;AAEA;;ACFA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngx-com-components-radio.mjs","sources":["../../../projects/com/components/radio/radio.variants.ts","../../../projects/com/components/radio/radio.utils.ts","../../../projects/com/components/radio/radio-group.component.ts","../../../projects/com/components/radio/radio.component.ts","../../../projects/com/components/radio/index.ts","../../../projects/com/components/radio/ngx-com-components-radio.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\n/** Radio size variants. */\nexport type RadioSize = 'sm' | 'md' | 'lg';\n\n/** Radio color variants. */\nexport type RadioVariant = 'primary' | 'accent' | 'warn';\n\n/** Radio group orientation. */\nexport type RadioOrientation = 'vertical' | 'horizontal';\n\n/**\n * CVA variants for the visual radio circle.\n *\n * Uses `peer` selectors to style based on native input state:\n * - `peer-checked:` for checked state\n * - `peer-focus-visible:` for keyboard focus\n * - `peer-disabled:` for disabled state\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-hover`,\n * `--color-disabled`, `--color-ring`\n */\nexport const radioCircleVariants: (props?: {\n variant?: RadioVariant;\n size?: RadioSize;\n}) => string = cva(\n [\n 'com-radio__circle',\n 'inline-flex shrink-0 items-center justify-center',\n 'rounded-full border-2 border-border',\n 'transition-colors duration-150',\n 'peer-focus-visible:outline-[1px] peer-focus-visible:outline-offset-2 peer-focus-visible:outline-ring',\n 'peer-disabled:cursor-not-allowed peer-disabled:border-disabled peer-disabled:bg-disabled',\n ],\n {\n variants: {\n variant: {\n primary: [\n 'peer-checked:border-primary peer-checked:bg-primary peer-checked:text-primary-foreground',\n 'group-hover:border-primary-hover',\n 'peer-checked:group-hover:bg-primary-hover peer-checked:group-hover:border-primary-hover',\n ],\n accent: [\n 'peer-checked:border-accent peer-checked:bg-accent peer-checked:text-accent-foreground',\n 'group-hover:border-accent-hover',\n 'peer-checked:group-hover:bg-accent-hover peer-checked:group-hover:border-accent-hover',\n ],\n warn: [\n 'peer-checked:border-warn peer-checked:bg-warn peer-checked:text-warn-foreground',\n 'group-hover:border-warn-hover',\n 'peer-checked:group-hover:bg-warn-hover peer-checked:group-hover:border-warn-hover',\n ],\n },\n size: {\n sm: 'size-4',\n md: 'size-5',\n lg: 'size-6',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n }\n);\n\n/** Size-based classes for the inner dot indicator. */\nexport const RADIO_DOT_SIZES: Record<RadioSize, string> = {\n sm: 'size-1.5',\n md: 'size-2',\n lg: 'size-2.5',\n};\n\n/** Size-based classes for the label content. */\nexport const RADIO_LABEL_SIZES: Record<RadioSize, string> = {\n sm: 'text-sm ms-2',\n md: 'text-base ms-2.5',\n lg: 'text-lg ms-3',\n};\n\n/** Base classes for the radio group container. */\nconst RADIO_GROUP_BASE = 'com-radio-group__container flex';\n\n/** Orientation-based classes for the radio group container. */\nexport const RADIO_GROUP_ORIENTATIONS: Record<RadioOrientation, string> = {\n vertical: `${RADIO_GROUP_BASE} flex-col gap-2`,\n horizontal: `${RADIO_GROUP_BASE} flex-row flex-wrap gap-4`,\n};\n","/** Auto-incrementing ID counter for unique radio IDs. */\nlet nextRadioId = 0;\n\n/** Generates a unique radio ID. */\nexport function generateRadioId(): string {\n return `com-radio-${nextRadioId++}`;\n}\n\n/** Auto-incrementing ID counter for unique radio group IDs. */\nlet nextGroupId = 0;\n\n/** Generates a unique radio group ID. */\nexport function generateRadioGroupId(): string {\n return `com-radio-group-${nextGroupId++}`;\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n inject,\n InjectionToken,\n input,\n linkedSignal,\n model,\n output,\n signal,\n ViewEncapsulation,\n} from '@angular/core';\nimport type {\n InputSignal,\n InputSignalWithTransform,\n ModelSignal,\n OutputEmitterRef,\n Signal,\n WritableSignal,\n} from '@angular/core';\nimport { FormGroupDirective, NgControl, NgForm } from '@angular/forms';\nimport type { ControlValueAccessor } from '@angular/forms';\nimport { ErrorStateMatcher } from 'ngx-com/components/form-field';\nimport { RADIO_GROUP_ORIENTATIONS } from './radio.variants';\nimport type { RadioOrientation, RadioSize, RadioVariant } from './radio.variants';\nimport { generateRadioGroupId } from './radio.utils';\n\n/** Event emitted when radio group value changes. */\nexport interface RadioGroupChange {\n value: string | null;\n}\n\n/** Interface for radio items that register with the group. */\nexport interface RadioItem {\n value: () => string;\n isDisabled: () => boolean;\n focus: () => void;\n}\n\n/** Context provided to child radio components via DI. */\nexport interface ComRadioGroupContext {\n name: Signal<string>;\n value: Signal<string | null>;\n disabled: Signal<boolean>;\n size: Signal<RadioSize>;\n variant: Signal<RadioVariant>;\n orientation: Signal<RadioOrientation>;\n focusedValue: Signal<string | null>;\n select: (value: string) => void;\n focusNext: (currentValue: string) => void;\n focusPrevious: (currentValue: string) => void;\n register: (radio: RadioItem) => void;\n unregister: (radio: RadioItem) => void;\n onTouched?: () => void;\n}\n\n/** Injection token for radio group context. */\nexport const COM_RADIO_GROUP: InjectionToken<ComRadioGroupContext> = new InjectionToken<ComRadioGroupContext>('COM_RADIO_GROUP');\n\n/**\n * Radio group component that manages a set of radio buttons.\n *\n * Provides mutual exclusion, shared name, and roving tabindex keyboard navigation.\n * Implements `ControlValueAccessor` for Reactive Forms integration.\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-foreground`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-foreground`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-foreground`, `--color-warn-hover`,\n * `--color-disabled`, `--color-disabled-foreground`, `--color-ring`\n *\n * @example Basic usage\n * ```html\n * <com-radio-group [(value)]=\"selectedFruit\" aria-label=\"Select a fruit\">\n * <com-radio value=\"apple\">Apple</com-radio>\n * <com-radio value=\"banana\">Banana</com-radio>\n * <com-radio value=\"cherry\">Cherry</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example With reactive forms\n * ```html\n * <com-radio-group formControlName=\"size\" aria-label=\"Select size\">\n * <com-radio value=\"sm\">Small</com-radio>\n * <com-radio value=\"md\">Medium</com-radio>\n * <com-radio value=\"lg\">Large</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example Horizontal orientation\n * ```html\n * <com-radio-group [(value)]=\"color\" orientation=\"horizontal\">\n * <com-radio value=\"red\">Red</com-radio>\n * <com-radio value=\"green\">Green</com-radio>\n * <com-radio value=\"blue\">Blue</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example With variants\n * ```html\n * <com-radio-group [(value)]=\"priority\" variant=\"warn\" size=\"lg\">\n * <com-radio value=\"low\">Low</com-radio>\n * <com-radio value=\"medium\">Medium</com-radio>\n * <com-radio value=\"high\">High</com-radio>\n * </com-radio-group>\n * ```\n */\n@Component({\n selector: 'com-radio-group',\n exportAs: 'comRadioGroup',\n template: `\n <div\n role=\"radiogroup\"\n [class]=\"groupClasses()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"computedAriaDescribedby()\"\n [attr.aria-required]=\"required() || null\"\n [attr.aria-invalid]=\"errorState() || null\"\n >\n <ng-content />\n </div>\n @if (errorState() && errorMessage()) {\n <div\n [id]=\"errorId\"\n class=\"com-radio-group__error mt-1.5 text-sm text-warn\"\n role=\"alert\"\n >\n {{ errorMessage() }}\n </div>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: COM_RADIO_GROUP,\n useFactory: () => {\n const group = inject(ComRadioGroup);\n return group.createContext();\n },\n },\n ],\n host: {\n class: 'com-radio-group block',\n '[class.com-radio-group--disabled]': 'disabled()',\n '[class.com-radio-group--error]': 'errorState()',\n },\n})\nexport class ComRadioGroup implements ControlValueAccessor {\n /** Optional NgControl for reactive forms integration. */\n readonly ngControl: NgControl | null = inject(NgControl, { optional: true, self: true });\n\n /** Error state matcher for determining when to show validation errors. */\n private readonly defaultErrorStateMatcher: ErrorStateMatcher = inject(ErrorStateMatcher);\n private readonly parentForm: NgForm | null = inject(NgForm, { optional: true });\n private readonly parentFormGroup: FormGroupDirective | null = inject(FormGroupDirective, { optional: true });\n\n /** Unique ID for this radio group instance. */\n private readonly uniqueId: string = generateRadioGroupId();\n\n /** ID for the error message element. */\n readonly errorId: string = `${this.uniqueId}-error`;\n\n /** Registered radio items. */\n private readonly registeredRadios: WritableSignal<RadioItem[]> = signal([]);\n\n // Inputs\n readonly name: InputSignal<string> = input<string>(this.uniqueId);\n readonly value: ModelSignal<string | null> = model<string | null>(null);\n readonly disabled: ModelSignal<boolean> = model<boolean>(false);\n readonly required: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n });\n readonly orientation: InputSignal<RadioOrientation> = input<RadioOrientation>('vertical');\n readonly size: InputSignal<RadioSize> = input<RadioSize>('md');\n readonly variant: InputSignal<RadioVariant> = input<RadioVariant>('primary');\n readonly errorMessage: InputSignal<string> = input<string>('');\n readonly errorStateMatcher: InputSignal<ErrorStateMatcher | undefined> = input<ErrorStateMatcher>();\n\n /** Tracks touched state — writable by both CVA callback and Signal Forms [formField]. */\n readonly touched: ModelSignal<boolean> = model<boolean>(false);\n\n // Signal Forms inputs — set automatically by [formField] via setInputOnDirectives\n readonly invalid: InputSignal<boolean> = input<boolean>(false);\n readonly sfErrors: InputSignal<readonly unknown[]> = input<readonly unknown[]>([], { alias: 'errors' });\n\n readonly ariaLabel: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-label' });\n readonly ariaLabelledby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-labelledby' });\n readonly ariaDescribedby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-describedby' });\n\n // Outputs\n /** Emits when the selection changes, with full event details. */\n readonly selectionChange: OutputEmitterRef<RadioGroupChange> = output<RadioGroupChange>();\n\n /**\n * Tracks the currently focused radio value for roving tabindex.\n * Resets to the current selection (or first focusable) when value or radios change.\n */\n private readonly focusedValueSignal: WritableSignal<string | null> = linkedSignal({\n source: () => ({ value: this.value(), radios: this.registeredRadios() }),\n computation: ({ value, radios }) => {\n if (value && radios.some((r) => r.value() === value && !r.isDisabled())) {\n return value;\n }\n const firstFocusable = radios.find((r) => !r.isDisabled());\n return firstFocusable?.value() ?? null;\n },\n });\n\n // Computed\n /**\n * Computed error state derived from form validation.\n * Shows errors when control is invalid and touched/submitted.\n */\n readonly errorState: Signal<boolean> = computed(() => {\n if (!this.ngControl) {\n // Signal Forms: gate on invalid AND touched (mirrors ErrorStateMatcher default)\n return this.invalid() && this.touched();\n }\n // Reactive Forms: use ErrorStateMatcher (existing logic)\n this.touched();\n const matcher = this.errorStateMatcher() ?? this.defaultErrorStateMatcher;\n const form = this.parentFormGroup ?? this.parentForm;\n return matcher.isErrorState(this.ngControl.control ?? null, form);\n });\n\n readonly computedAriaDescribedby: Signal<string | null> = computed(() => {\n const userDescribedby = this.ariaDescribedby();\n if (this.errorState() && this.errorMessage()) {\n return userDescribedby ? `${userDescribedby} ${this.errorId}` : this.errorId;\n }\n return userDescribedby;\n });\n\n protected readonly groupClasses: Signal<string> = computed(() =>\n RADIO_GROUP_ORIENTATIONS[this.orientation()]\n );\n\n // CVA callbacks\n private onChange: (value: string | null) => void = () => {};\n private onTouchedCallback: () => void = () => {};\n\n constructor() {\n if (this.ngControl) {\n this.ngControl.valueAccessor = this;\n }\n }\n\n /** Creates the context object for child radios. */\n createContext(): ComRadioGroupContext {\n return {\n name: this.name,\n value: this.value,\n disabled: this.disabled,\n size: this.size,\n variant: this.variant,\n orientation: this.orientation,\n focusedValue: this.focusedValueSignal,\n select: this.select.bind(this),\n focusNext: this.focusNext.bind(this),\n focusPrevious: this.focusPrevious.bind(this),\n register: this.register.bind(this),\n unregister: this.unregister.bind(this),\n onTouched: () => this.onTouchedCallback(),\n };\n }\n\n /** Register a radio item with the group. */\n private register(radio: RadioItem): void {\n this.registeredRadios.update((radios) => [...radios, radio]);\n }\n\n /** Unregister a radio item from the group. */\n private unregister(radio: RadioItem): void {\n this.registeredRadios.update((radios) => radios.filter((r) => r !== radio));\n }\n\n // ControlValueAccessor implementation\n writeValue(value: string | null): void {\n this.value.set(value);\n }\n\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouchedCallback = () => {\n this.touched.set(true);\n fn();\n };\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabled.set(isDisabled);\n }\n\n // Public API\n /** Selects a radio by value. */\n select(newValue: string): void {\n if (this.disabled()) {\n return;\n }\n this.value.set(newValue);\n this.focusedValueSignal.set(newValue);\n this.onChange(newValue);\n this.selectionChange.emit({ value: newValue });\n }\n\n /** Focuses the next non-disabled radio (with cyclic wrap). */\n focusNext(currentValue: string): void {\n const allRadios = this.registeredRadios();\n const focusableRadios = allRadios.filter((r) => !r.isDisabled());\n\n if (focusableRadios.length === 0) {\n return;\n }\n\n const currentIndex = focusableRadios.findIndex((r) => r.value() === currentValue);\n const nextIndex = (currentIndex + 1) % focusableRadios.length;\n const nextRadio = focusableRadios[nextIndex];\n\n if (nextRadio) {\n this.focusedValueSignal.set(nextRadio.value());\n this.select(nextRadio.value());\n nextRadio.focus();\n }\n }\n\n /** Focuses the previous non-disabled radio (with cyclic wrap). */\n focusPrevious(currentValue: string): void {\n const allRadios = this.registeredRadios();\n const focusableRadios = allRadios.filter((r) => !r.isDisabled());\n\n if (focusableRadios.length === 0) {\n return;\n }\n\n const currentIndex = focusableRadios.findIndex((r) => r.value() === currentValue);\n const prevIndex = (currentIndex - 1 + focusableRadios.length) % focusableRadios.length;\n const prevRadio = focusableRadios[prevIndex];\n\n if (prevRadio) {\n this.focusedValueSignal.set(prevRadio.value());\n this.select(prevRadio.value());\n prevRadio.focus();\n }\n }\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n ElementRef,\n inject,\n input,\n model,\n output,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport type {\n InputSignal,\n ModelSignal,\n OnInit,\n OutputEmitterRef,\n Signal,\n} from '@angular/core';\nimport {\n radioCircleVariants,\n RADIO_DOT_SIZES,\n RADIO_LABEL_SIZES,\n} from './radio.variants';\nimport type { RadioSize, RadioVariant } from './radio.variants';\nimport { generateRadioId } from './radio.utils';\nimport { COM_RADIO_GROUP, type ComRadioGroupContext, type RadioItem } from './radio-group.component';\n\n/** Event emitted when a radio is selected. */\nexport interface RadioChange {\n value: string;\n source: ComRadio;\n}\n\n/**\n * Production-grade radio component with full accessibility support.\n *\n * Uses a native `<input type=\"radio\">` for built-in keyboard handling,\n * `:checked` pseudo-class, and screen reader support.\n *\n * Must be used within a `ComRadioGroup` which manages the selected value\n * and provides the shared `name` attribute.\n *\n * @tokens `--color-border`, `--color-primary`, `--color-primary-foreground`, `--color-primary-hover`,\n * `--color-accent`, `--color-accent-foreground`, `--color-accent-hover`,\n * `--color-warn`, `--color-warn-foreground`, `--color-warn-hover`,\n * `--color-disabled`, `--color-disabled-foreground`, `--color-ring`\n *\n * @example Basic usage within a group\n * ```html\n * <com-radio-group [(value)]=\"selectedOption\">\n * <com-radio value=\"option1\">Option 1</com-radio>\n * <com-radio value=\"option2\">Option 2</com-radio>\n * <com-radio value=\"option3\">Option 3</com-radio>\n * </com-radio-group>\n * ```\n *\n * @example Disabled option\n * ```html\n * <com-radio-group [(value)]=\"selected\">\n * <com-radio value=\"enabled\">Enabled option</com-radio>\n * <com-radio value=\"disabled\" [disabled]=\"true\">Disabled option</com-radio>\n * </com-radio-group>\n * ```\n */\n@Component({\n selector: 'com-radio',\n exportAs: 'comRadio',\n template: `\n <label\n class=\"group relative inline-flex items-center\"\n [class.cursor-pointer]=\"!isDisabled()\"\n [class.cursor-not-allowed]=\"isDisabled()\"\n >\n <span><input\n #inputElement\n type=\"radio\"\n class=\"peer sr-only\"\n [id]=\"inputId()\"\n [checked]=\"isChecked()\"\n [disabled]=\"isDisabled()\"\n [attr.name]=\"groupName()\"\n [attr.value]=\"value()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.tabindex]=\"tabIndex()\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n /></span>\n <div [class]=\"circleClasses()\">\n <div\n class=\"com-radio__dot rounded-full bg-current transition-transform duration-150 peer-disabled:bg-disabled-foreground\"\n [class]=\"dotSizeClass()\"\n [class.scale-100]=\"isChecked()\"\n [class.scale-0]=\"!isChecked()\"\n ></div>\n </div>\n <span\n class=\"com-radio__label select-none peer-disabled:cursor-not-allowed peer-disabled:text-disabled-foreground\"\n [class]=\"labelSizeClass()\"\n >\n <ng-content />\n </span>\n </label>\n `,\n styles: `\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border: 0;\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'com-radio inline-block align-middle',\n '[class.com-radio--disabled]': 'isDisabled()',\n '[class.com-radio--checked]': 'isChecked()',\n },\n})\nexport class ComRadio implements OnInit, RadioItem {\n /** Optional parent radio group context. */\n private readonly group: ComRadioGroupContext | null = inject(COM_RADIO_GROUP, {\n optional: true,\n });\n\n /** DestroyRef for cleanup. */\n private readonly destroyRef: DestroyRef = inject(DestroyRef);\n\n /** Reference to the native input element. */\n readonly inputRef: Signal<ElementRef<HTMLInputElement> | undefined> =\n viewChild<ElementRef<HTMLInputElement>>('inputElement');\n\n /** Unique ID for this radio instance. */\n private readonly uniqueId: string = generateRadioId();\n\n // Inputs\n readonly value: InputSignal<string> = input.required<string>();\n readonly size: InputSignal<RadioSize> = input<RadioSize>('md');\n readonly variant: InputSignal<RadioVariant> = input<RadioVariant>('primary');\n readonly disabled: ModelSignal<boolean> = model<boolean>(false);\n readonly id: InputSignal<string | undefined> = input<string>();\n readonly ariaLabel: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-label' });\n readonly ariaLabelledby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-labelledby' });\n readonly ariaDescribedby: InputSignal<string | null> = input<string | null>(null, { alias: 'aria-describedby' });\n\n // Outputs\n readonly changed: OutputEmitterRef<RadioChange> = output<RadioChange>();\n\n // Computed state\n readonly inputId: Signal<string> = computed(() => this.id() ?? this.uniqueId);\n\n /** Resolve size from group or local input. */\n readonly resolvedSize: Signal<RadioSize> = computed(\n () => this.group?.size() ?? this.size()\n );\n\n /** Resolve variant from group or local input. */\n readonly resolvedVariant: Signal<RadioVariant> = computed(\n () => this.group?.variant() ?? this.variant()\n );\n\n /** Whether this radio is checked based on group value. */\n readonly isChecked: Signal<boolean> = computed(() => {\n if (!this.group) {\n return false;\n }\n return this.group.value() === this.value();\n });\n\n /** Whether this radio is disabled (from local or group). */\n readonly isDisabled: Signal<boolean> = computed(\n () => this.disabled() || (this.group?.disabled() ?? false)\n );\n\n /** Get name from group. */\n readonly groupName: Signal<string | undefined> = computed(() => this.group?.name());\n\n /** Tab index for roving tabindex pattern. */\n readonly tabIndex: Signal<number> = computed(() => {\n if (this.isDisabled()) {\n return -1;\n }\n if (!this.group) {\n return 0;\n }\n // Roving tabindex: only the selected or first focusable item gets tabindex 0\n const isSelected = this.isChecked();\n const isFocusTarget = this.group.focusedValue() === this.value();\n\n if (isSelected || isFocusTarget) {\n return 0;\n }\n return -1;\n });\n\n protected readonly circleClasses: Signal<string> = computed(() =>\n radioCircleVariants({ variant: this.resolvedVariant(), size: this.resolvedSize() })\n );\n\n protected readonly dotSizeClass: Signal<string> = computed(() => RADIO_DOT_SIZES[this.resolvedSize()]);\n protected readonly labelSizeClass: Signal<string> = computed(() => RADIO_LABEL_SIZES[this.resolvedSize()]);\n\n ngOnInit(): void {\n // Register with the group\n this.group?.register(this);\n\n // Unregister on destroy\n this.destroyRef.onDestroy(() => {\n this.group?.unregister(this);\n });\n }\n\n // Event handlers\n protected onInputChange(event: Event): void {\n const input = event.target as HTMLInputElement;\n if (input.checked && this.group) {\n this.group.select(this.value());\n this.changed.emit({ value: this.value(), source: this });\n }\n }\n\n protected onBlur(): void {\n this.group?.onTouched?.();\n }\n\n protected onKeyDown(event: KeyboardEvent): void {\n if (!this.group) {\n return;\n }\n\n const { key } = event;\n const isVertical = this.group.orientation() === 'vertical';\n const isHorizontal = this.group.orientation() === 'horizontal';\n\n let handled = false;\n\n if (\n (isVertical && key === 'ArrowDown') ||\n (isHorizontal && key === 'ArrowRight')\n ) {\n this.group.focusNext(this.value());\n handled = true;\n } else if (\n (isVertical && key === 'ArrowUp') ||\n (isHorizontal && key === 'ArrowLeft')\n ) {\n this.group.focusPrevious(this.value());\n handled = true;\n } else if (key === ' ') {\n // Space selects the focused radio\n if (!this.isChecked()) {\n this.group.select(this.value());\n this.changed.emit({ value: this.value(), source: this });\n }\n handled = true;\n }\n\n if (handled) {\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n // Public API\n /** Focuses this radio's input element. */\n focus(): void {\n this.inputRef()?.nativeElement.focus();\n }\n\n /** Selects this radio programmatically. */\n select(): void {\n if (this.isDisabled() || !this.group) {\n return;\n }\n this.group.select(this.value());\n this.changed.emit({ value: this.value(), source: this });\n }\n}\n","// Public API for the radio component\n\n// Main components\nexport { ComRadio } from './radio.component';\nexport { ComRadioGroup, COM_RADIO_GROUP } from './radio-group.component';\n\n// Types\nexport type { RadioChange } from './radio.component';\nexport type { RadioGroupChange, ComRadioGroupContext, RadioItem } from './radio-group.component';\n\n// Variants (for advanced customization)\nexport {\n radioCircleVariants,\n RADIO_GROUP_ORIENTATIONS,\n RADIO_DOT_SIZES,\n RADIO_LABEL_SIZES,\n} from './radio.variants';\n\nexport type { RadioSize, RadioVariant, RadioOrientation } from './radio.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAWA;;;;;;;;;;;;AAYG;A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A,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,SAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AC5I1D;AAEA;;ACFA;;AAEG;;;;"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, booleanAttribute, computed, Directive } from '@angular/core';
|
|
3
|
+
import { mergeClasses } from 'ngx-com/utils';
|
|
4
|
+
import { cva } from 'class-variance-authority';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* CVA variants for the separator directive.
|
|
8
|
+
*
|
|
9
|
+
* @tokens `--color-border`, `--color-border-subtle`
|
|
10
|
+
*/
|
|
11
|
+
const separatorVariants = cva(['com-separator', 'shrink-0'], {
|
|
12
|
+
variants: {
|
|
13
|
+
orientation: {
|
|
14
|
+
horizontal: 'border-t border-l-0 w-full h-0',
|
|
15
|
+
vertical: 'border-l border-t-0 h-full w-0',
|
|
16
|
+
},
|
|
17
|
+
variant: {
|
|
18
|
+
default: 'border-border',
|
|
19
|
+
subtle: 'border-border-subtle',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
orientation: 'horizontal',
|
|
24
|
+
variant: 'default',
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Separator directive — applies a visual divider to any host element.
|
|
30
|
+
*
|
|
31
|
+
* Works on `<hr>`, `<div>`, or any other element. Supports horizontal and
|
|
32
|
+
* vertical orientations, a subtle color variant, and a decorative mode that
|
|
33
|
+
* hides the separator from assistive technology.
|
|
34
|
+
*
|
|
35
|
+
* @tokens `--color-border`, `--color-border-subtle`
|
|
36
|
+
*
|
|
37
|
+
* @example Horizontal divider
|
|
38
|
+
* ```html
|
|
39
|
+
* <hr comSeparator />
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example Vertical divider
|
|
43
|
+
* ```html
|
|
44
|
+
* <div comSeparator orientation="vertical" class="h-6"></div>
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @example Subtle variant
|
|
48
|
+
* ```html
|
|
49
|
+
* <hr comSeparator variant="subtle" />
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @example Decorative (hidden from screen readers)
|
|
53
|
+
* ```html
|
|
54
|
+
* <hr comSeparator decorative />
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
class ComSeparator {
|
|
58
|
+
/** Direction of the separator line */
|
|
59
|
+
orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
60
|
+
/** Color intensity — `default` uses border-border, `subtle` uses border-border-subtle */
|
|
61
|
+
variant = input('default', ...(ngDevMode ? [{ debugName: "variant" }] : []));
|
|
62
|
+
/** When true, hides the separator from assistive technology */
|
|
63
|
+
decorative = input(false, { ...(ngDevMode ? { debugName: "decorative" } : {}), transform: booleanAttribute });
|
|
64
|
+
/** Consumer CSS classes — merged with variant classes via mergeClasses() */
|
|
65
|
+
userClass = input('', { ...(ngDevMode ? { debugName: "userClass" } : {}), alias: 'class' });
|
|
66
|
+
/** @internal Computed host class from CVA + consumer overrides */
|
|
67
|
+
computedClass = computed(() => mergeClasses(separatorVariants({
|
|
68
|
+
orientation: this.orientation(),
|
|
69
|
+
variant: this.variant(),
|
|
70
|
+
}), this.userClass()), ...(ngDevMode ? [{ debugName: "computedClass" }] : []));
|
|
71
|
+
/** @internal Role attribute — separator when semantic, none when decorative */
|
|
72
|
+
computedRole = computed(() => this.decorative() ? 'none' : 'separator', ...(ngDevMode ? [{ debugName: "computedRole" }] : []));
|
|
73
|
+
/** @internal Aria-orientation — set only when not decorative */
|
|
74
|
+
computedAriaOrientation = computed(() => this.decorative() ? null : this.orientation(), ...(ngDevMode ? [{ debugName: "computedAriaOrientation" }] : []));
|
|
75
|
+
/** @internal Aria-hidden — true only when decorative */
|
|
76
|
+
computedAriaHidden = computed(() => this.decorative() ? 'true' : null, ...(ngDevMode ? [{ debugName: "computedAriaHidden" }] : []));
|
|
77
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ComSeparator, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
78
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.0", type: ComSeparator, isStandalone: true, selector: "[comSeparator]", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, decorative: { classPropertyName: "decorative", publicName: "decorative", isSignal: true, isRequired: false, transformFunction: null }, userClass: { classPropertyName: "userClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "computedClass()", "attr.role": "computedRole()", "attr.aria-orientation": "computedAriaOrientation()", "attr.aria-hidden": "computedAriaHidden()" } }, exportAs: ["comSeparator"], ngImport: i0 });
|
|
79
|
+
}
|
|
80
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.0", ngImport: i0, type: ComSeparator, decorators: [{
|
|
81
|
+
type: Directive,
|
|
82
|
+
args: [{
|
|
83
|
+
selector: '[comSeparator]',
|
|
84
|
+
exportAs: 'comSeparator',
|
|
85
|
+
host: {
|
|
86
|
+
'[class]': 'computedClass()',
|
|
87
|
+
'[attr.role]': 'computedRole()',
|
|
88
|
+
'[attr.aria-orientation]': 'computedAriaOrientation()',
|
|
89
|
+
'[attr.aria-hidden]': 'computedAriaHidden()',
|
|
90
|
+
},
|
|
91
|
+
}]
|
|
92
|
+
}], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], decorative: [{ type: i0.Input, args: [{ isSignal: true, alias: "decorative", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }] } });
|
|
93
|
+
|
|
94
|
+
// Public API for the separator directive
|
|
95
|
+
// Main directive
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Generated bundle index. Do not edit.
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
export { ComSeparator, separatorVariants };
|
|
102
|
+
//# sourceMappingURL=ngx-com-components-separator.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-com-components-separator.mjs","sources":["../../../projects/com/components/separator/separator.variants.ts","../../../projects/com/components/separator/separator.directive.ts","../../../projects/com/components/separator/index.ts","../../../projects/com/components/separator/ngx-com-components-separator.ts"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\n\n/**\n * Orientation type for separator direction.\n */\nexport type SeparatorOrientation = 'horizontal' | 'vertical';\n\n/**\n * Variant type for separator appearance.\n */\nexport type SeparatorVariant = 'default' | 'subtle';\n\n/**\n * CVA variants for the separator directive.\n *\n * @tokens `--color-border`, `--color-border-subtle`\n */\nexport const separatorVariants: (props?: {\n orientation?: SeparatorOrientation;\n variant?: SeparatorVariant;\n}) => string = cva(\n ['com-separator', 'shrink-0'],\n {\n variants: {\n orientation: {\n horizontal: 'border-t border-l-0 w-full h-0',\n vertical: 'border-l border-t-0 h-full w-0',\n },\n variant: {\n default: 'border-border',\n subtle: 'border-border-subtle',\n },\n },\n defaultVariants: {\n orientation: 'horizontal',\n variant: 'default',\n },\n }\n);\n\nexport type SeparatorVariants = VariantProps<typeof separatorVariants>;\n","import {\n booleanAttribute,\n computed,\n Directive,\n input,\n} from '@angular/core';\nimport type { InputSignal, InputSignalWithTransform, Signal } from '@angular/core';\nimport { mergeClasses } from './separator.utils';\nimport { separatorVariants } from './separator.variants';\nimport type { SeparatorOrientation, SeparatorVariant } from './separator.variants';\n\n/**\n * Separator directive — applies a visual divider to any host element.\n *\n * Works on `<hr>`, `<div>`, or any other element. Supports horizontal and\n * vertical orientations, a subtle color variant, and a decorative mode that\n * hides the separator from assistive technology.\n *\n * @tokens `--color-border`, `--color-border-subtle`\n *\n * @example Horizontal divider\n * ```html\n * <hr comSeparator />\n * ```\n *\n * @example Vertical divider\n * ```html\n * <div comSeparator orientation=\"vertical\" class=\"h-6\"></div>\n * ```\n *\n * @example Subtle variant\n * ```html\n * <hr comSeparator variant=\"subtle\" />\n * ```\n *\n * @example Decorative (hidden from screen readers)\n * ```html\n * <hr comSeparator decorative />\n * ```\n */\n@Directive({\n selector: '[comSeparator]',\n exportAs: 'comSeparator',\n host: {\n '[class]': 'computedClass()',\n '[attr.role]': 'computedRole()',\n '[attr.aria-orientation]': 'computedAriaOrientation()',\n '[attr.aria-hidden]': 'computedAriaHidden()',\n },\n})\nexport class ComSeparator {\n /** Direction of the separator line */\n readonly orientation: InputSignal<SeparatorOrientation> = input<SeparatorOrientation>('horizontal');\n\n /** Color intensity — `default` uses border-border, `subtle` uses border-border-subtle */\n readonly variant: InputSignal<SeparatorVariant> = input<SeparatorVariant>('default');\n\n /** When true, hides the separator from assistive technology */\n readonly decorative: InputSignalWithTransform<boolean, unknown> = input(false, { transform: booleanAttribute });\n\n /** Consumer CSS classes — merged with variant classes via mergeClasses() */\n readonly userClass: InputSignal<string> = input<string>('', { alias: 'class' });\n\n /** @internal Computed host class from CVA + consumer overrides */\n protected readonly computedClass: Signal<string> = computed(() =>\n mergeClasses(\n separatorVariants({\n orientation: this.orientation(),\n variant: this.variant(),\n }),\n this.userClass()\n )\n );\n\n /** @internal Role attribute — separator when semantic, none when decorative */\n protected readonly computedRole: Signal<string> = computed(() =>\n this.decorative() ? 'none' : 'separator'\n );\n\n /** @internal Aria-orientation — set only when not decorative */\n protected readonly computedAriaOrientation: Signal<string | null> = computed(() =>\n this.decorative() ? null : this.orientation()\n );\n\n /** @internal Aria-hidden — true only when decorative */\n protected readonly computedAriaHidden: Signal<'true' | null> = computed(() =>\n this.decorative() ? 'true' : null\n );\n}\n","// Public API for the separator directive\n\n// Main directive\nexport { ComSeparator } from './separator.directive';\n\n// Variants (for advanced customization)\nexport { separatorVariants } from './separator.variants';\n\nexport type {\n SeparatorOrientation,\n SeparatorVariant,\n SeparatorVariants,\n} from './separator.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AAYA;;;;AAIG;AACI,MAAM,iBAAiB,GAGf,GAAG,CAChB,CAAC,eAAe,EAAE,UAAU,CAAC,EAC7B;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,WAAW,EAAE;AACX,YAAA,UAAU,EAAE,gCAAgC;AAC5C,YAAA,QAAQ,EAAE,gCAAgC;AAC3C,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,eAAe;AACxB,YAAA,MAAM,EAAE,sBAAsB;AAC/B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,WAAW,EAAE,YAAY;AACzB,QAAA,OAAO,EAAE,SAAS;AACnB,KAAA;AACF,CAAA;;AC1BH;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;MAWU,YAAY,CAAA;;AAEd,IAAA,WAAW,GAAsC,KAAK,CAAuB,YAAY,uDAAC;;AAG1F,IAAA,OAAO,GAAkC,KAAK,CAAmB,SAAS,mDAAC;;IAG3E,UAAU,GAA+C,KAAK,CAAC,KAAK,uDAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAGtG,SAAS,GAAwB,KAAK,CAAS,EAAE,sDAA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AAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,OAAA,EAAA,iBAAA,EAAA,WAAA,EAAA,gBAAA,EAAA,uBAAA,EAAA,2BAAA,EAAA,kBAAA,EAAA,sBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAZ,YAAY,EAAA,UAAA,EAAA,CAAA;kBAVxB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,IAAI,EAAE;AACJ,wBAAA,SAAS,EAAE,iBAAiB;AAC5B,wBAAA,aAAa,EAAE,gBAAgB;AAC/B,wBAAA,yBAAyB,EAAE,2BAA2B;AACtD,wBAAA,oBAAoB,EAAE,sBAAsB;AAC7C,qBAAA;AACF,iBAAA;;;ACjDD;AAEA;;ACFA;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngx-com",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/avs2001/ngx-com"
|
|
@@ -127,6 +127,10 @@
|
|
|
127
127
|
"types": "./types/ngx-com-components-segmented-control.d.ts",
|
|
128
128
|
"default": "./fesm2022/ngx-com-components-segmented-control.mjs"
|
|
129
129
|
},
|
|
130
|
+
"./components/separator": {
|
|
131
|
+
"types": "./types/ngx-com-components-separator.d.ts",
|
|
132
|
+
"default": "./fesm2022/ngx-com-components-separator.mjs"
|
|
133
|
+
},
|
|
130
134
|
"./components/sort": {
|
|
131
135
|
"types": "./types/ngx-com-components-sort.d.ts",
|
|
132
136
|
"default": "./fesm2022/ngx-com-components-sort.mjs"
|
|
@@ -85,8 +85,12 @@ declare class ComCheckbox implements ControlValueAccessor {
|
|
|
85
85
|
readonly checked: ModelSignal<boolean>;
|
|
86
86
|
readonly indeterminate: ModelSignal<boolean>;
|
|
87
87
|
readonly disabled: ModelSignal<boolean>;
|
|
88
|
-
readonly
|
|
88
|
+
readonly htmlValue: InputSignal<string | undefined>;
|
|
89
89
|
readonly name: InputSignal<string | undefined>;
|
|
90
|
+
readonly touched: ModelSignal<boolean>;
|
|
91
|
+
readonly invalid: InputSignal<boolean>;
|
|
92
|
+
readonly sfErrors: InputSignal<readonly unknown[]>;
|
|
93
|
+
readonly sfRequired: InputSignal<boolean>;
|
|
90
94
|
readonly id: InputSignal<string | undefined>;
|
|
91
95
|
readonly ariaLabel: InputSignal<string | null>;
|
|
92
96
|
readonly ariaLabelledby: InputSignal<string | null>;
|
|
@@ -103,13 +107,14 @@ declare class ComCheckbox implements ControlValueAccessor {
|
|
|
103
107
|
registerOnChange(fn: (value: boolean) => void): void;
|
|
104
108
|
registerOnTouched(fn: () => void): void;
|
|
105
109
|
setDisabledState(isDisabled: boolean): void;
|
|
110
|
+
protected onBlur(): void;
|
|
106
111
|
protected onInputChange(event: Event): void;
|
|
107
112
|
/** Focuses this checkbox's input element. */
|
|
108
113
|
focus(): void;
|
|
109
114
|
/** Toggles the checkbox state programmatically. */
|
|
110
115
|
toggle(): void;
|
|
111
116
|
static ɵfac: i0.ɵɵFactoryDeclaration<ComCheckbox, never>;
|
|
112
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ComCheckbox, "com-checkbox", ["comCheckbox"], { "size": { "alias": "size"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "
|
|
117
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ComCheckbox, "com-checkbox", ["comCheckbox"], { "size": { "alias": "size"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "indeterminate": { "alias": "indeterminate"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "htmlValue": { "alias": "value"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "sfErrors": { "alias": "errors"; "required": false; "isSignal": true; }; "sfRequired": { "alias": "required"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "indeterminate": "indeterminateChange"; "disabled": "disabledChange"; "touched": "touchedChange"; "changed": "changed"; }, never, ["*"], true, never>;
|
|
113
118
|
}
|
|
114
119
|
|
|
115
120
|
export { CHECKBOX_ICON_SIZES, CHECKBOX_LABEL_SIZES, ComCheckbox, checkboxBoxVariants };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { TemplateRef, Signal, InputSignal, OutputEmitterRef, WritableSignal, OnInit } from '@angular/core';
|
|
2
|
+
import { TemplateRef, Signal, InputSignal, ModelSignal, OutputEmitterRef, WritableSignal, OnInit } from '@angular/core';
|
|
3
3
|
import { ControlValueAccessor, NgControl } from '@angular/forms';
|
|
4
4
|
import { FormFieldControl, ErrorStateMatcher, FormFieldAppearance } from 'ngx-com/components/form-field';
|
|
5
5
|
import { VariantProps } from 'class-variance-authority';
|
|
@@ -473,7 +473,7 @@ declare class ComDropdown<T> implements ControlValueAccessor, FormFieldControl<T
|
|
|
473
473
|
/** Array of options to display. */
|
|
474
474
|
readonly options: InputSignal<T[]>;
|
|
475
475
|
/** Current value (single or array for multiple). */
|
|
476
|
-
readonly value:
|
|
476
|
+
readonly value: ModelSignal<T | T[] | null>;
|
|
477
477
|
/** Placeholder text when no value is selected. */
|
|
478
478
|
readonly placeholder: InputSignal<string>;
|
|
479
479
|
/** Enable multi-select mode. */
|
|
@@ -518,8 +518,9 @@ declare class ComDropdown<T> implements ControlValueAccessor, FormFieldControl<T
|
|
|
518
518
|
readonly maxVisibleTags: InputSignal<number | null>;
|
|
519
519
|
/** Custom error state matcher for determining when to show errors. */
|
|
520
520
|
readonly errorStateMatcher: InputSignal<ErrorStateMatcher | undefined>;
|
|
521
|
-
|
|
522
|
-
readonly
|
|
521
|
+
readonly touched: ModelSignal<boolean>;
|
|
522
|
+
readonly invalid: InputSignal<boolean>;
|
|
523
|
+
readonly sfErrors: InputSignal<readonly unknown[]>;
|
|
523
524
|
/** Emitted when search query changes. */
|
|
524
525
|
readonly searchChange: OutputEmitterRef<string>;
|
|
525
526
|
/** Emitted when panel opens. */
|
|
@@ -556,6 +557,8 @@ declare class ComDropdown<T> implements ControlValueAccessor, FormFieldControl<T
|
|
|
556
557
|
readonly shouldLabelFloat: Signal<boolean>;
|
|
557
558
|
/** Whether the control is in an error state. Implements FormFieldControl. */
|
|
558
559
|
readonly errorState: Signal<boolean>;
|
|
560
|
+
/** Structured validation errors from Signal Forms, exposed for the parent form field. */
|
|
561
|
+
readonly errors: Signal<readonly unknown[] | null>;
|
|
559
562
|
/** Unique ID for the control. Implements FormFieldControl. */
|
|
560
563
|
readonly id: Signal<string>;
|
|
561
564
|
/**
|
|
@@ -659,7 +662,7 @@ declare class ComDropdown<T> implements ControlValueAccessor, FormFieldControl<T
|
|
|
659
662
|
private typeAhead;
|
|
660
663
|
private announce;
|
|
661
664
|
static ɵfac: i0.ɵɵFactoryDeclaration<ComDropdown<any>, never>;
|
|
662
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ComDropdown<any>, "com-dropdown", ["comDropdown"], { "options": { "alias": "options"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "compareWith": { "alias": "compareWith"; "required": false; "isSignal": true; }; "displayWith": { "alias": "displayWith"; "required": false; "isSignal": true; }; "filterWith": { "alias": "filterWith"; "required": false; "isSignal": true; }; "groupBy": { "alias": "groupBy"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "panelClass": { "alias": "panelClass"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "panelWidth": { "alias": "panelWidth"; "required": false; "isSignal": true; }; "searchDebounceMs": { "alias": "searchDebounceMs"; "required": false; "isSignal": true; }; "virtualScrollThreshold": { "alias": "virtualScrollThreshold"; "required": false; "isSignal": true; }; "maxVisibleTags": { "alias": "maxVisibleTags"; "required": false; "isSignal": true; }; "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; "isSignal": true; }; }, { "
|
|
665
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ComDropdown<any>, "com-dropdown", ["comDropdown"], { "options": { "alias": "options"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "searchable": { "alias": "searchable"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "clearable": { "alias": "clearable"; "required": false; "isSignal": true; }; "compareWith": { "alias": "compareWith"; "required": false; "isSignal": true; }; "displayWith": { "alias": "displayWith"; "required": false; "isSignal": true; }; "filterWith": { "alias": "filterWith"; "required": false; "isSignal": true; }; "groupBy": { "alias": "groupBy"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "userClass": { "alias": "class"; "required": false; "isSignal": true; }; "panelClass": { "alias": "panelClass"; "required": false; "isSignal": true; }; "maxHeight": { "alias": "maxHeight"; "required": false; "isSignal": true; }; "panelWidth": { "alias": "panelWidth"; "required": false; "isSignal": true; }; "searchDebounceMs": { "alias": "searchDebounceMs"; "required": false; "isSignal": true; }; "virtualScrollThreshold": { "alias": "virtualScrollThreshold"; "required": false; "isSignal": true; }; "maxVisibleTags": { "alias": "maxVisibleTags"; "required": false; "isSignal": true; }; "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "sfErrors": { "alias": "errors"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "touched": "touchedChange"; "searchChange": "searchChange"; "opened": "opened"; "closed": "closed"; }, ["optionTemplate", "selectedTemplate", "emptyTemplate", "groupTemplate", "tagTemplate"], never, true, never>;
|
|
663
666
|
}
|
|
664
667
|
|
|
665
668
|
/**
|
|
@@ -35,6 +35,8 @@ declare abstract class FormFieldControl<T = unknown> {
|
|
|
35
35
|
abstract readonly errorState: Signal<boolean>;
|
|
36
36
|
/** Unique ID for the control element. */
|
|
37
37
|
abstract readonly id: Signal<string>;
|
|
38
|
+
/** Structured validation errors (Signal Forms path). */
|
|
39
|
+
readonly errors?: Signal<readonly unknown[] | null>;
|
|
38
40
|
/** Called when the form field container is clicked. */
|
|
39
41
|
abstract onContainerClick(event: MouseEvent): void;
|
|
40
42
|
}
|
|
@@ -131,8 +133,10 @@ declare class ComHint {
|
|
|
131
133
|
*/
|
|
132
134
|
declare class ComError {
|
|
133
135
|
readonly id: string;
|
|
134
|
-
/** Reference to the form control
|
|
136
|
+
/** Reference to the form control (Reactive Forms path). */
|
|
135
137
|
private readonly _control;
|
|
138
|
+
/** Structured errors from Signal Forms. */
|
|
139
|
+
private readonly _signalErrors;
|
|
136
140
|
/**
|
|
137
141
|
* Show this error only when a specific validation error key is present.
|
|
138
142
|
* If empty, the error is always shown when the control is in error state.
|
|
@@ -145,10 +149,15 @@ declare class ComError {
|
|
|
145
149
|
*/
|
|
146
150
|
readonly shouldShow: Signal<boolean>;
|
|
147
151
|
/**
|
|
148
|
-
* Sets the form control reference.
|
|
152
|
+
* Sets the form control reference (Reactive Forms).
|
|
149
153
|
* Called by the parent form field component.
|
|
150
154
|
*/
|
|
151
155
|
setControl(control: AbstractControl | null): void;
|
|
156
|
+
/**
|
|
157
|
+
* Sets structured validation errors (Signal Forms).
|
|
158
|
+
* Called by the parent form field component.
|
|
159
|
+
*/
|
|
160
|
+
setSignalErrors(errors: readonly unknown[]): void;
|
|
152
161
|
static ɵfac: i0.ɵɵFactoryDeclaration<ComError, never>;
|
|
153
162
|
static ɵdir: i0.ɵɵDirectiveDeclaration<ComError, "[comError]", ["comError"], { "match": { "alias": "match"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
154
163
|
}
|
|
@@ -414,6 +423,11 @@ declare class ComInput implements FormFieldControl<string>, OnInit, DoCheck {
|
|
|
414
423
|
readonly inputRequired: InputSignalWithTransform<boolean, unknown>;
|
|
415
424
|
readonly userAriaDescribedBy: InputSignal<string>;
|
|
416
425
|
readonly errorStateMatcher: InputSignal<ErrorStateMatcher | undefined>;
|
|
426
|
+
readonly sfInvalid: InputSignal<boolean>;
|
|
427
|
+
readonly sfTouched: InputSignalWithTransform<boolean, unknown>;
|
|
428
|
+
readonly sfErrors: InputSignal<readonly unknown[]>;
|
|
429
|
+
/** Whether the form system is Signal Forms (no NgControl present). */
|
|
430
|
+
private readonly isSignalForms;
|
|
417
431
|
private readonly _focused;
|
|
418
432
|
private readonly _autofilled;
|
|
419
433
|
private readonly _empty;
|
|
@@ -426,6 +440,8 @@ declare class ComInput implements FormFieldControl<string>, OnInit, DoCheck {
|
|
|
426
440
|
readonly disabled: Signal<boolean>;
|
|
427
441
|
readonly required: Signal<boolean>;
|
|
428
442
|
readonly errorState: Signal<boolean>;
|
|
443
|
+
/** Structured validation errors from Signal Forms, exposed for the parent form field. */
|
|
444
|
+
readonly errors: Signal<readonly unknown[] | null>;
|
|
429
445
|
/** Combined aria-describedby including user-provided and form-field-generated IDs. */
|
|
430
446
|
private readonly _describedByIds;
|
|
431
447
|
readonly ariaDescribedBy: Signal<string>;
|
|
@@ -452,7 +468,7 @@ declare class ComInput implements FormFieldControl<string>, OnInit, DoCheck {
|
|
|
452
468
|
/** Focus the native element. */
|
|
453
469
|
focus(): void;
|
|
454
470
|
static ɵfac: i0.ɵɵFactoryDeclaration<ComInput, never>;
|
|
455
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ComInput, "input[comInput], textarea[comInput]", ["comInput"], { "inputId": { "alias": "id"; "required": false; "isSignal": true; }; "inputDisabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "inputRequired": { "alias": "required"; "required": false; "isSignal": true; }; "userAriaDescribedBy": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
471
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ComInput, "input[comInput], textarea[comInput]", ["comInput"], { "inputId": { "alias": "id"; "required": false; "isSignal": true; }; "inputDisabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "inputRequired": { "alias": "required"; "required": false; "isSignal": true; }; "userAriaDescribedBy": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; "isSignal": true; }; "sfInvalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "sfTouched": { "alias": "touched"; "required": false; "isSignal": true; }; "sfErrors": { "alias": "errors"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
456
472
|
}
|
|
457
473
|
|
|
458
474
|
/**
|
|
@@ -130,8 +130,10 @@ declare class ComRadioGroup implements ControlValueAccessor {
|
|
|
130
130
|
readonly variant: InputSignal<RadioVariant>;
|
|
131
131
|
readonly errorMessage: InputSignal<string>;
|
|
132
132
|
readonly errorStateMatcher: InputSignal<ErrorStateMatcher | undefined>;
|
|
133
|
-
/**
|
|
134
|
-
|
|
133
|
+
/** Tracks touched state — writable by both CVA callback and Signal Forms [formField]. */
|
|
134
|
+
readonly touched: ModelSignal<boolean>;
|
|
135
|
+
readonly invalid: InputSignal<boolean>;
|
|
136
|
+
readonly sfErrors: InputSignal<readonly unknown[]>;
|
|
135
137
|
readonly ariaLabel: InputSignal<string | null>;
|
|
136
138
|
readonly ariaLabelledby: InputSignal<string | null>;
|
|
137
139
|
readonly ariaDescribedby: InputSignal<string | null>;
|
|
@@ -169,7 +171,7 @@ declare class ComRadioGroup implements ControlValueAccessor {
|
|
|
169
171
|
/** Focuses the previous non-disabled radio (with cyclic wrap). */
|
|
170
172
|
focusPrevious(currentValue: string): void;
|
|
171
173
|
static ɵfac: i0.ɵɵFactoryDeclaration<ComRadioGroup, never>;
|
|
172
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ComRadioGroup, "com-radio-group", ["comRadioGroup"], { "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; "selectionChange": "selectionChange"; }, never, ["*"], true, never>;
|
|
174
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ComRadioGroup, "com-radio-group", ["comRadioGroup"], { "name": { "alias": "name"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "errorMessage": { "alias": "errorMessage"; "required": false; "isSignal": true; }; "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; "isSignal": true; }; "touched": { "alias": "touched"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "sfErrors": { "alias": "errors"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "aria-label"; "required": false; "isSignal": true; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; "isSignal": true; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; "touched": "touchedChange"; "selectionChange": "selectionChange"; }, never, ["*"], true, never>;
|
|
173
175
|
}
|
|
174
176
|
|
|
175
177
|
/** Event emitted when a radio is selected. */
|