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