@ng-cn/core 1.0.15 → 1.0.17
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/package.json +34 -33
- package/schematics/component/index.js +454 -95
- package/schematics/component/index.ts +459 -98
- package/schematics/ng-add/index.js +539 -55
- package/schematics/ng-add/index.ts +555 -62
- package/schematics/ng-add/schema.json +8 -2
- package/schematics/test-schematic.js +1 -2
- package/src/app/lib/components/ui/.gitkeep +0 -0
- package/src/app/lib/components/ui/accordion/accordion-content.component.ts +16 -24
- package/src/app/lib/components/ui/accordion/accordion-context.ts +4 -9
- package/src/app/lib/components/ui/accordion/accordion-item.component.ts +33 -29
- package/src/app/lib/components/ui/accordion/accordion-trigger.component.ts +11 -14
- package/src/app/lib/components/ui/accordion/accordion.component.ts +60 -49
- package/src/app/lib/components/ui/accordion/index.ts +5 -6
- package/src/app/lib/components/ui/alert/alert-description.component.ts +3 -8
- package/src/app/lib/components/ui/alert/alert-title.component.ts +2 -7
- package/src/app/lib/components/ui/alert/alert-variants.ts +19 -5
- package/src/app/lib/components/ui/alert/alert.component.ts +2 -10
- package/src/app/lib/components/ui/alert/index.ts +0 -1
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-action.component.ts +5 -12
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-cancel.component.ts +5 -11
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-content.component.ts +63 -66
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-context.ts +10 -5
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-description.component.ts +5 -10
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-footer.component.ts +3 -7
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-header.component.ts +3 -7
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-title.component.ts +5 -12
- package/src/app/lib/components/ui/alert-dialog/alert-dialog-trigger.component.ts +8 -12
- package/src/app/lib/components/ui/alert-dialog/alert-dialog.component.ts +28 -34
- package/src/app/lib/components/ui/alert-dialog/index.ts +0 -1
- package/src/app/lib/components/ui/aspect-ratio/aspect-ratio.component.ts +3 -9
- package/src/app/lib/components/ui/avatar/avatar-context.ts +9 -0
- package/src/app/lib/components/ui/avatar/avatar-fallback.component.ts +7 -18
- package/src/app/lib/components/ui/avatar/avatar-image.component.ts +39 -17
- package/src/app/lib/components/ui/avatar/avatar.component.ts +17 -20
- package/src/app/lib/components/ui/avatar/index.ts +1 -1
- package/src/app/lib/components/ui/avatar/ui-avatar.component.ts +9 -30
- package/src/app/lib/components/ui/badge/badge-variants.ts +5 -5
- package/src/app/lib/components/ui/badge/badge.component.ts +4 -8
- package/src/app/lib/components/ui/badge/index.ts +0 -1
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-ellipsis.component.ts +3 -7
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-item.component.ts +5 -14
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-link.component.ts +6 -18
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-list.component.ts +6 -15
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-page.component.ts +3 -7
- package/src/app/lib/components/ui/breadcrumb/breadcrumb-separator.component.ts +22 -31
- package/src/app/lib/components/ui/breadcrumb/breadcrumb.component.ts +3 -9
- package/src/app/lib/components/ui/breadcrumb/index.ts +0 -1
- package/src/app/lib/components/ui/button/button-variants.ts +6 -8
- package/src/app/lib/components/ui/button/button.component.ts +4 -8
- package/src/app/lib/components/ui/button/index.ts +0 -1
- package/src/app/lib/components/ui/button-group/button-group-variants.ts +12 -15
- package/src/app/lib/components/ui/button-group/button-group.component.ts +6 -14
- package/src/app/lib/components/ui/button-group/index.ts +1 -5
- package/src/app/lib/components/ui/calendar/calendar.component.ts +103 -115
- package/src/app/lib/components/ui/card/card-action.component.ts +2 -10
- package/src/app/lib/components/ui/card/card-content.component.ts +1 -6
- package/src/app/lib/components/ui/card/card-description.component.ts +2 -7
- package/src/app/lib/components/ui/card/card-footer.component.ts +2 -7
- package/src/app/lib/components/ui/card/card-header.component.ts +3 -8
- package/src/app/lib/components/ui/card/card-title.component.ts +2 -9
- package/src/app/lib/components/ui/card/card.component.ts +3 -8
- package/src/app/lib/components/ui/card/index.ts +0 -1
- package/src/app/lib/components/ui/carousel/carousel-content.component.ts +3 -9
- package/src/app/lib/components/ui/carousel/carousel-item.component.ts +5 -5
- package/src/app/lib/components/ui/carousel/carousel-next.component.ts +9 -8
- package/src/app/lib/components/ui/carousel/carousel-previous.component.ts +9 -8
- package/src/app/lib/components/ui/carousel/carousel.component.ts +14 -25
- package/src/app/lib/components/ui/carousel/index.ts +5 -2
- package/src/app/lib/components/ui/chart/chart-container.component.ts +20 -26
- package/src/app/lib/components/ui/chart/chart-legend-content.component.ts +6 -16
- package/src/app/lib/components/ui/chart/chart-legend.component.ts +2 -7
- package/src/app/lib/components/ui/chart/chart-tooltip-content.component.ts +2 -9
- package/src/app/lib/components/ui/chart/chart-tooltip.component.ts +2 -7
- package/src/app/lib/components/ui/chart/chart.component.ts +12 -32
- package/src/app/lib/components/ui/chart/index.ts +7 -8
- package/src/app/lib/components/ui/checkbox/checkbox.component.ts +55 -74
- package/src/app/lib/components/ui/collapsible/collapsible-content.component.ts +16 -25
- package/src/app/lib/components/ui/collapsible/collapsible-context.ts +0 -8
- package/src/app/lib/components/ui/collapsible/collapsible-trigger.component.ts +6 -16
- package/src/app/lib/components/ui/collapsible/collapsible.component.ts +29 -33
- package/src/app/lib/components/ui/collapsible/index.ts +0 -1
- package/src/app/lib/components/ui/combobox/combobox-content.component.ts +8 -15
- package/src/app/lib/components/ui/combobox/combobox-context.ts +5 -4
- package/src/app/lib/components/ui/combobox/combobox-empty.component.ts +5 -12
- package/src/app/lib/components/ui/combobox/combobox-group.component.ts +3 -7
- package/src/app/lib/components/ui/combobox/combobox-input.component.ts +25 -25
- package/src/app/lib/components/ui/combobox/combobox-item.component.ts +45 -44
- package/src/app/lib/components/ui/combobox/combobox-list.component.ts +14 -12
- package/src/app/lib/components/ui/combobox/combobox-trigger.component.ts +24 -14
- package/src/app/lib/components/ui/combobox/combobox-value.component.ts +27 -22
- package/src/app/lib/components/ui/combobox/combobox.component.ts +74 -54
- package/src/app/lib/components/ui/combobox/index.ts +1 -6
- package/src/app/lib/components/ui/command/command-context.ts +1 -5
- package/src/app/lib/components/ui/command/command-dialog.component.ts +12 -14
- package/src/app/lib/components/ui/command/command-empty.component.ts +2 -3
- package/src/app/lib/components/ui/command/command-group.component.ts +32 -25
- package/src/app/lib/components/ui/command/command-input.component.ts +29 -28
- package/src/app/lib/components/ui/command/command-item.component.ts +46 -58
- package/src/app/lib/components/ui/command/command-list.component.ts +5 -4
- package/src/app/lib/components/ui/command/command-separator.component.ts +2 -3
- package/src/app/lib/components/ui/command/command-shortcut.component.ts +2 -1
- package/src/app/lib/components/ui/command/command.component.ts +33 -22
- package/src/app/lib/components/ui/command/index.ts +0 -1
- package/src/app/lib/components/ui/context-menu/context-menu-checkbox-item.component.ts +20 -11
- package/src/app/lib/components/ui/context-menu/context-menu-content.component.ts +36 -43
- package/src/app/lib/components/ui/context-menu/context-menu-context.ts +1 -1
- package/src/app/lib/components/ui/context-menu/context-menu-item.component.ts +12 -13
- package/src/app/lib/components/ui/context-menu/context-menu-label.component.ts +2 -5
- package/src/app/lib/components/ui/context-menu/context-menu-radio-group.component.ts +9 -2
- package/src/app/lib/components/ui/context-menu/context-menu-radio-item.component.ts +14 -14
- package/src/app/lib/components/ui/context-menu/context-menu-separator.component.ts +2 -3
- package/src/app/lib/components/ui/context-menu/context-menu-shortcut.component.ts +2 -1
- package/src/app/lib/components/ui/context-menu/context-menu-sub-content.component.ts +5 -5
- package/src/app/lib/components/ui/context-menu/context-menu-sub-trigger.component.ts +8 -7
- package/src/app/lib/components/ui/context-menu/context-menu-sub.component.ts +9 -2
- package/src/app/lib/components/ui/context-menu/context-menu-trigger.component.ts +8 -7
- package/src/app/lib/components/ui/context-menu/context-menu.component.ts +1 -0
- package/src/app/lib/components/ui/context-menu/index.ts +15 -4
- package/src/app/lib/components/ui/data-table/data-table-content.component.ts +22 -28
- package/src/app/lib/components/ui/data-table/data-table-context.ts +1 -3
- package/src/app/lib/components/ui/data-table/data-table-pagination.component.ts +17 -27
- package/src/app/lib/components/ui/data-table/data-table-search.component.ts +6 -14
- package/src/app/lib/components/ui/data-table/data-table-toolbar.component.ts +3 -7
- package/src/app/lib/components/ui/data-table/data-table-view-options.component.ts +11 -20
- package/src/app/lib/components/ui/data-table/data-table.component.ts +41 -49
- package/src/app/lib/components/ui/data-table/index.ts +7 -8
- package/src/app/lib/components/ui/date-picker/date-picker.component.ts +24 -24
- package/src/app/lib/components/ui/dialog/dialog-close.component.ts +4 -8
- package/src/app/lib/components/ui/dialog/dialog-content.component.ts +72 -73
- package/src/app/lib/components/ui/dialog/dialog-context.ts +7 -5
- package/src/app/lib/components/ui/dialog/dialog-description.component.ts +5 -10
- package/src/app/lib/components/ui/dialog/dialog-footer.component.ts +3 -7
- package/src/app/lib/components/ui/dialog/dialog-header.component.ts +3 -7
- package/src/app/lib/components/ui/dialog/dialog-title.component.ts +5 -10
- package/src/app/lib/components/ui/dialog/dialog-trigger.component.ts +7 -11
- package/src/app/lib/components/ui/dialog/dialog.component.ts +29 -34
- package/src/app/lib/components/ui/dialog/index.ts +0 -1
- package/src/app/lib/components/ui/drawer/drawer-close.component.ts +4 -8
- package/src/app/lib/components/ui/drawer/drawer-content.component.ts +39 -35
- package/src/app/lib/components/ui/drawer/drawer-description.component.ts +5 -10
- package/src/app/lib/components/ui/drawer/drawer-footer.component.ts +3 -7
- package/src/app/lib/components/ui/drawer/drawer-header.component.ts +3 -7
- package/src/app/lib/components/ui/drawer/drawer-title.component.ts +5 -10
- package/src/app/lib/components/ui/drawer/drawer-trigger.component.ts +7 -11
- package/src/app/lib/components/ui/drawer/drawer.component.ts +25 -26
- package/src/app/lib/components/ui/drawer/index.ts +0 -1
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-checkbox-item.component.ts +20 -11
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-content.component.ts +96 -61
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-context.ts +1 -1
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-group.component.ts +1 -0
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-item.component.ts +10 -11
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-label.component.ts +2 -5
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-radio-group.component.ts +14 -5
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-radio-item.component.ts +14 -14
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-separator.component.ts +2 -3
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-shortcut.component.ts +2 -1
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub-content.component.ts +5 -5
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub-trigger.component.ts +8 -7
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-sub.component.ts +9 -2
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu-trigger.component.ts +6 -5
- package/src/app/lib/components/ui/dropdown-menu/dropdown-menu.component.ts +1 -0
- package/src/app/lib/components/ui/dropdown-menu/index.ts +10 -3
- package/src/app/lib/components/ui/empty/empty-action.component.ts +2 -9
- package/src/app/lib/components/ui/empty/empty-description.component.ts +2 -10
- package/src/app/lib/components/ui/empty/empty-icon.component.ts +3 -8
- package/src/app/lib/components/ui/empty/empty-title.component.ts +2 -9
- package/src/app/lib/components/ui/empty/empty.component.ts +3 -8
- package/src/app/lib/components/ui/empty/index.ts +0 -1
- package/src/app/lib/components/ui/form/form-context.ts +1 -11
- package/src/app/lib/components/ui/form/form-control.component.ts +22 -22
- package/src/app/lib/components/ui/form/form-description.component.ts +4 -10
- package/src/app/lib/components/ui/form/form-field.component.ts +7 -10
- package/src/app/lib/components/ui/form/form-item.component.ts +2 -12
- package/src/app/lib/components/ui/form/form-label.component.ts +15 -15
- package/src/app/lib/components/ui/form/form-message.component.ts +7 -15
- package/src/app/lib/components/ui/form/form.component.ts +9 -20
- package/src/app/lib/components/ui/form/index.ts +4 -5
- package/src/app/lib/components/ui/hover-card/hover-card-content.component.ts +21 -33
- package/src/app/lib/components/ui/hover-card/hover-card-context.ts +0 -8
- package/src/app/lib/components/ui/hover-card/hover-card-trigger.component.ts +17 -26
- package/src/app/lib/components/ui/hover-card/hover-card.component.ts +18 -28
- package/src/app/lib/components/ui/hover-card/index.ts +9 -6
- package/src/app/lib/components/ui/input/input.component.ts +57 -75
- package/src/app/lib/components/ui/input-group/index.ts +0 -1
- package/src/app/lib/components/ui/input-group/input-group-addon.component.ts +4 -11
- package/src/app/lib/components/ui/input-group/input-group-input.component.ts +3 -8
- package/src/app/lib/components/ui/input-group/input-group.component.ts +4 -9
- package/src/app/lib/components/ui/input-otp/index.ts +4 -5
- package/src/app/lib/components/ui/input-otp/input-otp-context.ts +0 -8
- package/src/app/lib/components/ui/input-otp/input-otp-group.component.ts +2 -3
- package/src/app/lib/components/ui/input-otp/input-otp-separator.component.ts +4 -3
- package/src/app/lib/components/ui/input-otp/input-otp-slot.component.ts +8 -10
- package/src/app/lib/components/ui/input-otp/input-otp.component.ts +27 -45
- package/src/app/lib/components/ui/kbd/index.ts +0 -1
- package/src/app/lib/components/ui/kbd/kbd-variants.ts +1 -1
- package/src/app/lib/components/ui/kbd/kbd.component.ts +4 -8
- package/src/app/lib/components/ui/label/label.component.ts +15 -28
- package/src/app/lib/components/ui/menubar/index.ts +11 -8
- package/src/app/lib/components/ui/menubar/menubar-checkbox-item.component.ts +21 -12
- package/src/app/lib/components/ui/menubar/menubar-content.component.ts +46 -53
- package/src/app/lib/components/ui/menubar/menubar-context.ts +3 -9
- package/src/app/lib/components/ui/menubar/menubar-item.component.ts +13 -14
- package/src/app/lib/components/ui/menubar/menubar-label.component.ts +2 -5
- package/src/app/lib/components/ui/menubar/menubar-menu.component.ts +14 -2
- package/src/app/lib/components/ui/menubar/menubar-radio-group.component.ts +9 -2
- package/src/app/lib/components/ui/menubar/menubar-radio-item.component.ts +13 -13
- package/src/app/lib/components/ui/menubar/menubar-separator.component.ts +2 -3
- package/src/app/lib/components/ui/menubar/menubar-shortcut.component.ts +2 -1
- package/src/app/lib/components/ui/menubar/menubar-sub-content.component.ts +5 -5
- package/src/app/lib/components/ui/menubar/menubar-sub-trigger.component.ts +7 -6
- package/src/app/lib/components/ui/menubar/menubar-sub.component.ts +8 -1
- package/src/app/lib/components/ui/menubar/menubar-trigger.component.ts +26 -21
- package/src/app/lib/components/ui/menubar/menubar.component.ts +6 -13
- package/src/app/lib/components/ui/native-select/index.ts +1 -5
- package/src/app/lib/components/ui/native-select/native-select-variants.ts +1 -1
- package/src/app/lib/components/ui/native-select/native-select.component.ts +14 -15
- package/src/app/lib/components/ui/navigation-menu/index.ts +10 -8
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-content.component.ts +18 -13
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-context.ts +2 -10
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-indicator.component.ts +3 -2
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-item.component.ts +6 -1
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-link.component.ts +3 -8
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-list.component.ts +2 -4
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-trigger-style.ts +1 -1
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-trigger.component.ts +8 -7
- package/src/app/lib/components/ui/navigation-menu/navigation-menu-viewport.component.ts +3 -2
- package/src/app/lib/components/ui/navigation-menu/navigation-menu.component.ts +8 -15
- package/src/app/lib/components/ui/pagination/index.ts +0 -1
- package/src/app/lib/components/ui/pagination/pagination-content.component.ts +3 -7
- package/src/app/lib/components/ui/pagination/pagination-ellipsis.component.ts +3 -7
- package/src/app/lib/components/ui/pagination/pagination-item.component.ts +3 -9
- package/src/app/lib/components/ui/pagination/pagination-link.component.ts +4 -8
- package/src/app/lib/components/ui/pagination/pagination-next.component.ts +3 -11
- package/src/app/lib/components/ui/pagination/pagination-previous.component.ts +3 -11
- package/src/app/lib/components/ui/pagination/pagination.component.ts +3 -7
- package/src/app/lib/components/ui/popover/index.ts +9 -6
- package/src/app/lib/components/ui/popover/popover-anchor.component.ts +2 -13
- package/src/app/lib/components/ui/popover/popover-content.component.ts +119 -69
- package/src/app/lib/components/ui/popover/popover-context.ts +0 -8
- package/src/app/lib/components/ui/popover/popover-trigger.component.ts +22 -22
- package/src/app/lib/components/ui/popover/popover.component.ts +20 -33
- package/src/app/lib/components/ui/progress/index.ts +1 -6
- package/src/app/lib/components/ui/progress/progress.component.ts +15 -30
- package/src/app/lib/components/ui/radio-group/index.ts +1 -4
- package/src/app/lib/components/ui/radio-group/radio-group-context.ts +1 -7
- package/src/app/lib/components/ui/radio-group/radio-group-item.component.ts +36 -69
- package/src/app/lib/components/ui/radio-group/radio-group.component.ts +38 -67
- package/src/app/lib/components/ui/resizable/index.ts +0 -1
- package/src/app/lib/components/ui/resizable/resizable-handle.component.ts +25 -39
- package/src/app/lib/components/ui/resizable/resizable-panel-group.component.ts +15 -18
- package/src/app/lib/components/ui/resizable/resizable-panel.component.ts +12 -31
- package/src/app/lib/components/ui/scroll-area/index.ts +4 -5
- package/src/app/lib/components/ui/scroll-area/scroll-area.component.ts +5 -19
- package/src/app/lib/components/ui/scroll-area/scroll-bar.component.ts +8 -27
- package/src/app/lib/components/ui/segmented/index.ts +5 -9
- package/src/app/lib/components/ui/segmented/segmented-context.ts +1 -3
- package/src/app/lib/components/ui/segmented/segmented-item.component.ts +21 -29
- package/src/app/lib/components/ui/segmented/segmented-variants.ts +2 -2
- package/src/app/lib/components/ui/segmented/segmented.component.ts +24 -32
- package/src/app/lib/components/ui/select/index.ts +5 -6
- package/src/app/lib/components/ui/select/select-content.component.ts +34 -62
- package/src/app/lib/components/ui/select/select-context.ts +4 -14
- package/src/app/lib/components/ui/select/select-group.component.ts +6 -7
- package/src/app/lib/components/ui/select/select-item.component.ts +46 -55
- package/src/app/lib/components/ui/select/select-label.component.ts +2 -7
- package/src/app/lib/components/ui/select/select-separator.component.ts +3 -8
- package/src/app/lib/components/ui/select/select-trigger.component.ts +28 -25
- package/src/app/lib/components/ui/select/select-value.component.ts +7 -13
- package/src/app/lib/components/ui/select/select.component.ts +52 -64
- package/src/app/lib/components/ui/separator/index.ts +1 -6
- package/src/app/lib/components/ui/separator/separator.component.ts +4 -19
- package/src/app/lib/components/ui/sheet/index.ts +0 -1
- package/src/app/lib/components/ui/sheet/sheet-close.component.ts +4 -8
- package/src/app/lib/components/ui/sheet/sheet-content.component.ts +31 -36
- package/src/app/lib/components/ui/sheet/sheet-description.component.ts +5 -10
- package/src/app/lib/components/ui/sheet/sheet-footer.component.ts +3 -7
- package/src/app/lib/components/ui/sheet/sheet-header.component.ts +3 -7
- package/src/app/lib/components/ui/sheet/sheet-title.component.ts +5 -10
- package/src/app/lib/components/ui/sheet/sheet-trigger.component.ts +7 -11
- package/src/app/lib/components/ui/sheet/sheet-variants.ts +1 -1
- package/src/app/lib/components/ui/sheet/sheet.component.ts +36 -36
- package/src/app/lib/components/ui/sidebar/index.ts +14 -15
- package/src/app/lib/components/ui/sidebar/sidebar-content.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-context.ts +1 -3
- package/src/app/lib/components/ui/sidebar/sidebar-footer.component.ts +3 -9
- package/src/app/lib/components/ui/sidebar/sidebar-group-action.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-group-content.component.ts +3 -9
- package/src/app/lib/components/ui/sidebar/sidebar-group-label.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-group.component.ts +3 -7
- package/src/app/lib/components/ui/sidebar/sidebar-header.component.ts +3 -9
- package/src/app/lib/components/ui/sidebar/sidebar-input.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-inset.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-menu-action.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-menu-badge.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-menu-button.component.ts +4 -9
- package/src/app/lib/components/ui/sidebar/sidebar-menu-item.component.ts +3 -9
- package/src/app/lib/components/ui/sidebar/sidebar-menu-skeleton.component.ts +6 -11
- package/src/app/lib/components/ui/sidebar/sidebar-menu-sub-button.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-menu-sub-item.component.ts +2 -6
- package/src/app/lib/components/ui/sidebar/sidebar-menu-sub.component.ts +4 -8
- package/src/app/lib/components/ui/sidebar/sidebar-menu.component.ts +3 -7
- package/src/app/lib/components/ui/sidebar/sidebar-provider.component.ts +46 -52
- package/src/app/lib/components/ui/sidebar/sidebar-rail.component.ts +6 -11
- package/src/app/lib/components/ui/sidebar/sidebar-route-active.service.ts +17 -17
- package/src/app/lib/components/ui/sidebar/sidebar-separator.component.ts +3 -7
- package/src/app/lib/components/ui/sidebar/sidebar-trigger.component.ts +6 -11
- package/src/app/lib/components/ui/sidebar/sidebar.component.ts +20 -31
- package/src/app/lib/components/ui/skeleton/skeleton.component.ts +3 -8
- package/src/app/lib/components/ui/slider/index.ts +1 -6
- package/src/app/lib/components/ui/slider/slider.component.ts +73 -138
- package/src/app/lib/components/ui/spinner/index.ts +0 -1
- package/src/app/lib/components/ui/spinner/spinner-variants.ts +19 -22
- package/src/app/lib/components/ui/spinner/spinner.component.ts +4 -8
- package/src/app/lib/components/ui/switch/index.ts +1 -6
- package/src/app/lib/components/ui/switch/switch.component.ts +83 -108
- package/src/app/lib/components/ui/table/index.ts +0 -1
- package/src/app/lib/components/ui/table/table-body.component.ts +6 -10
- package/src/app/lib/components/ui/table/table-caption.component.ts +6 -8
- package/src/app/lib/components/ui/table/table-cell.component.ts +4 -8
- package/src/app/lib/components/ui/table/table-footer.component.ts +6 -8
- package/src/app/lib/components/ui/table/table-head.component.ts +4 -8
- package/src/app/lib/components/ui/table/table-header.component.ts +6 -10
- package/src/app/lib/components/ui/table/table-row.component.ts +6 -11
- package/src/app/lib/components/ui/table/table.component.ts +4 -8
- package/src/app/lib/components/ui/tabs/index.ts +14 -7
- package/src/app/lib/components/ui/tabs/tabs-content.component.ts +11 -36
- package/src/app/lib/components/ui/tabs/tabs-context.ts +0 -8
- package/src/app/lib/components/ui/tabs/tabs-list.component.ts +54 -60
- package/src/app/lib/components/ui/tabs/tabs-trigger.component.ts +20 -35
- package/src/app/lib/components/ui/tabs/tabs.component.ts +32 -49
- package/src/app/lib/components/ui/textarea/textarea.component.ts +3 -8
- package/src/app/lib/components/ui/toast/index.ts +6 -7
- package/src/app/lib/components/ui/toast/toast-action.component.ts +7 -18
- package/src/app/lib/components/ui/toast/toast-description.component.ts +2 -11
- package/src/app/lib/components/ui/toast/toast-title.component.ts +2 -9
- package/src/app/lib/components/ui/toast/toast-variants.ts +1 -1
- package/src/app/lib/components/ui/toast/toast.component.ts +18 -24
- package/src/app/lib/components/ui/toast/toast.service.ts +22 -37
- package/src/app/lib/components/ui/toast/toaster.component.ts +6 -16
- package/src/app/lib/components/ui/toggle/index.ts +1 -5
- package/src/app/lib/components/ui/toggle/toggle-variants.ts +2 -2
- package/src/app/lib/components/ui/toggle/toggle.component.ts +32 -51
- package/src/app/lib/components/ui/toggle-group/index.ts +1 -4
- package/src/app/lib/components/ui/toggle-group/toggle-group-context.ts +1 -7
- package/src/app/lib/components/ui/toggle-group/toggle-group-item.component.ts +38 -59
- package/src/app/lib/components/ui/toggle-group/toggle-group.component.ts +33 -51
- package/src/app/lib/components/ui/tooltip/index.ts +9 -6
- package/src/app/lib/components/ui/tooltip/tooltip-content.component.ts +6 -24
- package/src/app/lib/components/ui/tooltip/tooltip-context.ts +0 -8
- package/src/app/lib/components/ui/tooltip/tooltip-provider.component.ts +12 -24
- package/src/app/lib/components/ui/tooltip/tooltip-trigger.component.ts +4 -21
- package/src/app/lib/components/ui/tooltip/tooltip.component.ts +21 -33
- package/src/app/lib/components/ui/typography/index.ts +0 -1
- package/src/app/lib/components/ui/typography/typography-blockquote.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-h1.component.ts +3 -10
- package/src/app/lib/components/ui/typography/typography-h2.component.ts +3 -10
- package/src/app/lib/components/ui/typography/typography-h3.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-h4.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-inline-code.component.ts +4 -8
- package/src/app/lib/components/ui/typography/typography-large.component.ts +3 -9
- package/src/app/lib/components/ui/typography/typography-lead.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-list.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-muted.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-p.component.ts +3 -7
- package/src/app/lib/components/ui/typography/typography-small.component.ts +3 -7
- package/src/app/lib/utils/accessibility/click-outside.directive.ts +1 -8
- package/src/app/lib/utils/accessibility/focus-management.service.ts +4 -15
- package/src/app/lib/utils/accessibility/focus-trap.directive.ts +32 -106
- package/src/app/lib/utils/accessibility/index.ts +16 -5
- package/src/app/lib/utils/accessibility/keyboard-navigation.directive.ts +5 -8
- package/src/app/lib/utils/accessibility/live-region.directive.ts +10 -13
- package/src/app/lib/utils/accessibility/touch-target.directive.ts +1 -8
- package/src/app/lib/utils/animation/animation.utils.ts +4 -7
- package/src/app/lib/utils/animation/index.ts +15 -5
- package/src/app/lib/utils/animation/presence.component.ts +1 -1
- package/src/app/lib/utils/animation/presence.directive.ts +2 -2
- package/src/app/lib/utils/positioning/index.ts +40 -18
- package/src/app/lib/components/ui/index.ts +0 -551
- package/src/app/lib/index.ts +0 -7
|
@@ -29,18 +29,17 @@ import { CAROUSEL_CONTEXT } from './carousel-context';
|
|
|
29
29
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
30
30
|
})
|
|
31
31
|
export class CarouselPrevious {
|
|
32
|
-
protected readonly context = inject(CAROUSEL_CONTEXT);
|
|
33
|
-
protected readonly ArrowLeftIcon = ArrowLeft;
|
|
34
|
-
|
|
35
32
|
/** Button variant */
|
|
36
|
-
readonly variant = input<'default' | 'outline' | 'secondary' | 'ghost' | 'link' | 'destructive'>(
|
|
37
|
-
|
|
33
|
+
readonly variant = input<'default' | 'outline' | 'secondary' | 'ghost' | 'link' | 'destructive'>(
|
|
34
|
+
'outline',
|
|
35
|
+
);
|
|
38
36
|
/** Button size */
|
|
39
37
|
readonly size = input<'default' | 'sm' | 'lg' | 'icon'>('icon');
|
|
40
|
-
|
|
41
38
|
/** Additional CSS classes */
|
|
42
39
|
readonly class = input<string>('');
|
|
43
40
|
|
|
41
|
+
protected readonly context = inject(CAROUSEL_CONTEXT);
|
|
42
|
+
|
|
44
43
|
protected readonly computedClass = computed(() =>
|
|
45
44
|
cn(
|
|
46
45
|
buttonVariants({ variant: this.variant(), size: this.size() }),
|
|
@@ -48,7 +47,9 @@ export class CarouselPrevious {
|
|
|
48
47
|
this.context.orientation() === 'horizontal'
|
|
49
48
|
? '-left-12 top-1/2 -translate-y-1/2'
|
|
50
49
|
: '-top-12 left-1/2 -translate-x-1/2 rotate-90',
|
|
51
|
-
this.class()
|
|
52
|
-
)
|
|
50
|
+
this.class(),
|
|
51
|
+
),
|
|
53
52
|
);
|
|
53
|
+
|
|
54
|
+
protected readonly ArrowLeftIcon = ArrowLeft;
|
|
54
55
|
}
|
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import { LiveAnnouncerService } from '@/lib/utils/accessibility';
|
|
3
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input, signal } from '@angular/core';
|
|
3
4
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
inject,
|
|
8
|
-
input,
|
|
9
|
-
signal,
|
|
10
|
-
} from '@angular/core';
|
|
11
|
-
import {
|
|
12
|
-
CAROUSEL_CONTEXT,
|
|
13
|
-
type CarouselContextValue,
|
|
14
|
-
type CarouselOrientation,
|
|
5
|
+
CAROUSEL_CONTEXT,
|
|
6
|
+
type CarouselContextValue,
|
|
7
|
+
type CarouselOrientation,
|
|
15
8
|
} from './carousel-context';
|
|
16
9
|
|
|
17
10
|
/**
|
|
@@ -85,7 +78,7 @@ import {
|
|
|
85
78
|
],
|
|
86
79
|
host: {
|
|
87
80
|
'[class]': 'computedClass()',
|
|
88
|
-
|
|
81
|
+
role: 'region',
|
|
89
82
|
'[attr.aria-label]': 'ariaLabel()',
|
|
90
83
|
'aria-roledescription': 'carousel',
|
|
91
84
|
'(keydown.arrowleft)': 'onKeyDown($event, "left")',
|
|
@@ -94,32 +87,28 @@ import {
|
|
|
94
87
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
95
88
|
})
|
|
96
89
|
export class Carousel {
|
|
97
|
-
private readonly liveAnnouncer = inject(LiveAnnouncerService);
|
|
98
|
-
|
|
99
90
|
/** Carousel orientation */
|
|
100
91
|
readonly orientation = input<CarouselOrientation>('horizontal');
|
|
101
|
-
|
|
102
92
|
/** Accessible label for the carousel */
|
|
103
93
|
readonly ariaLabel = input<string>('Carousel');
|
|
104
|
-
|
|
105
94
|
/** Additional CSS classes */
|
|
106
95
|
readonly class = input<string>('');
|
|
107
96
|
|
|
108
|
-
|
|
109
|
-
readonly slideAnnouncement = signal<string>('');
|
|
97
|
+
private readonly _liveAnnouncer = inject(LiveAnnouncerService);
|
|
110
98
|
|
|
111
|
-
protected readonly computedClass = computed(() =>
|
|
112
|
-
cn('relative', this.class())
|
|
113
|
-
);
|
|
99
|
+
protected readonly computedClass = computed(() => cn('relative', this.class()));
|
|
114
100
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
101
|
+
/** Current slide announcement for screen readers */
|
|
102
|
+
readonly slideAnnouncement = signal<string>('');
|
|
118
103
|
|
|
119
104
|
/** Announce slide change to screen readers */
|
|
120
105
|
announceSlideChange(index: number, total: number): void {
|
|
121
106
|
const message = `Slide ${index + 1} of ${total}`;
|
|
122
107
|
this.slideAnnouncement.set(message);
|
|
123
|
-
this.
|
|
108
|
+
this._liveAnnouncer.announce(message, 'polite');
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
protected onKeyDown(_event: Event, _direction: 'left' | 'right'): void {
|
|
112
|
+
// Keyboard navigation is handled by the carousel API
|
|
124
113
|
}
|
|
125
114
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
export { CarouselContent } from './carousel-content.component';
|
|
2
|
-
export {
|
|
2
|
+
export {
|
|
3
|
+
CAROUSEL_CONTEXT,
|
|
4
|
+
type CarouselContextValue,
|
|
5
|
+
type CarouselOrientation,
|
|
6
|
+
} from './carousel-context';
|
|
3
7
|
export { CarouselItem } from './carousel-item.component';
|
|
4
8
|
export { CarouselNext } from './carousel-next.component';
|
|
5
9
|
export { CarouselPrevious } from './carousel-previous.component';
|
|
6
10
|
export { Carousel } from './carousel.component';
|
|
7
|
-
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
effect,
|
|
7
|
+
forwardRef,
|
|
8
|
+
input,
|
|
9
|
+
signal,
|
|
10
10
|
} from '@angular/core';
|
|
11
|
-
import {
|
|
12
|
-
CHART_CONTEXT,
|
|
13
|
-
type ChartConfig,
|
|
14
|
-
type ChartContext,
|
|
15
|
-
} from './chart-context';
|
|
11
|
+
import { CHART_CONTEXT, type ChartConfig, type ChartContext } from './chart-context';
|
|
16
12
|
|
|
17
13
|
/**
|
|
18
14
|
* ChartContainer component - wrapper that provides chart context and styling.
|
|
@@ -42,23 +38,17 @@ import {
|
|
|
42
38
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
43
39
|
})
|
|
44
40
|
export class ChartContainer {
|
|
45
|
-
/** Chart configuration with colors and labels */
|
|
46
|
-
readonly config = input<ChartConfig>({});
|
|
47
|
-
|
|
48
|
-
/** Additional CSS classes */
|
|
49
|
-
readonly class = input<string>('');
|
|
50
|
-
|
|
51
|
-
/** Context for child components */
|
|
52
|
-
readonly context: ChartContext = {
|
|
53
|
-
config: signal(this.config()),
|
|
54
|
-
};
|
|
55
|
-
|
|
56
41
|
constructor() {
|
|
57
42
|
effect(() => {
|
|
58
43
|
this.context.config.set(this.config());
|
|
59
44
|
});
|
|
60
45
|
}
|
|
61
46
|
|
|
47
|
+
/** Chart configuration with colors and labels */
|
|
48
|
+
readonly config = input<ChartConfig>({});
|
|
49
|
+
/** Additional CSS classes */
|
|
50
|
+
readonly class = input<string>('');
|
|
51
|
+
|
|
62
52
|
protected readonly chartStyles = computed(() => {
|
|
63
53
|
const config = this.config();
|
|
64
54
|
const styles: { [key: string]: string } = {};
|
|
@@ -71,11 +61,15 @@ export class ChartContainer {
|
|
|
71
61
|
|
|
72
62
|
return styles;
|
|
73
63
|
});
|
|
74
|
-
|
|
75
64
|
protected readonly computedClass = computed(() =>
|
|
76
65
|
cn(
|
|
77
66
|
'flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_]:stroke-border [&_.recharts-sector]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none',
|
|
78
|
-
this.class()
|
|
79
|
-
)
|
|
67
|
+
this.class(),
|
|
68
|
+
),
|
|
80
69
|
);
|
|
70
|
+
|
|
71
|
+
/** Context for child components */
|
|
72
|
+
readonly context: ChartContext = {
|
|
73
|
+
config: signal(this.config()),
|
|
74
|
+
};
|
|
81
75
|
}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
inject,
|
|
7
|
-
input,
|
|
8
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';
|
|
9
3
|
import { CHART_COLORS, CHART_CONTEXT } from './chart-context';
|
|
10
4
|
|
|
11
5
|
/**
|
|
@@ -16,10 +10,7 @@ import { CHART_COLORS, CHART_CONTEXT } from './chart-context';
|
|
|
16
10
|
template: `
|
|
17
11
|
@for (item of items(); track item.label) {
|
|
18
12
|
<div class="flex items-center gap-2">
|
|
19
|
-
<div
|
|
20
|
-
class="h-2 w-2 rounded-full"
|
|
21
|
-
[style.backgroundColor]="item.color"
|
|
22
|
-
></div>
|
|
13
|
+
<div class="h-2 w-2 rounded-full" [style.backgroundColor]="item.color"></div>
|
|
23
14
|
<span class="text-sm text-muted-foreground">{{ item.label }}</span>
|
|
24
15
|
</div>
|
|
25
16
|
}
|
|
@@ -30,13 +21,13 @@ import { CHART_COLORS, CHART_CONTEXT } from './chart-context';
|
|
|
30
21
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
31
22
|
})
|
|
32
23
|
export class ChartLegendContent {
|
|
33
|
-
private readonly context = inject(CHART_CONTEXT, { optional: true });
|
|
34
|
-
|
|
35
24
|
/** Additional CSS classes */
|
|
36
25
|
readonly class = input<string>('');
|
|
37
26
|
|
|
27
|
+
private readonly _context = inject(CHART_CONTEXT, { optional: true });
|
|
28
|
+
|
|
38
29
|
protected readonly items = computed(() => {
|
|
39
|
-
const config = this.
|
|
30
|
+
const config = this._context?.config() || {};
|
|
40
31
|
const colors = Object.values(CHART_COLORS);
|
|
41
32
|
|
|
42
33
|
return Object.entries(config).map(([key, value], i) => ({
|
|
@@ -44,8 +35,7 @@ export class ChartLegendContent {
|
|
|
44
35
|
color: value.color || colors[i % colors.length],
|
|
45
36
|
}));
|
|
46
37
|
});
|
|
47
|
-
|
|
48
38
|
protected readonly computedClass = computed(() =>
|
|
49
|
-
cn('flex flex-wrap items-center justify-center gap-4', this.class())
|
|
39
|
+
cn('flex flex-wrap items-center justify-center gap-4', this.class()),
|
|
50
40
|
);
|
|
51
41
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* ChartLegend component - legend for chart series.
|
|
@@ -23,6 +18,6 @@ export class ChartLegend {
|
|
|
23
18
|
readonly class = input<string>('');
|
|
24
19
|
|
|
25
20
|
protected readonly computedClass = computed(() =>
|
|
26
|
-
cn('flex flex-wrap items-center justify-center gap-4', this.class())
|
|
21
|
+
cn('flex flex-wrap items-center justify-center gap-4', this.class()),
|
|
27
22
|
);
|
|
28
23
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* ChartTooltipContent component - content inside tooltip.
|
|
@@ -31,7 +26,5 @@ export class ChartTooltipContent {
|
|
|
31
26
|
/** Additional CSS classes */
|
|
32
27
|
readonly class = input<string>('');
|
|
33
28
|
|
|
34
|
-
protected readonly computedClass = computed(() =>
|
|
35
|
-
cn('flex flex-col gap-1', this.class())
|
|
36
|
-
);
|
|
29
|
+
protected readonly computedClass = computed(() => cn('flex flex-col gap-1', this.class()));
|
|
37
30
|
}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
input,
|
|
7
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';
|
|
8
3
|
|
|
9
4
|
/**
|
|
10
5
|
* ChartTooltip component - tooltip for chart data points.
|
|
@@ -23,6 +18,6 @@ export class ChartTooltip {
|
|
|
23
18
|
readonly class = input<string>('');
|
|
24
19
|
|
|
25
20
|
protected readonly computedClass = computed(() =>
|
|
26
|
-
cn('rounded-lg border bg-background p-2 shadow-sm', this.class())
|
|
21
|
+
cn('rounded-lg border bg-background p-2 shadow-sm', this.class()),
|
|
27
22
|
);
|
|
28
23
|
}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
|
-
import {
|
|
3
|
-
ChangeDetectionStrategy,
|
|
4
|
-
Component,
|
|
5
|
-
computed,
|
|
6
|
-
inject,
|
|
7
|
-
input,
|
|
8
|
-
} from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';
|
|
9
3
|
import {
|
|
10
4
|
CHART_COLORS,
|
|
11
5
|
CHART_CONTEXT,
|
|
@@ -125,45 +119,38 @@ import {
|
|
|
125
119
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
126
120
|
})
|
|
127
121
|
export class Chart {
|
|
128
|
-
private readonly context = inject(CHART_CONTEXT, { optional: true });
|
|
129
|
-
|
|
130
122
|
/** Chart type */
|
|
131
123
|
readonly type = input<ChartType>('bar');
|
|
132
124
|
|
|
133
125
|
/** Data points for the chart */
|
|
134
126
|
readonly data = input<ChartDataPoint[]>([]);
|
|
135
|
-
|
|
136
127
|
/** Series data for multi-series charts */
|
|
137
128
|
readonly series = input<ChartSeries[]>([]);
|
|
138
129
|
|
|
139
130
|
/** Chart width */
|
|
140
131
|
readonly width = input<number>(400);
|
|
141
|
-
|
|
142
132
|
/** Chart height */
|
|
143
133
|
readonly height = input<number>(300);
|
|
144
134
|
|
|
145
135
|
/** Show X axis */
|
|
146
136
|
readonly showXAxis = input<boolean>(true);
|
|
147
|
-
|
|
148
137
|
/** Show Y axis */
|
|
149
138
|
readonly showYAxis = input<boolean>(true);
|
|
150
139
|
|
|
151
140
|
/** Additional CSS classes */
|
|
152
141
|
readonly class = input<string>('');
|
|
153
142
|
|
|
154
|
-
|
|
155
|
-
() => `0 0 ${this.width()} ${this.height()}`
|
|
156
|
-
);
|
|
143
|
+
private readonly _context = inject(CHART_CONTEXT, { optional: true });
|
|
157
144
|
|
|
145
|
+
protected readonly viewBox = computed(() => `0 0 ${this.width()} ${this.height()}`);
|
|
158
146
|
protected readonly primaryColor = computed(() => {
|
|
159
|
-
const config = this.
|
|
147
|
+
const config = this._context?.config() || {};
|
|
160
148
|
const firstKey = Object.keys(config)[0];
|
|
161
149
|
return config[firstKey]?.color || CHART_COLORS.chart1;
|
|
162
150
|
});
|
|
163
|
-
|
|
164
151
|
protected readonly barData = computed(() => {
|
|
165
152
|
const data = this.data();
|
|
166
|
-
const config = this.
|
|
153
|
+
const config = this._context?.config() || {};
|
|
167
154
|
const w = this.width();
|
|
168
155
|
const h = this.height();
|
|
169
156
|
const padding = 40;
|
|
@@ -178,7 +165,6 @@ export class Chart {
|
|
|
178
165
|
color: d.color || config[d.label]?.color || CHART_COLORS.chart1,
|
|
179
166
|
}));
|
|
180
167
|
});
|
|
181
|
-
|
|
182
168
|
protected readonly linePoints = computed(() => {
|
|
183
169
|
const data = this.data();
|
|
184
170
|
const w = this.width();
|
|
@@ -191,16 +177,17 @@ export class Chart {
|
|
|
191
177
|
y: padding + (h - padding * 2) * (1 - d.value / maxValue),
|
|
192
178
|
}));
|
|
193
179
|
});
|
|
194
|
-
|
|
195
180
|
protected readonly linePath = computed(() => {
|
|
196
181
|
const points = this.linePoints();
|
|
197
182
|
if (points.length === 0) return '';
|
|
198
183
|
return (
|
|
199
184
|
`M ${points[0].x} ${points[0].y}` +
|
|
200
|
-
points
|
|
185
|
+
points
|
|
186
|
+
.slice(1)
|
|
187
|
+
.map((p) => ` L ${p.x} ${p.y}`)
|
|
188
|
+
.join('')
|
|
201
189
|
);
|
|
202
190
|
});
|
|
203
|
-
|
|
204
191
|
protected readonly areaPath = computed(() => {
|
|
205
192
|
const points = this.linePoints();
|
|
206
193
|
const h = this.height();
|
|
@@ -214,10 +201,9 @@ export class Chart {
|
|
|
214
201
|
|
|
215
202
|
return `${linePath} L ${lastX} ${bottomY} L ${firstX} ${bottomY} Z`;
|
|
216
203
|
});
|
|
217
|
-
|
|
218
204
|
protected readonly pieSlices = computed(() => {
|
|
219
205
|
const data = this.data();
|
|
220
|
-
const config = this.
|
|
206
|
+
const config = this._context?.config() || {};
|
|
221
207
|
const total = data.reduce((sum, d) => sum + d.value, 0);
|
|
222
208
|
const cx = this.width() / 2;
|
|
223
209
|
const cy = this.height() / 2;
|
|
@@ -243,10 +229,9 @@ export class Chart {
|
|
|
243
229
|
};
|
|
244
230
|
});
|
|
245
231
|
});
|
|
246
|
-
|
|
247
232
|
protected readonly donutSlices = computed(() => {
|
|
248
233
|
const data = this.data();
|
|
249
|
-
const config = this.
|
|
234
|
+
const config = this._context?.config() || {};
|
|
250
235
|
const total = data.reduce((sum, d) => sum + d.value, 0);
|
|
251
236
|
const cx = this.width() / 2;
|
|
252
237
|
const cy = this.height() / 2;
|
|
@@ -277,7 +262,6 @@ export class Chart {
|
|
|
277
262
|
};
|
|
278
263
|
});
|
|
279
264
|
});
|
|
280
|
-
|
|
281
265
|
protected readonly xAxisLabels = computed(() => {
|
|
282
266
|
const data = this.data();
|
|
283
267
|
const w = this.width();
|
|
@@ -288,7 +272,6 @@ export class Chart {
|
|
|
288
272
|
text: d.label,
|
|
289
273
|
}));
|
|
290
274
|
});
|
|
291
|
-
|
|
292
275
|
protected readonly yAxisLabels = computed(() => {
|
|
293
276
|
const data = this.data();
|
|
294
277
|
const h = this.height();
|
|
@@ -301,8 +284,5 @@ export class Chart {
|
|
|
301
284
|
text: String(Math.round(maxValue * (1 - i / steps))),
|
|
302
285
|
}));
|
|
303
286
|
});
|
|
304
|
-
|
|
305
|
-
protected readonly computedClass = computed(() =>
|
|
306
|
-
cn('w-full h-full', this.class())
|
|
307
|
-
);
|
|
287
|
+
protected readonly computedClass = computed(() => cn('w-full h-full', this.class()));
|
|
308
288
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
export { ChartContainer } from './chart-container.component';
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
CHART_COLORS,
|
|
4
|
+
CHART_CONTEXT,
|
|
5
|
+
type ChartConfig,
|
|
6
|
+
type ChartContext,
|
|
7
|
+
type ChartDataPoint,
|
|
8
|
+
type ChartSeries,
|
|
9
|
+
type ChartType,
|
|
10
10
|
} from './chart-context';
|
|
11
11
|
export { ChartLegendContent } from './chart-legend-content.component';
|
|
12
12
|
export { ChartLegend } from './chart-legend.component';
|
|
13
13
|
export { ChartTooltipContent } from './chart-tooltip-content.component';
|
|
14
14
|
export { ChartTooltip } from './chart-tooltip.component';
|
|
15
15
|
export { Chart } from './chart.component';
|
|
16
|
-
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { cn } from '@/lib/utils';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
ChangeDetectionStrategy,
|
|
4
|
+
Component,
|
|
5
|
+
computed,
|
|
6
|
+
ElementRef,
|
|
7
|
+
forwardRef,
|
|
8
|
+
input,
|
|
9
|
+
model,
|
|
10
|
+
signal,
|
|
11
|
+
viewChild,
|
|
12
12
|
} from '@angular/core';
|
|
13
13
|
import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
14
14
|
|
|
@@ -58,10 +58,7 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
|
58
58
|
[attr.data-disabled]="isDisabled() ? '' : null"
|
|
59
59
|
aria-hidden="true"
|
|
60
60
|
>
|
|
61
|
-
<span
|
|
62
|
-
data-slot="checkbox-indicator"
|
|
63
|
-
class="flex items-center justify-center text-current"
|
|
64
|
-
>
|
|
61
|
+
<span data-slot="checkbox-indicator" class="flex items-center justify-center text-current">
|
|
65
62
|
@if (checked() === true) {
|
|
66
63
|
<svg
|
|
67
64
|
xmlns="http://www.w3.org/2000/svg"
|
|
@@ -113,91 +110,75 @@ import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
|
113
110
|
export class Checkbox implements ControlValueAccessor {
|
|
114
111
|
private readonly inputElement = viewChild<ElementRef<HTMLInputElement>>('inputElement');
|
|
115
112
|
|
|
116
|
-
/** The id for the checkbox input - used for label association */
|
|
117
|
-
readonly id = input<string>();
|
|
118
|
-
|
|
119
113
|
/** Whether the checkbox is checked (boolean) or indeterminate ('indeterminate') */
|
|
120
114
|
readonly checked = model<boolean | 'indeterminate'>(false);
|
|
121
115
|
|
|
116
|
+
/** The id for the checkbox input - used for label association */
|
|
117
|
+
readonly id = input<string>();
|
|
118
|
+
/** Additional CSS classes to apply */
|
|
119
|
+
readonly class = input<string>('');
|
|
122
120
|
/** Whether the checkbox is disabled via input */
|
|
123
121
|
readonly disabled = input<boolean>(false);
|
|
124
122
|
|
|
125
|
-
/** Whether the checkbox is disabled via forms */
|
|
126
|
-
private readonly formsDisabled = signal<boolean>(false);
|
|
127
|
-
|
|
128
123
|
/** Whether the checkbox is disabled (either via input or forms) */
|
|
129
|
-
readonly isDisabled = computed(() => this.disabled() || this.
|
|
124
|
+
readonly isDisabled = computed(() => this.disabled() || this.isFormsDisabled());
|
|
125
|
+
/** Computed class for the check icon with animation */
|
|
126
|
+
protected readonly checkIconClass = computed(() =>
|
|
127
|
+
cn(
|
|
128
|
+
'size-3.5 transition-all duration-200 ease-in-out',
|
|
129
|
+
this.checked() ? 'opacity-100 scale-100' : 'opacity-0 scale-0',
|
|
130
|
+
),
|
|
131
|
+
);
|
|
132
|
+
/** Computed class for the visual checkbox box */
|
|
133
|
+
protected readonly boxClass = computed(() =>
|
|
134
|
+
cn(
|
|
135
|
+
'peer-focus-visible:border-ring peer-focus-visible:ring-ring/50 peer-focus-visible:ring-[3px]',
|
|
136
|
+
'border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary',
|
|
137
|
+
'size-4 shrink-0 rounded-[4px] border shadow-xs transition-all duration-200 outline-none',
|
|
138
|
+
'inline-flex items-center justify-center cursor-pointer',
|
|
139
|
+
this.isDisabled() && 'cursor-not-allowed opacity-50',
|
|
140
|
+
),
|
|
141
|
+
);
|
|
142
|
+
/** Computed class combining base styles and custom classes */
|
|
143
|
+
protected readonly computedClass = computed(() => cn('relative inline-flex', this.class()));
|
|
130
144
|
|
|
131
|
-
/**
|
|
132
|
-
readonly
|
|
145
|
+
/** Whether the checkbox is disabled via forms */
|
|
146
|
+
private readonly isFormsDisabled = signal<boolean>(false);
|
|
133
147
|
|
|
134
148
|
/** ControlValueAccessor callbacks */
|
|
135
149
|
private onChange: (value: boolean | 'indeterminate') => void = () => {};
|
|
136
150
|
private onTouched: () => void = () => {};
|
|
137
151
|
|
|
138
|
-
/** Get the data-state attribute value */
|
|
139
|
-
getDataState(): string {
|
|
140
|
-
const state = this.checked();
|
|
141
|
-
if (state === true) return 'checked';
|
|
142
|
-
if (state === 'indeterminate') return 'indeterminate';
|
|
143
|
-
return 'unchecked';
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/** Toggle the checkbox state */
|
|
147
|
-
toggle() {
|
|
148
|
-
if (!this.isDisabled()) {
|
|
149
|
-
const current = this.checked();
|
|
150
|
-
// Cycle through: unchecked -> checked -> unchecked
|
|
151
|
-
const next = current === true ? false : true;
|
|
152
|
-
this.checked.set(next);
|
|
153
|
-
this.onChange(next);
|
|
154
|
-
this.onTouched();
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
152
|
// ControlValueAccessor implementation
|
|
159
153
|
writeValue(value: boolean | 'indeterminate'): void {
|
|
160
154
|
this.checked.set(value ?? false);
|
|
161
155
|
}
|
|
162
|
-
|
|
163
156
|
registerOnChange(fn: (value: boolean | 'indeterminate') => void): void {
|
|
164
157
|
this.onChange = fn;
|
|
165
158
|
}
|
|
166
|
-
|
|
167
159
|
registerOnTouched(fn: () => void): void {
|
|
168
160
|
this.onTouched = fn;
|
|
169
161
|
}
|
|
170
|
-
|
|
171
162
|
setDisabledState(isDisabled: boolean): void {
|
|
172
|
-
this.
|
|
163
|
+
this.isFormsDisabled.set(isDisabled);
|
|
173
164
|
}
|
|
174
165
|
|
|
175
|
-
/**
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
)
|
|
194
|
-
);
|
|
195
|
-
|
|
196
|
-
/** Computed class combining base styles and custom classes */
|
|
197
|
-
protected readonly computedClass = computed(() =>
|
|
198
|
-
cn(
|
|
199
|
-
'relative inline-flex',
|
|
200
|
-
this.class()
|
|
201
|
-
)
|
|
202
|
-
);
|
|
166
|
+
/** Toggle the checkbox state */
|
|
167
|
+
toggle(): void {
|
|
168
|
+
if (!this.isDisabled()) {
|
|
169
|
+
const current = this.checked();
|
|
170
|
+
// Cycle through: unchecked -> checked -> unchecked
|
|
171
|
+
const next = current === true ? false : true;
|
|
172
|
+
this.checked.set(next);
|
|
173
|
+
this.onChange(next);
|
|
174
|
+
this.onTouched();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/** Get the data-state attribute value */
|
|
178
|
+
getDataState(): string {
|
|
179
|
+
const state = this.checked();
|
|
180
|
+
if (state === true) return 'checked';
|
|
181
|
+
if (state === 'indeterminate') return 'indeterminate';
|
|
182
|
+
return 'unchecked';
|
|
183
|
+
}
|
|
203
184
|
}
|