@cognite/aura 0.3.5 → 1.46104.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/CHANGELOG.md +264 -0
- package/DESIGN.md +638 -281
- package/LICENSE +21 -0
- package/README.md +21 -13
- package/dist/colors-deprecated.css +587 -0
- package/dist/colors.css +803 -830
- package/dist/components/index.d.ts +63 -57
- package/dist/components/index.js +62 -59
- package/dist/components/index.js.map +1 -0
- package/dist/components/ui/core/accordion/accordion.d.ts +19 -18
- package/dist/components/ui/core/accordion/accordion.js +99 -78
- package/dist/components/ui/core/accordion/accordion.js.map +1 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar-motion.d.ts +8 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar-motion.js +125 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar-motion.js.map +1 -0
- package/dist/components/ui/core/action-toolbar/action-toolbar.d.ts +31 -31
- package/dist/components/ui/core/action-toolbar/action-toolbar.js +156 -106
- package/dist/components/ui/core/action-toolbar/action-toolbar.js.map +1 -0
- package/dist/components/ui/core/alert/alert.d.ts +25 -25
- package/dist/components/ui/core/alert/alert.js +181 -152
- package/dist/components/ui/core/alert/alert.js.map +1 -0
- package/dist/components/ui/core/avatar/avatar.d.ts +10 -9
- package/dist/components/ui/core/avatar/avatar.js +75 -65
- package/dist/components/ui/core/avatar/avatar.js.map +1 -0
- package/dist/components/ui/core/badge/badge.d.ts +13 -12
- package/dist/components/ui/core/badge/badge.js +88 -72
- package/dist/components/ui/core/badge/badge.js.map +1 -0
- package/dist/components/ui/core/banner/banner.d.ts +18 -18
- package/dist/components/ui/core/banner/banner.js +179 -142
- package/dist/components/ui/core/banner/banner.js.map +1 -0
- package/dist/components/ui/core/breadcrumb/breadcrumb.d.ts +12 -12
- package/dist/components/ui/core/breadcrumb/breadcrumb.js +139 -104
- package/dist/components/ui/core/breadcrumb/breadcrumb.js.map +1 -0
- package/dist/components/ui/core/button/button.d.ts +7 -7
- package/dist/components/ui/core/button/button.gallery.d.ts +2 -0
- package/dist/components/ui/core/button/button.gallery.js +76 -0
- package/dist/components/ui/core/button/button.gallery.js.map +1 -0
- package/dist/components/ui/core/button/button.js +57 -47
- package/dist/components/ui/core/button/button.js.map +1 -0
- package/dist/components/ui/core/button-group/button-group.d.ts +9 -9
- package/dist/components/ui/core/button-group/button-group.js +50 -40
- package/dist/components/ui/core/button-group/button-group.js.map +1 -0
- package/dist/components/ui/core/calendar/calendar-header.d.ts +7 -7
- package/dist/components/ui/core/calendar/calendar-header.js +102 -63
- package/dist/components/ui/core/calendar/calendar-header.js.map +1 -0
- package/dist/components/ui/core/calendar/calendar-utils.d.ts +30 -30
- package/dist/components/ui/core/calendar/calendar-utils.js +116 -39
- package/dist/components/ui/core/calendar/calendar-utils.js.map +1 -0
- package/dist/components/ui/core/calendar/calendar.d.ts +10 -10
- package/dist/components/ui/core/calendar/calendar.js +95 -66
- package/dist/components/ui/core/calendar/calendar.js.map +1 -0
- package/dist/components/ui/core/calendar/constants.js +3 -0
- package/dist/components/ui/core/calendar/constants.js.map +1 -0
- package/dist/components/ui/core/card/card.d.ts +20 -20
- package/dist/components/ui/core/card/card.js +133 -104
- package/dist/components/ui/core/card/card.js.map +1 -0
- package/dist/components/ui/core/chart/chart.d.ts +55 -53
- package/dist/components/ui/core/chart/chart.js +196 -116
- package/dist/components/ui/core/chart/chart.js.map +1 -0
- package/dist/components/ui/core/chart/index.d.ts +2 -2
- package/dist/components/ui/core/chart/index.js +3 -2
- package/dist/components/ui/core/chart/index.js.map +1 -0
- package/dist/components/ui/core/checkbox/checkbox.d.ts +9 -9
- package/dist/components/ui/core/checkbox/checkbox.js +88 -68
- package/dist/components/ui/core/checkbox/checkbox.js.map +1 -0
- package/dist/components/ui/core/checkbox/checkbox.metadata.d.ts +1 -1
- package/dist/components/ui/core/checkbox/checkbox.metadata.js +6 -7
- package/dist/components/ui/core/checkbox/checkbox.metadata.js.map +1 -0
- package/dist/components/ui/core/code-block/code-block.d.ts +19 -19
- package/dist/components/ui/core/code-block/code-block.js +259 -175
- package/dist/components/ui/core/code-block/code-block.js.map +1 -0
- package/dist/components/ui/core/collapsible/collapsible.d.ts +5 -5
- package/dist/components/ui/core/collapsible/collapsible.js +36 -30
- package/dist/components/ui/core/collapsible/collapsible.js.map +1 -0
- package/dist/components/ui/core/combobox/combobox.d.ts +13 -13
- package/dist/components/ui/core/combobox/combobox.js +89 -40
- package/dist/components/ui/core/combobox/combobox.js.map +1 -0
- package/dist/components/ui/core/command/command.d.ts +20 -18
- package/dist/components/ui/core/command/command.js +137 -85
- package/dist/components/ui/core/command/command.js.map +1 -0
- package/dist/components/ui/core/conversation/conversation.d.ts +14 -0
- package/dist/components/ui/core/conversation/conversation.js +51 -0
- package/dist/components/ui/core/conversation/conversation.js.map +1 -0
- package/dist/components/ui/core/count/count.d.ts +8 -6
- package/dist/components/ui/core/count/count.js +51 -21
- package/dist/components/ui/core/count/count.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-cell.d.ts +7 -7
- package/dist/components/ui/core/data-grid/data-grid-cell.js +22 -22
- package/dist/components/ui/core/data-grid/data-grid-cell.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-clauses.d.ts +14 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-clauses.js +36 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-clauses.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-panel.d.ts +41 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-panel.js +273 -0
- package/dist/components/ui/core/data-grid/data-grid-filter-panel.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-footer.d.ts +6 -0
- package/dist/components/ui/core/data-grid/data-grid-footer.js +34 -0
- package/dist/components/ui/core/data-grid/data-grid-footer.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-header-row.d.ts +10 -10
- package/dist/components/ui/core/data-grid/data-grid-header-row.js +69 -55
- package/dist/components/ui/core/data-grid/data-grid-header-row.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-header.d.ts +11 -0
- package/dist/components/ui/core/data-grid/data-grid-header.js +67 -0
- package/dist/components/ui/core/data-grid/data-grid-header.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid-row.d.ts +15 -15
- package/dist/components/ui/core/data-grid/data-grid-row.js +104 -76
- package/dist/components/ui/core/data-grid/data-grid-row.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid.d.ts +85 -35
- package/dist/components/ui/core/data-grid/data-grid.fixtures.d.ts +7 -7
- package/dist/components/ui/core/data-grid/data-grid.fixtures.js +139 -0
- package/dist/components/ui/core/data-grid/data-grid.fixtures.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid.js +402 -132
- package/dist/components/ui/core/data-grid/data-grid.js.map +1 -0
- package/dist/components/ui/core/data-grid/data-grid.utils.d.ts +3 -3
- package/dist/components/ui/core/data-grid/data-grid.utils.js +44 -33
- package/dist/components/ui/core/data-grid/data-grid.utils.js.map +1 -0
- package/dist/components/ui/core/data-grid/index.d.ts +4 -1
- package/dist/components/ui/core/data-grid/index.js +5 -2
- package/dist/components/ui/core/data-grid/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.d.ts +11 -13
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js +85 -61
- package/dist/components/ui/core/date-time-pickers/date-picker/date-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/types.d.ts +14 -14
- package/dist/components/ui/core/date-time-pickers/date-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js +51 -36
- package/dist/components/ui/core/date-time-pickers/date-picker/use-date-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.d.ts +11 -13
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js +89 -64
- package/dist/components/ui/core/date-time-pickers/date-range-picker/date-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.d.ts +20 -20
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.d.ts +4 -4
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js +95 -60
- package/dist/components/ui/core/date-time-pickers/date-range-picker/use-date-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.d.ts +15 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.js +120 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/date-time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.d.ts +3 -1
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.d.ts +25 -32
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.js +78 -0
- package/dist/components/ui/core/date-time-pickers/date-time-picker/use-date-time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.d.ts +13 -15
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js +165 -119
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/date-time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.d.ts +37 -37
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js +163 -104
- package/dist/components/ui/core/date-time-pickers/date-time-range-picker/use-date-time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/index.d.ts +17 -12
- package/dist/components/ui/core/date-time-pickers/index.js +10 -6
- package/dist/components/ui/core/date-time-pickers/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js +52 -42
- package/dist/components/ui/core/date-time-pickers/shared/am-pm-scroll/am-pm-scroll.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/constants.d.ts +6 -1
- package/dist/components/ui/core/date-time-pickers/shared/constants.js +23 -0
- package/dist/components/ui/core/date-time-pickers/shared/constants.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.d.ts +16 -15
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js +87 -64
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/date-time-input.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.d.ts +10 -9
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js +89 -38
- package/dist/components/ui/core/date-time-pickers/shared/date-time-input/range-input-display.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js +34 -23
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-popover-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.d.ts +23 -23
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js +95 -52
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-date-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js +22 -18
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-range-step-manager.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.d.ts +19 -19
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js +41 -24
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-single-date-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.d.ts +13 -13
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js +33 -24
- package/dist/components/ui/core/date-time-pickers/shared/hooks/use-time-state.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.d.ts +5 -5
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js +9 -4
- package/dist/components/ui/core/date-time-pickers/shared/scroll-cell-classes.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.d.ts +13 -9
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js +22 -17
- package/dist/components/ui/core/date-time-pickers/shared/shortcuts-panel/shortcuts-panel.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.d.ts +13 -13
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js +49 -40
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-panel/time-picker-panel.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.d.ts +7 -7
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js +41 -34
- package/dist/components/ui/core/date-time-pickers/shared/time-picker-scroll/time-picker-scroll.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/index.d.ts +3 -3
- package/dist/components/ui/core/date-time-pickers/time-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.d.ts +12 -14
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js +99 -79
- package/dist/components/ui/core/date-time-pickers/time-picker/time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/types.d.ts +20 -20
- package/dist/components/ui/core/date-time-pickers/time-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js +63 -41
- package/dist/components/ui/core/date-time-pickers/time-picker/use-time-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.d.ts +3 -1
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/index.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.d.ts +14 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.js +115 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.d.ts +30 -36
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.js +3 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/types.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.d.ts +2 -2
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.js +145 -0
- package/dist/components/ui/core/date-time-pickers/time-range-picker/use-time-range-picker.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-input.d.ts +56 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-input.js +67 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-input.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.d.ts +18 -18
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.js +42 -0
- package/dist/components/ui/core/date-time-pickers/utils/date-range-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.d.ts +31 -29
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.js +56 -0
- package/dist/components/ui/core/date-time-pickers/utils/format-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.d.ts +21 -21
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.js +170 -0
- package/dist/components/ui/core/date-time-pickers/utils/segment-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.d.ts +28 -28
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js +88 -7
- package/dist/components/ui/core/date-time-pickers/utils/time-utils.js.map +1 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.d.ts +17 -17
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.js +43 -0
- package/dist/components/ui/core/date-time-pickers/utils/time-validation.js.map +1 -0
- package/dist/components/ui/core/dialog/dialog.d.ts +12 -9
- package/dist/components/ui/core/dialog/dialog.js +90 -82
- package/dist/components/ui/core/dialog/dialog.js.map +1 -0
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.d.ts +22 -19
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js +204 -149
- package/dist/components/ui/core/dropdown-menu/dropdown-menu.js.map +1 -0
- package/dist/components/ui/core/empty-state/empty-state.context.d.ts +4 -4
- package/dist/components/ui/core/empty-state/empty-state.context.js +8 -5
- package/dist/components/ui/core/empty-state/empty-state.context.js.map +1 -0
- package/dist/components/ui/core/empty-state/empty-state.d.ts +14 -14
- package/dist/components/ui/core/empty-state/empty-state.js +96 -82
- package/dist/components/ui/core/empty-state/empty-state.js.map +1 -0
- package/dist/components/ui/core/helper-text/helper-text.d.ts +7 -7
- package/dist/components/ui/core/helper-text/helper-text.js +55 -36
- package/dist/components/ui/core/helper-text/helper-text.js.map +1 -0
- package/dist/components/ui/core/hover-card/hover-card.d.ts +7 -6
- package/dist/components/ui/core/hover-card/hover-card.js +56 -52
- package/dist/components/ui/core/hover-card/hover-card.js.map +1 -0
- package/dist/components/ui/core/inline-citation/inline-citation.d.ts +26 -25
- package/dist/components/ui/core/inline-citation/inline-citation.js +121 -97
- package/dist/components/ui/core/inline-citation/inline-citation.js.map +1 -0
- package/dist/components/ui/core/input/input.d.ts +2 -2
- package/dist/components/ui/core/input/input.js +15 -13
- package/dist/components/ui/core/input/input.js.map +1 -0
- package/dist/components/ui/core/input-group/input-group.d.ts +25 -14
- package/dist/components/ui/core/input-group/input-group.js +149 -76
- package/dist/components/ui/core/input-group/input-group.js.map +1 -0
- package/dist/components/ui/core/item/item.d.ts +20 -0
- package/dist/components/ui/core/item/item.js +93 -0
- package/dist/components/ui/core/item/item.js.map +1 -0
- package/dist/components/ui/core/kbd/kbd.d.ts +3 -3
- package/dist/components/ui/core/kbd/kbd.js +24 -20
- package/dist/components/ui/core/kbd/kbd.js.map +1 -0
- package/dist/components/ui/core/label/label.d.ts +3 -3
- package/dist/components/ui/core/label/label.js +33 -26
- package/dist/components/ui/core/label/label.js.map +1 -0
- package/dist/components/ui/core/loader/loader.d.ts +6 -6
- package/dist/components/ui/core/loader/loader.js +97 -80
- package/dist/components/ui/core/loader/loader.js.map +1 -0
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.d.ts +9 -9
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js +19 -12
- package/dist/components/ui/core/message/message-response-default-streamdown-controls.js.map +1 -0
- package/dist/components/ui/core/message/message-response-math-plugin.d.ts +3 -0
- package/dist/components/ui/core/message/message-response-math-plugin.js +6 -0
- package/dist/components/ui/core/message/message-response-math-plugin.js.map +1 -0
- package/dist/components/ui/core/message/message.d.ts +27 -23
- package/dist/components/ui/core/message/message.js +453 -316
- package/dist/components/ui/core/message/message.js.map +1 -0
- package/dist/components/ui/core/overflow-list/overflow-list.d.ts +21 -0
- package/dist/components/ui/core/overflow-list/overflow-list.js +197 -0
- package/dist/components/ui/core/overflow-list/overflow-list.js.map +1 -0
- package/dist/components/ui/core/overflow-list/overflow-list.utils.d.ts +37 -35
- package/dist/components/ui/core/overflow-list/overflow-list.utils.js +206 -0
- package/dist/components/ui/core/overflow-list/overflow-list.utils.js.map +1 -0
- package/dist/components/ui/core/pagination/pagination-size-context.d.ts +2 -2
- package/dist/components/ui/core/pagination/pagination-size-context.js +6 -5
- package/dist/components/ui/core/pagination/pagination-size-context.js.map +1 -0
- package/dist/components/ui/core/pagination/pagination-teleport.d.ts +9 -9
- package/dist/components/ui/core/pagination/pagination-teleport.js +127 -84
- package/dist/components/ui/core/pagination/pagination-teleport.js.map +1 -0
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js +6 -6
- package/dist/components/ui/core/pagination/pagination-teleport.utils.js.map +1 -0
- package/dist/components/ui/core/pagination/pagination.d.ts +39 -39
- package/dist/components/ui/core/pagination/pagination.js +294 -234
- package/dist/components/ui/core/pagination/pagination.js.map +1 -0
- package/dist/components/ui/core/popover/popover.d.ts +12 -11
- package/dist/components/ui/core/popover/popover.js +104 -89
- package/dist/components/ui/core/popover/popover.js.map +1 -0
- package/dist/components/ui/core/progress/progress.d.ts +9 -8
- package/dist/components/ui/core/progress/progress.js +50 -35
- package/dist/components/ui/core/progress/progress.js.map +1 -0
- package/dist/components/ui/core/prompt-input/prompt-input.d.ts +27 -27
- package/dist/components/ui/core/prompt-input/prompt-input.js +342 -271
- package/dist/components/ui/core/prompt-input/prompt-input.js.map +1 -0
- package/dist/components/ui/core/radio-group/radio-group.d.ts +12 -12
- package/dist/components/ui/core/radio-group/radio-group.js +88 -58
- package/dist/components/ui/core/radio-group/radio-group.js.map +1 -0
- package/dist/components/ui/core/reasoning/reasoning.d.ts +7 -7
- package/dist/components/ui/core/reasoning/reasoning.js +68 -56
- package/dist/components/ui/core/reasoning/reasoning.js.map +1 -0
- package/dist/components/ui/core/scroll-area/scroll-area.d.ts +4 -4
- package/dist/components/ui/core/scroll-area/scroll-area.js +50 -40
- package/dist/components/ui/core/scroll-area/scroll-area.js.map +1 -0
- package/dist/components/ui/core/search/search.d.ts +8 -8
- package/dist/components/ui/core/search/search.js +122 -76
- package/dist/components/ui/core/search/search.js.map +1 -0
- package/dist/components/ui/core/segmented-control/segmented-control.d.ts +10 -10
- package/dist/components/ui/core/segmented-control/segmented-control.js +203 -149
- package/dist/components/ui/core/segmented-control/segmented-control.js.map +1 -0
- package/dist/components/ui/core/select/select.d.ts +27 -26
- package/dist/components/ui/core/select/select.js +213 -168
- package/dist/components/ui/core/select/select.js.map +1 -0
- package/dist/components/ui/core/separator/separator.d.ts +2 -2
- package/dist/components/ui/core/separator/separator.js +13 -13
- package/dist/components/ui/core/separator/separator.js.map +1 -0
- package/dist/components/ui/core/shimmer/shimmer.d.ts +8 -8
- package/dist/components/ui/core/shimmer/shimmer.js +64 -40
- package/dist/components/ui/core/shimmer/shimmer.js.map +1 -0
- package/dist/components/ui/core/skeleton/skeleton.d.ts +2 -2
- package/dist/components/ui/core/skeleton/skeleton.js +13 -13
- package/dist/components/ui/core/skeleton/skeleton.js.map +1 -0
- package/dist/components/ui/core/slider/slider.d.ts +7 -7
- package/dist/components/ui/core/slider/slider.js +51 -39
- package/dist/components/ui/core/slider/slider.js.map +1 -0
- package/dist/components/ui/core/sonner-toast/sonner-toast.d.ts +2 -2
- package/dist/components/ui/core/sonner-toast/sonner-toast.js +67 -54
- package/dist/components/ui/core/sonner-toast/sonner-toast.js.map +1 -0
- package/dist/components/ui/core/sources/sources.d.ts +12 -12
- package/dist/components/ui/core/sources/sources.js +87 -58
- package/dist/components/ui/core/sources/sources.js.map +1 -0
- package/dist/components/ui/core/switch/switch.d.ts +9 -9
- package/dist/components/ui/core/switch/switch.js +83 -61
- package/dist/components/ui/core/switch/switch.js.map +1 -0
- package/dist/components/ui/core/switch/switch.metadata.d.ts +1 -1
- package/dist/components/ui/core/switch/switch.metadata.js +8 -0
- package/dist/components/ui/core/switch/switch.metadata.js.map +1 -0
- package/dist/components/ui/core/tabs/tabs.d.ts +20 -18
- package/dist/components/ui/core/tabs/tabs.js +176 -147
- package/dist/components/ui/core/tabs/tabs.js.map +1 -0
- package/dist/components/ui/core/tabs/tabs.utils.d.ts +1 -1
- package/dist/components/ui/core/tabs/tabs.utils.js +10 -6
- package/dist/components/ui/core/tabs/tabs.utils.js.map +1 -0
- package/dist/components/ui/core/textarea/textarea.d.ts +2 -2
- package/dist/components/ui/core/textarea/textarea.js +13 -13
- package/dist/components/ui/core/textarea/textarea.js.map +1 -0
- package/dist/components/ui/core/toggle/toggle.d.ts +9 -9
- package/dist/components/ui/core/toggle/toggle.js +60 -54
- package/dist/components/ui/core/toggle/toggle.js.map +1 -0
- package/dist/components/ui/core/tool/tool.d.ts +18 -18
- package/dist/components/ui/core/tool/tool.js +167 -126
- package/dist/components/ui/core/tool/tool.js.map +1 -0
- package/dist/components/ui/core/toolbar/toolbar.d.ts +37 -0
- package/dist/components/ui/core/toolbar/toolbar.js +171 -0
- package/dist/components/ui/core/toolbar/toolbar.js.map +1 -0
- package/dist/components/ui/core/tooltip/tooltip.d.ts +8 -7
- package/dist/components/ui/core/tooltip/tooltip.js +53 -46
- package/dist/components/ui/core/tooltip/tooltip.js.map +1 -0
- package/dist/components/ui/core/topbar/topbar.d.ts +26 -26
- package/dist/components/ui/core/topbar/topbar.js +160 -105
- package/dist/components/ui/core/topbar/topbar.js.map +1 -0
- package/dist/components/ui/core/tree/tree.d.ts +20 -0
- package/dist/components/ui/core/tree/tree.js +100 -0
- package/dist/components/ui/core/tree/tree.js.map +1 -0
- package/dist/eslint/index.d.ts +5 -5
- package/dist/eslint/index.js +9 -5
- package/dist/eslint/index.js.map +1 -0
- package/dist/eslint/no-overriding-styles.d.ts +1 -1
- package/dist/eslint/no-overriding-styles.js +341 -201
- package/dist/eslint/no-overriding-styles.js.map +1 -0
- package/dist/icons/index.d.ts +1 -1
- package/dist/icons/index.js +2 -0
- package/dist/icons/index.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/ai/types.d.ts +43 -43
- package/dist/lib/ai/types.js +3 -0
- package/dist/lib/ai/types.js.map +1 -0
- package/dist/lib/decorative-variant-classes.d.ts +53 -0
- package/dist/lib/decorative-variant-classes.js +58 -0
- package/dist/lib/decorative-variant-classes.js.map +1 -0
- package/dist/lib/highlight-code.d.ts +11 -8
- package/dist/lib/highlight-code.js +58 -40
- package/dist/lib/highlight-code.js.map +1 -0
- package/dist/lib/portal-container-context.d.ts +1 -1
- package/dist/lib/portal-container-context.js +8 -8
- package/dist/lib/portal-container-context.js.map +1 -0
- package/dist/lib/shared-theme-from-url.d.ts +13 -0
- package/dist/lib/shared-theme-from-url.js +61 -0
- package/dist/lib/shared-theme-from-url.js.map +1 -0
- package/dist/lib/style-scope.d.ts +2 -2
- package/dist/lib/style-scope.js +6 -6
- package/dist/lib/style-scope.js.map +1 -0
- package/dist/lib/theme-share-url.d.ts +31 -0
- package/dist/lib/theme-share-url.js +116 -0
- package/dist/lib/theme-share-url.js.map +1 -0
- package/dist/lib/types.d.ts +39 -39
- package/dist/lib/types.js +3 -0
- package/dist/lib/types.js.map +1 -0
- package/dist/lib/use-controllable-state.d.ts +4 -7
- package/dist/lib/use-controllable-state.js +34 -21
- package/dist/lib/use-controllable-state.js.map +1 -0
- package/dist/lib/utils.d.ts +63 -34
- package/dist/lib/utils.js +134 -32
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles.css +2 -1
- package/dist/styles.source.css +24 -12
- package/dist/utils/assign-ref.d.ts +3 -0
- package/dist/utils/assign-ref.js +13 -0
- package/dist/utils/assign-ref.js.map +1 -0
- package/package.json +46 -11
- package/src/components/ui/core/button/button.md +93 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ColumnDef } from
|
|
1
|
+
import type { ColumnDef } from "@tanstack/react-table";
|
|
2
2
|
declare const PINNED_COLUMN_Z_INDEX = 10;
|
|
3
|
-
declare function getAriaSort(sortDirection: false |
|
|
3
|
+
declare function getAriaSort(sortDirection: false | "asc" | "desc", canSort: boolean): "ascending" | "descending" | "none" | undefined;
|
|
4
4
|
declare function getTextValue(value: unknown): string | undefined;
|
|
5
5
|
declare function isAccessorColumn<TData>(def: ColumnDef<TData>): boolean;
|
|
6
6
|
declare function isFromIgnoredCellTarget(target?: EventTarget | null): boolean;
|
|
7
7
|
declare function isFromExpandToggleTarget(target?: EventTarget | null): boolean;
|
|
8
8
|
declare function collectCustomCellColumnIds<TData>(columns: ColumnDef<TData>[]): Set<string>;
|
|
9
|
-
export { PINNED_COLUMN_Z_INDEX, collectCustomCellColumnIds, getAriaSort, getTextValue, isAccessorColumn, isFromExpandToggleTarget, isFromIgnoredCellTarget
|
|
9
|
+
export { PINNED_COLUMN_Z_INDEX, collectCustomCellColumnIds, getAriaSort, getTextValue, isAccessorColumn, isFromExpandToggleTarget, isFromIgnoredCellTarget };
|
|
@@ -1,40 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
function
|
|
3
|
-
|
|
1
|
+
const PINNED_COLUMN_Z_INDEX = 10;
|
|
2
|
+
function getAriaSort(sortDirection, canSort) {
|
|
3
|
+
if (sortDirection === 'asc') return 'ascending';
|
|
4
|
+
if (sortDirection === 'desc') return 'descending';
|
|
5
|
+
return canSort ? 'none' : undefined;
|
|
4
6
|
}
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
+
function getTextValue(value) {
|
|
8
|
+
if (typeof value === 'string' || typeof value === 'number') {
|
|
9
|
+
return String(value);
|
|
10
|
+
}
|
|
11
|
+
return undefined;
|
|
7
12
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
function isAccessorColumn(def) {
|
|
14
|
+
const hasAccessorKey = 'accessorKey' in def && def.accessorKey !== undefined;
|
|
15
|
+
const hasAccessorFn = 'accessorFn' in def && def.accessorFn !== undefined;
|
|
16
|
+
return hasAccessorKey || hasAccessorFn;
|
|
11
17
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
18
|
+
function isFromIgnoredCellTarget(target) {
|
|
19
|
+
return target instanceof Element ? Boolean(target.closest('[data-row-activation="ignore"]')) : false;
|
|
14
20
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
21
|
+
function isFromExpandToggleTarget(target) {
|
|
22
|
+
return target instanceof Element ? Boolean(target.closest('[data-row-expand-toggle="true"]')) : false;
|
|
17
23
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
function collectCustomCellColumnIds(columns) {
|
|
25
|
+
const ids = new Set();
|
|
26
|
+
const visit = (defs)=>{
|
|
27
|
+
for (const def of defs){
|
|
28
|
+
if (hasNestedColumns(def)) {
|
|
29
|
+
visit(def.columns);
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
const hasOwnCellRenderer = Object.prototype.hasOwnProperty.call(def, 'cell');
|
|
33
|
+
if (!hasOwnCellRenderer) continue;
|
|
34
|
+
if ('id' in def && typeof def.id === 'string') {
|
|
35
|
+
ids.add(def.id);
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
if ('accessorKey' in def && typeof def.accessorKey === 'string') {
|
|
39
|
+
ids.add(def.accessorKey);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
visit(columns);
|
|
44
|
+
return ids;
|
|
35
45
|
}
|
|
36
|
-
function
|
|
37
|
-
|
|
46
|
+
function hasNestedColumns(def) {
|
|
47
|
+
return 'columns' in def && Array.isArray(def.columns);
|
|
38
48
|
}
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
export { PINNED_COLUMN_Z_INDEX, collectCustomCellColumnIds, getAriaSort, getTextValue, isAccessorColumn, isFromExpandToggleTarget, isFromIgnoredCellTarget };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=data-grid.utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/data-grid/data-grid.utils.ts"],"sourcesContent":["import type { ColumnDef } from '@tanstack/react-table';\n\nconst PINNED_COLUMN_Z_INDEX = 10;\n\nfunction getAriaSort(\n sortDirection: false | 'asc' | 'desc',\n canSort: boolean\n): 'ascending' | 'descending' | 'none' | undefined {\n if (sortDirection === 'asc') return 'ascending';\n if (sortDirection === 'desc') return 'descending';\n return canSort ? 'none' : undefined;\n}\n\nfunction getTextValue(value: unknown): string | undefined {\n if (typeof value === 'string' || typeof value === 'number') {\n return String(value);\n }\n return undefined;\n}\n\nfunction isAccessorColumn<TData>(def: ColumnDef<TData>): boolean {\n const hasAccessorKey = 'accessorKey' in def && def.accessorKey !== undefined;\n const hasAccessorFn = 'accessorFn' in def && def.accessorFn !== undefined;\n return hasAccessorKey || hasAccessorFn;\n}\n\nfunction isFromIgnoredCellTarget(target?: EventTarget | null): boolean {\n return target instanceof Element\n ? Boolean(target.closest('[data-row-activation=\"ignore\"]'))\n : false;\n}\n\nfunction isFromExpandToggleTarget(target?: EventTarget | null): boolean {\n return target instanceof Element\n ? Boolean(target.closest('[data-row-expand-toggle=\"true\"]'))\n : false;\n}\n\nfunction collectCustomCellColumnIds<TData>(\n columns: ColumnDef<TData>[]\n): Set<string> {\n const ids = new Set<string>();\n\n const visit = (defs: ColumnDef<TData>[]) => {\n for (const def of defs) {\n if (hasNestedColumns(def)) {\n visit(def.columns);\n continue;\n }\n\n const hasOwnCellRenderer = Object.prototype.hasOwnProperty.call(\n def,\n 'cell'\n );\n if (!hasOwnCellRenderer) continue;\n\n if ('id' in def && typeof def.id === 'string') {\n ids.add(def.id);\n continue;\n }\n\n if ('accessorKey' in def && typeof def.accessorKey === 'string') {\n ids.add(def.accessorKey);\n }\n }\n };\n\n visit(columns);\n return ids;\n}\n\nfunction hasNestedColumns<TData>(\n def: ColumnDef<TData>\n): def is ColumnDef<TData> & { columns: ColumnDef<TData>[] } {\n return 'columns' in def && Array.isArray(def.columns);\n}\n\nexport {\n PINNED_COLUMN_Z_INDEX,\n collectCustomCellColumnIds,\n getAriaSort,\n getTextValue,\n isAccessorColumn,\n isFromExpandToggleTarget,\n isFromIgnoredCellTarget,\n};\n"],"names":["PINNED_COLUMN_Z_INDEX","getAriaSort","sortDirection","canSort","undefined","getTextValue","value","String","isAccessorColumn","def","hasAccessorKey","accessorKey","hasAccessorFn","accessorFn","isFromIgnoredCellTarget","target","Element","Boolean","closest","isFromExpandToggleTarget","collectCustomCellColumnIds","columns","ids","Set","visit","defs","hasNestedColumns","hasOwnCellRenderer","Object","prototype","hasOwnProperty","call","id","add","Array","isArray"],"mappings":"AAEA,MAAMA,wBAAwB;AAE9B,SAASC,YACPC,aAAqC,EACrCC,OAAgB;IAEhB,IAAID,kBAAkB,OAAO,OAAO;IACpC,IAAIA,kBAAkB,QAAQ,OAAO;IACrC,OAAOC,UAAU,SAASC;AAC5B;AAEA,SAASC,aAAaC,KAAc;IAClC,IAAI,OAAOA,UAAU,YAAY,OAAOA,UAAU,UAAU;QAC1D,OAAOC,OAAOD;IAChB;IACA,OAAOF;AACT;AAEA,SAASI,iBAAwBC,GAAqB;IACpD,MAAMC,iBAAiB,iBAAiBD,OAAOA,IAAIE,WAAW,KAAKP;IACnE,MAAMQ,gBAAgB,gBAAgBH,OAAOA,IAAII,UAAU,KAAKT;IAChE,OAAOM,kBAAkBE;AAC3B;AAEA,SAASE,wBAAwBC,MAA2B;IAC1D,OAAOA,kBAAkBC,UACrBC,QAAQF,OAAOG,OAAO,CAAC,qCACvB;AACN;AAEA,SAASC,yBAAyBJ,MAA2B;IAC3D,OAAOA,kBAAkBC,UACrBC,QAAQF,OAAOG,OAAO,CAAC,sCACvB;AACN;AAEA,SAASE,2BACPC,OAA2B;IAE3B,MAAMC,MAAM,IAAIC;IAEhB,MAAMC,QAAQ,CAACC;QACb,KAAK,MAAMhB,OAAOgB,KAAM;YACtB,IAAIC,iBAAiBjB,MAAM;gBACzBe,MAAMf,IAAIY,OAAO;gBACjB;YACF;YAEA,MAAMM,qBAAqBC,OAAOC,SAAS,CAACC,cAAc,CAACC,IAAI,CAC7DtB,KACA;YAEF,IAAI,CAACkB,oBAAoB;YAEzB,IAAI,QAAQlB,OAAO,OAAOA,IAAIuB,EAAE,KAAK,UAAU;gBAC7CV,IAAIW,GAAG,CAACxB,IAAIuB,EAAE;gBACd;YACF;YAEA,IAAI,iBAAiBvB,OAAO,OAAOA,IAAIE,WAAW,KAAK,UAAU;gBAC/DW,IAAIW,GAAG,CAACxB,IAAIE,WAAW;YACzB;QACF;IACF;IAEAa,MAAMH;IACN,OAAOC;AACT;AAEA,SAASI,iBACPjB,GAAqB;IAErB,OAAO,aAAaA,OAAOyB,MAAMC,OAAO,CAAC1B,IAAIY,OAAO;AACtD;AAEA,SACErB,qBAAqB,EACrBoB,0BAA0B,EAC1BnB,WAAW,EACXI,YAAY,EACZG,gBAAgB,EAChBW,wBAAwB,EACxBL,uBAAuB,GACvB"}
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { ColumnDef, PaginationState } from "@tanstack/react-table";
|
|
2
|
+
export { DataGrid, DataGridFilterTrigger, DataGridResultCountBadge, DataGridSearch, useDataGridContext, type DataGridContextValue, type DataGridHandle } from "./data-grid";
|
|
3
|
+
export { applyDataGridFilterClauses, matchesDataGridFilterClause, type DataGridFilterClause, type DataGridFilterJoin, type DataGridFilterOperator } from "./data-grid-filter-clauses";
|
|
4
|
+
export { DataGridFilterPanel, type DataGridFilterColumn, type DataGridFilterPanelLabels } from "./data-grid-filter-panel";
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
1
|
+
export { DataGrid, DataGridFilterTrigger, DataGridResultCountBadge, DataGridSearch, useDataGridContext } from "./data-grid.js";
|
|
2
|
+
export { applyDataGridFilterClauses, matchesDataGridFilterClause } from "./data-grid-filter-clauses.js";
|
|
3
|
+
export { DataGridFilterPanel } from "./data-grid-filter-panel.js";
|
|
4
|
+
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/ui/core/data-grid/index.ts"],"sourcesContent":["export type { ColumnDef, PaginationState } from '@tanstack/react-table';\nexport {\n DataGrid,\n DataGridFilterTrigger,\n DataGridResultCountBadge,\n DataGridSearch,\n useDataGridContext,\n type DataGridContextValue,\n type DataGridHandle,\n} from './data-grid';\nexport {\n applyDataGridFilterClauses,\n matchesDataGridFilterClause,\n type DataGridFilterClause,\n type DataGridFilterJoin,\n type DataGridFilterOperator,\n} from './data-grid-filter-clauses';\nexport {\n DataGridFilterPanel,\n type DataGridFilterColumn,\n type DataGridFilterPanelLabels,\n} from './data-grid-filter-panel';\n"],"names":["DataGrid","DataGridFilterTrigger","DataGridResultCountBadge","DataGridSearch","useDataGridContext","applyDataGridFilterClauses","matchesDataGridFilterClause","DataGridFilterPanel"],"mappings":"AACA,SACEA,QAAQ,EACRC,qBAAqB,EACrBC,wBAAwB,EACxBC,cAAc,EACdC,kBAAkB,QAGb,iBAAc;AACrB,SACEC,0BAA0B,EAC1BC,2BAA2B,QAItB,gCAA6B;AACpC,SACEC,mBAAmB,QAGd,8BAA2B"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Dayjs } from
|
|
3
|
-
import { ShortcutItem } from
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { Dayjs } from "dayjs";
|
|
3
|
+
import type { ShortcutItem } from "../shared/shortcuts-panel/shortcuts-panel";
|
|
4
|
+
import { type DateInput, type DateValueProps } from "../utils/date-input";
|
|
4
5
|
export type { ShortcutItem };
|
|
5
|
-
export interface DatePickerProps {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
shortcuts?: ShortcutItem[];
|
|
12
|
-
defaultDate?: Dayjs;
|
|
13
|
-
className?: string;
|
|
6
|
+
export interface DatePickerProps<T extends DateInput = Dayjs> extends DateValueProps<T> {
|
|
7
|
+
format?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
displayWeekNumber?: boolean;
|
|
10
|
+
shortcuts?: ShortcutItem[];
|
|
11
|
+
className?: string;
|
|
14
12
|
}
|
|
15
|
-
export declare
|
|
13
|
+
export declare function DatePicker<T extends DateInput = Dayjs>({ value, onChange, format, placeholder, displayWeekNumber, shortcuts, defaultDate, valueType, className }: DatePickerProps<T>): JSX.Element;
|
|
@@ -1,61 +1,85 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { Calendar
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../../../lib/utils.js";
|
|
3
|
+
import { Calendar } from "../../calendar/calendar.js";
|
|
4
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../popover/popover.js";
|
|
5
|
+
import { DateTimeInput } from "../shared/date-time-input/date-time-input.js";
|
|
6
|
+
import { ShortcutsPanel } from "../shared/shortcuts-panel/shortcuts-panel.js";
|
|
7
|
+
import { normalizeIn, normalizeOut, normalizeShortcutValue, resolveValueType } from "../utils/date-input.js";
|
|
8
|
+
import { useDatePicker } from "./use-date-picker.js";
|
|
9
|
+
const toSelectedRange = (date)=>date ? [
|
|
10
|
+
date,
|
|
11
|
+
date
|
|
12
|
+
] : [
|
|
13
|
+
null,
|
|
14
|
+
null
|
|
15
|
+
];
|
|
16
|
+
export function DatePicker({ value, onChange, format = 'DD/MM/YYYY', placeholder, displayWeekNumber = false, shortcuts, defaultDate, valueType, className }) {
|
|
17
|
+
const resolvedType = resolveValueType(value, defaultDate, valueType);
|
|
18
|
+
const djValue = normalizeIn(value);
|
|
19
|
+
const djDefault = defaultDate != null ? normalizeIn(defaultDate) ?? undefined : undefined;
|
|
20
|
+
const handleChange = (date)=>{
|
|
21
|
+
onChange(normalizeOut(date, resolvedType));
|
|
22
|
+
};
|
|
23
|
+
const djShortcuts = shortcuts?.map((shortcut)=>({
|
|
24
|
+
...shortcut,
|
|
25
|
+
getValue: ()=>normalizeShortcutValue(shortcut.getValue())
|
|
26
|
+
}));
|
|
27
|
+
const { isOpen, displayedMonth, tempDate, handleOpenChange, handleDateClick, handleMonthChange, handleApplyShortcut, inputRef, popoverRef } = useDatePicker({
|
|
28
|
+
value: djValue,
|
|
29
|
+
onChange: handleChange,
|
|
30
|
+
defaultDate: djDefault
|
|
31
|
+
});
|
|
32
|
+
const displayValue = isOpen ? tempDate : djValue;
|
|
33
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
34
|
+
"data-slot": "date-picker",
|
|
35
|
+
className: cn('relative w-full', className),
|
|
36
|
+
children: /*#__PURE__*/ _jsxs(Popover, {
|
|
37
|
+
open: isOpen,
|
|
38
|
+
onOpenChange: handleOpenChange,
|
|
39
|
+
children: [
|
|
40
|
+
/*#__PURE__*/ _jsx(PopoverTrigger, {
|
|
41
|
+
render: /*#__PURE__*/ _jsx("div", {
|
|
42
|
+
ref: inputRef,
|
|
43
|
+
className: "w-full"
|
|
44
|
+
}),
|
|
45
|
+
children: /*#__PURE__*/ _jsx(DateTimeInput, {
|
|
46
|
+
value: displayValue,
|
|
47
|
+
format: format,
|
|
48
|
+
placeholder: placeholder,
|
|
49
|
+
isOpen: isOpen,
|
|
50
|
+
variant: "date"
|
|
51
|
+
})
|
|
52
|
+
}),
|
|
53
|
+
/*#__PURE__*/ _jsx(PopoverContent, {
|
|
54
|
+
ref: popoverRef,
|
|
55
|
+
className: "rounded-xl w-auto p-0",
|
|
56
|
+
side: "bottom",
|
|
57
|
+
align: "start",
|
|
58
|
+
children: /*#__PURE__*/ _jsxs("div", {
|
|
59
|
+
"data-slot": "date-picker-content",
|
|
60
|
+
className: "flex flex-row",
|
|
61
|
+
children: [
|
|
62
|
+
djShortcuts && djShortcuts.length > 0 && /*#__PURE__*/ _jsx(ShortcutsPanel, {
|
|
63
|
+
shortcuts: djShortcuts,
|
|
64
|
+
onShortcutClick: handleApplyShortcut
|
|
65
|
+
}),
|
|
66
|
+
/*#__PURE__*/ _jsx("div", {
|
|
67
|
+
className: "p-3",
|
|
68
|
+
children: /*#__PURE__*/ _jsx(Calendar, {
|
|
69
|
+
displayedMonth: displayedMonth,
|
|
70
|
+
selectedRange: toSelectedRange(tempDate),
|
|
71
|
+
hoverDate: null,
|
|
72
|
+
displayWeekNumber: displayWeekNumber,
|
|
73
|
+
onDateClick: handleDateClick,
|
|
74
|
+
onMonthChange: handleMonthChange
|
|
75
|
+
})
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
})
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
//# sourceMappingURL=date-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/ui/core/date-time-pickers/date-picker/date-picker.tsx"],"sourcesContent":["import type { JSX } from 'react';\n\nimport type { Dayjs } from 'dayjs';\n\nimport { cn } from '../../../../../lib/utils';\nimport { Calendar } from '../../calendar/calendar';\nimport { Popover, PopoverContent, PopoverTrigger } from '../../popover/popover';\nimport { DateTimeInput } from '../shared/date-time-input/date-time-input';\nimport { ShortcutsPanel } from '../shared/shortcuts-panel/shortcuts-panel';\nimport type { ShortcutItem } from '../shared/shortcuts-panel/shortcuts-panel';\nimport {\n type DateInput,\n type DateValueProps,\n normalizeIn,\n normalizeOut,\n normalizeShortcutValue,\n resolveValueType,\n} from '../utils/date-input';\n\nimport { useDatePicker } from './use-date-picker';\n\nexport type { ShortcutItem };\n\nexport interface DatePickerProps<\n T extends DateInput = Dayjs,\n> extends DateValueProps<T> {\n format?: string;\n placeholder?: string;\n displayWeekNumber?: boolean;\n shortcuts?: ShortcutItem[];\n className?: string;\n}\n\nconst toSelectedRange = (date: Dayjs | null): [Dayjs | null, Dayjs | null] =>\n date ? [date, date] : [null, null];\n\nexport function DatePicker<T extends DateInput = Dayjs>({\n value,\n onChange,\n format = 'DD/MM/YYYY',\n placeholder,\n displayWeekNumber = false,\n shortcuts,\n defaultDate,\n valueType,\n className,\n}: DatePickerProps<T>): JSX.Element {\n const resolvedType = resolveValueType(value, defaultDate, valueType);\n const djValue = normalizeIn(value);\n const djDefault =\n defaultDate != null ? (normalizeIn(defaultDate) ?? undefined) : undefined;\n\n const handleChange = (date: Dayjs | null) => {\n onChange(normalizeOut<T>(date, resolvedType));\n };\n\n const djShortcuts = shortcuts?.map((shortcut) => ({\n ...shortcut,\n getValue: () => normalizeShortcutValue(shortcut.getValue()),\n }));\n\n const {\n isOpen,\n displayedMonth,\n tempDate,\n handleOpenChange,\n handleDateClick,\n handleMonthChange,\n handleApplyShortcut,\n inputRef,\n popoverRef,\n } = useDatePicker({\n value: djValue,\n onChange: handleChange,\n defaultDate: djDefault,\n });\n\n const displayValue = isOpen ? tempDate : djValue;\n\n return (\n <div data-slot=\"date-picker\" className={cn('relative w-full', className)}>\n <Popover open={isOpen} onOpenChange={handleOpenChange}>\n <PopoverTrigger render={<div ref={inputRef} className=\"w-full\" />}>\n <DateTimeInput\n value={displayValue}\n format={format}\n placeholder={placeholder}\n isOpen={isOpen}\n variant=\"date\"\n />\n </PopoverTrigger>\n <PopoverContent\n ref={popoverRef}\n className=\"rounded-xl w-auto p-0\"\n side=\"bottom\"\n align=\"start\"\n >\n <div data-slot=\"date-picker-content\" className=\"flex flex-row\">\n {djShortcuts && djShortcuts.length > 0 && (\n <ShortcutsPanel\n shortcuts={djShortcuts}\n onShortcutClick={handleApplyShortcut}\n />\n )}\n <div className=\"p-3\">\n <Calendar\n displayedMonth={displayedMonth}\n selectedRange={toSelectedRange(tempDate)}\n hoverDate={null}\n displayWeekNumber={displayWeekNumber}\n onDateClick={handleDateClick}\n onMonthChange={handleMonthChange}\n />\n </div>\n </div>\n </PopoverContent>\n </Popover>\n </div>\n );\n}\n"],"names":["cn","Calendar","Popover","PopoverContent","PopoverTrigger","DateTimeInput","ShortcutsPanel","normalizeIn","normalizeOut","normalizeShortcutValue","resolveValueType","useDatePicker","toSelectedRange","date","DatePicker","value","onChange","format","placeholder","displayWeekNumber","shortcuts","defaultDate","valueType","className","resolvedType","djValue","djDefault","undefined","handleChange","djShortcuts","map","shortcut","getValue","isOpen","displayedMonth","tempDate","handleOpenChange","handleDateClick","handleMonthChange","handleApplyShortcut","inputRef","popoverRef","displayValue","div","data-slot","open","onOpenChange","render","ref","variant","side","align","length","onShortcutClick","selectedRange","hoverDate","onDateClick","onMonthChange"],"mappings":";AAIA,SAASA,EAAE,QAAQ,8BAA2B;AAC9C,SAASC,QAAQ,QAAQ,6BAA0B;AACnD,SAASC,OAAO,EAAEC,cAAc,EAAEC,cAAc,QAAQ,2BAAwB;AAChF,SAASC,aAAa,QAAQ,+CAA4C;AAC1E,SAASC,cAAc,QAAQ,+CAA4C;AAE3E,SAGEC,WAAW,EACXC,YAAY,EACZC,sBAAsB,EACtBC,gBAAgB,QACX,yBAAsB;AAE7B,SAASC,aAAa,QAAQ,uBAAoB;AAclD,MAAMC,kBAAkB,CAACC,OACvBA,OAAO;QAACA;QAAMA;KAAK,GAAG;QAAC;QAAM;KAAK;AAEpC,OAAO,SAASC,WAAwC,EACtDC,KAAK,EACLC,QAAQ,EACRC,SAAS,YAAY,EACrBC,WAAW,EACXC,oBAAoB,KAAK,EACzBC,SAAS,EACTC,WAAW,EACXC,SAAS,EACTC,SAAS,EACU;IACnB,MAAMC,eAAed,iBAAiBK,OAAOM,aAAaC;IAC1D,MAAMG,UAAUlB,YAAYQ;IAC5B,MAAMW,YACJL,eAAe,OAAQd,YAAYc,gBAAgBM,YAAaA;IAElE,MAAMC,eAAe,CAACf;QACpBG,SAASR,aAAgBK,MAAMW;IACjC;IAEA,MAAMK,cAAcT,WAAWU,IAAI,CAACC,WAAc,CAAA;YAChD,GAAGA,QAAQ;YACXC,UAAU,IAAMvB,uBAAuBsB,SAASC,QAAQ;QAC1D,CAAA;IAEA,MAAM,EACJC,MAAM,EACNC,cAAc,EACdC,QAAQ,EACRC,gBAAgB,EAChBC,eAAe,EACfC,iBAAiB,EACjBC,mBAAmB,EACnBC,QAAQ,EACRC,UAAU,EACX,GAAG9B,cAAc;QAChBI,OAAOU;QACPT,UAAUY;QACVP,aAAaK;IACf;IAEA,MAAMgB,eAAeT,SAASE,WAAWV;IAEzC,qBACE,KAACkB;QAAIC,aAAU;QAAcrB,WAAWvB,GAAG,mBAAmBuB;kBAC5D,cAAA,MAACrB;YAAQ2C,MAAMZ;YAAQa,cAAcV;;8BACnC,KAAChC;oBAAe2C,sBAAQ,KAACJ;wBAAIK,KAAKR;wBAAUjB,WAAU;;8BACpD,cAAA,KAAClB;wBACCU,OAAO2B;wBACPzB,QAAQA;wBACRC,aAAaA;wBACbe,QAAQA;wBACRgB,SAAQ;;;8BAGZ,KAAC9C;oBACC6C,KAAKP;oBACLlB,WAAU;oBACV2B,MAAK;oBACLC,OAAM;8BAEN,cAAA,MAACR;wBAAIC,aAAU;wBAAsBrB,WAAU;;4BAC5CM,eAAeA,YAAYuB,MAAM,GAAG,mBACnC,KAAC9C;gCACCc,WAAWS;gCACXwB,iBAAiBd;;0CAGrB,KAACI;gCAAIpB,WAAU;0CACb,cAAA,KAACtB;oCACCiC,gBAAgBA;oCAChBoB,eAAe1C,gBAAgBuB;oCAC/BoB,WAAW;oCACXpC,mBAAmBA;oCACnBqC,aAAanB;oCACboB,eAAenB;;;;;;;;;AAQ/B"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { DatePicker } from
|
|
2
|
-
export type { DatePickerProps, ShortcutItem } from
|
|
3
|
-
export type { UseDatePickerProps, UseDatePickerReturn } from
|
|
1
|
+
export { DatePicker } from "./date-picker";
|
|
2
|
+
export type { DatePickerProps, ShortcutItem } from "./date-picker";
|
|
3
|
+
export type { UseDatePickerProps, UseDatePickerReturn } from "./types";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/ui/core/date-time-pickers/date-picker/index.ts"],"sourcesContent":["export { DatePicker } from './date-picker';\nexport type { DatePickerProps, ShortcutItem } from './date-picker';\nexport type { UseDatePickerProps, UseDatePickerReturn } from './types';\n"],"names":["DatePicker"],"mappings":"AAAA,SAASA,UAAU,QAAQ,mBAAgB"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { Dayjs } from
|
|
2
|
-
import { ShortcutValueDayjs } from
|
|
1
|
+
import type { Dayjs } from "dayjs";
|
|
2
|
+
import type { ShortcutValueDayjs } from "../shared/shortcuts-panel/shortcuts-panel";
|
|
3
3
|
export interface UseDatePickerProps {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
value: Dayjs | null;
|
|
5
|
+
onChange: (date: Dayjs | null) => void;
|
|
6
|
+
defaultDate?: Dayjs;
|
|
7
7
|
}
|
|
8
8
|
export interface UseDatePickerReturn {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
displayedMonth: Dayjs;
|
|
11
|
+
tempDate: Dayjs | null;
|
|
12
|
+
handleOpenChange: (open: boolean) => void;
|
|
13
|
+
handleDateClick: (date: Dayjs) => void;
|
|
14
|
+
handleMonthChange: (month: Dayjs) => void;
|
|
15
|
+
handleApplyShortcut: (shortcutValue: ShortcutValueDayjs) => void;
|
|
16
|
+
inputRef: React.RefObject<HTMLDivElement>;
|
|
17
|
+
popoverRef: React.RefObject<HTMLDivElement>;
|
|
18
18
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/ui/core/date-time-pickers/date-picker/types.ts"],"sourcesContent":["import type { Dayjs } from 'dayjs';\n\nimport type { ShortcutValueDayjs } from '../shared/shortcuts-panel/shortcuts-panel';\n\nexport interface UseDatePickerProps {\n value: Dayjs | null;\n onChange: (date: Dayjs | null) => void;\n defaultDate?: Dayjs;\n}\n\nexport interface UseDatePickerReturn {\n isOpen: boolean;\n displayedMonth: Dayjs;\n tempDate: Dayjs | null;\n handleOpenChange: (open: boolean) => void;\n handleDateClick: (date: Dayjs) => void;\n handleMonthChange: (month: Dayjs) => void;\n handleApplyShortcut: (shortcutValue: ShortcutValueDayjs) => void;\n inputRef: React.RefObject<HTMLDivElement>;\n popoverRef: React.RefObject<HTMLDivElement>;\n}\n"],"names":[],"mappings":"AAUA,WAUC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { UseDatePickerProps, UseDatePickerReturn } from
|
|
1
|
+
import type { UseDatePickerProps, UseDatePickerReturn } from "./types";
|
|
2
2
|
export type { UseDatePickerProps, UseDatePickerReturn };
|
|
3
|
-
export declare const useDatePicker: ({ value, onChange, defaultDate
|
|
3
|
+
export declare const useDatePicker: ({ value, onChange, defaultDate }: UseDatePickerProps) => UseDatePickerReturn;
|
|
@@ -1,37 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
2
|
+
import dayjs from "dayjs";
|
|
3
|
+
import { usePopoverState } from "../shared/hooks/use-popover-state.js";
|
|
4
|
+
import { useSingleDateState } from "../shared/hooks/use-single-date-state.js";
|
|
5
|
+
export const useDatePicker = ({ value, onChange, defaultDate = dayjs() })=>{
|
|
6
|
+
const onBackspaceRef = useRef(()=>{});
|
|
7
|
+
const { isOpen, setIsOpen, popoverRef, inputRef } = usePopoverState({
|
|
8
|
+
onBackspace: useCallback(()=>onBackspaceRef.current(), [])
|
|
9
|
+
});
|
|
10
|
+
const dateState = useSingleDateState({
|
|
11
|
+
value,
|
|
12
|
+
defaultDate,
|
|
13
|
+
onDateSelected: (date)=>{
|
|
14
|
+
onChange(date);
|
|
15
|
+
setIsOpen(false);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
const { tempDate, displayedMonth, handleDateClick, handleMonthChange, clearDate, resetDate } = dateState;
|
|
19
|
+
const resetAll = ()=>{
|
|
20
|
+
resetDate(value);
|
|
21
|
+
};
|
|
22
|
+
const handleBackspace = ()=>{
|
|
23
|
+
if (clearDate()) {
|
|
24
|
+
onChange(null);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
useEffect(()=>{
|
|
28
|
+
onBackspaceRef.current = handleBackspace;
|
|
29
|
+
});
|
|
30
|
+
const handleOpenChange = (open)=>{
|
|
31
|
+
resetAll();
|
|
32
|
+
setIsOpen(open);
|
|
33
|
+
};
|
|
34
|
+
const handleApplyShortcut = (shortcutValue)=>{
|
|
35
|
+
const date = Array.isArray(shortcutValue) ? shortcutValue[0] : shortcutValue;
|
|
36
|
+
onChange(date);
|
|
37
|
+
setIsOpen(false);
|
|
38
|
+
};
|
|
39
|
+
return {
|
|
40
|
+
isOpen,
|
|
41
|
+
displayedMonth,
|
|
42
|
+
tempDate,
|
|
43
|
+
handleOpenChange,
|
|
44
|
+
handleDateClick,
|
|
45
|
+
handleMonthChange,
|
|
46
|
+
handleApplyShortcut,
|
|
47
|
+
inputRef,
|
|
48
|
+
popoverRef
|
|
49
|
+
};
|
|
35
50
|
};
|
|
36
|
-
|
|
37
|
-
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=use-date-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/components/ui/core/date-time-pickers/date-picker/use-date-picker.ts"],"sourcesContent":["import { useCallback, useEffect, useRef } from 'react';\n\nimport type { Dayjs } from 'dayjs';\nimport dayjs from 'dayjs';\n\nimport { usePopoverState } from '../shared/hooks/use-popover-state';\nimport { useSingleDateState } from '../shared/hooks/use-single-date-state';\nimport type { ShortcutValueDayjs } from '../shared/shortcuts-panel/shortcuts-panel';\n\nimport type { UseDatePickerProps, UseDatePickerReturn } from './types';\n\nexport type { UseDatePickerProps, UseDatePickerReturn };\n\nexport const useDatePicker = ({\n value,\n onChange,\n defaultDate = dayjs(),\n}: UseDatePickerProps): UseDatePickerReturn => {\n const onBackspaceRef = useRef<() => void>(() => {});\n\n const { isOpen, setIsOpen, popoverRef, inputRef } = usePopoverState({\n onBackspace: useCallback(() => onBackspaceRef.current(), []),\n });\n\n const dateState = useSingleDateState({\n value,\n defaultDate,\n onDateSelected: (date: Dayjs) => {\n onChange(date);\n setIsOpen(false);\n },\n });\n const {\n tempDate,\n displayedMonth,\n handleDateClick,\n handleMonthChange,\n clearDate,\n resetDate,\n } = dateState;\n\n const resetAll = () => {\n resetDate(value);\n };\n\n const handleBackspace = () => {\n if (clearDate()) {\n onChange(null);\n }\n };\n\n useEffect(() => {\n onBackspaceRef.current = handleBackspace;\n });\n\n const handleOpenChange = (open: boolean) => {\n resetAll();\n setIsOpen(open);\n };\n\n const handleApplyShortcut = (shortcutValue: ShortcutValueDayjs) => {\n const date: Dayjs | null = Array.isArray(shortcutValue)\n ? shortcutValue[0]\n : shortcutValue;\n onChange(date);\n setIsOpen(false);\n };\n\n return {\n isOpen,\n displayedMonth,\n tempDate,\n handleOpenChange,\n handleDateClick,\n handleMonthChange,\n handleApplyShortcut,\n inputRef,\n popoverRef,\n };\n};\n"],"names":["useCallback","useEffect","useRef","dayjs","usePopoverState","useSingleDateState","useDatePicker","value","onChange","defaultDate","onBackspaceRef","isOpen","setIsOpen","popoverRef","inputRef","onBackspace","current","dateState","onDateSelected","date","tempDate","displayedMonth","handleDateClick","handleMonthChange","clearDate","resetDate","resetAll","handleBackspace","handleOpenChange","open","handleApplyShortcut","shortcutValue","Array","isArray"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,QAAQ;AAGvD,OAAOC,WAAW,QAAQ;AAE1B,SAASC,eAAe,QAAQ,uCAAoC;AACpE,SAASC,kBAAkB,QAAQ,2CAAwC;AAO3E,OAAO,MAAMC,gBAAgB,CAAC,EAC5BC,KAAK,EACLC,QAAQ,EACRC,cAAcN,OAAO,EACF;IACnB,MAAMO,iBAAiBR,OAAmB,KAAO;IAEjD,MAAM,EAAES,MAAM,EAAEC,SAAS,EAAEC,UAAU,EAAEC,QAAQ,EAAE,GAAGV,gBAAgB;QAClEW,aAAaf,YAAY,IAAMU,eAAeM,OAAO,IAAI,EAAE;IAC7D;IAEA,MAAMC,YAAYZ,mBAAmB;QACnCE;QACAE;QACAS,gBAAgB,CAACC;YACfX,SAASW;YACTP,UAAU;QACZ;IACF;IACA,MAAM,EACJQ,QAAQ,EACRC,cAAc,EACdC,eAAe,EACfC,iBAAiB,EACjBC,SAAS,EACTC,SAAS,EACV,GAAGR;IAEJ,MAAMS,WAAW;QACfD,UAAUlB;IACZ;IAEA,MAAMoB,kBAAkB;QACtB,IAAIH,aAAa;YACfhB,SAAS;QACX;IACF;IAEAP,UAAU;QACRS,eAAeM,OAAO,GAAGW;IAC3B;IAEA,MAAMC,mBAAmB,CAACC;QACxBH;QACAd,UAAUiB;IACZ;IAEA,MAAMC,sBAAsB,CAACC;QAC3B,MAAMZ,OAAqBa,MAAMC,OAAO,CAACF,iBACrCA,aAAa,CAAC,EAAE,GAChBA;QACJvB,SAASW;QACTP,UAAU;IACZ;IAEA,OAAO;QACLD;QACAU;QACAD;QACAQ;QACAN;QACAC;QACAO;QACAhB;QACAD;IACF;AACF,EAAE"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Dayjs } from
|
|
3
|
-
import { ShortcutItem } from
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
import type { Dayjs } from "dayjs";
|
|
3
|
+
import type { ShortcutItem } from "../shared/shortcuts-panel/shortcuts-panel";
|
|
4
|
+
import { type DateInput, type DateRangeValueProps } from "../utils/date-input";
|
|
4
5
|
export type { ShortcutItem };
|
|
5
|
-
export interface DateRangePickerProps {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
shortcuts?: ShortcutItem[];
|
|
12
|
-
defaultDate?: Dayjs;
|
|
13
|
-
className?: string;
|
|
6
|
+
export interface DateRangePickerProps<T extends DateInput = Dayjs> extends DateRangeValueProps<T> {
|
|
7
|
+
format?: string;
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
displayWeekNumber?: boolean;
|
|
10
|
+
shortcuts?: ShortcutItem[];
|
|
11
|
+
className?: string;
|
|
14
12
|
}
|
|
15
|
-
export declare
|
|
13
|
+
export declare function DateRangePicker<T extends DateInput = Dayjs>({ value, onChange, format, placeholder, displayWeekNumber, shortcuts, defaultDate, valueType, className }: DateRangePickerProps<T>): JSX.Element;
|