@radix-ng/primitives 0.8.1 → 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/accordion/index.d.ts +3 -3
- package/accordion/src/accordion-content.directive.d.ts +1 -1
- package/accordion/src/accordion-header.directive.d.ts +1 -1
- package/accordion/src/accordion-item.directive.d.ts +1 -1
- package/accordion/src/accordion-root.directive.d.ts +1 -1
- package/accordion/src/accordion-trigger.directive.d.ts +1 -1
- package/alert-dialog/index.d.ts +2 -2
- package/avatar/index.d.ts +2 -2
- package/avatar/src/avatar-fallback.directive.d.ts +3 -3
- package/avatar/src/avatar-image.directive.d.ts +6 -6
- package/avatar/src/avatar-root.directive.d.ts +4 -4
- package/checkbox/index.d.ts +2 -0
- package/checkbox/src/checkbox-button.directive.d.ts +8 -0
- package/checkbox/src/checkbox-indicator.directive.d.ts +1 -1
- package/checkbox/src/checkbox-input.directive.d.ts +9 -0
- package/checkbox/src/checkbox.directive.d.ts +7 -5
- package/collapsible/index.d.ts +1 -1
- package/collapsible/src/collapsible-content.directive.d.ts +1 -1
- package/collapsible/src/collapsible-root.directive.d.ts +1 -1
- package/collapsible/src/collapsible-trigger.directive.d.ts +1 -1
- package/dropdown-menu/index.d.ts +8 -3
- package/dropdown-menu/src/dropdown-menu-content.directive.d.ts +12 -2
- package/dropdown-menu/src/dropdown-menu-item-checkbox.directive.d.ts +6 -0
- package/dropdown-menu/src/dropdown-menu-item-indicator.directive.d.ts +7 -0
- package/dropdown-menu/src/dropdown-menu-item-radio-group.directive.d.ts +12 -0
- package/dropdown-menu/src/dropdown-menu-item-radio.directive.d.ts +19 -0
- package/dropdown-menu/src/dropdown-menu-item-selectable.d.ts +14 -0
- package/dropdown-menu/src/dropdown-menu-item.directive.d.ts +13 -4
- package/dropdown-menu/src/dropdown-menu-label.directive.d.ts +1 -1
- package/dropdown-menu/src/dropdown-menu-separator.directive.d.ts +2 -2
- package/dropdown-menu/src/dropdown-menu-trigger.directive.d.ts +33 -2
- package/esm2022/accordion/index.mjs +4 -4
- package/esm2022/accordion/src/accordion-content.directive.mjs +7 -9
- package/esm2022/accordion/src/accordion-header.directive.mjs +5 -5
- package/esm2022/accordion/src/accordion-item.directive.mjs +17 -9
- package/esm2022/accordion/src/accordion-root.directive.mjs +5 -5
- package/esm2022/accordion/src/accordion-trigger.directive.mjs +5 -5
- package/esm2022/alert-dialog/index.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog-cancel.directive.mjs +4 -4
- package/esm2022/alert-dialog/src/alert-dialog-content.directive.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog-root.directive.mjs +5 -4
- package/esm2022/alert-dialog/src/alert-dialog-title.directive.mjs +3 -3
- package/esm2022/alert-dialog/src/alert-dialog-trigger.directive.mjs +4 -4
- package/esm2022/alert-dialog/src/alert-dialog.service.mjs +6 -9
- package/esm2022/avatar/index.mjs +1 -1
- package/esm2022/avatar/src/avatar-fallback.directive.mjs +6 -6
- package/esm2022/avatar/src/avatar-image.directive.mjs +6 -6
- package/esm2022/avatar/src/avatar-root.directive.mjs +6 -6
- package/esm2022/checkbox/index.mjs +3 -1
- package/esm2022/checkbox/src/checkbox-button.directive.mjs +33 -0
- package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +6 -5
- package/esm2022/checkbox/src/checkbox-input.directive.mjs +41 -0
- package/esm2022/checkbox/src/checkbox.directive.mjs +18 -22
- package/esm2022/checkbox/src/checkbox.token.mjs +1 -1
- package/esm2022/collapsible/index.mjs +2 -2
- package/esm2022/collapsible/src/collapsible-content.directive.mjs +13 -7
- package/esm2022/collapsible/src/collapsible-root.directive.mjs +5 -5
- package/esm2022/collapsible/src/collapsible-trigger.directive.mjs +5 -5
- package/esm2022/dropdown-menu/index.mjs +9 -4
- package/esm2022/dropdown-menu/src/dropdown-menu-content.directive.mjs +36 -10
- package/esm2022/dropdown-menu/src/dropdown-menu-item-checkbox.directive.mjs +26 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-indicator.directive.mjs +22 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-radio-group.directive.mjs +37 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-radio.directive.mjs +60 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-selectable.mjs +40 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item.directive.mjs +45 -13
- package/esm2022/dropdown-menu/src/dropdown-menu-label.directive.mjs +5 -5
- package/esm2022/dropdown-menu/src/dropdown-menu-separator.directive.mjs +8 -8
- package/esm2022/dropdown-menu/src/dropdown-menu-trigger.directive.mjs +134 -12
- package/esm2022/label/index.mjs +2 -2
- package/esm2022/label/src/label.directive.mjs +54 -0
- package/esm2022/menu/index.mjs +7 -7
- package/esm2022/menu/src/menu-content.directive.mjs +3 -3
- package/esm2022/menu/src/menu-directive.mjs +3 -3
- package/esm2022/menu/src/menu-group.directive.mjs +3 -3
- package/esm2022/menu/src/menu-item.directive.mjs +8 -4
- package/esm2022/menu/src/menu-label.directive.mjs +3 -3
- package/esm2022/menu/src/menu-separator.directive.mjs +4 -4
- package/esm2022/menubar/index.mjs +7 -7
- package/esm2022/menubar/src/menubar-content.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-item-checkbox.directive.mjs +4 -4
- package/esm2022/menubar/src/menubar-item-indicator.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-item-radio.directive.mjs +4 -4
- package/esm2022/menubar/src/menubar-item.directive.mjs +4 -4
- package/esm2022/menubar/src/menubar-radio-group.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-root.directive.mjs +3 -3
- package/esm2022/menubar/src/menubar-separator.directive.mjs +4 -4
- package/esm2022/menubar/src/menubar-trigger.directive.mjs +4 -4
- package/esm2022/progress/src/progress-indicator.directive.mjs +19 -9
- package/esm2022/progress/src/progress-root.directive.mjs +63 -7
- package/esm2022/radio/src/radio-indicator.directive.mjs +4 -4
- package/esm2022/radio/src/radio-item.directive.mjs +4 -8
- package/esm2022/radio/src/radio-root.directive.mjs +5 -9
- package/esm2022/separator/src/separator.directive.mjs +3 -3
- package/esm2022/switch/index.mjs +29 -3
- package/esm2022/switch/src/switch-input.directive.mjs +12 -10
- package/esm2022/switch/src/switch-root.directive.mjs +47 -23
- package/esm2022/switch/src/switch-thumb.directive.mjs +7 -7
- package/esm2022/tabs/index.mjs +7 -7
- package/esm2022/tabs/src/tabs-content.directive.mjs +7 -5
- package/esm2022/tabs/src/tabs-context.service.mjs +3 -3
- package/esm2022/tabs/src/tabs-list.directive.mjs +5 -5
- package/esm2022/tabs/src/tabs-root.directive.mjs +5 -5
- package/esm2022/tabs/src/tabs-trigger.directive.mjs +5 -5
- package/esm2022/toggle/index.mjs +2 -2
- package/esm2022/toggle/src/toggle.directive.mjs +39 -0
- package/esm2022/toggle-group/src/toggle-group-button.directive.mjs +14 -13
- package/esm2022/toggle-group/src/toggle-group-button.token.mjs +1 -1
- package/esm2022/toggle-group/src/toggle-group-multi.directive.mjs +18 -34
- package/esm2022/toggle-group/src/toggle-group.directive.mjs +5 -25
- package/esm2022/toggle-group/src/toggle-group.token.mjs +1 -1
- package/fesm2022/radix-ng-primitives-accordion.mjs +73 -67
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +49 -51
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-avatar.mjs +15 -15
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-checkbox.mjs +91 -26
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-collapsible.mjs +20 -14
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +386 -42
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-label.mjs +22 -16
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menu.mjs +26 -22
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-menubar.mjs +31 -31
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-progress.mjs +80 -14
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-radio.mjs +10 -14
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-separator.mjs +3 -3
- package/fesm2022/radix-ng-primitives-switch.mjs +94 -46
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +25 -23
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +34 -65
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +18 -28
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/label/index.d.ts +1 -1
- package/label/src/label.directive.d.ts +23 -0
- package/menu/index.d.ts +2 -2
- package/menubar/index.d.ts +2 -2
- package/package.json +1 -7
- package/progress/src/progress-indicator.directive.d.ts +12 -2
- package/progress/src/progress-root.directive.d.ts +38 -4
- package/radio/src/radio-item.directive.d.ts +1 -2
- package/radio/src/radio-root.directive.d.ts +1 -2
- package/switch/index.d.ts +11 -2
- package/switch/src/switch-input.directive.d.ts +1 -1
- package/switch/src/switch-root.directive.d.ts +26 -9
- package/switch/src/switch-thumb.directive.d.ts +1 -1
- package/tabs/index.d.ts +2 -2
- package/tabs/src/tabs-content.directive.d.ts +1 -1
- package/tabs/src/tabs-list.directive.d.ts +1 -1
- package/tabs/src/tabs-root.directive.d.ts +1 -1
- package/tabs/src/tabs-trigger.directive.d.ts +1 -1
- package/toggle/index.d.ts +2 -2
- package/toggle/src/toggle.directive.d.ts +30 -0
- package/toggle-group/src/toggle-group-button.directive.d.ts +9 -6
- package/toggle-group/src/toggle-group-multi.directive.d.ts +18 -15
- package/toggle-group/src/toggle-group.directive.d.ts +3 -9
- package/esm2022/label/src/label-root.directive.mjs +0 -48
- package/esm2022/roving-focus/index.mjs +0 -3
- package/esm2022/roving-focus/radix-ng-primitives-roving-focus.mjs +0 -5
- package/esm2022/roving-focus/src/roving-focus-group.directive.mjs +0 -109
- package/esm2022/roving-focus/src/roving-focus-item.directive.mjs +0 -86
- package/esm2022/toggle/src/toggle-root.directive.mjs +0 -49
- package/fesm2022/radix-ng-primitives-roving-focus.mjs +0 -198
- package/fesm2022/radix-ng-primitives-roving-focus.mjs.map +0 -1
- package/label/src/label-root.directive.d.ts +0 -13
- package/roving-focus/README.md +0 -1
- package/roving-focus/index.d.ts +0 -2
- package/roving-focus/src/roving-focus-group.directive.d.ts +0 -53
- package/roving-focus/src/roving-focus-item.directive.d.ts +0 -50
- package/toggle/src/toggle-root.directive.d.ts +0 -32
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-toggle-group.mjs","sources":["../../../packages/primitives/toggle-group/src/toggle-group-button.token.ts","../../../packages/primitives/toggle-group/src/toggle-group.token.ts","../../../packages/primitives/toggle-group/src/toggle-group-button.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group-multi.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group.directive.ts","../../../packages/primitives/toggle-group/radix-ng-primitives-toggle-group.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\n\nimport type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';\n\nexport const RdxToggleGroupButtonToken = new InjectionToken<RdxToggleGroupButtonDirective>(\n 'RdxToggleGroupButtonToken'\n);\n\nexport function injectToggleGroupButton(): RdxToggleGroupButtonDirective {\n return inject(RdxToggleGroupButtonToken);\n}\n","import { inject, InjectionToken } from '@angular/core';\n\nimport type { RdxToggleGroupMultiDirective } from './toggle-group-multi.directive';\nimport type { RdxToggleGroupDirective } from './toggle-group.directive';\n\nexport const RdxToggleGroupToken = new InjectionToken<\n RdxToggleGroupDirective | RdxToggleGroupMultiDirective\n>('RdxToggleGroupToken');\n\nexport function injectToggleGroup(): RdxToggleGroupDirective | RdxToggleGroupMultiDirective {\n return inject(RdxToggleGroupToken);\n}\n","import {\n booleanAttribute,\n Directive,\n inject,\n InjectionToken,\n Input,\n OnChanges,\n SimpleChanges\n} from '@angular/core';\n\nimport {\n injectRovingFocusItem,\n RdxRovingFocusItemDirective\n} from '@radix-ng/primitives/roving-focus';\n\nimport { RdxToggleGroupButtonToken } from './toggle-group-button.token';\nimport { injectToggleGroup } from './toggle-group.token';\n\n@Directive({\n selector: 'button[rdxToggleGroupButton]',\n standalone: true,\n hostDirectives: [RdxRovingFocusItemDirective],\n providers: [{ provide: RdxToggleGroupButtonToken, useExisting: RdxToggleGroupButtonDirective }],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'checked',\n '[attr.aria-disabled]': 'disabled || toggleGroup.disabled',\n '[attr.data-disabled]': 'disabled || toggleGroup.disabled',\n '[attr.data-state]': 'checked ? \"on\" : \"off\"',\n '[attr.data-orientation]': 'toggleGroup.orientation',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxToggleGroupButtonDirective implements OnChanges {\n /**\n * Access the toggle group.\n */\n protected readonly toggleGroup = injectToggleGroup();\n\n /**\n * Access the roving focus item.\n */\n private readonly rovingFocusItem = injectRovingFocusItem();\n\n /**\n * The value of this toggle button.\n */\n @Input({ required: true }) value!: string;\n\n /**\n * Whether this toggle button is disabled.\n * @default false\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether this toggle button is checked.\n */\n protected get checked(): boolean {\n return this.toggleGroup.isSelected(this.value);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n this.updateDisabled();\n }\n }\n\n toggle(): void {\n if (this.disabled) {\n return;\n }\n\n this.toggleGroup.toggle(this.value);\n }\n\n /**\n * Ensure the disabled state is propagated to the roving focus item.\n * @internal\n */\n updateDisabled(): void {\n this.rovingFocusItem.disabled = this.disabled || this.toggleGroup.disabled;\n }\n}\n","import {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnChanges,\n OnInit,\n QueryList,\n SimpleChanges\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport {\n injectRovingFocusGroup,\n RdxRovingFocusGroupDirective\n} from '@radix-ng/primitives/roving-focus';\n\nimport type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';\nimport { RdxToggleGroupButtonToken } from './toggle-group-button.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroupMulti]',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxRovingFocusGroupDirective,\n inputs: ['rdxRovingFocusGroupWrap:wrap', 'rdxRovingFocusGroupOrientation:orientation']\n }\n ],\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupMultiDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupMultiDirective, multi: true }\n ],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupMultiDirective\n implements OnInit, OnChanges, AfterContentInit, ControlValueAccessor\n{\n /**\n * Access the roving focus group\n */\n private readonly rovingFocusGroup = injectRovingFocusGroup();\n\n /**\n * The selected toggle button.\n */\n @Input('rdxToggleGroupMultiValue') value: ReadonlyArray<string> = [];\n\n /**\n * The orientation of the toggle group.\n * @default 'horizontal'\n */\n @Input('rdxToggleGroupMultiOrientation') orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Whether the toggle group is disabled.\n * @default false\n */\n @Input({ alias: 'rdxToggleGroupMultiDisabled', transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether the toggle group roving focus should wrap.\n * @default true\n */\n @Input({ alias: 'rdxToggleGroupMultiWrap', transform: booleanAttribute }) wrap = true;\n\n /**\n * Event emitted when the selected toggle button changes.\n */\n @Input('rdxToggleGroupMultiValueChange') readonly valueChange = new EventEmitter<\n ReadonlyArray<string>\n >();\n\n /**\n * Access the buttons in the toggle group.\n */\n @ContentChildren(RdxToggleGroupButtonToken)\n protected buttons?: QueryList<RdxToggleGroupButtonDirective>;\n\n /**\n * The value change callback.\n */\n private onChange?: (value: ReadonlyArray<string>) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n protected onTouched?: () => void;\n\n ngOnInit(): void {\n // the toggle button group has a default orientation of horizontal\n // whereas the roving focus group has a default orientation of vertical\n // if the toggle button group input is not defined, the orientation will not be set\n // in the roving focus group and the default vertical orientation will be used.\n // we must initially set the orientation of the roving focus group to match the toggle button group orientation\n this.rovingFocusGroup.setOrientation(this.orientation);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n ngAfterContentInit(): void {\n if (this.disabled) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n /**\n * Determine if a value is selected.\n * @param value The value to check.\n * @returns Whether the value is selected.\n * @internal\n */\n isSelected(value: string): boolean {\n return this.value.includes(value);\n }\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @internal\n */\n toggle(value: string): void {\n if (this.disabled) {\n return;\n }\n\n this.value = this.value.includes(value)\n ? this.value.filter((v) => v !== value)\n : [...this.value, value];\n\n this.valueChange.emit(this.value);\n this.onChange?.(this.value);\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @internal\n */\n writeValue(value: ReadonlyArray<string>): void {\n this.value = value;\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @internal\n */\n registerOnChange(fn: (value: ReadonlyArray<string>) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @internal\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n}\n","import {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n inject,\n InjectionToken,\n Input,\n OnChanges,\n OnInit,\n QueryList,\n SimpleChanges\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nimport {\n injectRovingFocusGroup,\n RdxRovingFocusGroupDirective\n} from '@radix-ng/primitives/roving-focus';\n\nimport type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';\nimport { RdxToggleGroupButtonToken } from './toggle-group-button.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroup]',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxRovingFocusGroupDirective,\n inputs: ['rdxRovingFocusGroupWrap:wrap', 'rdxRovingFocusGroupOrientation:orientation']\n }\n ],\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupDirective, multi: true }\n ],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupDirective\n implements OnInit, OnChanges, AfterContentInit, ControlValueAccessor\n{\n /**\n * Access the roving focus group\n */\n private readonly rovingFocusGroup = injectRovingFocusGroup();\n\n /**\n * The selected toggle button.\n */\n @Input() value: string | null = null;\n\n /**\n * The orientation of the toggle group.\n * @default 'horizontal'\n */\n @Input() orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Whether the toggle group is disabled.\n * @default false\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether the toggle group roving focus should wrap.\n * @default true\n */\n @Input({ transform: booleanAttribute }) wrap = true;\n\n /**\n * Event emitted when the selected toggle button changes.\n */\n @Input() readonly valueChange = new EventEmitter<string | null>();\n\n /**\n * Access the buttons in the toggle group.\n */\n @ContentChildren(RdxToggleGroupButtonToken)\n protected buttons?: QueryList<RdxToggleGroupButtonDirective>;\n\n /**\n * The value change callback.\n */\n private onChange?: (value: string | null) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n protected onTouched?: () => void;\n\n ngOnInit(): void {\n // the toggle button group has a default orientation of horizontal\n // whereas the roving focus group has a default orientation of vertical\n // if the toggle button group input is not defined, the orientation will not be set\n // in the roving focus group and the default vertical orientation will be used.\n // we must initially set the orientation of the roving focus group to match the toggle button group orientation\n this.rovingFocusGroup.setOrientation(this.orientation);\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n ngAfterContentInit(): void {\n if (this.disabled) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n /**\n * Determine if a value is selected.\n * @param value The value to check.\n * @returns Whether the value is selected.\n * @internal\n */\n isSelected(value: string): boolean {\n return this.value === value;\n }\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @internal\n */\n toggle(value: string): void {\n if (this.disabled) {\n return;\n }\n\n this.value = this.value === value ? null : value;\n this.valueChange.emit(this.value);\n this.onChange?.(this.value);\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @internal\n */\n writeValue(value: string): void {\n this.value = value;\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @internal\n */\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @internal\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAIa,yBAAyB,GAAG,IAAI,cAAc,CACvD,2BAA2B,EAC7B;SAEc,uBAAuB,GAAA;AACnC,IAAA,OAAO,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAC7C;;MCLa,mBAAmB,GAAG,IAAI,cAAc,CAEnD,qBAAqB,EAAE;SAET,iBAAiB,GAAA;AAC7B,IAAA,OAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACvC;;MCuBa,6BAA6B,CAAA;AAhB1C,IAAA,WAAA,GAAA;AAiBI;;AAEG;QACgB,IAAW,CAAA,WAAA,GAAG,iBAAiB,EAAE,CAAC;AAErD;;AAEG;QACc,IAAe,CAAA,eAAA,GAAG,qBAAqB,EAAE,CAAC;AAO3D;;;AAGG;QACqC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AA8B5D,KAAA;AA5BG;;AAEG;AACH,IAAA,IAAc,OAAO,GAAA;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAClD;AAED,IAAA,WAAW,CAAC,OAAsB,EAAA;AAC9B,QAAA,IAAI,UAAU,IAAI,OAAO,EAAE;YACvB,IAAI,CAAC,cAAc,EAAE,CAAC;SACzB;KACJ;IAED,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,OAAO;SACV;QAED,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACvC;AAED;;;AAGG;IACH,cAAc,GAAA;AACV,QAAA,IAAI,CAAC,eAAe,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI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,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,OAAO;AACb,wBAAA,yBAAyB,EAAE,aAAa;AACxC,wBAAA,YAAY,EAAE,eAAe;AAChC,qBAAA;AACJ,iBAAA,CAAA;8BAYY,KAAK,EAAA,CAAA;sBAAb,KAAK;gBAMG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBAMkC,QAAQ,EAAA,CAAA;sBAA/C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAME,IAAI,EAAA,CAAA;sBAA3C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAKpB,WAAW,EAAA,CAAA;sBAA5B,KAAK;gBAMI,OAAO,EAAA,CAAA;sBADhB,eAAe;uBAAC,yBAAyB,CAAA;;;ACnF9C;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"radix-ng-primitives-toggle-group.mjs","sources":["../../../packages/primitives/toggle-group/src/toggle-group-button.token.ts","../../../packages/primitives/toggle-group/src/toggle-group.token.ts","../../../packages/primitives/toggle-group/src/toggle-group-button.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group-multi.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group.directive.ts","../../../packages/primitives/toggle-group/radix-ng-primitives-toggle-group.ts"],"sourcesContent":["import { inject, InjectionToken } from '@angular/core';\nimport type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';\n\nexport const RdxToggleGroupButtonToken = new InjectionToken<RdxToggleGroupButtonDirective>('RdxToggleGroupButtonToken');\n\nexport function injectToggleGroupButton(): RdxToggleGroupButtonDirective {\n return inject(RdxToggleGroupButtonToken);\n}\n","import { inject, InjectionToken } from '@angular/core';\nimport type { RdxToggleGroupMultiDirective } from './toggle-group-multi.directive';\nimport type { RdxToggleGroupDirective } from './toggle-group.directive';\n\nexport const RdxToggleGroupToken = new InjectionToken<RdxToggleGroupDirective | RdxToggleGroupMultiDirective>(\n 'RdxToggleGroupToken'\n);\n\nexport function injectToggleGroup(): RdxToggleGroupDirective | RdxToggleGroupMultiDirective {\n return inject(RdxToggleGroupToken);\n}\n","import { booleanAttribute, Directive, Input, OnChanges, SimpleChanges } from '@angular/core';\nimport { RdxToggleGroupButtonToken } from './toggle-group-button.token';\nimport { injectToggleGroup } from './toggle-group.token';\n\n@Directive({\n selector: 'button[rdxToggleGroupButton]',\n standalone: true,\n providers: [{ provide: RdxToggleGroupButtonToken, useExisting: RdxToggleGroupButtonDirective }],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'checked',\n '[attr.aria-disabled]': 'disabled || toggleGroup.disabled',\n '[attr.data-disabled]': 'disabled || toggleGroup.disabled',\n '[attr.data-state]': 'checked ? \"on\" : \"off\"',\n '[attr.data-orientation]': 'toggleGroup.orientation',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxToggleGroupButtonDirective implements OnChanges {\n /**\n * Access the toggle group.\n * @ignore\n */\n protected readonly toggleGroup = injectToggleGroup();\n\n /**\n * The value of this toggle button.\n */\n @Input({ required: true }) value!: string;\n\n /**\n * Whether this toggle button is disabled.\n * @default false\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether this toggle button is checked.\n */\n protected get checked(): boolean {\n return this.toggleGroup.isSelected(this.value);\n }\n\n /**\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n // TODO\n }\n }\n\n /**\n * @ignore\n */\n toggle(): void {\n if (this.disabled) {\n return;\n }\n\n this.toggleGroup.toggle(this.value);\n }\n\n /**\n * Ensure the disabled state is propagated to the roving focus item.\n * @internal\n * @ignore\n */\n updateDisabled(): void {\n // TODO\n }\n}\n","import {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnChanges,\n QueryList,\n SimpleChanges\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';\nimport { RdxToggleGroupButtonToken } from './toggle-group-button.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroupMulti]',\n standalone: true,\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupMultiDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupMultiDirective, multi: true }\n ],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupMultiDirective implements OnChanges, AfterContentInit, ControlValueAccessor {\n /**\n * The selected toggle button.\n */\n @Input('rdxToggleGroupMultiValue') value: ReadonlyArray<string> = [];\n\n /**\n * The orientation of the toggle group.\n * @default 'horizontal'\n */\n @Input('rdxToggleGroupMultiOrientation') orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Whether the toggle group is disabled.\n * @default false\n */\n @Input({ alias: 'rdxToggleGroupMultiDisabled', transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether the toggle group roving focus should wrap.\n * @default true\n */\n @Input({ alias: 'rdxToggleGroupMultiWrap', transform: booleanAttribute }) wrap = true;\n\n /**\n * Event emitted when the selected toggle button changes.\n */\n @Input('rdxToggleGroupMultiValueChange') readonly valueChange = new EventEmitter<ReadonlyArray<string>>();\n\n /**\n * Access the buttons in the toggle group.\n * @ignore\n */\n @ContentChildren(RdxToggleGroupButtonToken)\n protected buttons?: QueryList<RdxToggleGroupButtonDirective>;\n\n /**\n * The value change callback.\n * @ignore\n */\n private onChange?: (value: ReadonlyArray<string>) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n * @ignore\n */\n protected onTouched?: () => void;\n\n /**\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n /**\n * @ignore\n */\n ngAfterContentInit(): void {\n if (this.disabled) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n /**\n * Determine if a value is selected.\n * @param value The value to check.\n * @returns Whether the value is selected.\n * @ignore\n */\n isSelected(value: string): boolean {\n return this.value.includes(value);\n }\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @ignore\n */\n toggle(value: string): void {\n if (this.disabled) {\n return;\n }\n\n this.value = this.value.includes(value) ? this.value.filter((v) => v !== value) : [...this.value, value];\n\n this.valueChange.emit(this.value);\n this.onChange?.(this.value);\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @ignore\n */\n writeValue(value: ReadonlyArray<string>): void {\n this.value = value;\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnChange(fn: (value: ReadonlyArray<string>) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @ignore\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @ignore\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n}\n","import {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnChanges,\n QueryList,\n SimpleChanges\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport type { RdxToggleGroupButtonDirective } from './toggle-group-button.directive';\nimport { RdxToggleGroupButtonToken } from './toggle-group-button.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroup]',\n standalone: true,\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupDirective, multi: true }\n ],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupDirective implements OnChanges, AfterContentInit, ControlValueAccessor {\n /**\n * The selected toggle button.\n */\n @Input() value: string | null = null;\n\n /**\n * The orientation of the toggle group.\n * @default 'horizontal'\n */\n @Input() orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /**\n * Whether the toggle group is disabled.\n * @default false\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * Whether the toggle group roving focus should wrap.\n * @default true\n */\n @Input({ transform: booleanAttribute }) wrap = true;\n\n /**\n * Event emitted when the selected toggle button changes.\n */\n @Input() readonly valueChange = new EventEmitter<string | null>();\n\n /**\n * Access the buttons in the toggle group.\n */\n @ContentChildren(RdxToggleGroupButtonToken)\n protected buttons?: QueryList<RdxToggleGroupButtonDirective>;\n\n /**\n * The value change callback.\n */\n private onChange?: (value: string | null) => void;\n\n /**\n * onTouch function registered via registerOnTouch (ControlValueAccessor).\n */\n protected onTouched?: () => void;\n\n ngOnChanges(changes: SimpleChanges): void {\n if ('disabled' in changes) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n ngAfterContentInit(): void {\n if (this.disabled) {\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n }\n\n /**\n * Determine if a value is selected.\n * @param value The value to check.\n * @returns Whether the value is selected.\n * @internal\n */\n isSelected(value: string): boolean {\n return this.value === value;\n }\n\n /**\n * Toggle a value.\n * @param value The value to toggle.\n * @internal\n */\n toggle(value: string): void {\n if (this.disabled) {\n return;\n }\n\n this.value = this.value === value ? null : value;\n this.valueChange.emit(this.value);\n this.onChange?.(this.value);\n }\n\n /**\n * Select a value from Angular forms.\n * @param value The value to select.\n * @internal\n */\n writeValue(value: string): void {\n this.value = value;\n }\n\n /**\n * Register a callback to be called when the value changes.\n * @param fn The callback to register.\n * @internal\n */\n registerOnChange(fn: (value: string | null) => void): void {\n this.onChange = fn;\n }\n\n /**\n * Register a callback to be called when the toggle group is touched.\n * @param fn The callback to register.\n * @internal\n */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the toggle group.\n * @param isDisabled Whether the toggle group is disabled.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n this.buttons?.forEach((button) => button.updateDisabled());\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;MAGa,yBAAyB,GAAG,IAAI,cAAc,CAAgC,2BAA2B,EAAE;SAExG,uBAAuB,GAAA;AACnC,IAAA,OAAO,MAAM,CAAC,yBAAyB,CAAC,CAAC;AAC7C;;MCHa,mBAAmB,GAAG,IAAI,cAAc,CACjD,qBAAqB,EACvB;SAEc,iBAAiB,GAAA;AAC7B,IAAA,OAAO,MAAM,CAAC,mBAAmB,CAAC,CAAC;AACvC;;MCSa,6BAA6B,CAAA;AAf1C,IAAA,WAAA,GAAA;AAgBI;;;AAGG;QACgB,IAAW,CAAA,WAAA,GAAG,iBAAiB,EAAE,CAAC;AAOrD;;;AAGG;QACqC,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AAqC5D,KAAA;AAnCG;;AAEG;AACH,IAAA,IAAc,OAAO,GAAA;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KAClD;AAED;;AAEG;AACH,IAAA,WAAW,CAAC,OAAsB,EAAA;AAC9B,QAAA,IAAI,UAAU,IAAI,OAAO,EAAE;;SAE1B;KACJ;AAED;;AAEG;IACH,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf,OAAO;SACV;QAED,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACvC;AAED;;;;AAIG;IACH,cAAc,GAAA;;KAEb;8GApDQ,6BAA6B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAA7B,IAAA,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;AACD,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,OAAO;AACb,wBAAA,yBAAyB,EAAE,aAAa;AACxC,wBAAA,YAAY,EAAE,eAAe;AAChC,qBAAA;AACJ,iBAAA,CAAA;8BAKY,KAAK,EAAA,CAAA;sBAAb,KAAK;gBAMG,WAAW,EAAA,CAAA;sBAAnB,KAAK;gBAMkC,QAAQ,EAAA,CAAA;sBAA/C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAME,IAAI,EAAA,CAAA;sBAA3C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAA;gBAKpB,WAAW,EAAA,CAAA;sBAA5B,KAAK;gBAMI,OAAO,EAAA,CAAA;sBADhB,eAAe;uBAAC,yBAAyB,CAAA;;;AC7D9C;;AAEG;;;;"}
|
@@ -1,50 +1,40 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import {
|
2
|
+
import { input, model, EventEmitter, Directive, Output } from '@angular/core';
|
3
3
|
|
4
|
-
|
5
|
-
class RdxToggleRootDirective {
|
4
|
+
class RdxToggleDirective {
|
6
5
|
constructor() {
|
7
|
-
this.
|
8
|
-
this.
|
9
|
-
this.
|
6
|
+
this.defaultPressed = input(false);
|
7
|
+
this.pressed = model(this.defaultPressed());
|
8
|
+
this.disabled = input(false);
|
10
9
|
/**
|
11
10
|
* Event emitted when the toggle is pressed.
|
12
11
|
*/
|
13
12
|
this.onPressedChange = new EventEmitter();
|
14
13
|
}
|
15
14
|
toggle() {
|
16
|
-
if (this.disabled) {
|
17
|
-
|
15
|
+
if (!this.disabled()) {
|
16
|
+
this.pressed.set(!this.pressed());
|
17
|
+
this.onPressedChange.emit(this.pressed());
|
18
18
|
}
|
19
|
-
this.pressed = !this.pressed;
|
20
|
-
this.onPressedChange.emit(this.pressed);
|
21
19
|
}
|
22
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.
|
23
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
20
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxToggleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
21
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.1.2", type: RdxToggleDirective, isStandalone: true, selector: "button[rdxToggle]", inputs: { defaultPressed: { classPropertyName: "defaultPressed", publicName: "defaultPressed", isSignal: true, isRequired: false, transformFunction: null }, pressed: { classPropertyName: "pressed", publicName: "pressed", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { pressed: "pressedChange", onPressedChange: "onPressedChange" }, host: { attributes: { "type": "button" }, listeners: { "click": "toggle()" }, properties: { "attr.aria-pressed": "pressed()", "attr.data-state": "pressed() ? \"on\" : \"off\"", "attr.data-disabled": "disabled()" } }, exportAs: ["rdxToggle"], ngImport: i0 }); }
|
24
22
|
}
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.
|
23
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.2", ngImport: i0, type: RdxToggleDirective, decorators: [{
|
26
24
|
type: Directive,
|
27
25
|
args: [{
|
28
|
-
selector: 'button[
|
29
|
-
exportAs: '
|
26
|
+
selector: 'button[rdxToggle]',
|
27
|
+
exportAs: 'rdxToggle',
|
30
28
|
standalone: true,
|
31
29
|
host: {
|
32
30
|
type: 'button',
|
33
|
-
'[attr.aria-pressed]': 'pressed',
|
34
|
-
'[attr.data-state]': 'pressed ? "on" : "off"',
|
35
|
-
'[attr.data-disabled]': 'disabled',
|
31
|
+
'[attr.aria-pressed]': 'pressed()',
|
32
|
+
'[attr.data-state]': 'pressed() ? "on" : "off"',
|
33
|
+
'[attr.data-disabled]': 'disabled()',
|
36
34
|
'(click)': 'toggle()'
|
37
35
|
}
|
38
36
|
}]
|
39
|
-
}], propDecorators: {
|
40
|
-
type: Input,
|
41
|
-
args: [{ transform: booleanAttribute }]
|
42
|
-
}], disabled: [{
|
43
|
-
type: Input,
|
44
|
-
args: [{ transform: booleanAttribute }]
|
45
|
-
}], id: [{
|
46
|
-
type: Input
|
47
|
-
}], onPressedChange: [{
|
37
|
+
}], propDecorators: { onPressedChange: [{
|
48
38
|
type: Output
|
49
39
|
}] } });
|
50
40
|
|
@@ -52,5 +42,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.4", ngImpor
|
|
52
42
|
* Generated bundle index. Do not edit.
|
53
43
|
*/
|
54
44
|
|
55
|
-
export {
|
45
|
+
export { RdxToggleDirective };
|
56
46
|
//# sourceMappingURL=radix-ng-primitives-toggle.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle
|
1
|
+
{"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import { Directive, EventEmitter, input, model, Output } from '@angular/core';\n\nexport interface ToggleProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n /**\n * The state of the toggle when initially rendered. Use `defaultPressed`\n * if you do not need to control the state of the toggle.\n * @defaultValue false\n */\n defaultPressed?: boolean;\n /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?: EventEmitter<boolean>;\n}\n\n@Directive({\n selector: 'button[rdxToggle]',\n exportAs: 'rdxToggle',\n standalone: true,\n host: {\n type: 'button',\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'pressed() ? \"on\" : \"off\"',\n '[attr.data-disabled]': 'disabled()',\n\n '(click)': 'toggle()'\n }\n})\nexport class RdxToggleDirective {\n readonly defaultPressed = input<boolean>(false);\n readonly pressed = model<boolean>(this.defaultPressed());\n readonly disabled = input<boolean>(false);\n\n /**\n * Event emitted when the toggle is pressed.\n */\n @Output() readonly onPressedChange = new EventEmitter<boolean>();\n\n protected toggle(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAgCa,kBAAkB,CAAA;AAb/B,IAAA,WAAA,GAAA;AAca,QAAA,IAAA,CAAA,cAAc,GAAG,KAAK,CAAU,KAAK,CAAC,CAAC;QACvC,IAAO,CAAA,OAAA,GAAG,KAAK,CAAU,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC;AAChD,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAU,KAAK,CAAC,CAAC;AAE1C;;AAEG;AACgB,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,YAAY,EAAW,CAAC;AAQpE,KAAA;IANa,MAAM,GAAA;AACZ,QAAA,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE;YAClB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;YAClC,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;SAC7C;KACJ;8GAfQ,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAAlB,kBAAkB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,EAAA,cAAA,EAAA,EAAA,iBAAA,EAAA,gBAAA,EAAA,UAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EA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 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
export declare class RdxLabelDirective {
|
3
|
+
readonly id: import("@angular/core").InputSignal<string>;
|
4
|
+
/**
|
5
|
+
* @ignore
|
6
|
+
*/
|
7
|
+
protected readonly elementId: import("@angular/core").Signal<string | null>;
|
8
|
+
/**
|
9
|
+
* The id of the element the label is associated with.
|
10
|
+
* @default '-'
|
11
|
+
*/
|
12
|
+
readonly htmlFor: import("@angular/core").InputSignal<string>;
|
13
|
+
/**
|
14
|
+
* @ignore
|
15
|
+
*/
|
16
|
+
private readonly elementRef;
|
17
|
+
/**
|
18
|
+
* @ignore
|
19
|
+
*/
|
20
|
+
onMouseDown(event: MouseEvent): void;
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxLabelDirective, never>;
|
22
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxLabelDirective, "label[rdxLabel]", ["rdxLabel"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "htmlFor": { "alias": "htmlFor"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
23
|
+
}
|
package/menu/index.d.ts
CHANGED
@@ -5,12 +5,12 @@ import * as i3 from "./src/menu-item.directive";
|
|
5
5
|
import * as i4 from "./src/menu-separator.directive";
|
6
6
|
import * as i5 from "./src/menu-content.directive";
|
7
7
|
import * as i6 from "./src/menu-label.directive";
|
8
|
+
export * from './src/menu-content.directive';
|
8
9
|
export * from './src/menu-directive';
|
9
10
|
export * from './src/menu-group.directive';
|
10
11
|
export * from './src/menu-item.directive';
|
11
|
-
export * from './src/menu-separator.directive';
|
12
|
-
export * from './src/menu-content.directive';
|
13
12
|
export * from './src/menu-label.directive';
|
13
|
+
export * from './src/menu-separator.directive';
|
14
14
|
export declare class MenuModule {
|
15
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<MenuModule, never>;
|
16
16
|
static ɵmod: i0.ɵɵNgModuleDeclaration<MenuModule, never, [typeof i1.RdxMenuDirective, typeof i2.RdxMenuGroupDirective, typeof i3.RdxMenuItemDirective, typeof i4.RdxMenuSeparatorDirective, typeof i5.RdxMenuContentDirective, typeof i6.RdxMenuLabelDirective], [typeof i1.RdxMenuDirective, typeof i2.RdxMenuGroupDirective, typeof i3.RdxMenuItemDirective, typeof i4.RdxMenuSeparatorDirective, typeof i5.RdxMenuContentDirective, typeof i6.RdxMenuLabelDirective]>;
|
package/menubar/index.d.ts
CHANGED
@@ -9,11 +9,11 @@ import * as i7 from "./src/menubar-item-indicator.directive";
|
|
9
9
|
import * as i8 from "./src/menubar-item-radio.directive";
|
10
10
|
import * as i9 from "./src/menubar-radio-group.directive";
|
11
11
|
export * from './src/menubar-content.directive';
|
12
|
-
export * from './src/menubar-item.directive';
|
13
12
|
export * from './src/menubar-item-checkbox.directive';
|
13
|
+
export * from './src/menubar-item-indicator.directive';
|
14
14
|
export * from './src/menubar-item-radio.directive';
|
15
|
+
export * from './src/menubar-item.directive';
|
15
16
|
export * from './src/menubar-radio-group.directive';
|
16
|
-
export * from './src/menubar-item-indicator.directive';
|
17
17
|
export * from './src/menubar-root.directive';
|
18
18
|
export * from './src/menubar-separator.directive';
|
19
19
|
export * from './src/menubar-trigger.directive';
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@radix-ng/primitives",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.9.0",
|
4
4
|
"license": "MIT",
|
5
5
|
"publishConfig": {
|
6
6
|
"access": "public"
|
@@ -103,12 +103,6 @@
|
|
103
103
|
"esm": "./esm2022/radio/radix-ng-primitives-radio.mjs",
|
104
104
|
"default": "./fesm2022/radix-ng-primitives-radio.mjs"
|
105
105
|
},
|
106
|
-
"./roving-focus": {
|
107
|
-
"types": "./roving-focus/index.d.ts",
|
108
|
-
"esm2022": "./esm2022/roving-focus/radix-ng-primitives-roving-focus.mjs",
|
109
|
-
"esm": "./esm2022/roving-focus/radix-ng-primitives-roving-focus.mjs",
|
110
|
-
"default": "./fesm2022/radix-ng-primitives-roving-focus.mjs"
|
111
|
-
},
|
112
106
|
"./separator": {
|
113
107
|
"types": "./separator/index.d.ts",
|
114
108
|
"esm2022": "./esm2022/separator/radix-ng-primitives-separator.mjs",
|
@@ -1,6 +1,16 @@
|
|
1
1
|
import * as i0 from "@angular/core";
|
2
|
+
/**
|
3
|
+
* Directive to manage progress indicator state and attributes.
|
4
|
+
*
|
5
|
+
* This directive is used to display the progress indicator inside the progress bar.
|
6
|
+
* It inherits the state and value from the `RdxProgressRootDirective`.
|
7
|
+
*/
|
2
8
|
export declare class RdxProgressIndicatorDirective {
|
3
|
-
|
9
|
+
/**
|
10
|
+
*
|
11
|
+
* This allows the directive to access the progress bar state and values.
|
12
|
+
*/
|
13
|
+
protected readonly progress: import("./progress-root.directive").RdxProgressRootDirective;
|
4
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxProgressIndicatorDirective, never>;
|
5
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxProgressIndicatorDirective, "div[
|
15
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxProgressIndicatorDirective, "div[rdxProgressIndicator]", ["ProgressIndicator"], {}, {}, never, never, true, never>;
|
6
16
|
}
|
@@ -1,29 +1,63 @@
|
|
1
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
1
2
|
import * as i0 from "@angular/core";
|
3
|
+
/**
|
4
|
+
* Injects the current instance of RdxProgressRootDirective.
|
5
|
+
* @returns The instance of RdxProgressRootDirective.
|
6
|
+
*/
|
2
7
|
export declare function injectProgress(): RdxProgressRootDirective;
|
3
|
-
export type ProgressState = 'indeterminate' | '
|
8
|
+
export type ProgressState = 'indeterminate' | 'complete' | 'loading';
|
4
9
|
export interface ProgressProps {
|
5
10
|
value?: number | null | undefined;
|
6
11
|
max?: number;
|
7
12
|
getValueLabel?: string;
|
8
13
|
}
|
9
|
-
|
14
|
+
/**
|
15
|
+
* Directive to manage progress bar state and attributes.
|
16
|
+
*
|
17
|
+
* This directive provides a way to create a progress bar with customizable value and max attributes.
|
18
|
+
* It handles aria attributes for accessibility and provides different states like 'indeterminate', 'complete', and 'loading'.
|
19
|
+
*/
|
20
|
+
export declare class RdxProgressRootDirective implements ProgressProps, OnChanges {
|
21
|
+
/**
|
22
|
+
* The unique ID for the progress bar.
|
23
|
+
* @default 'rdx-progress-bar-{idIterator}'
|
24
|
+
*/
|
10
25
|
id: string;
|
26
|
+
/**
|
27
|
+
* The current value of the progress bar.
|
28
|
+
* @default 0
|
29
|
+
*/
|
11
30
|
value: number;
|
12
31
|
/**
|
32
|
+
* The maximum value of the progress bar.
|
13
33
|
* @default 100
|
14
34
|
*/
|
15
35
|
max: number;
|
36
|
+
/**
|
37
|
+
* Function to generate the value label.
|
38
|
+
*/
|
16
39
|
valueLabel: (value: number, max: number) => string;
|
40
|
+
/**
|
41
|
+
* Lifecycle hook that is called when any data-bound property of a directive changes.
|
42
|
+
* @param changes - The changed properties.
|
43
|
+
* @ignore
|
44
|
+
*/
|
45
|
+
ngOnChanges(changes: SimpleChanges): void;
|
17
46
|
/**
|
18
47
|
* Get the state of the progress bar.
|
19
48
|
* @returns 'indeterminate' | 'loading' | 'complete'
|
20
|
-
* @
|
49
|
+
* @ignore
|
21
50
|
*/
|
22
51
|
get state(): ProgressState;
|
23
52
|
private getProgressState;
|
24
53
|
private defaultGetValueLabel;
|
54
|
+
private isValidMaxNumber;
|
55
|
+
private isNumber;
|
56
|
+
private isValidValueNumber;
|
57
|
+
private getInvalidMaxError;
|
58
|
+
private getInvalidValueError;
|
25
59
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxProgressRootDirective, never>;
|
26
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxProgressRootDirective, "div[
|
60
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxProgressRootDirective, "div[rdxProgressRoot]", ["ProgressRoot"], { "id": { "alias": "id"; "required": false; }; "value": { "alias": "rdxValue"; "required": false; }; "max": { "alias": "rdxMax"; "required": false; }; "valueLabel": { "alias": "rdxValueLabel"; "required": false; }; }, {}, never, never, true, never>;
|
27
61
|
static ngAcceptInputType_value: unknown;
|
28
62
|
static ngAcceptInputType_max: unknown;
|
29
63
|
}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
2
2
|
import * as i0 from "@angular/core";
|
3
|
-
import * as i1 from "@radix-ng/primitives/roving-focus";
|
4
3
|
export declare const RdxRadioItemToken: InjectionToken<RdxRadioItemDirective>;
|
5
4
|
export declare function injectRadioItem(): RdxRadioItemDirective;
|
6
5
|
export declare class RdxRadioItemDirective {
|
@@ -12,6 +11,6 @@ export declare class RdxRadioItemDirective {
|
|
12
11
|
_onFocus(): void;
|
13
12
|
_onClick(): void;
|
14
13
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxRadioItemDirective, never>;
|
15
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioItemDirective, "[RadioItem]", ["RadioItem"], { "id": { "alias": "id"; "required": false; }; "value": { "alias": "value"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true,
|
14
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioItemDirective, "[RadioItem]", ["RadioItem"], { "id": { "alias": "id"; "required": false; }; "value": { "alias": "value"; "required": true; }; "disabled": { "alias": "disabled"; "required": false; }; }, {}, never, never, true, never>;
|
16
15
|
static ngAcceptInputType_disabled: unknown;
|
17
16
|
}
|
@@ -1,7 +1,6 @@
|
|
1
1
|
import { EventEmitter, InjectionToken } from '@angular/core';
|
2
2
|
import { ControlValueAccessor } from '@angular/forms';
|
3
3
|
import * as i0 from "@angular/core";
|
4
|
-
import * as i1 from "@radix-ng/primitives/roving-focus";
|
5
4
|
export declare const RdxRadioGroupToken: InjectionToken<RdxRadioGroupDirective>;
|
6
5
|
export declare function injectRadioGroup(): RdxRadioGroupDirective;
|
7
6
|
interface RadioGroupProps {
|
@@ -66,7 +65,7 @@ export declare class RdxRadioGroupDirective implements RadioGroupProps, ControlV
|
|
66
65
|
*/
|
67
66
|
_onFocusout(): void;
|
68
67
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxRadioGroupDirective, never>;
|
69
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioGroupDirective, "div[RadioRoot]", ["RadioRoot"], { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; }, { "onValueChange": "onValueChange"; }, never, never, true,
|
68
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxRadioGroupDirective, "div[RadioRoot]", ["RadioRoot"], { "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; }, { "onValueChange": "onValueChange"; }, never, never, true, never>;
|
70
69
|
static ngAcceptInputType_disabled: unknown;
|
71
70
|
}
|
72
71
|
export {};
|
package/switch/index.d.ts
CHANGED
@@ -1,4 +1,13 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
import * as i1 from "./src/switch-root.directive";
|
3
|
+
import * as i2 from "./src/switch-input.directive";
|
4
|
+
import * as i3 from "./src/switch-thumb.directive";
|
3
5
|
export * from './src/switch-input.directive';
|
6
|
+
export * from './src/switch-root.directive';
|
7
|
+
export * from './src/switch-thumb.directive';
|
4
8
|
export type { SwitchProps } from './src/switch-root.directive';
|
9
|
+
export declare class RdxSwitchModule {
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxSwitchModule, never>;
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<RdxSwitchModule, never, [typeof i1.RdxSwitchRootDirective, typeof i2.RdxSwitchInputDirective, typeof i3.RdxSwitchThumbDirective], [typeof i1.RdxSwitchRootDirective, typeof i2.RdxSwitchInputDirective, typeof i3.RdxSwitchThumbDirective]>;
|
12
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<RdxSwitchModule>;
|
13
|
+
}
|
@@ -2,5 +2,5 @@ import * as i0 from "@angular/core";
|
|
2
2
|
export declare class RdxSwitchInputDirective {
|
3
3
|
protected readonly switchRoot: import("./switch-root.directive").RdxSwitchRootDirective;
|
4
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxSwitchInputDirective, never>;
|
5
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSwitchInputDirective, "input[
|
5
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSwitchInputDirective, "input[rdxSwitchInput]", ["rdxSwitchInput"], {}, {}, never, never, true, never>;
|
6
6
|
}
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import {
|
1
|
+
import { BooleanInput } from '@angular/cdk/coercion';
|
2
|
+
import { EventEmitter, InjectionToken, InputSignalWithTransform, ModelSignal } from '@angular/core';
|
2
3
|
import { ControlValueAccessor } from '@angular/forms';
|
3
4
|
import * as i0 from "@angular/core";
|
4
5
|
export declare const RdxSwitchToken: InjectionToken<RdxSwitchRootDirective>;
|
@@ -6,14 +7,17 @@ export declare function injectSwitch(): RdxSwitchRootDirective;
|
|
6
7
|
export interface SwitchProps {
|
7
8
|
checked?: ModelSignal<boolean>;
|
8
9
|
defaultChecked?: boolean;
|
9
|
-
required?: boolean
|
10
|
+
required?: InputSignalWithTransform<boolean, BooleanInput>;
|
10
11
|
onCheckedChange?: EventEmitter<boolean>;
|
11
12
|
}
|
12
13
|
export declare class RdxSwitchRootDirective implements SwitchProps, ControlValueAccessor {
|
13
|
-
|
14
|
+
readonly id: import("@angular/core").InputSignal<string>;
|
15
|
+
protected readonly elementId: import("@angular/core").Signal<string | null>;
|
16
|
+
readonly required: InputSignalWithTransform<boolean, BooleanInput>;
|
14
17
|
readonly checked: ModelSignal<boolean>;
|
15
|
-
disabled: boolean
|
16
|
-
readonly
|
18
|
+
readonly disabled: InputSignalWithTransform<boolean, BooleanInput>;
|
19
|
+
readonly disabledState: import("@angular/core").Signal<boolean>;
|
20
|
+
onCheckedChange: EventEmitter<boolean>;
|
17
21
|
/**
|
18
22
|
* The method to be called in order to update ngModel.
|
19
23
|
*/
|
@@ -22,13 +26,26 @@ export declare class RdxSwitchRootDirective implements SwitchProps, ControlValue
|
|
22
26
|
* onTouch function registered via registerOnTouch (ControlValueAccessor).
|
23
27
|
*/
|
24
28
|
_onTouched?: () => void;
|
29
|
+
/**
|
30
|
+
* Registers a function to call when the checked state changes.
|
31
|
+
* @param fn Function to call on change.
|
32
|
+
*/
|
25
33
|
registerOnChange(fn: (checked: boolean) => void): void;
|
34
|
+
/**
|
35
|
+
* Registers a function to call when the component is touched.
|
36
|
+
* @param fn Function to call on touch.
|
37
|
+
*/
|
26
38
|
registerOnTouched(fn: () => void): void;
|
39
|
+
/**
|
40
|
+
* Writes a new value to the model.
|
41
|
+
* @param checked The new checked value.
|
42
|
+
*/
|
27
43
|
writeValue(checked: boolean): void;
|
28
|
-
|
44
|
+
/**
|
45
|
+
* Toggles the checked state of the switch.
|
46
|
+
* If the switch is disabled, the function returns early.
|
47
|
+
*/
|
29
48
|
protected toggle(): void;
|
30
49
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxSwitchRootDirective, never>;
|
31
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSwitchRootDirective, "button[
|
32
|
-
static ngAcceptInputType_required: unknown;
|
33
|
-
static ngAcceptInputType_disabled: unknown;
|
50
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSwitchRootDirective, "button[rdxSwitchRoot]", ["rdxSwitchRoot"], { "id": { "alias": "id"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "checked": { "alias": "checked"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "checked": "checkedChange"; "onCheckedChange": "onCheckedChange"; }, never, never, true, never>;
|
34
51
|
}
|
@@ -2,5 +2,5 @@ import * as i0 from "@angular/core";
|
|
2
2
|
export declare class RdxSwitchThumbDirective {
|
3
3
|
protected readonly switchRoot: import("./switch-root.directive").RdxSwitchRootDirective;
|
4
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxSwitchThumbDirective, never>;
|
5
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSwitchThumbDirective, "span[
|
5
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxSwitchThumbDirective, "span[rdxSwitchThumb]", ["rdxSwitchThumb"], {}, {}, never, never, true, never>;
|
6
6
|
}
|
package/tabs/index.d.ts
CHANGED
@@ -3,11 +3,11 @@ import * as i1 from "./src/tabs-root.directive";
|
|
3
3
|
import * as i2 from "./src/tabs-content.directive";
|
4
4
|
import * as i3 from "./src/tabs-list.directive";
|
5
5
|
import * as i4 from "./src/tabs-trigger.directive";
|
6
|
-
export * from './src/tabs-root.directive';
|
7
6
|
export * from './src/tabs-content.directive';
|
7
|
+
export * from './src/tabs-context.service';
|
8
8
|
export * from './src/tabs-list.directive';
|
9
|
+
export * from './src/tabs-root.directive';
|
9
10
|
export * from './src/tabs-trigger.directive';
|
10
|
-
export * from './src/tabs-context.service';
|
11
11
|
export declare class RdxTabsModule {
|
12
12
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsModule, never>;
|
13
13
|
static ɵmod: i0.ɵɵNgModuleDeclaration<RdxTabsModule, never, [typeof i1.RdxTabsRootDirective, typeof i2.RdxTabsContentDirective, typeof i3.RdxTabsListDirective, typeof i4.RdxTabsTriggerDirective], [typeof i1.RdxTabsRootDirective, typeof i2.RdxTabsContentDirective, typeof i3.RdxTabsListDirective, typeof i4.RdxTabsTriggerDirective]>;
|
@@ -4,5 +4,5 @@ export declare class RdxTabsContentDirective {
|
|
4
4
|
readonly value: import("@angular/core").InputSignal<string>;
|
5
5
|
protected readonly selected: import("@angular/core").Signal<boolean>;
|
6
6
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsContentDirective, never>;
|
7
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsContentDirective, "[
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsContentDirective, "[rdxTabsContent]", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
8
8
|
}
|
@@ -2,5 +2,5 @@ import * as i0 from "@angular/core";
|
|
2
2
|
export declare class RdxTabsListDirective {
|
3
3
|
protected readonly tabsContext: import("./tabs-context.service").RdxTabsContextService;
|
4
4
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsListDirective, never>;
|
5
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsListDirective, "[
|
5
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsListDirective, "[rdxTabsList]", never, {}, {}, never, never, true, never>;
|
6
6
|
}
|
@@ -33,5 +33,5 @@ export declare class RdxTabsRootDirective implements OnInit {
|
|
33
33
|
constructor();
|
34
34
|
ngOnInit(): void;
|
35
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsRootDirective, never>;
|
36
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsRootDirective, "[
|
36
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsRootDirective, "[rdxTabsRoot]", never, { "value": { "alias": "value"; "required": false; }; "defaultValue": { "alias": "defaultValue"; "required": false; }; "orientation": { "alias": "orientation"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; }, { "onValueChange": "onValueChange"; }, never, never, true, never>;
|
37
37
|
}
|
@@ -14,6 +14,6 @@ export declare class RdxTabsTriggerDirective implements TabsTriggerProps {
|
|
14
14
|
protected onMouseDown(event: MouseEvent): void;
|
15
15
|
protected onKeyDown(event: KeyboardEvent): void;
|
16
16
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxTabsTriggerDirective, never>;
|
17
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsTriggerDirective, "[
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxTabsTriggerDirective, "[rdxTabsTrigger]", never, { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
18
18
|
}
|
19
19
|
export {};
|
package/toggle/index.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export * from './src/toggle
|
2
|
-
export type { ToggleProps } from './src/toggle
|
1
|
+
export * from './src/toggle.directive';
|
2
|
+
export type { ToggleProps } from './src/toggle.directive';
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
2
|
+
import * as i0 from "@angular/core";
|
3
|
+
export interface ToggleProps {
|
4
|
+
/**
|
5
|
+
* The controlled state of the toggle.
|
6
|
+
*/
|
7
|
+
pressed?: boolean;
|
8
|
+
/**
|
9
|
+
* The state of the toggle when initially rendered. Use `defaultPressed`
|
10
|
+
* if you do not need to control the state of the toggle.
|
11
|
+
* @defaultValue false
|
12
|
+
*/
|
13
|
+
defaultPressed?: boolean;
|
14
|
+
/**
|
15
|
+
* The callback that fires when the state of the toggle changes.
|
16
|
+
*/
|
17
|
+
onPressedChange?: EventEmitter<boolean>;
|
18
|
+
}
|
19
|
+
export declare class RdxToggleDirective {
|
20
|
+
readonly defaultPressed: import("@angular/core").InputSignal<boolean>;
|
21
|
+
readonly pressed: import("@angular/core").ModelSignal<boolean>;
|
22
|
+
readonly disabled: import("@angular/core").InputSignal<boolean>;
|
23
|
+
/**
|
24
|
+
* Event emitted when the toggle is pressed.
|
25
|
+
*/
|
26
|
+
readonly onPressedChange: EventEmitter<boolean>;
|
27
|
+
protected toggle(): void;
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxToggleDirective, never>;
|
29
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxToggleDirective, "button[rdxToggle]", ["rdxToggle"], { "defaultPressed": { "alias": "defaultPressed"; "required": false; "isSignal": true; }; "pressed": { "alias": "pressed"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "pressed": "pressedChange"; "onPressedChange": "onPressedChange"; }, never, never, true, never>;
|
30
|
+
}
|