@cascivo/react 0.18.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -7
- package/dist/accordion/accordion.js +1 -114
- package/dist/accordion/accordion.module.js +1 -10
- package/dist/action-sheet/action-sheet.css +1 -1
- package/dist/action-sheet/action-sheet.js +1 -91
- package/dist/action-sheet/action-sheet.module.js +1 -12
- package/dist/alert/alert.js +1 -55
- package/dist/alert/alert.module.js +1 -11
- package/dist/alert-dialog/alert-dialog.css +1 -1
- package/dist/alert-dialog/alert-dialog.js +1 -66
- package/dist/alert-dialog/alert-dialog.module.js +1 -11
- package/dist/app-shell/app-shell.css +1 -1
- package/dist/app-shell/app-shell.js +1 -85
- package/dist/app-shell/app-shell.module.js +1 -12
- package/dist/aspect-ratio/aspect-ratio.js +1 -20
- package/dist/aspect-ratio/aspect-ratio.module.js +1 -6
- package/dist/avatar/avatar.js +1 -57
- package/dist/avatar/avatar.module.js +1 -8
- package/dist/avatar-group/avatar-group.js +1 -24
- package/dist/avatar-group/avatar-group.module.js +1 -6
- package/dist/badge/badge.js +1 -22
- package/dist/badge/badge.module.js +1 -3
- package/dist/blockquote/blockquote.js +1 -16
- package/dist/blockquote/blockquote.module.js +1 -6
- package/dist/bottom-sheet/bottom-sheet.js +1 -111
- package/dist/bottom-sheet/bottom-sheet.module.js +1 -14
- package/dist/brand/logo/logo.css +1 -0
- package/dist/brand/logo/logo.js +1 -0
- package/dist/brand/logo/logo.module.js +2 -0
- package/dist/breadcrumb/breadcrumb.js +1 -28
- package/dist/breadcrumb/breadcrumb.module.js +1 -3
- package/dist/button/button.css +1 -1
- package/dist/button/button.js +1 -35
- package/dist/button/button.module.js +1 -6
- package/dist/button-group/button-group.js +1 -39
- package/dist/button-group/button-group.module.js +1 -3
- package/dist/calendar/calendar-date.js +1 -0
- package/dist/calendar/calendar.css +1 -1
- package/dist/calendar/calendar.js +1 -199
- package/dist/calendar/calendar.module.js +1 -14
- package/dist/card/card.js +1 -53
- package/dist/card/card.module.js +1 -12
- package/dist/carousel/carousel.css +1 -1
- package/dist/carousel/carousel.js +1 -138
- package/dist/carousel/carousel.module.js +1 -13
- package/dist/chat-bubble/chat-bubble.js +1 -31
- package/dist/chat-bubble/chat-bubble.module.js +1 -11
- package/dist/checkbox/checkbox.js +1 -38
- package/dist/checkbox/checkbox.module.js +1 -8
- package/dist/checkbox-card/checkbox-card.css +1 -1
- package/dist/checkbox-card/checkbox-card.js +1 -50
- package/dist/checkbox-card/checkbox-card.module.js +1 -11
- package/dist/code/code.js +1 -14
- package/dist/code/code.module.js +1 -3
- package/dist/code-snippet/code-snippet.js +2 -121
- package/dist/code-snippet/code-snippet.module.js +1 -17
- package/dist/code-snippet/highlight.js +1 -67
- package/dist/collapsible/collapsible.js +1 -47
- package/dist/collapsible/collapsible.module.js +1 -7
- package/dist/color-picker/color-picker.css +1 -1
- package/dist/color-picker/color-picker.js +1 -268
- package/dist/color-picker/color-picker.module.js +1 -18
- package/dist/color-picker/color.js +1 -0
- package/dist/combobox/combobox.css +1 -1
- package/dist/combobox/combobox.js +1 -165
- package/dist/combobox/combobox.module.js +1 -19
- package/dist/combobox/list-nav.js +1 -0
- package/dist/combobox/option-list.js +1 -0
- package/dist/command-menu/command-menu.js +1 -421
- package/dist/command-menu/command-menu.module.js +1 -34
- package/dist/comparison/comparison.js +1 -69
- package/dist/comparison/comparison.module.js +1 -9
- package/dist/contained-list/contained-list.js +1 -41
- package/dist/contained-list/contained-list.module.js +1 -11
- package/dist/context-menu/context-menu.js +1 -93
- package/dist/context-menu/context-menu.module.js +1 -7
- package/dist/copy-button/copy-button.js +1 -60
- package/dist/copy-button/copy-button.module.js +1 -6
- package/dist/data-list/data-list.js +1 -25
- package/dist/data-list/data-list.module.js +1 -8
- package/dist/data-table/column-filter.js +1 -0
- package/dist/data-table/column-layout.js +1 -0
- package/dist/data-table/data-table.css +1 -1
- package/dist/data-table/data-table.js +1 -371
- package/dist/data-table/data-table.module.js +1 -33
- package/dist/data-table/grid-keys.js +1 -0
- package/dist/data-table/row-group.js +1 -0
- package/dist/data-table/row-search.js +1 -0
- package/dist/data-table/row-sort.js +1 -0
- package/dist/data-table/to-csv.js +3 -0
- package/dist/data-table/virtual-window.js +1 -0
- package/dist/date-picker/date-picker.css +1 -1
- package/dist/date-picker/date-picker.js +1 -219
- package/dist/date-picker/date-picker.module.js +1 -23
- package/dist/date-picker/parse-date.js +1 -0
- package/dist/date-range-picker/date-range-picker.js +1 -196
- package/dist/date-range-picker/date-range-picker.module.js +1 -18
- package/dist/dock/dock.css +1 -1
- package/dist/dock/dock.js +1 -34
- package/dist/dock/dock.module.js +1 -8
- package/dist/drawer/drawer.js +1 -96
- package/dist/drawer/drawer.module.js +1 -13
- package/dist/dropdown/dropdown.css +1 -1
- package/dist/dropdown/dropdown.js +1 -107
- package/dist/dropdown/dropdown.module.js +1 -9
- package/dist/editable/editable.js +1 -67
- package/dist/editable/editable.module.js +1 -11
- package/dist/empty-state/empty-state.js +1 -32
- package/dist/empty-state/empty-state.module.js +1 -9
- package/dist/fab/fab.css +1 -1
- package/dist/fab/fab.js +1 -93
- package/dist/fab/fab.module.js +1 -12
- package/dist/field/field.css +1 -1
- package/dist/field/field.js +1 -46
- package/dist/field/field.module.js +1 -7
- package/dist/file-uploader/file-uploader.css +1 -1
- package/dist/file-uploader/file-uploader.js +1 -122
- package/dist/file-uploader/file-uploader.module.js +1 -18
- package/dist/filter/filter.css +1 -1
- package/dist/filter/filter.js +1 -35
- package/dist/filter/filter.module.js +1 -6
- package/dist/form/form.js +1 -95
- package/dist/form/form.module.js +1 -3
- package/dist/header/header.js +1 -44
- package/dist/header/header.module.js +1 -11
- package/dist/header-panel/header-panel.js +1 -72
- package/dist/header-panel/header-panel.module.js +1 -9
- package/dist/heading/heading.css +1 -1
- package/dist/heading/heading.js +1 -22
- package/dist/heading/heading.module.js +1 -3
- package/dist/hover-card/hover-card.css +1 -1
- package/dist/hover-card/hover-card.js +1 -84
- package/dist/hover-card/hover-card.module.js +1 -6
- package/dist/icon-button/icon-button.js +1 -19
- package/dist/icon-button/icon-button.module.js +1 -3
- package/dist/image/image.css +1 -1
- package/dist/image/image.js +1 -64
- package/dist/image/image.module.js +1 -9
- package/dist/index.d.ts +2084 -120
- package/dist/indicator/indicator.js +1 -16
- package/dist/indicator/indicator.module.js +1 -6
- package/dist/infinite-scroll/infinite-scroll.js +1 -49
- package/dist/infinite-scroll/infinite-scroll.module.js +1 -7
- package/dist/inline-loading/inline-loading.js +1 -74
- package/dist/inline-loading/inline-loading.module.js +1 -9
- package/dist/input/input.css +1 -1
- package/dist/input/input.js +1 -55
- package/dist/input/input.module.js +1 -9
- package/dist/input-group/input-group.css +1 -1
- package/dist/input-group/input-group.js +1 -39
- package/dist/input-group/input-group.module.js +1 -9
- package/dist/item/item.js +1 -50
- package/dist/item/item.module.js +1 -10
- package/dist/join/join.js +1 -12
- package/dist/join/join.module.js +1 -3
- package/dist/kbd/kbd.js +1 -14
- package/dist/kbd/kbd.module.js +1 -3
- package/dist/label/label.js +1 -23
- package/dist/label/label.module.js +1 -7
- package/dist/large-title-header/large-title-header.js +1 -38
- package/dist/large-title-header/large-title-header.module.js +1 -12
- package/dist/layouts/src/auto-grid/auto-grid.js +1 -17
- package/dist/layouts/src/auto-grid/auto-grid.module.js +1 -4
- package/dist/layouts/src/center/center.js +1 -16
- package/dist/layouts/src/center/center.module.js +1 -3
- package/dist/layouts/src/columns/columns.js +1 -21
- package/dist/layouts/src/columns/columns.module.js +1 -6
- package/dist/layouts/src/flex/flex.js +1 -20
- package/dist/layouts/src/flex/flex.module.js +1 -3
- package/dist/layouts/src/grid/grid.css +1 -1
- package/dist/layouts/src/grid/grid.js +1 -55
- package/dist/layouts/src/grid/grid.module.js +1 -7
- package/dist/layouts/src/page-header/page-header.js +1 -31
- package/dist/layouts/src/page-header/page-header.module.js +1 -10
- package/dist/layouts/src/spacer/spacer.js +1 -17
- package/dist/layouts/src/spacer/spacer.module.js +1 -3
- package/dist/link/link.css +1 -1
- package/dist/link/link.js +1 -22
- package/dist/link/link.module.js +1 -3
- package/dist/list/list.js +1 -21
- package/dist/list/list.module.js +1 -6
- package/dist/log-viewer/log-viewer.css +1 -1
- package/dist/log-viewer/log-viewer.js +2 -184
- package/dist/log-viewer/log-viewer.module.js +1 -16
- package/dist/menu/menu.js +1 -126
- package/dist/menu/menu.module.js +1 -8
- package/dist/menu-button/menu-button.js +1 -92
- package/dist/menu-button/menu-button.module.js +1 -8
- package/dist/menubar/menubar.js +1 -103
- package/dist/menubar/menubar.module.js +1 -8
- package/dist/modal/modal.css +1 -1
- package/dist/modal/modal.js +1 -76
- package/dist/modal/modal.module.js +1 -12
- package/dist/multi-select/list-nav.js +1 -0
- package/dist/multi-select/multi-select.css +1 -1
- package/dist/multi-select/multi-select.js +1 -106
- package/dist/multi-select/multi-select.module.js +1 -15
- package/dist/multi-select/option-list.js +1 -0
- package/dist/native-select/native-select.css +1 -1
- package/dist/native-select/native-select.js +1 -37
- package/dist/native-select/native-select.module.js +1 -7
- package/dist/navigation-menu/navigation-menu.js +1 -99
- package/dist/navigation-menu/navigation-menu.module.js +1 -10
- package/dist/node/accordion/accordion.js +1 -114
- package/dist/node/accordion/accordion.module.js +1 -10
- package/dist/node/action-sheet/action-sheet.js +1 -91
- package/dist/node/action-sheet/action-sheet.module.js +1 -12
- package/dist/node/alert/alert.js +1 -55
- package/dist/node/alert/alert.module.js +1 -11
- package/dist/node/alert-dialog/alert-dialog.js +1 -66
- package/dist/node/alert-dialog/alert-dialog.module.js +1 -11
- package/dist/node/app-shell/app-shell.js +1 -85
- package/dist/node/app-shell/app-shell.module.js +1 -12
- package/dist/node/aspect-ratio/aspect-ratio.js +1 -20
- package/dist/node/aspect-ratio/aspect-ratio.module.js +1 -6
- package/dist/node/avatar/avatar.js +1 -57
- package/dist/node/avatar/avatar.module.js +1 -8
- package/dist/node/avatar-group/avatar-group.js +1 -24
- package/dist/node/avatar-group/avatar-group.module.js +1 -6
- package/dist/node/badge/badge.js +1 -22
- package/dist/node/badge/badge.module.js +1 -3
- package/dist/node/blockquote/blockquote.js +1 -16
- package/dist/node/blockquote/blockquote.module.js +1 -6
- package/dist/node/bottom-sheet/bottom-sheet.js +1 -111
- package/dist/node/bottom-sheet/bottom-sheet.module.js +1 -14
- package/dist/node/brand/logo/logo.js +1 -0
- package/dist/node/brand/logo/logo.module.js +1 -0
- package/dist/node/breadcrumb/breadcrumb.js +1 -28
- package/dist/node/breadcrumb/breadcrumb.module.js +1 -3
- package/dist/node/button/button.js +1 -35
- package/dist/node/button/button.module.js +1 -6
- package/dist/node/button-group/button-group.js +1 -39
- package/dist/node/button-group/button-group.module.js +1 -3
- package/dist/node/calendar/calendar-date.js +1 -0
- package/dist/node/calendar/calendar.js +1 -199
- package/dist/node/calendar/calendar.module.js +1 -14
- package/dist/node/card/card.js +1 -53
- package/dist/node/card/card.module.js +1 -12
- package/dist/node/carousel/carousel.js +1 -138
- package/dist/node/carousel/carousel.module.js +1 -13
- package/dist/node/chat-bubble/chat-bubble.js +1 -31
- package/dist/node/chat-bubble/chat-bubble.module.js +1 -11
- package/dist/node/checkbox/checkbox.js +1 -38
- package/dist/node/checkbox/checkbox.module.js +1 -8
- package/dist/node/checkbox-card/checkbox-card.js +1 -50
- package/dist/node/checkbox-card/checkbox-card.module.js +1 -11
- package/dist/node/code/code.js +1 -14
- package/dist/node/code/code.module.js +1 -3
- package/dist/node/code-snippet/code-snippet.js +2 -121
- package/dist/node/code-snippet/code-snippet.module.js +1 -17
- package/dist/node/code-snippet/highlight.js +1 -67
- package/dist/node/collapsible/collapsible.js +1 -47
- package/dist/node/collapsible/collapsible.module.js +1 -7
- package/dist/node/color-picker/color-picker.js +1 -268
- package/dist/node/color-picker/color-picker.module.js +1 -18
- package/dist/node/color-picker/color.js +1 -0
- package/dist/node/combobox/combobox.js +1 -165
- package/dist/node/combobox/combobox.module.js +1 -19
- package/dist/node/combobox/list-nav.js +1 -0
- package/dist/node/combobox/option-list.js +1 -0
- package/dist/node/command-menu/command-menu.js +1 -421
- package/dist/node/command-menu/command-menu.module.js +1 -34
- package/dist/node/comparison/comparison.js +1 -69
- package/dist/node/comparison/comparison.module.js +1 -9
- package/dist/node/contained-list/contained-list.js +1 -41
- package/dist/node/contained-list/contained-list.module.js +1 -11
- package/dist/node/context-menu/context-menu.js +1 -93
- package/dist/node/context-menu/context-menu.module.js +1 -7
- package/dist/node/copy-button/copy-button.js +1 -60
- package/dist/node/copy-button/copy-button.module.js +1 -6
- package/dist/node/data-list/data-list.js +1 -25
- package/dist/node/data-list/data-list.module.js +1 -8
- package/dist/node/data-table/column-filter.js +1 -0
- package/dist/node/data-table/column-layout.js +1 -0
- package/dist/node/data-table/data-table.js +1 -371
- package/dist/node/data-table/data-table.module.js +1 -33
- package/dist/node/data-table/grid-keys.js +1 -0
- package/dist/node/data-table/row-group.js +1 -0
- package/dist/node/data-table/row-search.js +1 -0
- package/dist/node/data-table/row-sort.js +1 -0
- package/dist/node/data-table/to-csv.js +3 -0
- package/dist/node/data-table/virtual-window.js +1 -0
- package/dist/node/date-picker/date-picker.js +1 -219
- package/dist/node/date-picker/date-picker.module.js +1 -23
- package/dist/node/date-picker/parse-date.js +1 -0
- package/dist/node/date-range-picker/date-range-picker.js +1 -196
- package/dist/node/date-range-picker/date-range-picker.module.js +1 -18
- package/dist/node/dock/dock.js +1 -34
- package/dist/node/dock/dock.module.js +1 -8
- package/dist/node/drawer/drawer.js +1 -96
- package/dist/node/drawer/drawer.module.js +1 -13
- package/dist/node/dropdown/dropdown.js +1 -107
- package/dist/node/dropdown/dropdown.module.js +1 -9
- package/dist/node/editable/editable.js +1 -67
- package/dist/node/editable/editable.module.js +1 -11
- package/dist/node/empty-state/empty-state.js +1 -32
- package/dist/node/empty-state/empty-state.module.js +1 -9
- package/dist/node/fab/fab.js +1 -93
- package/dist/node/fab/fab.module.js +1 -12
- package/dist/node/field/field.js +1 -46
- package/dist/node/field/field.module.js +1 -7
- package/dist/node/file-uploader/file-uploader.js +1 -122
- package/dist/node/file-uploader/file-uploader.module.js +1 -18
- package/dist/node/filter/filter.js +1 -35
- package/dist/node/filter/filter.module.js +1 -6
- package/dist/node/form/form.js +1 -95
- package/dist/node/form/form.module.js +1 -3
- package/dist/node/header/header.js +1 -44
- package/dist/node/header/header.module.js +1 -11
- package/dist/node/header-panel/header-panel.js +1 -72
- package/dist/node/header-panel/header-panel.module.js +1 -9
- package/dist/node/heading/heading.js +1 -22
- package/dist/node/heading/heading.module.js +1 -3
- package/dist/node/hover-card/hover-card.js +1 -84
- package/dist/node/hover-card/hover-card.module.js +1 -6
- package/dist/node/icon-button/icon-button.js +1 -19
- package/dist/node/icon-button/icon-button.module.js +1 -3
- package/dist/node/image/image.js +1 -64
- package/dist/node/image/image.module.js +1 -9
- package/dist/node/indicator/indicator.js +1 -16
- package/dist/node/indicator/indicator.module.js +1 -6
- package/dist/node/infinite-scroll/infinite-scroll.js +1 -49
- package/dist/node/infinite-scroll/infinite-scroll.module.js +1 -7
- package/dist/node/inline-loading/inline-loading.js +1 -74
- package/dist/node/inline-loading/inline-loading.module.js +1 -9
- package/dist/node/input/input.js +1 -55
- package/dist/node/input/input.module.js +1 -9
- package/dist/node/input-group/input-group.js +1 -39
- package/dist/node/input-group/input-group.module.js +1 -9
- package/dist/node/item/item.js +1 -50
- package/dist/node/item/item.module.js +1 -10
- package/dist/node/join/join.js +1 -12
- package/dist/node/join/join.module.js +1 -3
- package/dist/node/kbd/kbd.js +1 -14
- package/dist/node/kbd/kbd.module.js +1 -3
- package/dist/node/label/label.js +1 -23
- package/dist/node/label/label.module.js +1 -7
- package/dist/node/large-title-header/large-title-header.js +1 -38
- package/dist/node/large-title-header/large-title-header.module.js +1 -12
- package/dist/node/layouts/src/auto-grid/auto-grid.js +1 -17
- package/dist/node/layouts/src/auto-grid/auto-grid.module.js +1 -4
- package/dist/node/layouts/src/center/center.js +1 -16
- package/dist/node/layouts/src/center/center.module.js +1 -3
- package/dist/node/layouts/src/columns/columns.js +1 -21
- package/dist/node/layouts/src/columns/columns.module.js +1 -6
- package/dist/node/layouts/src/flex/flex.js +1 -20
- package/dist/node/layouts/src/flex/flex.module.js +1 -3
- package/dist/node/layouts/src/grid/grid.js +1 -55
- package/dist/node/layouts/src/grid/grid.module.js +1 -7
- package/dist/node/layouts/src/page-header/page-header.js +1 -31
- package/dist/node/layouts/src/page-header/page-header.module.js +1 -10
- package/dist/node/layouts/src/spacer/spacer.js +1 -17
- package/dist/node/layouts/src/spacer/spacer.module.js +1 -3
- package/dist/node/link/link.js +1 -22
- package/dist/node/link/link.module.js +1 -3
- package/dist/node/list/list.js +1 -21
- package/dist/node/list/list.module.js +1 -6
- package/dist/node/log-viewer/log-viewer.js +2 -184
- package/dist/node/log-viewer/log-viewer.module.js +1 -16
- package/dist/node/menu/menu.js +1 -126
- package/dist/node/menu/menu.module.js +1 -8
- package/dist/node/menu-button/menu-button.js +1 -92
- package/dist/node/menu-button/menu-button.module.js +1 -8
- package/dist/node/menubar/menubar.js +1 -103
- package/dist/node/menubar/menubar.module.js +1 -8
- package/dist/node/modal/modal.js +1 -76
- package/dist/node/modal/modal.module.js +1 -12
- package/dist/node/multi-select/list-nav.js +1 -0
- package/dist/node/multi-select/multi-select.js +1 -106
- package/dist/node/multi-select/multi-select.module.js +1 -15
- package/dist/node/multi-select/option-list.js +1 -0
- package/dist/node/native-select/native-select.js +1 -37
- package/dist/node/native-select/native-select.module.js +1 -7
- package/dist/node/navigation-menu/navigation-menu.js +1 -99
- package/dist/node/navigation-menu/navigation-menu.module.js +1 -10
- package/dist/node/notification/notification.js +1 -140
- package/dist/node/notification/notification.module.js +1 -11
- package/dist/node/number-input/number-input.js +1 -147
- package/dist/node/number-input/number-input.module.js +1 -12
- package/dist/node/otp-input/otp-input.js +1 -70
- package/dist/node/otp-input/otp-input.module.js +1 -6
- package/dist/node/overflow-menu/overflow-menu.js +1 -70
- package/dist/node/overflow-menu/overflow-menu.module.js +1 -7
- package/dist/node/pagination/pagination.js +1 -92
- package/dist/node/pagination/pagination.module.js +1 -11
- package/dist/node/password-input/password-input.js +1 -81
- package/dist/node/password-input/password-input.module.js +1 -11
- package/dist/node/popover/popover.js +1 -51
- package/dist/node/popover/popover.module.js +1 -6
- package/dist/node/popover/use-popover.js +1 -55
- package/dist/node/progress/progress.js +1 -16
- package/dist/node/progress/progress.module.js +1 -6
- package/dist/node/progress-bar/progress-bar.js +1 -42
- package/dist/node/progress-bar/progress-bar.module.js +1 -11
- package/dist/node/progress-circle/progress-circle.js +1 -46
- package/dist/node/progress-circle/progress-circle.module.js +1 -9
- package/dist/node/progress-indicator/progress-indicator.js +1 -34
- package/dist/node/progress-indicator/progress-indicator.module.js +1 -10
- package/dist/node/prose/prose.js +1 -13
- package/dist/node/prose/prose.module.js +1 -3
- package/dist/node/pull-to-refresh/pull-to-refresh.js +1 -82
- package/dist/node/pull-to-refresh/pull-to-refresh.module.js +1 -9
- package/dist/node/qr-code/encode.js +1 -583
- package/dist/node/qr-code/qr-code.js +1 -41
- package/dist/node/qr-code/qr-code.module.js +1 -6
- package/dist/node/radial-progress/radial-progress.js +1 -27
- package/dist/node/radial-progress/radial-progress.module.js +1 -6
- package/dist/node/radio/radio.js +1 -48
- package/dist/node/radio/radio.module.js +1 -9
- package/dist/node/radio-card/radio-card.js +1 -64
- package/dist/node/radio-card/radio-card.module.js +1 -11
- package/dist/node/rating-group/rating-group.js +1 -37
- package/dist/node/rating-group/rating-group.module.js +1 -6
- package/dist/node/react/src/index.js +1 -141
- package/dist/node/relative-time/relative-time.js +1 -66
- package/dist/node/relative-time/relative-time.module.js +1 -3
- package/dist/node/reorder-list/reorder-list.js +1 -143
- package/dist/node/reorder-list/reorder-list.module.js +1 -11
- package/dist/node/resizable/resizable.js +1 -80
- package/dist/node/resizable/resizable.module.js +1 -8
- package/dist/node/scroll-area/scroll-area.js +1 -38
- package/dist/node/scroll-area/scroll-area.module.js +1 -3
- package/dist/node/search/search.js +1 -92
- package/dist/node/search/search.module.js +1 -9
- package/dist/node/segmented-control/segmented-control.js +1 -43
- package/dist/node/segmented-control/segmented-control.module.js +1 -6
- package/dist/node/select/select.js +1 -72
- package/dist/node/select/select.module.js +1 -11
- package/dist/node/separator/separator.js +1 -19
- package/dist/node/separator/separator.module.js +1 -3
- package/dist/node/sheet/sheet.js +1 -49
- package/dist/node/sheet/sheet.module.js +1 -9
- package/dist/node/shell-header/shell-header.js +1 -169
- package/dist/node/shell-header/shell-header.module.js +1 -24
- package/dist/node/side-nav/side-nav.js +1 -334
- package/dist/node/side-nav/side-nav.module.js +1 -31
- package/dist/node/skeleton/skeleton.js +1 -23
- package/dist/node/skeleton/skeleton.module.js +1 -7
- package/dist/node/skip-nav/skip-nav.js +1 -28
- package/dist/node/skip-nav/skip-nav.module.js +1 -3
- package/dist/node/slider/slider.js +1 -29
- package/dist/node/slider/slider.module.js +1 -7
- package/dist/node/spinner/spinner.js +1 -18
- package/dist/node/spinner/spinner.module.js +1 -6
- package/dist/node/stack/stack.js +1 -17
- package/dist/node/stack/stack.module.js +1 -6
- package/dist/node/stat/stat.js +1 -41
- package/dist/node/stat/stat.module.js +1 -11
- package/dist/node/status/status.js +1 -25
- package/dist/node/status/status.module.js +1 -7
- package/dist/node/steps/steps.js +1 -35
- package/dist/node/steps/steps.module.js +1 -8
- package/dist/node/structured-list/structured-list.js +1 -102
- package/dist/node/structured-list/structured-list.module.js +1 -12
- package/dist/node/swap/swap.js +1 -36
- package/dist/node/swap/swap.module.js +1 -7
- package/dist/node/swipe-item/swipe-item.js +1 -62
- package/dist/node/swipe-item/swipe-item.module.js +1 -12
- package/dist/node/switcher/switcher.js +1 -32
- package/dist/node/switcher/switcher.module.js +1 -8
- package/dist/node/tabs/tabs.js +1 -98
- package/dist/node/tabs/tabs.module.js +1 -8
- package/dist/node/tag/tag.js +1 -33
- package/dist/node/tag/tag.module.js +1 -6
- package/dist/node/tags-input/tags-input.js +1 -64
- package/dist/node/tags-input/tags-input.module.js +1 -8
- package/dist/node/text/text.js +1 -16
- package/dist/node/text/text.module.js +1 -3
- package/dist/node/textarea/textarea.js +1 -57
- package/dist/node/textarea/textarea.module.js +1 -9
- package/dist/node/tile/tile.js +1 -39
- package/dist/node/tile/tile.module.js +1 -7
- package/dist/node/time-picker/time-picker.js +1 -63
- package/dist/node/time-picker/time-picker.module.js +1 -9
- package/dist/node/timeline/timeline.js +1 -55
- package/dist/node/timeline/timeline.module.js +1 -11
- package/dist/node/toast/toast.js +1 -85
- package/dist/node/toast/toast.module.js +1 -11
- package/dist/node/toc/toc.js +1 -43
- package/dist/node/toc/toc.module.js +1 -3
- package/dist/node/toc/use-toc-from-region.js +1 -18
- package/dist/node/toggle/toggle.js +1 -41
- package/dist/node/toggle/toggle.module.js +1 -8
- package/dist/node/toggle-group/toggle-group.js +1 -55
- package/dist/node/toggle-group/toggle-group.module.js +1 -6
- package/dist/node/toggletip/toggletip.js +1 -49
- package/dist/node/toggletip/toggletip.module.js +1 -7
- package/dist/node/tooltip/tooltip.js +1 -58
- package/dist/node/tooltip/tooltip.module.js +1 -6
- package/dist/node/tree-view/tree-view.js +1 -201
- package/dist/node/tree-view/tree-view.module.js +1 -13
- package/dist/node/user/user.js +1 -35
- package/dist/node/user/user.module.js +1 -9
- package/dist/node/virtual-list/virtual-list.js +1 -40
- package/dist/node/virtual-list/virtual-list.module.js +1 -7
- package/dist/node/visually-hidden/visually-hidden.js +1 -2
- package/dist/node/wheel-picker/wheel-picker.js +1 -84
- package/dist/node/wheel-picker/wheel-picker.module.js +1 -8
- package/dist/notification/notification.js +1 -140
- package/dist/notification/notification.module.js +1 -11
- package/dist/number-input/number-input.js +1 -147
- package/dist/number-input/number-input.module.js +1 -12
- package/dist/otp-input/otp-input.js +1 -70
- package/dist/otp-input/otp-input.module.js +1 -6
- package/dist/overflow-menu/overflow-menu.js +1 -70
- package/dist/overflow-menu/overflow-menu.module.js +1 -7
- package/dist/pagination/pagination.js +1 -92
- package/dist/pagination/pagination.module.js +1 -11
- package/dist/password-input/password-input.js +1 -81
- package/dist/password-input/password-input.module.js +1 -11
- package/dist/popover/popover.js +1 -51
- package/dist/popover/popover.module.js +1 -6
- package/dist/popover/use-popover.js +1 -55
- package/dist/progress/progress.css +1 -1
- package/dist/progress/progress.js +1 -16
- package/dist/progress/progress.module.js +1 -6
- package/dist/progress-bar/progress-bar.css +1 -1
- package/dist/progress-bar/progress-bar.js +1 -42
- package/dist/progress-bar/progress-bar.module.js +1 -11
- package/dist/progress-circle/progress-circle.js +1 -46
- package/dist/progress-circle/progress-circle.module.js +1 -9
- package/dist/progress-indicator/progress-indicator.css +1 -1
- package/dist/progress-indicator/progress-indicator.js +1 -34
- package/dist/progress-indicator/progress-indicator.module.js +1 -10
- package/dist/prose/prose.css +1 -1
- package/dist/prose/prose.js +1 -13
- package/dist/prose/prose.module.js +1 -3
- package/dist/pull-to-refresh/pull-to-refresh.js +1 -82
- package/dist/pull-to-refresh/pull-to-refresh.module.js +1 -9
- package/dist/qr-code/encode.js +1 -583
- package/dist/qr-code/qr-code.js +1 -41
- package/dist/qr-code/qr-code.module.js +1 -6
- package/dist/radial-progress/radial-progress.js +1 -27
- package/dist/radial-progress/radial-progress.module.js +1 -6
- package/dist/radio/radio.js +1 -48
- package/dist/radio/radio.module.js +1 -9
- package/dist/radio-card/radio-card.css +1 -1
- package/dist/radio-card/radio-card.js +1 -64
- package/dist/radio-card/radio-card.module.js +1 -11
- package/dist/rating-group/rating-group.js +1 -37
- package/dist/rating-group/rating-group.module.js +1 -6
- package/dist/react/src/index.js +1 -141
- package/dist/relative-time/relative-time.js +1 -66
- package/dist/relative-time/relative-time.module.js +1 -3
- package/dist/reorder-list/reorder-list.css +1 -1
- package/dist/reorder-list/reorder-list.js +1 -143
- package/dist/reorder-list/reorder-list.module.js +1 -11
- package/dist/resizable/resizable.js +1 -80
- package/dist/resizable/resizable.module.js +1 -8
- package/dist/scroll-area/scroll-area.css +1 -1
- package/dist/scroll-area/scroll-area.js +1 -38
- package/dist/scroll-area/scroll-area.module.js +1 -3
- package/dist/search/search.js +1 -92
- package/dist/search/search.module.js +1 -9
- package/dist/segmented-control/segmented-control.js +1 -43
- package/dist/segmented-control/segmented-control.module.js +1 -6
- package/dist/select/select.js +1 -72
- package/dist/select/select.module.js +1 -11
- package/dist/separator/separator.js +1 -19
- package/dist/separator/separator.module.js +1 -3
- package/dist/sheet/sheet.js +1 -49
- package/dist/sheet/sheet.module.js +1 -9
- package/dist/shell-header/shell-header.css +1 -1
- package/dist/shell-header/shell-header.js +1 -169
- package/dist/shell-header/shell-header.module.js +1 -24
- package/dist/side-nav/side-nav.css +1 -1
- package/dist/side-nav/side-nav.js +1 -334
- package/dist/side-nav/side-nav.module.js +1 -31
- package/dist/skeleton/skeleton.css +1 -1
- package/dist/skeleton/skeleton.js +1 -23
- package/dist/skeleton/skeleton.module.js +1 -7
- package/dist/skip-nav/skip-nav.js +1 -28
- package/dist/skip-nav/skip-nav.module.js +1 -3
- package/dist/slider/slider.js +1 -29
- package/dist/slider/slider.module.js +1 -7
- package/dist/spinner/spinner.css +1 -1
- package/dist/spinner/spinner.js +1 -18
- package/dist/spinner/spinner.module.js +1 -6
- package/dist/stack/stack.js +1 -17
- package/dist/stack/stack.module.js +1 -6
- package/dist/stat/stat.js +1 -41
- package/dist/stat/stat.module.js +1 -11
- package/dist/status/status.css +1 -1
- package/dist/status/status.js +1 -25
- package/dist/status/status.module.js +1 -7
- package/dist/steps/steps.css +1 -1
- package/dist/steps/steps.js +1 -35
- package/dist/steps/steps.module.js +1 -8
- package/dist/structured-list/structured-list.js +1 -102
- package/dist/structured-list/structured-list.module.js +1 -12
- package/dist/styles.css +395 -53
- package/dist/swap/swap.css +1 -1
- package/dist/swap/swap.js +1 -36
- package/dist/swap/swap.module.js +1 -7
- package/dist/swipe-item/swipe-item.js +1 -62
- package/dist/swipe-item/swipe-item.module.js +1 -12
- package/dist/switcher/switcher.js +1 -32
- package/dist/switcher/switcher.module.js +1 -8
- package/dist/tabs/tabs.js +1 -98
- package/dist/tabs/tabs.module.js +1 -8
- package/dist/tag/tag.js +1 -33
- package/dist/tag/tag.module.js +1 -6
- package/dist/tags-input/tags-input.js +1 -64
- package/dist/tags-input/tags-input.module.js +1 -8
- package/dist/text/text.css +1 -1
- package/dist/text/text.js +1 -16
- package/dist/text/text.module.js +1 -3
- package/dist/textarea/textarea.css +1 -1
- package/dist/textarea/textarea.js +1 -57
- package/dist/textarea/textarea.module.js +1 -9
- package/dist/tile/tile.css +1 -1
- package/dist/tile/tile.js +1 -39
- package/dist/tile/tile.module.js +1 -7
- package/dist/time-picker/time-picker.js +1 -63
- package/dist/time-picker/time-picker.module.js +1 -9
- package/dist/timeline/timeline.js +1 -55
- package/dist/timeline/timeline.module.js +1 -11
- package/dist/toast/toast.css +1 -1
- package/dist/toast/toast.js +1 -85
- package/dist/toast/toast.module.js +1 -11
- package/dist/toc/toc.css +1 -1
- package/dist/toc/toc.js +1 -43
- package/dist/toc/toc.module.js +1 -3
- package/dist/toc/use-toc-from-region.js +1 -18
- package/dist/toggle/toggle.js +1 -41
- package/dist/toggle/toggle.module.js +1 -8
- package/dist/toggle-group/toggle-group.js +1 -55
- package/dist/toggle-group/toggle-group.module.js +1 -6
- package/dist/toggletip/toggletip.js +1 -49
- package/dist/toggletip/toggletip.module.js +1 -7
- package/dist/tooltip/tooltip.css +1 -1
- package/dist/tooltip/tooltip.js +1 -58
- package/dist/tooltip/tooltip.module.js +1 -6
- package/dist/tree-view/tree-view.css +1 -1
- package/dist/tree-view/tree-view.js +1 -201
- package/dist/tree-view/tree-view.module.js +1 -13
- package/dist/user/user.js +1 -35
- package/dist/user/user.module.js +1 -9
- package/dist/virtual-list/virtual-list.js +1 -40
- package/dist/virtual-list/virtual-list.module.js +1 -7
- package/dist/visually-hidden/visually-hidden.js +1 -2
- package/dist/wheel-picker/wheel-picker.js +1 -84
- package/dist/wheel-picker/wheel-picker.module.js +1 -8
- package/package.json +4 -4
- package/readme.body.md +7 -5
|
@@ -1,33 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
root: "_root_bwapn_2",
|
|
3
|
-
toolbar: "_toolbar_bwapn_26",
|
|
4
|
-
heading: "_heading_bwapn_35",
|
|
5
|
-
title: "_title_bwapn_41",
|
|
6
|
-
description: "_description_bwapn_47",
|
|
7
|
-
search: "_search_bwapn_52",
|
|
8
|
-
batchBar: "_batchBar_bwapn_79",
|
|
9
|
-
batchCount: "_batchCount_bwapn_89",
|
|
10
|
-
batchActions: "_batchActions_bwapn_95",
|
|
11
|
-
scroller: "_scroller_bwapn_101",
|
|
12
|
-
scrollerVirtualized: "_scrollerVirtualized_bwapn_111",
|
|
13
|
-
table: "_table_bwapn_117",
|
|
14
|
-
row: "_row_bwapn_199",
|
|
15
|
-
controlCol: "_controlCol_bwapn_219",
|
|
16
|
-
controlCell: "_controlCell_bwapn_223",
|
|
17
|
-
sortButton: "_sortButton_bwapn_229",
|
|
18
|
-
emptyCell: "_emptyCell_bwapn_277",
|
|
19
|
-
expansionRow: "_expansionRow_bwapn_284",
|
|
20
|
-
expansionGrid: "_expansionGrid_bwapn_290",
|
|
21
|
-
expansionInner: "_expansionInner_bwapn_294",
|
|
22
|
-
expandButton: "_expandButton_bwapn_299",
|
|
23
|
-
chevron: "_chevron_bwapn_322",
|
|
24
|
-
shimmer: "_shimmer_bwapn_337",
|
|
25
|
-
footer: "_footer_bwapn_364",
|
|
26
|
-
pageSize: "_pageSize_bwapn_374",
|
|
27
|
-
range: "_range_bwapn_400",
|
|
28
|
-
pageButtons: "_pageButtons_bwapn_405",
|
|
29
|
-
pageButton: "_pageButton_bwapn_405",
|
|
30
|
-
srOnly: "_srOnly_bwapn_446"
|
|
31
|
-
};
|
|
32
|
-
//#endregion
|
|
33
|
-
export { e as default };
|
|
1
|
+
var e={root:`_root_1tqve_2`,toolbar:`_toolbar_1tqve_26`,heading:`_heading_1tqve_35`,title:`_title_1tqve_41`,description:`_description_1tqve_47`,search:`_search_1tqve_52`,toolbarActions:`_toolbarActions_1tqve_79`,menu:`_menu_1tqve_88`,filterRow:`_filterRow_1tqve_99`,filterInput:`_filterInput_1tqve_106`,rangeInputs:`_rangeInputs_1tqve_126`,batchBar:`_batchBar_1tqve_136`,batchCount:`_batchCount_1tqve_146`,batchActions:`_batchActions_1tqve_152`,scroller:`_scroller_1tqve_158`,scrollerVirtualized:`_scrollerVirtualized_1tqve_194`,table:`_table_1tqve_200`,totals:`_totals_1tqve_306`,groupHeader:`_groupHeader_1tqve_324`,groupRow:`_groupRow_1tqve_336`,groupToggle:`_groupToggle_1tqve_345`,chevron:`_chevron_1tqve_363`,groupCount:`_groupCount_1tqve_367`,row:`_row_1tqve_409`,headerCell:`_headerCell_1tqve_429`,headerInner:`_headerInner_1tqve_433`,resizeHandle:`_resizeHandle_1tqve_442`,controlCol:`_controlCol_1tqve_500`,controlCell:`_controlCell_1tqve_504`,sortButton:`_sortButton_1tqve_510`,sortIndex:`_sortIndex_1tqve_548`,emptyCell:`_emptyCell_1tqve_566`,expansionRow:`_expansionRow_1tqve_573`,expansionGrid:`_expansionGrid_1tqve_579`,expansionInner:`_expansionInner_1tqve_583`,expandButton:`_expandButton_1tqve_588`,shimmer:`_shimmer_1tqve_626`,footer:`_footer_1tqve_647`,pageSize:`_pageSize_1tqve_657`,range:`_range_1tqve_126`,pageButtons:`_pageButtons_1tqve_688`,pageButton:`_pageButton_1tqve_688`,srOnly:`_srOnly_1tqve_744`};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,t,n,r=!1){let i=n.rowCount-1,a=n.colCount-1,o=e=>Math.max(-1,Math.min(i,e)),s=e=>Math.max(0,Math.min(a,e));switch(t){case`ArrowDown`:return{row:o(e.row+1),col:e.col};case`ArrowUp`:return{row:o(e.row-1),col:e.col};case`ArrowRight`:return{row:e.row,col:s(e.col+1)};case`ArrowLeft`:return{row:e.row,col:s(e.col-1)};case`Home`:return r?{row:o(0),col:0}:{row:e.row,col:0};case`End`:return r?{row:i,col:a}:{row:e.row,col:a};case`PageDown`:return{row:o(e.row+n.pageRows),col:e.col};case`PageUp`:return{row:o(e.row-n.pageRows),col:e.col};default:return}}export{e as moveGridFocus};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=``;function t(t,n,r,i){let a=[],o=(t,s,c)=>{let l=n[s];if(l===void 0){for(let e of t)a.push(e);return}let u=new Map;for(let e of t){let t=r(e,l),n=String(t??``),i=u.get(n);i?i.rows.push(e):u.set(n,{value:t,rows:[e]})}for(let[t,n]of u){let r=`${c}${l}=${t}`,u=i.has(r);a.push({id:`group${e}${r}`,group:{key:r,column:l,value:n.value,depth:s,count:n.rows.length,collapsed:u},leaves:n.rows}),u||o(n.rows,s+1,`${r}${e}`)}};return o(t,0,``),a}function n(e,t){if(t===`count`)return e.length;let n=0,r=0,i=1/0,a=-1/0;for(let t of e){if(t==null||t===``)continue;let e=typeof t==`number`?t:Number(t);Number.isNaN(e)||(r++,n+=e,e<i&&(i=e),e>a&&(a=e))}if(r!==0)switch(t){case`sum`:return n;case`avg`:return n/r;case`min`:return i;default:return a}}function r(e,t){let n=new Map;for(let e of t)for(let t of e.columns)n.set(t,e.header);let r=[];for(let t of e){let e=n.get(t),i=r[r.length-1];i&&i.header===e?i.span++:r.push({header:e,span:1})}return r}export{n as aggregate,t as groupItems,r as headerSpans};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let t,n=``,r=[];return{filter(i,a){if(a===``)return t=i,n=``,r=i,i;let o=i===t;if(o&&a===n)return r;let s=o&&n!==``&&a.startsWith(n)?r:i,c=[];for(let t of s)e(t).includes(a)&&c.push(t);return t=i,n=a,r=c,c},prime(t,n,r){let i=Math.min(t.length,n+r);for(let r=n;r<i;r++)e(t[r]);return i}}}export{e as createRowSearch};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e,n){let r=e.length;if(r<2||n.length===0)return[...e];let i=Array.from({length:r},(e,t)=>t),a=()=>i.map(t=>e[t]),o=new Intl.Collator().compare,s=[],c=[];for(let l of n){let u=Array.from({length:r}),d=!0;for(let t=0;t<r;t++){let n=l.keyOf(e[t]);u[t]=n,typeof n!=`number`&&(d=!1)}let f=l.direction===`desc`?-1:1,p=new Float64Array(r);if(d)for(let e=0;e<r;e++)p[e]=u[e];else{let e=Array.from({length:r});for(let t=0;t<r;t++)e[t]=String(u[t]??``);if(n.length===1&&t(e))return i.sort((t,n)=>{let r=o(e[t],e[n]);return r===0?t-n:f*r}),a();let s=new Map;for(let t=0;t<r;t++)s.set(e[t],0);let c=[...s.keys()].sort(o);for(let e=0;e<c.length;e++)s.set(c[e],e);for(let t=0;t<r;t++)p[t]=s.get(e[t])}s.push(p),c.push(f)}let l=s.length;return i.sort((e,t)=>{for(let n=0;n<l;n++){let r=s[n],i=r[e]-r[t];if(i!==0)return c[n]*i}return e-t}),a()}function t(e){let t=Math.min(e.length,2048),n=new Set;for(let r=0;r<t;r++)n.add(e[r]);return n.size>t*.9}export{e as sortRowsBy};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
function e(e){let t=e==null?``:String(e);return/[",\r\n]/.test(t)?`"${t.replaceAll(`"`,`""`)}"`:t}function t(t,n,r){let i=[n.map(t=>e(t.header)).join(`,`)];for(let a of t)i.push(n.map(t=>e(r(a,t.key))).join(`,`));return i.join(`\r
|
|
2
|
+
`)+`\r
|
|
3
|
+
`}function n(e,t){let n=new Blob([``,e],{type:`text/csv;charset=utf-8`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=t.endsWith(`.csv`)?t:`${t}.csv`,i.click(),URL.revokeObjectURL(r)}export{n as downloadCsv,t as toCsv};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){let{viewportHeight:t,rowHeight:n,count:r,overscan:i}=e,a=e.maxCanvas??12e6,o=r*n,s=Math.min(o,a);if(r===0)return{start:0,end:0,topPad:0,bottomPad:0,canvasHeight:0,scale:1};let c=Math.max(0,s-t),l=Math.max(0,Math.min(e.scrollTop,c)),u=c>0?Math.max(0,o-t)/c:1,d=l*u,f=Math.min(r-1,Math.floor(d/n)),p=Math.ceil(t/n)+1,m=Math.max(0,f-i),h=Math.min(r,f+p+i),g=d-f*n,_=Math.max(0,l-g-(f-m)*n);return{start:m,end:h,topPad:_,bottomPad:Math.max(0,s-_-(h-m)*n),canvasHeight:s,scale:u}}function t(e,t){let{viewportHeight:n,rowHeight:r,count:i}=t,a=t.maxCanvas??12e6,o=i*r,s=Math.max(0,Math.min(o,a)-n);if(s===0)return 0;let c=Math.max(0,o-n)/s,l=Math.max(0,e*r-(n-r)/2);return Math.max(0,Math.min(s,Math.round(l/c)))}export{e as computeWindow,t as scrollTopForRow};
|
|
@@ -1,219 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./date-picker.module.js";
|
|
4
|
-
import { useId as t, useRef as n } from "react";
|
|
5
|
-
import { batch as r, cn as i, createMachine as a, useControllableSignal as o, useMachine as s, useSignal as c, useSignalEffect as l, useSignals as ee } from "@cascivo/core";
|
|
6
|
-
import { builtin as u, currentLocale as d, t as f } from "@cascivo/i18n";
|
|
7
|
-
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
8
|
-
//#region ../components/src/date-picker/date-picker.tsx
|
|
9
|
-
var h = a({
|
|
10
|
-
initial: "closed",
|
|
11
|
-
states: {
|
|
12
|
-
closed: { on: { OPEN: "open" } },
|
|
13
|
-
open: { on: { CLOSE: "closed" } }
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
function g(e) {
|
|
17
|
-
try {
|
|
18
|
-
let t = new Intl.Locale(e).weekInfo;
|
|
19
|
-
if (t) return t.firstDay % 7;
|
|
20
|
-
} catch {}
|
|
21
|
-
return 1;
|
|
22
|
-
}
|
|
23
|
-
function te(e, t, n) {
|
|
24
|
-
let r = new Date(Date.UTC(e, t, 1)), i = new Date(Date.UTC(e, t + 1, 0)), a = (r.getUTCDay() - n + 7) % 7, o = [];
|
|
25
|
-
for (let e = 0; e < a; e++) o.push(null);
|
|
26
|
-
for (let n = 1; n <= i.getUTCDate(); n++) o.push(new Date(Date.UTC(e, t, n)));
|
|
27
|
-
for (; o.length % 7 != 0;) o.push(null);
|
|
28
|
-
let s = [];
|
|
29
|
-
for (let e = 0; e < o.length; e += 7) s.push(o.slice(e, e + 7));
|
|
30
|
-
return s;
|
|
31
|
-
}
|
|
32
|
-
function _(e, t) {
|
|
33
|
-
return new Intl.DateTimeFormat(t).format(e);
|
|
34
|
-
}
|
|
35
|
-
function v(e) {
|
|
36
|
-
return e.toISOString().slice(0, 10);
|
|
37
|
-
}
|
|
38
|
-
function y(e) {
|
|
39
|
-
let [t, n, r] = e.split("-").map(Number);
|
|
40
|
-
return new Date(Date.UTC(t, n - 1, r));
|
|
41
|
-
}
|
|
42
|
-
function b({ value: a, defaultValue: b, onValueChange: ne, onChange: x, min: S, max: C, clearable: w = !1, label: T, hint: E, error: D, size: re = "md", disabled: O = !1, labels: k, className: ie, id: ae }) {
|
|
43
|
-
ee();
|
|
44
|
-
let [A, j] = s(h), M = t(), N = ae ?? `cascade-date-picker-${M}`, P = `${M}-grid`, F = d(), I = k?.placeholder ?? f(u.datePicker.placeholder), L = k?.previousMonth ?? f(u.datePicker.previousMonth), R = k?.nextMonth ?? f(u.datePicker.nextMonth), z = k?.clear ?? f(u.datePicker.clear), B = /* @__PURE__ */ new Date(), V = v(B), [H] = o({
|
|
45
|
-
value: a,
|
|
46
|
-
defaultValue: b
|
|
47
|
-
}), U = c(H.value ? y(H.value).getUTCFullYear() : B.getUTCFullYear()), W = c(H.value ? y(H.value).getUTCMonth() : B.getUTCMonth()), G = c(H.value), K = n(null);
|
|
48
|
-
l(() => {
|
|
49
|
-
if (A.value !== "open") return;
|
|
50
|
-
let e = (e) => {
|
|
51
|
-
K.current && !K.current.contains(e.target) && j("CLOSE");
|
|
52
|
-
};
|
|
53
|
-
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
54
|
-
});
|
|
55
|
-
let q = () => {
|
|
56
|
-
O || j("OPEN");
|
|
57
|
-
}, J = () => j("CLOSE"), Y = ne ?? x, X = (e) => {
|
|
58
|
-
S && e < S || C && e > C || (a === void 0 && (H.value = e), Y?.(e), J());
|
|
59
|
-
}, oe = (e) => {
|
|
60
|
-
e.stopPropagation(), a === void 0 && (H.value = void 0), Y?.(void 0);
|
|
61
|
-
}, se = () => {
|
|
62
|
-
W.value === 0 ? r(() => {
|
|
63
|
-
U.value--, W.value = 11;
|
|
64
|
-
}) : W.value--;
|
|
65
|
-
}, ce = () => {
|
|
66
|
-
W.value === 11 ? r(() => {
|
|
67
|
-
U.value++, W.value = 0;
|
|
68
|
-
}) : W.value++;
|
|
69
|
-
}, Z = g(F), le = te(U.value, W.value, Z), ue = new Intl.DateTimeFormat(F, { weekday: "short" }), de = Array.from({ length: 7 }, (e, t) => {
|
|
70
|
-
let n = new Date(Date.UTC(2024, 0, 7 + Z + t));
|
|
71
|
-
return ue.format(n);
|
|
72
|
-
}), Q = new Intl.DateTimeFormat(F, {
|
|
73
|
-
month: "long",
|
|
74
|
-
year: "numeric"
|
|
75
|
-
}).format(new Date(Date.UTC(U.value, W.value, 1))), fe = (e) => {
|
|
76
|
-
let t = G.value;
|
|
77
|
-
if (!t) return;
|
|
78
|
-
let n = y(t), i;
|
|
79
|
-
if (e.key === "ArrowRight") i = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() + 1));
|
|
80
|
-
else if (e.key === "ArrowLeft") i = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() - 1));
|
|
81
|
-
else if (e.key === "ArrowDown") i = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() + 7));
|
|
82
|
-
else if (e.key === "ArrowUp") i = new Date(Date.UTC(n.getUTCFullYear(), n.getUTCMonth(), n.getUTCDate() - 7));
|
|
83
|
-
else if (e.key === "Enter" || e.key === " ") {
|
|
84
|
-
e.preventDefault(), X(t);
|
|
85
|
-
return;
|
|
86
|
-
} else if (e.key === "Escape") {
|
|
87
|
-
J();
|
|
88
|
-
return;
|
|
89
|
-
} else return;
|
|
90
|
-
if (e.preventDefault(), i) {
|
|
91
|
-
let e = v(i);
|
|
92
|
-
if (S && e < S || C && e > C) return;
|
|
93
|
-
G.value = e, r(() => {
|
|
94
|
-
U.value = i.getUTCFullYear(), W.value = i.getUTCMonth();
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}, $ = H.value ? _(y(H.value), F) : "";
|
|
98
|
-
return /* @__PURE__ */ m("div", {
|
|
99
|
-
ref: K,
|
|
100
|
-
className: i(e.wrapper, ie),
|
|
101
|
-
"data-state": D ? "error" : A.value,
|
|
102
|
-
"data-size": re,
|
|
103
|
-
children: [
|
|
104
|
-
T && /* @__PURE__ */ p("label", {
|
|
105
|
-
className: e.label,
|
|
106
|
-
htmlFor: N,
|
|
107
|
-
children: T
|
|
108
|
-
}),
|
|
109
|
-
/* @__PURE__ */ m("div", {
|
|
110
|
-
className: e.field,
|
|
111
|
-
children: [/* @__PURE__ */ m("button", {
|
|
112
|
-
id: N,
|
|
113
|
-
type: "button",
|
|
114
|
-
role: "combobox",
|
|
115
|
-
"aria-expanded": A.value === "open",
|
|
116
|
-
"aria-controls": P,
|
|
117
|
-
"aria-haspopup": "dialog",
|
|
118
|
-
"aria-invalid": D ? !0 : void 0,
|
|
119
|
-
"aria-describedby": D ? `${M}-error` : E ? `${M}-hint` : void 0,
|
|
120
|
-
className: e.trigger,
|
|
121
|
-
disabled: O,
|
|
122
|
-
onClick: A.value === "open" ? J : q,
|
|
123
|
-
children: [/* @__PURE__ */ p("span", {
|
|
124
|
-
className: i(e.value, $ ? void 0 : e.placeholder),
|
|
125
|
-
children: $ || I
|
|
126
|
-
}), /* @__PURE__ */ p("span", {
|
|
127
|
-
className: e.icon,
|
|
128
|
-
"aria-hidden": "true",
|
|
129
|
-
children: "📅"
|
|
130
|
-
})]
|
|
131
|
-
}), w && H.value !== void 0 && /* @__PURE__ */ p("button", {
|
|
132
|
-
type: "button",
|
|
133
|
-
className: e.clear,
|
|
134
|
-
"aria-label": z,
|
|
135
|
-
onClick: oe,
|
|
136
|
-
children: "✕"
|
|
137
|
-
})]
|
|
138
|
-
}),
|
|
139
|
-
/* @__PURE__ */ m("div", {
|
|
140
|
-
id: P,
|
|
141
|
-
role: "dialog",
|
|
142
|
-
"aria-label": Q,
|
|
143
|
-
className: e.calendar,
|
|
144
|
-
"data-state": A.value,
|
|
145
|
-
onKeyDown: fe,
|
|
146
|
-
children: [/* @__PURE__ */ m("div", {
|
|
147
|
-
className: e.header,
|
|
148
|
-
children: [
|
|
149
|
-
/* @__PURE__ */ p("button", {
|
|
150
|
-
type: "button",
|
|
151
|
-
className: e.navButton,
|
|
152
|
-
"aria-label": L,
|
|
153
|
-
onClick: se,
|
|
154
|
-
children: "‹"
|
|
155
|
-
}),
|
|
156
|
-
/* @__PURE__ */ p("span", {
|
|
157
|
-
className: e.monthLabel,
|
|
158
|
-
"aria-live": "polite",
|
|
159
|
-
children: Q
|
|
160
|
-
}),
|
|
161
|
-
/* @__PURE__ */ p("button", {
|
|
162
|
-
type: "button",
|
|
163
|
-
className: e.navButton,
|
|
164
|
-
"aria-label": R,
|
|
165
|
-
onClick: ce,
|
|
166
|
-
children: "›"
|
|
167
|
-
})
|
|
168
|
-
]
|
|
169
|
-
}), /* @__PURE__ */ m("table", {
|
|
170
|
-
role: "grid",
|
|
171
|
-
className: e.grid,
|
|
172
|
-
children: [/* @__PURE__ */ p("thead", { children: /* @__PURE__ */ p("tr", { children: de.map((t) => /* @__PURE__ */ p("th", {
|
|
173
|
-
className: e.weekday,
|
|
174
|
-
abbr: t,
|
|
175
|
-
scope: "col",
|
|
176
|
-
children: t
|
|
177
|
-
}, t)) }) }), /* @__PURE__ */ p("tbody", { children: le.map((t, n) => /* @__PURE__ */ p("tr", { children: t.map((t, n) => {
|
|
178
|
-
if (!t) return /* @__PURE__ */ p("td", { className: e.empty }, n);
|
|
179
|
-
let r = v(t), i = r === H.value, a = r === V, o = r === G.value, s = S !== void 0 && r < S || C !== void 0 && r > C;
|
|
180
|
-
return /* @__PURE__ */ p("td", {
|
|
181
|
-
className: e.cell,
|
|
182
|
-
children: /* @__PURE__ */ p("button", {
|
|
183
|
-
type: "button",
|
|
184
|
-
className: e.day,
|
|
185
|
-
tabIndex: o ? 0 : -1,
|
|
186
|
-
"aria-pressed": i,
|
|
187
|
-
"aria-label": _(t, F),
|
|
188
|
-
"aria-current": a ? "date" : void 0,
|
|
189
|
-
"aria-disabled": s || void 0,
|
|
190
|
-
"data-selected": i || void 0,
|
|
191
|
-
"data-today": a || void 0,
|
|
192
|
-
onClick: () => {
|
|
193
|
-
s || X(r);
|
|
194
|
-
},
|
|
195
|
-
onFocus: () => {
|
|
196
|
-
G.value = r;
|
|
197
|
-
},
|
|
198
|
-
children: t.getUTCDate()
|
|
199
|
-
})
|
|
200
|
-
}, n);
|
|
201
|
-
}) }, n)) })]
|
|
202
|
-
})]
|
|
203
|
-
}),
|
|
204
|
-
D && /* @__PURE__ */ p("span", {
|
|
205
|
-
id: `${M}-error`,
|
|
206
|
-
className: e.error,
|
|
207
|
-
role: "alert",
|
|
208
|
-
children: D
|
|
209
|
-
}),
|
|
210
|
-
!D && E && /* @__PURE__ */ p("span", {
|
|
211
|
-
id: `${M}-hint`,
|
|
212
|
-
className: e.hint,
|
|
213
|
-
children: E
|
|
214
|
-
})
|
|
215
|
-
]
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
//#endregion
|
|
219
|
-
export { b as DatePicker };
|
|
1
|
+
"use client";import{Calendar as e}from"../calendar/calendar.js";import{formatDate as t,formatHint as ee,fromISO as n,parseTypedDate as te,toISO as r}from"./parse-date.js";import i from"./date-picker.module.js";import{useId as ne,useRef as a}from"react";import{DismissableLayer as o,cn as s,focusElement as c,useControllableSignal as l,useSignal as re,useSignalEffect as ie,useSignals as ae}from"@cascivo/core";import{builtin as u,currentLocale as d,t as f}from"@cascivo/i18n";import{jsx as p,jsxs as m}from"react/jsx-runtime";function oe(...e){return e.filter(Boolean).join(` `)||void 0}function h({value:h,defaultValue:se,onValueChange:ce,min:g,max:_,disabledDate:v,clearable:y=!1,label:b,ariaLabel:x,hint:S,error:C,size:w=`md`,disabled:T=!1,typeable:E=!0,format:le,showToday:ue=!1,name:D,required:de,open:O,onOpenChange:fe,labels:k,className:pe,id:me,"aria-labelledby":he,"aria-describedby":ge,"aria-invalid":_e}){ae();let A=ne(),j=me??`cascade-date-picker-${A}`,M=`${A}-dialog`,N=d(),P=k?.placeholder??f(u.datePicker.placeholder),F=k?.clear??f(u.datePicker.clear),ve=k?.open??f(u.datePicker.open),I=a(null),L=a(null),R=a(null),[z,ye]=l({value:h,defaultValue:se,onChange:ce}),[B,V]=l({value:O,defaultValue:!1,onChange:fe}),H=B.value,U=z.value?n(z.value):null,W=g?n(g):null,G=_?n(_):null,K=U?t(U,N,le):``,q=re(null),be=q.value??K;function J(){T||V(!0)}function Y(e=!0){V(!1),e&&c(E?I.current:L.current)}let X=a(!1);ie(()=>{if(B.value){X.current=!0;let e=setTimeout(()=>{c(R.current?.querySelector(`[tabindex="0"]`)??null)},0);return()=>clearTimeout(e)}X.current=!1});function Z(e){q.value=null,ye(e?r(e):void 0)}function Q(){let e=q.peek();if(e===null)return;if(e.trim()===``){Z(null);return}let t=te(e,N,U?.getUTCFullYear());t&&!xe(t)?Z(t):q.value=null}function xe(e){return W&&e.getTime()<W.getTime()||G&&e.getTime()>G.getTime()?!0:v?.(e)??!1}function Se(e){if(!T){if(e.altKey&&e.key===`ArrowDown`){e.preventDefault(),J();return}switch(e.key){case`ArrowDown`:e.preventDefault(),J();break;case`Enter`:E&&(e.preventDefault(),Q());break;case`Escape`:H?(e.preventDefault(),e.stopPropagation(),Y()):q.peek()!==null&&(q.value=null);break;case`Backspace`:case`Delete`:!E&&y&&z.peek()!==void 0&&(e.preventDefault(),Z(null));break}}}let Ce=oe(C?`${A}-error`:S?`${A}-hint`:void 0,ge),$={id:j,role:`combobox`,"aria-expanded":H,"aria-controls":M,"aria-haspopup":`dialog`,"aria-labelledby":he,"aria-label":x,"aria-invalid":C?!0:_e,"aria-describedby":Ce,"aria-required":de||void 0,disabled:T,onKeyDown:Se};return p(o,{onDismiss:()=>H&&Y(!1),children:m(`div`,{className:s(i.wrapper,pe),"data-state":C?`error`:H?`open`:`closed`,"data-size":w,children:[b&&p(`label`,{className:i.label,htmlFor:j,children:b}),m(`div`,{className:i.field,children:[E?p(`input`,{...$,ref:I,type:`text`,className:i.trigger,autoComplete:`off`,inputMode:`numeric`,placeholder:P||ee(N),value:be,onChange:e=>{q.value=e.currentTarget.value},onBlur:Q}):p(`button`,{...$,ref:L,type:`button`,className:i.trigger,children:p(`span`,{className:s(i.value,K?void 0:i.placeholder),children:K||P})}),y&&z.value!==void 0&&!T&&p(`button`,{type:`button`,className:i.clear,"aria-label":F,onClick:()=>{Z(null),c(E?I.current:L.current)},children:p(`span`,{className:i.clearGlyph,"aria-hidden":`true`})}),p(`button`,{ref:E?L:void 0,type:`button`,className:i.openButton,"aria-label":ve,"aria-expanded":H,"aria-controls":M,disabled:T,onClick:()=>H?Y():J(),children:p(`span`,{className:i.calendarGlyph,"aria-hidden":`true`})})]}),D!==void 0&&p(`input`,{type:`hidden`,name:D,value:z.value??``}),p(`div`,{ref:R,id:M,role:`dialog`,"aria-label":b??x??P,className:i.popup,"data-state":H?`open`:`closed`,onKeyDown:e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Y())},children:p(e,{value:U,onValueChange:e=>{Z(e),Y()},...W?{min:W}:{},...G?{max:G}:{},...v?{disabled:v}:{},labels:{...k?.previousMonth?{previousMonth:k.previousMonth}:{},...k?.nextMonth?{nextMonth:k.nextMonth}:{},...k?.today?{today:k.today}:{}},showToday:ue,size:w,locale:N})}),C&&p(`span`,{id:`${A}-error`,className:i.error,role:`alert`,children:C}),!C&&S&&p(`span`,{id:`${A}-hint`,className:i.hint,children:S})]})})}export{h as DatePicker};
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
wrapper: "_wrapper_g43fz_2",
|
|
3
|
-
label: "_label_g43fz_31",
|
|
4
|
-
field: "_field_g43fz_38",
|
|
5
|
-
trigger: "_trigger_g43fz_44",
|
|
6
|
-
value: "_value_g43fz_82",
|
|
7
|
-
placeholder: "_placeholder_g43fz_88",
|
|
8
|
-
icon: "_icon_g43fz_91",
|
|
9
|
-
clear: "_clear_g43fz_96",
|
|
10
|
-
calendar: "_calendar_g43fz_121",
|
|
11
|
-
header: "_header_g43fz_153",
|
|
12
|
-
monthLabel: "_monthLabel_g43fz_160",
|
|
13
|
-
navButton: "_navButton_g43fz_166",
|
|
14
|
-
grid: "_grid_g43fz_188",
|
|
15
|
-
weekday: "_weekday_g43fz_193",
|
|
16
|
-
cell: "_cell_g43fz_202",
|
|
17
|
-
empty: "_empty_g43fz_206",
|
|
18
|
-
day: "_day_g43fz_210",
|
|
19
|
-
error: "_error_g43fz_245",
|
|
20
|
-
hint: "_hint_g43fz_249"
|
|
21
|
-
};
|
|
22
|
-
//#endregion
|
|
23
|
-
export { e as default };
|
|
1
|
+
var e={wrapper:`_wrapper_7wyss_3`,label:`_label_7wyss_42`,field:`_field_7wyss_49`,trigger:`_trigger_7wyss_55`,value:`_value_7wyss_93`,placeholder:`_placeholder_7wyss_99`,clear:`_clear_7wyss_103`,popup:`_popup_7wyss_128`,error:`_error_7wyss_160`,hint:`_hint_7wyss_164`,openButton:`_openButton_7wyss_169`,calendarGlyph:`_calendarGlyph_7wyss_194`,clearGlyph:`_clearGlyph_7wyss_195`};export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return`${String(e.getUTCFullYear()).padStart(4,`0`)}-${String(e.getUTCMonth()+1).padStart(2,`0`)}-${String(e.getUTCDate()).padStart(2,`0`)}`}function t(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e.trim());return t?n(Number(t[1]),Number(t[2]),Number(t[3])):null}function n(e,t,n){if(t<1||t>12||n<1||n>31)return null;let r=new Date(Date.UTC(e,t-1,n));return r.getUTCMonth()!==t-1||r.getUTCDate()!==n?null:r}function r(e){try{return new Intl.DateTimeFormat(e).formatToParts(new Date(Date.UTC(2026,0,2))).filter(e=>e.type===`day`||e.type===`month`).map(e=>e.type)[0]===`day`}catch{return!1}}function i(e,i,a){let o=e.trim();if(o===``)return null;let s=t(o);if(s)return s;let c=o.split(/[/.\-\s]+/).filter(Boolean);if(c.length<2||c.length>3||!c.every(e=>/^\d{1,4}$/.test(e)))return null;let l=c.map(Number),u=r(i),d,f,p;return l.length===2?([d,f]=u?[l[0],l[1]]:[l[1],l[0]],p=a??new Date().getFullYear()):([d,f]=u?[l[0],l[1]]:[l[1],l[0]],p=l[2],c[2].length<=2&&(p=2e3+p)),n(p,f,d)}function a(e,t,n){return new Intl.DateTimeFormat(t,n??{timeZone:`UTC`}).format(e)}function o(e){try{return new Intl.DateTimeFormat(e,{timeZone:`UTC`}).formatToParts(new Date(Date.UTC(2026,10,22))).map(e=>e.type===`day`?`DD`:e.type===`month`?`MM`:e.type===`year`?`YYYY`:e.value).join(``)}catch{return`YYYY-MM-DD`}}export{a as formatDate,o as formatHint,t as fromISO,i as parseTypedDate,e as toISO};
|
|
@@ -1,196 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { Calendar as e } from "../calendar/calendar.js";
|
|
4
|
-
import t from "./date-range-picker.module.js";
|
|
5
|
-
import { useRef as n } from "react";
|
|
6
|
-
import { batch as r, cn as i, useControllableSignal as a, useSignal as o, useSignalEffect as s, useSignals as ee } from "@cascivo/core";
|
|
7
|
-
import { builtin as c, currentLocale as l, t as u } from "@cascivo/i18n";
|
|
8
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
9
|
-
//#region ../components/src/date-range-picker/date-range-picker.tsx
|
|
10
|
-
function p(e) {
|
|
11
|
-
return Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate());
|
|
12
|
-
}
|
|
13
|
-
function m(e, t) {
|
|
14
|
-
return !e || !t ? !1 : p(e) === p(t);
|
|
15
|
-
}
|
|
16
|
-
function h(e, t, n) {
|
|
17
|
-
let r = new Date(Date.UTC(e, t + n, 1));
|
|
18
|
-
return {
|
|
19
|
-
year: r.getUTCFullYear(),
|
|
20
|
-
month: r.getUTCMonth()
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
function g({ value: g, defaultValue: _, onValueChange: v, min: y, max: b, disabled: x, presets: S, locale: C, placeholder: w, size: T = "md", labels: E, className: D }) {
|
|
24
|
-
ee();
|
|
25
|
-
let O = C ?? l(), te = w ?? u(c.dateRangePicker.placeholder), ne = E?.apply ?? u(c.dateRangePicker.apply), re = E?.clear ?? u(c.dateRangePicker.clear), k = E?.previousMonth ?? u(c.calendar.previousMonth), A = E?.nextMonth ?? u(c.calendar.nextMonth), [j, M] = a({
|
|
26
|
-
value: g === void 0 ? void 0 : g,
|
|
27
|
-
defaultValue: _ ?? null,
|
|
28
|
-
onChange: (e) => {
|
|
29
|
-
e && v?.(e);
|
|
30
|
-
}
|
|
31
|
-
}), N = o(!1), P = o(null), F = o(null), I = j.value?.start ?? _?.start ?? /* @__PURE__ */ new Date(), L = o(I.getUTCFullYear()), R = o(I.getUTCMonth()), z = n(null);
|
|
32
|
-
s(() => {
|
|
33
|
-
if (!N.value) return;
|
|
34
|
-
let e = (e) => {
|
|
35
|
-
z.current && !z.current.contains(e.target) && (N.value = !1);
|
|
36
|
-
};
|
|
37
|
-
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
38
|
-
});
|
|
39
|
-
let B = () => {
|
|
40
|
-
N.value = !0;
|
|
41
|
-
}, V = () => {
|
|
42
|
-
N.value = !1;
|
|
43
|
-
}, H = (e) => {
|
|
44
|
-
let t = h(L.value, R.value, e);
|
|
45
|
-
r(() => {
|
|
46
|
-
L.value = t.year, R.value = t.month;
|
|
47
|
-
});
|
|
48
|
-
}, U = (e) => {
|
|
49
|
-
let t = P.value;
|
|
50
|
-
if (t === null) {
|
|
51
|
-
P.value = e;
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
if (m(t, e)) {
|
|
55
|
-
r(() => {
|
|
56
|
-
P.value = null, F.value = null;
|
|
57
|
-
}), M(null);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
let n = p(t) <= p(e) ? {
|
|
61
|
-
start: t,
|
|
62
|
-
end: e
|
|
63
|
-
} : {
|
|
64
|
-
start: e,
|
|
65
|
-
end: t
|
|
66
|
-
};
|
|
67
|
-
r(() => {
|
|
68
|
-
P.value = null, F.value = null;
|
|
69
|
-
}), M(n);
|
|
70
|
-
}, W = (e) => {
|
|
71
|
-
r(() => {
|
|
72
|
-
P.value = null, F.value = null, L.value = e.range.start.getUTCFullYear(), R.value = e.range.start.getUTCMonth();
|
|
73
|
-
}), M(e.range);
|
|
74
|
-
}, G = () => {
|
|
75
|
-
r(() => {
|
|
76
|
-
P.value = null, F.value = null;
|
|
77
|
-
}), M(null);
|
|
78
|
-
}, K = P.value ?? j.value?.start ?? null, q = P.value ? F.value ?? null : j.value?.end ?? null, J = K && q ? Math.min(p(K), p(q)) : null, Y = K && q ? Math.max(p(K), p(q)) : null, ie = (e) => {
|
|
79
|
-
if (J === null || Y === null) return !1;
|
|
80
|
-
let t = p(e);
|
|
81
|
-
return t > J && t < Y;
|
|
82
|
-
}, ae = (e) => m(e, K) || J !== null && p(e) === J, oe = (e) => m(e, q) || Y !== null && p(e) === Y, X = new Intl.DateTimeFormat(O, {
|
|
83
|
-
year: "numeric",
|
|
84
|
-
month: "short",
|
|
85
|
-
day: "numeric"
|
|
86
|
-
}), Z = j.value ? `${X.format(j.value.start)} → ${X.format(j.value.end)}` : "", Q = h(L.value, R.value, 1), $ = {
|
|
87
|
-
locale: O,
|
|
88
|
-
size: T,
|
|
89
|
-
...y === void 0 ? {} : { min: y },
|
|
90
|
-
...b === void 0 ? {} : { max: b },
|
|
91
|
-
...x === void 0 ? {} : { disabled: x },
|
|
92
|
-
hideNav: !0,
|
|
93
|
-
isInRange: ie,
|
|
94
|
-
isRangeStart: ae,
|
|
95
|
-
isRangeEnd: oe,
|
|
96
|
-
onValueChange: U,
|
|
97
|
-
onDayHover: (e) => {
|
|
98
|
-
F.value = e;
|
|
99
|
-
},
|
|
100
|
-
labels: {
|
|
101
|
-
previousMonth: k,
|
|
102
|
-
nextMonth: A
|
|
103
|
-
}
|
|
104
|
-
};
|
|
105
|
-
return /* @__PURE__ */ f("div", {
|
|
106
|
-
ref: z,
|
|
107
|
-
className: i(t.wrapper, D),
|
|
108
|
-
"data-size": T,
|
|
109
|
-
onKeyDown: (e) => {
|
|
110
|
-
e.key === "Escape" && N.value && (e.stopPropagation(), V());
|
|
111
|
-
},
|
|
112
|
-
children: [/* @__PURE__ */ f("button", {
|
|
113
|
-
type: "button",
|
|
114
|
-
role: "combobox",
|
|
115
|
-
"aria-expanded": N.value,
|
|
116
|
-
"aria-haspopup": "dialog",
|
|
117
|
-
"aria-label": E?.label ?? u(c.dateRangePicker.label),
|
|
118
|
-
className: t.trigger,
|
|
119
|
-
onClick: N.value ? V : B,
|
|
120
|
-
children: [/* @__PURE__ */ d("span", {
|
|
121
|
-
className: i(t.value, Z ? void 0 : t.placeholder),
|
|
122
|
-
children: Z || te
|
|
123
|
-
}), /* @__PURE__ */ d("span", {
|
|
124
|
-
className: t.icon,
|
|
125
|
-
"aria-hidden": "true",
|
|
126
|
-
children: "📅"
|
|
127
|
-
})]
|
|
128
|
-
}), /* @__PURE__ */ f("div", {
|
|
129
|
-
role: "dialog",
|
|
130
|
-
className: t.panel,
|
|
131
|
-
"data-state": N.value ? "open" : "closed",
|
|
132
|
-
children: [
|
|
133
|
-
S && S.length > 0 && /* @__PURE__ */ d("div", {
|
|
134
|
-
className: t.presets,
|
|
135
|
-
children: S.map((e) => /* @__PURE__ */ d("button", {
|
|
136
|
-
type: "button",
|
|
137
|
-
className: t.preset,
|
|
138
|
-
onClick: () => W(e),
|
|
139
|
-
children: e.label
|
|
140
|
-
}, e.label))
|
|
141
|
-
}),
|
|
142
|
-
/* @__PURE__ */ f("div", {
|
|
143
|
-
className: t.calendars,
|
|
144
|
-
children: [
|
|
145
|
-
/* @__PURE__ */ d("div", {
|
|
146
|
-
className: t.calNav,
|
|
147
|
-
children: /* @__PURE__ */ d("button", {
|
|
148
|
-
type: "button",
|
|
149
|
-
className: t.navButton,
|
|
150
|
-
"aria-label": k,
|
|
151
|
-
onClick: () => H(-1),
|
|
152
|
-
children: "‹"
|
|
153
|
-
})
|
|
154
|
-
}),
|
|
155
|
-
/* @__PURE__ */ d(e, {
|
|
156
|
-
month: R.value,
|
|
157
|
-
year: L.value,
|
|
158
|
-
...$
|
|
159
|
-
}),
|
|
160
|
-
/* @__PURE__ */ d(e, {
|
|
161
|
-
month: Q.month,
|
|
162
|
-
year: Q.year,
|
|
163
|
-
...$
|
|
164
|
-
}),
|
|
165
|
-
/* @__PURE__ */ d("div", {
|
|
166
|
-
className: t.calNav,
|
|
167
|
-
children: /* @__PURE__ */ d("button", {
|
|
168
|
-
type: "button",
|
|
169
|
-
className: t.navButton,
|
|
170
|
-
"aria-label": A,
|
|
171
|
-
onClick: () => H(1),
|
|
172
|
-
children: "›"
|
|
173
|
-
})
|
|
174
|
-
})
|
|
175
|
-
]
|
|
176
|
-
}),
|
|
177
|
-
/* @__PURE__ */ f("div", {
|
|
178
|
-
className: t.footer,
|
|
179
|
-
children: [/* @__PURE__ */ d("button", {
|
|
180
|
-
type: "button",
|
|
181
|
-
className: t.clearBtn,
|
|
182
|
-
onClick: G,
|
|
183
|
-
children: re
|
|
184
|
-
}), /* @__PURE__ */ d("button", {
|
|
185
|
-
type: "button",
|
|
186
|
-
className: t.applyBtn,
|
|
187
|
-
onClick: V,
|
|
188
|
-
children: ne
|
|
189
|
-
})]
|
|
190
|
-
})
|
|
191
|
-
]
|
|
192
|
-
})]
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
//#endregion
|
|
196
|
-
export { g as DateRangePicker };
|
|
1
|
+
"use client";import{Calendar as e}from"../calendar/calendar.js";import t from"./date-range-picker.module.js";import{useRef as n}from"react";import{batch as r,cn as i,useControllableSignal as a,useSignal as o,useSignalEffect as s,useSignals as ee}from"@cascivo/core";import{builtin as c,currentLocale as l,t as u}from"@cascivo/i18n";import{jsx as d,jsxs as f}from"react/jsx-runtime";function p(e){return Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate())}function m(e,t){return!e||!t?!1:p(e)===p(t)}function h(e,t,n){let r=new Date(Date.UTC(e,t+n,1));return{year:r.getUTCFullYear(),month:r.getUTCMonth()}}function g({value:g,defaultValue:_,onValueChange:v,min:y,max:b,disabled:x,presets:S,locale:C,placeholder:w,size:T=`md`,labels:E,className:D}){ee();let O=C??l(),te=w??u(c.dateRangePicker.placeholder),ne=E?.apply??u(c.dateRangePicker.apply),re=E?.clear??u(c.dateRangePicker.clear),k=E?.previousMonth??u(c.calendar.previousMonth),A=E?.nextMonth??u(c.calendar.nextMonth),[j,M]=a({value:g===void 0?void 0:g,defaultValue:_??null,onChange:e=>{e&&v?.(e)}}),N=o(!1),P=o(null),F=o(null),I=j.value?.start??_?.start??new Date,L=o(I.getUTCFullYear()),R=o(I.getUTCMonth()),z=n(null);s(()=>{if(!N.value)return;let e=e=>{z.current&&!z.current.contains(e.target)&&(N.value=!1)};return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)});let B=()=>{N.value=!0},V=()=>{N.value=!1},H=e=>{let t=h(L.value,R.value,e);r(()=>{L.value=t.year,R.value=t.month})},U=e=>{let t=P.value;if(t===null){P.value=e;return}if(m(t,e)){r(()=>{P.value=null,F.value=null}),M(null);return}let n=p(t)<=p(e)?{start:t,end:e}:{start:e,end:t};r(()=>{P.value=null,F.value=null}),M(n)},W=e=>{r(()=>{P.value=null,F.value=null,L.value=e.range.start.getUTCFullYear(),R.value=e.range.start.getUTCMonth()}),M(e.range)},G=()=>{r(()=>{P.value=null,F.value=null}),M(null)},K=P.value??j.value?.start??null,q=P.value?F.value??null:j.value?.end??null,J=K&&q?Math.min(p(K),p(q)):null,Y=K&&q?Math.max(p(K),p(q)):null,ie=e=>{if(J===null||Y===null)return!1;let t=p(e);return t>J&&t<Y},ae=e=>m(e,K)||J!==null&&p(e)===J,oe=e=>m(e,q)||Y!==null&&p(e)===Y,X=new Intl.DateTimeFormat(O,{year:`numeric`,month:`short`,day:`numeric`}),Z=j.value?`${X.format(j.value.start)} → ${X.format(j.value.end)}`:``,Q=h(L.value,R.value,1),$={locale:O,size:T,...y===void 0?{}:{min:y},...b===void 0?{}:{max:b},...x===void 0?{}:{disabled:x},hideNav:!0,isInRange:ie,isRangeStart:ae,isRangeEnd:oe,onValueChange:U,onDayHover:e=>{F.value=e},labels:{previousMonth:k,nextMonth:A}};return f(`div`,{ref:z,className:i(t.wrapper,D),"data-size":T,onKeyDown:e=>{e.key===`Escape`&&N.value&&(e.stopPropagation(),V())},children:[f(`button`,{type:`button`,role:`combobox`,"aria-expanded":N.value,"aria-haspopup":`dialog`,"aria-label":E?.label??u(c.dateRangePicker.label),className:t.trigger,onClick:N.value?V:B,children:[d(`span`,{className:i(t.value,Z?void 0:t.placeholder),children:Z||te}),d(`span`,{className:t.icon,"aria-hidden":`true`,children:`📅`})]}),f(`div`,{role:`dialog`,className:t.panel,"data-state":N.value?`open`:`closed`,children:[S&&S.length>0&&d(`div`,{className:t.presets,children:S.map(e=>d(`button`,{type:`button`,className:t.preset,onClick:()=>W(e),children:e.label},e.id??e.label))}),f(`div`,{className:t.calendars,children:[d(`div`,{className:t.calNav,children:d(`button`,{type:`button`,className:t.navButton,"aria-label":k,onClick:()=>H(-1),children:`‹`})}),d(e,{month:R.value,year:L.value,...$}),d(e,{month:Q.month,year:Q.year,...$}),d(`div`,{className:t.calNav,children:d(`button`,{type:`button`,className:t.navButton,"aria-label":A,onClick:()=>H(1),children:`›`})})]}),f(`div`,{className:t.footer,children:[d(`button`,{type:`button`,className:t.clearBtn,onClick:G,children:re}),d(`button`,{type:`button`,className:t.applyBtn,onClick:V,children:ne})]})]})]})}export{g as DateRangePicker};
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
wrapper: "_wrapper_k1szr_2",
|
|
3
|
-
trigger: "_trigger_k1szr_25",
|
|
4
|
-
value: "_value_k1szr_55",
|
|
5
|
-
placeholder: "_placeholder_k1szr_61",
|
|
6
|
-
icon: "_icon_k1szr_64",
|
|
7
|
-
panel: "_panel_k1szr_69",
|
|
8
|
-
calendars: "_calendars_k1szr_104",
|
|
9
|
-
calNav: "_calNav_k1szr_110",
|
|
10
|
-
navButton: "_navButton_k1szr_116",
|
|
11
|
-
presets: "_presets_k1szr_139",
|
|
12
|
-
preset: "_preset_k1szr_139",
|
|
13
|
-
footer: "_footer_k1szr_166",
|
|
14
|
-
clearBtn: "_clearBtn_k1szr_175",
|
|
15
|
-
applyBtn: "_applyBtn_k1szr_176"
|
|
16
|
-
};
|
|
17
|
-
//#endregion
|
|
18
|
-
export { e as default };
|
|
1
|
+
var e={wrapper:`_wrapper_k1szr_2`,trigger:`_trigger_k1szr_25`,value:`_value_k1szr_55`,placeholder:`_placeholder_k1szr_61`,icon:`_icon_k1szr_64`,panel:`_panel_k1szr_69`,calendars:`_calendars_k1szr_104`,calNav:`_calNav_k1szr_110`,navButton:`_navButton_k1szr_116`,presets:`_presets_k1szr_139`,preset:`_preset_k1szr_139`,footer:`_footer_k1szr_166`,clearBtn:`_clearBtn_k1szr_175`,applyBtn:`_applyBtn_k1szr_176`};export{e as default};
|
package/dist/node/dock/dock.js
CHANGED
|
@@ -1,34 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import e from "./dock.module.js";
|
|
4
|
-
import { getLinkComponent as t, useSignals as n } from "@cascivo/core";
|
|
5
|
-
import { builtin as r, t as i } from "@cascivo/i18n";
|
|
6
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
//#region ../components/src/dock/dock.tsx
|
|
8
|
-
function s({ items: s, activeIndex: c, className: l, ariaLabel: u }) {
|
|
9
|
-
return n(), /* @__PURE__ */ a("nav", {
|
|
10
|
-
"aria-label": u ?? i(r.dock.nav),
|
|
11
|
-
className: [e.dock, l].filter(Boolean).join(" "),
|
|
12
|
-
children: s.map((n, r) => {
|
|
13
|
-
let i = r === c;
|
|
14
|
-
return /* @__PURE__ */ o(n.href ? t() : "button", {
|
|
15
|
-
className: e.item,
|
|
16
|
-
"data-active": i || void 0,
|
|
17
|
-
"aria-current": i ? "page" : void 0,
|
|
18
|
-
...n.href ? { href: n.href } : {},
|
|
19
|
-
type: n.href ? void 0 : "button",
|
|
20
|
-
onClick: n.onClick,
|
|
21
|
-
children: [/* @__PURE__ */ a("span", {
|
|
22
|
-
className: e.icon,
|
|
23
|
-
"aria-hidden": "true",
|
|
24
|
-
children: n.icon
|
|
25
|
-
}), /* @__PURE__ */ a("span", {
|
|
26
|
-
className: e.label,
|
|
27
|
-
children: n.label
|
|
28
|
-
})]
|
|
29
|
-
}, n.id ?? `${r}-${n.label}`);
|
|
30
|
-
})
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
//#endregion
|
|
34
|
-
export { s as Dock };
|
|
1
|
+
"use client";import e from"./dock.module.js";import{getLinkComponent as t,useSignals as n}from"@cascivo/core";import{builtin as r,t as i}from"@cascivo/i18n";import{jsx as a,jsxs as o}from"react/jsx-runtime";function s({items:s,activeIndex:c,className:l,ariaLabel:u,label:d}){return n(),a(`nav`,{"aria-label":u??d??i(r.dock.nav),className:[e.dock,l].filter(Boolean).join(` `),children:s.map((n,r)=>{let i=r===c;return o(n.href?t():`button`,{className:e.item,"data-active":i||void 0,"aria-current":i?`page`:void 0,...n.href?{href:n.href}:{},type:n.href?void 0:`button`,onClick:n.onClick,children:[a(`span`,{className:e.icon,"aria-hidden":`true`,children:n.icon}),a(`span`,{className:e.label,children:n.label})]},n.id??`${r}-${n.label}`)})})}export{s as Dock};
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
var e
|
|
2
|
-
dock: "_dock_cqgv4_2",
|
|
3
|
-
item: "_item_cqgv4_20",
|
|
4
|
-
icon: "_icon_cqgv4_47",
|
|
5
|
-
label: "_label_cqgv4_54"
|
|
6
|
-
};
|
|
7
|
-
//#endregion
|
|
8
|
-
export { e as default };
|
|
1
|
+
var e={dock:`_dock_ggq7w_2`,item:`_item_ggq7w_23`,icon:`_icon_ggq7w_50`,label:`_label_ggq7w_57`};export{e as default};
|