@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
@@ -0,0 +1,184 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { InjectionToken, inject, numberAttribute, Directive, Input, NgModule } from '@angular/core';
|
3
|
+
|
4
|
+
let idIterator = 0;
|
5
|
+
const MIN_PERCENT = 0;
|
6
|
+
const DEFAULT_MAX = 100;
|
7
|
+
const PROGRESS_NAME = 'Radix Progress';
|
8
|
+
const RdxProgressToken = new InjectionToken('RdxProgressDirective');
|
9
|
+
/**
|
10
|
+
* Injects the current instance of RdxProgressRootDirective.
|
11
|
+
* @returns The instance of RdxProgressRootDirective.
|
12
|
+
*/
|
13
|
+
function injectProgress() {
|
14
|
+
return inject(RdxProgressToken);
|
15
|
+
}
|
16
|
+
/**
|
17
|
+
* Directive to manage progress bar state and attributes.
|
18
|
+
*
|
19
|
+
* This directive provides a way to create a progress bar with customizable value and max attributes.
|
20
|
+
* It handles aria attributes for accessibility and provides different states like 'indeterminate', 'complete', and 'loading'.
|
21
|
+
*/
|
22
|
+
class RdxProgressRootDirective {
|
23
|
+
constructor() {
|
24
|
+
/**
|
25
|
+
* The unique ID for the progress bar.
|
26
|
+
* @default 'rdx-progress-bar-{idIterator}'
|
27
|
+
*/
|
28
|
+
this.id = `rdx-progress-bar-${idIterator++}`;
|
29
|
+
/**
|
30
|
+
* The current value of the progress bar.
|
31
|
+
* @default 0
|
32
|
+
*/
|
33
|
+
this.value = MIN_PERCENT;
|
34
|
+
/**
|
35
|
+
* The maximum value of the progress bar.
|
36
|
+
* @default 100
|
37
|
+
*/
|
38
|
+
this.max = DEFAULT_MAX;
|
39
|
+
/**
|
40
|
+
* Function to generate the value label.
|
41
|
+
*/
|
42
|
+
this.valueLabel = (value, max) => this.defaultGetValueLabel(value, max);
|
43
|
+
}
|
44
|
+
/**
|
45
|
+
* Lifecycle hook that is called when any data-bound property of a directive changes.
|
46
|
+
* @param changes - The changed properties.
|
47
|
+
* @ignore
|
48
|
+
*/
|
49
|
+
ngOnChanges(changes) {
|
50
|
+
if (changes['max'] && !this.isValidMaxNumber(this.max)) {
|
51
|
+
console.error(this.getInvalidMaxError(`${this.max}`, PROGRESS_NAME));
|
52
|
+
}
|
53
|
+
if (changes['value'] && this.value !== null && !this.isValidValueNumber(this.value, this.max)) {
|
54
|
+
console.error(this.getInvalidValueError(`${this.value}`, PROGRESS_NAME));
|
55
|
+
}
|
56
|
+
}
|
57
|
+
/**
|
58
|
+
* Get the state of the progress bar.
|
59
|
+
* @returns 'indeterminate' | 'loading' | 'complete'
|
60
|
+
* @ignore
|
61
|
+
*/
|
62
|
+
get state() {
|
63
|
+
return this.getProgressState(this.value, this.max);
|
64
|
+
}
|
65
|
+
getProgressState(value, maxValue) {
|
66
|
+
return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading';
|
67
|
+
}
|
68
|
+
defaultGetValueLabel(value, max) {
|
69
|
+
return `${Math.round((value / max) * 100)}%`;
|
70
|
+
}
|
71
|
+
isValidMaxNumber(max) {
|
72
|
+
return this.isNumber(max) && !isNaN(max) && max > 0;
|
73
|
+
}
|
74
|
+
isNumber(value) {
|
75
|
+
return typeof value === 'number';
|
76
|
+
}
|
77
|
+
isValidValueNumber(value, max) {
|
78
|
+
return this.isNumber(value) && !isNaN(value) && value <= max && value >= 0;
|
79
|
+
}
|
80
|
+
getInvalidMaxError(propValue, componentName) {
|
81
|
+
return `Invalid prop \`max\` of value \`${propValue}\` supplied to \`${componentName}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${DEFAULT_MAX}\`.`;
|
82
|
+
}
|
83
|
+
getInvalidValueError(propValue, componentName) {
|
84
|
+
return `Invalid prop \`value\` of value \`${propValue}\` supplied to \`${componentName}\`. The \`value\` prop must be:
|
85
|
+
- a positive number
|
86
|
+
- less than the value passed to \`max\` (or ${DEFAULT_MAX} if no \`max\` prop is set)
|
87
|
+
- \`null\` or \`undefined\` if the progress is indeterminate.
|
88
|
+
|
89
|
+
Defaulting to \`null\`.`;
|
90
|
+
}
|
91
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxProgressRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
92
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.1", type: RdxProgressRootDirective, isStandalone: true, selector: "[rdxProgressRoot]", inputs: { id: "id", value: ["rdxValue", "value", numberAttribute], max: ["rdxMax", "max", numberAttribute], valueLabel: ["rdxValueLabel", "valueLabel"] }, host: { attributes: { "role": "progressbar", "tabindex": "-1" }, properties: { "id": "id", "attr.aria-valuemax": "max", "attr.aria-valuemin": "0", "attr.aria-valuenow": "value", "attr.aria-valuetext": "valueLabel(value, max)", "attr.data-state": "state", "attr.data-value": "value", "attr.data-max": "max" } }, providers: [{ provide: RdxProgressToken, useExisting: RdxProgressRootDirective }], exportAs: ["rdxProgressRoot"], usesOnChanges: true, ngImport: i0 }); }
|
93
|
+
}
|
94
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxProgressRootDirective, decorators: [{
|
95
|
+
type: Directive,
|
96
|
+
args: [{
|
97
|
+
selector: '[rdxProgressRoot]',
|
98
|
+
exportAs: 'rdxProgressRoot',
|
99
|
+
standalone: true,
|
100
|
+
providers: [{ provide: RdxProgressToken, useExisting: RdxProgressRootDirective }],
|
101
|
+
host: {
|
102
|
+
role: 'progressbar',
|
103
|
+
'[id]': 'id',
|
104
|
+
'[attr.aria-valuemax]': 'max',
|
105
|
+
'[attr.aria-valuemin]': '0',
|
106
|
+
'[attr.aria-valuenow]': 'value',
|
107
|
+
'[attr.aria-valuetext]': 'valueLabel(value, max)',
|
108
|
+
'[attr.data-state]': 'state',
|
109
|
+
'[attr.data-value]': 'value',
|
110
|
+
'[attr.data-max]': 'max',
|
111
|
+
// set tab index to -1 so screen readers will read the aria-label
|
112
|
+
// Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox
|
113
|
+
tabindex: '-1'
|
114
|
+
}
|
115
|
+
}]
|
116
|
+
}], propDecorators: { id: [{
|
117
|
+
type: Input
|
118
|
+
}], value: [{
|
119
|
+
type: Input,
|
120
|
+
args: [{ alias: 'rdxValue', transform: numberAttribute }]
|
121
|
+
}], max: [{
|
122
|
+
type: Input,
|
123
|
+
args: [{ alias: 'rdxMax', transform: numberAttribute }]
|
124
|
+
}], valueLabel: [{
|
125
|
+
type: Input,
|
126
|
+
args: ['rdxValueLabel']
|
127
|
+
}] } });
|
128
|
+
|
129
|
+
/**
|
130
|
+
* Directive to manage progress indicator state and attributes.
|
131
|
+
*
|
132
|
+
* This directive is used to display the progress indicator inside the progress bar.
|
133
|
+
* It inherits the state and value from the `RdxProgressRootDirective`.
|
134
|
+
*/
|
135
|
+
class RdxProgressIndicatorDirective {
|
136
|
+
constructor() {
|
137
|
+
/**
|
138
|
+
*
|
139
|
+
* This allows the directive to access the progress bar state and values.
|
140
|
+
*/
|
141
|
+
this.progress = injectProgress();
|
142
|
+
}
|
143
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxProgressIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
144
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.1", type: RdxProgressIndicatorDirective, isStandalone: true, selector: "[rdxProgressIndicator]", host: { properties: { "attr.data-state": "progress.state", "attr.data-value": "progress.value", "attr.data-max": "progress.max" } }, exportAs: ["rdxProgressIndicator"], ngImport: i0 }); }
|
145
|
+
}
|
146
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxProgressIndicatorDirective, decorators: [{
|
147
|
+
type: Directive,
|
148
|
+
args: [{
|
149
|
+
selector: '[rdxProgressIndicator]',
|
150
|
+
exportAs: 'rdxProgressIndicator',
|
151
|
+
standalone: true,
|
152
|
+
host: {
|
153
|
+
'[attr.data-state]': 'progress.state',
|
154
|
+
'[attr.data-value]': 'progress.value',
|
155
|
+
'[attr.data-max]': 'progress.max'
|
156
|
+
}
|
157
|
+
}]
|
158
|
+
}] });
|
159
|
+
|
160
|
+
const _imports = [
|
161
|
+
RdxProgressRootDirective,
|
162
|
+
RdxProgressIndicatorDirective
|
163
|
+
];
|
164
|
+
class RdxProgressModule {
|
165
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxProgressModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
166
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.1", ngImport: i0, type: RdxProgressModule, imports: [RdxProgressRootDirective,
|
167
|
+
RdxProgressIndicatorDirective], exports: [RdxProgressRootDirective,
|
168
|
+
RdxProgressIndicatorDirective] }); }
|
169
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxProgressModule }); }
|
170
|
+
}
|
171
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxProgressModule, decorators: [{
|
172
|
+
type: NgModule,
|
173
|
+
args: [{
|
174
|
+
imports: [..._imports],
|
175
|
+
exports: [..._imports]
|
176
|
+
}]
|
177
|
+
}] });
|
178
|
+
|
179
|
+
/**
|
180
|
+
* Generated bundle index. Do not edit.
|
181
|
+
*/
|
182
|
+
|
183
|
+
export { RdxProgressIndicatorDirective, RdxProgressModule, RdxProgressRootDirective, injectProgress };
|
184
|
+
//# sourceMappingURL=radix-ng-primitives-progress.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-progress.mjs","sources":["../../../packages/primitives/progress/src/progress-root.directive.ts","../../../packages/primitives/progress/src/progress-indicator.directive.ts","../../../packages/primitives/progress/index.ts","../../../packages/primitives/progress/radix-ng-primitives-progress.ts"],"sourcesContent":["import { Directive, inject, InjectionToken, Input, numberAttribute, OnChanges, SimpleChanges } from '@angular/core';\n\nlet idIterator = 0;\n\nconst MIN_PERCENT = 0;\nconst DEFAULT_MAX = 100;\nconst PROGRESS_NAME = 'Radix Progress';\n\nconst RdxProgressToken = new InjectionToken<RdxProgressRootDirective>('RdxProgressDirective');\n\n/**\n * Injects the current instance of RdxProgressRootDirective.\n * @returns The instance of RdxProgressRootDirective.\n */\nexport function injectProgress(): RdxProgressRootDirective {\n return inject(RdxProgressToken);\n}\n\nexport type ProgressState = 'indeterminate' | 'complete' | 'loading';\n\nexport interface ProgressProps {\n value?: number | null | undefined;\n max?: number;\n getValueLabel?: string;\n}\n\n/**\n * Directive to manage progress bar state and attributes.\n *\n * This directive provides a way to create a progress bar with customizable value and max attributes.\n * It handles aria attributes for accessibility and provides different states like 'indeterminate', 'complete', and 'loading'.\n */\n@Directive({\n selector: '[rdxProgressRoot]',\n exportAs: 'rdxProgressRoot',\n standalone: true,\n providers: [{ provide: RdxProgressToken, useExisting: RdxProgressRootDirective }],\n host: {\n role: 'progressbar',\n '[id]': 'id',\n '[attr.aria-valuemax]': 'max',\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuenow]': 'value',\n '[attr.aria-valuetext]': 'valueLabel(value, max)',\n '[attr.data-state]': 'state',\n '[attr.data-value]': 'value',\n '[attr.data-max]': 'max',\n // set tab index to -1 so screen readers will read the aria-label\n // Note: there is a known issue with JAWS that does not read progressbar aria labels on FireFox\n tabindex: '-1'\n }\n})\nexport class RdxProgressRootDirective implements ProgressProps, OnChanges {\n /**\n * The unique ID for the progress bar.\n * @default 'rdx-progress-bar-{idIterator}'\n */\n @Input() id = `rdx-progress-bar-${idIterator++}`;\n\n /**\n * The current value of the progress bar.\n * @default 0\n */\n @Input({ alias: 'rdxValue', transform: numberAttribute }) value = MIN_PERCENT;\n\n /**\n * The maximum value of the progress bar.\n * @default 100\n */\n @Input({ alias: 'rdxMax', transform: numberAttribute }) max = DEFAULT_MAX;\n\n /**\n * Function to generate the value label.\n */\n @Input('rdxValueLabel') valueLabel: (value: number, max: number) => string = (value, max) =>\n this.defaultGetValueLabel(value, max);\n\n /**\n * Lifecycle hook that is called when any data-bound property of a directive changes.\n * @param changes - The changed properties.\n * @ignore\n */\n ngOnChanges(changes: SimpleChanges) {\n if (changes['max'] && !this.isValidMaxNumber(this.max)) {\n console.error(this.getInvalidMaxError(`${this.max}`, PROGRESS_NAME));\n }\n\n if (changes['value'] && this.value !== null && !this.isValidValueNumber(this.value, this.max)) {\n console.error(this.getInvalidValueError(`${this.value}`, PROGRESS_NAME));\n }\n }\n\n /**\n * Get the state of the progress bar.\n * @returns 'indeterminate' | 'loading' | 'complete'\n * @ignore\n */\n get state(): ProgressState {\n return this.getProgressState(this.value, this.max);\n }\n\n private getProgressState(value: number | undefined | null, maxValue: number): ProgressState {\n return value == null ? 'indeterminate' : value === maxValue ? 'complete' : 'loading';\n }\n\n private defaultGetValueLabel(value: number, max: number) {\n return `${Math.round((value / max) * 100)}%`;\n }\n\n private isValidMaxNumber(max: unknown): max is number {\n return this.isNumber(max) && !isNaN(max) && max > 0;\n }\n\n private isNumber(value: unknown): value is number {\n return typeof value === 'number';\n }\n\n private isValidValueNumber(value: unknown, max: number): value is number {\n return this.isNumber(value) && !isNaN(value) && value <= max && value >= 0;\n }\n\n private getInvalidMaxError(propValue: string, componentName: string): string {\n return `Invalid prop \\`max\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. Only numbers greater than 0 are valid max values. Defaulting to \\`${DEFAULT_MAX}\\`.`;\n }\n\n private getInvalidValueError(propValue: string, componentName: string): string {\n return `Invalid prop \\`value\\` of value \\`${propValue}\\` supplied to \\`${componentName}\\`. The \\`value\\` prop must be:\n - a positive number\n - less than the value passed to \\`max\\` (or ${DEFAULT_MAX} if no \\`max\\` prop is set)\n - \\`null\\` or \\`undefined\\` if the progress is indeterminate.\n\n Defaulting to \\`null\\`.`;\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectProgress } from './progress-root.directive';\n\n/**\n * Directive to manage progress indicator state and attributes.\n *\n * This directive is used to display the progress indicator inside the progress bar.\n * It inherits the state and value from the `RdxProgressRootDirective`.\n */\n@Directive({\n selector: '[rdxProgressIndicator]',\n exportAs: 'rdxProgressIndicator',\n standalone: true,\n host: {\n '[attr.data-state]': 'progress.state',\n '[attr.data-value]': 'progress.value',\n '[attr.data-max]': 'progress.max'\n }\n})\nexport class RdxProgressIndicatorDirective {\n /**\n *\n * This allows the directive to access the progress bar state and values.\n */\n protected readonly progress = injectProgress();\n}\n","import { NgModule } from '@angular/core';\nimport { RdxProgressIndicatorDirective } from './src/progress-indicator.directive';\nimport { RdxProgressRootDirective } from './src/progress-root.directive';\n\nexport * from './src/progress-indicator.directive';\nexport * from './src/progress-root.directive';\n\nexport type { ProgressProps } from './src/progress-root.directive';\n\nconst _imports = [\n RdxProgressRootDirective,\n RdxProgressIndicatorDirective\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxProgressModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,IAAI,UAAU,GAAG,CAAC,CAAC;AAEnB,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,WAAW,GAAG,GAAG,CAAC;AACxB,MAAM,aAAa,GAAG,gBAAgB,CAAC;AAEvC,MAAM,gBAAgB,GAAG,IAAI,cAAc,CAA2B,sBAAsB,CAAC,CAAC;AAE9F;;;AAGG;SACa,cAAc,GAAA;AAC1B,IAAA,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACpC,CAAC;AAUD;;;;;AAKG;MAqBU,wBAAwB,CAAA;AApBrC,IAAA,WAAA,GAAA;AAqBI;;;AAGG;AACM,QAAA,IAAA,CAAA,EAAE,GAAG,CAAA,iBAAA,E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,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAR1B,wBAAwB;AACxB,YAAA,6BAA6B,aAD7B,wBAAwB;YACxB,6BAA6B,CAAA,EAAA,CAAA,CAAA,EAAA;+GAOpB,iBAAiB,EAAA,CAAA,CAAA,EAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAJ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACzB,iBAAA,CAAA;;;ACjBD;;AAEG;;;;"}
|
@@ -0,0 +1,289 @@
|
|
1
|
+
import { FocusKeyManager } from '@angular/cdk/a11y';
|
2
|
+
import { TAB, LEFT_ARROW, UP_ARROW, RIGHT_ARROW, DOWN_ARROW, SPACE, ENTER } from '@angular/cdk/keycodes';
|
3
|
+
import * as i0 from '@angular/core';
|
4
|
+
import { InjectionToken, inject, ElementRef, booleanAttribute, Directive, Input, EventEmitter, ContentChildren, Output } from '@angular/core';
|
5
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
6
|
+
import { Subject, takeUntil } from 'rxjs';
|
7
|
+
|
8
|
+
const RDX_RADIO_GROUP = new InjectionToken('RdxRadioGroup');
|
9
|
+
|
10
|
+
const RdxRadioItemToken = new InjectionToken('RadioItemToken');
|
11
|
+
function injectRadioItem() {
|
12
|
+
return inject(RdxRadioItemToken);
|
13
|
+
}
|
14
|
+
// Increasing integer for generating unique ids for radio components.
|
15
|
+
let nextUniqueId = 0;
|
16
|
+
class RdxRadioItemDirective {
|
17
|
+
constructor() {
|
18
|
+
this.radioGroup = inject(RDX_RADIO_GROUP);
|
19
|
+
this.element = inject(ElementRef);
|
20
|
+
this.id = `rdx-radio-${++nextUniqueId}`;
|
21
|
+
this.disabled = false;
|
22
|
+
}
|
23
|
+
get tabIndex() {
|
24
|
+
return this.disabled ? -1 : this.radioGroup.value === this.value ? 0 : -1;
|
25
|
+
}
|
26
|
+
get checked() {
|
27
|
+
return this.radioGroup.value === this.value;
|
28
|
+
}
|
29
|
+
ngOnInit() {
|
30
|
+
if (this.radioGroup.defaultValue === this.value) {
|
31
|
+
this.radioGroup.select(this.value);
|
32
|
+
}
|
33
|
+
}
|
34
|
+
focus() {
|
35
|
+
this.element.nativeElement.focus();
|
36
|
+
}
|
37
|
+
_onClick() {
|
38
|
+
if (!this.disabled) {
|
39
|
+
this.radioGroup.select(this.value);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
_onBlur() {
|
43
|
+
this.radioGroup.onTouched?.();
|
44
|
+
}
|
45
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxRadioItemDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
46
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.1", type: RdxRadioItemDirective, isStandalone: true, selector: "[rdxRadioItem]", inputs: { id: "id", value: "value", disabled: ["disabled", "disabled", booleanAttribute] }, host: { attributes: { "type": "button", "role": "radio" }, listeners: { "click": "_onClick()", "blur": "_onBlur()" }, properties: { "attr.id": "id", "attr.aria-checked": "checked", "attr.data-disabled": "disabled ? \"\" : null", "attr.data-state": "checked ? \"checked\" : \"unchecked\"", "attr.tabindex": "tabIndex" } }, providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }], exportAs: ["rdxRadioItem"], ngImport: i0 }); }
|
47
|
+
}
|
48
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxRadioItemDirective, decorators: [{
|
49
|
+
type: Directive,
|
50
|
+
args: [{
|
51
|
+
selector: '[rdxRadioItem]',
|
52
|
+
exportAs: 'rdxRadioItem',
|
53
|
+
standalone: true,
|
54
|
+
providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }],
|
55
|
+
host: {
|
56
|
+
type: 'button',
|
57
|
+
role: 'radio',
|
58
|
+
'[attr.id]': 'id',
|
59
|
+
'[attr.aria-checked]': 'checked',
|
60
|
+
'[attr.data-disabled]': 'disabled ? "" : null',
|
61
|
+
'[attr.data-state]': 'checked ? "checked" : "unchecked"',
|
62
|
+
'[attr.tabindex]': 'tabIndex',
|
63
|
+
'(click)': '_onClick()',
|
64
|
+
'(blur)': '_onBlur()'
|
65
|
+
}
|
66
|
+
}]
|
67
|
+
}], propDecorators: { id: [{
|
68
|
+
type: Input
|
69
|
+
}], value: [{
|
70
|
+
type: Input,
|
71
|
+
args: [{ required: true }]
|
72
|
+
}], disabled: [{
|
73
|
+
type: Input,
|
74
|
+
args: [{ transform: booleanAttribute }]
|
75
|
+
}] } });
|
76
|
+
|
77
|
+
class RdxRadioGroupDirective {
|
78
|
+
constructor() {
|
79
|
+
this.destroy$ = new Subject();
|
80
|
+
this.disabled = false;
|
81
|
+
/**
|
82
|
+
* The orientation of the radio group only vertical.
|
83
|
+
* Horizontal radio buttons can sometimes be challenging to scan and localize.
|
84
|
+
* The horizontal arrangement of radio buttons may also lead to difficulties in determining which
|
85
|
+
* label corresponds to which button: whether the label is above or below the button.
|
86
|
+
* @default 'vertical'
|
87
|
+
*/
|
88
|
+
this._orientation = 'vertical';
|
89
|
+
/**
|
90
|
+
* Event handler called when the value changes.
|
91
|
+
*/
|
92
|
+
this.onValueChange = new EventEmitter();
|
93
|
+
/**
|
94
|
+
* The callback function to call when the value of the radio group changes.
|
95
|
+
*/
|
96
|
+
this.onChange = () => {
|
97
|
+
/* Empty */
|
98
|
+
};
|
99
|
+
/**
|
100
|
+
* The callback function to call when the radio group is touched.
|
101
|
+
*/
|
102
|
+
this.onTouched = () => {
|
103
|
+
/* Empty */
|
104
|
+
};
|
105
|
+
}
|
106
|
+
ngAfterContentInit() {
|
107
|
+
this.focusKeyManager = new FocusKeyManager(this.radioItems).withWrap().withVerticalOrientation();
|
108
|
+
this.radioItems.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
109
|
+
this.updateActiveItem();
|
110
|
+
});
|
111
|
+
this.updateActiveItem(false);
|
112
|
+
}
|
113
|
+
ngOnDestroy() {
|
114
|
+
this.destroy$.next();
|
115
|
+
this.destroy$.complete();
|
116
|
+
}
|
117
|
+
/**
|
118
|
+
* Select a radio item.
|
119
|
+
* @param value The value of the radio item to select.
|
120
|
+
*/
|
121
|
+
select(value) {
|
122
|
+
this.value = value;
|
123
|
+
this.onValueChange.emit(value);
|
124
|
+
this.onChange?.(value);
|
125
|
+
this.updateActiveItem();
|
126
|
+
this.onTouched();
|
127
|
+
}
|
128
|
+
/**
|
129
|
+
* Update the value of the radio group.
|
130
|
+
* @param value The new value of the radio group.
|
131
|
+
* @internal
|
132
|
+
*/
|
133
|
+
writeValue(value) {
|
134
|
+
this.value = value;
|
135
|
+
if (this.radioItems) {
|
136
|
+
this.updateActiveItem(false);
|
137
|
+
}
|
138
|
+
}
|
139
|
+
/**
|
140
|
+
* Register a callback function to call when the value of the radio group changes.
|
141
|
+
* @param fn The callback function to call when the value of the radio group changes.
|
142
|
+
* @internal
|
143
|
+
*/
|
144
|
+
registerOnChange(fn) {
|
145
|
+
this.onChange = fn;
|
146
|
+
}
|
147
|
+
registerOnTouched(fn) {
|
148
|
+
this.onTouched = fn;
|
149
|
+
}
|
150
|
+
/**
|
151
|
+
* Set the disabled state of the radio group.
|
152
|
+
* @param isDisabled Whether the radio group is disabled.
|
153
|
+
* @internal
|
154
|
+
*/
|
155
|
+
setDisabledState(isDisabled) {
|
156
|
+
this.disabled = isDisabled;
|
157
|
+
}
|
158
|
+
/**
|
159
|
+
* When focus leaves the radio group.
|
160
|
+
*/
|
161
|
+
_onFocusin(event) {
|
162
|
+
const target = event.target;
|
163
|
+
const radioItem = this.radioItems.find((item) => item.element.nativeElement === target);
|
164
|
+
if (radioItem) {
|
165
|
+
this.focusKeyManager.setActiveItem(radioItem);
|
166
|
+
}
|
167
|
+
}
|
168
|
+
_onKeydown(event) {
|
169
|
+
if (this.disabled)
|
170
|
+
return;
|
171
|
+
switch (event.keyCode) {
|
172
|
+
case ENTER:
|
173
|
+
case SPACE:
|
174
|
+
event.preventDefault();
|
175
|
+
this.selectFocusedItem();
|
176
|
+
break;
|
177
|
+
case DOWN_ARROW:
|
178
|
+
case RIGHT_ARROW:
|
179
|
+
event.preventDefault();
|
180
|
+
this.focusKeyManager.setNextItemActive();
|
181
|
+
this.selectFocusedItem();
|
182
|
+
break;
|
183
|
+
case UP_ARROW:
|
184
|
+
case LEFT_ARROW:
|
185
|
+
event.preventDefault();
|
186
|
+
this.focusKeyManager.setPreviousItemActive();
|
187
|
+
this.selectFocusedItem();
|
188
|
+
break;
|
189
|
+
case TAB:
|
190
|
+
this.tabNavigation(event);
|
191
|
+
break;
|
192
|
+
default:
|
193
|
+
this.focusKeyManager.onKeydown(event);
|
194
|
+
}
|
195
|
+
}
|
196
|
+
selectFocusedItem() {
|
197
|
+
const focusedItem = this.focusKeyManager.activeItem;
|
198
|
+
if (focusedItem) {
|
199
|
+
this.select(focusedItem.value);
|
200
|
+
}
|
201
|
+
}
|
202
|
+
updateActiveItem(setFocus = true) {
|
203
|
+
const activeItem = this.radioItems.find((item) => item.value === this.value);
|
204
|
+
if (activeItem) {
|
205
|
+
this.focusKeyManager.setActiveItem(activeItem);
|
206
|
+
}
|
207
|
+
else if (this.radioItems.length > 0 && setFocus) {
|
208
|
+
this.focusKeyManager.setFirstItemActive();
|
209
|
+
}
|
210
|
+
}
|
211
|
+
tabNavigation(event) {
|
212
|
+
event.preventDefault();
|
213
|
+
const checkedItem = this.radioItems.find((item) => item.checked);
|
214
|
+
if (checkedItem) {
|
215
|
+
checkedItem.focus();
|
216
|
+
}
|
217
|
+
else if (this.radioItems.first) {
|
218
|
+
this.radioItems.first.focus();
|
219
|
+
}
|
220
|
+
}
|
221
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxRadioGroupDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
222
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.1", type: RdxRadioGroupDirective, isStandalone: true, selector: "[rdxRadioRoot]", inputs: { value: "value", disabled: ["disabled", "disabled", booleanAttribute], dir: "dir", defaultValue: "defaultValue" }, outputs: { onValueChange: "onValueChange" }, host: { attributes: { "role": "radiogroup" }, listeners: { "keydown": "_onKeydown($event)", "focusin": "_onFocusin($event)" }, properties: { "attr.aria-orientation": "_orientation", "attr.data-disabled": "disabled ? \"\" : null", "attr.tabindex": "-1", "attr.dir": "dir" } }, providers: [
|
223
|
+
{ provide: RDX_RADIO_GROUP, useExisting: RdxRadioGroupDirective },
|
224
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }
|
225
|
+
], queries: [{ propertyName: "radioItems", predicate: RdxRadioItemDirective, descendants: true }], exportAs: ["rdxRadioRoot"], ngImport: i0 }); }
|
226
|
+
}
|
227
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxRadioGroupDirective, decorators: [{
|
228
|
+
type: Directive,
|
229
|
+
args: [{
|
230
|
+
selector: '[rdxRadioRoot]',
|
231
|
+
exportAs: 'rdxRadioRoot',
|
232
|
+
standalone: true,
|
233
|
+
providers: [
|
234
|
+
{ provide: RDX_RADIO_GROUP, useExisting: RdxRadioGroupDirective },
|
235
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }
|
236
|
+
],
|
237
|
+
host: {
|
238
|
+
role: 'radiogroup',
|
239
|
+
'[attr.aria-orientation]': '_orientation',
|
240
|
+
'[attr.data-disabled]': 'disabled ? "" : null',
|
241
|
+
'[attr.tabindex]': '-1',
|
242
|
+
'[attr.dir]': 'dir',
|
243
|
+
'(keydown)': '_onKeydown($event)',
|
244
|
+
'(focusin)': '_onFocusin($event)'
|
245
|
+
}
|
246
|
+
}]
|
247
|
+
}], propDecorators: { radioItems: [{
|
248
|
+
type: ContentChildren,
|
249
|
+
args: [RdxRadioItemDirective, { descendants: true }]
|
250
|
+
}], value: [{
|
251
|
+
type: Input
|
252
|
+
}], disabled: [{
|
253
|
+
type: Input,
|
254
|
+
args: [{ transform: booleanAttribute }]
|
255
|
+
}], dir: [{
|
256
|
+
type: Input
|
257
|
+
}], defaultValue: [{
|
258
|
+
type: Input
|
259
|
+
}], onValueChange: [{
|
260
|
+
type: Output
|
261
|
+
}] } });
|
262
|
+
|
263
|
+
class RdxRadioIndicatorDirective {
|
264
|
+
constructor() {
|
265
|
+
this.radioGroup = inject(RDX_RADIO_GROUP);
|
266
|
+
this.radioItem = inject(RdxRadioItemDirective);
|
267
|
+
}
|
268
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxRadioIndicatorDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
269
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.1", type: RdxRadioIndicatorDirective, isStandalone: true, selector: "[rdxRadioIndicator]", host: { properties: { "attr.data-state": "radioItem.checked ? \"checked\" : \"unchecked\"", "attr.data-disabled": "radioItem.disabled ? \"\" : null" } }, exportAs: ["rdxRadioIndicator"], ngImport: i0 }); }
|
270
|
+
}
|
271
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxRadioIndicatorDirective, decorators: [{
|
272
|
+
type: Directive,
|
273
|
+
args: [{
|
274
|
+
selector: '[rdxRadioIndicator]',
|
275
|
+
exportAs: 'rdxRadioIndicator',
|
276
|
+
standalone: true,
|
277
|
+
host: {
|
278
|
+
'[attr.data-state]': 'radioItem.checked ? "checked" : "unchecked"',
|
279
|
+
'[attr.data-disabled]': 'radioItem.disabled ? "" : null'
|
280
|
+
}
|
281
|
+
}]
|
282
|
+
}] });
|
283
|
+
|
284
|
+
/**
|
285
|
+
* Generated bundle index. Do not edit.
|
286
|
+
*/
|
287
|
+
|
288
|
+
export { RdxRadioGroupDirective, RdxRadioIndicatorDirective, RdxRadioItemDirective, RdxRadioItemToken, injectRadioItem };
|
289
|
+
//# sourceMappingURL=radix-ng-primitives-radio.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-radio.mjs","sources":["../../../packages/primitives/radio/src/radio-tokens.ts","../../../packages/primitives/radio/src/radio-item.directive.ts","../../../packages/primitives/radio/src/radio-root.directive.ts","../../../packages/primitives/radio/src/radio-indicator.directive.ts","../../../packages/primitives/radio/radix-ng-primitives-radio.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\n\nexport interface RadioGroupProps {\n name?: string;\n disabled?: boolean;\n defaultValue?: string;\n value?: string;\n}\n\nexport interface RadioGroupDirective extends RadioGroupProps {\n select(value: string): void;\n\n onTouched(): void;\n}\n\nexport const RDX_RADIO_GROUP = new InjectionToken<RadioGroupDirective>('RdxRadioGroup');\n","import { FocusableOption } from '@angular/cdk/a11y';\nimport { booleanAttribute, Directive, ElementRef, inject, InjectionToken, Input, OnInit } from '@angular/core';\nimport { RDX_RADIO_GROUP } from './radio-tokens';\n\nexport const RdxRadioItemToken = new InjectionToken<RdxRadioItemDirective>('RadioItemToken');\n\nexport function injectRadioItem(): RdxRadioItemDirective {\n return inject(RdxRadioItemToken);\n}\n\n// Increasing integer for generating unique ids for radio components.\nlet nextUniqueId = 0;\n\n@Directive({\n selector: '[rdxRadioItem]',\n exportAs: 'rdxRadioItem',\n standalone: true,\n providers: [{ provide: RdxRadioItemToken, useExisting: RdxRadioItemDirective }],\n host: {\n type: 'button',\n role: 'radio',\n '[attr.id]': 'id',\n '[attr.aria-checked]': 'checked',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '[attr.data-state]': 'checked ? \"checked\" : \"unchecked\"',\n '[attr.tabindex]': 'tabIndex',\n '(click)': '_onClick()',\n '(blur)': '_onBlur()'\n }\n})\nexport class RdxRadioItemDirective implements FocusableOption, OnInit {\n private readonly radioGroup = inject(RDX_RADIO_GROUP);\n readonly element = inject(ElementRef);\n\n @Input() id = `rdx-radio-${++nextUniqueId}`;\n\n @Input({ required: true }) value!: string;\n\n @Input({ transform: booleanAttribute }) disabled = false;\n\n get tabIndex(): number {\n return this.disabled ? -1 : this.radioGroup.value === this.value ? 0 : -1;\n }\n\n get checked(): boolean {\n return this.radioGroup.value === this.value;\n }\n\n ngOnInit() {\n if (this.radioGroup.defaultValue === this.value) {\n this.radioGroup.select(this.value);\n }\n }\n\n focus(): void {\n this.element.nativeElement.focus();\n }\n\n _onClick(): void {\n if (!this.disabled) {\n this.radioGroup.select(this.value);\n }\n }\n\n _onBlur(): void {\n this.radioGroup.onTouched?.();\n }\n}\n","import { FocusKeyManager } from '@angular/cdk/a11y';\nimport { DOWN_ARROW, ENTER, LEFT_ARROW, RIGHT_ARROW, SPACE, TAB, UP_ARROW } from '@angular/cdk/keycodes';\nimport {\n AfterContentInit,\n booleanAttribute,\n ContentChildren,\n Directive,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n QueryList\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { Subject, takeUntil } from 'rxjs';\nimport { RdxRadioItemDirective } from './radio-item.directive';\nimport { RadioGroupDirective, RadioGroupProps, RDX_RADIO_GROUP } from './radio-tokens';\n\n@Directive({\n selector: '[rdxRadioRoot]',\n exportAs: 'rdxRadioRoot',\n standalone: true,\n providers: [\n { provide: RDX_RADIO_GROUP, useExisting: RdxRadioGroupDirective },\n { provide: NG_VALUE_ACCESSOR, useExisting: RdxRadioGroupDirective, multi: true }\n ],\n host: {\n role: 'radiogroup',\n '[attr.aria-orientation]': '_orientation',\n '[attr.data-disabled]': 'disabled ? \"\" : null',\n '[attr.tabindex]': '-1',\n '[attr.dir]': 'dir',\n '(keydown)': '_onKeydown($event)',\n '(focusin)': '_onFocusin($event)'\n }\n})\nexport class RdxRadioGroupDirective\n implements RadioGroupProps, RadioGroupDirective, ControlValueAccessor, AfterContentInit, OnDestroy\n{\n @ContentChildren(RdxRadioItemDirective, { descendants: true }) radioItems!: QueryList<RdxRadioItemDirective>;\n private focusKeyManager!: FocusKeyManager<RdxRadioItemDirective>;\n private destroy$ = new Subject<void>();\n\n name?: string | undefined;\n @Input() value?: string;\n\n @Input({ transform: booleanAttribute }) disabled = false;\n\n @Input() dir?: string;\n\n @Input() defaultValue?: string;\n\n /**\n * The orientation of the radio group only vertical.\n * Horizontal radio buttons can sometimes be challenging to scan and localize.\n * The horizontal arrangement of radio buttons may also lead to difficulties in determining which\n * label corresponds to which button: whether the label is above or below the button.\n * @default 'vertical'\n */\n readonly _orientation = 'vertical';\n\n /**\n * Event handler called when the value changes.\n */\n @Output() readonly onValueChange = new EventEmitter<string>();\n\n /**\n * The callback function to call when the value of the radio group changes.\n */\n private onChange: (value: string) => void = () => {\n /* Empty */\n };\n\n /**\n * The callback function to call when the radio group is touched.\n */\n onTouched: () => void = () => {\n /* Empty */\n };\n\n ngAfterContentInit() {\n this.focusKeyManager = new FocusKeyManager(this.radioItems).withWrap().withVerticalOrientation();\n\n this.radioItems.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {\n this.updateActiveItem();\n });\n\n this.updateActiveItem(false);\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n /**\n * Select a radio item.\n * @param value The value of the radio item to select.\n */\n select(value: string): void {\n this.value = value;\n this.onValueChange.emit(value);\n this.onChange?.(value);\n this.updateActiveItem();\n this.onTouched();\n }\n\n /**\n * Update the value of the radio group.\n * @param value The new value of the radio group.\n * @internal\n */\n writeValue(value: string): void {\n this.value = value;\n if (this.radioItems) {\n this.updateActiveItem(false);\n }\n }\n\n /**\n * Register a callback function to call when the value of the radio group changes.\n * @param fn The callback function to call when the value of the radio group changes.\n * @internal\n */\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n /**\n * Set the disabled state of the radio group.\n * @param isDisabled Whether the radio group is disabled.\n * @internal\n */\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n /**\n * When focus leaves the radio group.\n */\n _onFocusin(event: FocusEvent): void {\n const target = event.target as HTMLElement;\n const radioItem = this.radioItems.find((item) => item.element.nativeElement === target);\n if (radioItem) {\n this.focusKeyManager.setActiveItem(radioItem);\n }\n }\n\n _onKeydown(event: KeyboardEvent): void {\n if (this.disabled) return;\n\n switch (event.keyCode) {\n case ENTER:\n case SPACE:\n event.preventDefault();\n this.selectFocusedItem();\n break;\n case DOWN_ARROW:\n case RIGHT_ARROW:\n event.preventDefault();\n this.focusKeyManager.setNextItemActive();\n this.selectFocusedItem();\n break;\n case UP_ARROW:\n case LEFT_ARROW:\n event.preventDefault();\n this.focusKeyManager.setPreviousItemActive();\n this.selectFocusedItem();\n break;\n case TAB:\n this.tabNavigation(event);\n break;\n default:\n this.focusKeyManager.onKeydown(event);\n }\n }\n\n private selectFocusedItem(): void {\n const focusedItem = this.focusKeyManager.activeItem;\n if (focusedItem) {\n this.select(focusedItem.value);\n }\n }\n\n private updateActiveItem(setFocus = true): void {\n const activeItem = this.radioItems.find((item) => item.value === this.value);\n if (activeItem) {\n this.focusKeyManager.setActiveItem(activeItem);\n } else if (this.radioItems.length > 0 && setFocus) {\n this.focusKeyManager.setFirstItemActive();\n }\n }\n\n private tabNavigation(event: KeyboardEvent): void {\n event.preventDefault();\n const checkedItem = this.radioItems.find((item) => item.checked);\n if (checkedItem) {\n checkedItem.focus();\n } else if (this.radioItems.first) {\n this.radioItems.first.focus();\n }\n }\n}\n","import { Directive, inject } from '@angular/core';\nimport { RdxRadioItemDirective } from './radio-item.directive';\nimport { RDX_RADIO_GROUP, RadioGroupDirective } from './radio-tokens';\n\n@Directive({\n selector: '[rdxRadioIndicator]',\n exportAs: 'rdxRadioIndicator',\n standalone: true,\n host: {\n '[attr.data-state]': 'radioItem.checked ? \"checked\" : \"unchecked\"',\n '[attr.data-disabled]': 'radioItem.disabled ? \"\" : null'\n }\n})\nexport class RdxRadioIndicatorDirective {\n protected readonly radioGroup: RadioGroupDirective = inject(RDX_RADIO_GROUP);\n protected readonly radioItem: RdxRadioItemDirective = inject(RdxRadioItemDirective);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;AAeO,MAAM,eAAe,GAAG,IAAI,cAAc,CAAsB,eAAe,CAAC;;MCX1E,iBAAiB,GAAG,IAAI,cAAc,CAAwB,gBAAgB,EAAE;SAE7E,eAAe,GAAA;AAC3B,IAAA,OAAO,MAAM,CAAC,iBAAiB,CAAC,CAAC;AACrC,CAAC;AAED;AACA,IAAI,YAAY,GAAG,CAAC,CAAC;MAmBR,qBAAqB,CAAA;AAjBlC,IAAA,WAAA,GAAA;AAkBqB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAC7C,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;AAE7B,QAAA,IAAA,CAAA,EAAE,GAAG,CAAA,UAAA,EAAa,EAAE,YAAY,EAAE,CAAC;QAIJ,IAAQ,CAAA,QAAA,GAAG,KAAK,CAAC;AA6B5D,KAAA;AA3BG,IAAA,IAAI,QAAQ,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;KAC7E;AAED,IAAA,IAAI,OAAO,GAAA;QACP,OAAO,I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,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;kGAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qBAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,iBAAA,EAAA,iDAAA,EAAA,oBAAA,EAAA,kCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBATtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,qBAAqB;AAC/B,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,mBAAmB,EAAE,6CAA6C;AAClE,wBAAA,sBAAsB,EAAE,gCAAgC;AAC3D,qBAAA;AACJ,iBAAA,CAAA;;;ACZD;;AAEG;;;;"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import * as i0 from '@angular/core';
|
2
|
+
import { booleanAttribute, Directive, Input } from '@angular/core';
|
3
|
+
|
4
|
+
const DEFAULT_ORIENTATION = 'horizontal';
|
5
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
6
|
+
const ORIENTATIONS = ['horizontal', 'vertical'];
|
7
|
+
class RdxSeparatorRootDirective {
|
8
|
+
constructor() {
|
9
|
+
this.orientation = DEFAULT_ORIENTATION;
|
10
|
+
this.decorative = false;
|
11
|
+
}
|
12
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSeparatorRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
13
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "18.2.1", type: RdxSeparatorRootDirective, isStandalone: true, selector: "div[rdxSeparatorRoot]", inputs: { orientation: "orientation", decorative: ["decorative", "decorative", booleanAttribute] }, host: { properties: { "attr.role": "decorative ? \"none\" : \"separator\"", "attr.aria-orientation": "!decorative && orientation === \"vertical\" ? \"vertical\" : null", "attr.data-orientation": "orientation" } }, ngImport: i0 }); }
|
14
|
+
}
|
15
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.1", ngImport: i0, type: RdxSeparatorRootDirective, decorators: [{
|
16
|
+
type: Directive,
|
17
|
+
args: [{
|
18
|
+
selector: 'div[rdxSeparatorRoot]',
|
19
|
+
standalone: true,
|
20
|
+
host: {
|
21
|
+
'[attr.role]': 'decorative ? "none" : "separator"',
|
22
|
+
// `aria-orientation` defaults to `horizontal` so we only need it if `orientation` is vertical
|
23
|
+
'[attr.aria-orientation]': '!decorative && orientation === "vertical" ? "vertical" : null',
|
24
|
+
'[attr.data-orientation]': 'orientation'
|
25
|
+
}
|
26
|
+
}]
|
27
|
+
}], propDecorators: { orientation: [{
|
28
|
+
type: Input
|
29
|
+
}], decorative: [{
|
30
|
+
type: Input,
|
31
|
+
args: [{ transform: booleanAttribute }]
|
32
|
+
}] } });
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Generated bundle index. Do not edit.
|
36
|
+
*/
|
37
|
+
|
38
|
+
export { RdxSeparatorRootDirective };
|
39
|
+
//# sourceMappingURL=radix-ng-primitives-separator.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"radix-ng-primitives-separator.mjs","sources":["../../../packages/primitives/separator/src/separator.directive.ts","../../../packages/primitives/separator/radix-ng-primitives-separator.ts"],"sourcesContent":["import { booleanAttribute, Directive, Input } from '@angular/core';\n\nconst DEFAULT_ORIENTATION = 'horizontal';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst ORIENTATIONS = ['horizontal', 'vertical'] as const;\n\nexport type Orientation = (typeof ORIENTATIONS)[number];\n\nexport interface SeparatorProps {\n /**\n * Either `vertical` or `horizontal`. Defaults to `horizontal`.\n */\n orientation?: Orientation;\n /**\n * Whether the component is purely decorative. When true, accessibility-related attributes\n * are updated so that the rendered element is removed from the accessibility tree.\n */\n decorative?: boolean;\n}\n\n@Directive({\n selector: 'div[rdxSeparatorRoot]',\n standalone: true,\n host: {\n '[attr.role]': 'decorative ? \"none\" : \"separator\"',\n // `aria-orientation` defaults to `horizontal` so we only need it if `orientation` is vertical\n '[attr.aria-orientation]': '!decorative && orientation === \"vertical\" ? \"vertical\" : null',\n '[attr.data-orientation]': 'orientation'\n }\n})\nexport class RdxSeparatorRootDirective implements SeparatorProps {\n @Input() orientation: Orientation = DEFAULT_ORIENTATION;\n\n @Input({ transform: booleanAttribute }) decorative = false;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,MAAM,mBAAmB,GAAG,YAAY,CAAC;AACzC;AACA,MAAM,YAAY,GAAG,CAAC,YAAY,EAAE,UAAU,CAAU,CAAC;MA0B5C,yBAAyB,CAAA;AAVtC,IAAA,WAAA,GAAA;QAWa,IAAW,CAAA,WAAA,GAAgB,mBAAmB,CAAC;QAEhB,IAAU,CAAA,UAAA,GAAG,KAAK,CAAC;AAC9D,KAAA;8GAJY,yBAAyB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAzB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,yBAAyB,wIAGd,gBAAgB,CAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,WAAA,EAAA,uCAAA,EAAA,uBAAA,EAAA,mEAAA,EAAA,uBAAA,EAAA,aAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA,EAAA;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