@code0-tech/pictor 1.0.0 → 1.1.1
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/dist/_virtual/rolldown_runtime.js +9 -0
- package/dist/assets/Alert.style.css +1 -0
- package/dist/assets/Aurora.style.css +1 -0
- package/dist/assets/Avatar.style.css +1 -0
- package/dist/assets/Badge.style.css +1 -0
- package/dist/assets/Breadcrumb.style.css +1 -0
- package/dist/assets/Button.style.css +1 -0
- package/dist/assets/ButtonGroup.style.css +1 -0
- package/dist/assets/Card.style.css +1 -0
- package/dist/assets/Chart.style.css +1 -0
- package/dist/assets/Col.style.css +1 -0
- package/dist/assets/ColorInput.style.css +1 -0
- package/dist/assets/Command.style.css +1 -0
- package/dist/assets/Container.style.css +1 -0
- package/dist/assets/ContextMenu.style.css +1 -0
- package/dist/assets/DataTable.style.css +1 -0
- package/dist/assets/DateInput.style.css +1 -0
- package/dist/assets/Dialog.style.css +1 -0
- package/dist/assets/Editor.styles.css +1 -0
- package/dist/assets/EditorInput.style.css +1 -0
- package/dist/assets/FileInput.style.css +1 -0
- package/dist/assets/FileTabs.style.css +1 -0
- package/dist/assets/FullScreen.style.css +1 -0
- package/dist/assets/Gantt.style.css +1 -0
- package/dist/assets/Icon.style.css +1 -0
- package/dist/assets/Input.style.css +1 -0
- package/dist/assets/InputWrapper.style.css +1 -0
- package/dist/assets/JsonView.style.css +1 -0
- package/dist/assets/Layout.style.css +1 -0
- package/dist/assets/Menu.style.css +1 -0
- package/dist/assets/Progress.style.css +1 -0
- package/dist/assets/Quote.style.css +1 -0
- package/dist/assets/Resizable.style.css +1 -0
- package/dist/assets/Row.style.css +1 -0
- package/dist/assets/ScrollArea.style.css +1 -0
- package/dist/assets/SegmentedControl.style.css +1 -0
- package/dist/assets/SelectInput.style.css +1 -0
- package/dist/assets/Tab.style.css +1 -0
- package/dist/assets/Text.style.css +1 -0
- package/dist/assets/Toast.style.css +1 -0
- package/dist/assets/Tooltip.style.css +1 -0
- package/dist/components/alert/Alert.js +33 -41
- package/dist/components/aurora/Aurora.js +26 -22
- package/dist/components/avatar/Avatar.js +57 -55
- package/dist/components/badge/Badge.js +57 -64
- package/dist/components/breadcrumb/Breadcrumb.js +16 -21
- package/dist/components/button/Button.js +23 -31
- package/dist/components/button-group/ButtonGroup.js +28 -31
- package/dist/components/card/Card.js +28 -43
- package/dist/components/card/CardSection.js +21 -29
- package/dist/components/chart/Chart.js +138 -153
- package/dist/components/chart/LineChart.js +74 -74
- package/dist/components/chart/index.js +3 -8
- package/dist/components/col/Col.js +18 -29
- package/dist/components/command/Command.js +100 -134
- package/dist/components/container/Container.js +18 -23
- package/dist/components/context-menu/ContextMenu.js +118 -112
- package/dist/components/data-table/DataTable.js +53 -64
- package/dist/components/data-table/DataTableColumn.js +17 -22
- package/dist/components/data-table/DataTableFilterInput.js +208 -205
- package/dist/components/data-table/DataTableFilterSuggestionMenu.js +58 -48
- package/dist/components/data-table/DataTableHeader.js +33 -38
- package/dist/components/data-table/DataTablePagination.js +61 -74
- package/dist/components/data-table/index.js +7 -22
- package/dist/components/dialog/Dialog.js +106 -97
- package/dist/components/editor/Editor.js +352 -323
- package/dist/components/file-tabs/FileTabs.js +77 -73
- package/dist/components/file-tabs/FileTabs.service.js +85 -87
- package/dist/components/file-tabs/FileTabs.view.js +0 -1
- package/dist/components/file-tabs/index.js +3 -9
- package/dist/components/flex/Flex.js +18 -23
- package/dist/components/form/CheckboxInput.js +72 -76
- package/dist/components/form/ColorInput.js +378 -353
- package/dist/components/form/DateInput.js +315 -265
- package/dist/components/form/EditorInput.js +597 -579
- package/dist/components/form/EmailInput.js +30 -23
- package/dist/components/form/FileInput.js +92 -123
- package/dist/components/form/Input.js +64 -58
- package/dist/components/form/Input.utils.js +25 -37
- package/dist/components/form/InputDescription.js +10 -11
- package/dist/components/form/InputLabel.js +17 -22
- package/dist/components/form/InputMessage.js +16 -17
- package/dist/components/form/InputWrapper.js +55 -65
- package/dist/components/form/NumberInput.js +41 -20
- package/dist/components/form/PasswordInput.js +71 -54
- package/dist/components/form/PinInput.js +49 -65
- package/dist/components/form/RadioGroup.js +41 -50
- package/dist/components/form/RadioInput.js +30 -29
- package/dist/components/form/SelectInput.js +68 -92
- package/dist/components/form/SwitchInput.js +17 -18
- package/dist/components/form/TagInput.js +108 -122
- package/dist/components/form/TextAreaInput.js +24 -21
- package/dist/components/form/TextInput.js +30 -22
- package/dist/components/form/index.js +22 -87
- package/dist/components/form/useForm.js +87 -88
- package/dist/components/fullscreen/FullScreen.js +27 -27
- package/dist/components/gantt/Gantt.js +99 -98
- package/dist/components/gantt/GanttGroup.js +210 -195
- package/dist/components/gantt/GanttHeader.js +78 -81
- package/dist/components/gantt/GanttItem.js +18 -22
- package/dist/components/icon/Icon.d.ts +6 -4
- package/dist/components/icon/Icon.js +53 -42
- package/dist/components/icon/codezero/codezero.js +10 -0
- package/dist/components/icon/codezero/gls.js +9 -0
- package/dist/components/icon/codezero/index.js +17 -13
- package/dist/components/json-view/JsonView.js +119 -109
- package/dist/components/layout/Layout.js +100 -78
- package/dist/components/menu/Menu.js +134 -128
- package/dist/components/progress/ProgressCircle.js +60 -49
- package/dist/components/progress/ProgressLinear.js +39 -43
- package/dist/components/quote/Quote.js +51 -43
- package/dist/components/resizable/Resizable.js +35 -33
- package/dist/components/row/Row.js +18 -23
- package/dist/components/scroll-area/ScrollArea.js +65 -76
- package/dist/components/segmented-control/SegmentedControl.js +46 -50
- package/dist/components/spacing/Spacing.js +15 -23
- package/dist/components/tab/Tab.js +73 -66
- package/dist/components/text/Text.js +18 -25
- package/dist/components/toast/Toast.js +104 -82
- package/dist/components/tooltip/Tooltip.js +65 -55
- package/dist/index.js +76 -272
- package/dist/node_modules/@lezer/common/dist/index.js +778 -143
- package/dist/node_modules/@lezer/highlight/dist/index.js +305 -536
- package/dist/node_modules/prettier/plugins/babel.js +9582 -7023
- package/dist/node_modules/prettier/plugins/estree.js +6997 -4377
- package/dist/node_modules/prettier/standalone.js +3444 -2415
- package/dist/utils/arrayService.js +0 -1
- package/dist/utils/color.js +46 -41
- package/dist/utils/component.js +60 -129
- package/dist/utils/contextStore.js +47 -58
- package/dist/utils/index.js +7 -29
- package/dist/utils/motion.js +84 -113
- package/dist/utils/reactiveArrayService.js +80 -76
- package/dist/utils/size.js +14 -26
- package/dist/utils/utils.js +0 -1
- package/dist/utils/view.js +27 -24
- package/dist/vite-env.d.js +0 -1
- package/package.json +28 -23
- package/dist/_virtual/compiler-runtime.js +0 -5
- package/dist/_virtual/compiler-runtime2.js +0 -4
- package/dist/_virtual/react-compiler-runtime.development.js +0 -4
- package/dist/_virtual/react-compiler-runtime.production.js +0 -4
- package/dist/assets/components/alert/Alert.style.css +0 -1
- package/dist/assets/components/aurora/Aurora.style.css +0 -1
- package/dist/assets/components/avatar/Avatar.style.css +0 -1
- package/dist/assets/components/badge/Badge.style.css +0 -1
- package/dist/assets/components/breadcrumb/Breadcrumb.style.css +0 -1
- package/dist/assets/components/button/Button.style.css +0 -1
- package/dist/assets/components/button-group/ButtonGroup.style.css +0 -1
- package/dist/assets/components/card/Card.style.css +0 -1
- package/dist/assets/components/chart/Chart.style.css +0 -1
- package/dist/assets/components/col/Col.style.css +0 -1
- package/dist/assets/components/command/Command.style.css +0 -1
- package/dist/assets/components/container/Container.style.css +0 -1
- package/dist/assets/components/context-menu/ContextMenu.style.css +0 -1
- package/dist/assets/components/data-table/DataTable.style.css +0 -1
- package/dist/assets/components/dialog/Dialog.style.css +0 -1
- package/dist/assets/components/editor/Editor.styles.css +0 -1
- package/dist/assets/components/file-tabs/FileTabs.style.css +0 -1
- package/dist/assets/components/form/ColorInput.style.css +0 -1
- package/dist/assets/components/form/DateInput.style.css +0 -1
- package/dist/assets/components/form/EditorInput.style.css +0 -1
- package/dist/assets/components/form/FileInput.style.css +0 -1
- package/dist/assets/components/form/Input.style.css +0 -1
- package/dist/assets/components/form/InputWrapper.style.css +0 -1
- package/dist/assets/components/form/SelectInput.style.css +0 -1
- package/dist/assets/components/fullscreen/FullScreen.style.css +0 -1
- package/dist/assets/components/gantt/Gantt.style.css +0 -1
- package/dist/assets/components/icon/Icon.style.css +0 -1
- package/dist/assets/components/json-view/JsonView.style.css +0 -1
- package/dist/assets/components/layout/Layout.style.css +0 -1
- package/dist/assets/components/menu/Menu.style.css +0 -1
- package/dist/assets/components/progress/Progress.style.css +0 -1
- package/dist/assets/components/quote/Quote.style.css +0 -1
- package/dist/assets/components/resizable/Resizable.style.css +0 -1
- package/dist/assets/components/row/Row.style.css +0 -1
- package/dist/assets/components/scroll-area/ScrollArea.style.css +0 -1
- package/dist/assets/components/segmented-control/SegmentedControl.style.css +0 -1
- package/dist/assets/components/tab/Tab.style.css +0 -1
- package/dist/assets/components/text/Text.style.css +0 -1
- package/dist/assets/components/toast/Toast.style.css +0 -1
- package/dist/assets/components/tooltip/Tooltip.style.css +0 -1
- package/dist/components/icon/codezero/codezero.svg.js +0 -5
- package/dist/components/icon/codezero/gls.svg.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +0 -59
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +0 -34
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +0 -47
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +0 -17
- package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +0 -12
- package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +0 -15
- package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +0 -5
- package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/events/event-info.js +0 -14
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +0 -285
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +0 -22
- package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +0 -67
- package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +0 -28
- package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +0 -21
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +0 -130
- package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +0 -43
- package/dist/node_modules/framer-motion/dist/es/gestures/press.js +0 -29
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +0 -45
- package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +0 -33
- package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +0 -39
- package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +0 -17
- package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +0 -21
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +0 -60
- package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +0 -11
- package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +0 -14
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +0 -45
- package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +0 -21
- package/dist/node_modules/framer-motion/dist/es/motion/index.js +0 -62
- package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +0 -21
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +0 -65
- package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +0 -52
- package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +0 -39
- package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +0 -18
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +0 -13
- package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +0 -7
- package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +0 -10
- package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +0 -16
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +0 -21
- package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +0 -24
- package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +0 -10
- package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +0 -27
- package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +0 -30
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +0 -22
- package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +0 -10
- package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/utils/distance.js +0 -9
- package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +0 -4
- package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +0 -6
- package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +0 -12
- package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +0 -28
- package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +0 -8
- package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +0 -112
- package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +0 -144
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +0 -106
- package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +0 -38
- package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +0 -37
- package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +0 -30
- package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +0 -178
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +0 -46
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +0 -59
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +0 -29
- package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +0 -22
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +0 -68
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +0 -74
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +0 -37
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +0 -27
- package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +0 -23
- package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +0 -31
- package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +0 -22
- package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +0 -21
- package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +0 -21
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +0 -33
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +0 -27
- package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +0 -21
- package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +0 -43
- package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +0 -38
- package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +0 -34
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +0 -18
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +0 -27
- package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +0 -32
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +0 -25
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +0 -53
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +0 -38
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +0 -25
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +0 -18
- package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +0 -34
- package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +0 -25
- package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +0 -618
- package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +0 -53
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +0 -21
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +0 -21
- package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +0 -19
- package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/render/Feature.js +0 -10
- package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +0 -263
- package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +0 -28
- package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +0 -65
- package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +0 -37
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +0 -29
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +0 -38
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/render/store.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +0 -40
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +0 -32
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +0 -28
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +0 -143
- package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +0 -23
- package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +0 -25
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +0 -20
- package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +0 -21
- package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +0 -13
- package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +0 -39
- package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +0 -23
- package/dist/node_modules/motion-dom/dist/es/resize/index.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/utils/delay.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +0 -42
- package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +0 -29
- package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +0 -51
- package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +0 -5
- package/dist/node_modules/motion-dom/dist/es/value/index.js +0 -212
- package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +0 -19
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +0 -22
- package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +0 -15
- package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +0 -16
- package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +0 -18
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +0 -24
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +0 -51
- package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +0 -11
- package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +0 -9
- package/dist/node_modules/motion-dom/dist/es/value/types/int.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +0 -27
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +0 -70
- package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +0 -37
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +0 -17
- package/dist/node_modules/motion-dom/dist/es/value/types/test.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +0 -12
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +0 -8
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +0 -6
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +0 -4
- package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +0 -7
- package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +0 -14
- package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +0 -7
- package/dist/node_modules/motion-utils/dist/es/array.js +0 -11
- package/dist/node_modules/motion-utils/dist/es/clamp.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/easing/back.js +0 -9
- package/dist/node_modules/motion-utils/dist/es/easing/circ.js +0 -8
- package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +0 -19
- package/dist/node_modules/motion-utils/dist/es/easing/ease.js +0 -7
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +0 -32
- package/dist/node_modules/motion-utils/dist/es/errors.js +0 -14
- package/dist/node_modules/motion-utils/dist/es/format-error-message.js +0 -6
- package/dist/node_modules/motion-utils/dist/es/global-config.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/is-object.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/memo.js +0 -8
- package/dist/node_modules/motion-utils/dist/es/noop.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/pipe.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/progress.js +0 -7
- package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +0 -29
- package/dist/node_modules/motion-utils/dist/es/time-conversion.js +0 -5
- package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +0 -4
- package/dist/node_modules/motion-utils/dist/es/warn-once.js +0 -8
- package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +0 -21
- package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +0 -14
- package/dist/node_modules/react/compiler-runtime.js +0 -10
- /package/dist/assets/{components/flex/Flex.style.css → Flex.style.css} +0 -0
- /package/dist/assets/{components/spacing/Spacing.style.css → Spacing.style.css} +0 -0
|
@@ -1,65 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "
|
|
7
|
-
import "
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
pageCount: j,
|
|
54
|
-
setPage: P
|
|
55
|
-
}, children: /* @__PURE__ */ x(F, { style: {
|
|
56
|
-
flexDirection: "column",
|
|
57
|
-
gap: "0.5rem"
|
|
58
|
-
}, children: [
|
|
59
|
-
M,
|
|
60
|
-
S.map((r, o) => /* @__PURE__ */ y(m.Fragment, { children: r }, o))
|
|
61
|
-
] }) }) : M;
|
|
62
|
-
};
|
|
63
|
-
export {
|
|
64
|
-
W as DataTable
|
|
1
|
+
import { mergeComponentProps } from "../../utils/component.js";
|
|
2
|
+
import "../../utils/index.js";
|
|
3
|
+
import { Flex } from "../flex/Flex.js";
|
|
4
|
+
import '../../assets/DataTable.style.css';/* empty css */
|
|
5
|
+
import { DataTableHeader } from "./DataTableHeader.js";
|
|
6
|
+
import { DataTablePaginationContext } from "./DataTablePagination.js";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
var getNestedValue = (e, r) => r.split(".").reduce((e, r) => {
|
|
10
|
+
if (e != null) return Array.isArray(e) ? e.map((e) => e?.[r]).filter((e) => e !== void 0) : e[r];
|
|
11
|
+
}, e);
|
|
12
|
+
const DataTable = (c) => {
|
|
13
|
+
let { data: l, sort: u, filter: d, limit: f, pagination: p, loading: m, loadingComponent: h, emptyComponent: g, onSelect: _, children: v, ...y } = c, [b, x] = React.useState(0), S = Array.isArray(v) ? v : [v], C = S.find((e) => typeof e == "function"), w = S.find((e) => React.isValidElement(e) && e.type === DataTableHeader), T = S.filter((e) => typeof e != "function" && e !== w), E = l.filter((e) => Object.entries(d || {}).every(([r, { operator: i, value: a }]) => {
|
|
14
|
+
let o = getNestedValue(e, r);
|
|
15
|
+
return i === "isOneOf" && !Array.isArray(a) && !Array.isArray(o) ? o === a : i === "isOneOf" && !Array.isArray(a) && Array.isArray(o) ? Array.from(o).includes(a) : i === "isOneOf" && Array.isArray(a) && !Array.isArray(o) ? Array.from(a).some((e) => e === o) : i === "isOneOf" && Array.isArray(a) && Array.isArray(o) ? Array.from(a).some((e) => Array.from(o).includes(e)) : !1;
|
|
16
|
+
})), D = React.useMemo(() => u ? [...E].sort((e, r) => {
|
|
17
|
+
for (let [i, a] of Object.entries(u)) {
|
|
18
|
+
let o = getNestedValue(e, i), s = getNestedValue(r, i);
|
|
19
|
+
if (o < s) return a === "asc" ? -1 : 1;
|
|
20
|
+
if (o > s) return a === "asc" ? 1 : -1;
|
|
21
|
+
}
|
|
22
|
+
return 0;
|
|
23
|
+
}) : E, [E, u]), O = typeof f == "number" ? f : 10, k = p ? Math.max(1, Math.ceil(D.length / O)) : 1, A = Math.min(b, k - 1);
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
b !== A && x(A);
|
|
26
|
+
}, [b, A]);
|
|
27
|
+
let j = p ? D.slice(A * O, A * O + O) : typeof f == "number" ? D.slice(0, f) : D, M = /* @__PURE__ */ jsxs("table", {
|
|
28
|
+
...mergeComponentProps("data-table", y),
|
|
29
|
+
children: [w, /* @__PURE__ */ jsxs("tbody", { children: [j.map((e, r) => /* @__PURE__ */ jsx("tr", {
|
|
30
|
+
className: "data-table__row",
|
|
31
|
+
onClick: () => _?.(e),
|
|
32
|
+
children: C?.(e, r)
|
|
33
|
+
})), D.length === 0 && !m && g ? /* @__PURE__ */ jsx("tr", {
|
|
34
|
+
className: "data-table__row",
|
|
35
|
+
onClick: () => _?.(void 0),
|
|
36
|
+
children: g
|
|
37
|
+
}) : null] })]
|
|
38
|
+
});
|
|
39
|
+
return p ? /* @__PURE__ */ jsx(DataTablePaginationContext.Provider, {
|
|
40
|
+
value: {
|
|
41
|
+
page: A,
|
|
42
|
+
pageCount: k,
|
|
43
|
+
setPage: x
|
|
44
|
+
},
|
|
45
|
+
children: /* @__PURE__ */ jsxs(Flex, {
|
|
46
|
+
style: {
|
|
47
|
+
flexDirection: "column",
|
|
48
|
+
gap: "0.5rem"
|
|
49
|
+
},
|
|
50
|
+
children: [M, T.map((e, r) => /* @__PURE__ */ jsx(React.Fragment, { children: e }, r))]
|
|
51
|
+
})
|
|
52
|
+
}) : M;
|
|
65
53
|
};
|
|
54
|
+
export { DataTable };
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import "
|
|
4
|
-
import "react";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
e = t[1], o = t[2];
|
|
18
|
-
let r;
|
|
19
|
-
return t[3] !== e || t[4] !== o ? (r = /* @__PURE__ */ n("td", { ...o, children: e }), t[3] = e, t[4] = o, t[5] = r) : r = t[5], r;
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
h as DataTableColumn
|
|
1
|
+
import { mergeComponentProps } from "../../utils/component.js";
|
|
2
|
+
import "../../utils/index.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
const DataTableColumn = (n) => {
|
|
7
|
+
let i = c(6), a, o;
|
|
8
|
+
if (i[0] !== n) {
|
|
9
|
+
let { children: t, ...r } = n;
|
|
10
|
+
a = t, o = mergeComponentProps("", r), i[0] = n, i[1] = a, i[2] = o;
|
|
11
|
+
} else a = i[1], o = i[2];
|
|
12
|
+
let s;
|
|
13
|
+
return i[3] !== a || i[4] !== o ? (s = /* @__PURE__ */ jsx("td", {
|
|
14
|
+
...o,
|
|
15
|
+
children: a
|
|
16
|
+
}), i[3] = a, i[4] = o, i[5] = s) : s = i[5], s;
|
|
23
17
|
};
|
|
18
|
+
export { DataTableColumn };
|
|
@@ -1,213 +1,216 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import "
|
|
10
|
-
import "react";
|
|
11
|
-
import "
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}, e[11] = T, e[12] = E) : (T = e[11], E = e[12]);
|
|
173
|
-
let P;
|
|
174
|
-
return e[13] !== V || e[14] !== F || e[15] !== A ? (P = /* @__PURE__ */ u(z, { w: "100%", initialValue: "", onChange: F, style: D, tokenHighlights: I, showTooltips: !1, showValidation: !1, customSuggestionComponent: !0, suggestions: V, extensions: T, basicSetup: E, language: A }), e[13] = V, e[14] = F, e[15] = A, e[16] = P) : P = e[16], P;
|
|
1
|
+
import { hashToColor } from "../../utils/color.js";
|
|
2
|
+
import "../../utils/index.js";
|
|
3
|
+
import { Badge } from "../badge/Badge.js";
|
|
4
|
+
import { MenuItem } from "../menu/Menu.js";
|
|
5
|
+
import { Editor } from "../editor/Editor.js";
|
|
6
|
+
import { DataTableFilterSuggestionMenu } from "./DataTableFilterSuggestionMenu.js";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
8
|
+
import React from "react";
|
|
9
|
+
import { jsx } from "react/jsx-runtime";
|
|
10
|
+
import { EditorState } from "@uiw/react-codemirror";
|
|
11
|
+
import { StreamLanguage, syntaxTree } from "@codemirror/language";
|
|
12
|
+
var OP_MAP = {
|
|
13
|
+
"=": "isOneOf",
|
|
14
|
+
"!=": "isNotOneOf"
|
|
15
|
+
}, OP_LABELS = {
|
|
16
|
+
isOneOf: "is one of",
|
|
17
|
+
isNotOneOf: "is not one of"
|
|
18
|
+
}, OP_CHARS = {
|
|
19
|
+
isOneOf: "=",
|
|
20
|
+
isNotOneOf: "!="
|
|
21
|
+
}, strip = (e) => e.replace(/^\\|\\$/g, "");
|
|
22
|
+
const createFilterQueryLanguage = (e) => StreamLanguage.define({
|
|
23
|
+
startState: () => ({ tokens: [] }),
|
|
24
|
+
token(o, s) {
|
|
25
|
+
if (o.eatSpace()) return null;
|
|
26
|
+
if (o.match("!=") || o.match("=") && o.peek() !== "=") return s.tokens.push("operator"), "operator";
|
|
27
|
+
if (o.peek() === "\\") {
|
|
28
|
+
o.next();
|
|
29
|
+
let l = [];
|
|
30
|
+
for (; !o.eol() && o.peek() !== "\\";) l.push(o.next());
|
|
31
|
+
if (o.peek() === "\\") {
|
|
32
|
+
o.next();
|
|
33
|
+
let u = l.join("");
|
|
34
|
+
if (e.includes(u) && s.tokens[s.tokens.length - 1] !== "propertyName") return s.tokens.push("propertyName"), "propertyName";
|
|
35
|
+
if (s.tokens[s.tokens.length - 1] !== "literal") return s.tokens.push("literal"), "literal";
|
|
36
|
+
}
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return o.next(), null;
|
|
40
|
+
}
|
|
41
|
+
}), DataTableFilterInput = (e) => {
|
|
42
|
+
let o = c(17), { filterTokens: f, onChange: h } = e, x;
|
|
43
|
+
o[0] === f ? x = o[1] : (x = createFilterQueryLanguage(f?.map(_temp) || []), o[0] = f, o[1] = x);
|
|
44
|
+
let w = x, T;
|
|
45
|
+
o[2] === f ? T = o[3] : (T = (e) => {
|
|
46
|
+
if (!e.trim()) return {};
|
|
47
|
+
let o = {}, s = e.split(/\\/).filter(Boolean);
|
|
48
|
+
for (let e = 0; e + 2 < s.length; e += 3) {
|
|
49
|
+
let l = s[e], u = s[e + 1], d = s[e + 2];
|
|
50
|
+
if (!l || !u || !d) continue;
|
|
51
|
+
let p = f?.find((e) => e.token === l);
|
|
52
|
+
if (!p) continue;
|
|
53
|
+
let m = OP_MAP[u];
|
|
54
|
+
if (!m) continue;
|
|
55
|
+
let h = d.split(",").map(_temp2).filter(Boolean);
|
|
56
|
+
h.length > 0 && (o[p.key] = {
|
|
57
|
+
operator: m,
|
|
58
|
+
value: h
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return o;
|
|
62
|
+
}, o[2] = f, o[3] = T);
|
|
63
|
+
let E = T, D;
|
|
64
|
+
o[4] !== h || o[5] !== E ? (D = (e) => {
|
|
65
|
+
let o = E(e);
|
|
66
|
+
h?.(o);
|
|
67
|
+
}, o[4] = h, o[5] = E, o[6] = D) : D = o[6];
|
|
68
|
+
let O = D, k;
|
|
69
|
+
o[7] === f ? k = o[8] : (k = (e) => {
|
|
70
|
+
let o = syntaxTree(e.state), l = o.resolveInner(e.pos, -1), d = o.resolveInner(e.pos, 1), { propertyNode: m, operatorNode: h } = (() => {
|
|
71
|
+
let e = {
|
|
72
|
+
propertyNode: null,
|
|
73
|
+
operatorNode: null
|
|
74
|
+
};
|
|
75
|
+
for (let o = l; o; o = o.prevSibling) o.name === "propertyName" && !e.propertyNode && (e.propertyNode = o), o.name === "operator" && !e.operatorNode && (e.operatorNode = o);
|
|
76
|
+
return e;
|
|
77
|
+
})(), b = m ? e.pos < m.to ? "propertyName" : e.pos === m.to ? "operator" : h ? e.pos < h.to ? "operator" : e.pos === h.to ? "literal" : l.name === "literal" ? "propertyName" : l.name === "invalid" && e.state.sliceDoc(l.from, l.to).startsWith("\\") ? "literal" : (() => {
|
|
78
|
+
let o = e.state.sliceDoc(h.to, e.pos);
|
|
79
|
+
return o.trim() ? o.includes(" ") ? "propertyName" : "literal" : o.length > 0 ? "propertyName" : "literal";
|
|
80
|
+
})() : (d.name, "operator") : "propertyName", x = m ? strip(e.state.sliceDoc(m.from, m.to)) : "", S = f?.find((e) => e.token === x), C = (o, s, l, u) => {
|
|
81
|
+
u ? e.view?.dispatch({
|
|
82
|
+
changes: {
|
|
83
|
+
from: o,
|
|
84
|
+
to: s,
|
|
85
|
+
insert: l
|
|
86
|
+
},
|
|
87
|
+
selection: { anchor: e.pos },
|
|
88
|
+
scrollIntoView: !1
|
|
89
|
+
}) : (e.view?.dispatch({
|
|
90
|
+
changes: {
|
|
91
|
+
from: o,
|
|
92
|
+
to: s,
|
|
93
|
+
insert: l
|
|
94
|
+
},
|
|
95
|
+
selection: { anchor: o + l.length },
|
|
96
|
+
scrollIntoView: !0
|
|
97
|
+
}), e.view?.focus());
|
|
98
|
+
};
|
|
99
|
+
if (b === "propertyName") {
|
|
100
|
+
let h = /* @__PURE__ */ new Set(), g = e.matchBefore(/\\?[\w-]*/), _ = g ? g.from : e.pos, v = m && e.pos <= m.to, y = d.name === "propertyName" ? d.to : v ? m.to : e.pos, b = v && m.from < _ ? m.from : _, x = strip(e.state.sliceDoc(b, e.pos)), S = f?.filter((e) => e.token.startsWith(x) && !h.has(e.token)) || [];
|
|
101
|
+
if (o.iterate({ enter: (o) => {
|
|
102
|
+
o.name === "propertyName" && h.add(strip(e.state.sliceDoc(o.from, o.to)));
|
|
103
|
+
} }), S.length) return /* @__PURE__ */ jsx(DataTableFilterSuggestionMenu, {
|
|
104
|
+
context: e,
|
|
105
|
+
children: S.map((o) => /* @__PURE__ */ jsx(MenuItem, {
|
|
106
|
+
onSelect: () => {
|
|
107
|
+
let s = `\\${o.token}\\`;
|
|
108
|
+
l.name === "literal" && e.state.sliceDoc(y, y + 1) !== "\\" && (s = "\\" + s), C(b, y, s);
|
|
109
|
+
},
|
|
110
|
+
children: o.token
|
|
111
|
+
}, o.token))
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
if (b === "operator" && S) {
|
|
115
|
+
let o = e.matchBefore(/[!=]+/), l = o ? o.from : e.pos, f = h && e.pos <= h.to, m = d.name === "operator" ? d.to : f ? h.to : e.pos, g = f && h.from < l ? h.from : l;
|
|
116
|
+
return /* @__PURE__ */ jsx(DataTableFilterSuggestionMenu, {
|
|
117
|
+
context: e,
|
|
118
|
+
children: S.operators.map((e) => /* @__PURE__ */ jsx(MenuItem, {
|
|
119
|
+
onSelect: () => C(g, m, OP_CHARS[e]),
|
|
120
|
+
children: OP_LABELS[e]
|
|
121
|
+
}, e))
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
if (b === "literal" && S?.suggestion) {
|
|
125
|
+
let o = OP_MAP[h ? e.state.sliceDoc(h.from, h.to) : ""];
|
|
126
|
+
if (o && S.operators.includes(o)) {
|
|
127
|
+
let s = d.name === "literal" ? e.state.sliceDoc(d.from, d.to) : "";
|
|
128
|
+
return S.suggestion(e, o, strip(s), (o, s) => {
|
|
129
|
+
let u = l.name === "literal" || l.name === "invalid" && e.state.sliceDoc(l.from, l.to).startsWith("\\");
|
|
130
|
+
C(u ? l.from : e.pos, u ? l.to : d.name === "literal" ? d.to : e.pos, `\\${o}\\`, s);
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return null;
|
|
135
|
+
}, o[7] = f, o[8] = k);
|
|
136
|
+
let A = k, j, M;
|
|
137
|
+
o[9] === Symbol.for("react.memo_cache_sentinel") ? (j = {
|
|
138
|
+
backgroundColor: "rgba(255,255,255,.1)",
|
|
139
|
+
padding: "0.35rem",
|
|
140
|
+
boxSizing: "border-box",
|
|
141
|
+
borderRadius: "1rem",
|
|
142
|
+
boxShadow: "inset 0 1px 1px 0 rgba(255,255,255,.2)"
|
|
143
|
+
}, M = {
|
|
144
|
+
literal: _temp4,
|
|
145
|
+
operator: _temp5,
|
|
146
|
+
propertyName: _temp6
|
|
147
|
+
}, o[9] = j, o[10] = M) : (j = o[9], M = o[10]);
|
|
148
|
+
let N, P;
|
|
149
|
+
o[11] === Symbol.for("react.memo_cache_sentinel") ? (N = [EditorState.transactionFilter.of(_temp7)], P = {
|
|
150
|
+
lineNumbers: !1,
|
|
151
|
+
foldGutter: !1,
|
|
152
|
+
highlightActiveLine: !1,
|
|
153
|
+
highlightActiveLineGutter: !1,
|
|
154
|
+
dropCursor: !1,
|
|
155
|
+
indentOnInput: !1
|
|
156
|
+
}, o[11] = N, o[12] = P) : (N = o[11], P = o[12]);
|
|
157
|
+
let F;
|
|
158
|
+
return o[13] !== A || o[14] !== O || o[15] !== w ? (F = /* @__PURE__ */ jsx(Editor, {
|
|
159
|
+
w: "100%",
|
|
160
|
+
initialValue: "",
|
|
161
|
+
onChange: O,
|
|
162
|
+
style: j,
|
|
163
|
+
tokenHighlights: M,
|
|
164
|
+
showTooltips: !1,
|
|
165
|
+
showValidation: !1,
|
|
166
|
+
customSuggestionComponent: !0,
|
|
167
|
+
suggestions: A,
|
|
168
|
+
extensions: N,
|
|
169
|
+
basicSetup: P,
|
|
170
|
+
language: w
|
|
171
|
+
}), o[13] = A, o[14] = O, o[15] = w, o[16] = F) : F = o[16], F;
|
|
175
172
|
};
|
|
176
|
-
function
|
|
177
|
-
|
|
173
|
+
function _temp(e) {
|
|
174
|
+
return e.token;
|
|
178
175
|
}
|
|
179
|
-
function
|
|
180
|
-
|
|
176
|
+
function _temp2(e) {
|
|
177
|
+
return e.trim();
|
|
181
178
|
}
|
|
182
|
-
function
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
179
|
+
function _temp3(e) {
|
|
180
|
+
return /* @__PURE__ */ jsx(Badge, {
|
|
181
|
+
style: { boxShadow: "none" },
|
|
182
|
+
color: "secondary",
|
|
183
|
+
children: e
|
|
184
|
+
}, e);
|
|
186
185
|
}
|
|
187
|
-
function
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
186
|
+
function _temp4(e) {
|
|
187
|
+
let { content: s } = e, l = strip(s).split(",");
|
|
188
|
+
return l.length > 1 ? /* @__PURE__ */ jsx(Badge, {
|
|
189
|
+
p: .175,
|
|
190
|
+
mx: .175,
|
|
191
|
+
children: l.map(_temp3)
|
|
192
|
+
}) : /* @__PURE__ */ jsx(Badge, {
|
|
193
|
+
mx: .175,
|
|
194
|
+
children: strip(s)
|
|
195
|
+
});
|
|
192
196
|
}
|
|
193
|
-
function
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
197
|
+
function _temp5(e) {
|
|
198
|
+
let { content: s } = e;
|
|
199
|
+
return /* @__PURE__ */ jsx(Badge, {
|
|
200
|
+
color: "tertiary",
|
|
201
|
+
style: { boxShadow: "none" },
|
|
202
|
+
children: OP_LABELS[OP_MAP[s]] || s
|
|
203
|
+
});
|
|
200
204
|
}
|
|
201
|
-
function
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
205
|
+
function _temp6(s) {
|
|
206
|
+
let { content: l } = s;
|
|
207
|
+
return /* @__PURE__ */ jsx(Badge, {
|
|
208
|
+
mx: .175,
|
|
209
|
+
color: hashToColor(strip(l)),
|
|
210
|
+
children: strip(l)
|
|
211
|
+
});
|
|
206
212
|
}
|
|
207
|
-
function
|
|
208
|
-
|
|
213
|
+
function _temp7(e) {
|
|
214
|
+
return e.docChanged && e.newDoc.lines > 1 ? [] : e;
|
|
209
215
|
}
|
|
210
|
-
export {
|
|
211
|
-
Ne as DataTableFilterInput,
|
|
212
|
-
Z as createFilterQueryLanguage
|
|
213
|
-
};
|
|
216
|
+
export { DataTableFilterInput, createFilterQueryLanguage };
|