@radix-ng/primitives 0.20.2 → 0.22.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/avatar/src/avatar-fallback.directive.d.ts +1 -1
- package/avatar/src/avatar-image.directive.d.ts +3 -3
- package/compodoc/documentation.json +6879 -2567
- package/core/index.d.ts +1 -0
- package/core/src/id-generator.d.ts +12 -0
- package/esm2022/avatar/src/avatar-fallback.directive.mjs +6 -8
- package/esm2022/avatar/src/avatar-image.directive.mjs +4 -3
- package/esm2022/core/index.mjs +2 -1
- package/esm2022/core/src/create-inject-context/index.mjs +2 -2
- package/esm2022/core/src/id-generator.mjs +43 -0
- package/esm2022/popover/index.mjs +14 -4
- package/esm2022/popover/src/popover-anchor.directive.mjs +70 -0
- package/esm2022/popover/src/popover-anchor.token.mjs +3 -0
- package/esm2022/popover/src/popover-arrow.directive.mjs +12 -7
- package/esm2022/popover/src/popover-close.directive.mjs +16 -4
- package/esm2022/popover/src/popover-close.token.mjs +3 -0
- package/esm2022/popover/src/popover-content-attributes.component.mjs +70 -0
- package/esm2022/popover/src/popover-content-attributes.token.mjs +3 -0
- package/esm2022/popover/src/popover-content.directive.mjs +120 -84
- package/esm2022/popover/src/popover-root.directive.mjs +232 -64
- package/esm2022/popover/src/popover-root.inject.mjs +4 -4
- package/esm2022/popover/src/popover-trigger.directive.mjs +5 -7
- package/esm2022/popover/src/popover.types.mjs +18 -1
- package/esm2022/popover/src/popover.utils.mjs +4 -6
- package/esm2022/switch/src/switch-input.directive.mjs +16 -7
- package/esm2022/switch/src/switch-root.directive.mjs +59 -14
- package/esm2022/switch/src/switch-thumb.directive.mjs +3 -3
- package/esm2022/tabs/index.mjs +3 -6
- package/esm2022/tabs/src/tabs-content.directive.mjs +14 -8
- package/esm2022/tabs/src/tabs-list.directive.mjs +9 -6
- package/esm2022/tabs/src/tabs-root.directive.mjs +40 -37
- package/esm2022/tabs/src/tabs-trigger.directive.mjs +43 -17
- package/esm2022/tabs/src/utils.mjs +7 -0
- package/esm2022/toggle/index.mjs +2 -2
- package/esm2022/toggle/src/toggle-visually-hidden-input.directive.mjs +31 -0
- package/esm2022/toggle/src/toggle.directive.mjs +39 -8
- package/esm2022/toggle-group/src/toggle-group-item.directive.mjs +4 -3
- package/fesm2022/radix-ng-primitives-avatar.mjs +8 -9
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-core.mjs +44 -3
- package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-popover.mjs +672 -303
- package/fesm2022/radix-ng-primitives-popover.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-switch.mjs +76 -22
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-tabs.mjs +109 -109
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +3 -2
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
- package/fesm2022/radix-ng-primitives-toggle.mjs +47 -15
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
- package/package.json +1 -1
- package/popover/index.d.ts +5 -1
- package/popover/src/popover-anchor.directive.d.ts +28 -0
- package/popover/src/popover-anchor.token.d.ts +3 -0
- package/popover/src/popover-arrow.directive.d.ts +8 -5
- package/popover/src/popover-close.directive.d.ts +1 -1
- package/popover/src/popover-close.token.d.ts +3 -0
- package/popover/src/popover-content-attributes.component.d.ts +17 -0
- package/popover/src/popover-content-attributes.token.d.ts +3 -0
- package/popover/src/popover-content.directive.d.ts +36 -23
- package/popover/src/popover-root.directive.d.ts +89 -18
- package/popover/src/popover-root.inject.d.ts +2 -1
- package/popover/src/popover-trigger.directive.d.ts +3 -5
- package/popover/src/popover.types.d.ts +14 -3
- package/switch/src/switch-input.directive.d.ts +2 -0
- package/switch/src/switch-root.directive.d.ts +33 -5
- package/tabs/index.d.ts +0 -1
- package/tabs/src/tabs-content.directive.d.ts +6 -1
- package/tabs/src/tabs-list.directive.d.ts +6 -2
- package/tabs/src/tabs-root.directive.d.ts +25 -9
- package/tabs/src/tabs-trigger.directive.d.ts +13 -3
- package/tabs/src/utils.d.ts +2 -0
- package/toggle/index.d.ts +2 -2
- package/toggle/src/toggle-visually-hidden-input.directive.d.ts +6 -0
- package/toggle/src/toggle.directive.d.ts +20 -2
- package/esm2022/popover/src/popover-root.token.mjs +0 -3
- package/esm2022/tabs/src/tabs-context.service.mjs +0 -43
- package/esm2022/toggle/src/toggle-input.directive.mjs +0 -30
- package/popover/src/popover-root.token.d.ts +0 -3
- package/tabs/src/tabs-context.service.d.ts +0 -22
- package/toggle/src/toggle-input.directive.d.ts +0 -6
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-toggle-group.mjs","sources":["../../../packages/primitives/toggle-group/src/toggle-group-item.token.ts","../../../packages/primitives/toggle-group/src/toggle-group.token.ts","../../../packages/primitives/toggle-group/src/toggle-group-item.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group-multiple.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group.directive.ts","../../../packages/primitives/toggle-group/radix-ng-primitives-toggle-group.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { RdxToggleGroupItemDirective } from './toggle-group-item.directive';\n\nexport const RdxToggleGroupItemToken = new InjectionToken<RdxToggleGroupItemDirective>('RdxToggleGroupItemToken');\n","import { inject, InjectionToken } from '@angular/core';\nimport type { RdxToggleGroupMultipleDirective } from './toggle-group-multiple.directive';\nimport type { RdxToggleGroupDirective } from './toggle-group.directive';\n\nexport const RdxToggleGroupToken = new InjectionToken<RdxToggleGroupDirective | RdxToggleGroupMultipleDirective>(\n 'RdxToggleGroupToken'\n);\n\nexport function injectToggleGroup(): RdxToggleGroupDirective | RdxToggleGroupMultipleDirective {\n return inject(RdxToggleGroupToken);\n}\n","import { FocusableOption } from '@angular/cdk/a11y';\nimport { booleanAttribute, Directive, ElementRef, inject, Input, OnChanges, SimpleChanges } from '@angular/core';\nimport { RdxToggleGroupItemToken } from './toggle-group-item.token';\nimport { injectToggleGroup } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroupItem]',\n exportAs: 'rdxToggleGroupItem',\n standalone: true,\n providers: [{ provide: RdxToggleGroupItemToken, useExisting: RdxToggleGroupItemDirective }],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'checked',\n '[attr.aria-disabled]': 'disabled || toggleGroup.disabled',\n '[attr.aria-pressed]': 'undefined',\n\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 RdxToggleGroupItemDirective implements OnChanges, FocusableOption {\n /**\n * Access the toggle group.\n * @ignore\n */\n protected readonly toggleGroup = injectToggleGroup();\n\n private readonly elementRef = inject(ElementRef);\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 focus(): void {\n this.elementRef.nativeElement.focus();\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 { FocusKeyManager } from '@angular/cdk/a11y';\nimport {\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 { RdxToggleGroupItemDirective } from './toggle-group-item.directive';\nimport { RdxToggleGroupItemToken } from './toggle-group-item.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroupMultiple]',\n exportAs: 'rdxToggleGroupMultiple',\n standalone: true,\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupMultipleDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupMultipleDirective, multi: true }\n ],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation',\n\n '(keydown)': 'handleKeydown($event)',\n '(focusin)': 'onFocusIn()',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupMultipleDirective implements OnChanges, AfterContentInit, ControlValueAccessor {\n /**\n * The selected toggle button.\n */\n @Input() value: ReadonlyArray<string> = [];\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<ReadonlyArray<string>>();\n\n /**\n * Access the buttons in the toggle group.\n * @ignore\n */\n @ContentChildren(RdxToggleGroupItemToken)\n protected buttons?: QueryList<RdxToggleGroupItemDirective>;\n\n /**\n * FocusKeyManager to manage keyboard interactions.\n */\n private keyManager!: FocusKeyManager<RdxToggleGroupItemDirective>;\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 if (this.buttons) {\n this.keyManager = new FocusKeyManager(this.buttons).withWrap();\n }\n }\n\n protected onFocusIn(): void {\n if (!this.keyManager.activeItem) {\n this.keyManager.setFirstItemActive();\n }\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n this.keyManager.setNextItemActive();\n event.preventDefault();\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n this.keyManager.setPreviousItemActive();\n event.preventDefault();\n break;\n case 'Home':\n this.keyManager.setFirstItemActive();\n event.preventDefault();\n break;\n case 'End':\n this.keyManager.setLastItemActive();\n event.preventDefault();\n break;\n case 'Enter':\n case ' ':\n // eslint-disable-next-line no-case-declarations\n const activeItem = this.keyManager.activeItem;\n if (activeItem) {\n activeItem.toggle();\n }\n event.preventDefault();\n break;\n default:\n break;\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 { FocusKeyManager } from '@angular/cdk/a11y';\nimport {\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 { RdxToggleGroupItemDirective } from './toggle-group-item.directive';\nimport { RdxToggleGroupItemToken } from './toggle-group-item.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroup]',\n exportAs: '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\n '(focusout)': 'onTouched?.()',\n '(focusin)': 'onFocusIn()',\n '(keydown)': 'handleKeydown($event)'\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(RdxToggleGroupItemToken)\n protected buttons?: QueryList<RdxToggleGroupItemDirective>;\n\n /**\n * FocusKeyManager to manage keyboard interactions.\n */\n private keyManager!: FocusKeyManager<RdxToggleGroupItemDirective>;\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 if (this.buttons) {\n this.keyManager = new FocusKeyManager(this.buttons).withWrap();\n }\n }\n\n protected onFocusIn(): void {\n if (!this.keyManager.activeItem) {\n this.keyManager.setFirstItemActive();\n }\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n this.keyManager.setNextItemActive();\n event.preventDefault();\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n this.keyManager.setPreviousItemActive();\n event.preventDefault();\n break;\n case 'Home':\n this.keyManager.setFirstItemActive();\n event.preventDefault();\n break;\n case 'End':\n this.keyManager.setLastItemActive();\n event.preventDefault();\n break;\n case 'Enter':\n case ' ':\n // eslint-disable-next-line no-case-declarations\n const activeItem = this.keyManager.activeItem;\n if (activeItem) {\n activeItem.toggle();\n }\n event.preventDefault();\n break;\n default:\n break;\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,uBAAuB,GAAG,IAAI,cAAc,CAA8B,yBAAyB;;MCCnG,mBAAmB,GAAG,IAAI,cAAc,CACjD,qBAAqB;SAGT,iBAAiB,GAAA;AAC7B,IAAA,OAAO,MAAM,CAAC,mBAAmB,CAAC;AACtC;;MCaa,2BAA2B,CAAA;AAlBxC,IAAA,WAAA,GAAA;AAmBI;;;AAGG;QACgB,IAAW,CAAA,WAAA,GAAG,iBAAiB,EAAE;AAEnC,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAMhD;;;AAGG;QACqC,IAAQ,CAAA,QAAA,GAAG,KAAK;AA4C3D;AA1CG;;AAEG;AACH,IAAA,IAAc,OAAO,GAAA;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;;AAGlD;;AAEG;AACH,IAAA,WAAW,CAAC,OAAsB,EAAA;AAC9B,QAAA,IAAI,UAAU,IAAI,OAAO,EAAE;;;;AAK/B;;AAEG;IACH,KAAK,GAAA;AACD,QAAA,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,EAAE;;AAGzC;;AAEG;IACH,MAAM,GAAA;AACF,QAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;YACf;;QAGJ,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;;AAGvC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C,EAAE,SAAS,EAAE,gBAAgB,EAAE;gBAKpB,WAAW,EAAA,CAAA;sBAA5B;gBAMS,OAAO,EAAA,CAAA;sBADhB,eAAe;uBAAC,uBAAuB;;;AClE5C;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"radix-ng-primitives-toggle-group.mjs","sources":["../../../packages/primitives/toggle-group/src/toggle-group-item.token.ts","../../../packages/primitives/toggle-group/src/toggle-group.token.ts","../../../packages/primitives/toggle-group/src/toggle-group-item.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group-multiple.directive.ts","../../../packages/primitives/toggle-group/src/toggle-group.directive.ts","../../../packages/primitives/toggle-group/radix-ng-primitives-toggle-group.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\nimport type { RdxToggleGroupItemDirective } from './toggle-group-item.directive';\n\nexport const RdxToggleGroupItemToken = new InjectionToken<RdxToggleGroupItemDirective>('RdxToggleGroupItemToken');\n","import { inject, InjectionToken } from '@angular/core';\nimport type { RdxToggleGroupMultipleDirective } from './toggle-group-multiple.directive';\nimport type { RdxToggleGroupDirective } from './toggle-group.directive';\n\nexport const RdxToggleGroupToken = new InjectionToken<RdxToggleGroupDirective | RdxToggleGroupMultipleDirective>(\n 'RdxToggleGroupToken'\n);\n\nexport function injectToggleGroup(): RdxToggleGroupDirective | RdxToggleGroupMultipleDirective {\n return inject(RdxToggleGroupToken);\n}\n","import { FocusableOption } from '@angular/cdk/a11y';\nimport { booleanAttribute, Directive, ElementRef, inject, Input, OnChanges, SimpleChanges } from '@angular/core';\nimport { RdxToggleGroupItemToken } from './toggle-group-item.token';\nimport { injectToggleGroup } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroupItem]',\n exportAs: 'rdxToggleGroupItem',\n standalone: true,\n providers: [{ provide: RdxToggleGroupItemToken, useExisting: RdxToggleGroupItemDirective }],\n host: {\n role: 'radio',\n '[attr.aria-checked]': 'checked',\n '[attr.aria-disabled]': 'disabled || toggleGroup.disabled',\n '[attr.aria-pressed]': 'undefined',\n\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 '(focus)': 'focus()'\n }\n})\nexport class RdxToggleGroupItemDirective implements OnChanges, FocusableOption {\n /**\n * Access the toggle group.\n * @ignore\n */\n protected readonly toggleGroup = injectToggleGroup();\n\n private readonly elementRef = inject(ElementRef);\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 focus(): void {\n this.elementRef.nativeElement.focus();\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 { FocusKeyManager } from '@angular/cdk/a11y';\nimport {\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 { RdxToggleGroupItemDirective } from './toggle-group-item.directive';\nimport { RdxToggleGroupItemToken } from './toggle-group-item.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroupMultiple]',\n exportAs: 'rdxToggleGroupMultiple',\n standalone: true,\n providers: [\n { provide: RdxToggleGroupToken, useExisting: RdxToggleGroupMultipleDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupMultipleDirective, multi: true }\n ],\n host: {\n role: 'group',\n '[attr.data-orientation]': 'orientation',\n\n '(keydown)': 'handleKeydown($event)',\n '(focusin)': 'onFocusIn()',\n '(focusout)': 'onTouched?.()'\n }\n})\nexport class RdxToggleGroupMultipleDirective implements OnChanges, AfterContentInit, ControlValueAccessor {\n /**\n * The selected toggle button.\n */\n @Input() value: ReadonlyArray<string> = [];\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<ReadonlyArray<string>>();\n\n /**\n * Access the buttons in the toggle group.\n * @ignore\n */\n @ContentChildren(RdxToggleGroupItemToken)\n protected buttons?: QueryList<RdxToggleGroupItemDirective>;\n\n /**\n * FocusKeyManager to manage keyboard interactions.\n */\n private keyManager!: FocusKeyManager<RdxToggleGroupItemDirective>;\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 if (this.buttons) {\n this.keyManager = new FocusKeyManager(this.buttons).withWrap();\n }\n }\n\n protected onFocusIn(): void {\n if (!this.keyManager.activeItem) {\n this.keyManager.setFirstItemActive();\n }\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n this.keyManager.setNextItemActive();\n event.preventDefault();\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n this.keyManager.setPreviousItemActive();\n event.preventDefault();\n break;\n case 'Home':\n this.keyManager.setFirstItemActive();\n event.preventDefault();\n break;\n case 'End':\n this.keyManager.setLastItemActive();\n event.preventDefault();\n break;\n case 'Enter':\n case ' ':\n // eslint-disable-next-line no-case-declarations\n const activeItem = this.keyManager.activeItem;\n if (activeItem) {\n activeItem.toggle();\n }\n event.preventDefault();\n break;\n default:\n break;\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 { FocusKeyManager } from '@angular/cdk/a11y';\nimport {\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 { RdxToggleGroupItemDirective } from './toggle-group-item.directive';\nimport { RdxToggleGroupItemToken } from './toggle-group-item.token';\nimport { RdxToggleGroupToken } from './toggle-group.token';\n\n@Directive({\n selector: '[rdxToggleGroup]',\n exportAs: '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\n '(focusout)': 'onTouched?.()',\n '(focusin)': 'onFocusIn()',\n '(keydown)': 'handleKeydown($event)'\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(RdxToggleGroupItemToken)\n protected buttons?: QueryList<RdxToggleGroupItemDirective>;\n\n /**\n * FocusKeyManager to manage keyboard interactions.\n */\n private keyManager!: FocusKeyManager<RdxToggleGroupItemDirective>;\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 if (this.buttons) {\n this.keyManager = new FocusKeyManager(this.buttons).withWrap();\n }\n }\n\n protected onFocusIn(): void {\n if (!this.keyManager.activeItem) {\n this.keyManager.setFirstItemActive();\n }\n }\n\n protected handleKeydown(event: KeyboardEvent): void {\n switch (event.key) {\n case 'ArrowRight':\n case 'ArrowDown':\n this.keyManager.setNextItemActive();\n event.preventDefault();\n break;\n case 'ArrowLeft':\n case 'ArrowUp':\n this.keyManager.setPreviousItemActive();\n event.preventDefault();\n break;\n case 'Home':\n this.keyManager.setFirstItemActive();\n event.preventDefault();\n break;\n case 'End':\n this.keyManager.setLastItemActive();\n event.preventDefault();\n break;\n case 'Enter':\n case ' ':\n // eslint-disable-next-line no-case-declarations\n const activeItem = this.keyManager.activeItem;\n if (activeItem) {\n activeItem.toggle();\n }\n event.preventDefault();\n break;\n default:\n break;\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.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,SAAA,EAAA,OAAA,EAAA,CAAA,EAAA,YAAA,EAAA,SAAA,EAAA,SAAA,EA0CgB,uBAAuB,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,aAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;4FAhC/B,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAjBnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,SAAS,EAAE;AACP,wBAAA,EAAE,OAAO,EAAE,mBAAmB,EAAE,WAAW,yBAAyB,EAAE;wBACtE,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,yBAAyB,EAAE,KAAK,EAAE,IAAI;AAClF,qBAAA;AACD,oBAAA,IAAI,EAAE;AACF,wBAAA,IAAI,EAAE,OAAO;AACb,wBAAA,yBAAyB,EAAE,aAAa;AAExC,wBAAA,YAAY,EAAE,eAAe;AAC7B,wBAAA,WAAW,EAAE,aAAa;AAC1B,wBAAA,WAAW,EAAE;AAChB;AACJ,iBAAA;8BAKY,KAAK,EAAA,CAAA;sBAAb;gBAMQ,WAAW,EAAA,CAAA;sBAAnB;gBAMuC,QAAQ,EAAA,CAAA;sBAA/C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;gBAME,IAAI,EAAA,CAAA;sBAA3C,KAAK;uBAAC,EAAE,SAAS,EAAE,gBAAgB,EAAE;gBAKpB,WAAW,EAAA,CAAA;sBAA5B;gBAMS,OAAO,EAAA,CAAA;sBADhB,eAAe;uBAAC,uBAAuB;;;AClE5C;;AAEG;;;;"}
|
@@ -1,17 +1,18 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { Directive, input, booleanAttribute, model, output } from '@angular/core';
|
2
|
+
import { Directive, forwardRef, input, booleanAttribute, model, computed, output, signal } from '@angular/core';
|
3
3
|
import * as i1 from '@radix-ng/primitives/visually-hidden';
|
4
4
|
import { RdxVisuallyHiddenInputDirective } from '@radix-ng/primitives/visually-hidden';
|
5
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
5
6
|
|
6
|
-
class
|
7
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type:
|
8
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.11", type:
|
7
|
+
class RdxToggleVisuallyHiddenInputDirective {
|
8
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxToggleVisuallyHiddenInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
9
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.11", type: RdxToggleVisuallyHiddenInputDirective, isStandalone: true, selector: "input[rdxToggleVisuallyHiddenInput]", host: { attributes: { "type": "checkbox" } }, exportAs: ["rdxToggleVisuallyHiddenInput"], hostDirectives: [{ directive: i1.RdxVisuallyHiddenInputDirective, inputs: ["name", "name", "required", "required", "value", "value", "disabled", "disabled"] }], ngImport: i0 }); }
|
9
10
|
}
|
10
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type:
|
11
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxToggleVisuallyHiddenInputDirective, decorators: [{
|
11
12
|
type: Directive,
|
12
13
|
args: [{
|
13
|
-
selector: '[
|
14
|
-
exportAs: '
|
14
|
+
selector: 'input[rdxToggleVisuallyHiddenInput]',
|
15
|
+
exportAs: 'rdxToggleVisuallyHiddenInput',
|
15
16
|
standalone: true,
|
16
17
|
hostDirectives: [
|
17
18
|
{
|
@@ -19,7 +20,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
|
|
19
20
|
inputs: [
|
20
21
|
'name',
|
21
22
|
'required',
|
22
|
-
'value'
|
23
|
+
'value',
|
24
|
+
'disabled'
|
23
25
|
]
|
24
26
|
}
|
25
27
|
],
|
@@ -29,6 +31,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
|
|
29
31
|
}]
|
30
32
|
}] });
|
31
33
|
|
34
|
+
const TOGGLE_VALUE_ACCESSOR = {
|
35
|
+
provide: NG_VALUE_ACCESSOR,
|
36
|
+
useExisting: forwardRef(() => RdxToggleDirective),
|
37
|
+
multi: true
|
38
|
+
};
|
32
39
|
class RdxToggleDirective {
|
33
40
|
constructor() {
|
34
41
|
/**
|
@@ -45,19 +52,43 @@ class RdxToggleDirective {
|
|
45
52
|
* When true, prevents the user from interacting with the toggle.
|
46
53
|
*/
|
47
54
|
this.disabled = input(false, { transform: booleanAttribute });
|
55
|
+
/** @ignore */
|
56
|
+
this.disabledState = computed(() => this.disabled() || this.accessorDisabled());
|
57
|
+
this.dataState = computed(() => {
|
58
|
+
return this.pressed() ? 'on' : 'off';
|
59
|
+
});
|
48
60
|
/**
|
49
61
|
* Event handler called when the pressed state of the toggle changes.
|
50
62
|
*/
|
51
63
|
this.onPressedChange = output();
|
64
|
+
this.accessorDisabled = signal(false);
|
65
|
+
this.onChange = () => { };
|
52
66
|
}
|
53
|
-
|
67
|
+
togglePressed() {
|
54
68
|
if (!this.disabled()) {
|
55
69
|
this.pressed.set(!this.pressed());
|
70
|
+
this.onChange(this.pressed());
|
56
71
|
this.onPressedChange.emit(this.pressed());
|
57
72
|
}
|
58
73
|
}
|
74
|
+
/** @ignore */
|
75
|
+
writeValue(value) {
|
76
|
+
this.pressed.set(value);
|
77
|
+
}
|
78
|
+
/** @ignore */
|
79
|
+
registerOnChange(fn) {
|
80
|
+
this.onChange = fn;
|
81
|
+
}
|
82
|
+
/** @ignore */
|
83
|
+
registerOnTouched(fn) {
|
84
|
+
this.onTouched = fn;
|
85
|
+
}
|
86
|
+
/** @ignore */
|
87
|
+
setDisabledState(isDisabled) {
|
88
|
+
this.accessorDisabled.set(isDisabled);
|
89
|
+
}
|
59
90
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxToggleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
60
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.11", type: RdxToggleDirective, isStandalone: true, selector: "[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: { listeners: { "click": "
|
91
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "18.2.11", type: RdxToggleDirective, isStandalone: true, selector: "[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: { listeners: { "click": "togglePressed()" }, properties: { "attr.aria-pressed": "pressed()", "attr.data-state": "dataState()", "attr.data-disabled": "disabledState() ? \"\" : undefined", "disabled": "disabledState()" } }, providers: [TOGGLE_VALUE_ACCESSOR], exportAs: ["rdxToggle"], ngImport: i0 }); }
|
61
92
|
}
|
62
93
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImport: i0, type: RdxToggleDirective, decorators: [{
|
63
94
|
type: Directive,
|
@@ -65,12 +96,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
|
|
65
96
|
selector: '[rdxToggle]',
|
66
97
|
exportAs: 'rdxToggle',
|
67
98
|
standalone: true,
|
99
|
+
providers: [TOGGLE_VALUE_ACCESSOR],
|
68
100
|
host: {
|
69
101
|
'[attr.aria-pressed]': 'pressed()',
|
70
|
-
'[attr.data-state]': '
|
71
|
-
'[attr.data-disabled]': '
|
72
|
-
'[disabled]': '
|
73
|
-
'(click)': '
|
102
|
+
'[attr.data-state]': 'dataState()',
|
103
|
+
'[attr.data-disabled]': 'disabledState() ? "" : undefined',
|
104
|
+
'[disabled]': 'disabledState()',
|
105
|
+
'(click)': 'togglePressed()'
|
74
106
|
}
|
75
107
|
}]
|
76
108
|
}] });
|
@@ -79,5 +111,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.11", ngImpo
|
|
79
111
|
* Generated bundle index. Do not edit.
|
80
112
|
*/
|
81
113
|
|
82
|
-
export { RdxToggleDirective,
|
114
|
+
export { RdxToggleDirective, RdxToggleVisuallyHiddenInputDirective, TOGGLE_VALUE_ACCESSOR };
|
83
115
|
//# sourceMappingURL=radix-ng-primitives-toggle.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle-input.directive.ts","../../../packages/primitives/toggle/src/toggle.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { RdxVisuallyHiddenInputDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Directive({\n selector: '[
|
1
|
+
{"version":3,"file":"radix-ng-primitives-toggle.mjs","sources":["../../../packages/primitives/toggle/src/toggle-visually-hidden-input.directive.ts","../../../packages/primitives/toggle/src/toggle.directive.ts","../../../packages/primitives/toggle/radix-ng-primitives-toggle.ts"],"sourcesContent":["import { Directive } from '@angular/core';\nimport { RdxVisuallyHiddenInputDirective } from '@radix-ng/primitives/visually-hidden';\n\n@Directive({\n selector: 'input[rdxToggleVisuallyHiddenInput]',\n exportAs: 'rdxToggleVisuallyHiddenInput',\n standalone: true,\n hostDirectives: [\n {\n directive: RdxVisuallyHiddenInputDirective,\n inputs: [\n 'name',\n 'required',\n 'value',\n 'disabled'\n ]\n }\n ],\n host: {\n type: 'checkbox'\n }\n})\nexport class RdxToggleVisuallyHiddenInputDirective {}\n","import { BooleanInput } from '@angular/cdk/coercion';\nimport {\n booleanAttribute,\n computed,\n Directive,\n forwardRef,\n input,\n model,\n output,\n OutputEmitterRef,\n signal\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport interface ToggleProps {\n /**\n * The controlled state of the toggle.\n */\n pressed?: boolean;\n\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 /**\n * The callback that fires when the state of the toggle changes.\n */\n onPressedChange?: OutputEmitterRef<boolean>;\n\n /**\n * Whether the toggle is disabled.\n * @defaultValue false\n */\n disabled?: boolean;\n}\n\nexport type DataState = 'on' | 'off';\n\nexport const TOGGLE_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => RdxToggleDirective),\n multi: true\n};\n\n@Directive({\n selector: '[rdxToggle]',\n exportAs: 'rdxToggle',\n standalone: true,\n providers: [TOGGLE_VALUE_ACCESSOR],\n host: {\n '[attr.aria-pressed]': 'pressed()',\n '[attr.data-state]': 'dataState()',\n '[attr.data-disabled]': 'disabledState() ? \"\" : undefined',\n '[disabled]': 'disabledState()',\n\n '(click)': 'togglePressed()'\n }\n})\nexport class RdxToggleDirective implements ControlValueAccessor {\n /**\n * The pressed state of the toggle when it is initially rendered.\n * Use when you do not need to control its pressed state.\n */\n readonly defaultPressed = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The controlled pressed state of the toggle.\n * Must be used in conjunction with `onPressedChange`.\n */\n readonly pressed = model<boolean>(this.defaultPressed());\n\n /**\n * When true, prevents the user from interacting with the toggle.\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** @ignore */\n readonly disabledState = computed(() => this.disabled() || this.accessorDisabled());\n\n protected readonly dataState = computed<DataState>(() => {\n return this.pressed() ? 'on' : 'off';\n });\n\n /**\n * Event handler called when the pressed state of the toggle changes.\n */\n readonly onPressedChange = output<boolean>();\n\n protected togglePressed(): void {\n if (!this.disabled()) {\n this.pressed.set(!this.pressed());\n this.onChange(this.pressed());\n this.onPressedChange.emit(this.pressed());\n }\n }\n\n private readonly accessorDisabled = signal(false);\n\n private onChange: (value: any) => void = () => {};\n /** @ignore */\n onTouched: (() => void) | undefined;\n\n /** @ignore */\n writeValue(value: any): void {\n this.pressed.set(value);\n }\n\n /** @ignore */\n registerOnChange(fn: (value: any) => void): void {\n this.onChange = fn;\n }\n\n /** @ignore */\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /** @ignore */\n setDisabledState(isDisabled: boolean): void {\n this.accessorDisabled.set(isDisabled);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAsBa,qCAAqC,CAAA;+GAArC,qCAAqC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;mGAArC,qCAAqC,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qCAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,MAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,8BAAA,CAAA,EAAA,cAAA,EAAA,CAAA,EAAA,SAAA,EAAA,E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|
package/package.json
CHANGED
package/popover/index.d.ts
CHANGED
@@ -4,14 +4,18 @@ import * as i2 from "./src/popover-close.directive";
|
|
4
4
|
import * as i3 from "./src/popover-content.directive";
|
5
5
|
import * as i4 from "./src/popover-trigger.directive";
|
6
6
|
import * as i5 from "./src/popover-root.directive";
|
7
|
+
import * as i6 from "./src/popover-anchor.directive";
|
8
|
+
import * as i7 from "./src/popover-content-attributes.component";
|
9
|
+
export * from './src/popover-anchor.directive';
|
7
10
|
export * from './src/popover-arrow.directive';
|
8
11
|
export * from './src/popover-close.directive';
|
12
|
+
export * from './src/popover-content-attributes.component';
|
9
13
|
export * from './src/popover-content.directive';
|
10
14
|
export * from './src/popover-root.directive';
|
11
15
|
export * from './src/popover-trigger.directive';
|
12
16
|
export * from './src/popover.types';
|
13
17
|
export declare class RdxPopoverModule {
|
14
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxPopoverModule, never>;
|
15
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<RdxPopoverModule, never, [typeof i1.RdxPopoverArrowDirective, typeof i2.RdxPopoverCloseDirective, typeof i3.RdxPopoverContentDirective, typeof i4.RdxPopoverTriggerDirective, typeof i5.RdxPopoverRootDirective], [typeof i1.RdxPopoverArrowDirective, typeof i2.RdxPopoverCloseDirective, typeof i3.RdxPopoverContentDirective, typeof i4.RdxPopoverTriggerDirective, typeof i5.RdxPopoverRootDirective]>;
|
19
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<RdxPopoverModule, never, [typeof i1.RdxPopoverArrowDirective, typeof i2.RdxPopoverCloseDirective, typeof i3.RdxPopoverContentDirective, typeof i4.RdxPopoverTriggerDirective, typeof i5.RdxPopoverRootDirective, typeof i6.RdxPopoverAnchorDirective, typeof i7.RdxPopoverContentAttributesComponent], [typeof i1.RdxPopoverArrowDirective, typeof i2.RdxPopoverCloseDirective, typeof i3.RdxPopoverContentDirective, typeof i4.RdxPopoverTriggerDirective, typeof i5.RdxPopoverRootDirective, typeof i6.RdxPopoverAnchorDirective, typeof i7.RdxPopoverContentAttributesComponent]>;
|
16
20
|
static ɵinj: i0.ɵɵInjectorDeclaration<RdxPopoverModule>;
|
17
21
|
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { CdkOverlayOrigin } from '@angular/cdk/overlay';
|
2
|
+
import { ElementRef } from '@angular/core';
|
3
|
+
import { RdxPopoverRootDirective } from './popover-root.directive';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
import * as i1 from "@angular/cdk/overlay";
|
6
|
+
export declare class RdxPopoverAnchorDirective {
|
7
|
+
/**
|
8
|
+
* @ignore
|
9
|
+
* If outside the root then null, otherwise the root directive - with optional `true` passed in as the first param.
|
10
|
+
* If outside the root and non-null value that means the html structure is wrong - popover inside popover.
|
11
|
+
* */
|
12
|
+
protected popoverRoot: RdxPopoverRootDirective | null;
|
13
|
+
/** @ignore */
|
14
|
+
readonly elementRef: ElementRef<any>;
|
15
|
+
/** @ignore */
|
16
|
+
readonly overlayOrigin: CdkOverlayOrigin;
|
17
|
+
/** @ignore */
|
18
|
+
readonly document: Document;
|
19
|
+
/** @ignore */
|
20
|
+
readonly name: import("@angular/core").Signal<string>;
|
21
|
+
/** @ignore */
|
22
|
+
click(): void;
|
23
|
+
/** @ignore */
|
24
|
+
setPopoverRoot(popoverRoot: RdxPopoverRootDirective): void;
|
25
|
+
private emitOutsideClick;
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxPopoverAnchorDirective, never>;
|
27
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxPopoverAnchorDirective, "[rdxPopoverAnchor]", ["rdxPopoverAnchor"], {}, {}, never, never, true, [{ directive: typeof i1.CdkOverlayOrigin; inputs: {}; outputs: {}; }]>;
|
28
|
+
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { AfterViewInit } from '@angular/core';
|
1
|
+
import { AfterViewInit, ElementRef } from '@angular/core';
|
2
2
|
import * as i0 from "@angular/core";
|
3
3
|
export declare class RdxPopoverArrowDirective implements AfterViewInit {
|
4
4
|
/** @ignore */
|
@@ -6,13 +6,15 @@ export declare class RdxPopoverArrowDirective implements AfterViewInit {
|
|
6
6
|
/** @ignore */
|
7
7
|
private readonly popoverRoot;
|
8
8
|
/** @ignore */
|
9
|
-
|
9
|
+
readonly elementRef: ElementRef<any>;
|
10
10
|
/**
|
11
|
-
* The width of the arrow in pixels.
|
11
|
+
* @description The width of the arrow in pixels.
|
12
|
+
* @default 10
|
12
13
|
*/
|
13
14
|
readonly width: import("@angular/core").InputSignal<number>;
|
14
15
|
/**
|
15
|
-
* The height of the arrow in pixels.
|
16
|
+
* @description The height of the arrow in pixels.
|
17
|
+
* @default 5
|
16
18
|
*/
|
17
19
|
readonly height: import("@angular/core").InputSignal<number>;
|
18
20
|
/** @ignore */
|
@@ -22,10 +24,11 @@ export declare class RdxPopoverArrowDirective implements AfterViewInit {
|
|
22
24
|
/** @ignore */
|
23
25
|
private readonly position;
|
24
26
|
/** @ignore */
|
25
|
-
private
|
27
|
+
private anchorOrTriggerRect;
|
26
28
|
constructor();
|
27
29
|
/** @ignore */
|
28
30
|
ngAfterViewInit(): void;
|
31
|
+
private setAnchorOrTriggerRect;
|
29
32
|
/** @ignore */
|
30
33
|
private setPosition;
|
31
34
|
/** @ignore */
|
@@ -2,7 +2,7 @@ import { ElementRef } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
3
3
|
export declare class RdxPopoverCloseDirective {
|
4
4
|
/** @ignore */
|
5
|
-
readonly popoverRoot: import("@radix-ng/primitives/popover").RdxPopoverRootDirective;
|
5
|
+
protected readonly popoverRoot: import("@radix-ng/primitives/popover").RdxPopoverRootDirective;
|
6
6
|
/** @ignore */
|
7
7
|
readonly elementRef: ElementRef<any>;
|
8
8
|
/** @ignore */
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
export declare class RdxPopoverContentAttributesComponent {
|
3
|
+
/** @ignore */
|
4
|
+
protected readonly popoverRoot: import("@radix-ng/primitives/popover").RdxPopoverRootDirective;
|
5
|
+
/** @ignore */
|
6
|
+
readonly name: import("@angular/core").Signal<string>;
|
7
|
+
/** @ignore */
|
8
|
+
readonly disableAnimation: import("@angular/core").Signal<boolean>;
|
9
|
+
/** @ignore */
|
10
|
+
protected onAnimationStart(_: AnimationEvent): void;
|
11
|
+
/** @ignore */
|
12
|
+
protected onAnimationEnd(_: AnimationEvent): void;
|
13
|
+
/** @ignore */
|
14
|
+
private canAnimate;
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RdxPopoverContentAttributesComponent, never>;
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<RdxPopoverContentAttributesComponent, "[rdxPopoverContentAttributes]", never, {}, {}, never, ["*"], true, never>;
|
17
|
+
}
|
@@ -1,64 +1,70 @@
|
|
1
|
-
import {
|
2
|
-
import { DestroyRef, OnInit, TemplateRef } from '@angular/core';
|
1
|
+
import { OnInit } from '@angular/core';
|
3
2
|
import { RdxPopoverAlign, RdxPopoverSide } from './popover.types';
|
4
3
|
import * as i0 from "@angular/core";
|
5
4
|
import * as i1 from "@angular/cdk/overlay";
|
6
5
|
export declare class RdxPopoverContentDirective implements OnInit {
|
7
6
|
/** @ignore */
|
8
|
-
readonly popoverRoot
|
7
|
+
private readonly popoverRoot;
|
9
8
|
/** @ignore */
|
10
|
-
readonly templateRef
|
9
|
+
private readonly templateRef;
|
11
10
|
/** @ignore */
|
12
|
-
readonly overlay
|
11
|
+
private readonly overlay;
|
13
12
|
/** @ignore */
|
14
|
-
readonly destroyRef
|
13
|
+
private readonly destroyRef;
|
15
14
|
/** @ignore */
|
16
15
|
private readonly connectedOverlay;
|
16
|
+
/** @ignore */
|
17
|
+
readonly name: import("@angular/core").Signal<string>;
|
17
18
|
/**
|
18
|
-
* The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled.
|
19
|
+
* @description The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled.
|
20
|
+
* @default top
|
19
21
|
*/
|
20
22
|
readonly side: import("@angular/core").InputSignal<RdxPopoverSide>;
|
21
23
|
/**
|
22
|
-
* The distance in pixels from the trigger.
|
24
|
+
* @description The distance in pixels from the trigger.
|
25
|
+
* @default undefined
|
23
26
|
*/
|
24
27
|
readonly sideOffset: import("@angular/core").InputSignal<number | undefined>;
|
25
28
|
/**
|
26
|
-
* The preferred alignment against the trigger. May change when collisions occur.
|
29
|
+
* @description The preferred alignment against the trigger. May change when collisions occur.
|
30
|
+
* @default center
|
27
31
|
*/
|
28
32
|
readonly align: import("@angular/core").InputSignal<RdxPopoverAlign>;
|
29
33
|
/**
|
30
|
-
* An offset in pixels from the "start" or "end" alignment options.
|
34
|
+
* @description An offset in pixels from the "start" or "end" alignment options.
|
35
|
+
* @default undefined
|
31
36
|
*/
|
32
37
|
readonly alignOffset: import("@angular/core").InputSignal<number | undefined>;
|
33
38
|
/**
|
34
|
-
* Whether to add some alternate positions of the content.
|
39
|
+
* @description Whether to add some alternate positions of the content.
|
40
|
+
* @default false
|
35
41
|
*/
|
36
42
|
readonly disableAlternatePositions: import("@angular/core").InputSignal<boolean>;
|
37
|
-
/** @ingore */
|
38
|
-
readonly positions: import("@angular/core").Signal<import("@angular/cdk/overlay").ConnectedPosition[]>;
|
39
43
|
/**
|
40
|
-
* Event handler called when the escape key is down. It can be prevented by calling event.preventDefault.
|
44
|
+
* @description Event handler called when the escape key is down. It can be prevented by calling event.preventDefault.
|
41
45
|
*/
|
42
46
|
readonly onEscapeKeyDown: import("@angular/core").OutputEmitterRef<KeyboardEvent>;
|
43
47
|
/**
|
44
|
-
* Event handler called when a pointer event occurs outside the bounds of the component. It can be prevented by calling event.preventDefault.
|
48
|
+
* @description Event handler called when a pointer event occurs outside the bounds of the component. It can be prevented by calling event.preventDefault.
|
45
49
|
*/
|
46
|
-
readonly
|
50
|
+
readonly onOutsideClick: import("@angular/core").OutputEmitterRef<MouseEvent>;
|
47
51
|
/**
|
48
|
-
* Event handler called
|
52
|
+
* @description Event handler called after the overlay is open
|
49
53
|
*/
|
50
|
-
readonly
|
54
|
+
readonly onOpen: import("@angular/core").OutputEmitterRef<void>;
|
51
55
|
/**
|
52
|
-
* Event handler called
|
56
|
+
* @description Event handler called after the overlay is closed
|
53
57
|
*/
|
54
|
-
readonly
|
58
|
+
readonly onClosed: import("@angular/core").OutputEmitterRef<void>;
|
59
|
+
/** @ingore */
|
60
|
+
readonly positions: import("@angular/core").Signal<import("@angular/cdk/overlay").ConnectedPosition[]>;
|
55
61
|
constructor();
|
56
62
|
/** @ignore */
|
57
63
|
ngOnInit(): void;
|
58
64
|
/** @ignore */
|
59
|
-
|
65
|
+
open(): void;
|
60
66
|
/** @ignore */
|
61
|
-
|
67
|
+
close(): void;
|
62
68
|
/** @ignore */
|
63
69
|
positionChange(): import("rxjs").Observable<import("@angular/cdk/overlay").ConnectedOverlayPositionChange>;
|
64
70
|
/** @ignore */
|
@@ -76,7 +82,14 @@ export declare class RdxPopoverContentDirective implements OnInit {
|
|
76
82
|
/** @ignore */
|
77
83
|
private setOrigin;
|
78
84
|
/** @ignore */
|
85
|
+
private setPositions;
|
86
|
+
/** @ignore */
|
87
|
+
private computePositions;
|
88
|
+
private onOriginChangeEffect;
|
89
|
+
/** @ignore */
|
79
90
|
private onPositionChangeEffect;
|
91
|
+
/** @ignore */
|
92
|
+
private fireOverlayNgOnChanges;
|
80
93
|
static ɵfac: i0.ɵɵFactoryDeclaration<RdxPopoverContentDirective, never>;
|
81
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxPopoverContentDirective, "[rdxPopoverContent]", never, { "side": { "alias": "side"; "required": false; "isSignal": true; }; "sideOffset": { "alias": "sideOffset"; "required": false; "isSignal": true; }; "align": { "alias": "align"; "required": false; "isSignal": true; }; "alignOffset": { "alias": "alignOffset"; "required": false; "isSignal": true; }; "disableAlternatePositions": { "alias": "disableAlternatePositions"; "required": false; "isSignal": true; }; }, { "onEscapeKeyDown": "onEscapeKeyDown"; "
|
94
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RdxPopoverContentDirective, "[rdxPopoverContent]", never, { "side": { "alias": "side"; "required": false; "isSignal": true; }; "sideOffset": { "alias": "sideOffset"; "required": false; "isSignal": true; }; "align": { "alias": "align"; "required": false; "isSignal": true; }; "alignOffset": { "alias": "alignOffset"; "required": false; "isSignal": true; }; "disableAlternatePositions": { "alias": "disableAlternatePositions"; "required": false; "isSignal": true; }; }, { "onEscapeKeyDown": "onEscapeKeyDown"; "onOutsideClick": "onOutsideClick"; "onOpen": "onOpen"; "onClosed": "onClosed"; }, never, never, true, [{ directive: typeof i1.CdkConnectedOverlay; inputs: {}; outputs: {}; }]>;
|
82
95
|
}
|