mtxuilib 0.1.8 → 0.1.9

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 (317) hide show
  1. package/dist/common/{DeleteComfirm.jsx → DeleteComfirm.js} +9 -22
  2. package/dist/common/FullCenter.js +6 -0
  3. package/dist/common/{GlobalSearch.jsx → GlobalSearch.js} +2 -4
  4. package/dist/common/{MtImage.jsx → MtImage.js} +2 -1
  5. package/dist/common/MtProgressBar.js +6 -0
  6. package/dist/common/NotFoundGoBack.js +10 -0
  7. package/dist/common/SlntTree/{SlntChildrenTabs.jsx → SlntChildrenTabs.js} +5 -12
  8. package/dist/common/SlntTree/{SlntTreeNode.jsx → SlntTreeNode.js} +3 -5
  9. package/dist/common/devtools/DebugValue.js +8 -0
  10. package/dist/common/devtools/{DevTools.jsx → DevTools.js} +2 -4
  11. package/dist/common/{mtlink.jsx → mtlink.js} +3 -4
  12. package/dist/common/pip/PipExamplePage.js +20 -0
  13. package/dist/common/pip/{ReactDocumentPictureInPicture.jsx → ReactDocumentPictureInPicture.js} +6 -11
  14. package/dist/common/react-markdown/Code.js +9 -0
  15. package/dist/common/react-markdown/{MarkdownToolbar.jsx → MarkdownToolbar.js} +2 -5
  16. package/dist/common/react-markdown/ReactMarkdownExample.js +19 -0
  17. package/dist/common/schema-form/SchemaFormFieldsRender.js +12 -0
  18. package/dist/common/schema-form/{SchemaFormView.jsx → SchemaFormView.js} +3 -15
  19. package/dist/common/table/SimpleTable.js +10 -0
  20. package/dist/common/table/cells/ExpenderCell.js +7 -0
  21. package/dist/common/table/cells/SelectCell.js +19 -0
  22. package/dist/common/table/cells/{Text.jsx → Text.js} +2 -4
  23. package/dist/common/table/cells/ViewLink.js +19 -0
  24. package/dist/common/table/cells/container/cellWrapper.js +5 -0
  25. package/dist/common/table/cells/number.js +10 -0
  26. package/dist/common/table/cells/{string.jsx → string.js} +2 -5
  27. package/dist/common/table/data-table-pagination.js +10 -0
  28. package/dist/common/table/data-table-view-options.js +13 -0
  29. package/dist/common/table/example/{ExampleTable.jsx → ExampleTable.js} +7 -25
  30. package/dist/common/table/header/SimpleHeader.js +16 -0
  31. package/dist/common/table/header/header.js +16 -0
  32. package/dist/common/tailwind-indicator.js +7 -0
  33. package/dist/common/theme/mode-toggle.js +10 -0
  34. package/dist/common/theme/theme-toggle.js +9 -0
  35. package/dist/common/tiptap/MenuBar.js +34 -0
  36. package/dist/common/tiptap/{TiptapEditor.jsx → TiptapEditor.js} +7 -17
  37. package/dist/common/tiptap/examples/Demo-Default.js +84 -0
  38. package/dist/common/tiptap/examples/{Demo-Tiptap.jsx → Demo-Tiptap.js} +2 -1
  39. package/dist/demos/bigcode/BigCode.js +11 -0
  40. package/dist/demos/condition-type/{serialize.jsx → serialize.js} +2 -3
  41. package/dist/demos/{demo-react-use.jsx → demo-react-use.js} +2 -3
  42. package/dist/demos/scrollarea/LongListDemo.js +7 -0
  43. package/dist/demos/scrollarea/ScrollAreaDemo.js +14 -0
  44. package/dist/demos/suspense-ssr/ExampleOg.js +7 -0
  45. package/dist/demos/suspense-ssr/ExamplePage.js +13 -0
  46. package/dist/demos/suspense-ssr/{ExampleProviderProviders.jsx → ExampleProviderProviders.js} +2 -3
  47. package/dist/demos/suspense-ssr/ReadMe.js +6 -0
  48. package/dist/demos/suspense-ssr/{examplesPostDetail.jsx → examplesPostDetail.js} +3 -11
  49. package/dist/demos/suspense-ssr/examplesPosts.js +17 -0
  50. package/dist/form/EditFormToolbar.js +43 -0
  51. package/dist/form/ZodForm.js +34 -0
  52. package/dist/form/deleteConform.js +38 -0
  53. package/dist/icons/crazy-spinner.js +5 -0
  54. package/dist/icons/font-default.js +4 -0
  55. package/dist/icons/font-mono.js +4 -0
  56. package/dist/icons/font-serif.js +4 -0
  57. package/dist/icons/github.js +4 -0
  58. package/dist/icons/icons.js +147 -0
  59. package/dist/icons/loading-circle.js +4 -0
  60. package/dist/icons/magic.js +4 -0
  61. package/dist/lib/htmlparse/components/ItemActionButton.js +17 -0
  62. package/dist/lib/htmlparse/htmlParse.js +32 -0
  63. package/dist/lib/react-query/{ReactQueryProvider.jsx → ReactQueryProvider.js} +4 -16
  64. package/dist/lib/{render.jsx → render.js} +2 -1
  65. package/dist/lib/service-worker/{ServiceWorkerMain.jsx → ServiceWorkerMain.js} +5 -11
  66. package/dist/lib/trpc-query/TrpcComponents/TrpcDehydrate.js +7 -0
  67. package/dist/misc/CustomErrorRetry.js +9 -0
  68. package/dist/misc/{ExampleErrorDemo.jsx → ExampleErrorDemo.js} +3 -6
  69. package/dist/misc/{MtErrorBoundary.jsx → MtErrorBoundary.js} +3 -12
  70. package/dist/misc/{MtErrorBoundary.stories.jsx → MtErrorBoundary.stories.js} +4 -3
  71. package/dist/misc/MtErrorBoundaryV2.js +7 -0
  72. package/dist/misc/{MtErrorBoundaryV2.stories.jsx → MtErrorBoundaryV2.stories.js} +4 -3
  73. package/dist/mtapp/{History.jsx → History.js} +2 -3
  74. package/dist/mtapp/{MtAppProvider.jsx → MtAppProvider.js} +2 -4
  75. package/dist/mtedtior/{AiButtons.jsx → AiButtons.js} +2 -4
  76. package/dist/mtedtior/{MtEditor.jsx → MtEditor.js} +20 -61
  77. package/dist/mtedtior/components/{editor-bubble-item.jsx → editor-bubble-item.js} +2 -3
  78. package/dist/mtedtior/components/{editor-bubble.jsx → editor-bubble.js} +2 -6
  79. package/dist/mtedtior/components/{editor-command-item.jsx → editor-command-item.js} +2 -3
  80. package/dist/mtedtior/components/{editor-command.jsx → editor-command.js} +5 -13
  81. package/dist/mtedtior/components/{editor.jsx → editor.js} +3 -6
  82. package/dist/mtedtior/extensions/{image-resizer.jsx → image-resizer.js} +5 -4
  83. package/dist/mtedtior/extensions/{slash-command.jsx → slash-command.js} +12 -11
  84. package/dist/mtedtior/generative/ai-completion-command.js +30 -0
  85. package/dist/mtedtior/generative/ai-selector-commands.js +42 -0
  86. package/dist/mtedtior/generative/ai-selector.js +48 -0
  87. package/dist/mtedtior/generative/{generative-menu-switch.jsx → generative-menu-switch.js} +3 -11
  88. package/dist/mtedtior/mtextesions/{DemoComponent.jsx → DemoComponent.js} +2 -4
  89. package/dist/mtedtior/selectors/color-selector.js +104 -0
  90. package/dist/mtedtior/selectors/link-selector.js +50 -0
  91. package/dist/mtedtior/selectors/{node-selector.jsx → node-selector.js} +5 -22
  92. package/dist/mtedtior/selectors/{text-buttons.jsx → text-buttons.js} +5 -10
  93. package/dist/service-worker/{ServiceWorkerMain.jsx → ServiceWorkerMain.js} +5 -11
  94. package/dist/ui/accordion.js +14 -0
  95. package/dist/ui/alert-dialog.js +27 -0
  96. package/dist/ui/{alert.jsx → alert.js} +4 -3
  97. package/dist/ui/{avatar.jsx → avatar.js} +4 -3
  98. package/dist/ui/{badge.jsx → badge.js} +2 -2
  99. package/dist/ui/breadcrumb.js +23 -0
  100. package/dist/ui/{button.jsx → button.js} +2 -1
  101. package/dist/ui/{calendar.jsx → calendar.js} +6 -6
  102. package/dist/ui/{card.jsx → card.js} +7 -6
  103. package/dist/ui/checkbox.js +9 -0
  104. package/dist/ui/command.js +29 -0
  105. package/dist/ui/context-menu.js +34 -0
  106. package/dist/ui/dialog.js +23 -0
  107. package/dist/ui/drawer.js +23 -0
  108. package/dist/ui/dropdown-menu.js +36 -0
  109. package/dist/ui/{form.jsx → form.js} +8 -13
  110. package/dist/ui/hover-card.js +10 -0
  111. package/dist/ui/input.js +8 -0
  112. package/dist/ui/{label.jsx → label.js} +2 -1
  113. package/dist/ui/menubar.js +36 -0
  114. package/dist/ui/navigation-menu.js +25 -0
  115. package/dist/ui/pagination.js +23 -0
  116. package/dist/ui/popover.js +10 -0
  117. package/dist/ui/progress.js +8 -0
  118. package/dist/ui/radio-group.js +15 -0
  119. package/dist/ui/resizable.js +9 -0
  120. package/dist/ui/scroll-area.js +12 -0
  121. package/dist/ui/select.js +22 -0
  122. package/dist/ui/separator.js +8 -0
  123. package/dist/ui/{sheet.jsx → sheet.js} +7 -15
  124. package/dist/ui/skeleton.js +6 -0
  125. package/dist/ui/slider.js +8 -0
  126. package/dist/ui/{sonner.jsx → sonner.js} +3 -2
  127. package/dist/ui/switch.js +8 -0
  128. package/dist/ui/table.js +20 -0
  129. package/dist/ui/tabs.js +13 -0
  130. package/dist/ui/textarea.js +8 -0
  131. package/dist/ui/{toast.jsx → toast.js} +7 -8
  132. package/dist/ui/toaster.js +10 -0
  133. package/dist/ui/{toggle.jsx → toggle.js} +2 -1
  134. package/dist/ui/tooltip.js +11 -0
  135. package/dist/ui-mt/Boundary.js +10 -0
  136. package/dist/ui-mt/{DropdownMenuItemLink.jsx → DropdownMenuItemLink.js} +2 -3
  137. package/dist/ui-mt/ErrorMessage.js +6 -0
  138. package/dist/ui-mt/{ExampleTree.jsx → ExampleTree.js} +2 -6
  139. package/dist/ui-mt/{MtDialog.jsx → MtDialog.js} +4 -5
  140. package/dist/ui-mt/NavTag.js +28 -0
  141. package/dist/ui-mt/ScreenPanel.js +9 -0
  142. package/dist/ui-mt/{SimpleModel.jsx → SimpleModel.js} +2 -5
  143. package/dist/ui-mt/SimpleTag.js +6 -0
  144. package/dist/ui-mt/Tree.js +63 -0
  145. package/dist/ui-mt/{WithLinkIf.jsx → WithLinkIf.js} +2 -1
  146. package/dist/ui-mt/headline.js +4 -0
  147. package/dist/ui-mt/input-field/InputField.js +21 -0
  148. package/dist/ui-mt/input-field/{RichEditorInput.jsx → RichEditorInput.js} +5 -6
  149. package/dist/ui-mt/input-field/SingleUploadForm.js +62 -0
  150. package/dist/ui-mt/input-field/TextArea.js +13 -0
  151. package/dist/ui-mt/input-field/{TextFileInput.jsx → TextFileInput.js} +5 -8
  152. package/dist/ui-mt/input-field/select/InputSelect.js +16 -0
  153. package/dist/ui-mt/inputs/SearchInput.js +10 -0
  154. package/dist/ui-mt/inputs/TaskStatusInput.js +22 -0
  155. package/dist/ui-mt/inputs/{UrlsInput.jsx → UrlsInput.js} +2 -3
  156. package/dist/ui-mt/modal/{MtModal.jsx → MtModal.js} +3 -9
  157. package/dist/ui-mt/mt-tree-view/{mt-tree-view-api.jsx → mt-tree-view-api.js} +19 -45
  158. package/dist/ui-mt/mt-tree-view/mt-treeview.js +26 -0
  159. package/dist/ui-mt/pagination.js +30 -0
  160. package/dist/ui-mt/skeleton/NewLoading.js +6 -0
  161. package/dist/ui-mt/skeleton/SkeletonInput.js +5 -0
  162. package/dist/ui-mt/skeleton/SkeletonLayout.js +6 -0
  163. package/dist/ui-mt/skeleton/SkeletonLoading.js +10 -0
  164. package/dist/ui-mt/skeleton/skeleton-card.js +5 -0
  165. package/dist/ui-mt/skeleton/skeleton2.js +4 -0
  166. package/dist/ui-mt/skeleton/skeletons.js +6 -0
  167. package/dist/ui-mt/skeleton.js +5 -0
  168. package/dist/ui-vamp/alert.js +37 -0
  169. package/dist/ui-vamp/{button.jsx → button.js} +2 -1
  170. package/dist/ui-vamp/card.js +24 -0
  171. package/dist/ui-vamp/{chip.jsx → chip.js} +2 -1
  172. package/dist/ui-vamp/dropdown.js +24 -0
  173. package/dist/ui-vamp/external-link.js +5 -0
  174. package/dist/ui-vamp/{input.jsx → input.js} +4 -13
  175. package/dist/ui-vamp/keyvalue.js +4 -0
  176. package/dist/ui-vamp/mobile-nav-button.js +9 -0
  177. package/dist/ui-vamp/modal.js +18 -0
  178. package/dist/ui-vamp/{textarea.jsx → textarea.js} +2 -4
  179. package/dist/ui-vamp/toggle-group.js +11 -0
  180. package/dist/video-player/{mt-video-player.jsx → mt-video-player.js} +2 -11
  181. package/dist/video-player/video-player2/modal-video-player.js +12 -0
  182. package/package.json +2 -2
  183. package/dist/common/FullCenter.jsx +0 -7
  184. package/dist/common/MtProgressBar.jsx +0 -5
  185. package/dist/common/NotFoundGoBack.jsx +0 -15
  186. package/dist/common/devtools/DebugValue.jsx +0 -16
  187. package/dist/common/pip/PipExamplePage.jsx +0 -42
  188. package/dist/common/react-markdown/Code.jsx +0 -12
  189. package/dist/common/react-markdown/ReactMarkdownExample.jsx +0 -27
  190. package/dist/common/schema-form/SchemaFormFieldsRender.jsx +0 -22
  191. package/dist/common/table/SimpleTable.jsx +0 -26
  192. package/dist/common/table/cells/ExpenderCell.jsx +0 -10
  193. package/dist/common/table/cells/SelectCell.jsx +0 -32
  194. package/dist/common/table/cells/ViewLink.jsx +0 -32
  195. package/dist/common/table/cells/container/cellWrapper.jsx +0 -6
  196. package/dist/common/table/cells/number.jsx +0 -11
  197. package/dist/common/table/data-table-pagination.jsx +0 -49
  198. package/dist/common/table/data-table-view-options.jsx +0 -26
  199. package/dist/common/table/header/SimpleHeader.jsx +0 -39
  200. package/dist/common/table/header/header.jsx +0 -15
  201. package/dist/common/tailwind-indicator.jsx +0 -13
  202. package/dist/common/theme/mode-toggle.jsx +0 -28
  203. package/dist/common/theme/theme-toggle.jsx +0 -12
  204. package/dist/common/tiptap/MenuBar.jsx +0 -100
  205. package/dist/common/tiptap/examples/Demo-Default.jsx +0 -152
  206. package/dist/demos/bigcode/BigCode.jsx +0 -16
  207. package/dist/demos/scrollarea/LongListDemo.jsx +0 -8
  208. package/dist/demos/scrollarea/ScrollAreaDemo.jsx +0 -43
  209. package/dist/demos/suspense-ssr/ExampleOg.jsx +0 -19
  210. package/dist/demos/suspense-ssr/ExamplePage.jsx +0 -55
  211. package/dist/demos/suspense-ssr/ReadMe.jsx +0 -44
  212. package/dist/demos/suspense-ssr/examplesPosts.jsx +0 -24
  213. package/dist/form/EditFormToolbar.jsx +0 -67
  214. package/dist/form/ZodForm.jsx +0 -35
  215. package/dist/form/deleteConform.jsx +0 -65
  216. package/dist/icons/crazy-spinner.jsx +0 -8
  217. package/dist/icons/font-default.jsx +0 -6
  218. package/dist/icons/font-mono.jsx +0 -6
  219. package/dist/icons/font-serif.jsx +0 -6
  220. package/dist/icons/github.jsx +0 -5
  221. package/dist/icons/icons.jsx +0 -188
  222. package/dist/icons/loading-circle.jsx +0 -6
  223. package/dist/icons/magic.jsx +0 -7
  224. package/dist/lib/htmlparse/components/ItemActionButton.jsx +0 -58
  225. package/dist/lib/htmlparse/htmlParse.jsx +0 -50
  226. package/dist/lib/trpc-query/TrpcComponents/TrpcDehydrate.jsx +0 -11
  227. package/dist/misc/CustomErrorRetry.jsx +0 -13
  228. package/dist/misc/MtErrorBoundaryV2.jsx +0 -13
  229. package/dist/mtedtior/generative/ai-completion-command.jsx +0 -48
  230. package/dist/mtedtior/generative/ai-selector-commands.jsx +0 -55
  231. package/dist/mtedtior/generative/ai-selector.jsx +0 -72
  232. package/dist/mtedtior/selectors/color-selector.jsx +0 -138
  233. package/dist/mtedtior/selectors/link-selector.jsx +0 -68
  234. package/dist/ui/accordion.jsx +0 -20
  235. package/dist/ui/alert-dialog.jsx +0 -29
  236. package/dist/ui/breadcrumb.jsx +0 -27
  237. package/dist/ui/checkbox.jsx +0 -12
  238. package/dist/ui/command.jsx +0 -37
  239. package/dist/ui/context-menu.jsx +0 -52
  240. package/dist/ui/dialog.jsx +0 -31
  241. package/dist/ui/drawer.jsx +0 -28
  242. package/dist/ui/dropdown-menu.jsx +0 -54
  243. package/dist/ui/hover-card.jsx +0 -9
  244. package/dist/ui/input.jsx +0 -7
  245. package/dist/ui/menubar.jsx +0 -54
  246. package/dist/ui/navigation-menu.jsx +0 -34
  247. package/dist/ui/pagination.jsx +0 -31
  248. package/dist/ui/popover.jsx +0 -11
  249. package/dist/ui/progress.jsx +0 -9
  250. package/dist/ui/radio-group.jsx +0 -18
  251. package/dist/ui/resizable.jsx +0 -12
  252. package/dist/ui/scroll-area.jsx +0 -19
  253. package/dist/ui/select.jsx +0 -39
  254. package/dist/ui/separator.jsx +0 -7
  255. package/dist/ui/skeleton.jsx +0 -5
  256. package/dist/ui/slider.jsx +0 -12
  257. package/dist/ui/switch.jsx +0 -9
  258. package/dist/ui/table.jsx +0 -21
  259. package/dist/ui/tabs.jsx +0 -12
  260. package/dist/ui/textarea.jsx +0 -7
  261. package/dist/ui/toaster.jsx +0 -19
  262. package/dist/ui/tooltip.jsx +0 -10
  263. package/dist/ui-mt/Boundary.jsx +0 -16
  264. package/dist/ui-mt/ErrorMessage.jsx +0 -7
  265. package/dist/ui-mt/NavTag.jsx +0 -35
  266. package/dist/ui-mt/ScreenPanel.jsx +0 -10
  267. package/dist/ui-mt/SimpleTag.jsx +0 -7
  268. package/dist/ui-mt/Tree.jsx +0 -98
  269. package/dist/ui-mt/headline.jsx +0 -8
  270. package/dist/ui-mt/input-field/InputField.jsx +0 -40
  271. package/dist/ui-mt/input-field/SingleUploadForm.jsx +0 -83
  272. package/dist/ui-mt/input-field/TextArea.jsx +0 -20
  273. package/dist/ui-mt/input-field/select/InputSelect.jsx +0 -44
  274. package/dist/ui-mt/inputs/SearchInput.jsx +0 -12
  275. package/dist/ui-mt/inputs/TaskStatusInput.jsx +0 -38
  276. package/dist/ui-mt/mt-tree-view/mt-treeview.jsx +0 -40
  277. package/dist/ui-mt/pagination.jsx +0 -49
  278. package/dist/ui-mt/skeleton/NewLoading.jsx +0 -31
  279. package/dist/ui-mt/skeleton/SkeletonInput.jsx +0 -6
  280. package/dist/ui-mt/skeleton/SkeletonLayout.jsx +0 -8
  281. package/dist/ui-mt/skeleton/SkeletonLoading.jsx +0 -14
  282. package/dist/ui-mt/skeleton/skeleton-card.jsx +0 -10
  283. package/dist/ui-mt/skeleton/skeleton2.jsx +0 -8
  284. package/dist/ui-mt/skeleton/skeletons.jsx +0 -12
  285. package/dist/ui-mt/skeleton.jsx +0 -4
  286. package/dist/ui-vamp/alert.jsx +0 -45
  287. package/dist/ui-vamp/card.jsx +0 -32
  288. package/dist/ui-vamp/dropdown.jsx +0 -25
  289. package/dist/ui-vamp/external-link.jsx +0 -6
  290. package/dist/ui-vamp/keyvalue.jsx +0 -6
  291. package/dist/ui-vamp/mobile-nav-button.jsx +0 -13
  292. package/dist/ui-vamp/modal.jsx +0 -22
  293. package/dist/ui-vamp/toggle-group.jsx +0 -10
  294. package/dist/video-player/video-player2/modal-video-player.jsx +0 -43
  295. /package/dist/common/SlntTree/{Slnt.z.jsx → Slnt.z.js} +0 -0
  296. /package/dist/common/{TrpcQuery.jsx → TrpcQuery.js} +0 -0
  297. /package/dist/common/table/{datatable-view-options.jsx → datatable-view-options.js} +0 -0
  298. /package/dist/demos/{lib.jsx → lib.js} +0 -0
  299. /package/dist/hooks/{use-media-query.jsx → use-media-query.js} +0 -0
  300. /package/dist/hooks/{useIsIntersecting.jsx → useIsIntersecting.js} +0 -0
  301. /package/dist/icons/{Cross2Icon.jsx → Cross2Icon.js} +0 -0
  302. /package/dist/icons/{DotsHorizontalIcon.jsx → DotsHorizontalIcon.js} +0 -0
  303. /package/dist/icons/{MixerHorizontal.jsx → MixerHorizontal.js} +0 -0
  304. /package/dist/icons/{index.jsx → index.js} +0 -0
  305. /package/dist/mtedtior/extensions/{drag-and-drop.jsx → drag-and-drop.js} +0 -0
  306. /package/dist/mtedtior/plugins/{upload-images.jsx → upload-images.js} +0 -0
  307. /package/dist/mtedtior/{utils.jsx → utils.js} +0 -0
  308. /package/dist/ui/{aspect-ratio.jsx → aspect-ratio.js} +0 -0
  309. /package/dist/ui/{collapsible.jsx → collapsible.js} +0 -0
  310. /package/dist/ui-mt/{Button.jsx → Button.js} +0 -0
  311. /package/dist/ui-mt/{MtForm.jsx → MtForm.js} +0 -0
  312. /package/dist/ui-mt/{Separator.jsx → Separator.js} +0 -0
  313. /package/dist/ui-mt/{Slot.jsx → Slot.js} +0 -0
  314. /package/dist/ui-mt/inputs/{input.jsx → input.js} +0 -0
  315. /package/dist/ui-mt/mt-tree-view/{MtTreeViewExample.jsx → MtTreeViewExample.js} +0 -0
  316. /package/dist/ui-mt/skeleton/{SkeletonDashboardShell.jsx → SkeletonDashboardShell.js} +0 -0
  317. /package/dist/ui-mt/{types.jsx → types.js} +0 -0
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { createContext, useCallback, useContext, useMemo } from "react";
3
4
  import { createStore, useStore } from "zustand";
4
5
  import { immer } from "zustand/middleware/immer";
@@ -18,10 +19,7 @@ const formContext = createContext(null);
18
19
  export const DeleteConfirmProvider = (props) => {
19
20
  const { children, ...etc } = props;
20
21
  const mystore = useMemo(() => createDeleteConformStore(etc), [etc]);
21
- return (<formContext.Provider value={mystore}>
22
- {children}
23
- <DeleteConfirmDlg />
24
- </formContext.Provider>);
22
+ return (_jsxs(formContext.Provider, { value: mystore, children: [children, _jsx(DeleteConfirmDlg, {})] }));
25
23
  };
26
24
  function useDeleteConfirmStore(selector) {
27
25
  const store = useContext(formContext);
@@ -44,22 +42,11 @@ export const DeleteConfirmDlg = () => {
44
42
  const open = useDeleteConfirmStore((x) => x.open);
45
43
  const setOpen = useDeleteConfirmStore((x) => x.setOpen);
46
44
  const confirmCallback = useDeleteConfirmStore((x) => x.confirmCallback);
47
- return (<Dialog open={open} onOpenChange={setOpen}>
48
- <DialogContent>
49
- <DialogTitle>delete confirm</DialogTitle>
50
- <DialogDescription>will delete item, continue?</DialogDescription>
51
- <MtButton variant={"destructive"} onClick={async () => {
52
- setOpen(false);
53
- confirmCallback && confirmCallback();
54
- }}>
55
- Continue
56
- </MtButton>
57
- <MtButton variant={"outline"} onClick={() => {
58
- setOpen(false);
59
- confirmCallback && confirmCallback();
60
- }}>
61
- Cancel
62
- </MtButton>
63
- </DialogContent>
64
- </Dialog>);
45
+ return (_jsx(Dialog, { open: open, onOpenChange: setOpen, children: _jsxs(DialogContent, { children: [_jsx(DialogTitle, { children: "delete confirm" }), _jsx(DialogDescription, { children: "will delete item, continue?" }), _jsx(MtButton, { variant: "destructive", onClick: async () => {
46
+ setOpen(false);
47
+ confirmCallback && confirmCallback();
48
+ }, children: "Continue" }), _jsx(MtButton, { variant: "outline", onClick: () => {
49
+ setOpen(false);
50
+ confirmCallback && confirmCallback();
51
+ }, children: "Cancel" })] }) }));
65
52
  };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export const FullCenter = (props) => {
4
+ const { children } = props;
5
+ return (_jsx("div", { className: "flex h-full w-full items-center justify-center", children: _jsx("div", { className: "flex-1", children: children }) }));
6
+ };
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { createContext, useContext, useMemo } from "react";
3
4
  import { createStore, useStore } from "zustand";
4
5
  export const createFormSlice = (set, get) => ({
@@ -14,10 +15,7 @@ const formContext = createContext(null);
14
15
  export const GlobalSearchProvider = (props) => {
15
16
  const { children, ...etc } = props;
16
17
  const mystore = useMemo(() => createDeleteConformStore(etc), [etc]);
17
- return (<formContext.Provider value={mystore}>
18
- {children}
19
-
20
- </formContext.Provider>);
18
+ return (_jsx(formContext.Provider, { value: mystore, children: children }));
21
19
  };
22
20
  export function useGlobalSearch(selector) {
23
21
  const store = useContext(formContext);
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { isCloudflarePage } from 'mtxlib/utils';
2
3
  import Image from 'next/image';
3
4
  const normalizeSrc = (src) => {
@@ -23,5 +24,5 @@ function getImageLoader() {
23
24
  }
24
25
  }
25
26
  export const MtImage = (props) => {
26
- return <Image {...props} loader={getImageLoader()}/>;
27
+ return _jsx(Image, { ...props, loader: getImageLoader() });
27
28
  };
@@ -0,0 +1,6 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { AppProgressBar } from "next-nprogress-bar";
4
+ export const MtProgressBar = () => {
5
+ return _jsx(AppProgressBar, { height: "4px", color: "#4934eb", options: { showSpinner: false }, shallowRouting: true });
6
+ };
@@ -0,0 +1,10 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useRouter } from "next/navigation";
4
+ import { Button } from "../ui/button";
5
+ export const NotFoundGoBack = () => {
6
+ const router = useRouter();
7
+ return (_jsxs("div", { className: "container flex flex-col", children: [_jsx("div", { className: "mx-auto p-8", children: "not found" }), _jsx(Button, { className: "mx-auto p-8", onClick: () => {
8
+ router.back();
9
+ }, children: "Go back" })] }));
10
+ };
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { urlJoinPaths } from "mtxlib/http/url";
3
4
  import { usePathname, useSelectedLayoutSegment, useSelectedLayoutSegments, } from "next/navigation";
4
5
  import { cn } from "../../lib/utils";
@@ -11,23 +12,15 @@ export const SlntChildrenTabs = () => {
11
12
  const segment = useSelectedLayoutSegment();
12
13
  const basePath = pathName.slice(0, -segments.join("/").length);
13
14
  const basePath3 = "/" + segments.join("/");
14
- return (<div className="flex gap-1 ">
15
-
16
- {parentData?.children?.map((item, i) => {
15
+ return (_jsx("div", { className: "flex gap-1 ", children: parentData?.children?.map((item, i) => {
17
16
  let href = `${urlJoinPaths(basePath, item.routeName || "")}`;
18
17
  if (!segments?.length) {
19
18
  href = urlJoinPaths(pathName, item.routeName || "");
20
19
  }
21
- return (<TabItem key={i} activate={segment == item.routeName}>
22
- <MtLink key={i} variant={"ghost"} href={href}>
23
- {item.label}
24
- </MtLink>
25
-
26
- </TabItem>);
27
- })}
28
- </div>);
20
+ return (_jsx(TabItem, { activate: segment == item.routeName, children: _jsx(MtLink, { variant: "ghost", href: href, children: item.label }, i) }, i));
21
+ }) }));
29
22
  };
30
23
  const TabItem = (props) => {
31
24
  const { activate, ...etc } = props;
32
- return (<div data-state={activate && "active"} className={cn("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow")} {...etc}/>);
25
+ return (_jsx("div", { "data-state": activate && "active", className: cn("ring-offset-background focus-visible:ring-ring data-[state=active]:bg-background data-[state=active]:text-foreground inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow"), ...etc }));
33
26
  };
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { useSelectedLayoutSegment, useSelectedLayoutSegments, } from "next/navigation";
3
4
  import { createContext, useContext, useMemo } from "react";
4
5
  import { useStore } from "zustand";
@@ -14,7 +15,7 @@ export const slntContext = createContext(null);
14
15
  export const MenuTreeProvider = (props) => {
15
16
  const { children, ...etc } = props;
16
17
  const mystore = useMemo(() => createModalStore(etc), [etc]);
17
- return (<slntContext.Provider value={mystore}>{children}</slntContext.Provider>);
18
+ return (_jsx(slntContext.Provider, { value: mystore, children: children }));
18
19
  };
19
20
  export const DEFAULT_USE_SHALLOW = true;
20
21
  export function useMenuTreeStore(selector) {
@@ -40,8 +41,5 @@ export const SlntTreeNode = (props) => {
40
41
  console.log({ message: `(SlntTreeNode)${segment}`, fined, parent });
41
42
  return fined;
42
43
  }, [parent, segment]);
43
- return (<MenuTreeProvider menuNode={currNode}>
44
-
45
- {children}
46
- </MenuTreeProvider>);
44
+ return (_jsx(MenuTreeProvider, { menuNode: currNode, children: children }));
47
45
  };
@@ -0,0 +1,8 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { MtButton } from "../../ui-mt/Button";
4
+ import { Dialog, DialogContent, DialogTrigger } from "../../ui/dialog";
5
+ export const DebugValue = (props) => {
6
+ const { title, data, className } = props;
7
+ return (_jsxs(Dialog, { children: [_jsx(DialogTrigger, { asChild: true, children: _jsx(MtButton, { variant: "outline", className: className, children: title || "debug" }) }), _jsx(DialogContent, { className: "max-h-lvh w-full overflow-scroll bg-red-100", children: _jsx("pre", { className: " text-xs", children: JSON.stringify(data, null, 2) }) })] }));
8
+ };
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import dynamic from "next/dynamic";
3
4
  import { useHotkeys } from "react-hotkeys-hook";
4
5
  import { useMtapp } from "../../mtapp/MtAppProvider";
@@ -19,8 +20,5 @@ export const DevTools = () => {
19
20
  if (!debug) {
20
21
  return null;
21
22
  }
22
- return (<>
23
- <ReactQueryDevtoolsProduction buttonPosition="bottom-right"/>
24
- <TailwindIndicator />
25
- </>);
23
+ return (_jsxs(_Fragment, { children: [_jsx(ReactQueryDevtoolsProduction, { buttonPosition: "bottom-right" }), _jsx(TailwindIndicator, {})] }));
26
24
  };
@@ -1,4 +1,5 @@
1
1
  'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { Slot } from "@radix-ui/react-slot";
3
4
  import Link from "next/link";
4
5
  import React from "react";
@@ -6,11 +7,9 @@ import { cn } from "../lib/utils";
6
7
  import { buttonVariants } from "../ui/button";
7
8
  export const MtLink = React.forwardRef(({ className, variant, size, asChild = false, ...props }, ref) => {
8
9
  const Comp = asChild ? Slot : Link;
9
- return (<Comp className={cn(((variant) && buttonVariants({ variant: variant, className })))} ref={ref} {...props}/>);
10
+ return (_jsx(Comp, { className: cn(((variant) && buttonVariants({ variant: variant, className }))), ref: ref, ...props }));
10
11
  });
11
12
  MtLink.displayName = "MtLink";
12
13
  export function MtExternalLink({ children, className, ...props }) {
13
- return (<a className={cn(className, "hover:text-brandtext-500 hover:underline hover:brightness-150")} rel="noopener noreferrer" {...props}>
14
- {children}
15
- </a>);
14
+ return (_jsx("a", { className: cn(className, "hover:text-brandtext-500 hover:underline hover:brightness-150"), rel: "noopener noreferrer", ...props, children: children }));
16
15
  }
@@ -0,0 +1,20 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import ReactDocumentPictureInPicture from "mtxuilib/common/pip/ReactDocumentPictureInPicture";
4
+ import { MtButton } from "mtxuilib/ui-mt/Button";
5
+ import { useRef, useState } from "react";
6
+ export default function PipExamplePage() {
7
+ const pipWindowRef = useRef(null);
8
+ return (_jsx(_Fragment, { children: _jsx(ReactDocumentPictureInPicture, { ref: pipWindowRef, width: "50%", height: "100%", buttonRenderer: ({ open, close, toggle, isOpen }) => (_jsxs("div", { className: "flex gap-2", children: [_jsxs("b", { children: ["Is ", isOpen ? "Open" : "Closed", " "] }), _jsx(MtButton, { onClick: open, children: "Open" }), _jsx(MtButton, { onClick: close, children: "Close" }), _jsx(MtButton, { onClick: toggle, children: "Toggle" })] })), children: _jsx(Comp, { pipWindowRef: pipWindowRef }) }) }));
9
+ }
10
+ const Comp = (props) => {
11
+ const { pipWindowRef } = props;
12
+ const [text, setText] = useState("tet1");
13
+ return (_jsxs("div", { className: "prose", children: [_jsx("h1", { children: "\u753B\u4E2D\u753B\u663E\u793A\uFF08\u8303\u4F8B\uFF09" }), _jsxs("div", { children: [_jsx("button", { onClick: () => {
14
+ console.log("关闭");
15
+ setText("ssssssssssssssss");
16
+ }, children: "sssss" }), _jsxs(MtButton, { onClick: () => {
17
+ console.log("关闭");
18
+ setText("ssssssssssssssss");
19
+ }, children: ["\u5173\u95ED333 ", text] })] }), _jsx("i", { children: "This text should be displayed in a Document Picture in Picture filling the maximum allow height and 50% of the width of the original window" })] }));
20
+ };
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState } from "react";
3
4
  export var FeatureUnavailableReasonEnum;
4
5
  (function (FeatureUnavailableReasonEnum) {
@@ -106,17 +107,11 @@ const ReactDocumentPictureInPicture = forwardRef((props, ref) => {
106
107
  return featureUnavailableRenderer;
107
108
  }
108
109
  const buttonRenderer = typeof props.buttonRenderer === "function" ? props.buttonRenderer({ open, close, toggle, isOpen }) : props.buttonRenderer;
109
- return (<div>
110
- {buttonRenderer}
111
-
112
- <div ref={contentRef} style={{
113
- display: isOpen ? 'block' : 'none',
114
- width: '100%',
115
- height: '100%',
116
- }}>
117
- {props.children}
118
- </div>
119
- </div>);
110
+ return (_jsxs("div", { children: [buttonRenderer, _jsx("div", { ref: contentRef, style: {
111
+ display: isOpen ? 'block' : 'none',
112
+ width: '100%',
113
+ height: '100%',
114
+ }, children: props.children })] }));
120
115
  });
121
116
  ReactDocumentPictureInPicture.displayName = "ReactDocumentPictureInPicture";
122
117
  export default ReactDocumentPictureInPicture;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
3
+ import { materialOceanic } from 'react-syntax-highlighter/dist/cjs/styles/prism';
4
+ export const CodeBlock = ({ ...props }) => {
5
+ return (_jsx(SyntaxHighlighter, { language: props.className?.replace(/(?:lang(?:uage)?-)/, ''), style: materialOceanic, wrapLines: true, className: 'not-prose rounded-md', children: props.children }));
6
+ };
7
+ export const Pre = ({ ...props }) => {
8
+ return (_jsx("div", { className: 'not-prose', children: props.children }));
9
+ };
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { Button } from "../../ui/button";
2
3
  const MarkdownToolbar = ({ feedElement }) => {
3
4
  const btns = [
@@ -6,10 +7,6 @@ const MarkdownToolbar = ({ feedElement }) => {
6
7
  { name: 'S', syntax: '~Strikethrough~' },
7
8
  { name: 'H1', syntax: '# ' },
8
9
  ];
9
- return (<header className=" flex gap-1 bg-[#253237]">
10
- {btns.map(btn => (<Button key={btn.syntax} className="flex rounded-md" onClick={() => feedElement(btn.syntax)}>
11
- {btn.name}
12
- </Button>))}
13
- </header>);
10
+ return (_jsx("header", { className: " flex gap-1 bg-[#253237]", children: btns.map(btn => (_jsx(Button, { className: "flex rounded-md", onClick: () => feedElement(btn.syntax), children: btn.name }, btn.syntax))) }));
14
11
  };
15
12
  export default MarkdownToolbar;
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import Markdown from 'react-markdown';
4
+ import rehypeExternalLinks from 'rehype-external-links';
5
+ import rehypeSanitize from 'rehype-sanitize';
6
+ import remarkGfm from 'remark-gfm';
7
+ import { CodeBlock, Pre } from "./Code";
8
+ export const ReactMarkdownExample = () => {
9
+ const options = {
10
+ code: CodeBlock,
11
+ pre: Pre,
12
+ };
13
+ return (_jsx("div", { className: 'bg-slate-500', children: _jsx("div", { className: 'flex h-screen justify-between', children: _jsx("article", { className: 'w-full pl-6 pt-5', children: _jsx(Markdown, { className: 'prose prose-invert min-w-full', remarkPlugins: [remarkGfm], rehypePlugins: [
14
+ rehypeSanitize,
15
+ [rehypeExternalLinks,
16
+ { content: { type: 'text', value: '🔗' } }
17
+ ],
18
+ ], components: options }) }) }) }));
19
+ };
@@ -0,0 +1,12 @@
1
+ "use client";
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage } from "mtxuilib/ui/form";
4
+ import { Input } from "mtxuilib/ui/input";
5
+ import { useFormContext } from "react-hook-form";
6
+ export const SchemaFormFieldsRender = (props) => {
7
+ const { schema } = props;
8
+ const form = useFormContext();
9
+ return (_jsx(_Fragment, { children: schema.fields?.map((formField, i) => {
10
+ return (_jsx(FormField, { control: form.control, name: formField.name, defaultValue: formField.defaultValue || "", render: ({ field }) => (_jsxs(FormItem, { children: [formField.label && _jsx(FormLabel, { children: formField.label }), _jsx(FormControl, { children: _jsx(_Fragment, { children: _jsx(Input, { placeholder: formField.placeholder, ...field }) }) }), formField.description && _jsx(FormDescription, { children: formField.description }), _jsx(FormMessage, {})] })) }, i));
11
+ }) }));
12
+ };
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import { useState } from "react";
3
4
  import { FormProvider, useForm } from "react-hook-form";
4
5
  import { EditFormToolbar } from "mtxuilib/form/EditFormToolbar";
@@ -12,20 +13,7 @@ export const SchemaFormView = (props) => {
12
13
  defaultValues: defaultValues,
13
14
  });
14
15
  if (!formSchema) {
15
- return <div className="border p-8">missing formSchema params</div>;
16
+ return _jsx("div", { className: "border p-8", children: "missing formSchema params" });
16
17
  }
17
- return (<>
18
- <FormProvider {...form}>
19
- <Card className="p-2">
20
- <CardContent>
21
- <form onSubmit={form.handleSubmit(onSubmit)}>
22
- <SchemaFormFieldsRender schema={formSchema}/>
23
- <DialogFooter>
24
- <EditFormToolbar onCancel={() => onCancel && onCancel()}/>
25
- </DialogFooter>
26
- </form>
27
- </CardContent>
28
- </Card>
29
- </FormProvider>
30
- </>);
18
+ return (_jsx(_Fragment, { children: _jsx(FormProvider, { ...form, children: _jsx(Card, { className: "p-2", children: _jsx(CardContent, { children: _jsxs("form", { onSubmit: form.handleSubmit(onSubmit), children: [_jsx(SchemaFormFieldsRender, { schema: formSchema }), _jsx(DialogFooter, { children: _jsx(EditFormToolbar, { onCancel: () => onCancel && onCancel() }) })] }) }) }) }) }));
31
19
  };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { flexRender } from "@tanstack/react-table";
4
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../ui/table";
5
+ export function SimpleTable(props) {
6
+ const { table } = props;
7
+ return (_jsx("div", { className: "rounded-md border", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { children: headerGroup.headers.map((header) => {
8
+ return (_jsx(TableHead, { children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }, header.id));
9
+ }) }, headerGroup.id))) }), _jsx(TableBody, { children: table.getRowModel().rows?.length ? (table.getRowModel().rows.map((row) => (_jsx(TableRow, { "data-state": row.getIsSelected() && "selected", children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) : (_jsx(TableRow, {})) })] }) }));
10
+ }
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { ChevronRight } from 'lucide-react';
4
+ import { cn } from "../../../lib/utils";
5
+ export const ExpenderCell = (info) => {
6
+ return info.row.getCanExpand() ? (_jsx("button", { className: "pointer", onClick: info.row.getToggleExpandedHandler(), children: _jsx(ChevronRight, { className: cn(info.row.getIsExpanded() && "rotate-90") }) })) : ('🔵');
7
+ };
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "../../../ui/select";
5
+ export const SelectCell = (info) => {
6
+ const [value, setValue] = React.useState(info.cell.getValue());
7
+ const onBlur = () => {
8
+ const numValue = parseInt(value);
9
+ };
10
+ return _jsx("div", { className: "flex w-full", children: _jsx("input", { type: "number", value: value, onChange: e => setValue(e.target.value), onBlur: onBlur, className: "grow" }) });
11
+ };
12
+ export const NewSelectCell = ({ placeholder, items }) => {
13
+ const component = (_info) => {
14
+ return _jsx(_Fragment, { children: _jsxs(Select, { children: [_jsx(SelectTrigger, { className: "w-[180px]", children: _jsx(SelectValue, { placeholder: placeholder || "--" }) }), _jsx(SelectContent, { children: _jsx(SelectGroup, { children: items?.map((item, i) => {
15
+ return _jsx(SelectItem, { value: item.value, children: item.label }, i);
16
+ }) }) })] }) });
17
+ };
18
+ return component;
19
+ };
@@ -1,4 +1,5 @@
1
1
  'use client';
2
+ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
2
3
  import React from "react";
3
4
  export const NewTextCell = ({ enableEdit, placeholder, popup }) => (info) => {
4
5
  const initialValue = info.cell.getValue();
@@ -8,8 +9,5 @@ export const NewTextCell = ({ enableEdit, placeholder, popup }) => (info) => {
8
9
  }, [initialValue]);
9
10
  const onBlur = () => {
10
11
  };
11
- return <>
12
-
13
- {value}
14
- </>;
12
+ return _jsx(_Fragment, { children: value });
15
13
  };
@@ -0,0 +1,19 @@
1
+ 'use client';
2
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import Link from "next/link";
4
+ import React from "react";
5
+ import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from "../../../ui/select";
6
+ export const ViewLinkCell = (info) => {
7
+ const [value, setValue] = React.useState(info.cell.getValue());
8
+ const onBlur = () => {
9
+ const numValue = parseInt(value);
10
+ };
11
+ return _jsx(_Fragment, { children: _jsx(Link, { href: "#", children: "res link" }) });
12
+ };
13
+ export const NewSelectCell = ({ placeholder, items }) => {
14
+ return (info) => {
15
+ return _jsx(_Fragment, { children: _jsxs(Select, { children: [_jsx(SelectTrigger, { className: "w-[180px]", children: _jsx(SelectValue, { placeholder: placeholder || "--" }) }), _jsx(SelectContent, { children: _jsx(SelectGroup, { children: items?.map((item, i) => {
16
+ return _jsx(SelectItem, { value: item.value, children: item.label }, i);
17
+ }) }) })] }) });
18
+ };
19
+ };
@@ -0,0 +1,5 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export const CellWrapper = ({ children }) => {
4
+ return (_jsx("div", { children: children }));
5
+ };
@@ -0,0 +1,10 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import React from "react";
4
+ export const NumberCell = (info) => {
5
+ const [value, setValue] = React.useState(info.cell.getValue());
6
+ const onBlur = () => {
7
+ const numValue = parseInt(value);
8
+ };
9
+ return _jsx("div", { className: "flex w-full", children: _jsx("input", { type: "number", value: value, onChange: e => setValue(e.target.value), onBlur: onBlur, className: "grow" }) });
10
+ };
@@ -1,4 +1,5 @@
1
1
  'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import React from "react";
3
4
  import { CellWrapper } from "./container/cellWrapper";
4
5
  export const StringCell = (info) => {
@@ -10,9 +11,5 @@ export const StringCell = (info) => {
10
11
  React.useEffect(() => {
11
12
  setValue(initialValue);
12
13
  }, [initialValue]);
13
- return <CellWrapper>
14
- {value}
15
-
16
-
17
- </CellWrapper>;
14
+ return _jsx(CellWrapper, { children: value });
18
15
  };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
3
+ import { ChevronLeftIcon, ChevronRightIcon, DoubleArrowLeftIcon, DoubleArrowRightIcon } from "@radix-ui/react-icons";
4
+ import { MtButton } from "../../ui-mt/Button";
5
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../ui/select";
6
+ export function DataTablePagination({ table }) {
7
+ return (_jsxs("div", { className: "flex items-center justify-between px-2", children: [_jsxs("div", { className: "text-muted-foreground flex-1 text-sm", children: [table.getFilteredSelectedRowModel().rows.length, " of ", table.getFilteredRowModel().rows.length, " row(s) selected."] }), _jsxs("div", { className: "flex items-center space-x-6 lg:space-x-8", children: [_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("p", { className: "text-sm font-medium", children: "Rows per page" }), _jsxs(Select, { value: `${table.getState().pagination.pageSize}`, onValueChange: (value) => {
8
+ table.setPageSize(Number(value));
9
+ }, children: [_jsx(SelectTrigger, { className: "h-8 w-[70px]", children: _jsx(SelectValue, { placeholder: table.getState().pagination.pageSize }) }), _jsx(SelectContent, { side: "top", children: [10, 20, 30, 40, 50].map((pageSize) => (_jsx(SelectItem, { value: `${pageSize}`, children: pageSize }, pageSize))) })] })] }), _jsxs("div", { className: "flex w-[100px] items-center justify-center text-sm font-medium", children: ["Page ", table.getState().pagination.pageIndex + 1, " of ", table.getPageCount()] }), _jsxs("div", { className: "flex items-center space-x-2", children: [_jsxs(MtButton, { variant: "outline", className: "hidden h-8 w-8 p-0 lg:flex", onClick: () => table.setPageIndex(0), disabled: !table.getCanPreviousPage(), children: [_jsx("span", { className: "sr-only", children: "Go to first page" }), _jsx(DoubleArrowLeftIcon, { className: "h-4 w-4" })] }), _jsxs(MtButton, { variant: "outline", className: "h-8 w-8 p-0", onClick: () => table.previousPage(), disabled: !table.getCanPreviousPage(), children: [_jsx("span", { className: "sr-only", children: "Go to previous page" }), _jsx(ChevronLeftIcon, { className: "h-4 w-4" })] }), _jsxs(MtButton, { variant: "outline", className: "h-8 w-8 p-0", onClick: () => table.nextPage(), disabled: !table.getCanNextPage(), children: [_jsx("span", { className: "sr-only", children: "Go to next page" }), _jsx(ChevronRightIcon, { className: "h-4 w-4" })] }), _jsxs(MtButton, { variant: "outline", className: "hidden h-8 w-8 p-0 lg:flex", onClick: () => table.setPageIndex(table.getPageCount() - 1), disabled: !table.getCanNextPage(), children: [_jsx("span", { className: "sr-only", children: "Go to last page" }), _jsx(DoubleArrowRightIcon, { className: "h-4 w-4" })] })] })] })] }));
10
+ }
@@ -0,0 +1,13 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { MixerHorizontalIcon } from "@radix-ui/react-icons";
4
+ import { MtButton } from "../../ui-mt/Button";
5
+ import { DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger, } from "../../ui/dropdown-menu";
6
+ export function DataTableViewOptions({ table }) {
7
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(MtButton, { variant: "outline", size: "sm", className: "ml-auto hidden h-8 lg:flex", children: [_jsx(MixerHorizontalIcon, { className: "mr-2 h-4 w-4" }), "View"] }) }), _jsxs(DropdownMenuContent, { align: "end", className: "w-[150px]", children: [_jsx(DropdownMenuLabel, { children: "Toggle columns" }), _jsx(DropdownMenuSeparator, {}), table
8
+ .getAllColumns()
9
+ .filter((column) => typeof column.accessorFn !== "undefined" && column.getCanHide())
10
+ .map((column) => {
11
+ return (_jsx(DropdownMenuCheckboxItem, { className: "capitalize", checked: column.getIsVisible(), onCheckedChange: (value) => column.toggleVisibility(!!value), children: column.id }, column.id));
12
+ })] })] }));
13
+ }
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { createColumnHelper, flexRender, getCoreRowModel, useReactTable } from "@tanstack/react-table";
3
4
  import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../../ui/table";
4
5
  const columnHelper = createColumnHelper();
@@ -17,7 +18,7 @@ const defaultColumns = [
17
18
  columnHelper.accessor((row) => row.lastName, {
18
19
  id: "lastName",
19
20
  cell: (info) => info.getValue(),
20
- header: () => <span>Last Name</span>,
21
+ header: () => _jsx("span", { children: "Last Name" }),
21
22
  footer: (props) => props.column.id,
22
23
  }),
23
24
  ],
@@ -34,7 +35,7 @@ const defaultColumns = [
34
35
  header: "More Info",
35
36
  columns: [
36
37
  columnHelper.accessor("visits", {
37
- header: () => <span>Visits</span>,
38
+ header: () => _jsx("span", { children: "Visits" }),
38
39
  footer: (props) => props.column.id,
39
40
  }),
40
41
  columnHelper.accessor("status", {
@@ -74,29 +75,10 @@ function DataTableDemo1Inner({ columns, data }) {
74
75
  columns,
75
76
  getCoreRowModel: getCoreRowModel(),
76
77
  });
77
- return (<div className="rounded-md border">
78
- <Table>
79
- <TableHeader>
80
- {table.getHeaderGroups().map((headerGroup) => (<TableRow key={headerGroup.id}>
81
- {headerGroup.headers.map((header) => {
82
- return (<TableHead key={header.id}>
83
- {header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext())}
84
- </TableHead>);
85
- })}
86
- </TableRow>))}
87
- </TableHeader>
88
- <TableBody>
89
- {table.getRowModel().rows?.length ? (table.getRowModel().rows.map((row) => (<TableRow key={row.id} data-state={row.getIsSelected() && "selected"}>
90
- {row.getVisibleCells().map((cell) => (<TableCell key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</TableCell>))}
91
- </TableRow>))) : (<TableRow>
92
- <TableCell colSpan={columns.length} className="h-24 text-center">
93
- No results.
94
- </TableCell>
95
- </TableRow>)}
96
- </TableBody>
97
- </Table>
98
- </div>);
78
+ return (_jsx("div", { className: "rounded-md border", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: table.getHeaderGroups().map((headerGroup) => (_jsx(TableRow, { children: headerGroup.headers.map((header) => {
79
+ return (_jsx(TableHead, { children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }, header.id));
80
+ }) }, headerGroup.id))) }), _jsx(TableBody, { children: table.getRowModel().rows?.length ? (table.getRowModel().rows.map((row) => (_jsx(TableRow, { "data-state": row.getIsSelected() && "selected", children: row.getVisibleCells().map((cell) => (_jsx(TableCell, { children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id))) }, row.id)))) : (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: columns.length, className: "h-24 text-center", children: "No results." }) })) })] }) }));
99
81
  }
100
82
  export function DataTableDemo1() {
101
- return <DataTableDemo1Inner columns={defaultColumns} data={demoData}/>;
83
+ return _jsx(DataTableDemo1Inner, { columns: defaultColumns, data: demoData });
102
84
  }
@@ -0,0 +1,16 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { cn } from "../../../lib/utils";
4
+ import { ArrowDownIcon, ArrowUpIcon, CaretSortIcon, EyeNoneIcon } from "@radix-ui/react-icons";
5
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "mtxuilib/ui/dropdown-menu";
6
+ import { Button } from "../../../ui/button";
7
+ export function SimpleHeader(props) {
8
+ const { column } = props;
9
+ return _jsx(SimpleHeaderRender, { column: column, title: "Status" });
10
+ }
11
+ export function SimpleHeaderRender({ column, title, className, }) {
12
+ if (!column.getCanSort()) {
13
+ return _jsx("div", { className: cn(className), children: title });
14
+ }
15
+ return (_jsx("div", { className: cn("flex items-center space-x-2", className), children: _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "ghost", size: "sm", className: "data-[state=open]:bg-accent -ml-3 h-8", children: [_jsx("span", { children: title }), column.getIsSorted() === "desc" ? (_jsx(ArrowDownIcon, { className: "ml-2 h-4 w-4" })) : column.getIsSorted() === "asc" ? (_jsx(ArrowUpIcon, { className: "ml-2 h-4 w-4" })) : (_jsx(CaretSortIcon, { className: "ml-2 h-4 w-4" }))] }) }), _jsxs(DropdownMenuContent, { align: "start", children: [_jsxs(DropdownMenuItem, { onClick: () => column.toggleSorting(false), children: [_jsx(ArrowUpIcon, { className: "text-muted-foreground/70 mr-2 h-3.5 w-3.5" }), "Asc"] }), _jsxs(DropdownMenuItem, { onClick: () => column.toggleSorting(true), children: [_jsx(ArrowDownIcon, { className: "text-muted-foreground/70 mr-2 h-3.5 w-3.5" }), "Desc"] }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { onClick: () => column.toggleVisibility(false), children: [_jsx(EyeNoneIcon, { className: "text-muted-foreground/70 mr-2 h-3.5 w-3.5" }), "Hide"] })] })] }) }));
16
+ }
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Checkbox } from "../../../ui/checkbox";
3
+ import { SimpleHeaderRender } from "./SimpleHeader";
4
+ export const TableHeader = (props) => {
5
+ const { table, column, columnConfig } = props;
6
+ if (!columnConfig.header) {
7
+ return _jsx("div", {});
8
+ }
9
+ const headerType = columnConfig.header.type;
10
+ switch (headerType) {
11
+ case "checkbox":
12
+ return (_jsx(Checkbox, { checked: table.getIsAllPageRowsSelected() || (table.getIsSomePageRowsSelected() && "indeterminate"), onCheckedChange: (value) => table.toggleAllPageRowsSelected(!!value), "aria-label": "Select all", className: "translate-y-[2px]" }));
13
+ default:
14
+ return _jsx(SimpleHeaderRender, { column: column, title: columnConfig.header.label });
15
+ }
16
+ };
@@ -0,0 +1,7 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ export const TailwindIndicator = () => {
4
+ if (process.env.NODE_ENV === 'production')
5
+ return null;
6
+ return (_jsxs("div", { className: "fixed bottom-1 left-1 z-50 flex h-6 w-6 items-center justify-center rounded-full bg-gray-800 p-3 font-mono text-xs text-white", children: [_jsx("div", { className: "block sm:hidden", children: "xs" }), _jsx("div", { className: "hidden sm:block md:hidden", children: "sm" }), _jsx("div", { className: "hidden md:block lg:hidden", children: "md" }), _jsx("div", { className: "hidden lg:block xl:hidden", children: "lg" }), _jsx("div", { className: "hidden xl:block 2xl:hidden", children: "xl" }), _jsx("div", { className: "hidden 2xl:block", children: "2xl" })] }));
7
+ };