@quan-erp/shared-ui 1.0.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 +90 -0
- package/dist/common/common.d.ts +2 -0
- package/dist/components/blocks/editor-00/editor.d.ts +8 -0
- package/dist/components/blocks/editor-00/nodes.d.ts +3 -0
- package/dist/components/blocks/editor-00/plugins.d.ts +2 -0
- package/dist/components/custom/confirm-dialog.d.ts +15 -0
- package/dist/components/custom/dashboard.d.ts +22 -0
- package/dist/components/custom/data-table/cursor-based-pagination.d.ts +9 -0
- package/dist/components/custom/data-table/data-table-bulk-action-menu.d.ts +9 -0
- package/dist/components/custom/data-table/data-table-bulk-export.d.ts +8 -0
- package/dist/components/custom/data-table/data-table-column-header.d.ts +9 -0
- package/dist/components/custom/data-table/data-table-grid.d.ts +21 -0
- package/dist/components/custom/data-table/data-table-group-by.types.d.ts +11 -0
- package/dist/components/custom/data-table/data-table-helper.d.ts +2 -0
- package/dist/components/custom/data-table/data-table-list-view.d.ts +13 -0
- package/dist/components/custom/data-table/data-table-page-size.d.ts +11 -0
- package/dist/components/custom/data-table/data-table-pagination.d.ts +9 -0
- package/dist/components/custom/data-table/data-table-toolbar.d.ts +26 -0
- package/dist/components/custom/data-table/data-table-util.d.ts +7 -0
- package/dist/components/custom/data-table/data-table-view-fallback.d.ts +2 -0
- package/dist/components/custom/data-table/data-table-view-options.d.ts +17 -0
- package/dist/components/custom/data-table/data-table-view-preferences.d.ts +22 -0
- package/dist/components/custom/data-table/data-table-view-preferences.storage.d.ts +15 -0
- package/dist/components/custom/data-table/data-table-wrapper.d.ts +51 -0
- package/dist/components/custom/data-table/data-table.d.ts +47 -0
- package/dist/components/custom/data-table/export.d.ts +22 -0
- package/dist/components/custom/data-table/group-table-rows.d.ts +3 -0
- package/dist/components/custom/data-table/types.d.ts +17 -0
- package/dist/components/custom/data-table/use-data-table-page-size.d.ts +41 -0
- package/dist/components/custom/document-title.d.ts +4 -0
- package/dist/components/custom/empty-screen.d.ts +8 -0
- package/dist/components/custom/error-screen.d.ts +9 -0
- package/dist/components/custom/floating-action-btn.d.ts +39 -0
- package/dist/components/custom/index.d.ts +20 -0
- package/dist/components/custom/loading-screen.d.ts +7 -0
- package/dist/components/custom/menu-tab.d.ts +17 -0
- package/dist/components/custom/page.d.ts +35 -0
- package/dist/components/custom/plugin-theme.d.ts +8 -0
- package/dist/components/custom/portal.d.ts +4 -0
- package/dist/components/custom/protected-page.d.ts +26 -0
- package/dist/components/custom/pull-to-refresh.d.ts +16 -0
- package/dist/components/custom/render-in-view.d.ts +12 -0
- package/dist/components/custom/responsive-dialog.d.ts +47 -0
- package/dist/components/custom/safearea.d.ts +5 -0
- package/dist/components/custom/scrollable.d.ts +17 -0
- package/dist/components/custom/search-and-filter-suite.d.ts +16 -0
- package/dist/components/custom/setting.d.ts +30 -0
- package/dist/components/custom/submenu-hub.d.ts +17 -0
- package/dist/components/editor/editor-ui/content-editable.d.ts +9 -0
- package/dist/components/editor/themes/editor-theme.d.ts +3 -0
- package/dist/components/ui/accordion.d.ts +8 -0
- package/dist/components/ui/alert-dialog.d.ts +19 -0
- package/dist/components/ui/alert.d.ts +9 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/badge.d.ts +10 -0
- package/dist/components/ui/breadcrumb.d.ts +20 -0
- package/dist/components/ui/button-group.d.ts +12 -0
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts +12 -0
- package/dist/components/ui/card.d.ts +10 -0
- package/dist/components/ui/carousel.d.ts +29 -0
- package/dist/components/ui/chart.d.ts +63 -0
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/command.d.ts +81 -0
- package/dist/components/ui/context-menu.d.ts +28 -0
- package/dist/components/ui/dialog.d.ts +16 -0
- package/dist/components/ui/drawer.d.ts +23 -0
- package/dist/components/ui/dropdown-menu.d.ts +28 -0
- package/dist/components/ui/field.d.ts +25 -0
- package/dist/components/ui/form.d.ts +26 -0
- package/dist/components/ui/hover-card.d.ts +7 -0
- package/dist/components/ui/index.d.ts +54 -0
- package/dist/components/ui/input-group.d.ts +17 -0
- package/dist/components/ui/input-otp.d.ts +35 -0
- package/dist/components/ui/input.d.ts +10 -0
- package/dist/components/ui/item.d.ts +24 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/label.d.ts +5 -0
- package/dist/components/ui/menubar.d.ts +29 -0
- package/dist/components/ui/navigation-menu.d.ts +13 -0
- package/dist/components/ui/pagination.d.ts +28 -0
- package/dist/components/ui/popover.d.ts +8 -0
- package/dist/components/ui/progress.d.ts +5 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/resizable.d.ts +24 -0
- package/dist/components/ui/scroll-area.d.ts +6 -0
- package/dist/components/ui/select.d.ts +14 -0
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/sheet.d.ts +16 -0
- package/dist/components/ui/sidebar.d.ts +71 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/slider.d.ts +12 -0
- package/dist/components/ui/sonner.d.ts +6 -0
- package/dist/components/ui/spinner.d.ts +9 -0
- package/dist/components/ui/switch.d.ts +11 -0
- package/dist/components/ui/table.d.ts +14 -0
- package/dist/components/ui/tabs.d.ts +16 -0
- package/dist/components/ui/textarea.d.ts +10 -0
- package/dist/components/ui/time-picker.d.ts +13 -0
- package/dist/components/ui/toggle-group.d.ts +13 -0
- package/dist/components/ui/toggle.d.ts +10 -0
- package/dist/components/ui/tooltip.d.ts +8 -0
- package/dist/es/common/common.js +4 -0
- package/dist/es/components/blocks/editor-00/editor.js +49 -0
- package/dist/es/components/blocks/editor-00/nodes.js +6 -0
- package/dist/es/components/blocks/editor-00/plugins.js +23 -0
- package/dist/es/components/custom/confirm-dialog.js +34 -0
- package/dist/es/components/custom/dashboard.js +86 -0
- package/dist/es/components/custom/data-table/cursor-based-pagination.js +123 -0
- package/dist/es/components/custom/data-table/data-table-bulk-action-menu.js +112 -0
- package/dist/es/components/custom/data-table/data-table-bulk-export.js +76 -0
- package/dist/es/components/custom/data-table/data-table-column-header.js +102 -0
- package/dist/es/components/custom/data-table/data-table-grid.js +234 -0
- package/dist/es/components/custom/data-table/data-table-helper.js +8 -0
- package/dist/es/components/custom/data-table/data-table-list-view.js +121 -0
- package/dist/es/components/custom/data-table/data-table-page-size.js +49 -0
- package/dist/es/components/custom/data-table/data-table-pagination.js +156 -0
- package/dist/es/components/custom/data-table/data-table-toolbar.js +149 -0
- package/dist/es/components/custom/data-table/data-table-util.js +31 -0
- package/dist/es/components/custom/data-table/data-table-view-fallback.js +7 -0
- package/dist/es/components/custom/data-table/data-table-view-options.js +311 -0
- package/dist/es/components/custom/data-table/data-table-view-preferences.js +71 -0
- package/dist/es/components/custom/data-table/data-table-view-preferences.storage.js +115 -0
- package/dist/es/components/custom/data-table/data-table.js +425 -0
- package/dist/es/components/custom/data-table/group-table-rows.js +16 -0
- package/dist/es/components/custom/data-table/use-data-table-page-size.js +155 -0
- package/dist/es/components/custom/empty-screen.js +28 -0
- package/dist/es/components/custom/error-screen.js +84 -0
- package/dist/es/components/custom/floating-action-btn.js +200 -0
- package/dist/es/components/custom/loading-screen.js +26 -0
- package/dist/es/components/custom/menu-tab.js +45 -0
- package/dist/es/components/custom/page.js +105 -0
- package/dist/es/components/custom/plugin-theme.js +13 -0
- package/dist/es/components/custom/portal.js +13 -0
- package/dist/es/components/custom/protected-page.js +74 -0
- package/dist/es/components/custom/pull-to-refresh.js +378 -0
- package/dist/es/components/custom/render-in-view.js +35 -0
- package/dist/es/components/custom/responsive-dialog.js +163 -0
- package/dist/es/components/custom/safearea.js +8 -0
- package/dist/es/components/custom/scrollable.js +96 -0
- package/dist/es/components/custom/setting.js +39 -0
- package/dist/es/components/editor/editor-ui/content-editable.js +26 -0
- package/dist/es/components/editor/themes/editor-theme.js +119 -0
- package/dist/es/components/ui/accordion.js +47 -0
- package/dist/es/components/ui/alert-dialog.js +178 -0
- package/dist/es/components/ui/alert.js +51 -0
- package/dist/es/components/ui/avatar.js +42 -0
- package/dist/es/components/ui/badge.js +27 -0
- package/dist/es/components/ui/breadcrumb.js +93 -0
- package/dist/es/components/ui/button-group.js +76 -0
- package/dist/es/components/ui/button.js +57 -0
- package/dist/es/components/ui/calendar.js +402 -0
- package/dist/es/components/ui/card.js +91 -0
- package/dist/es/components/ui/carousel.js +194 -0
- package/dist/es/components/ui/chart.js +239 -0
- package/dist/es/components/ui/checkbox.js +27 -0
- package/dist/es/components/ui/collapsible.js +9 -0
- package/dist/es/components/ui/command.js +115 -0
- package/dist/es/components/ui/context-menu.js +153 -0
- package/dist/es/components/ui/dialog.js +137 -0
- package/dist/es/components/ui/drawer.js +107 -0
- package/dist/es/components/ui/dropdown-menu.js +152 -0
- package/dist/es/components/ui/field.js +226 -0
- package/dist/es/components/ui/form.js +109 -0
- package/dist/es/components/ui/hover-card.js +25 -0
- package/dist/es/components/ui/input-group.js +155 -0
- package/dist/es/components/ui/input-otp.js +49 -0
- package/dist/es/components/ui/input.js +37 -0
- package/dist/es/components/ui/item.js +188 -0
- package/dist/es/components/ui/kbd.js +31 -0
- package/dist/es/components/ui/label.js +23 -0
- package/dist/es/components/ui/menubar.js +202 -0
- package/dist/es/components/ui/navigation-menu.js +107 -0
- package/dist/es/components/ui/pagination.js +101 -0
- package/dist/es/components/ui/popover.js +27 -0
- package/dist/es/components/ui/progress.js +26 -0
- package/dist/es/components/ui/radio-group.js +35 -0
- package/dist/es/components/ui/resizable.js +38 -0
- package/dist/es/components/ui/scroll-area.js +38 -0
- package/dist/es/components/ui/select.js +124 -0
- package/dist/es/components/ui/separator.js +27 -0
- package/dist/es/components/ui/sheet.js +129 -0
- package/dist/es/components/ui/sidebar.js +604 -0
- package/dist/es/components/ui/skeleton.js +17 -0
- package/dist/es/components/ui/slider.js +62 -0
- package/dist/es/components/ui/sonner.js +26 -0
- package/dist/es/components/ui/spinner.js +34 -0
- package/dist/es/components/ui/switch.js +54 -0
- package/dist/es/components/ui/table.js +90 -0
- package/dist/es/components/ui/tabs.js +84 -0
- package/dist/es/components/ui/textarea.js +32 -0
- package/dist/es/components/ui/time-picker.js +199 -0
- package/dist/es/components/ui/toggle-group.js +43 -0
- package/dist/es/components/ui/toggle.js +44 -0
- package/dist/es/components/ui/tooltip.js +56 -0
- package/dist/es/hooks/use-debounce-value.js +16 -0
- package/dist/es/hooks/use-is-inview.js +25 -0
- package/dist/es/hooks/use-mobile-back-dialog.js +34 -0
- package/dist/es/hooks/use-mobile.js +43 -0
- package/dist/es/hooks/use-mounted.js +14 -0
- package/dist/es/hooks/use-scroll-direction.js +26 -0
- package/dist/es/hooks/use-user-hand-behavior.js +20 -0
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.js +487 -0
- package/dist/es/lib/utils.js +8 -0
- package/dist/es/locale/locale.js +87 -0
- package/dist/es/node_modules/@tanstack/react-table/build/lib/index.js +93 -0
- package/dist/es/node_modules/@tanstack/table-core/build/lib/index.js +2737 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +85 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +49 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +86 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +19 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +14 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/LazyContext.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +9 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/MotionContext/create.js +13 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/MotionContext/index.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +15 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/PresenceContext.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +5 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/events/add-pointer-event.js +8 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/events/event-info.js +14 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +432 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/drag/index.js +38 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +93 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/focus.js +35 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/hover.js +31 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +215 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/pan/index.js +50 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/gestures/press.js +38 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +60 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/animation/index.js +40 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/animations.js +13 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/definitions.js +42 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/drag.js +17 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/gestures.js +21 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +111 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/layout.js +11 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/load-features.js +15 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +64 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +33 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/index.js +69 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/symbol.js +4 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +35 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +106 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +66 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +39 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/components/create-proxy.js +35 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +13 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +7 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +13 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/use-render.js +21 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +31 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +29 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +10 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/html/use-props.js +44 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +9 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +30 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/svg/use-props.js +24 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +10 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +8 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/distance.js +10 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/get-context-window.js +6 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/is-browser.js +4 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/is-ref-object.js +6 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +38 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/use-constant.js +11 -0
- package/dist/es/shared-ui/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +153 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/JSAnimation.js +294 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +160 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +51 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/animate/single-value.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/drivers/frame.js +17 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/inertia.js +67 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +37 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/spring.js +246 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +16 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +69 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +78 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +36 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +22 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +107 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +131 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +8 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +22 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +43 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +27 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +31 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +31 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +33 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +16 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +20 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +22 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +36 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +19 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/events/add-dom-event.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/batcher.js +67 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/frame.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/microtask.js +5 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/order.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/render-step.js +64 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/frameloop/sync-time.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +25 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/hover.js +62 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/press/index.js +62 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +32 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/gestures/utils/setup.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +60 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/copy.js +19 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +86 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +57 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +40 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/models.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/geometry/utils.js +34 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +28 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +1124 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/node/state.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/shared/stack.js +83 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +25 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/styles/transform.js +38 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +24 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +20 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/projection/utils/measure.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/Feature.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/VisualElement.js +426 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +37 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +83 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/style-set.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +40 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +42 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +53 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/utils/render.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/store.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +45 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +59 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +28 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/path.js +17 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/render.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +16 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/animation-state.js +223 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/keys-position.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +24 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/motion-values.js +33 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +20 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +8 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +25 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/setters.js +25 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/render/utils/variant-props.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/resize/handle-element.js +61 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/resize/handle-window.js +31 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/resize/index.js +8 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/delay.js +17 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/interpolate.js +53 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/is-html-element.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/is-svg-element.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/color.js +44 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/complex.js +83 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/immediate.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/index.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/number.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/mix/visibility.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/resolve-elements.js +16 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/supports/flags.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/supports/memo.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +5 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/index.js +286 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/auto.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/hex.js +37 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +39 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/hsla.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/index.js +26 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/rgba.js +18 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/color/utils.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/complex/filter.js +27 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/complex/index.js +91 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/complex/mask.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/dimensions.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/int.js +8 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +28 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/maps/number.js +70 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/maps/transform.js +37 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/numbers/index.js +19 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/numbers/units.js +23 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/test.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +14 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/find.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +15 -0
- package/dist/es/shared-ui/node_modules/motion-dom/dist/es/value/will-change/is.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/array.js +13 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/clamp.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/anticipate.js +5 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/back.js +11 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/circ.js +10 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +29 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/ease.js +9 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/easing/utils/map.js +38 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/errors.js +21 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/format-error-message.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/global-config.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/is-numerical-string.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/is-object.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/is-zero-value-string.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/memo.js +12 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/noop.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/pipe.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/progress.js +7 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/subscription-manager.js +32 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/time-conversion.js +6 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/velocity-per-second.js +4 -0
- package/dist/es/shared-ui/node_modules/motion-utils/dist/es/warn-once.js +11 -0
- package/dist/es/shared-ui.css +95 -0
- package/dist/hooks/index.d.ts +8 -0
- package/dist/hooks/use-debounce-value.d.ts +2 -0
- package/dist/hooks/use-inview.d.ts +7 -0
- package/dist/hooks/use-is-inview.d.ts +7 -0
- package/dist/hooks/use-mobile-back-dialog.d.ts +6 -0
- package/dist/hooks/use-mobile.d.ts +9 -0
- package/dist/hooks/use-mounted.d.ts +2 -0
- package/dist/hooks/use-scroll-direction.d.ts +3 -0
- package/dist/hooks/use-user-hand-behavior.d.ts +7 -0
- package/dist/index.d.ts +13 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/locale/index.d.ts +2 -0
- package/dist/locale/locale.d.ts +26 -0
- package/package.json +118 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "../../ui/accordion.js";
|
|
3
|
+
import "../../ui/alert.js";
|
|
4
|
+
import "../../ui/avatar.js";
|
|
5
|
+
import "../../ui/badge.js";
|
|
6
|
+
import "../../ui/breadcrumb.js";
|
|
7
|
+
import "../../ui/button-group.js";
|
|
8
|
+
import { Button } from "../../ui/button.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import { Layers, X, Zap } from "lucide-react";
|
|
11
|
+
import "react-day-picker";
|
|
12
|
+
import { cn } from "../../../lib/utils.js";
|
|
13
|
+
import "../../ui/popover.js";
|
|
14
|
+
import "../../ui/drawer.js";
|
|
15
|
+
import "../../ui/select.js";
|
|
16
|
+
import "uuid";
|
|
17
|
+
import "@quan-erp/shared-frontend-core";
|
|
18
|
+
import "@icon-park/react";
|
|
19
|
+
import "../../ui/carousel.js";
|
|
20
|
+
import "../../ui/chart.js";
|
|
21
|
+
import "../../ui/checkbox.js";
|
|
22
|
+
import "@radix-ui/react-collapsible";
|
|
23
|
+
import "../../ui/command.js";
|
|
24
|
+
import "../../ui/context-menu.js";
|
|
25
|
+
import "@radix-ui/react-dialog";
|
|
26
|
+
import "../../ui/dropdown-menu.js";
|
|
27
|
+
import "../../ui/field.js";
|
|
28
|
+
import "../../ui/form.js";
|
|
29
|
+
import "../../ui/hover-card.js";
|
|
30
|
+
import "../../ui/input-group.js";
|
|
31
|
+
import "../../ui/input-otp.js";
|
|
32
|
+
import "../../ui/input.js";
|
|
33
|
+
import "../../ui/item.js";
|
|
34
|
+
import "@radix-ui/react-label";
|
|
35
|
+
import "../../ui/menubar.js";
|
|
36
|
+
import "../../ui/navigation-menu.js";
|
|
37
|
+
import "../../ui/pagination.js";
|
|
38
|
+
import "../../ui/progress.js";
|
|
39
|
+
import "../../ui/radio-group.js";
|
|
40
|
+
import "react-resizable-panels";
|
|
41
|
+
import "../../ui/scroll-area.js";
|
|
42
|
+
import { Separator } from "../../ui/separator.js";
|
|
43
|
+
import "../../ui/sidebar.js";
|
|
44
|
+
import "../../ui/slider.js";
|
|
45
|
+
import "next-themes";
|
|
46
|
+
import "sonner";
|
|
47
|
+
import "../../ui/spinner.js";
|
|
48
|
+
import "../../ui/switch.js";
|
|
49
|
+
import "../../ui/table.js";
|
|
50
|
+
import "../../ui/tabs.js";
|
|
51
|
+
import "../../ui/textarea.js";
|
|
52
|
+
import "../../ui/toggle-group.js";
|
|
53
|
+
import "../../ui/toggle.js";
|
|
54
|
+
import "@radix-ui/react-tooltip";
|
|
55
|
+
import "@radix-ui/react-alert-dialog";
|
|
56
|
+
function DataTableBulkActionMenu({
|
|
57
|
+
selectedCount,
|
|
58
|
+
bulkActionMenu,
|
|
59
|
+
onClear
|
|
60
|
+
}) {
|
|
61
|
+
if (selectedCount === 0) return null;
|
|
62
|
+
return /* @__PURE__ */ jsxs(
|
|
63
|
+
"div",
|
|
64
|
+
{
|
|
65
|
+
className: cn(
|
|
66
|
+
// Ultra-compact height (h-12 = 48px)
|
|
67
|
+
"shared:border-primary/20 shared:bg-primary/3 shared:relative shared:flex shared:min-h-12 shared:w-full shared:items-center shared:justify-between shared:gap-2 shared:rounded-xl shared:border shared:px-3 shared:py-1.5",
|
|
68
|
+
"shared:from-primary/4 shared:bg-linear-to-r shared:to-transparent",
|
|
69
|
+
"shared:animate-in shared:slide-in-from-top-1 shared:fade-in shared:duration-200"
|
|
70
|
+
),
|
|
71
|
+
children: [
|
|
72
|
+
/* @__PURE__ */ jsxs("div", { className: "shared:flex shared:items-center shared:gap-3", children: [
|
|
73
|
+
/* @__PURE__ */ jsxs("div", { className: "shared:bg-primary shared:flex shared:items-center shared:gap-2 shared:rounded-lg shared:px-2.5 shared:py-1 shared:shadow-sm", children: [
|
|
74
|
+
/* @__PURE__ */ jsx(Layers, { className: "shared:text-primary-foreground shared:size-3.5" }),
|
|
75
|
+
/* @__PURE__ */ jsx("span", { className: "shared:text-primary-foreground shared:text-xs shared:font-black shared:tabular-nums", children: selectedCount })
|
|
76
|
+
] }),
|
|
77
|
+
/* @__PURE__ */ jsxs("div", { className: "shared:flex shared:flex-col max-sm:shared:hidden", children: [
|
|
78
|
+
/* @__PURE__ */ jsx("span", { className: "shared:text-foreground/80 shared:text-[10px] shared:leading-none shared:font-bold shared:tracking-wider shared:uppercase", children: "Selected" }),
|
|
79
|
+
/* @__PURE__ */ jsxs("div", { className: "shared:flex shared:items-center shared:gap-1", children: [
|
|
80
|
+
/* @__PURE__ */ jsx("div", { className: "shared:bg-primary shared:size-1 shared:animate-pulse shared:rounded-full" }),
|
|
81
|
+
/* @__PURE__ */ jsx("span", { className: "shared:text-primary/70 shared:text-[9px] shared:font-medium", children: "Action Mode" })
|
|
82
|
+
] })
|
|
83
|
+
] }),
|
|
84
|
+
/* @__PURE__ */ jsx(Separator, { orientation: "vertical", className: "shared:bg-primary/20 shared:mx-1 shared:h-5" }),
|
|
85
|
+
/* @__PURE__ */ jsxs(
|
|
86
|
+
Button,
|
|
87
|
+
{
|
|
88
|
+
variant: "ghost",
|
|
89
|
+
size: "sm",
|
|
90
|
+
onClick: onClear,
|
|
91
|
+
className: "shared:text-muted-foreground hover:shared:bg-destructive/10 hover:shared:text-destructive shared:h-8 shared:gap-1.5 shared:rounded-lg shared:px-2 shared:text-[11px] shared:font-bold shared:transition-all",
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ jsx(X, { className: "shared:size-3" }),
|
|
94
|
+
/* @__PURE__ */ jsx("span", { children: "Clear" })
|
|
95
|
+
]
|
|
96
|
+
}
|
|
97
|
+
)
|
|
98
|
+
] }),
|
|
99
|
+
/* @__PURE__ */ jsxs("div", { className: "shared:flex shared:items-center shared:gap-2", children: [
|
|
100
|
+
/* @__PURE__ */ jsxs("div", { className: "shared:mr-1 shared:flex shared:items-center shared:gap-1.5 max-lg:shared:hidden", children: [
|
|
101
|
+
/* @__PURE__ */ jsx(Zap, { className: "shared:text-primary/40 shared:size-3" }),
|
|
102
|
+
/* @__PURE__ */ jsx("span", { className: "shared:text-muted-foreground/50 shared:text-[9px] shared:font-black shared:tracking-widest shared:uppercase", children: "Quick Actions" })
|
|
103
|
+
] }),
|
|
104
|
+
/* @__PURE__ */ jsx("div", { className: "shared:flex shared:items-center shared:gap-1.5 [&_button]:shared:h-8 [&_button]:shared:rounded-lg [&_button]:shared:px-3 [&_button]:shared:text-[10px] [&_button]:shared:font-black [&_button]:shared:tracking-tight [&_button]:shared:uppercase [&_button]:shared:transition-all active:[&_button]:shared:scale-95", children: bulkActionMenu })
|
|
105
|
+
] })
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
export {
|
|
111
|
+
DataTableBulkActionMenu
|
|
112
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import "../../ui/accordion.js";
|
|
3
|
+
import "../../ui/alert.js";
|
|
4
|
+
import "../../ui/avatar.js";
|
|
5
|
+
import "../../ui/badge.js";
|
|
6
|
+
import "../../ui/breadcrumb.js";
|
|
7
|
+
import "../../ui/button-group.js";
|
|
8
|
+
import { Button } from "../../ui/button.js";
|
|
9
|
+
import "react";
|
|
10
|
+
import "lucide-react";
|
|
11
|
+
import "react-day-picker";
|
|
12
|
+
import "clsx";
|
|
13
|
+
import "tailwind-merge";
|
|
14
|
+
import "../../ui/popover.js";
|
|
15
|
+
import "../../ui/drawer.js";
|
|
16
|
+
import "../../ui/select.js";
|
|
17
|
+
import "uuid";
|
|
18
|
+
import "@quan-erp/shared-frontend-core";
|
|
19
|
+
import "@icon-park/react";
|
|
20
|
+
import "../../ui/carousel.js";
|
|
21
|
+
import "../../ui/chart.js";
|
|
22
|
+
import "../../ui/checkbox.js";
|
|
23
|
+
import "@radix-ui/react-collapsible";
|
|
24
|
+
import "../../ui/command.js";
|
|
25
|
+
import "../../ui/context-menu.js";
|
|
26
|
+
import "@radix-ui/react-dialog";
|
|
27
|
+
import "../../ui/dropdown-menu.js";
|
|
28
|
+
import "../../ui/field.js";
|
|
29
|
+
import "../../ui/form.js";
|
|
30
|
+
import "../../ui/hover-card.js";
|
|
31
|
+
import "../../ui/input-group.js";
|
|
32
|
+
import "../../ui/input-otp.js";
|
|
33
|
+
import "../../ui/input.js";
|
|
34
|
+
import "../../ui/item.js";
|
|
35
|
+
import "@radix-ui/react-label";
|
|
36
|
+
import "../../ui/menubar.js";
|
|
37
|
+
import "../../ui/navigation-menu.js";
|
|
38
|
+
import "../../ui/pagination.js";
|
|
39
|
+
import "../../ui/progress.js";
|
|
40
|
+
import "../../ui/radio-group.js";
|
|
41
|
+
import "react-resizable-panels";
|
|
42
|
+
import "../../ui/scroll-area.js";
|
|
43
|
+
import "@radix-ui/react-separator";
|
|
44
|
+
import "../../ui/sidebar.js";
|
|
45
|
+
import "../../ui/slider.js";
|
|
46
|
+
import "next-themes";
|
|
47
|
+
import "sonner";
|
|
48
|
+
import "../../ui/spinner.js";
|
|
49
|
+
import "../../ui/switch.js";
|
|
50
|
+
import "../../ui/table.js";
|
|
51
|
+
import "../../ui/tabs.js";
|
|
52
|
+
import "../../ui/textarea.js";
|
|
53
|
+
import "../../ui/toggle-group.js";
|
|
54
|
+
import "../../ui/toggle.js";
|
|
55
|
+
import "@radix-ui/react-tooltip";
|
|
56
|
+
import "@radix-ui/react-alert-dialog";
|
|
57
|
+
import { exportToCSV } from "./data-table-util.js";
|
|
58
|
+
function DataTableBulkExportButton({
|
|
59
|
+
selectedData,
|
|
60
|
+
tableName,
|
|
61
|
+
label
|
|
62
|
+
}) {
|
|
63
|
+
const filename = `${tableName}_export_${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.csv`;
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
65
|
+
Button,
|
|
66
|
+
{
|
|
67
|
+
variant: "ghost",
|
|
68
|
+
className: "shared:h-8 shared:text-xs",
|
|
69
|
+
onClick: () => exportToCSV(selectedData, filename),
|
|
70
|
+
children: label
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
DataTableBulkExportButton
|
|
76
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowDownIcon, ArrowUpIcon, ChevronsUpDown, EyeOff } from "lucide-react";
|
|
3
|
+
import "react";
|
|
4
|
+
import { cn } from "../../../lib/utils.js";
|
|
5
|
+
import "../../ui/accordion.js";
|
|
6
|
+
import "../../ui/alert.js";
|
|
7
|
+
import "../../ui/avatar.js";
|
|
8
|
+
import "../../ui/badge.js";
|
|
9
|
+
import "../../ui/breadcrumb.js";
|
|
10
|
+
import "../../ui/button-group.js";
|
|
11
|
+
import { Button } from "../../ui/button.js";
|
|
12
|
+
import "react-day-picker";
|
|
13
|
+
import "../../ui/popover.js";
|
|
14
|
+
import "../../ui/drawer.js";
|
|
15
|
+
import "../../ui/select.js";
|
|
16
|
+
import "uuid";
|
|
17
|
+
import "@quan-erp/shared-frontend-core";
|
|
18
|
+
import "@icon-park/react";
|
|
19
|
+
import "../../ui/carousel.js";
|
|
20
|
+
import "../../ui/chart.js";
|
|
21
|
+
import "../../ui/checkbox.js";
|
|
22
|
+
import "@radix-ui/react-collapsible";
|
|
23
|
+
import "../../ui/command.js";
|
|
24
|
+
import "../../ui/context-menu.js";
|
|
25
|
+
import "@radix-ui/react-dialog";
|
|
26
|
+
import { DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator } from "../../ui/dropdown-menu.js";
|
|
27
|
+
import "../../ui/field.js";
|
|
28
|
+
import "../../ui/form.js";
|
|
29
|
+
import "../../ui/hover-card.js";
|
|
30
|
+
import "../../ui/input-group.js";
|
|
31
|
+
import "../../ui/input-otp.js";
|
|
32
|
+
import "../../ui/input.js";
|
|
33
|
+
import "../../ui/item.js";
|
|
34
|
+
import "@radix-ui/react-label";
|
|
35
|
+
import "../../ui/menubar.js";
|
|
36
|
+
import "../../ui/navigation-menu.js";
|
|
37
|
+
import "../../ui/pagination.js";
|
|
38
|
+
import "../../ui/progress.js";
|
|
39
|
+
import "../../ui/radio-group.js";
|
|
40
|
+
import "react-resizable-panels";
|
|
41
|
+
import "../../ui/scroll-area.js";
|
|
42
|
+
import "@radix-ui/react-separator";
|
|
43
|
+
import "../../ui/sidebar.js";
|
|
44
|
+
import "../../ui/slider.js";
|
|
45
|
+
import "next-themes";
|
|
46
|
+
import "sonner";
|
|
47
|
+
import "../../ui/spinner.js";
|
|
48
|
+
import "../../ui/switch.js";
|
|
49
|
+
import "../../ui/table.js";
|
|
50
|
+
import "../../ui/tabs.js";
|
|
51
|
+
import "../../ui/textarea.js";
|
|
52
|
+
import "../../ui/toggle-group.js";
|
|
53
|
+
import "../../ui/toggle.js";
|
|
54
|
+
import "@radix-ui/react-tooltip";
|
|
55
|
+
import "@radix-ui/react-alert-dialog";
|
|
56
|
+
function DataTableColumnHeader({
|
|
57
|
+
column,
|
|
58
|
+
title,
|
|
59
|
+
className
|
|
60
|
+
}) {
|
|
61
|
+
if (!column.getCanSort()) {
|
|
62
|
+
return /* @__PURE__ */ jsx("div", { className: cn("shared:whitespace-nowrap", className), children: title });
|
|
63
|
+
}
|
|
64
|
+
return /* @__PURE__ */ jsx(
|
|
65
|
+
"div",
|
|
66
|
+
{
|
|
67
|
+
className: cn("shared:flex shared:items-center shared:space-x-2 shared:whitespace-nowrap", className),
|
|
68
|
+
children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
70
|
+
Button,
|
|
71
|
+
{
|
|
72
|
+
variant: "ghost",
|
|
73
|
+
size: "sm",
|
|
74
|
+
className: "data-[state=open]:shared:bg-accent shared:-ml-3 shared:h-8",
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ jsx("span", { children: title }),
|
|
77
|
+
column.getIsSorted() === "desc" ? /* @__PURE__ */ jsx(ArrowDownIcon, { className: "shared:ml-2 shared:size-4" }) : column.getIsSorted() === "asc" ? /* @__PURE__ */ jsx(ArrowUpIcon, { className: "shared:ml-2 shared:size-4" }) : column.getCanSort() === true ? /* @__PURE__ */ jsx(ChevronsUpDown, { className: "shared:ml-2 shared:size-4" }) : /* @__PURE__ */ jsx(Fragment, {})
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
) }),
|
|
81
|
+
/* @__PURE__ */ jsxs(DropdownMenuContent, { align: "start", children: [
|
|
82
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: () => column.toggleSorting(false), children: [
|
|
83
|
+
/* @__PURE__ */ jsx(ArrowUpIcon, { className: "shared:text-muted-foreground/70 shared:mr-2 shared:size-3.5" }),
|
|
84
|
+
"Asc"
|
|
85
|
+
] }),
|
|
86
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: () => column.toggleSorting(true), children: [
|
|
87
|
+
/* @__PURE__ */ jsx(ArrowDownIcon, { className: "shared:text-muted-foreground/70 shared:mr-2 shared:size-3.5" }),
|
|
88
|
+
"Desc"
|
|
89
|
+
] }),
|
|
90
|
+
/* @__PURE__ */ jsx(DropdownMenuSeparator, {}),
|
|
91
|
+
/* @__PURE__ */ jsxs(DropdownMenuItem, { onClick: () => column.toggleVisibility(false), children: [
|
|
92
|
+
/* @__PURE__ */ jsx(EyeOff, { className: "shared:text-muted-foreground/70 shared:mr-2 shared:size-3.5" }),
|
|
93
|
+
"Hide"
|
|
94
|
+
] })
|
|
95
|
+
] })
|
|
96
|
+
] })
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
export {
|
|
101
|
+
DataTableColumnHeader
|
|
102
|
+
};
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { flexRender } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { groupTableRowsBy } from "./group-table-rows.js";
|
|
5
|
+
import "../../ui/accordion.js";
|
|
6
|
+
import "../../ui/alert.js";
|
|
7
|
+
import "../../ui/avatar.js";
|
|
8
|
+
import "../../ui/badge.js";
|
|
9
|
+
import "../../ui/breadcrumb.js";
|
|
10
|
+
import "../../ui/button-group.js";
|
|
11
|
+
import "../../ui/button.js";
|
|
12
|
+
import "lucide-react";
|
|
13
|
+
import "react-day-picker";
|
|
14
|
+
import { cn } from "../../../lib/utils.js";
|
|
15
|
+
import "../../ui/popover.js";
|
|
16
|
+
import "../../ui/drawer.js";
|
|
17
|
+
import "../../ui/select.js";
|
|
18
|
+
import "uuid";
|
|
19
|
+
import "@quan-erp/shared-frontend-core";
|
|
20
|
+
import "@icon-park/react";
|
|
21
|
+
import "../../ui/carousel.js";
|
|
22
|
+
import "../../ui/chart.js";
|
|
23
|
+
import "../../ui/checkbox.js";
|
|
24
|
+
import "@radix-ui/react-collapsible";
|
|
25
|
+
import "../../ui/command.js";
|
|
26
|
+
import "../../ui/context-menu.js";
|
|
27
|
+
import "@radix-ui/react-dialog";
|
|
28
|
+
import "../../ui/dropdown-menu.js";
|
|
29
|
+
import "../../ui/field.js";
|
|
30
|
+
import "../../ui/form.js";
|
|
31
|
+
import "../../ui/hover-card.js";
|
|
32
|
+
import "../../ui/input-group.js";
|
|
33
|
+
import "../../ui/input-otp.js";
|
|
34
|
+
import "../../ui/input.js";
|
|
35
|
+
import "../../ui/item.js";
|
|
36
|
+
import "@radix-ui/react-label";
|
|
37
|
+
import "../../ui/menubar.js";
|
|
38
|
+
import "../../ui/navigation-menu.js";
|
|
39
|
+
import "../../ui/pagination.js";
|
|
40
|
+
import "../../ui/progress.js";
|
|
41
|
+
import "../../ui/radio-group.js";
|
|
42
|
+
import "react-resizable-panels";
|
|
43
|
+
import "../../ui/scroll-area.js";
|
|
44
|
+
import "@radix-ui/react-separator";
|
|
45
|
+
import "../../ui/sidebar.js";
|
|
46
|
+
import "../../ui/slider.js";
|
|
47
|
+
import "next-themes";
|
|
48
|
+
import "sonner";
|
|
49
|
+
import "../../ui/spinner.js";
|
|
50
|
+
import "../../ui/switch.js";
|
|
51
|
+
import { TableRow, TableCell, Table, TableHeader, TableHead, TableBody, TableFooter } from "../../ui/table.js";
|
|
52
|
+
import "../../ui/tabs.js";
|
|
53
|
+
import "../../ui/textarea.js";
|
|
54
|
+
import "../../ui/toggle-group.js";
|
|
55
|
+
import "../../ui/toggle.js";
|
|
56
|
+
import "@radix-ui/react-tooltip";
|
|
57
|
+
import "@radix-ui/react-alert-dialog";
|
|
58
|
+
function dataTableRowMemoPropsAreEqual(prev, next) {
|
|
59
|
+
return prev.row.id === next.row.id && prev.row.original === next.row.original && prev.isSelected === next.isSelected && prev.onRowClickFn === next.onRowClickFn && prev.layoutKey === next.layoutKey;
|
|
60
|
+
}
|
|
61
|
+
function DataTableBodyRow({
|
|
62
|
+
row,
|
|
63
|
+
isSelected,
|
|
64
|
+
onRowClickFn
|
|
65
|
+
}) {
|
|
66
|
+
const handleClick = React.useCallback(() => {
|
|
67
|
+
onRowClickFn?.(row.original);
|
|
68
|
+
}, [onRowClickFn, row.original]);
|
|
69
|
+
return /* @__PURE__ */ jsx(
|
|
70
|
+
TableRow,
|
|
71
|
+
{
|
|
72
|
+
className: cn(
|
|
73
|
+
"shared:group shared:transition-colors",
|
|
74
|
+
onRowClickFn && "shared:cursor-pointer",
|
|
75
|
+
isSelected ? "shared:bg-primary/5 hover:shared:bg-primary/10" : "hover:shared:bg-muted/30"
|
|
76
|
+
),
|
|
77
|
+
onClick: onRowClickFn ? handleClick : void 0,
|
|
78
|
+
children: row.getVisibleCells().map((cell) => {
|
|
79
|
+
const isPinned = cell.column.getIsPinned();
|
|
80
|
+
const meta = cell.column.columnDef.meta;
|
|
81
|
+
const size = cell.column.getSize();
|
|
82
|
+
return /* @__PURE__ */ jsx(
|
|
83
|
+
TableCell,
|
|
84
|
+
{
|
|
85
|
+
className: cn(
|
|
86
|
+
"shared:border-border/50 shared:border-b",
|
|
87
|
+
isPinned && "shared:bg-background shared:sticky shared:left-0 shared:z-20 shared:shadow-[1px_0_0_0_rgba(0,0,0,0.1)]",
|
|
88
|
+
isSelected && isPinned && "shared:bg-muted",
|
|
89
|
+
meta?.className
|
|
90
|
+
),
|
|
91
|
+
style: {
|
|
92
|
+
left: isPinned ? `${cell.column.getStart("left")}px` : void 0,
|
|
93
|
+
width: `${size}px`,
|
|
94
|
+
minWidth: `${size}px`,
|
|
95
|
+
maxWidth: `${size}px`
|
|
96
|
+
},
|
|
97
|
+
children: flexRender(cell.column.columnDef.cell, cell.getContext())
|
|
98
|
+
},
|
|
99
|
+
cell.id
|
|
100
|
+
);
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
const MemoDataTableBodyRow = React.memo(
|
|
106
|
+
DataTableBodyRow,
|
|
107
|
+
dataTableRowMemoPropsAreEqual
|
|
108
|
+
);
|
|
109
|
+
function DataTableGroupHeaderRow({
|
|
110
|
+
colSpan,
|
|
111
|
+
label,
|
|
112
|
+
summary
|
|
113
|
+
}) {
|
|
114
|
+
return /* @__PURE__ */ jsx(TableRow, { className: "hover:shared:bg-transparent", children: /* @__PURE__ */ jsx(TableCell, { colSpan, className: "shared:px-0 shared:py-0", children: /* @__PURE__ */ jsx("div", { className: "shared:border-b-primary shared:bg-primary/10 shared:text-primary shared:sticky shared:top-0 shared:z-30 shared:border-b-2 shared:px-3 shared:pb-2 shared:backdrop-blur", children: /* @__PURE__ */ jsxs("div", { className: "shared:flex shared:flex-row shared:flex-wrap shared:items-center shared:gap-x-5 shared:gap-y-1 shared:pt-3", children: [
|
|
115
|
+
/* @__PURE__ */ jsx("p", { className: "shared:text-base shared:font-semibold", children: label }),
|
|
116
|
+
summary
|
|
117
|
+
] }) }) }) });
|
|
118
|
+
}
|
|
119
|
+
function DataTableGrid({
|
|
120
|
+
table,
|
|
121
|
+
rows,
|
|
122
|
+
rowSelection,
|
|
123
|
+
columnCount,
|
|
124
|
+
onRowClickFn,
|
|
125
|
+
footerData,
|
|
126
|
+
noResultsLabel = "No results found.",
|
|
127
|
+
groupBy,
|
|
128
|
+
layoutKey,
|
|
129
|
+
firstRowData
|
|
130
|
+
}) {
|
|
131
|
+
const visibleColumns = table.getHeaderGroups()[0]?.headers.filter((h) => h.column.getIsVisible()) ?? [];
|
|
132
|
+
const resolvedFooter = React.useMemo(() => {
|
|
133
|
+
if (!footerData?.length) return [];
|
|
134
|
+
return footerData.map((footer) => ({
|
|
135
|
+
...footer,
|
|
136
|
+
colIndex: visibleColumns.findIndex(
|
|
137
|
+
(col) => col.id === footer.valueColumnKey
|
|
138
|
+
)
|
|
139
|
+
}));
|
|
140
|
+
}, [footerData, visibleColumns]);
|
|
141
|
+
const resolvedFirstRow = React.useMemo(() => {
|
|
142
|
+
if (!firstRowData?.length) return [];
|
|
143
|
+
return firstRowData.map((firstRow) => ({
|
|
144
|
+
...firstRow,
|
|
145
|
+
colIndex: visibleColumns.findIndex(
|
|
146
|
+
(col) => col.id === firstRow.valueColumnKey
|
|
147
|
+
)
|
|
148
|
+
}));
|
|
149
|
+
}, [firstRowData, visibleColumns]);
|
|
150
|
+
const emptyColSpan = visibleColumns.length || columnCount;
|
|
151
|
+
const showFooter = resolvedFooter.length > 0 && visibleColumns.length > 0;
|
|
152
|
+
const groupedRows = React.useMemo(() => {
|
|
153
|
+
if (!groupBy || rows.length === 0) return null;
|
|
154
|
+
return groupTableRowsBy(rows, groupBy.getGroupKey);
|
|
155
|
+
}, [groupBy, rows]);
|
|
156
|
+
const renderBodyRow = (row) => /* @__PURE__ */ jsx(
|
|
157
|
+
MemoDataTableBodyRow,
|
|
158
|
+
{
|
|
159
|
+
row,
|
|
160
|
+
isSelected: row.getIsSelected(),
|
|
161
|
+
onRowClickFn,
|
|
162
|
+
layoutKey
|
|
163
|
+
},
|
|
164
|
+
row.id
|
|
165
|
+
);
|
|
166
|
+
return /* @__PURE__ */ jsxs(Table, { className: "shared:w-full shared:table-fixed shared:border-separate shared:border-spacing-0", children: [
|
|
167
|
+
/* @__PURE__ */ jsx(TableHeader, { className: "shared:bg-muted/60 shared:backdrop-blur-md", children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx(TableRow, { className: "hover:shared:bg-transparent", children: headerGroup.headers.filter((header) => header.column.getIsVisible()).map((header) => {
|
|
168
|
+
const isPinned = header.column.getIsPinned();
|
|
169
|
+
const meta = header.column.columnDef.meta;
|
|
170
|
+
const size = header.getSize();
|
|
171
|
+
return /* @__PURE__ */ jsx(
|
|
172
|
+
TableHead,
|
|
173
|
+
{
|
|
174
|
+
className: cn(
|
|
175
|
+
"shared:text-muted-foreground shared:text-[11px] shared:font-bold shared:tracking-wider shared:uppercase",
|
|
176
|
+
isPinned && "shared:bg-muted/90 shared:sticky shared:left-0 shared:z-50 shared:shadow-[1px_0_0_0_rgba(0,0,0,0.1)]",
|
|
177
|
+
meta?.className
|
|
178
|
+
),
|
|
179
|
+
style: {
|
|
180
|
+
left: isPinned ? `${header.getStart("left")}px` : void 0,
|
|
181
|
+
width: `${size}px`,
|
|
182
|
+
minWidth: `${size}px`,
|
|
183
|
+
maxWidth: `${size}px`,
|
|
184
|
+
position: isPinned ? "sticky" : "relative"
|
|
185
|
+
},
|
|
186
|
+
children: flexRender(
|
|
187
|
+
header.column.columnDef.header,
|
|
188
|
+
header.getContext()
|
|
189
|
+
)
|
|
190
|
+
},
|
|
191
|
+
header.id
|
|
192
|
+
);
|
|
193
|
+
}) }, headerGroup.id)) }),
|
|
194
|
+
/* @__PURE__ */ jsxs(TableBody, { children: [
|
|
195
|
+
showFooter ? /* @__PURE__ */ jsx(TableRow, { children: visibleColumns.map((col, idx) => {
|
|
196
|
+
const firstRowItem = resolvedFirstRow.find(
|
|
197
|
+
(f) => f.colIndex === idx
|
|
198
|
+
);
|
|
199
|
+
if (firstRowItem) {
|
|
200
|
+
return /* @__PURE__ */ jsx(TableCell, { className: "shared:font-bold", children: firstRowItem.render }, col.id);
|
|
201
|
+
}
|
|
202
|
+
return /* @__PURE__ */ jsx(TableCell, {}, col.id);
|
|
203
|
+
}) }) : null,
|
|
204
|
+
rows.length ? groupedRows ? groupedRows.map(([groupKey, groupRows]) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
205
|
+
/* @__PURE__ */ jsx(
|
|
206
|
+
DataTableGroupHeaderRow,
|
|
207
|
+
{
|
|
208
|
+
colSpan: emptyColSpan,
|
|
209
|
+
label: groupBy?.formatGroupLabel?.(groupKey, groupRows) ?? groupKey,
|
|
210
|
+
summary: groupBy?.renderGroupSummary?.(groupKey, groupRows)
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
groupRows.map(renderBodyRow)
|
|
214
|
+
] }, groupKey)) : rows.map(renderBodyRow) : /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(
|
|
215
|
+
TableCell,
|
|
216
|
+
{
|
|
217
|
+
colSpan: emptyColSpan,
|
|
218
|
+
className: "shared:text-muted-foreground shared:h-32 shared:text-center",
|
|
219
|
+
children: noResultsLabel
|
|
220
|
+
}
|
|
221
|
+
) })
|
|
222
|
+
] }),
|
|
223
|
+
showFooter ? /* @__PURE__ */ jsx(TableFooter, { children: /* @__PURE__ */ jsx(TableRow, { children: visibleColumns.map((col, idx) => {
|
|
224
|
+
const footerItem = resolvedFooter.find((f) => f.colIndex === idx);
|
|
225
|
+
if (footerItem) {
|
|
226
|
+
return /* @__PURE__ */ jsx(TableCell, { className: "shared:font-bold", children: footerItem.render }, col.id);
|
|
227
|
+
}
|
|
228
|
+
return /* @__PURE__ */ jsx(TableCell, {}, col.id);
|
|
229
|
+
}) }) }) : null
|
|
230
|
+
] });
|
|
231
|
+
}
|
|
232
|
+
export {
|
|
233
|
+
DataTableGrid
|
|
234
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
function formatCamelCaseString(inputString) {
|
|
2
|
+
const words = inputString.split(/(?=[A-Z])/);
|
|
3
|
+
const formattedString = words.map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
4
|
+
return formattedString;
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
formatCamelCaseString
|
|
8
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { flexRender } from "../../../node_modules/@tanstack/react-table/build/lib/index.js";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { groupTableRowsBy } from "./group-table-rows.js";
|
|
5
|
+
import { cn } from "../../../lib/utils.js";
|
|
6
|
+
function dataTableRowMemoPropsAreEqual(prev, next) {
|
|
7
|
+
return prev.row.id === next.row.id && prev.row.original === next.row.original && prev.isSelected === next.isSelected && prev.onRowClickFn === next.onRowClickFn && prev.layoutKey === next.layoutKey;
|
|
8
|
+
}
|
|
9
|
+
function DataCard({
|
|
10
|
+
row,
|
|
11
|
+
isSelected,
|
|
12
|
+
onRowClickFn,
|
|
13
|
+
layoutKey
|
|
14
|
+
}) {
|
|
15
|
+
const handleClick = React.useCallback(() => {
|
|
16
|
+
onRowClickFn?.(row.original);
|
|
17
|
+
}, [onRowClickFn, row.original]);
|
|
18
|
+
const { selectionCell, otherCells } = React.useMemo(() => {
|
|
19
|
+
const visibleCells = row.getVisibleCells();
|
|
20
|
+
const selection = visibleCells.find((c) => c.column.id === "select");
|
|
21
|
+
const others = visibleCells.filter((c) => {
|
|
22
|
+
const meta = c.column.columnDef.meta;
|
|
23
|
+
return !meta?.isCardHeader && !meta?.isCardSubheader && c.column.id !== "select";
|
|
24
|
+
}).sort((a, b) => {
|
|
25
|
+
const aSort = a.column.columnDef.meta?.sortNumber ?? 999;
|
|
26
|
+
const bSort = b.column.columnDef.meta?.sortNumber ?? 999;
|
|
27
|
+
return aSort - bSort;
|
|
28
|
+
});
|
|
29
|
+
return { selectionCell: selection, otherCells: others };
|
|
30
|
+
}, [row, layoutKey]);
|
|
31
|
+
return /* @__PURE__ */ jsxs(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
onClick: onRowClickFn ? handleClick : void 0,
|
|
35
|
+
className: cn(
|
|
36
|
+
"shared:group shared:border-border/40 shared:bg-card hover:shared:border-primary/40 shared:relative shared:flex shared:flex-col shared:rounded-xl shared:border shared:p-3 shared:shadow-sm shared:transition-all shared:duration-200 active:shared:scale-[0.98]",
|
|
37
|
+
onRowClickFn && "shared:cursor-pointer",
|
|
38
|
+
isSelected && "shared:bg-primary/3 shared:border-primary/30 shared:ring-primary/20 shared:ring-1"
|
|
39
|
+
),
|
|
40
|
+
children: [
|
|
41
|
+
selectionCell ? /* @__PURE__ */ jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: "shared:absolute shared:top-3 shared:right-3 shared:z-10",
|
|
45
|
+
onClick: (e) => e.stopPropagation(),
|
|
46
|
+
children: flexRender(
|
|
47
|
+
selectionCell.column.columnDef.cell,
|
|
48
|
+
selectionCell.getContext()
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
) : null,
|
|
52
|
+
/* @__PURE__ */ jsx("div", { className: "shared:grid shared:grid-cols-12 shared:gap-1.5", children: otherCells.map((cell) => /* @__PURE__ */ jsx(React.Fragment, { children: flexRender(
|
|
53
|
+
cell.column.columnDef.mobileCell ?? cell.column.columnDef.cell,
|
|
54
|
+
cell.getContext()
|
|
55
|
+
) }, cell.id)) })
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
const MemoDataCard = React.memo(
|
|
61
|
+
DataCard,
|
|
62
|
+
dataTableRowMemoPropsAreEqual
|
|
63
|
+
);
|
|
64
|
+
function DataTableListGroupHeader({
|
|
65
|
+
label,
|
|
66
|
+
summary
|
|
67
|
+
}) {
|
|
68
|
+
return /* @__PURE__ */ jsx("div", { className: "shared:border-b-primary shared:bg-primary/10 shared:sticky shared:top-0 shared:z-20 shared:rounded-md shared:border-b-2 shared:px-3 shared:py-2 shared:backdrop-blur", children: /* @__PURE__ */ jsxs("div", { className: "shared:flex shared:flex-row shared:flex-wrap shared:items-center shared:gap-x-4 shared:gap-y-1", children: [
|
|
69
|
+
/* @__PURE__ */ jsx("p", { className: "shared:text-sm shared:font-semibold", children: label }),
|
|
70
|
+
summary
|
|
71
|
+
] }) });
|
|
72
|
+
}
|
|
73
|
+
function DataTableListView({
|
|
74
|
+
rows,
|
|
75
|
+
rowSelection,
|
|
76
|
+
onRowClickFn,
|
|
77
|
+
layoutKey,
|
|
78
|
+
groupBy,
|
|
79
|
+
firstRowData,
|
|
80
|
+
footerData
|
|
81
|
+
}) {
|
|
82
|
+
const groupedRows = React.useMemo(() => {
|
|
83
|
+
if (!groupBy || rows.length === 0) return null;
|
|
84
|
+
return groupTableRowsBy(rows, groupBy.getGroupKey);
|
|
85
|
+
}, [groupBy, rows]);
|
|
86
|
+
return /* @__PURE__ */ jsxs("div", { className: "shared:space-y-4 shared:p-2", children: [
|
|
87
|
+
firstRowData,
|
|
88
|
+
groupedRows ? groupedRows.map(([groupKey, groupItems]) => /* @__PURE__ */ jsxs("div", { className: "shared:space-y-3", children: [
|
|
89
|
+
/* @__PURE__ */ jsx(
|
|
90
|
+
DataTableListGroupHeader,
|
|
91
|
+
{
|
|
92
|
+
label: groupBy?.formatGroupLabel?.(groupKey, groupItems) ?? groupKey,
|
|
93
|
+
summary: groupBy?.renderGroupSummary?.(groupKey, groupItems)
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ jsx("div", { className: "shared:grid shared:grid-cols-1 shared:gap-4 sm:shared:grid-cols-2 lg:shared:grid-cols-3 xl:shared:grid-cols-4 2xl:shared:grid-cols-6", children: groupItems.map((row) => /* @__PURE__ */ jsx(
|
|
97
|
+
MemoDataCard,
|
|
98
|
+
{
|
|
99
|
+
row,
|
|
100
|
+
isSelected: row.getIsSelected(),
|
|
101
|
+
onRowClickFn,
|
|
102
|
+
layoutKey
|
|
103
|
+
},
|
|
104
|
+
row.id
|
|
105
|
+
)) })
|
|
106
|
+
] }, groupKey)) : /* @__PURE__ */ jsx("div", { className: "shared:grid shared:grid-cols-1 shared:gap-4 sm:shared:grid-cols-2 lg:shared:grid-cols-3 xl:shared:grid-cols-4 2xl:shared:grid-cols-6", children: rows.map((row) => /* @__PURE__ */ jsx(
|
|
107
|
+
MemoDataCard,
|
|
108
|
+
{
|
|
109
|
+
row,
|
|
110
|
+
isSelected: row.getIsSelected(),
|
|
111
|
+
onRowClickFn,
|
|
112
|
+
layoutKey
|
|
113
|
+
},
|
|
114
|
+
row.id
|
|
115
|
+
)) }),
|
|
116
|
+
footerData
|
|
117
|
+
] });
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
DataTableListView
|
|
121
|
+
};
|