@radix-ng/primitives 0.12.0 → 0.12.2
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 +6 -2
- 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 +13895 -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.ts → dialog.config.d.ts} +17 -33
- 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/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 +6 -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 +11 -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 +47 -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 +87 -0
- package/esm2022/dropdown-menu/index.mjs +11 -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 +3 -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 +455 -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 +420 -0
- package/fesm2022/radix-ng-primitives-context-menu.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-dialog.mjs +361 -0
- package/fesm2022/radix-ng-primitives-dialog.mjs.map +1 -0
- package/fesm2022/radix-ng-primitives-dropdown-menu.mjs +509 -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 +165 -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.ts → index.d.ts} +0 -1
- 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 -182
- 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/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/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.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/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/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/accordion/{index.ts → index.d.ts} +0 -0
- /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/context-menu/{index.ts → index.d.ts} +0 -0
- /package/dropdown-menu/{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
@@ -0,0 +1,134 @@
|
|
1
|
+
import { booleanAttribute, ContentChildren, Directive, EventEmitter, Input, QueryList } from '@angular/core';
|
2
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
3
|
+
import { RdxToggleGroupButtonToken } from './toggle-group-button.token';
|
4
|
+
import { RdxToggleGroupToken } from './toggle-group.token';
|
5
|
+
import * as i0 from "@angular/core";
|
6
|
+
export class RdxToggleGroupDirective {
|
7
|
+
constructor() {
|
8
|
+
/**
|
9
|
+
* The selected toggle button.
|
10
|
+
*/
|
11
|
+
this.value = null;
|
12
|
+
/**
|
13
|
+
* The orientation of the toggle group.
|
14
|
+
* @default 'horizontal'
|
15
|
+
*/
|
16
|
+
this.orientation = 'horizontal';
|
17
|
+
/**
|
18
|
+
* Whether the toggle group is disabled.
|
19
|
+
* @default false
|
20
|
+
*/
|
21
|
+
this.disabled = false;
|
22
|
+
/**
|
23
|
+
* Whether the toggle group roving focus should wrap.
|
24
|
+
* @default true
|
25
|
+
*/
|
26
|
+
this.wrap = true;
|
27
|
+
/**
|
28
|
+
* Event emitted when the selected toggle button changes.
|
29
|
+
*/
|
30
|
+
this.valueChange = new EventEmitter();
|
31
|
+
}
|
32
|
+
ngOnChanges(changes) {
|
33
|
+
if ('disabled' in changes) {
|
34
|
+
this.buttons?.forEach((button) => button.updateDisabled());
|
35
|
+
}
|
36
|
+
}
|
37
|
+
ngAfterContentInit() {
|
38
|
+
if (this.disabled) {
|
39
|
+
this.buttons?.forEach((button) => button.updateDisabled());
|
40
|
+
}
|
41
|
+
}
|
42
|
+
/**
|
43
|
+
* Determine if a value is selected.
|
44
|
+
* @param value The value to check.
|
45
|
+
* @returns Whether the value is selected.
|
46
|
+
* @internal
|
47
|
+
*/
|
48
|
+
isSelected(value) {
|
49
|
+
return this.value === value;
|
50
|
+
}
|
51
|
+
/**
|
52
|
+
* Toggle a value.
|
53
|
+
* @param value The value to toggle.
|
54
|
+
* @internal
|
55
|
+
*/
|
56
|
+
toggle(value) {
|
57
|
+
if (this.disabled) {
|
58
|
+
return;
|
59
|
+
}
|
60
|
+
this.value = this.value === value ? null : value;
|
61
|
+
this.valueChange.emit(this.value);
|
62
|
+
this.onChange?.(this.value);
|
63
|
+
}
|
64
|
+
/**
|
65
|
+
* Select a value from Angular forms.
|
66
|
+
* @param value The value to select.
|
67
|
+
* @internal
|
68
|
+
*/
|
69
|
+
writeValue(value) {
|
70
|
+
this.value = value;
|
71
|
+
}
|
72
|
+
/**
|
73
|
+
* Register a callback to be called when the value changes.
|
74
|
+
* @param fn The callback to register.
|
75
|
+
* @internal
|
76
|
+
*/
|
77
|
+
registerOnChange(fn) {
|
78
|
+
this.onChange = fn;
|
79
|
+
}
|
80
|
+
/**
|
81
|
+
* Register a callback to be called when the toggle group is touched.
|
82
|
+
* @param fn The callback to register.
|
83
|
+
* @internal
|
84
|
+
*/
|
85
|
+
registerOnTouched(fn) {
|
86
|
+
this.onTouched = fn;
|
87
|
+
}
|
88
|
+
/**
|
89
|
+
* Set the disabled state of the toggle group.
|
90
|
+
* @param isDisabled Whether the toggle group is disabled.
|
91
|
+
* @internal
|
92
|
+
*/
|
93
|
+
setDisabledState(isDisabled) {
|
94
|
+
this.disabled = isDisabled;
|
95
|
+
this.buttons?.forEach((button) => button.updateDisabled());
|
96
|
+
}
|
97
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxToggleGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
98
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.1", type: RdxToggleGroupDirective, isStandalone: true, selector: "[rdxToggleGroup]", inputs: { value: "value", orientation: "orientation", disabled: ["disabled", "disabled", booleanAttribute], wrap: ["wrap", "wrap", booleanAttribute], valueChange: "valueChange" }, host: { attributes: { "role": "group" }, listeners: { "focusout": "onTouched?.()" }, properties: { "attr.data-orientation": "orientation" } }, providers: [
|
99
|
+
{ provide: RdxToggleGroupToken, useExisting: RdxToggleGroupDirective },
|
100
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupDirective, multi: true }
|
101
|
+
], queries: [{ propertyName: "buttons", predicate: RdxToggleGroupButtonToken }], usesOnChanges: true, ngImport: i0 }); }
|
102
|
+
}
|
103
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxToggleGroupDirective, decorators: [{
|
104
|
+
type: Directive,
|
105
|
+
args: [{
|
106
|
+
selector: '[rdxToggleGroup]',
|
107
|
+
standalone: true,
|
108
|
+
providers: [
|
109
|
+
{ provide: RdxToggleGroupToken, useExisting: RdxToggleGroupDirective },
|
110
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: RdxToggleGroupDirective, multi: true }
|
111
|
+
],
|
112
|
+
host: {
|
113
|
+
role: 'group',
|
114
|
+
'[attr.data-orientation]': 'orientation',
|
115
|
+
'(focusout)': 'onTouched?.()'
|
116
|
+
}
|
117
|
+
}]
|
118
|
+
}], propDecorators: { value: [{
|
119
|
+
type: Input
|
120
|
+
}], orientation: [{
|
121
|
+
type: Input
|
122
|
+
}], disabled: [{
|
123
|
+
type: Input,
|
124
|
+
args: [{ transform: booleanAttribute }]
|
125
|
+
}], wrap: [{
|
126
|
+
type: Input,
|
127
|
+
args: [{ transform: booleanAttribute }]
|
128
|
+
}], valueChange: [{
|
129
|
+
type: Input
|
130
|
+
}], buttons: [{
|
131
|
+
type: ContentChildren,
|
132
|
+
args: [RdxToggleGroupButtonToken]
|
133
|
+
}] } });
|
134
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9nZ2xlLWdyb3VwLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3ByaW1pdGl2ZXMvdG9nZ2xlLWdyb3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YXRlKGlzRGlzYWJsZWQ6IGJvb2xlYW4pOiB2b2lkIHtcbiAgICAgICAgdGhpcy5kaXNhYmxlZCA9IGlzRGlzYWJsZWQ7XG4gICAgICAgIHRoaXMuYnV0dG9ucz8uZm9yRWFjaCgoYnV0dG9uKSA9PiBidXR0b24udXBkYXRlRGlzYWJsZWQoKSk7XG4gICAgfVxufVxuIl19
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { inject, InjectionToken } from '@angular/core';
|
2
|
+
export const RdxToggleGroupToken = new InjectionToken('RdxToggleGroupToken');
|
3
|
+
export function injectToggleGroup() {
|
4
|
+
return inject(RdxToggleGroupToken);
|
5
|
+
}
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9nZ2xlLWdyb3VwLnRva2VuLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvcHJpbWl0aXZlcy90b2dnbGUtZ3JvdXAvc3JjL3RvZ2dsZS1ncm91cC50b2tlbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsTUFBTSxFQUFFLGNBQWMsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUl2RCxNQUFNLENBQUMsTUFBTSxtQkFBbUIsR0FBRyxJQUFJLGNBQWMsQ0FDakQscUJBQXFCLENBQ3hCLENBQUM7QUFFRixNQUFNLFVBQVUsaUJBQWlCO0lBQzdCLE9BQU8sTUFBTSxDQUFDLG1CQUFtQixDQUFDLENBQUM7QUFDdkMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGluamVjdCwgSW5qZWN0aW9uVG9rZW4gfSBmcm9tICdAYW5ndWxhci9jb3JlJztcbmltcG9ydCB0eXBlIHsgUmR4VG9nZ2xlR3JvdXBNdWx0aURpcmVjdGl2ZSB9IGZyb20gJy4vdG9nZ2xlLWdyb3VwLW11bHRpLmRpcmVjdGl2ZSc7XG5pbXBvcnQgdHlwZSB7IFJkeFRvZ2dsZUdyb3VwRGlyZWN0aXZlIH0gZnJvbSAnLi90b2dnbGUtZ3JvdXAuZGlyZWN0aXZlJztcblxuZXhwb3J0IGNvbnN0IFJkeFRvZ2dsZUdyb3VwVG9rZW4gPSBuZXcgSW5qZWN0aW9uVG9rZW48UmR4VG9nZ2xlR3JvdXBEaXJlY3RpdmUgfCBSZHhUb2dnbGVHcm91cE11bHRpRGlyZWN0aXZlPihcbiAgICAnUmR4VG9nZ2xlR3JvdXBUb2tlbidcbik7XG5cbmV4cG9ydCBmdW5jdGlvbiBpbmplY3RUb2dnbGVHcm91cCgpOiBSZHhUb2dnbGVHcm91cERpcmVjdGl2ZSB8IFJkeFRvZ2dsZUdyb3VwTXVsdGlEaXJlY3RpdmUge1xuICAgIHJldHVybiBpbmplY3QoUmR4VG9nZ2xlR3JvdXBUb2tlbik7XG59XG4iXX0=
|
@@ -0,0 +1,455 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { InjectionToken, inject, EventEmitter, booleanAttribute, Directive, Input, ContentChildren, forwardRef, Output, ElementRef, ChangeDetectorRef, ContentChild } from '@angular/core';
|
3
|
+
import { UniqueSelectionDispatcher } from '@angular/cdk/collections';
|
4
|
+
import { Subject, merge, Subscription } from 'rxjs';
|
5
|
+
import { FocusKeyManager } from '@angular/cdk/a11y';
|
6
|
+
import { Directionality } from '@angular/cdk/bidi';
|
7
|
+
import { ENTER, SPACE } from '@angular/cdk/keycodes';
|
8
|
+
|
9
|
+
const RdxAccordionRootToken = new InjectionToken('RdxAccordionRootDirective');
|
10
|
+
let nextId$1 = 0;
|
11
|
+
class RdxAccordionRootDirective {
|
12
|
+
constructor() {
|
13
|
+
/**
|
14
|
+
* @ignore
|
15
|
+
*/
|
16
|
+
this.selectionDispatcher = inject(UniqueSelectionDispatcher);
|
17
|
+
/**
|
18
|
+
* @ignore
|
19
|
+
*/
|
20
|
+
this.dir = inject(Directionality, { optional: true });
|
21
|
+
/**
|
22
|
+
* @ignore
|
23
|
+
*/
|
24
|
+
this.id = `rdx-accordion-${nextId$1++}`;
|
25
|
+
/**
|
26
|
+
* @ignore
|
27
|
+
*/
|
28
|
+
this.openCloseAllActions = new Subject();
|
29
|
+
/**
|
30
|
+
* The orientation of the accordion.
|
31
|
+
*/
|
32
|
+
this.orientation = 'vertical';
|
33
|
+
/**
|
34
|
+
* Determines whether one or multiple items can be opened at the same time.
|
35
|
+
*/
|
36
|
+
this.type = 'single';
|
37
|
+
/**
|
38
|
+
* @ignore
|
39
|
+
*/
|
40
|
+
this.collapsible = true;
|
41
|
+
this.onValueChange = new EventEmitter();
|
42
|
+
this._defaultValue = [];
|
43
|
+
}
|
44
|
+
get isMultiple() {
|
45
|
+
return this.type === 'multiple';
|
46
|
+
}
|
47
|
+
/**
|
48
|
+
* 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.
|
49
|
+
*/
|
50
|
+
set defaultValue(value) {
|
51
|
+
if (value !== this._defaultValue) {
|
52
|
+
this._defaultValue = Array.isArray(value) ? value : [value];
|
53
|
+
}
|
54
|
+
}
|
55
|
+
get defaultValue() {
|
56
|
+
return this.isMultiple ? this._defaultValue : this._defaultValue[0];
|
57
|
+
}
|
58
|
+
/**
|
59
|
+
* The controlled value of the item to expand
|
60
|
+
*/
|
61
|
+
set value(value) {
|
62
|
+
if (value !== this._value) {
|
63
|
+
this._value = Array.isArray(value) ? value : [value];
|
64
|
+
this.selectionDispatcher.notify(this.value, this.id);
|
65
|
+
}
|
66
|
+
}
|
67
|
+
get value() {
|
68
|
+
if (this._value === undefined) {
|
69
|
+
return this.defaultValue;
|
70
|
+
}
|
71
|
+
return this.isMultiple ? this._value : this._value[0];
|
72
|
+
}
|
73
|
+
/**
|
74
|
+
* @ignore
|
75
|
+
*/
|
76
|
+
ngAfterContentInit() {
|
77
|
+
this.selectionDispatcher.notify((this._value ?? this._defaultValue), this.id);
|
78
|
+
this.keyManager = new FocusKeyManager(this.items).withHomeAndEnd();
|
79
|
+
if (this.orientation === 'horizontal') {
|
80
|
+
this.keyManager.withHorizontalOrientation(this.dir?.value || 'ltr');
|
81
|
+
}
|
82
|
+
else {
|
83
|
+
this.keyManager.withVerticalOrientation();
|
84
|
+
}
|
85
|
+
this.onValueChangeSubscription = merge(...this.items.map((item) => item.expandedChange)).subscribe(() => this.onValueChange.emit());
|
86
|
+
}
|
87
|
+
/**
|
88
|
+
* @ignore
|
89
|
+
*/
|
90
|
+
ngOnDestroy() {
|
91
|
+
this.openCloseAllActions.complete();
|
92
|
+
this.onValueChangeSubscription.unsubscribe();
|
93
|
+
}
|
94
|
+
/**
|
95
|
+
* @ignore
|
96
|
+
*/
|
97
|
+
handleKeydown(event) {
|
98
|
+
if (!this.keyManager.activeItem) {
|
99
|
+
this.keyManager.setFirstItemActive();
|
100
|
+
}
|
101
|
+
const activeItem = this.keyManager.activeItem;
|
102
|
+
if ((event.keyCode === ENTER || event.keyCode === SPACE) &&
|
103
|
+
!this.keyManager.isTyping() &&
|
104
|
+
activeItem &&
|
105
|
+
!activeItem.disabled) {
|
106
|
+
event.preventDefault();
|
107
|
+
activeItem.toggle();
|
108
|
+
}
|
109
|
+
else {
|
110
|
+
this.keyManager.onKeydown(event);
|
111
|
+
}
|
112
|
+
}
|
113
|
+
/** Opens all enabled accordion items in an accordion where multi is enabled.
|
114
|
+
* @ignore
|
115
|
+
*/
|
116
|
+
openAll() {
|
117
|
+
if (this.isMultiple) {
|
118
|
+
this.openCloseAllActions.next(true);
|
119
|
+
}
|
120
|
+
}
|
121
|
+
/** Closes all enabled accordion items.
|
122
|
+
* @ignore
|
123
|
+
*/
|
124
|
+
closeAll() {
|
125
|
+
this.openCloseAllActions.next(false);
|
126
|
+
}
|
127
|
+
/**
|
128
|
+
* @ignore
|
129
|
+
*/
|
130
|
+
setActiveItem(item) {
|
131
|
+
this.keyManager.setActiveItem(item);
|
132
|
+
}
|
133
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAccordionRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
134
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.1", type: RdxAccordionRootDirective, isStandalone: true, selector: "[rdxAccordionRoot]", inputs: { disabled: ["disabled", "disabled", booleanAttribute], orientation: "orientation", defaultValue: "defaultValue", type: "type", collapsible: "collapsible", value: "value" }, outputs: { onValueChange: "onValueChange" }, host: { listeners: { "keydown": "handleKeydown($event)" }, properties: { "attr.data-orientation": "orientation" } }, providers: [
|
135
|
+
{ provide: RdxAccordionRootToken, useExisting: RdxAccordionRootDirective },
|
136
|
+
{ provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }
|
137
|
+
], queries: [{ propertyName: "items", predicate: i0.forwardRef(() => RdxAccordionItemDirective), descendants: true }], ngImport: i0 }); }
|
138
|
+
}
|
139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAccordionRootDirective, decorators: [{
|
140
|
+
type: Directive,
|
141
|
+
args: [{
|
142
|
+
selector: '[rdxAccordionRoot]',
|
143
|
+
standalone: true,
|
144
|
+
providers: [
|
145
|
+
{ provide: RdxAccordionRootToken, useExisting: RdxAccordionRootDirective },
|
146
|
+
{ provide: UniqueSelectionDispatcher, useClass: UniqueSelectionDispatcher }
|
147
|
+
],
|
148
|
+
host: {
|
149
|
+
'[attr.data-orientation]': 'orientation',
|
150
|
+
'(keydown)': 'handleKeydown($event)'
|
151
|
+
}
|
152
|
+
}]
|
153
|
+
}], propDecorators: { disabled: [{
|
154
|
+
type: Input,
|
155
|
+
args: [{ transform: booleanAttribute }]
|
156
|
+
}], orientation: [{
|
157
|
+
type: Input
|
158
|
+
}], items: [{
|
159
|
+
type: ContentChildren,
|
160
|
+
args: [forwardRef(() => RdxAccordionItemDirective), { descendants: true }]
|
161
|
+
}], defaultValue: [{
|
162
|
+
type: Input
|
163
|
+
}], type: [{
|
164
|
+
type: Input
|
165
|
+
}], collapsible: [{
|
166
|
+
type: Input
|
167
|
+
}], value: [{
|
168
|
+
type: Input
|
169
|
+
}], onValueChange: [{
|
170
|
+
type: Output
|
171
|
+
}] } });
|
172
|
+
|
173
|
+
class RdxAccordionTriggerDirective {
|
174
|
+
constructor() {
|
175
|
+
this.nativeElement = inject(ElementRef).nativeElement;
|
176
|
+
this.accordionRoot = inject(RdxAccordionRootDirective);
|
177
|
+
this.item = inject(RdxAccordionItemDirective);
|
178
|
+
}
|
179
|
+
/**
|
180
|
+
* Fires when trigger clicked
|
181
|
+
*/
|
182
|
+
onClick() {
|
183
|
+
if (!this.accordionRoot.collapsible && this.item.expanded)
|
184
|
+
return;
|
185
|
+
this.item.toggle();
|
186
|
+
this.accordionRoot.setActiveItem(this.item);
|
187
|
+
}
|
188
|
+
focus() {
|
189
|
+
this.nativeElement.focus();
|
190
|
+
}
|
191
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAccordionTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
192
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.1", type: RdxAccordionTriggerDirective, isStandalone: true, selector: "[rdxAccordionTrigger]", host: { listeners: { "click": "onClick()" }, properties: { "attr.role": "\"button\"", "attr.aria-expanded": "item.expanded", "attr.data-state": "item.dataState", "attr.data-disabled": "item.disabled", "attr.disabled": "item.disabled ? \"\" : null", "attr.data-orientation": "item.orientation" } }, ngImport: i0 }); }
|
193
|
+
}
|
194
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAccordionTriggerDirective, decorators: [{
|
195
|
+
type: Directive,
|
196
|
+
args: [{
|
197
|
+
selector: '[rdxAccordionTrigger]',
|
198
|
+
standalone: true,
|
199
|
+
host: {
|
200
|
+
'[attr.role]': '"button"',
|
201
|
+
'[attr.aria-expanded]': 'item.expanded',
|
202
|
+
'[attr.data-state]': 'item.dataState',
|
203
|
+
'[attr.data-disabled]': 'item.disabled',
|
204
|
+
'[attr.disabled]': 'item.disabled ? "" : null',
|
205
|
+
'[attr.data-orientation]': 'item.orientation',
|
206
|
+
'(click)': 'onClick()'
|
207
|
+
}
|
208
|
+
}]
|
209
|
+
}] });
|
210
|
+
|
211
|
+
let nextId = 0;
|
212
|
+
class RdxAccordionItemDirective {
|
213
|
+
get dataState() {
|
214
|
+
return this.expanded ? 'open' : 'closed';
|
215
|
+
}
|
216
|
+
get orientation() {
|
217
|
+
return this.accordion.orientation;
|
218
|
+
}
|
219
|
+
/** Whether the AccordionItem is expanded. */
|
220
|
+
set expanded(expanded) {
|
221
|
+
// Only emit events and update the internal value if the value changes.
|
222
|
+
if (this._expanded !== expanded) {
|
223
|
+
this._expanded = expanded;
|
224
|
+
this.expandedChange.emit(expanded);
|
225
|
+
if (expanded) {
|
226
|
+
this.opened.emit();
|
227
|
+
/**
|
228
|
+
* In the unique selection dispatcher, the id parameter is the id of the CdkAccordionItem,
|
229
|
+
* the name value is the id of the accordion.
|
230
|
+
*/
|
231
|
+
const accordionId = this.accordion ? this.accordion.id : this.value;
|
232
|
+
this.expansionDispatcher.notify(this.value, accordionId);
|
233
|
+
}
|
234
|
+
else {
|
235
|
+
this.closed.emit();
|
236
|
+
}
|
237
|
+
// Ensures that the animation will run when the value is set outside of an `@Input`.
|
238
|
+
// This includes cases like the open, close and toggle methods.
|
239
|
+
this.changeDetectorRef.markForCheck();
|
240
|
+
}
|
241
|
+
}
|
242
|
+
get expanded() {
|
243
|
+
return this._expanded;
|
244
|
+
}
|
245
|
+
set value(value) {
|
246
|
+
this._value = value;
|
247
|
+
}
|
248
|
+
get value() {
|
249
|
+
return this._value || this.id;
|
250
|
+
}
|
251
|
+
/** Whether the AccordionItem is disabled. */
|
252
|
+
set disabled(value) {
|
253
|
+
this._disabled = value;
|
254
|
+
}
|
255
|
+
get disabled() {
|
256
|
+
return this.accordion.disabled ?? this._disabled;
|
257
|
+
}
|
258
|
+
constructor() {
|
259
|
+
/**
|
260
|
+
* @ignore
|
261
|
+
*/
|
262
|
+
this.accordion = inject(RdxAccordionRootToken, { skipSelf: true });
|
263
|
+
/**
|
264
|
+
* @ignore
|
265
|
+
*/
|
266
|
+
this.changeDetectorRef = inject(ChangeDetectorRef);
|
267
|
+
/**
|
268
|
+
* @ignore
|
269
|
+
*/
|
270
|
+
this.expansionDispatcher = inject(UniqueSelectionDispatcher);
|
271
|
+
/**
|
272
|
+
* The unique AccordionItem id.
|
273
|
+
* @ignore
|
274
|
+
*/
|
275
|
+
this.id = `rdx-accordion-item-${nextId++}`;
|
276
|
+
this._expanded = false;
|
277
|
+
this._disabled = false;
|
278
|
+
/** Event emitted every time the AccordionItem is closed. */
|
279
|
+
this.closed = new EventEmitter();
|
280
|
+
/** Event emitted every time the AccordionItem is opened. */
|
281
|
+
this.opened = new EventEmitter();
|
282
|
+
/**
|
283
|
+
* Event emitted when the AccordionItem is destroyed.
|
284
|
+
* @ignore
|
285
|
+
*/
|
286
|
+
this.destroyed = new EventEmitter();
|
287
|
+
/**
|
288
|
+
* Emits whenever the expanded state of the accordion changes.
|
289
|
+
* Primarily used to facilitate two-way binding.
|
290
|
+
* @docs-private
|
291
|
+
*/
|
292
|
+
this.expandedChange = new EventEmitter();
|
293
|
+
/** Subscription to openAll/closeAll events. */
|
294
|
+
this.openCloseAllSubscription = Subscription.EMPTY;
|
295
|
+
this.removeUniqueSelectionListener = this.expansionDispatcher.listen((id, accordionId) => {
|
296
|
+
if (this.accordion.isMultiple) {
|
297
|
+
if (this.accordion.id === accordionId && id.includes(this.value)) {
|
298
|
+
this.expanded = true;
|
299
|
+
}
|
300
|
+
}
|
301
|
+
else {
|
302
|
+
this.expanded = this.accordion.id === accordionId && id.includes(this.value);
|
303
|
+
}
|
304
|
+
});
|
305
|
+
// When an accordion item is hosted in an accordion, subscribe to open/close events.
|
306
|
+
if (this.accordion) {
|
307
|
+
this.openCloseAllSubscription = this.subscribeToOpenCloseAllActions();
|
308
|
+
}
|
309
|
+
}
|
310
|
+
/** Emits an event for the accordion item being destroyed. */
|
311
|
+
ngOnDestroy() {
|
312
|
+
this.opened.complete();
|
313
|
+
this.closed.complete();
|
314
|
+
this.destroyed.emit();
|
315
|
+
this.destroyed.complete();
|
316
|
+
this.removeUniqueSelectionListener();
|
317
|
+
this.openCloseAllSubscription.unsubscribe();
|
318
|
+
}
|
319
|
+
focus() {
|
320
|
+
this.trigger.focus();
|
321
|
+
}
|
322
|
+
/** Toggles the expanded state of the accordion item. */
|
323
|
+
toggle() {
|
324
|
+
if (!this.disabled) {
|
325
|
+
this.content.onToggle();
|
326
|
+
this.expanded = !this.expanded;
|
327
|
+
}
|
328
|
+
}
|
329
|
+
/** Sets the expanded state of the accordion item to false. */
|
330
|
+
close() {
|
331
|
+
if (!this.disabled) {
|
332
|
+
this.expanded = false;
|
333
|
+
}
|
334
|
+
}
|
335
|
+
/** Sets the expanded state of the accordion item to true. */
|
336
|
+
open() {
|
337
|
+
if (!this.disabled) {
|
338
|
+
this.expanded = true;
|
339
|
+
}
|
340
|
+
}
|
341
|
+
subscribeToOpenCloseAllActions() {
|
342
|
+
return this.accordion.openCloseAllActions.subscribe((expanded) => {
|
343
|
+
// Only change expanded state if item is enabled
|
344
|
+
if (!this.disabled) {
|
345
|
+
this.expanded = expanded;
|
346
|
+
}
|
347
|
+
});
|
348
|
+
}
|
349
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAccordionItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
350
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.1", type: RdxAccordionItemDirective, isStandalone: true, selector: "[rdxAccordionItem]", inputs: { expanded: ["expanded", "expanded", booleanAttribute], value: "value", disabled: ["disabled", "disabled", booleanAttribute] }, outputs: { closed: "closed", opened: "opened", expandedChange: "expandedChange" }, host: { properties: { "attr.data-state": "dataState", "attr.data-disabled": "disabled", "attr.data-orientation": "orientation" } }, providers: [
|
351
|
+
{ provide: RdxAccordionRootToken, useValue: undefined }
|
352
|
+
], queries: [{ propertyName: "trigger", first: true, predicate: RdxAccordionTriggerDirective, descendants: true }, { propertyName: "content", first: true, predicate: i0.forwardRef(() => RdxAccordionContentDirective), descendants: true }], exportAs: ["rdxAccordionItem"], ngImport: i0 }); }
|
353
|
+
}
|
354
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAccordionItemDirective, decorators: [{
|
355
|
+
type: Directive,
|
356
|
+
args: [{
|
357
|
+
selector: '[rdxAccordionItem]',
|
358
|
+
standalone: true,
|
359
|
+
exportAs: 'rdxAccordionItem',
|
360
|
+
host: {
|
361
|
+
'[attr.data-state]': 'dataState',
|
362
|
+
'[attr.data-disabled]': 'disabled',
|
363
|
+
'[attr.data-orientation]': 'orientation'
|
364
|
+
},
|
365
|
+
providers: [
|
366
|
+
{ provide: RdxAccordionRootToken, useValue: undefined }
|
367
|
+
]
|
368
|
+
}]
|
369
|
+
}], ctorParameters: () => [], propDecorators: { trigger: [{
|
370
|
+
type: ContentChild,
|
371
|
+
args: [RdxAccordionTriggerDirective, { descendants: true }]
|
372
|
+
}], content: [{
|
373
|
+
type: ContentChild,
|
374
|
+
args: [forwardRef(() => RdxAccordionContentDirective), { descendants: true }]
|
375
|
+
}], expanded: [{
|
376
|
+
type: Input,
|
377
|
+
args: [{ transform: booleanAttribute }]
|
378
|
+
}], value: [{
|
379
|
+
type: Input
|
380
|
+
}], disabled: [{
|
381
|
+
type: Input,
|
382
|
+
args: [{ transform: booleanAttribute }]
|
383
|
+
}], closed: [{
|
384
|
+
type: Output
|
385
|
+
}], opened: [{
|
386
|
+
type: Output
|
387
|
+
}], expandedChange: [{
|
388
|
+
type: Output
|
389
|
+
}] } });
|
390
|
+
|
391
|
+
class RdxAccordionContentDirective {
|
392
|
+
constructor() {
|
393
|
+
this.item = inject(RdxAccordionItemDirective);
|
394
|
+
this.nativeElement = inject(ElementRef).nativeElement;
|
395
|
+
this.hidden = false;
|
396
|
+
}
|
397
|
+
onAnimationEnd() {
|
398
|
+
this.hidden = !this.item.expanded;
|
399
|
+
const { height, width } = this.nativeElement.getBoundingClientRect();
|
400
|
+
this.nativeElement.style.setProperty('--radix-collapsible-content-height', `${height}px`);
|
401
|
+
this.nativeElement.style.setProperty('--radix-collapsible-content-width', `${width}px`);
|
402
|
+
this.nativeElement.style.setProperty('--radix-accordion-content-height', 'var(--radix-collapsible-content-height)');
|
403
|
+
this.nativeElement.style.setProperty('--radix-accordion-content-width', 'var(--radix-collapsible-content-width)');
|
404
|
+
}
|
405
|
+
onToggle() {
|
406
|
+
if (!this.item.expanded) {
|
407
|
+
this.hidden = false;
|
408
|
+
}
|
409
|
+
}
|
410
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAccordionContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
411
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.1", type: RdxAccordionContentDirective, isStandalone: true, selector: "[rdxAccordionContent]", host: { listeners: { "animationend": "onAnimationEnd()" }, properties: { "attr.role": "\"region\"", "style.display": "hidden ? \"none\" : \"\"", "attr.data-state": "item.dataState", "attr.data-disabled": "item.disabled", "attr.data-orientation": "item.orientation" } }, exportAs: ["rdxAccordionContent"], ngImport: i0 }); }
|
412
|
+
}
|
413
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAccordionContentDirective, decorators: [{
|
414
|
+
type: Directive,
|
415
|
+
args: [{
|
416
|
+
selector: '[rdxAccordionContent]',
|
417
|
+
standalone: true,
|
418
|
+
exportAs: 'rdxAccordionContent',
|
419
|
+
host: {
|
420
|
+
'[attr.role]': '"region"',
|
421
|
+
'[style.display]': 'hidden ? "none" : ""',
|
422
|
+
'[attr.data-state]': 'item.dataState',
|
423
|
+
'[attr.data-disabled]': 'item.disabled',
|
424
|
+
'[attr.data-orientation]': 'item.orientation',
|
425
|
+
'(animationend)': 'onAnimationEnd()'
|
426
|
+
}
|
427
|
+
}]
|
428
|
+
}] });
|
429
|
+
|
430
|
+
class RdxAccordionHeaderDirective {
|
431
|
+
constructor() {
|
432
|
+
this.item = inject(RdxAccordionItemDirective);
|
433
|
+
}
|
434
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAccordionHeaderDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
435
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.1", type: RdxAccordionHeaderDirective, isStandalone: true, selector: "[rdxAccordionHeader]", host: { properties: { "attr.data-state": "item.dataState", "attr.data-disabled": "item.disabled", "attr.data-orientation": "item.orientation" } }, ngImport: i0 }); }
|
436
|
+
}
|
437
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxAccordionHeaderDirective, decorators: [{
|
438
|
+
type: Directive,
|
439
|
+
args: [{
|
440
|
+
selector: '[rdxAccordionHeader]',
|
441
|
+
standalone: true,
|
442
|
+
host: {
|
443
|
+
'[attr.data-state]': 'item.dataState',
|
444
|
+
'[attr.data-disabled]': 'item.disabled',
|
445
|
+
'[attr.data-orientation]': 'item.orientation'
|
446
|
+
}
|
447
|
+
}]
|
448
|
+
}] });
|
449
|
+
|
450
|
+
/**
|
451
|
+
* Generated bundle index. Do not edit.
|
452
|
+
*/
|
453
|
+
|
454
|
+
export { RdxAccordionContentDirective, RdxAccordionHeaderDirective, RdxAccordionItemDirective, RdxAccordionRootDirective, RdxAccordionRootToken, RdxAccordionTriggerDirective };
|
455
|
+
//# sourceMappingURL=radix-ng-primitives-accordion.mjs.map
|