@code0-tech/pictor 0.18.3 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (464) hide show
  1. package/dist/_virtual/__vite-optional-peer-dep_@emotion/is-prop-valid_framer-motion.js +6 -0
  2. package/dist/_virtual/rolldown_runtime.js +18 -0
  3. package/dist/assets/Alert.style.css +1 -0
  4. package/dist/assets/Aurora.style.css +1 -0
  5. package/dist/assets/Avatar.style.css +1 -0
  6. package/dist/assets/Badge.style.css +1 -0
  7. package/dist/assets/Breadcrumb.style.css +1 -0
  8. package/dist/assets/Button.style.css +1 -0
  9. package/dist/assets/ButtonGroup.style.css +1 -0
  10. package/dist/assets/Card.style.css +1 -0
  11. package/dist/assets/Chart.style.css +1 -0
  12. package/dist/assets/Col.style.css +1 -0
  13. package/dist/assets/ColorInput.style.css +1 -0
  14. package/dist/assets/Command.style.css +1 -0
  15. package/dist/assets/Container.style.css +1 -0
  16. package/dist/assets/ContextMenu.style.css +1 -0
  17. package/dist/assets/DataTable.style.css +1 -0
  18. package/dist/assets/DateInput.style.css +1 -0
  19. package/dist/assets/Dialog.style.css +1 -0
  20. package/dist/assets/Editor.styles.css +1 -0
  21. package/dist/assets/EditorInput.style.css +1 -0
  22. package/dist/assets/FileInput.style.css +1 -0
  23. package/dist/assets/FileTabs.style.css +1 -0
  24. package/dist/assets/FullScreen.style.css +1 -0
  25. package/dist/assets/Gantt.style.css +1 -0
  26. package/dist/assets/Icon.style.css +1 -0
  27. package/dist/assets/Input.style.css +1 -0
  28. package/dist/assets/InputWrapper.style.css +1 -0
  29. package/dist/assets/JsonView.style.css +1 -0
  30. package/dist/assets/Layout.style.css +1 -0
  31. package/dist/assets/Menu.style.css +1 -0
  32. package/dist/assets/Progress.style.css +1 -0
  33. package/dist/assets/Quote.style.css +1 -0
  34. package/dist/assets/Resizable.style.css +1 -0
  35. package/dist/assets/Row.style.css +1 -0
  36. package/dist/assets/ScrollArea.style.css +1 -0
  37. package/dist/assets/SegmentedControl.style.css +1 -0
  38. package/dist/assets/SelectInput.style.css +1 -0
  39. package/dist/assets/Tab.style.css +1 -0
  40. package/dist/assets/Text.style.css +1 -0
  41. package/dist/assets/Toast.style.css +1 -0
  42. package/dist/assets/Tooltip.style.css +1 -0
  43. package/dist/components/alert/Alert.js +34 -41
  44. package/dist/components/aurora/Aurora.js +27 -22
  45. package/dist/components/avatar/Avatar.js +57 -55
  46. package/dist/components/badge/Badge.js +58 -64
  47. package/dist/components/breadcrumb/Breadcrumb.js +16 -20
  48. package/dist/components/button/Button.js +24 -31
  49. package/dist/components/button-group/ButtonGroup.js +29 -31
  50. package/dist/components/card/Card.js +30 -44
  51. package/dist/components/card/CardSection.js +21 -29
  52. package/dist/components/chart/Chart.js +138 -153
  53. package/dist/components/chart/LineChart.js +75 -74
  54. package/dist/components/chart/index.js +3 -8
  55. package/dist/components/col/Col.js +19 -29
  56. package/dist/components/command/Command.js +101 -134
  57. package/dist/components/container/Container.js +19 -23
  58. package/dist/components/context-menu/ContextMenu.d.ts +1 -1
  59. package/dist/components/context-menu/ContextMenu.js +119 -125
  60. package/dist/components/data-table/DataTable.js +53 -63
  61. package/dist/components/data-table/DataTableColumn.js +18 -22
  62. package/dist/components/data-table/DataTableFilterInput.js +208 -205
  63. package/dist/components/data-table/DataTableFilterSuggestionMenu.js +59 -48
  64. package/dist/components/data-table/DataTableHeader.js +34 -38
  65. package/dist/components/data-table/DataTablePagination.js +62 -74
  66. package/dist/components/data-table/index.js +7 -22
  67. package/dist/components/dialog/Dialog.js +107 -102
  68. package/dist/components/editor/Editor.js +352 -322
  69. package/dist/components/file-tabs/FileTabs.js +78 -73
  70. package/dist/components/file-tabs/FileTabs.service.js +85 -87
  71. package/dist/components/file-tabs/FileTabs.view.js +0 -1
  72. package/dist/components/file-tabs/index.js +3 -9
  73. package/dist/components/flex/Flex.js +19 -23
  74. package/dist/components/form/CheckboxInput.js +73 -76
  75. package/dist/components/form/ColorInput.js +378 -353
  76. package/dist/components/form/DateInput.js +315 -265
  77. package/dist/components/form/EditorInput.js +597 -579
  78. package/dist/components/form/EmailInput.js +30 -23
  79. package/dist/components/form/FileInput.js +93 -123
  80. package/dist/components/form/Input.js +64 -57
  81. package/dist/components/form/Input.utils.js +25 -37
  82. package/dist/components/form/InputDescription.js +11 -11
  83. package/dist/components/form/InputLabel.js +18 -22
  84. package/dist/components/form/InputMessage.js +17 -17
  85. package/dist/components/form/InputWrapper.js +56 -65
  86. package/dist/components/form/NumberInput.js +41 -20
  87. package/dist/components/form/PasswordInput.js +71 -54
  88. package/dist/components/form/PinInput.js +50 -65
  89. package/dist/components/form/RadioGroup.js +42 -50
  90. package/dist/components/form/RadioInput.js +31 -29
  91. package/dist/components/form/SelectInput.js +69 -92
  92. package/dist/components/form/SwitchInput.js +17 -18
  93. package/dist/components/form/TagInput.js +108 -122
  94. package/dist/components/form/TextAreaInput.js +24 -21
  95. package/dist/components/form/TextInput.js +30 -22
  96. package/dist/components/form/index.js +22 -87
  97. package/dist/components/form/useForm.js +87 -88
  98. package/dist/components/fullscreen/FullScreen.js +28 -27
  99. package/dist/components/gantt/Gantt.js +100 -98
  100. package/dist/components/gantt/GanttGroup.js +210 -194
  101. package/dist/components/gantt/GanttHeader.js +79 -81
  102. package/dist/components/gantt/GanttItem.js +19 -22
  103. package/dist/components/icon/Icon.d.ts +6 -4
  104. package/dist/components/icon/Icon.js +53 -42
  105. package/dist/components/icon/codezero/codezero.js +10 -0
  106. package/dist/components/icon/codezero/gls.js +9 -0
  107. package/dist/components/icon/codezero/index.js +17 -13
  108. package/dist/components/json-view/JsonView.js +120 -109
  109. package/dist/components/layout/Layout.js +101 -78
  110. package/dist/components/menu/Menu.js +135 -141
  111. package/dist/components/progress/ProgressCircle.js +60 -48
  112. package/dist/components/progress/ProgressLinear.js +39 -42
  113. package/dist/components/quote/Quote.js +52 -43
  114. package/dist/components/resizable/Resizable.js +36 -33
  115. package/dist/components/row/Row.js +19 -23
  116. package/dist/components/scroll-area/ScrollArea.js +66 -76
  117. package/dist/components/segmented-control/SegmentedControl.d.ts +2 -2
  118. package/dist/components/segmented-control/SegmentedControl.js +46 -26
  119. package/dist/components/spacing/Spacing.js +16 -23
  120. package/dist/components/tab/Tab.js +73 -40
  121. package/dist/components/text/Text.js +19 -25
  122. package/dist/components/toast/Toast.d.ts +1 -1
  123. package/dist/components/toast/Toast.js +104 -83
  124. package/dist/components/tooltip/Tooltip.js +66 -60
  125. package/dist/index.js +76 -261
  126. package/dist/node_modules/@lezer/common/dist/index.js +778 -143
  127. package/dist/node_modules/@lezer/highlight/dist/index.js +305 -536
  128. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.js +55 -55
  129. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.js +49 -32
  130. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/index.js +57 -46
  131. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.js +17 -16
  132. package/dist/node_modules/framer-motion/dist/es/components/AnimatePresence/utils.js +8 -11
  133. package/dist/node_modules/framer-motion/dist/es/context/LayoutGroupContext.js +4 -5
  134. package/dist/node_modules/framer-motion/dist/es/context/LazyContext.js +4 -5
  135. package/dist/node_modules/framer-motion/dist/es/context/MotionConfigContext.js +7 -8
  136. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/create.js +13 -11
  137. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/index.js +4 -5
  138. package/dist/node_modules/framer-motion/dist/es/context/MotionContext/utils.js +12 -14
  139. package/dist/node_modules/framer-motion/dist/es/context/PresenceContext.js +4 -5
  140. package/dist/node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.js +4 -5
  141. package/dist/node_modules/framer-motion/dist/es/events/add-pointer-event.js +5 -7
  142. package/dist/node_modules/framer-motion/dist/es/events/event-info.js +8 -13
  143. package/dist/node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.js +252 -281
  144. package/dist/node_modules/framer-motion/dist/es/gestures/drag/index.js +19 -21
  145. package/dist/node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.js +57 -67
  146. package/dist/node_modules/framer-motion/dist/es/gestures/focus.js +24 -27
  147. package/dist/node_modules/framer-motion/dist/es/gestures/hover.js +16 -19
  148. package/dist/node_modules/framer-motion/dist/es/gestures/pan/PanSession.js +130 -124
  149. package/dist/node_modules/framer-motion/dist/es/gestures/pan/index.js +39 -42
  150. package/dist/node_modules/framer-motion/dist/es/gestures/press.js +22 -27
  151. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/exit.js +36 -44
  152. package/dist/node_modules/framer-motion/dist/es/motion/features/animation/index.js +22 -32
  153. package/dist/node_modules/framer-motion/dist/es/motion/features/animations.js +6 -12
  154. package/dist/node_modules/framer-motion/dist/es/motion/features/definitions.js +47 -37
  155. package/dist/node_modules/framer-motion/dist/es/motion/features/drag.js +12 -16
  156. package/dist/node_modules/framer-motion/dist/es/motion/features/gestures.js +10 -20
  157. package/dist/node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.js +58 -59
  158. package/dist/node_modules/framer-motion/dist/es/motion/features/layout.js +7 -11
  159. package/dist/node_modules/framer-motion/dist/es/motion/features/load-features.js +10 -13
  160. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/index.js +42 -43
  161. package/dist/node_modules/framer-motion/dist/es/motion/features/viewport/observers.js +19 -18
  162. package/dist/node_modules/framer-motion/dist/es/motion/index.js +64 -58
  163. package/dist/node_modules/framer-motion/dist/es/motion/utils/symbol.js +2 -4
  164. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.js +18 -20
  165. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-element.js +53 -62
  166. package/dist/node_modules/framer-motion/dist/es/motion/utils/use-visual-state.js +45 -49
  167. package/dist/node_modules/framer-motion/dist/es/motion/utils/valid-prop.js +4 -38
  168. package/dist/node_modules/framer-motion/dist/es/render/components/create-proxy.js +7 -17
  169. package/dist/node_modules/framer-motion/dist/es/render/components/m/proxy.js +3 -0
  170. package/dist/node_modules/framer-motion/dist/es/render/components/motion/feature-bundle.js +10 -12
  171. package/dist/node_modules/framer-motion/dist/es/render/components/motion/proxy.js +5 -7
  172. package/dist/node_modules/framer-motion/dist/es/render/dom/create-visual-element.js +6 -10
  173. package/dist/node_modules/framer-motion/dist/es/render/dom/use-render.js +18 -15
  174. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/filter-props.js +14 -18
  175. package/dist/node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.js +4 -23
  176. package/dist/node_modules/framer-motion/dist/es/render/html/use-html-visual-state.js +8 -9
  177. package/dist/node_modules/framer-motion/dist/es/render/html/use-props.js +20 -23
  178. package/dist/node_modules/framer-motion/dist/es/render/html/utils/create-render-state.js +6 -8
  179. package/dist/node_modules/framer-motion/dist/es/render/svg/lowercase-elements.js +27 -29
  180. package/dist/node_modules/framer-motion/dist/es/render/svg/use-props.js +23 -21
  181. package/dist/node_modules/framer-motion/dist/es/render/svg/use-svg-visual-state.js +8 -9
  182. package/dist/node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.js +5 -7
  183. package/dist/node_modules/framer-motion/dist/es/utils/distance.js +5 -8
  184. package/dist/node_modules/framer-motion/dist/es/utils/get-context-window.js +2 -4
  185. package/dist/node_modules/framer-motion/dist/es/utils/is-browser.js +2 -4
  186. package/dist/node_modules/framer-motion/dist/es/utils/is-ref-object.js +3 -5
  187. package/dist/node_modules/framer-motion/dist/es/utils/reduced-motion/use-reduced-motion.js +11 -0
  188. package/dist/node_modules/framer-motion/dist/es/utils/use-composed-ref.js +20 -25
  189. package/dist/node_modules/framer-motion/dist/es/utils/use-constant.js +6 -7
  190. package/dist/node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.js +5 -6
  191. package/dist/node_modules/motion/dist/es/react.js +196 -0
  192. package/dist/node_modules/motion-dom/dist/es/animation/AsyncMotionValueAnimation.js +104 -111
  193. package/dist/node_modules/motion-dom/dist/es/animation/JSAnimation.js +126 -143
  194. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimation.js +81 -105
  195. package/dist/node_modules/motion-dom/dist/es/animation/NativeAnimationExtended.js +25 -37
  196. package/dist/node_modules/motion-dom/dist/es/animation/animate/single-value.js +7 -9
  197. package/dist/node_modules/motion-dom/dist/es/animation/drivers/frame.js +10 -16
  198. package/dist/node_modules/motion-dom/dist/es/animation/generators/inertia.js +29 -36
  199. package/dist/node_modules/motion-dom/dist/es/animation/generators/keyframes.js +18 -28
  200. package/dist/node_modules/motion-dom/dist/es/animation/generators/spring.js +156 -170
  201. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/calc-duration.js +6 -12
  202. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/create-generator-easing.js +13 -12
  203. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/is-generator.js +3 -5
  204. package/dist/node_modules/motion-dom/dist/es/animation/generators/utils/velocity.js +6 -8
  205. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/motion-value.js +42 -45
  206. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-target.js +52 -57
  207. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element-variant.js +22 -27
  208. package/dist/node_modules/motion-dom/dist/es/animation/interfaces/visual-element.js +18 -21
  209. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/DOMKeyframesResolver.js +58 -67
  210. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/KeyframesResolver.js +61 -70
  211. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/get-final.js +5 -7
  212. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/default.js +5 -7
  213. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/fill.js +9 -11
  214. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/offsets/time.js +3 -5
  215. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/fill-wildcards.js +3 -6
  216. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/is-none.js +4 -6
  217. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/make-none-animatable.js +15 -15
  218. package/dist/node_modules/motion-dom/dist/es/animation/keyframes/utils/unit-conversion.js +32 -35
  219. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/data-id.js +3 -6
  220. package/dist/node_modules/motion-dom/dist/es/animation/optimized-appear/get-appear-id.js +4 -6
  221. package/dist/node_modules/motion-dom/dist/es/animation/utils/WithPromise.js +19 -26
  222. package/dist/node_modules/motion-dom/dist/es/animation/utils/calc-child-stagger.js +4 -6
  223. package/dist/node_modules/motion-dom/dist/es/animation/utils/can-animate.js +14 -21
  224. package/dist/node_modules/motion-dom/dist/es/animation/utils/css-variables-conversion.js +21 -29
  225. package/dist/node_modules/motion-dom/dist/es/animation/utils/default-transitions.js +25 -22
  226. package/dist/node_modules/motion-dom/dist/es/animation/utils/get-value-transition.js +5 -7
  227. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-animatable.js +3 -7
  228. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-css-variable.js +4 -8
  229. package/dist/node_modules/motion-dom/dist/es/animation/utils/is-transition-defined.js +15 -19
  230. package/dist/node_modules/motion-dom/dist/es/animation/utils/make-animation-instant.js +3 -5
  231. package/dist/node_modules/motion-dom/dist/es/animation/utils/replace-transition-type.js +12 -14
  232. package/dist/node_modules/motion-dom/dist/es/animation/utils/resolve-transition.js +10 -9
  233. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/cubic-bezier.js +2 -4
  234. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/map-easing.js +8 -11
  235. package/dist/node_modules/motion-dom/dist/es/animation/waapi/easing/supported.js +32 -14
  236. package/dist/node_modules/motion-dom/dist/es/animation/waapi/start-waapi-animation.js +16 -20
  237. package/dist/node_modules/motion-dom/dist/es/animation/waapi/supports/waapi.js +21 -32
  238. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/accelerated-values.js +7 -11
  239. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/apply-generator.js +5 -7
  240. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/is-browser-color.js +5 -9
  241. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/linear.js +5 -9
  242. package/dist/node_modules/motion-dom/dist/es/animation/waapi/utils/unsupported-easing.js +12 -14
  243. package/dist/node_modules/motion-dom/dist/es/events/add-dom-event.js +3 -5
  244. package/dist/node_modules/motion-dom/dist/es/frameloop/batcher.js +27 -26
  245. package/dist/node_modules/motion-dom/dist/es/frameloop/frame.js +4 -9
  246. package/dist/node_modules/motion-dom/dist/es/frameloop/microtask.js +3 -5
  247. package/dist/node_modules/motion-dom/dist/es/frameloop/order.js +10 -20
  248. package/dist/node_modules/motion-dom/dist/es/frameloop/render-step.js +29 -42
  249. package/dist/node_modules/motion-dom/dist/es/frameloop/sync-time.js +11 -13
  250. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/is-active.js +6 -9
  251. package/dist/node_modules/motion-dom/dist/es/gestures/drag/state/set-active.js +8 -10
  252. package/dist/node_modules/motion-dom/dist/es/gestures/hover.js +32 -36
  253. package/dist/node_modules/motion-dom/dist/es/gestures/press/index.js +32 -32
  254. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/is-keyboard-accessible.js +16 -15
  255. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/keyboard.js +23 -24
  256. package/dist/node_modules/motion-dom/dist/es/gestures/press/utils/state.js +2 -4
  257. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-node-or-child.js +2 -4
  258. package/dist/node_modules/motion-dom/dist/es/gestures/utils/is-primary-pointer.js +2 -4
  259. package/dist/node_modules/motion-dom/dist/es/gestures/utils/setup.js +13 -11
  260. package/dist/node_modules/motion-dom/dist/es/projection/animation/mix-values.js +20 -29
  261. package/dist/node_modules/motion-dom/dist/es/projection/geometry/conversion.js +34 -22
  262. package/dist/node_modules/motion-dom/dist/es/projection/geometry/copy.js +7 -11
  263. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-apply.js +41 -53
  264. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-calc.js +28 -38
  265. package/dist/node_modules/motion-dom/dist/es/projection/geometry/delta-remove.js +23 -21
  266. package/dist/node_modules/motion-dom/dist/es/projection/geometry/models.js +15 -17
  267. package/dist/node_modules/motion-dom/dist/es/projection/geometry/utils.js +18 -26
  268. package/dist/node_modules/motion-dom/dist/es/projection/node/DocumentProjectionNode.js +10 -12
  269. package/dist/node_modules/motion-dom/dist/es/projection/node/HTMLProjectionNode.js +19 -24
  270. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +554 -592
  271. package/dist/node_modules/motion-dom/dist/es/projection/node/state.js +4 -14
  272. package/dist/node_modules/motion-dom/dist/es/projection/shared/stack.js +48 -52
  273. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-border-radius.js +10 -20
  274. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-box-shadow.js +11 -16
  275. package/dist/node_modules/motion-dom/dist/es/projection/styles/scale-correction.js +14 -20
  276. package/dist/node_modules/motion-dom/dist/es/projection/styles/transform.js +9 -12
  277. package/dist/node_modules/motion-dom/dist/es/projection/utils/compare-by-depth.js +2 -4
  278. package/dist/node_modules/motion-dom/dist/es/projection/utils/each-axis.js +3 -5
  279. package/dist/node_modules/motion-dom/dist/es/projection/utils/flat-tree.js +16 -18
  280. package/dist/node_modules/motion-dom/dist/es/projection/utils/has-transform.js +11 -15
  281. package/dist/node_modules/motion-dom/dist/es/projection/utils/measure.js +8 -11
  282. package/dist/node_modules/motion-dom/dist/es/render/Feature.js +6 -9
  283. package/dist/node_modules/motion-dom/dist/es/render/VisualElement.js +198 -260
  284. package/dist/node_modules/motion-dom/dist/es/render/dom/DOMVisualElement.js +25 -27
  285. package/dist/node_modules/motion-dom/dist/es/render/dom/is-css-var.js +2 -4
  286. package/dist/node_modules/motion-dom/dist/es/render/dom/parse-transform.js +49 -60
  287. package/dist/node_modules/motion-dom/dist/es/render/dom/style-set.js +4 -6
  288. package/dist/node_modules/motion-dom/dist/es/render/dom/utils/camel-to-dash.js +3 -5
  289. package/dist/node_modules/motion-dom/dist/es/render/html/HTMLVisualElement.js +35 -35
  290. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-styles.js +25 -28
  291. package/dist/node_modules/motion-dom/dist/es/render/html/utils/build-transform.js +33 -37
  292. package/dist/node_modules/motion-dom/dist/es/render/html/utils/render.js +5 -11
  293. package/dist/node_modules/motion-dom/dist/es/render/html/utils/scrape-motion-values.js +8 -12
  294. package/dist/node_modules/motion-dom/dist/es/render/store.js +2 -4
  295. package/dist/node_modules/motion-dom/dist/es/render/svg/SVGVisualElement.js +37 -39
  296. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/build-attrs.js +18 -30
  297. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/camel-case-attrs.js +25 -27
  298. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/is-svg-tag.js +2 -4
  299. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/path.js +11 -13
  300. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/render.js +6 -10
  301. package/dist/node_modules/motion-dom/dist/es/render/svg/utils/scrape-motion-values.js +11 -14
  302. package/dist/node_modules/motion-dom/dist/es/render/utils/animation-state.js +128 -138
  303. package/dist/node_modules/motion-dom/dist/es/render/utils/get-variant-context.js +16 -19
  304. package/dist/node_modules/motion-dom/dist/es/render/utils/is-animation-controls.js +3 -5
  305. package/dist/node_modules/motion-dom/dist/es/render/utils/is-controlling-variants.js +8 -11
  306. package/dist/node_modules/motion-dom/dist/es/render/utils/is-forced-motion-value.js +5 -8
  307. package/dist/node_modules/motion-dom/dist/es/render/utils/is-keyframes-target.js +2 -4
  308. package/dist/node_modules/motion-dom/dist/es/render/utils/is-variant-label.js +3 -5
  309. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-position.js +10 -12
  310. package/dist/node_modules/motion-dom/dist/es/render/utils/keys-transform.js +20 -23
  311. package/dist/node_modules/motion-dom/dist/es/render/utils/motion-values.js +18 -24
  312. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/index.js +8 -14
  313. package/dist/node_modules/motion-dom/dist/es/render/utils/reduced-motion/state.js +2 -5
  314. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-dynamic-variants.js +5 -7
  315. package/dist/node_modules/motion-dom/dist/es/render/utils/resolve-variants.js +16 -18
  316. package/dist/node_modules/motion-dom/dist/es/render/utils/setters.js +14 -18
  317. package/dist/node_modules/motion-dom/dist/es/render/utils/shallow-compare.js +7 -13
  318. package/dist/node_modules/motion-dom/dist/es/render/utils/variant-props.js +10 -13
  319. package/dist/node_modules/motion-dom/dist/es/resize/handle-element.js +31 -35
  320. package/dist/node_modules/motion-dom/dist/es/resize/handle-window.js +18 -21
  321. package/dist/node_modules/motion-dom/dist/es/resize/index.js +5 -7
  322. package/dist/node_modules/motion-dom/dist/es/stats/buffer.js +5 -0
  323. package/dist/node_modules/motion-dom/dist/es/utils/border-radius.js +7 -0
  324. package/dist/node_modules/motion-dom/dist/es/utils/delay.js +9 -11
  325. package/dist/node_modules/motion-dom/dist/es/utils/interpolate.js +29 -40
  326. package/dist/node_modules/motion-dom/dist/es/utils/is-html-element.js +4 -6
  327. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-element.js +4 -6
  328. package/dist/node_modules/motion-dom/dist/es/utils/is-svg-svg-element.js +4 -6
  329. package/dist/node_modules/motion-dom/dist/es/utils/mix/color.js +26 -27
  330. package/dist/node_modules/motion-dom/dist/es/utils/mix/complex.js +44 -45
  331. package/dist/node_modules/motion-dom/dist/es/utils/mix/immediate.js +3 -5
  332. package/dist/node_modules/motion-dom/dist/es/utils/mix/index.js +5 -7
  333. package/dist/node_modules/motion-dom/dist/es/utils/mix/number.js +2 -4
  334. package/dist/node_modules/motion-dom/dist/es/utils/mix/visibility.js +4 -7
  335. package/dist/node_modules/motion-dom/dist/es/utils/resolve-elements.js +11 -14
  336. package/dist/node_modules/motion-dom/dist/es/utils/supports/flags.js +2 -4
  337. package/dist/node_modules/motion-dom/dist/es/utils/supports/linear-easing.js +9 -11
  338. package/dist/node_modules/motion-dom/dist/es/utils/supports/memo.js +6 -8
  339. package/dist/node_modules/motion-dom/dist/es/utils/supports/scroll-timeline.js +3 -5
  340. package/dist/node_modules/motion-dom/dist/es/value/index.js +89 -211
  341. package/dist/node_modules/motion-dom/dist/es/value/types/auto.js +4 -6
  342. package/dist/node_modules/motion-dom/dist/es/value/types/color/hex.js +15 -17
  343. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla-to-rgba.js +17 -20
  344. package/dist/node_modules/motion-dom/dist/es/value/types/color/hsla.js +9 -11
  345. package/dist/node_modules/motion-dom/dist/es/value/types/color/index.js +12 -14
  346. package/dist/node_modules/motion-dom/dist/es/value/types/color/rgba.js +12 -15
  347. package/dist/node_modules/motion-dom/dist/es/value/types/color/utils.js +13 -17
  348. package/dist/node_modules/motion-dom/dist/es/value/types/complex/filter.js +22 -22
  349. package/dist/node_modules/motion-dom/dist/es/value/types/complex/index.js +43 -44
  350. package/dist/node_modules/motion-dom/dist/es/value/types/complex/mask.js +11 -10
  351. package/dist/node_modules/motion-dom/dist/es/value/types/dimensions.js +14 -9
  352. package/dist/node_modules/motion-dom/dist/es/value/types/int.js +5 -7
  353. package/dist/node_modules/motion-dom/dist/es/value/types/maps/defaults.js +22 -27
  354. package/dist/node_modules/motion-dom/dist/es/value/types/maps/number.js +61 -69
  355. package/dist/node_modules/motion-dom/dist/es/value/types/maps/transform.js +29 -36
  356. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/index.js +12 -16
  357. package/dist/node_modules/motion-dom/dist/es/value/types/numbers/units.js +10 -17
  358. package/dist/node_modules/motion-dom/dist/es/value/types/test.js +2 -4
  359. package/dist/node_modules/motion-dom/dist/es/value/types/utils/animatable-none.js +9 -11
  360. package/dist/node_modules/motion-dom/dist/es/value/types/utils/color-regex.js +2 -4
  361. package/dist/node_modules/motion-dom/dist/es/value/types/utils/find.js +10 -8
  362. package/dist/node_modules/motion-dom/dist/es/value/types/utils/float-regex.js +2 -4
  363. package/dist/node_modules/motion-dom/dist/es/value/types/utils/get-as-type.js +2 -4
  364. package/dist/node_modules/motion-dom/dist/es/value/types/utils/is-nullish.js +3 -5
  365. package/dist/node_modules/motion-dom/dist/es/value/types/utils/sanitize.js +2 -4
  366. package/dist/node_modules/motion-dom/dist/es/value/types/utils/single-color-regex.js +2 -4
  367. package/dist/node_modules/motion-dom/dist/es/value/utils/is-motion-value.js +2 -4
  368. package/dist/node_modules/motion-dom/dist/es/value/utils/resolve-motion-value.js +4 -6
  369. package/dist/node_modules/motion-dom/dist/es/value/will-change/add-will-change.js +10 -13
  370. package/dist/node_modules/motion-dom/dist/es/value/will-change/is.js +4 -6
  371. package/dist/node_modules/motion-utils/dist/es/array.js +6 -9
  372. package/dist/node_modules/motion-utils/dist/es/clamp.js +2 -4
  373. package/dist/node_modules/motion-utils/dist/es/easing/anticipate.js +3 -5
  374. package/dist/node_modules/motion-utils/dist/es/easing/back.js +5 -9
  375. package/dist/node_modules/motion-utils/dist/es/easing/circ.js +4 -8
  376. package/dist/node_modules/motion-utils/dist/es/easing/cubic-bezier.js +14 -17
  377. package/dist/node_modules/motion-utils/dist/es/easing/ease.js +3 -7
  378. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/mirror.js +2 -4
  379. package/dist/node_modules/motion-utils/dist/es/easing/modifiers/reverse.js +2 -4
  380. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-bezier-definition.js +2 -4
  381. package/dist/node_modules/motion-utils/dist/es/easing/utils/is-easing-array.js +2 -4
  382. package/dist/node_modules/motion-utils/dist/es/easing/utils/map.js +28 -31
  383. package/dist/node_modules/motion-utils/dist/es/errors.js +7 -13
  384. package/dist/node_modules/motion-utils/dist/es/format-error-message.js +3 -5
  385. package/dist/node_modules/motion-utils/dist/es/global-config.js +2 -4
  386. package/dist/node_modules/motion-utils/dist/es/is-numerical-string.js +2 -4
  387. package/dist/node_modules/motion-utils/dist/es/is-object.js +2 -4
  388. package/dist/node_modules/motion-utils/dist/es/is-zero-value-string.js +2 -4
  389. package/dist/node_modules/motion-utils/dist/es/memo.js +5 -7
  390. package/dist/node_modules/motion-utils/dist/es/noop.js +2 -4
  391. package/dist/node_modules/motion-utils/dist/es/pipe.js +2 -4
  392. package/dist/node_modules/motion-utils/dist/es/progress.js +4 -6
  393. package/dist/node_modules/motion-utils/dist/es/subscription-manager.js +23 -28
  394. package/dist/node_modules/motion-utils/dist/es/time-conversion.js +2 -5
  395. package/dist/node_modules/motion-utils/dist/es/velocity-per-second.js +2 -4
  396. package/dist/node_modules/motion-utils/dist/es/warn-once.js +5 -7
  397. package/dist/node_modules/prettier/plugins/babel.js +9582 -7023
  398. package/dist/node_modules/prettier/plugins/estree.js +6997 -4377
  399. package/dist/node_modules/prettier/standalone.js +3444 -2415
  400. package/dist/node_modules/react/cjs/react-compiler-runtime.development.js +21 -21
  401. package/dist/node_modules/react/cjs/react-compiler-runtime.production.js +18 -14
  402. package/dist/node_modules/react/compiler-runtime.js +8 -10
  403. package/dist/utils/arrayService.js +0 -1
  404. package/dist/utils/color.js +46 -41
  405. package/dist/utils/component.js +60 -129
  406. package/dist/utils/contextStore.js +48 -58
  407. package/dist/utils/index.d.ts +1 -0
  408. package/dist/utils/index.js +7 -18
  409. package/dist/utils/motion.d.ts +55 -0
  410. package/dist/utils/motion.js +87 -0
  411. package/dist/utils/reactiveArrayService.js +80 -76
  412. package/dist/utils/size.js +14 -26
  413. package/dist/utils/utils.js +0 -1
  414. package/dist/utils/view.js +27 -24
  415. package/dist/vite-env.d.js +0 -1
  416. package/package.json +30 -25
  417. package/dist/_virtual/compiler-runtime.js +0 -5
  418. package/dist/_virtual/compiler-runtime2.js +0 -4
  419. package/dist/_virtual/react-compiler-runtime.development.js +0 -4
  420. package/dist/_virtual/react-compiler-runtime.production.js +0 -4
  421. package/dist/assets/components/alert/Alert.style.css +0 -1
  422. package/dist/assets/components/aurora/Aurora.style.css +0 -1
  423. package/dist/assets/components/avatar/Avatar.style.css +0 -1
  424. package/dist/assets/components/badge/Badge.style.css +0 -1
  425. package/dist/assets/components/breadcrumb/Breadcrumb.style.css +0 -1
  426. package/dist/assets/components/button/Button.style.css +0 -1
  427. package/dist/assets/components/button-group/ButtonGroup.style.css +0 -1
  428. package/dist/assets/components/card/Card.style.css +0 -1
  429. package/dist/assets/components/chart/Chart.style.css +0 -1
  430. package/dist/assets/components/col/Col.style.css +0 -1
  431. package/dist/assets/components/command/Command.style.css +0 -1
  432. package/dist/assets/components/container/Container.style.css +0 -1
  433. package/dist/assets/components/context-menu/ContextMenu.style.css +0 -1
  434. package/dist/assets/components/data-table/DataTable.style.css +0 -1
  435. package/dist/assets/components/dialog/Dialog.style.css +0 -1
  436. package/dist/assets/components/editor/Editor.styles.css +0 -1
  437. package/dist/assets/components/file-tabs/FileTabs.style.css +0 -1
  438. package/dist/assets/components/form/ColorInput.style.css +0 -1
  439. package/dist/assets/components/form/DateInput.style.css +0 -1
  440. package/dist/assets/components/form/EditorInput.style.css +0 -1
  441. package/dist/assets/components/form/FileInput.style.css +0 -1
  442. package/dist/assets/components/form/Input.style.css +0 -1
  443. package/dist/assets/components/form/InputWrapper.style.css +0 -1
  444. package/dist/assets/components/form/SelectInput.style.css +0 -1
  445. package/dist/assets/components/fullscreen/FullScreen.style.css +0 -1
  446. package/dist/assets/components/gantt/Gantt.style.css +0 -1
  447. package/dist/assets/components/icon/Icon.style.css +0 -1
  448. package/dist/assets/components/json-view/JsonView.style.css +0 -1
  449. package/dist/assets/components/layout/Layout.style.css +0 -1
  450. package/dist/assets/components/menu/Menu.style.css +0 -1
  451. package/dist/assets/components/progress/Progress.style.css +0 -1
  452. package/dist/assets/components/quote/Quote.style.css +0 -1
  453. package/dist/assets/components/resizable/Resizable.style.css +0 -1
  454. package/dist/assets/components/row/Row.style.css +0 -1
  455. package/dist/assets/components/scroll-area/ScrollArea.style.css +0 -1
  456. package/dist/assets/components/segmented-control/SegmentedControl.style.css +0 -1
  457. package/dist/assets/components/tab/Tab.style.css +0 -1
  458. package/dist/assets/components/text/Text.style.css +0 -1
  459. package/dist/assets/components/toast/Toast.style.css +0 -1
  460. package/dist/assets/components/tooltip/Tooltip.style.css +0 -1
  461. package/dist/components/icon/codezero/codezero.svg.js +0 -5
  462. package/dist/components/icon/codezero/gls.svg.js +0 -5
  463. /package/dist/assets/{components/flex/Flex.style.css → Flex.style.css} +0 -0
  464. /package/dist/assets/{components/spacing/Spacing.style.css → Spacing.style.css} +0 -0
@@ -1,64 +1,54 @@
1
- import { jsxs as x, jsx as y } from "react/jsx-runtime";
2
- import c from "react";
3
- import '../../assets/components/data-table/DataTable.style.css';/* empty css */
4
- import "../../utils/contextStore.js";
5
- import { mergeComponentProps as E } from "../../utils/component.js";
6
- import "js-md5";
7
- import { Flex as F } from "../flex/Flex.js";
8
- import { DataTableHeader as R } from "./DataTableHeader.js";
9
- import { DataTablePaginationContext as v } from "./DataTablePagination.js";
10
- const C = (u, p) => p.split(".").reduce((n, m) => {
11
- if (n != null)
12
- return Array.isArray(n) ? n.map((i) => i?.[m]).filter((i) => i !== void 0) : n[m];
13
- }, u), U = (u) => {
14
- const {
15
- data: p,
16
- sort: n,
17
- filter: m,
18
- limit: i,
19
- pagination: A,
20
- loading: _,
21
- loadingComponent: z,
22
- emptyComponent: D,
23
- onSelect: N,
24
- children: g,
25
- ...k
26
- } = u, [b, P] = c.useState(0), h = Array.isArray(g) ? g : [g], w = h.find((r) => typeof r == "function"), V = h.find((r) => c.isValidElement(r) && r.type === R), S = h.filter((r) => typeof r != "function" && r !== V), O = p.filter((r) => Object.entries(m || {}).every(([o, {
27
- operator: a,
28
- value: e
29
- }]) => {
30
- const t = C(r, o);
31
- return a === "isOneOf" && !Array.isArray(e) && !Array.isArray(t) ? t === e : a === "isOneOf" && !Array.isArray(e) && Array.isArray(t) ? Array.from(t).includes(e) : a === "isOneOf" && Array.isArray(e) && !Array.isArray(t) ? Array.from(e).some((l) => l === t) : a === "isOneOf" && Array.isArray(e) && Array.isArray(t) ? Array.from(e).some((l) => Array.from(t).includes(l)) : !1;
32
- })), f = c.useMemo(() => n ? [...O].sort((r, o) => {
33
- for (const [a, e] of Object.entries(n)) {
34
- const t = C(r, a), l = C(o, a);
35
- if (t < l) return e === "asc" ? -1 : 1;
36
- if (t > l) return e === "asc" ? 1 : -1;
37
- }
38
- return 0;
39
- }) : O, [O, n]), d = typeof i == "number" ? i : 10, j = A ? Math.max(1, Math.ceil(f.length / d)) : 1, s = Math.min(b, j - 1);
40
- c.useEffect(() => {
41
- b !== s && P(s);
42
- }, [b, s]);
43
- const T = A ? f.slice(s * d, s * d + d) : typeof i == "number" ? f.slice(0, i) : f, M = /* @__PURE__ */ x("table", { ...E("data-table", k), children: [
44
- V,
45
- /* @__PURE__ */ x("tbody", { children: [
46
- T.map((r, o) => /* @__PURE__ */ y("tr", { className: "data-table__row", onClick: () => N?.(r), children: w?.(r, o) })),
47
- f.length === 0 && !_ && D ? /* @__PURE__ */ y("tr", { className: "data-table__row", onClick: () => N?.(void 0), children: D }) : null
48
- ] })
49
- ] });
50
- return A ? /* @__PURE__ */ y(v.Provider, { value: {
51
- page: s,
52
- pageCount: j,
53
- setPage: P
54
- }, children: /* @__PURE__ */ x(F, { style: {
55
- flexDirection: "column",
56
- gap: "0.5rem"
57
- }, children: [
58
- M,
59
- S.map((r, o) => /* @__PURE__ */ y(c.Fragment, { children: r }, o))
60
- ] }) }) : M;
61
- };
62
- export {
63
- U 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;
64
53
  };
54
+ export { DataTable };
@@ -1,23 +1,19 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { c } from "../../_virtual/compiler-runtime.js";
3
- import "../../utils/contextStore.js";
4
- import "react";
5
- import { mergeComponentProps as s } from "../../utils/component.js";
6
- import "js-md5";
7
- const h = (m) => {
8
- const t = c.c(6);
9
- let e, o;
10
- if (t[0] !== m) {
11
- const {
12
- children: i,
13
- ...l
14
- } = m;
15
- e = i, o = s("", l), t[0] = m, t[1] = e, t[2] = o;
16
- } else
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 { require_compiler_runtime } from "../../node_modules/react/compiler-runtime.js";
2
+ import { mergeComponentProps } from "../../utils/component.js";
3
+ import "../../utils/index.js";
4
+ import React from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ var import_compiler_runtime = require_compiler_runtime();
7
+ const DataTableColumn = (e) => {
8
+ let n = (0, import_compiler_runtime.c)(6), a, o;
9
+ if (n[0] !== e) {
10
+ let { children: r, ...i } = e;
11
+ a = r, o = mergeComponentProps("", i), n[0] = e, n[1] = a, n[2] = o;
12
+ } else a = n[1], o = n[2];
13
+ let s;
14
+ return n[3] !== a || n[4] !== o ? (s = /* @__PURE__ */ jsx("td", {
15
+ ...o,
16
+ children: a
17
+ }), n[3] = a, n[4] = o, n[5] = s) : s = n[5], s;
23
18
  };
19
+ export { DataTableColumn };
@@ -1,213 +1,216 @@
1
- import { jsx as u } from "react/jsx-runtime";
2
- import { c as Q } from "../../_virtual/compiler-runtime.js";
3
- import { Editor as z } from "../editor/Editor.js";
4
- import { StreamLanguage as U, syntaxTree as J } from "@codemirror/language";
5
- import { EditorState as K } from "@uiw/react-codemirror";
6
- import { Badge as b } from "../badge/Badge.js";
7
- import { DataTableFilterSuggestionMenu as j } from "./DataTableFilterSuggestionMenu.js";
8
- import { MenuItem as G } from "../menu/Menu.js";
9
- import "../../utils/contextStore.js";
10
- import "react";
11
- import "merge-props";
12
- import { hashToColor as X } from "../../utils/color.js";
13
- const $ = {
14
- "=": "isOneOf",
15
- "!=": "isNotOneOf"
16
- }, H = {
17
- isOneOf: "is one of",
18
- isNotOneOf: "is not one of"
19
- }, Y = {
20
- isOneOf: "=",
21
- isNotOneOf: "!="
22
- }, y = (r) => r.replace(/^\\|\\$/g, ""), Z = (r) => U.define({
23
- startState: () => ({
24
- tokens: []
25
- }),
26
- token(e, n) {
27
- if (e.eatSpace()) return null;
28
- if (e.match("!=") || e.match("=") && e.peek() !== "=")
29
- return n.tokens.push("operator"), "operator";
30
- if (e.peek() === "\\") {
31
- e.next();
32
- const k = [];
33
- for (; !e.eol() && e.peek() !== "\\"; ) k.push(e.next());
34
- if (e.peek() === "\\") {
35
- e.next();
36
- const S = k.join("");
37
- if (r.includes(S) && n.tokens[n.tokens.length - 1] !== "propertyName")
38
- return n.tokens.push("propertyName"), "propertyName";
39
- if (n.tokens[n.tokens.length - 1] !== "literal")
40
- return n.tokens.push("literal"), "literal";
41
- }
42
- return null;
43
- }
44
- return e.next(), null;
45
- }
46
- }), Ne = (r) => {
47
- const e = Q.c(17), {
48
- filterTokens: n,
49
- onChange: k
50
- } = r;
51
- let S;
52
- e[0] !== n ? (S = Z(n?.map(q) || []), e[0] = n, e[1] = S) : S = e[1];
53
- const A = S;
54
- let v;
55
- e[2] !== n ? (v = (o) => {
56
- if (!o.trim())
57
- return {};
58
- const d = {}, l = o.split(/\\/).filter(Boolean);
59
- for (let i = 0; i + 2 < l.length; i = i + 3, i) {
60
- const p = l[i], a = l[i + 1], _ = l[i + 2];
61
- if (!p || !a || !_)
62
- continue;
63
- const L = n?.find((t) => t.token === p);
64
- if (!L)
65
- continue;
66
- const h = $[a];
67
- if (!h)
68
- continue;
69
- const O = _.split(",").map(x).filter(Boolean);
70
- O.length > 0 && (d[L.key] = {
71
- operator: h,
72
- value: O
73
- });
74
- }
75
- return d;
76
- }, e[2] = n, e[3] = v) : v = e[3];
77
- const B = v;
78
- let w;
79
- e[4] !== k || e[5] !== B ? (w = (o) => {
80
- const d = B(o);
81
- k?.(d);
82
- }, e[4] = k, e[5] = B, e[6] = w) : w = e[6];
83
- const F = w;
84
- let C;
85
- e[7] !== n ? (C = (o) => {
86
- const d = J(o.state), l = d.resolveInner(o.pos, -1), i = d.resolveInner(o.pos, 1), {
87
- propertyNode: p,
88
- operatorNode: a
89
- } = (() => {
90
- const t = {
91
- propertyNode: null,
92
- operatorNode: null
93
- };
94
- for (let s = l; s; s = s.prevSibling)
95
- s.name === "propertyName" && !t.propertyNode && (t.propertyNode = s), s.name === "operator" && !t.operatorNode && (t.operatorNode = s);
96
- return t;
97
- })(), _ = p ? o.pos < p.to ? "propertyName" : o.pos === p.to ? "operator" : a ? o.pos < a.to ? "operator" : o.pos === a.to ? "literal" : l.name === "literal" ? "propertyName" : l.name === "invalid" && o.state.sliceDoc(l.from, l.to).startsWith("\\") ? "literal" : (() => {
98
- const t = o.state.sliceDoc(a.to, o.pos);
99
- return t.trim() ? t.includes(" ") ? "propertyName" : "literal" : t.length > 0 ? "propertyName" : "literal";
100
- })() : (i.name === "operator", "operator") : "propertyName", L = p ? y(o.state.sliceDoc(p.from, p.to)) : "", h = n?.find((t) => t.token === L), O = (t, s, c, g) => {
101
- g ? o.view?.dispatch({
102
- changes: {
103
- from: t,
104
- to: s,
105
- insert: c
106
- },
107
- selection: {
108
- anchor: o.pos
109
- },
110
- scrollIntoView: !1
111
- }) : (o.view?.dispatch({
112
- changes: {
113
- from: t,
114
- to: s,
115
- insert: c
116
- },
117
- selection: {
118
- anchor: t + c.length
119
- },
120
- scrollIntoView: !0
121
- }), o.view?.focus());
122
- };
123
- if (_ === "propertyName") {
124
- const t = /* @__PURE__ */ new Set(), s = o.matchBefore(/\\?[\w-]*/), c = s ? s.from : o.pos, g = p && o.pos <= p.to, N = i.name === "propertyName" ? i.to : g ? p.to : o.pos, m = g && p.from < c ? p.from : c, W = y(o.state.sliceDoc(m, o.pos)), R = n?.filter((f) => f.token.startsWith(W) && !t.has(f.token)) || [];
125
- if (d.iterate({
126
- enter: (f) => {
127
- f.name === "propertyName" && t.add(y(o.state.sliceDoc(f.from, f.to)));
128
- }
129
- }), R.length)
130
- return /* @__PURE__ */ u(j, { context: o, children: R.map((f) => /* @__PURE__ */ u(G, { onSelect: () => {
131
- let M = `\\${f.token}\\`;
132
- l.name === "literal" && o.state.sliceDoc(N, N + 1) !== "\\" && (M = "\\" + M), O(m, N, M);
133
- }, children: f.token }, f.token)) });
134
- }
135
- if (_ === "operator" && h) {
136
- const t = o.matchBefore(/[!=]+/), s = t ? t.from : o.pos, c = a && o.pos <= a.to, g = i.name === "operator" ? i.to : c ? a.to : o.pos, N = c && a.from < s ? a.from : s;
137
- return /* @__PURE__ */ u(j, { context: o, children: h.operators.map((m) => /* @__PURE__ */ u(G, { onSelect: () => O(N, g, Y[m]), children: H[m] }, m)) });
138
- }
139
- if (_ === "literal" && h?.suggestion) {
140
- const t = a ? o.state.sliceDoc(a.from, a.to) : "", s = $[t];
141
- if (s && h.operators.includes(s)) {
142
- const c = i.name === "literal" ? o.state.sliceDoc(i.from, i.to) : "";
143
- return h.suggestion(o, s, y(c), (g, N) => {
144
- const m = l.name === "literal" || l.name === "invalid" && o.state.sliceDoc(l.from, l.to).startsWith("\\"), W = m ? l.from : o.pos, R = m ? l.to : i.name === "literal" ? i.to : o.pos;
145
- O(W, R, `\\${g}\\`, N);
146
- });
147
- }
148
- }
149
- return null;
150
- }, e[7] = n, e[8] = C) : C = e[8];
151
- const V = C;
152
- let D, I;
153
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (D = {
154
- backgroundColor: "rgba(255,255,255,.1)",
155
- padding: "0.35rem",
156
- boxSizing: "border-box",
157
- borderRadius: "1rem",
158
- boxShadow: "inset 0 1px 1px 0 rgba(255,255,255,.2)"
159
- }, I = {
160
- literal: oe,
161
- operator: te,
162
- propertyName: re
163
- }, e[9] = D, e[10] = I) : (D = e[9], I = e[10]);
164
- let T, E;
165
- e[11] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (T = [K.transactionFilter.of(ne)], E = {
166
- lineNumbers: !1,
167
- foldGutter: !1,
168
- highlightActiveLine: !1,
169
- highlightActiveLineGutter: !1,
170
- dropCursor: !1,
171
- indentOnInput: !1
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 { require_compiler_runtime } from "../../node_modules/react/compiler-runtime.js";
2
+ import { hashToColor } from "../../utils/color.js";
3
+ import "../../utils/index.js";
4
+ import { Badge } from "../badge/Badge.js";
5
+ import { MenuItem } from "../menu/Menu.js";
6
+ import { Editor } from "../editor/Editor.js";
7
+ import { DataTableFilterSuggestionMenu } from "./DataTableFilterSuggestionMenu.js";
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 import_compiler_runtime = require_compiler_runtime(), 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(s, c) {
25
+ if (s.eatSpace()) return null;
26
+ if (s.match("!=") || s.match("=") && s.peek() !== "=") return c.tokens.push("operator"), "operator";
27
+ if (s.peek() === "\\") {
28
+ s.next();
29
+ let l = [];
30
+ for (; !s.eol() && s.peek() !== "\\";) l.push(s.next());
31
+ if (s.peek() === "\\") {
32
+ s.next();
33
+ let u = l.join("");
34
+ if (e.includes(u) && c.tokens[c.tokens.length - 1] !== "propertyName") return c.tokens.push("propertyName"), "propertyName";
35
+ if (c.tokens[c.tokens.length - 1] !== "literal") return c.tokens.push("literal"), "literal";
36
+ }
37
+ return null;
38
+ }
39
+ return s.next(), null;
40
+ }
41
+ }), DataTableFilterInput = (e) => {
42
+ let s = (0, import_compiler_runtime.c)(17), { filterTokens: c, onChange: f } = e, h;
43
+ s[0] === c ? h = s[1] : (h = createFilterQueryLanguage(c?.map(_temp) || []), s[0] = c, s[1] = h);
44
+ let S = h, w;
45
+ s[2] === c ? w = s[3] : (w = (e) => {
46
+ if (!e.trim()) return {};
47
+ let s = {}, l = e.split(/\\/).filter(Boolean);
48
+ for (let e = 0; e + 2 < l.length; e += 3) {
49
+ let u = l[e], d = l[e + 1], f = l[e + 2];
50
+ if (!u || !d || !f) continue;
51
+ let p = c?.find((e) => e.token === u);
52
+ if (!p) continue;
53
+ let m = OP_MAP[d];
54
+ if (!m) continue;
55
+ let h = f.split(",").map(_temp2).filter(Boolean);
56
+ h.length > 0 && (s[p.key] = {
57
+ operator: m,
58
+ value: h
59
+ });
60
+ }
61
+ return s;
62
+ }, s[2] = c, s[3] = w);
63
+ let T = w, E;
64
+ s[4] !== f || s[5] !== T ? (E = (e) => {
65
+ let s = T(e);
66
+ f?.(s);
67
+ }, s[4] = f, s[5] = T, s[6] = E) : E = s[6];
68
+ let D = E, O;
69
+ s[7] === c ? O = s[8] : (O = (e) => {
70
+ let s = syntaxTree(e.state), u = s.resolveInner(e.pos, -1), f = s.resolveInner(e.pos, 1), { propertyNode: m, operatorNode: h } = (() => {
71
+ let e = {
72
+ propertyNode: null,
73
+ operatorNode: null
74
+ };
75
+ for (let s = u; s; s = s.prevSibling) s.name === "propertyName" && !e.propertyNode && (e.propertyNode = s), s.name === "operator" && !e.operatorNode && (e.operatorNode = s);
76
+ return e;
77
+ })(), _ = m ? e.pos < m.to ? "propertyName" : e.pos === m.to ? "operator" : h ? e.pos < h.to ? "operator" : e.pos === h.to ? "literal" : u.name === "literal" ? "propertyName" : u.name === "invalid" && e.state.sliceDoc(u.from, u.to).startsWith("\\") ? "literal" : (() => {
78
+ let s = e.state.sliceDoc(h.to, e.pos);
79
+ return s.trim() ? s.includes(" ") ? "propertyName" : "literal" : s.length > 0 ? "propertyName" : "literal";
80
+ })() : (f.name, "operator") : "propertyName", x = m ? strip(e.state.sliceDoc(m.from, m.to)) : "", S = c?.find((e) => e.token === x), C = (s, c, l, u) => {
81
+ u ? e.view?.dispatch({
82
+ changes: {
83
+ from: s,
84
+ to: c,
85
+ insert: l
86
+ },
87
+ selection: { anchor: e.pos },
88
+ scrollIntoView: !1
89
+ }) : (e.view?.dispatch({
90
+ changes: {
91
+ from: s,
92
+ to: c,
93
+ insert: l
94
+ },
95
+ selection: { anchor: s + l.length },
96
+ scrollIntoView: !0
97
+ }), e.view?.focus());
98
+ };
99
+ if (_ === "propertyName") {
100
+ let h = /* @__PURE__ */ new Set(), g = e.matchBefore(/\\?[\w-]*/), _ = g ? g.from : e.pos, v = m && e.pos <= m.to, y = f.name === "propertyName" ? f.to : v ? m.to : e.pos, b = v && m.from < _ ? m.from : _, x = strip(e.state.sliceDoc(b, e.pos)), S = c?.filter((e) => e.token.startsWith(x) && !h.has(e.token)) || [];
101
+ if (s.iterate({ enter: (s) => {
102
+ s.name === "propertyName" && h.add(strip(e.state.sliceDoc(s.from, s.to)));
103
+ } }), S.length) return /* @__PURE__ */ jsx(DataTableFilterSuggestionMenu, {
104
+ context: e,
105
+ children: S.map((s) => /* @__PURE__ */ jsx(MenuItem, {
106
+ onSelect: () => {
107
+ let c = `\\${s.token}\\`;
108
+ u.name === "literal" && e.state.sliceDoc(y, y + 1) !== "\\" && (c = "\\" + c), C(b, y, c);
109
+ },
110
+ children: s.token
111
+ }, s.token))
112
+ });
113
+ }
114
+ if (_ === "operator" && S) {
115
+ let s = e.matchBefore(/[!=]+/), c = s ? s.from : e.pos, u = h && e.pos <= h.to, m = f.name === "operator" ? f.to : u ? h.to : e.pos, g = u && h.from < c ? h.from : c;
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 (_ === "literal" && S?.suggestion) {
125
+ let s = OP_MAP[h ? e.state.sliceDoc(h.from, h.to) : ""];
126
+ if (s && S.operators.includes(s)) {
127
+ let c = f.name === "literal" ? e.state.sliceDoc(f.from, f.to) : "";
128
+ return S.suggestion(e, s, strip(c), (s, c) => {
129
+ let l = u.name === "literal" || u.name === "invalid" && e.state.sliceDoc(u.from, u.to).startsWith("\\");
130
+ C(l ? u.from : e.pos, l ? u.to : f.name === "literal" ? f.to : e.pos, `\\${s}\\`, c);
131
+ });
132
+ }
133
+ }
134
+ return null;
135
+ }, s[7] = c, s[8] = O);
136
+ let k = O, A, j;
137
+ s[9] === Symbol.for("react.memo_cache_sentinel") ? (A = {
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
+ }, j = {
144
+ literal: _temp4,
145
+ operator: _temp5,
146
+ propertyName: _temp6
147
+ }, s[9] = A, s[10] = j) : (A = s[9], j = s[10]);
148
+ let M, N;
149
+ s[11] === Symbol.for("react.memo_cache_sentinel") ? (M = [EditorState.transactionFilter.of(_temp7)], N = {
150
+ lineNumbers: !1,
151
+ foldGutter: !1,
152
+ highlightActiveLine: !1,
153
+ highlightActiveLineGutter: !1,
154
+ dropCursor: !1,
155
+ indentOnInput: !1
156
+ }, s[11] = M, s[12] = N) : (M = s[11], N = s[12]);
157
+ let P;
158
+ return s[13] !== k || s[14] !== D || s[15] !== S ? (P = /* @__PURE__ */ jsx(Editor, {
159
+ w: "100%",
160
+ initialValue: "",
161
+ onChange: D,
162
+ style: A,
163
+ tokenHighlights: j,
164
+ showTooltips: !1,
165
+ showValidation: !1,
166
+ customSuggestionComponent: !0,
167
+ suggestions: k,
168
+ extensions: M,
169
+ basicSetup: N,
170
+ language: S
171
+ }), s[13] = k, s[14] = D, s[15] = S, s[16] = P) : P = s[16], P;
175
172
  };
176
- function q(r) {
177
- return r.token;
173
+ function _temp(e) {
174
+ return e.token;
178
175
  }
179
- function x(r) {
180
- return r.trim();
176
+ function _temp2(e) {
177
+ return e.trim();
181
178
  }
182
- function ee(r) {
183
- return /* @__PURE__ */ u(b, { style: {
184
- boxShadow: "none"
185
- }, color: "secondary", children: r }, r);
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 oe(r) {
188
- const {
189
- content: e
190
- } = r, n = y(e).split(",");
191
- return n.length > 1 ? /* @__PURE__ */ u(b, { p: 0.175, mx: 0.175, children: n.map(ee) }) : /* @__PURE__ */ u(b, { mx: 0.175, children: y(e) });
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 te(r) {
194
- const {
195
- content: e
196
- } = r;
197
- return /* @__PURE__ */ u(b, { color: "tertiary", style: {
198
- boxShadow: "none"
199
- }, children: H[$[e]] || e });
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 re(r) {
202
- const {
203
- content: e
204
- } = r;
205
- return /* @__PURE__ */ u(b, { mx: 0.175, color: X(y(e)), children: y(e) });
205
+ function _temp6(e) {
206
+ let { content: l } = e;
207
+ return /* @__PURE__ */ jsx(Badge, {
208
+ mx: .175,
209
+ color: hashToColor(strip(l)),
210
+ children: strip(l)
211
+ });
206
212
  }
207
- function ne(r) {
208
- return r.docChanged && r.newDoc.lines > 1 ? [] : r;
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 };