@radix-ng/primitives 0.12.1 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/accordion/index.d.ts +16 -0
- package/accordion/src/accordion-content.directive.d.ts +11 -0
- package/accordion/src/accordion-header.directive.d.ts +7 -0
- package/accordion/src/accordion-item.directive.d.ts +82 -0
- package/accordion/src/accordion-root.directive.d.ts +93 -0
- package/accordion/src/accordion-trigger.directive.d.ts +15 -0
- package/alert-dialog/{index.ts → index.d.ts} +0 -1
- package/alert-dialog/src/alert-dialog-cancel.directive.d.ts +7 -0
- package/alert-dialog/src/alert-dialog-content.directive.d.ts +9 -0
- package/alert-dialog/src/alert-dialog-root.directive.d.ts +9 -0
- package/alert-dialog/src/alert-dialog-title.directive.d.ts +5 -0
- package/alert-dialog/src/alert-dialog-trigger.directive.d.ts +7 -0
- package/alert-dialog/src/alert-dialog.service.d.ts +14 -0
- package/avatar/src/avatar-fallback.directive.d.ts +28 -0
- package/avatar/src/avatar-image.directive.d.ts +21 -0
- package/avatar/src/avatar-root.directive.d.ts +21 -0
- package/avatar/src/avatar.config.d.ts +13 -0
- package/checkbox/src/checkbox-button.directive.d.ts +8 -0
- package/checkbox/src/checkbox-indicator.directive.d.ts +6 -0
- package/checkbox/src/checkbox-input.directive.d.ts +9 -0
- package/checkbox/src/checkbox.directive.d.ts +75 -0
- package/checkbox/src/checkbox.token.d.ts +4 -0
- package/collapsible/src/collapsible-content.directive.d.ts +17 -0
- package/collapsible/src/collapsible-content.token.d.ts +3 -0
- package/collapsible/src/collapsible-root.directive.d.ts +55 -0
- package/collapsible/src/collapsible-trigger.directive.d.ts +26 -0
- package/compodoc/documentation.json +14249 -0
- package/context-menu/index.d.ts +26 -0
- package/context-menu/src/context-menu-content.directive.d.ts +15 -0
- package/context-menu/src/context-menu-item-checkbox.directive.d.ts +9 -0
- package/context-menu/src/context-menu-item-indicator.directive.d.ts +7 -0
- package/context-menu/src/context-menu-item-radio-group.directive.d.ts +12 -0
- package/context-menu/src/context-menu-item-radio.directive.d.ts +19 -0
- package/context-menu/src/context-menu-item-selectable.d.ts +12 -0
- package/context-menu/src/context-menu-item.directive.d.ts +17 -0
- package/context-menu/src/context-menu-label.directive.d.ts +5 -0
- package/context-menu/src/context-menu-separator.directive.d.ts +6 -0
- package/context-menu/src/context-menu-trigger.directive.d.ts +31 -0
- package/dialog/index.d.ts +23 -0
- package/dialog/src/dialog-close.directive.d.ts +7 -0
- package/dialog/src/dialog-content.directive.d.ts +21 -0
- package/dialog/src/dialog-description.directive.d.ts +5 -0
- package/dialog/src/dialog-dismiss.directive.d.ts +7 -0
- package/dialog/src/dialog-ref.d.ts +37 -0
- package/dialog/src/dialog-title.directive.d.ts +5 -0
- package/dialog/src/dialog-trigger.directive.d.ts +16 -0
- package/dialog/src/dialog.config.d.ts +39 -0
- package/dialog/src/dialog.injectors.d.ts +4 -0
- package/dialog/src/{dialog.providers.ts → dialog.providers.d.ts} +3 -11
- package/dialog/src/dialog.service.d.ts +26 -0
- package/dropdown-menu/index.d.ts +26 -0
- package/dropdown-menu/src/dropdown-menu-content.directive.d.ts +15 -0
- package/dropdown-menu/src/dropdown-menu-item-checkbox.directive.d.ts +9 -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 +12 -0
- package/dropdown-menu/src/dropdown-menu-item.directive.d.ts +17 -0
- package/dropdown-menu/src/dropdown-menu-label.directive.d.ts +5 -0
- package/dropdown-menu/src/dropdown-menu-separator.directive.d.ts +6 -0
- package/dropdown-menu/src/dropdown-menu-trigger.directive.d.ts +46 -0
- package/esm2022/accordion/index.mjs +40 -0
- package/esm2022/accordion/radix-ng-primitives-accordion.mjs +5 -0
- package/esm2022/accordion/src/accordion-content.directive.mjs +42 -0
- package/esm2022/accordion/src/accordion-header.directive.mjs +23 -0
- package/esm2022/accordion/src/accordion-item.directive.mjs +187 -0
- package/esm2022/accordion/src/accordion-root.directive.mjs +172 -0
- package/esm2022/accordion/src/accordion-trigger.directive.mjs +42 -0
- package/esm2022/alert-dialog/index.mjs +7 -0
- package/esm2022/alert-dialog/radix-ng-primitives-alert-dialog.mjs +5 -0
- package/esm2022/alert-dialog/src/alert-dialog-cancel.directive.mjs +24 -0
- package/esm2022/alert-dialog/src/alert-dialog-content.directive.mjs +34 -0
- package/esm2022/alert-dialog/src/alert-dialog-root.directive.mjs +24 -0
- package/esm2022/alert-dialog/src/alert-dialog-title.directive.mjs +14 -0
- package/esm2022/alert-dialog/src/alert-dialog-trigger.directive.mjs +24 -0
- package/esm2022/alert-dialog/src/alert-dialog.service.mjs +46 -0
- package/esm2022/avatar/index.mjs +5 -0
- package/esm2022/avatar/radix-ng-primitives-avatar.mjs +5 -0
- package/esm2022/avatar/src/avatar-fallback.directive.mjs +60 -0
- package/esm2022/avatar/src/avatar-image.directive.mjs +52 -0
- package/esm2022/avatar/src/avatar-root.directive.mjs +38 -0
- package/esm2022/avatar/src/avatar.config.mjs +17 -0
- package/esm2022/checkbox/index.mjs +6 -0
- package/esm2022/checkbox/radix-ng-primitives-checkbox.mjs +5 -0
- package/esm2022/checkbox/src/checkbox-button.directive.mjs +33 -0
- package/esm2022/checkbox/src/checkbox-indicator.directive.mjs +24 -0
- package/esm2022/checkbox/src/checkbox-input.directive.mjs +41 -0
- package/esm2022/checkbox/src/checkbox.directive.mjs +141 -0
- package/esm2022/checkbox/src/checkbox.token.mjs +6 -0
- package/esm2022/collapsible/index.mjs +4 -0
- package/esm2022/collapsible/radix-ng-primitives-collapsible.mjs +5 -0
- package/esm2022/collapsible/src/collapsible-content.directive.mjs +45 -0
- package/esm2022/collapsible/src/collapsible-content.token.mjs +3 -0
- package/esm2022/collapsible/src/collapsible-root.directive.mjs +118 -0
- package/esm2022/collapsible/src/collapsible-trigger.directive.mjs +49 -0
- package/esm2022/context-menu/index.mjs +65 -0
- package/esm2022/context-menu/radix-ng-primitives-context-menu.mjs +5 -0
- package/esm2022/context-menu/src/context-menu-content.directive.mjs +56 -0
- package/esm2022/context-menu/src/context-menu-item-checkbox.directive.mjs +39 -0
- package/esm2022/context-menu/src/context-menu-item-indicator.directive.mjs +22 -0
- package/esm2022/context-menu/src/context-menu-item-radio-group.directive.mjs +37 -0
- package/esm2022/context-menu/src/context-menu-item-radio.directive.mjs +67 -0
- package/esm2022/context-menu/src/context-menu-item-selectable.mjs +31 -0
- package/esm2022/context-menu/src/context-menu-item.directive.mjs +70 -0
- package/esm2022/context-menu/src/context-menu-label.directive.mjs +14 -0
- package/esm2022/context-menu/src/context-menu-separator.directive.mjs +21 -0
- package/esm2022/context-menu/src/context-menu-trigger.directive.mjs +92 -0
- package/esm2022/dialog/index.mjs +50 -0
- package/esm2022/dialog/radix-ng-primitives-dialog.mjs +5 -0
- package/esm2022/dialog/src/dialog-close.directive.mjs +25 -0
- package/esm2022/dialog/src/dialog-content.directive.mjs +46 -0
- package/esm2022/dialog/src/dialog-description.directive.mjs +14 -0
- package/esm2022/dialog/src/dialog-dismiss.directive.mjs +25 -0
- package/esm2022/dialog/src/dialog-ref.mjs +46 -0
- package/esm2022/dialog/src/dialog-title.directive.mjs +14 -0
- package/esm2022/dialog/src/dialog-trigger.directive.mjs +54 -0
- package/esm2022/dialog/src/dialog.config.mjs +6 -0
- package/esm2022/dialog/src/dialog.injectors.mjs +10 -0
- package/esm2022/dialog/src/dialog.providers.mjs +26 -0
- package/esm2022/dialog/src/dialog.service.mjs +96 -0
- package/esm2022/dropdown-menu/index.mjs +68 -0
- package/esm2022/dropdown-menu/radix-ng-primitives-dropdown-menu.mjs +5 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-content.directive.mjs +56 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-checkbox.directive.mjs +39 -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 +67 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item-selectable.mjs +31 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-item.directive.mjs +71 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-label.directive.mjs +14 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-separator.directive.mjs +21 -0
- package/esm2022/dropdown-menu/src/dropdown-menu-trigger.directive.mjs +179 -0
- package/esm2022/index.mjs +2 -0
- package/esm2022/label/index.mjs +2 -0
- package/esm2022/label/radix-ng-primitives-label.mjs +5 -0
- package/esm2022/label/src/label.directive.mjs +59 -0
- package/esm2022/menu/index.mjs +45 -0
- package/esm2022/menu/radix-ng-primitives-menu.mjs +5 -0
- package/esm2022/menu/src/menu-content.directive.mjs +17 -0
- package/esm2022/menu/src/menu-directive.mjs +18 -0
- package/esm2022/menu/src/menu-group.directive.mjs +20 -0
- package/esm2022/menu/src/menu-item.directive.mjs +46 -0
- package/esm2022/menu/src/menu-label.directive.mjs +14 -0
- package/esm2022/menu/src/menu-separator.directive.mjs +21 -0
- package/esm2022/menubar/index.mjs +60 -0
- package/esm2022/menubar/radix-ng-primitives-menubar.mjs +5 -0
- package/esm2022/menubar/src/menubar-content.directive.mjs +17 -0
- package/esm2022/menubar/src/menubar-item-checkbox.directive.mjs +34 -0
- package/esm2022/menubar/src/menubar-item-indicator.directive.mjs +17 -0
- package/esm2022/menubar/src/menubar-item-radio.directive.mjs +35 -0
- package/esm2022/menubar/src/menubar-item.directive.mjs +20 -0
- package/esm2022/menubar/src/menubar-radio-group.directive.mjs +17 -0
- package/esm2022/menubar/src/menubar-root.directive.mjs +24 -0
- package/esm2022/menubar/src/menubar-separator.directive.mjs +17 -0
- package/esm2022/menubar/src/menubar-trigger.directive.mjs +45 -0
- package/esm2022/progress/index.mjs +25 -0
- package/esm2022/progress/radix-ng-primitives-progress.mjs +5 -0
- package/esm2022/progress/src/progress-indicator.directive.mjs +34 -0
- package/esm2022/progress/src/progress-root.directive.mjs +127 -0
- package/esm2022/radio/index.mjs +4 -0
- package/esm2022/radio/radix-ng-primitives-radio.mjs +5 -0
- package/esm2022/radio/src/radio-indicator.directive.mjs +25 -0
- package/esm2022/radio/src/radio-item.directive.mjs +70 -0
- package/esm2022/radio/src/radio-root.directive.mjs +194 -0
- package/esm2022/radio/src/radio-tokens.mjs +3 -0
- package/esm2022/radix-ng-primitives.mjs +5 -0
- package/esm2022/separator/index.mjs +2 -0
- package/esm2022/separator/radix-ng-primitives-separator.mjs +5 -0
- package/esm2022/separator/src/separator.directive.mjs +32 -0
- package/esm2022/switch/index.mjs +30 -0
- package/esm2022/switch/radix-ng-primitives-switch.mjs +5 -0
- package/esm2022/switch/src/switch-input.directive.mjs +32 -0
- package/esm2022/switch/src/switch-root.directive.mjs +95 -0
- package/esm2022/switch/src/switch-thumb.directive.mjs +23 -0
- package/esm2022/tabs/index.mjs +38 -0
- package/esm2022/tabs/radix-ng-primitives-tabs.mjs +5 -0
- package/esm2022/tabs/src/tabs-content.directive.mjs +29 -0
- package/esm2022/tabs/src/tabs-context.service.mjs +43 -0
- package/esm2022/tabs/src/tabs-list.directive.mjs +23 -0
- package/esm2022/tabs/src/tabs-root.directive.mjs +54 -0
- package/esm2022/tabs/src/tabs-trigger.directive.mjs +52 -0
- package/esm2022/toggle/index.mjs +2 -0
- package/esm2022/toggle/radix-ng-primitives-toggle.mjs +5 -0
- package/esm2022/toggle/src/toggle.directive.mjs +39 -0
- package/esm2022/toggle-group/index.mjs +6 -0
- package/esm2022/toggle-group/radix-ng-primitives-toggle-group.mjs +5 -0
- package/esm2022/toggle-group/src/toggle-group-button.directive.mjs +75 -0
- package/esm2022/toggle-group/src/toggle-group-button.token.mjs +6 -0
- package/esm2022/toggle-group/src/toggle-group-multi.directive.mjs +143 -0
- package/esm2022/toggle-group/src/toggle-group.directive.mjs +134 -0
- package/esm2022/toggle-group/src/toggle-group.token.mjs +6 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs +483 -0
- package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs +159 -0
- package/fesm2022/radix-ng-primitives-alert-dialog.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-avatar.mjs +166 -0
- package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-checkbox.mjs +241 -0
- package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-collapsible.mjs +213 -0
- package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-context-menu.mjs +463 -0
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-dialog.mjs +373 -0
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +555 -0
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-label.mjs +66 -0
- package/fesm2022/radix-ng-primitives-label.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-menu.mjs +158 -0
- package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-menubar.mjs +245 -0
- package/fesm2022/radix-ng-primitives-menubar.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-progress.mjs +184 -0
- package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-radio.mjs +289 -0
- package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-separator.mjs +39 -0
- package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-switch.mjs +173 -0
- package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-tabs.mjs +222 -0
- package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-toggle-group.mjs +358 -0
- package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-toggle.mjs +46 -0
- package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives.mjs +4 -0
- package/fesm2022/radix-ng-primitives.mjs.map +1 -0
- package/label/src/label.directive.d.ts +29 -0
- package/menu/index.d.ts +18 -0
- package/menu/src/menu-content.directive.d.ts +6 -0
- package/menu/src/menu-directive.d.ts +6 -0
- package/menu/src/menu-group.directive.d.ts +6 -0
- package/menu/src/menu-item.directive.d.ts +12 -0
- package/menu/src/menu-label.directive.d.ts +5 -0
- package/menu/src/menu-separator.directive.d.ts +6 -0
- package/menubar/index.d.ts +24 -0
- package/menubar/src/menubar-content.directive.d.ts +6 -0
- package/menubar/src/menubar-item-checkbox.directive.d.ts +14 -0
- package/menubar/src/menubar-item-indicator.directive.d.ts +5 -0
- package/menubar/src/menubar-item-radio.directive.d.ts +14 -0
- package/menubar/src/menubar-item.directive.d.ts +8 -0
- package/menubar/src/menubar-radio-group.directive.d.ts +6 -0
- package/menubar/src/menubar-root.directive.d.ts +7 -0
- package/menubar/src/menubar-separator.directive.d.ts +6 -0
- package/menubar/src/menubar-trigger.directive.d.ts +11 -0
- package/package.json +124 -4
- package/progress/index.d.ts +11 -0
- package/progress/src/progress-indicator.directive.d.ts +16 -0
- package/progress/src/progress-root.directive.d.ts +63 -0
- package/radio/{index.ts → index.d.ts} +0 -1
- package/radio/src/radio-indicator.directive.d.ts +9 -0
- package/radio/src/radio-item.directive.d.ts +21 -0
- package/radio/src/radio-root.directive.d.ts +72 -0
- package/radio/src/{radio-tokens.ts → radio-tokens.d.ts} +1 -5
- package/separator/src/separator.directive.d.ts +22 -0
- package/switch/index.d.ts +13 -0
- package/switch/src/switch-input.directive.d.ts +6 -0
- package/switch/src/switch-root.directive.d.ts +51 -0
- package/switch/src/switch-thumb.directive.d.ts +6 -0
- package/tabs/index.d.ts +15 -0
- package/tabs/src/tabs-content.directive.d.ts +8 -0
- package/tabs/src/tabs-context.service.d.ts +22 -0
- package/tabs/src/tabs-list.directive.d.ts +6 -0
- package/tabs/src/tabs-root.directive.d.ts +37 -0
- package/tabs/src/tabs-trigger.directive.d.ts +19 -0
- package/toggle/src/toggle.directive.d.ts +30 -0
- package/toggle-group/src/toggle-group-button.directive.d.ts +39 -0
- package/toggle-group/src/toggle-group-button.token.d.ts +4 -0
- package/toggle-group/src/toggle-group-multi.directive.d.ts +93 -0
- package/toggle-group/src/toggle-group.directive.d.ts +84 -0
- package/toggle-group/src/toggle-group.token.d.ts +5 -0
- package/.compodocrc.json +0 -12
- package/CHANGELOG.md +0 -189
- package/accordion/__tests__/accordion-content.directive.spec.ts +0 -8
- package/accordion/__tests__/accordion-header.directive.spec.ts +0 -8
- package/accordion/__tests__/accordion-item.directive.spec.ts +0 -8
- package/accordion/__tests__/accordion-root.directive.spec.ts +0 -8
- package/accordion/__tests__/accordion-trigger.directive.spec.ts +0 -8
- package/accordion/index.ts +0 -5
- package/accordion/ng-package.json +0 -5
- package/accordion/src/accordion-content.directive.ts +0 -46
- package/accordion/src/accordion-header.directive.ts +0 -15
- package/accordion/src/accordion-item.directive.ts +0 -216
- package/accordion/src/accordion-root.directive.ts +0 -205
- package/accordion/src/accordion-trigger.directive.ts +0 -37
- package/accordion/stories/accordion.docs.mdx +0 -77
- package/accordion/stories/accordion.stories.ts +0 -340
- package/alert-dialog/ng-package.json +0 -5
- package/alert-dialog/src/alert-dialog-cancel.directive.ts +0 -17
- package/alert-dialog/src/alert-dialog-content.directive.ts +0 -24
- package/alert-dialog/src/alert-dialog-root.directive.ts +0 -15
- package/alert-dialog/src/alert-dialog-title.directive.ts +0 -7
- package/alert-dialog/src/alert-dialog-trigger.directive.ts +0 -17
- package/alert-dialog/src/alert-dialog.service.ts +0 -51
- package/alert-dialog/stories/alert-dialog.stories.ts +0 -139
- package/avatar/__tests__/avatar-fallback.directive.spec.ts +0 -31
- package/avatar/__tests__/avatar-image.directive.spec.ts +0 -36
- package/avatar/ng-package.json +0 -5
- package/avatar/src/avatar-fallback.directive.ts +0 -62
- package/avatar/src/avatar-image.directive.ts +0 -55
- package/avatar/src/avatar-root.directive.ts +0 -35
- package/avatar/src/avatar.config.ts +0 -29
- package/avatar/stories/avatar.docs.mdx +0 -37
- package/avatar/stories/avatar.stories.ts +0 -87
- package/button/__tests__/.gitkeep +0 -0
- package/button/src/button-abstract.directive.ts +0 -46
- package/checkbox/ng-package.json +0 -5
- package/checkbox/src/checkbox-button.directive.ts +0 -26
- package/checkbox/src/checkbox-indicator.directive.ts +0 -16
- package/checkbox/src/checkbox-input.directive.ts +0 -36
- package/checkbox/src/checkbox.directive.ts +0 -146
- package/checkbox/src/checkbox.token.ts +0 -8
- package/checkbox/stories/checkbox-group.component.ts +0 -87
- package/checkbox/stories/checkbox-group.styles.scss +0 -49
- package/checkbox/stories/checkbox-indeterminate.component.ts +0 -52
- package/checkbox/stories/checkbox.docs.mdx +0 -58
- package/checkbox/stories/checkbox.stories.ts +0 -105
- package/collapsible/__tests__/collapsible-content.directive.spec.ts +0 -30
- package/collapsible/__tests__/collapsible-root.directive.spec.ts +0 -27
- package/collapsible/__tests__/collapsible-trigger.directive.spec.ts +0 -30
- package/collapsible/ng-package.json +0 -5
- package/collapsible/src/collapsible-content.directive.ts +0 -34
- package/collapsible/src/collapsible-content.token.ts +0 -6
- package/collapsible/src/collapsible-root.directive.ts +0 -120
- package/collapsible/src/collapsible-trigger.directive.ts +0 -44
- package/collapsible/stories/collapsible-animation.component.ts +0 -116
- package/collapsible/stories/collapsible-external-triggering.component.ts +0 -86
- package/collapsible/stories/collapsible.docs.mdx +0 -53
- package/collapsible/stories/collapsible.stories.ts +0 -151
- package/context-menu/index.ts +0 -10
- package/context-menu/ng-package.json +0 -5
- package/context-menu/src/context-menu-content.directive.ts +0 -47
- package/context-menu/src/context-menu-item-checkbox.directive.ts +0 -30
- package/context-menu/src/context-menu-item-indicator.directive.ts +0 -14
- package/context-menu/src/context-menu-item-radio-group.directive.ts +0 -31
- package/context-menu/src/context-menu-item-radio.directive.ts +0 -69
- package/context-menu/src/context-menu-item-selectable.ts +0 -18
- package/context-menu/src/context-menu-item.directive.ts +0 -65
- package/context-menu/src/context-menu-label.directive.ts +0 -7
- package/context-menu/src/context-menu-separator.directive.ts +0 -13
- package/context-menu/src/context-menu-trigger.directive.ts +0 -82
- package/context-menu/stories/context-menu.docs.mdx +0 -23
- package/context-menu/stories/context-menu.stories.ts +0 -253
- package/core/index.ts +0 -3
- package/core/src/accessor/provide-value-accessor.ts +0 -20
- package/core/src/auto-focus.directive.ts +0 -81
- package/core/src/inject-ng-control.ts +0 -28
- package/core/src/mount.ts +0 -27
- package/dialog/__tests__/dialog-content.directive.spec.ts +0 -77
- package/dialog/__tests__/dialog-trigger.directive.spec.ts +0 -85
- package/dialog/index.ts +0 -31
- package/dialog/ng-package.json +0 -5
- package/dialog/src/dialog-close.directive.ts +0 -18
- package/dialog/src/dialog-content.directive.ts +0 -45
- package/dialog/src/dialog-description.directive.ts +0 -7
- package/dialog/src/dialog-dismiss.directive.ts +0 -18
- package/dialog/src/dialog-ref.ts +0 -70
- package/dialog/src/dialog-title.directive.ts +0 -7
- package/dialog/src/dialog-trigger.directive.ts +0 -52
- package/dialog/src/dialog.config.ts +0 -55
- package/dialog/src/dialog.injectors.ts +0 -12
- package/dialog/src/dialog.service.ts +0 -94
- package/dialog/stories/dialog.docs.mdx +0 -32
- package/dialog/stories/dialog.stories.ts +0 -233
- package/dropdown-menu/index.ts +0 -10
- package/dropdown-menu/ng-package.json +0 -5
- package/dropdown-menu/src/dropdown-menu-content.directive.ts +0 -47
- package/dropdown-menu/src/dropdown-menu-item-checkbox.directive.ts +0 -30
- package/dropdown-menu/src/dropdown-menu-item-indicator.directive.ts +0 -14
- package/dropdown-menu/src/dropdown-menu-item-radio-group.directive.ts +0 -31
- package/dropdown-menu/src/dropdown-menu-item-radio.directive.ts +0 -72
- package/dropdown-menu/src/dropdown-menu-item-selectable.ts +0 -18
- package/dropdown-menu/src/dropdown-menu-item.directive.ts +0 -66
- package/dropdown-menu/src/dropdown-menu-label.directive.ts +0 -7
- package/dropdown-menu/src/dropdown-menu-separator.directive.ts +0 -13
- package/dropdown-menu/src/dropdown-menu-trigger.directive.ts +0 -185
- package/dropdown-menu/stories/dropdown-menu-item-checkbox.component.ts +0 -104
- package/dropdown-menu/stories/dropdown-menu-item-checkbox.styles.scss +0 -106
- package/dropdown-menu/stories/dropdown-menu-item-radio.component.ts +0 -95
- package/dropdown-menu/stories/dropdown-menu-item-radio.styles.scss +0 -106
- package/dropdown-menu/stories/dropdown.docs.mdx +0 -27
- package/dropdown-menu/stories/dropdown.stories.ts +0 -212
- package/form-field/index.ts +0 -1
- package/form-field/src/.gitkeep +0 -0
- package/jest.config.ts +0 -21
- package/label/__tests__/label-root.directive.spec.ts +0 -99
- package/label/ng-package.json +0 -5
- package/label/src/label.directive.ts +0 -58
- package/label/stories/label.docs.mdx +0 -40
- package/label/stories/label.stories.ts +0 -76
- package/menu/index.ts +0 -29
- package/menu/ng-package.json +0 -5
- package/menu/src/menu-content.directive.ts +0 -9
- package/menu/src/menu-directive.ts +0 -10
- package/menu/src/menu-group.directive.ts +0 -12
- package/menu/src/menu-item.directive.ts +0 -44
- package/menu/src/menu-label.directive.ts +0 -7
- package/menu/src/menu-separator.directive.ts +0 -13
- package/menubar/index.ts +0 -38
- package/menubar/ng-package.json +0 -5
- package/menubar/src/menubar-content.directive.ts +0 -9
- package/menubar/src/menubar-item-checkbox.directive.ts +0 -32
- package/menubar/src/menubar-item-indicator.directive.ts +0 -10
- package/menubar/src/menubar-item-radio.directive.ts +0 -33
- package/menubar/src/menubar-item.directive.ts +0 -12
- package/menubar/src/menubar-radio-group.directive.ts +0 -9
- package/menubar/src/menubar-root.directive.ts +0 -15
- package/menubar/src/menubar-separator.directive.ts +0 -9
- package/menubar/src/menubar-trigger.directive.ts +0 -40
- package/menubar/stories/menubar.stories.ts +0 -229
- package/ng-package.json +0 -8
- package/portal/stories/portal.docs.mdx +0 -85
- package/presence/__test__/presence-test.component.ts +0 -51
- package/presence/__test__/presence.spec.ts +0 -50
- package/presence/index.ts +0 -4
- package/presence/src/presence.ts +0 -119
- package/presence/src/transitions/transition.collapse.ts +0 -99
- package/presence/src/transitions/transition.toast.ts +0 -27
- package/presence/src/types.ts +0 -20
- package/presence/src/utils.ts +0 -63
- package/presence/stories/presence-story.componen.ts +0 -69
- package/presence/stories/presence.docs.mdx +0 -40
- package/presence/stories/presence.stories.ts +0 -29
- package/progress/__test__/progress.spec.ts +0 -55
- package/progress/index.ts +0 -4
- package/progress/ng-package.json +0 -5
- package/progress/src/progress-indicator.directive.ts +0 -26
- package/progress/src/progress-root.directive.ts +0 -134
- package/progress/stories/progress.docs.mdx +0 -65
- package/progress/stories/progress.stories.ts +0 -66
- package/project.json +0 -39
- package/radio/ng-package.json +0 -5
- package/radio/src/radio-indicator.directive.ts +0 -17
- package/radio/src/radio-item.directive.ts +0 -68
- package/radio/src/radio-root.directive.ts +0 -207
- package/radio/stories/radio-group.component.ts +0 -39
- package/radio/stories/radio-group.styles.scss +0 -70
- package/radio/stories/radio.docs.mdx +0 -68
- package/radio/stories/radio.stories.ts +0 -155
- package/separator/__tests__/separator.directive.spec.ts +0 -58
- package/separator/ng-package.json +0 -5
- package/separator/src/separator.directive.ts +0 -35
- package/separator/stories/separator.docs.mdx +0 -37
- package/separator/stories/separator.stories.ts +0 -82
- package/slider/src/slider-input.directive.ts +0 -0
- package/slider/src/slider-thumb.directives.ts +0 -60
- package/slider/src/slider-track.directive.ts +0 -11
- package/slider/src/slider.directive.ts +0 -59
- package/slider/src/slider.types.ts +0 -4
- package/switch/index.ts +0 -22
- package/switch/ng-package.json +0 -5
- package/switch/src/switch-input.directive.ts +0 -24
- package/switch/src/switch-root.directive.ts +0 -127
- package/switch/src/switch-thumb.directive.ts +0 -15
- package/switch/stories/switch.docs.mdx +0 -83
- package/switch/stories/switch.stories.ts +0 -149
- package/tabs/__tests__/tabs-context.service.spec.ts +0 -35
- package/tabs/index.ts +0 -26
- package/tabs/ng-package.json +0 -5
- package/tabs/src/tabs-content.directive.ts +0 -23
- package/tabs/src/tabs-context.service.ts +0 -43
- package/tabs/src/tabs-list.directive.ts +0 -21
- package/tabs/src/tabs-root.directive.ts +0 -70
- package/tabs/src/tabs-trigger.directive.ts +0 -55
- package/tabs/stories/tabs.stories.ts +0 -213
- package/test-setup.ts +0 -1
- package/toggle/__tests__/toggle.directive.spec.ts +0 -87
- package/toggle/ng-package.json +0 -5
- package/toggle/src/toggle.directive.ts +0 -49
- package/toggle/stories/toggle.docs.mdx +0 -60
- package/toggle/stories/toggle.stories.ts +0 -84
- package/toggle-group/ng-package.json +0 -5
- package/toggle-group/src/toggle-group-button.directive.ts +0 -73
- package/toggle-group/src/toggle-group-button.token.ts +0 -8
- package/toggle-group/src/toggle-group-multi.directive.ts +0 -158
- package/toggle-group/src/toggle-group.directive.ts +0 -148
- package/toggle-group/src/toggle-group.token.ts +0 -11
- package/toggle-group/stories/toggle-group.docs.mdx +0 -87
- package/toggle-group/stories/toggle-group.stories.ts +0 -95
- package/tsconfig.doc.json +0 -11
- package/tsconfig.json +0 -29
- package/tsconfig.lib.json +0 -19
- package/tsconfig.lib.prod.json +0 -12
- package/tsconfig.spec.json +0 -11
- package/visually-hidden/README.md +0 -3
- package/visually-hidden/stories/visually-hidden.docs.mdx +0 -36
- /package/avatar/{index.ts → index.d.ts} +0 -0
- /package/checkbox/{index.ts → index.d.ts} +0 -0
- /package/collapsible/{index.ts → index.d.ts} +0 -0
- /package/{index.ts → index.d.ts} +0 -0
- /package/label/{index.ts → index.d.ts} +0 -0
- /package/separator/{index.ts → index.d.ts} +0 -0
- /package/toggle/{index.ts → index.d.ts} +0 -0
- /package/toggle-group/{index.ts → index.d.ts} +0 -0
@@ -1,216 +0,0 @@
|
|
1
|
-
import { FocusableOption } from '@angular/cdk/a11y';
|
2
|
-
import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
|
3
|
-
import {
|
4
|
-
booleanAttribute,
|
5
|
-
ChangeDetectorRef,
|
6
|
-
ContentChild,
|
7
|
-
Directive,
|
8
|
-
EventEmitter,
|
9
|
-
forwardRef,
|
10
|
-
inject,
|
11
|
-
Input,
|
12
|
-
OnDestroy,
|
13
|
-
Output
|
14
|
-
} from '@angular/core';
|
15
|
-
import { Subscription } from 'rxjs';
|
16
|
-
import { RdxAccordionContentDirective } from './accordion-content.directive';
|
17
|
-
import { RdxAccordionOrientation, RdxAccordionRootToken } from './accordion-root.directive';
|
18
|
-
import { RdxAccordionTriggerDirective } from './accordion-trigger.directive';
|
19
|
-
|
20
|
-
export type RdxAccordionItemState = 'open' | 'closed';
|
21
|
-
|
22
|
-
let nextId = 0;
|
23
|
-
|
24
|
-
@Directive({
|
25
|
-
selector: '[rdxAccordionItem]',
|
26
|
-
standalone: true,
|
27
|
-
exportAs: 'rdxAccordionItem',
|
28
|
-
host: {
|
29
|
-
'[attr.data-state]': 'dataState',
|
30
|
-
'[attr.data-disabled]': 'disabled',
|
31
|
-
'[attr.data-orientation]': 'orientation'
|
32
|
-
},
|
33
|
-
providers: [
|
34
|
-
{ provide: RdxAccordionRootToken, useValue: undefined }]
|
35
|
-
})
|
36
|
-
export class RdxAccordionItemDirective implements FocusableOption, OnDestroy {
|
37
|
-
/**
|
38
|
-
* @ignore
|
39
|
-
*/
|
40
|
-
protected readonly accordion = inject(RdxAccordionRootToken, { skipSelf: true });
|
41
|
-
/**
|
42
|
-
* @ignore
|
43
|
-
*/
|
44
|
-
protected readonly changeDetectorRef = inject(ChangeDetectorRef);
|
45
|
-
/**
|
46
|
-
* @ignore
|
47
|
-
*/
|
48
|
-
protected readonly expansionDispatcher = inject(UniqueSelectionDispatcher);
|
49
|
-
|
50
|
-
/**
|
51
|
-
* @ignore
|
52
|
-
*/
|
53
|
-
@ContentChild(RdxAccordionTriggerDirective, { descendants: true }) trigger: RdxAccordionTriggerDirective;
|
54
|
-
|
55
|
-
/**
|
56
|
-
* @ignore
|
57
|
-
*/
|
58
|
-
@ContentChild(forwardRef(() => RdxAccordionContentDirective), { descendants: true })
|
59
|
-
content: RdxAccordionContentDirective;
|
60
|
-
|
61
|
-
get dataState(): RdxAccordionItemState {
|
62
|
-
return this.expanded ? 'open' : 'closed';
|
63
|
-
}
|
64
|
-
|
65
|
-
/**
|
66
|
-
* The unique AccordionItem id.
|
67
|
-
* @ignore
|
68
|
-
*/
|
69
|
-
readonly id: string = `rdx-accordion-item-${nextId++}`;
|
70
|
-
|
71
|
-
get orientation(): RdxAccordionOrientation {
|
72
|
-
return this.accordion.orientation;
|
73
|
-
}
|
74
|
-
|
75
|
-
/** Whether the AccordionItem is expanded. */
|
76
|
-
@Input({ transform: booleanAttribute })
|
77
|
-
set expanded(expanded: boolean) {
|
78
|
-
// Only emit events and update the internal value if the value changes.
|
79
|
-
if (this._expanded !== expanded) {
|
80
|
-
this._expanded = expanded;
|
81
|
-
this.expandedChange.emit(expanded);
|
82
|
-
|
83
|
-
if (expanded) {
|
84
|
-
this.opened.emit();
|
85
|
-
/**
|
86
|
-
* In the unique selection dispatcher, the id parameter is the id of the CdkAccordionItem,
|
87
|
-
* the name value is the id of the accordion.
|
88
|
-
*/
|
89
|
-
const accordionId = this.accordion ? this.accordion.id : this.value;
|
90
|
-
this.expansionDispatcher.notify(this.value, accordionId);
|
91
|
-
} else {
|
92
|
-
this.closed.emit();
|
93
|
-
}
|
94
|
-
|
95
|
-
// Ensures that the animation will run when the value is set outside of an `@Input`.
|
96
|
-
// This includes cases like the open, close and toggle methods.
|
97
|
-
this.changeDetectorRef.markForCheck();
|
98
|
-
}
|
99
|
-
}
|
100
|
-
|
101
|
-
get expanded(): boolean {
|
102
|
-
return this._expanded;
|
103
|
-
}
|
104
|
-
|
105
|
-
private _expanded = false;
|
106
|
-
|
107
|
-
@Input()
|
108
|
-
set value(value: string) {
|
109
|
-
this._value = value;
|
110
|
-
}
|
111
|
-
|
112
|
-
get value(): string {
|
113
|
-
return this._value || this.id;
|
114
|
-
}
|
115
|
-
|
116
|
-
private _value?: string;
|
117
|
-
|
118
|
-
/** Whether the AccordionItem is disabled. */
|
119
|
-
@Input({ transform: booleanAttribute })
|
120
|
-
set disabled(value: boolean) {
|
121
|
-
this._disabled = value;
|
122
|
-
}
|
123
|
-
|
124
|
-
get disabled(): boolean {
|
125
|
-
return this.accordion.disabled ?? this._disabled;
|
126
|
-
}
|
127
|
-
|
128
|
-
private _disabled = false;
|
129
|
-
|
130
|
-
/** Event emitted every time the AccordionItem is closed. */
|
131
|
-
@Output() readonly closed: EventEmitter<void> = new EventEmitter<void>();
|
132
|
-
/** Event emitted every time the AccordionItem is opened. */
|
133
|
-
@Output() readonly opened: EventEmitter<void> = new EventEmitter<void>();
|
134
|
-
|
135
|
-
/**
|
136
|
-
* Event emitted when the AccordionItem is destroyed.
|
137
|
-
* @ignore
|
138
|
-
*/
|
139
|
-
readonly destroyed: EventEmitter<void> = new EventEmitter<void>();
|
140
|
-
|
141
|
-
/**
|
142
|
-
* Emits whenever the expanded state of the accordion changes.
|
143
|
-
* Primarily used to facilitate two-way binding.
|
144
|
-
* @docs-private
|
145
|
-
*/
|
146
|
-
@Output() readonly expandedChange: EventEmitter<boolean> = new EventEmitter<boolean>();
|
147
|
-
|
148
|
-
/** Unregister function for expansionDispatcher. */
|
149
|
-
private removeUniqueSelectionListener: () => void;
|
150
|
-
|
151
|
-
/** Subscription to openAll/closeAll events. */
|
152
|
-
private openCloseAllSubscription = Subscription.EMPTY;
|
153
|
-
|
154
|
-
constructor() {
|
155
|
-
this.removeUniqueSelectionListener = this.expansionDispatcher.listen((id: string, accordionId: string) => {
|
156
|
-
if (this.accordion.isMultiple) {
|
157
|
-
if (this.accordion.id === accordionId && id.includes(this.value)) {
|
158
|
-
this.expanded = true;
|
159
|
-
}
|
160
|
-
} else {
|
161
|
-
this.expanded = this.accordion.id === accordionId && id.includes(this.value);
|
162
|
-
}
|
163
|
-
});
|
164
|
-
|
165
|
-
// When an accordion item is hosted in an accordion, subscribe to open/close events.
|
166
|
-
if (this.accordion) {
|
167
|
-
this.openCloseAllSubscription = this.subscribeToOpenCloseAllActions();
|
168
|
-
}
|
169
|
-
}
|
170
|
-
|
171
|
-
/** Emits an event for the accordion item being destroyed. */
|
172
|
-
ngOnDestroy() {
|
173
|
-
this.opened.complete();
|
174
|
-
this.closed.complete();
|
175
|
-
this.destroyed.emit();
|
176
|
-
this.destroyed.complete();
|
177
|
-
this.removeUniqueSelectionListener();
|
178
|
-
this.openCloseAllSubscription.unsubscribe();
|
179
|
-
}
|
180
|
-
|
181
|
-
focus(): void {
|
182
|
-
this.trigger.focus();
|
183
|
-
}
|
184
|
-
|
185
|
-
/** Toggles the expanded state of the accordion item. */
|
186
|
-
toggle(): void {
|
187
|
-
if (!this.disabled) {
|
188
|
-
this.content.onToggle();
|
189
|
-
|
190
|
-
this.expanded = !this.expanded;
|
191
|
-
}
|
192
|
-
}
|
193
|
-
|
194
|
-
/** Sets the expanded state of the accordion item to false. */
|
195
|
-
close(): void {
|
196
|
-
if (!this.disabled) {
|
197
|
-
this.expanded = false;
|
198
|
-
}
|
199
|
-
}
|
200
|
-
|
201
|
-
/** Sets the expanded state of the accordion item to true. */
|
202
|
-
open(): void {
|
203
|
-
if (!this.disabled) {
|
204
|
-
this.expanded = true;
|
205
|
-
}
|
206
|
-
}
|
207
|
-
|
208
|
-
private subscribeToOpenCloseAllActions(): Subscription {
|
209
|
-
return this.accordion.openCloseAllActions.subscribe((expanded) => {
|
210
|
-
// Only change expanded state if item is enabled
|
211
|
-
if (!this.disabled) {
|
212
|
-
this.expanded = expanded;
|
213
|
-
}
|
214
|
-
});
|
215
|
-
}
|
216
|
-
}
|
@@ -1,205 +0,0 @@
|
|
1
|
-
import { FocusKeyManager } from '@angular/cdk/a11y';
|
2
|
-
import { Directionality } from '@angular/cdk/bidi';
|
3
|
-
import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
|
4
|
-
import { ENTER, SPACE } from '@angular/cdk/keycodes';
|
5
|
-
import {
|
6
|
-
AfterContentInit,
|
7
|
-
booleanAttribute,
|
8
|
-
ContentChildren,
|
9
|
-
Directive,
|
10
|
-
EventEmitter,
|
11
|
-
forwardRef,
|
12
|
-
inject,
|
13
|
-
InjectionToken,
|
14
|
-
Input,
|
15
|
-
OnDestroy,
|
16
|
-
Output,
|
17
|
-
QueryList
|
18
|
-
} from '@angular/core';
|
19
|
-
import { merge, Subject, Subscription } from 'rxjs';
|
20
|
-
import { RdxAccordionItemDirective } from './accordion-item.directive';
|
21
|
-
|
22
|
-
export type RdxAccordionType = 'single' | 'multiple';
|
23
|
-
export type RdxAccordionOrientation = 'horizontal' | 'vertical';
|
24
|
-
|
25
|
-
export const RdxAccordionRootToken = new InjectionToken<RdxAccordionRootDirective>('RdxAccordionRootDirective');
|
26
|
-
|
27
|
-
let nextId = 0;
|
28
|
-
|
29
|
-
@Directive({
|
30
|
-
selector: '[rdxAccordionRoot]',
|
31
|
-
standalone: true,
|
32
|
-
providers: [
|
33
|
-
{ provide: RdxAccordionRootToken, useExisting: RdxAccordionRootDirective },
|
34
|
-
{ provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }
|
35
|
-
],
|
36
|
-
host: {
|
37
|
-
'[attr.data-orientation]': 'orientation',
|
38
|
-
'(keydown)': 'handleKeydown($event)'
|
39
|
-
}
|
40
|
-
})
|
41
|
-
export class RdxAccordionRootDirective implements AfterContentInit, OnDestroy {
|
42
|
-
/**
|
43
|
-
* @ignore
|
44
|
-
*/
|
45
|
-
protected readonly selectionDispatcher = inject(UniqueSelectionDispatcher);
|
46
|
-
/**
|
47
|
-
* @ignore
|
48
|
-
*/
|
49
|
-
protected readonly dir = inject(Directionality, { optional: true });
|
50
|
-
|
51
|
-
/**
|
52
|
-
* @ignore
|
53
|
-
*/
|
54
|
-
protected keyManager: FocusKeyManager<RdxAccordionItemDirective>;
|
55
|
-
|
56
|
-
/**
|
57
|
-
* @ignore
|
58
|
-
*/
|
59
|
-
readonly id: string = `rdx-accordion-${nextId++}`;
|
60
|
-
|
61
|
-
/**
|
62
|
-
* @ignore
|
63
|
-
*/
|
64
|
-
readonly openCloseAllActions = new Subject<boolean>();
|
65
|
-
|
66
|
-
get isMultiple(): boolean {
|
67
|
-
return this.type === 'multiple';
|
68
|
-
}
|
69
|
-
|
70
|
-
/** Whether the Accordion is disabled. */
|
71
|
-
@Input({ transform: booleanAttribute }) disabled: boolean;
|
72
|
-
|
73
|
-
/**
|
74
|
-
* The orientation of the accordion.
|
75
|
-
*/
|
76
|
-
@Input() orientation: RdxAccordionOrientation = 'vertical';
|
77
|
-
/**
|
78
|
-
* @private
|
79
|
-
* @ignore
|
80
|
-
*/
|
81
|
-
@ContentChildren(forwardRef(() => RdxAccordionItemDirective), { descendants: true })
|
82
|
-
items: QueryList<RdxAccordionItemDirective>;
|
83
|
-
|
84
|
-
/**
|
85
|
-
* The value of the item to expand when initially rendered and type is "single". Use when you do not need to control the state of the items.
|
86
|
-
*/
|
87
|
-
@Input()
|
88
|
-
set defaultValue(value: string[] | string) {
|
89
|
-
if (value !== this._defaultValue) {
|
90
|
-
this._defaultValue = Array.isArray(value) ? value : [value];
|
91
|
-
}
|
92
|
-
}
|
93
|
-
|
94
|
-
get defaultValue(): string[] | string {
|
95
|
-
return this.isMultiple ? this._defaultValue : this._defaultValue[0];
|
96
|
-
}
|
97
|
-
|
98
|
-
/**
|
99
|
-
* Determines whether one or multiple items can be opened at the same time.
|
100
|
-
*/
|
101
|
-
@Input() type: RdxAccordionType = 'single';
|
102
|
-
/**
|
103
|
-
* @ignore
|
104
|
-
*/
|
105
|
-
@Input() collapsible = true;
|
106
|
-
/**
|
107
|
-
* The controlled value of the item to expand
|
108
|
-
*/
|
109
|
-
@Input()
|
110
|
-
set value(value: string[] | string) {
|
111
|
-
if (value !== this._value) {
|
112
|
-
this._value = Array.isArray(value) ? value : [value];
|
113
|
-
|
114
|
-
this.selectionDispatcher.notify(this.value as unknown as string, this.id);
|
115
|
-
}
|
116
|
-
}
|
117
|
-
|
118
|
-
get value(): string[] | string {
|
119
|
-
if (this._value === undefined) {
|
120
|
-
return this.defaultValue;
|
121
|
-
}
|
122
|
-
|
123
|
-
return this.isMultiple ? this._value : this._value[0];
|
124
|
-
}
|
125
|
-
|
126
|
-
@Output() readonly onValueChange: EventEmitter<void> = new EventEmitter<void>();
|
127
|
-
|
128
|
-
private _value?: string[];
|
129
|
-
private _defaultValue: string[] | string = [];
|
130
|
-
|
131
|
-
private onValueChangeSubscription: Subscription;
|
132
|
-
|
133
|
-
/**
|
134
|
-
* @ignore
|
135
|
-
*/
|
136
|
-
ngAfterContentInit(): void {
|
137
|
-
this.selectionDispatcher.notify((this._value ?? this._defaultValue) as unknown as string, this.id);
|
138
|
-
|
139
|
-
this.keyManager = new FocusKeyManager(this.items).withHomeAndEnd();
|
140
|
-
|
141
|
-
if (this.orientation === 'horizontal') {
|
142
|
-
this.keyManager.withHorizontalOrientation(this.dir?.value || 'ltr');
|
143
|
-
} else {
|
144
|
-
this.keyManager.withVerticalOrientation();
|
145
|
-
}
|
146
|
-
|
147
|
-
this.onValueChangeSubscription = merge(...this.items.map((item) => item.expandedChange)).subscribe(() =>
|
148
|
-
this.onValueChange.emit()
|
149
|
-
);
|
150
|
-
}
|
151
|
-
|
152
|
-
/**
|
153
|
-
* @ignore
|
154
|
-
*/
|
155
|
-
ngOnDestroy() {
|
156
|
-
this.openCloseAllActions.complete();
|
157
|
-
this.onValueChangeSubscription.unsubscribe();
|
158
|
-
}
|
159
|
-
|
160
|
-
/**
|
161
|
-
* @ignore
|
162
|
-
*/
|
163
|
-
handleKeydown(event: KeyboardEvent) {
|
164
|
-
if (!this.keyManager.activeItem) {
|
165
|
-
this.keyManager.setFirstItemActive();
|
166
|
-
}
|
167
|
-
|
168
|
-
const activeItem = this.keyManager.activeItem;
|
169
|
-
|
170
|
-
if (
|
171
|
-
(event.keyCode === ENTER || event.keyCode === SPACE) &&
|
172
|
-
!this.keyManager.isTyping() &&
|
173
|
-
activeItem &&
|
174
|
-
!activeItem.disabled
|
175
|
-
) {
|
176
|
-
event.preventDefault();
|
177
|
-
activeItem.toggle();
|
178
|
-
} else {
|
179
|
-
this.keyManager.onKeydown(event);
|
180
|
-
}
|
181
|
-
}
|
182
|
-
|
183
|
-
/** Opens all enabled accordion items in an accordion where multi is enabled.
|
184
|
-
* @ignore
|
185
|
-
*/
|
186
|
-
openAll(): void {
|
187
|
-
if (this.isMultiple) {
|
188
|
-
this.openCloseAllActions.next(true);
|
189
|
-
}
|
190
|
-
}
|
191
|
-
|
192
|
-
/** Closes all enabled accordion items.
|
193
|
-
* @ignore
|
194
|
-
*/
|
195
|
-
closeAll(): void {
|
196
|
-
this.openCloseAllActions.next(false);
|
197
|
-
}
|
198
|
-
|
199
|
-
/**
|
200
|
-
* @ignore
|
201
|
-
*/
|
202
|
-
setActiveItem(item: RdxAccordionItemDirective) {
|
203
|
-
this.keyManager.setActiveItem(item);
|
204
|
-
}
|
205
|
-
}
|
@@ -1,37 +0,0 @@
|
|
1
|
-
import { Directive, ElementRef, inject } from '@angular/core';
|
2
|
-
import { RdxAccordionItemDirective } from './accordion-item.directive';
|
3
|
-
import { RdxAccordionRootDirective } from './accordion-root.directive';
|
4
|
-
|
5
|
-
@Directive({
|
6
|
-
selector: '[rdxAccordionTrigger]',
|
7
|
-
standalone: true,
|
8
|
-
host: {
|
9
|
-
'[attr.role]': '"button"',
|
10
|
-
'[attr.aria-expanded]': 'item.expanded',
|
11
|
-
'[attr.data-state]': 'item.dataState',
|
12
|
-
'[attr.data-disabled]': 'item.disabled',
|
13
|
-
'[attr.disabled]': 'item.disabled ? "" : null',
|
14
|
-
'[attr.data-orientation]': 'item.orientation',
|
15
|
-
'(click)': 'onClick()'
|
16
|
-
}
|
17
|
-
})
|
18
|
-
export class RdxAccordionTriggerDirective {
|
19
|
-
protected readonly nativeElement = inject(ElementRef).nativeElement;
|
20
|
-
protected readonly accordionRoot = inject(RdxAccordionRootDirective);
|
21
|
-
protected readonly item = inject(RdxAccordionItemDirective);
|
22
|
-
|
23
|
-
/**
|
24
|
-
* Fires when trigger clicked
|
25
|
-
*/
|
26
|
-
onClick(): void {
|
27
|
-
if (!this.accordionRoot.collapsible && this.item.expanded) return;
|
28
|
-
|
29
|
-
this.item.toggle();
|
30
|
-
|
31
|
-
this.accordionRoot.setActiveItem(this.item);
|
32
|
-
}
|
33
|
-
|
34
|
-
focus() {
|
35
|
-
this.nativeElement.focus();
|
36
|
-
}
|
37
|
-
}
|
@@ -1,77 +0,0 @@
|
|
1
|
-
import { ArgTypes, Canvas, Meta } from '@storybook/blocks';
|
2
|
-
import * as AccordionStories from './accordion.stories';
|
3
|
-
import { RdxAccordionRootDirective } from '../src/accordion-root.directive';
|
4
|
-
import { RdxAccordionItemDirective } from '../src/accordion-item.directive';
|
5
|
-
import { RdxAccordionTriggerDirective } from '../src/accordion-trigger.directive';
|
6
|
-
import { RdxAccordionContentDirective } from '../src/accordion-content.directive';
|
7
|
-
|
8
|
-
<Meta title="Primitives/Accordion" />
|
9
|
-
|
10
|
-
# Accordion
|
11
|
-
|
12
|
-
#### A vertically stacked set of interactive headings that each reveal an associated section of content.
|
13
|
-
|
14
|
-
## Single
|
15
|
-
|
16
|
-
<Canvas sourceState="hidden" of={AccordionStories.Default} />
|
17
|
-
|
18
|
-
## Multiple
|
19
|
-
|
20
|
-
<Canvas sourceState="hidden" of={AccordionStories.Multiple} />
|
21
|
-
|
22
|
-
## Horizontal
|
23
|
-
|
24
|
-
<Canvas sourceState="hidden" of={AccordionStories.Horizontal} />
|
25
|
-
|
26
|
-
## Features
|
27
|
-
|
28
|
-
- ✅ Full keyboard navigation.
|
29
|
-
- ✅ Supports horizontal/vertical orientation.
|
30
|
-
- ✅ Supports Right to Left direction.
|
31
|
-
- ✅ Can expand one or multiple items.
|
32
|
-
- ✅ Can be controlled or uncontrolled.
|
33
|
-
|
34
|
-
## Anatomy
|
35
|
-
|
36
|
-
```html
|
37
|
-
<div rdxAccordionRoot>
|
38
|
-
<div rdxAccordionItem>
|
39
|
-
<div rdxAccordionHeader>
|
40
|
-
<button rdxAccordionTrigger></button>
|
41
|
-
</div>
|
42
|
-
<div rdxAccordionContent></div>
|
43
|
-
</div>
|
44
|
-
</div>
|
45
|
-
```
|
46
|
-
|
47
|
-
## Import
|
48
|
-
|
49
|
-
Get started with importing the directives:
|
50
|
-
|
51
|
-
```typescript
|
52
|
-
import {
|
53
|
-
RdxAccordionRootDirective,
|
54
|
-
RdxAccordionItemDirective,
|
55
|
-
RdxAccordionHeaderDirective,
|
56
|
-
RdxAccordionTriggerDirective,
|
57
|
-
RdxAccordionContentDirective
|
58
|
-
} from '@radix-ng/primitives/accordion';
|
59
|
-
```
|
60
|
-
|
61
|
-
## API Reference
|
62
|
-
|
63
|
-
## RdxAccordionRootDirective
|
64
|
-
|
65
|
-
<ArgTypes of={RdxAccordionRootDirective} />
|
66
|
-
|
67
|
-
## RdxAccordionItemDirective
|
68
|
-
|
69
|
-
<ArgTypes of={RdxAccordionItemDirective} />
|
70
|
-
|
71
|
-
## RdxAccordionTriggerDirective
|
72
|
-
|
73
|
-
<ArgTypes of={RdxAccordionTriggerDirective} />
|
74
|
-
|
75
|
-
## RdxAccordionContentDirective
|
76
|
-
|
77
|
-
<ArgTypes of={RdxAccordionContentDirective} />
|