@akanjs/ui 0.0.151 → 0.0.152

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 (351) hide show
  1. package/Button.d.ts +1 -1
  2. package/ClientSide.d.ts +1 -1
  3. package/Copy.d.ts +1 -1
  4. package/CsrImage.d.ts +1 -1
  5. package/Data/CardList.d.ts +1 -1
  6. package/Data/Dashboard.d.ts +1 -1
  7. package/Data/Insight.d.ts +1 -1
  8. package/Data/Item.d.ts +6 -6
  9. package/Data/ListContainer.d.ts +2 -2
  10. package/Data/Pagination.d.ts +1 -1
  11. package/Data/QueryMaker.d.ts +1 -1
  12. package/Data/TableList.d.ts +2 -2
  13. package/DatePicker.d.ts +3 -4
  14. package/Dialog/Close.d.ts +1 -1
  15. package/Dialog/Content.d.ts +1 -1
  16. package/Dialog/Modal.d.ts +1 -1
  17. package/Dialog/Provider.d.ts +1 -1
  18. package/Dialog/Trigger.d.ts +1 -1
  19. package/Dialog/index.d.ts +4 -4
  20. package/DragAction.d.ts +4 -4
  21. package/DraggableList.d.ts +2 -2
  22. package/Dropdown.d.ts +1 -1
  23. package/Empty.d.ts +2 -2
  24. package/Field.d.ts +22 -22
  25. package/Image.d.ts +1 -1
  26. package/InfiniteScroll.d.ts +1 -1
  27. package/Input.d.ts +6 -6
  28. package/KeyboardAvoiding.d.ts +1 -1
  29. package/Layout/BottomAction.d.ts +1 -1
  30. package/Layout/BottomInset.d.ts +1 -1
  31. package/Layout/BottomTab.d.ts +1 -1
  32. package/Layout/Header.d.ts +1 -1
  33. package/Layout/LeftSider.d.ts +1 -1
  34. package/Layout/Navbar.d.ts +2 -2
  35. package/Layout/RightSider.d.ts +1 -1
  36. package/Layout/Sider.d.ts +1 -1
  37. package/Layout/Template.d.ts +1 -1
  38. package/Layout/TopLeftAction.d.ts +1 -1
  39. package/Layout/Unit.d.ts +1 -1
  40. package/Layout/View.d.ts +1 -1
  41. package/Layout/Zone.d.ts +1 -1
  42. package/Layout/index.d.ts +12 -12
  43. package/Link/Back.d.ts +1 -1
  44. package/Link/Close.d.ts +1 -1
  45. package/Link/CsrLink.d.ts +1 -1
  46. package/Link/NextLink.d.ts +1 -1
  47. package/Link/index.d.ts +1 -1
  48. package/Load/Edit.d.ts +1 -1
  49. package/Load/Edit_Client.d.ts +1 -1
  50. package/Load/Page.d.ts +1 -1
  51. package/Load/PageCSR.d.ts +1 -1
  52. package/Load/Pagination.d.ts +1 -1
  53. package/Load/Units.d.ts +1 -1
  54. package/Load/View.d.ts +1 -1
  55. package/Load/index.d.ts +1 -1
  56. package/Loading/Area.d.ts +1 -1
  57. package/Loading/Button.d.ts +1 -1
  58. package/Loading/Input.d.ts +1 -1
  59. package/Loading/ProgressBar.d.ts +1 -1
  60. package/Loading/Skeleton.d.ts +1 -1
  61. package/Loading/Spin.d.ts +1 -1
  62. package/Loading/index.d.ts +6 -6
  63. package/Menu.d.ts +1 -1
  64. package/Modal.d.ts +3 -3
  65. package/Model/Edit.d.ts +1 -1
  66. package/Model/EditModal.d.ts +2 -2
  67. package/Model/EditWrapper.d.ts +1 -1
  68. package/Model/LoadInit.d.ts +1 -1
  69. package/Model/New.d.ts +1 -1
  70. package/Model/NewWrapper.d.ts +1 -1
  71. package/Model/NewWrapper_Client.d.ts +1 -1
  72. package/Model/Remove.d.ts +1 -1
  73. package/Model/RemoveWrapper.d.ts +1 -1
  74. package/Model/SureToRemove.d.ts +1 -1
  75. package/Model/View.d.ts +1 -1
  76. package/Model/ViewEditModal.d.ts +1 -1
  77. package/Model/ViewModal.d.ts +1 -1
  78. package/Model/ViewWrapper.d.ts +1 -1
  79. package/More.d.ts +1 -1
  80. package/ObjectId.d.ts +1 -1
  81. package/Popconfirm.d.ts +2 -2
  82. package/Radio.d.ts +2 -2
  83. package/RecentTime.d.ts +1 -1
  84. package/Refresh.d.ts +1 -1
  85. package/ScreenNavigator.d.ts +3 -3
  86. package/Select.d.ts +1 -1
  87. package/Signal/Arg.d.ts +13 -13
  88. package/Signal/Doc.d.ts +6 -6
  89. package/Signal/GraphQL.d.ts +5 -6
  90. package/Signal/Listener.d.ts +2 -2
  91. package/Signal/Message.d.ts +4 -5
  92. package/Signal/Object.d.ts +4 -4
  93. package/Signal/PubSub.d.ts +4 -4
  94. package/Signal/Request.d.ts +2 -2
  95. package/Signal/Response.d.ts +3 -3
  96. package/Signal/RestApi.d.ts +5 -6
  97. package/Signal/WebSocket.d.ts +2 -2
  98. package/System/CSR.d.ts +5 -5
  99. package/System/Client.d.ts +8 -8
  100. package/System/Common.d.ts +2 -2
  101. package/System/DevModeToggle.d.ts +1 -1
  102. package/System/Gtag.d.ts +1 -1
  103. package/System/HealthCheck.d.ts +1 -1
  104. package/System/Messages.d.ts +1 -1
  105. package/System/Reconnect.d.ts +1 -1
  106. package/System/Root.d.ts +1 -1
  107. package/System/SSR.d.ts +4 -4
  108. package/System/SelectLanguage.d.ts +1 -1
  109. package/System/ThemeToggle.d.ts +1 -1
  110. package/System/index.d.ts +7 -7
  111. package/Tab/Menu.d.ts +1 -1
  112. package/Tab/Menus.d.ts +1 -1
  113. package/Tab/Panel.d.ts +1 -1
  114. package/Tab/Provider.d.ts +1 -1
  115. package/Tab/index.d.ts +4 -4
  116. package/Table.d.ts +1 -1
  117. package/ToggleSelect.d.ts +2 -2
  118. package/Unauthorized.d.ts +2 -2
  119. package/cjs/BottomSheet.js +38 -42
  120. package/cjs/Button.js +36 -34
  121. package/cjs/ClientSide.js +2 -1
  122. package/cjs/Copy.js +5 -4
  123. package/cjs/CsrImage.js +2 -1
  124. package/cjs/Data/CardList.js +41 -33
  125. package/cjs/Data/Dashboard.js +22 -12
  126. package/cjs/Data/Insight.js +7 -3
  127. package/cjs/Data/Item.js +54 -39
  128. package/cjs/Data/ListContainer.js +104 -70
  129. package/cjs/Data/Pagination.js +3 -2
  130. package/cjs/Data/QueryMaker.js +104 -82
  131. package/cjs/Data/TableList.js +45 -34
  132. package/cjs/DatePicker.js +38 -33
  133. package/cjs/Dialog/Close.js +5 -4
  134. package/cjs/Dialog/Content.js +2 -1
  135. package/cjs/Dialog/Modal.js +60 -49
  136. package/cjs/Dialog/Provider.js +2 -1
  137. package/cjs/Dialog/Trigger.js +5 -4
  138. package/cjs/Dialog/index.js +2 -1
  139. package/cjs/DragAction.js +11 -10
  140. package/cjs/DraggableList.js +10 -9
  141. package/cjs/Dropdown.js +32 -29
  142. package/cjs/Empty.js +17 -22
  143. package/cjs/Field.js +695 -573
  144. package/cjs/Image.js +2 -1
  145. package/cjs/InfiniteScroll.js +6 -1
  146. package/cjs/Input.js +171 -154
  147. package/cjs/KeyboardAvoiding.js +2 -1
  148. package/cjs/Layout/BottomAction.js +2 -1
  149. package/cjs/Layout/BottomInset.js +6 -5
  150. package/cjs/Layout/BottomTab.js +23 -17
  151. package/cjs/Layout/Header.js +14 -10
  152. package/cjs/Layout/LeftSider.js +17 -14
  153. package/cjs/Layout/Navbar.js +6 -12
  154. package/cjs/Layout/RightSider.js +24 -18
  155. package/cjs/Layout/Sider.js +24 -11
  156. package/cjs/Layout/Template.js +2 -1
  157. package/cjs/Layout/TopLeftAction.js +2 -1
  158. package/cjs/Layout/Unit.js +2 -1
  159. package/cjs/Layout/View.js +2 -1
  160. package/cjs/Layout/Zone.js +2 -1
  161. package/cjs/Link/Back.js +2 -1
  162. package/cjs/Link/Close.js +5 -4
  163. package/cjs/Link/CsrLink.js +5 -4
  164. package/cjs/Link/NextLink.js +5 -4
  165. package/cjs/Link/index.js +4 -3
  166. package/cjs/Load/Edit.js +2 -1
  167. package/cjs/Load/Edit_Client.js +6 -5
  168. package/cjs/Load/PageCSR.js +2 -1
  169. package/cjs/Load/Pagination.js +4 -3
  170. package/cjs/Load/Units.js +34 -27
  171. package/cjs/Load/View.js +3 -2
  172. package/cjs/Loading/Area.js +5 -1
  173. package/cjs/Loading/Button.js +2 -1
  174. package/cjs/Loading/Input.js +2 -1
  175. package/cjs/Loading/ProgressBar.js +2 -1
  176. package/cjs/Loading/Skeleton.js +7 -1
  177. package/cjs/Loading/Spin.js +2 -1
  178. package/cjs/Menu.js +105 -89
  179. package/cjs/Modal.js +33 -20
  180. package/cjs/Model/Edit.js +18 -12
  181. package/cjs/Model/EditModal.js +43 -45
  182. package/cjs/Model/EditWrapper.js +5 -4
  183. package/cjs/Model/LoadInit.js +2 -1
  184. package/cjs/Model/New.js +18 -12
  185. package/cjs/Model/NewWrapper.js +2 -1
  186. package/cjs/Model/NewWrapper_Client.js +5 -4
  187. package/cjs/Model/Remove.js +45 -39
  188. package/cjs/Model/RemoveWrapper.js +6 -5
  189. package/cjs/Model/SureToRemove.js +70 -54
  190. package/cjs/Model/View.js +13 -3
  191. package/cjs/Model/ViewEditModal.js +30 -19
  192. package/cjs/Model/ViewModal.js +9 -8
  193. package/cjs/Model/ViewWrapper.js +5 -4
  194. package/cjs/More.js +10 -6
  195. package/cjs/ObjectId.js +5 -1
  196. package/cjs/Pagination.js +45 -40
  197. package/cjs/Popconfirm.js +53 -45
  198. package/cjs/Radio.js +26 -22
  199. package/cjs/RecentTime.js +16 -15
  200. package/cjs/Refresh.js +5 -4
  201. package/cjs/ScreenNavigator.js +7 -6
  202. package/cjs/Select.js +156 -135
  203. package/cjs/Signal/Arg.js +94 -54
  204. package/cjs/Signal/Doc.js +175 -98
  205. package/cjs/Signal/GraphQL.js +143 -59
  206. package/cjs/Signal/Listener.js +28 -21
  207. package/cjs/Signal/Message.js +166 -80
  208. package/cjs/Signal/Object.js +75 -39
  209. package/cjs/Signal/PubSub.js +161 -79
  210. package/cjs/Signal/Request.js +16 -9
  211. package/cjs/Signal/Response.js +30 -17
  212. package/cjs/Signal/RestApi.js +186 -84
  213. package/cjs/Signal/WebSocket.js +6 -5
  214. package/cjs/System/CSR.js +184 -165
  215. package/cjs/System/Client.js +24 -20
  216. package/cjs/System/Common.js +29 -25
  217. package/cjs/System/DevModeToggle.js +14 -10
  218. package/cjs/System/Gtag.js +11 -7
  219. package/cjs/System/HealthCheck.js +2 -1
  220. package/cjs/System/Messages.js +39 -36
  221. package/cjs/System/Reconnect.js +25 -3
  222. package/cjs/System/Root.js +2 -1
  223. package/cjs/System/SSR.js +72 -54
  224. package/cjs/System/SelectLanguage.js +25 -21
  225. package/cjs/System/ThemeToggle.js +5 -1
  226. package/cjs/System/index.js +3 -2
  227. package/cjs/Tab/Menu.js +5 -4
  228. package/cjs/Tab/Menus.js +2 -1
  229. package/cjs/Tab/Panel.js +3 -2
  230. package/cjs/Tab/Provider.js +2 -1
  231. package/cjs/Tab/index.js +2 -1
  232. package/cjs/Table.js +25 -26
  233. package/cjs/ToggleSelect.js +59 -54
  234. package/cjs/Unauthorized.js +17 -22
  235. package/esm/BottomSheet.js +38 -32
  236. package/esm/Button.js +36 -24
  237. package/esm/ClientSide.js +2 -1
  238. package/esm/Copy.js +5 -4
  239. package/esm/CsrImage.js +2 -1
  240. package/esm/Data/CardList.js +41 -33
  241. package/esm/Data/Dashboard.js +22 -12
  242. package/esm/Data/Insight.js +7 -3
  243. package/esm/Data/Item.js +54 -29
  244. package/esm/Data/ListContainer.js +104 -70
  245. package/esm/Data/Pagination.js +3 -2
  246. package/esm/Data/QueryMaker.js +104 -82
  247. package/esm/Data/TableList.js +45 -34
  248. package/esm/DatePicker.js +38 -33
  249. package/esm/Dialog/Close.js +5 -4
  250. package/esm/Dialog/Content.js +2 -1
  251. package/esm/Dialog/Modal.js +60 -49
  252. package/esm/Dialog/Provider.js +2 -1
  253. package/esm/Dialog/Trigger.js +5 -4
  254. package/esm/Dialog/index.js +2 -1
  255. package/esm/DragAction.js +11 -10
  256. package/esm/DraggableList.js +10 -9
  257. package/esm/Dropdown.js +32 -29
  258. package/esm/Empty.js +17 -12
  259. package/esm/Field.js +695 -573
  260. package/esm/Image.js +2 -1
  261. package/esm/InfiniteScroll.js +6 -1
  262. package/esm/Input.js +171 -144
  263. package/esm/KeyboardAvoiding.js +2 -1
  264. package/esm/Layout/BottomAction.js +2 -1
  265. package/esm/Layout/BottomInset.js +6 -5
  266. package/esm/Layout/BottomTab.js +23 -17
  267. package/esm/Layout/Header.js +14 -10
  268. package/esm/Layout/LeftSider.js +17 -14
  269. package/esm/Layout/Navbar.js +6 -2
  270. package/esm/Layout/RightSider.js +24 -18
  271. package/esm/Layout/Sider.js +24 -11
  272. package/esm/Layout/Template.js +2 -1
  273. package/esm/Layout/TopLeftAction.js +2 -1
  274. package/esm/Layout/Unit.js +2 -1
  275. package/esm/Layout/View.js +2 -1
  276. package/esm/Layout/Zone.js +2 -1
  277. package/esm/Link/Back.js +2 -1
  278. package/esm/Link/Close.js +5 -4
  279. package/esm/Link/CsrLink.js +5 -4
  280. package/esm/Link/NextLink.js +5 -4
  281. package/esm/Link/index.js +4 -3
  282. package/esm/Load/Edit.js +2 -1
  283. package/esm/Load/Edit_Client.js +6 -5
  284. package/esm/Load/PageCSR.js +2 -1
  285. package/esm/Load/Pagination.js +4 -3
  286. package/esm/Load/Units.js +34 -27
  287. package/esm/Load/View.js +3 -2
  288. package/esm/Loading/Area.js +5 -1
  289. package/esm/Loading/Button.js +2 -1
  290. package/esm/Loading/Input.js +2 -1
  291. package/esm/Loading/ProgressBar.js +2 -1
  292. package/esm/Loading/Skeleton.js +7 -1
  293. package/esm/Loading/Spin.js +2 -1
  294. package/esm/Menu.js +105 -89
  295. package/esm/Modal.js +33 -20
  296. package/esm/Model/Edit.js +18 -12
  297. package/esm/Model/EditModal.js +43 -35
  298. package/esm/Model/EditWrapper.js +5 -4
  299. package/esm/Model/LoadInit.js +2 -1
  300. package/esm/Model/New.js +18 -12
  301. package/esm/Model/NewWrapper.js +2 -1
  302. package/esm/Model/NewWrapper_Client.js +5 -4
  303. package/esm/Model/Remove.js +45 -39
  304. package/esm/Model/RemoveWrapper.js +6 -5
  305. package/esm/Model/SureToRemove.js +70 -54
  306. package/esm/Model/View.js +13 -3
  307. package/esm/Model/ViewEditModal.js +30 -19
  308. package/esm/Model/ViewModal.js +9 -8
  309. package/esm/Model/ViewWrapper.js +5 -4
  310. package/esm/More.js +10 -6
  311. package/esm/ObjectId.js +5 -1
  312. package/esm/Pagination.js +45 -40
  313. package/esm/Popconfirm.js +53 -35
  314. package/esm/Radio.js +26 -22
  315. package/esm/RecentTime.js +16 -15
  316. package/esm/Refresh.js +5 -4
  317. package/esm/ScreenNavigator.js +7 -6
  318. package/esm/Select.js +156 -135
  319. package/esm/Signal/Arg.js +94 -54
  320. package/esm/Signal/Doc.js +175 -98
  321. package/esm/Signal/GraphQL.js +143 -59
  322. package/esm/Signal/Listener.js +28 -21
  323. package/esm/Signal/Message.js +166 -80
  324. package/esm/Signal/Object.js +75 -39
  325. package/esm/Signal/PubSub.js +161 -79
  326. package/esm/Signal/Request.js +16 -9
  327. package/esm/Signal/Response.js +30 -17
  328. package/esm/Signal/RestApi.js +186 -84
  329. package/esm/Signal/WebSocket.js +6 -5
  330. package/esm/System/CSR.js +184 -165
  331. package/esm/System/Client.js +24 -20
  332. package/esm/System/Common.js +29 -25
  333. package/esm/System/DevModeToggle.js +14 -10
  334. package/esm/System/Gtag.js +11 -7
  335. package/esm/System/HealthCheck.js +2 -1
  336. package/esm/System/Messages.js +39 -36
  337. package/esm/System/Reconnect.js +25 -3
  338. package/esm/System/Root.js +2 -1
  339. package/esm/System/SSR.js +72 -54
  340. package/esm/System/SelectLanguage.js +25 -21
  341. package/esm/System/ThemeToggle.js +5 -1
  342. package/esm/System/index.js +3 -2
  343. package/esm/Tab/Menu.js +5 -4
  344. package/esm/Tab/Menus.js +2 -1
  345. package/esm/Tab/Panel.js +3 -2
  346. package/esm/Tab/Provider.js +2 -1
  347. package/esm/Tab/index.js +2 -1
  348. package/esm/Table.js +25 -16
  349. package/esm/ToggleSelect.js +59 -54
  350. package/esm/Unauthorized.js +17 -12
  351. package/package.json +1 -1
@@ -20,8 +20,14 @@ __export(Skeleton_exports, {
20
20
  Skeleton: () => Skeleton
21
21
  });
22
22
  module.exports = __toCommonJS(Skeleton_exports);
23
+ var import_jsx_runtime = require("react/jsx-runtime");
23
24
  var import_client = require("@akanjs/client");
24
25
  const Skeleton = ({ className = "", active, style }) => {
25
26
  const activeClassName = active ? "animate-pulse" : "";
26
- return /* @__PURE__ */ React.createElement("div", { className: (0, import_client.clsx)("w-full", activeClassName, className), style }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col justify-start space-y-3" }, /* @__PURE__ */ React.createElement("div", { className: "h-4 w-2/5 rounded-md bg-gray-200" }), /* @__PURE__ */ React.createElement("div", { className: "h-4 w-full rounded-md bg-gray-200" }), /* @__PURE__ */ React.createElement("div", { className: "h-4 w-full rounded-md bg-gray-200" }), /* @__PURE__ */ React.createElement("div", { className: "h-4 w-3/5 rounded-md bg-gray-200" })));
27
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_client.clsx)("w-full", activeClassName, className), style, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex flex-col justify-start space-y-3", children: [
28
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-4 w-2/5 rounded-md bg-gray-200" }),
29
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-4 w-full rounded-md bg-gray-200" }),
30
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-4 w-full rounded-md bg-gray-200" }),
31
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-4 w-3/5 rounded-md bg-gray-200" })
32
+ ] }) });
27
33
  };
@@ -20,8 +20,9 @@ __export(Spin_exports, {
20
20
  Spin: () => Spin
21
21
  });
22
22
  module.exports = __toCommonJS(Spin_exports);
23
+ var import_jsx_runtime = require("react/jsx-runtime");
23
24
  var import_client = require("@akanjs/client");
24
25
  var import_ai = require("react-icons/ai");
25
26
  const Spin = ({ indicator, isCenter, className }) => {
26
- return /* @__PURE__ */ React.createElement("div", { className: (0, import_client.clsx)("inline-block py-1", className) }, /* @__PURE__ */ React.createElement("div", { className: isCenter ? "absolute inset-0 flex size-full flex-none items-center justify-center" : "" }, indicator ? /* @__PURE__ */ React.createElement("div", { className: "[&>svg]:animate-spin" }, indicator) : /* @__PURE__ */ React.createElement(import_ai.AiOutlineLoading, { className: "text-primary/60 animate-spin text-lg" })));
27
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: (0, import_client.clsx)("inline-block py-1", className), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: isCenter ? "absolute inset-0 flex size-full flex-none items-center justify-center" : "", children: indicator ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "[&>svg]:animate-spin", children: indicator }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlineLoading, { className: "text-primary/60 animate-spin text-lg" }) }) });
27
28
  };
package/cjs/Menu.js CHANGED
@@ -21,6 +21,7 @@ __export(Menu_exports, {
21
21
  Menu: () => Menu
22
22
  });
23
23
  module.exports = __toCommonJS(Menu_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
24
25
  var import_client = require("@akanjs/client");
25
26
  var import_store = require("@akanjs/store");
26
27
  var import_react = require("react");
@@ -102,76 +103,86 @@ const Menu = ({
102
103
  return selectedKeys.includes(key);
103
104
  return key === currentKey;
104
105
  };
105
- return /* @__PURE__ */ React.createElement(
106
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
106
107
  "div",
107
108
  {
108
109
  ref: menuRef,
109
110
  id: "menu",
110
- className: (0, import_client.clsx)(mode === "horizontal" ? "w-full shrink overflow-hidden" : "w-fit", className)
111
- },
112
- /* @__PURE__ */ React.createElement(
113
- "ul",
114
- {
115
- className: (0, import_client.clsx)("menu size-full flex-nowrap overflow-y-auto p-0", modeClassName, ulClassName),
116
- style: { ...style },
117
- onMouseOver,
118
- onMouseLeave
119
- },
120
- items.filter((item) => !overflowMenuItems.some((overflowItem) => overflowItem.key === item.key)).map((item, idx) => {
121
- const isOverflowItem = overflowMenuItems.some((overflowItem) => overflowItem.key === item.key);
122
- const overflowClassName = isOverflowItem ? "opacity-50" : "";
123
- return /* @__PURE__ */ React.createElement(
124
- "li",
125
- {
126
- ref: (el) => {
127
- if (el)
128
- LiRefs.current[idx] = el;
129
- },
130
- id: item.key,
131
- key: item.key,
132
- className: (0, import_client.clsx)("relative m-0 duration-200 hover:opacity-70", overflowClassName, liClassName, {
133
- "bg-base-300": activeStyle === "active" && checkIsActive(item.key),
134
- "border-base-100 border-b-2": activeStyle === "bordered" && checkIsActive(item.key)
111
+ className: (0, import_client.clsx)(mode === "horizontal" ? "w-full shrink overflow-hidden" : "w-fit", className),
112
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
113
+ "ul",
114
+ {
115
+ className: (0, import_client.clsx)("menu size-full flex-nowrap overflow-y-auto p-0", modeClassName, ulClassName),
116
+ style: { ...style },
117
+ onMouseOver,
118
+ onMouseLeave,
119
+ children: [
120
+ items.filter((item) => !overflowMenuItems.some((overflowItem) => overflowItem.key === item.key)).map((item, idx) => {
121
+ const isOverflowItem = overflowMenuItems.some((overflowItem) => overflowItem.key === item.key);
122
+ const overflowClassName = isOverflowItem ? "opacity-50" : "";
123
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
124
+ "li",
125
+ {
126
+ ref: (el) => {
127
+ if (el)
128
+ LiRefs.current[idx] = el;
129
+ },
130
+ id: item.key,
131
+ className: (0, import_client.clsx)("relative m-0 duration-200 hover:opacity-70", overflowClassName, liClassName, {
132
+ "bg-base-300": activeStyle === "active" && checkIsActive(item.key),
133
+ "border-base-100 border-b-2": activeStyle === "bordered" && checkIsActive(item.key)
134
+ }),
135
+ onClick: () => {
136
+ if (!isOverflowItem)
137
+ handleOnClick(item);
138
+ },
139
+ onMouseEnter: () => {
140
+ if (mode === "horizontal" && !isOverflowItem && item.children && expandedKey !== item.key)
141
+ setExpandedKey(item.key);
142
+ },
143
+ onMouseLeave: () => {
144
+ if (mode === "horizontal" && !isOverflowItem)
145
+ setExpandedKey(void 0);
146
+ },
147
+ children: [
148
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex h-full justify-between rounded-none", children: [
149
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_client.clsx)("flex items-center gap-1", labelClassName?.(checkIsActive(item.key))), children: [
150
+ item.icon,
151
+ !inlineCollapsed && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-base-content whitespace-nowrap", children: item.label })
152
+ ] }),
153
+ item.children && mode === "inline" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
154
+ import_ai.AiFillCaretDown,
155
+ {
156
+ className: (0, import_client.clsx)(
157
+ "text-xs transition-transform duration-400",
158
+ expandedKey === item.key ? "rotate-180" : ""
159
+ )
160
+ }
161
+ )
162
+ ] }),
163
+ item.children && expandedKey === item.key && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: subMenuClassName, children: item.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
164
+ "div",
165
+ {
166
+ onClick: (e) => {
167
+ e.stopPropagation();
168
+ onClick?.(child);
169
+ setExpandedKey(void 0);
170
+ },
171
+ className: subMenuItemClassName,
172
+ children: child.label
173
+ },
174
+ child.key
175
+ )) })
176
+ ]
177
+ },
178
+ item.key
179
+ );
135
180
  }),
136
- onClick: () => {
137
- if (!isOverflowItem)
138
- handleOnClick(item);
139
- },
140
- onMouseEnter: () => {
141
- if (mode === "horizontal" && !isOverflowItem && item.children && expandedKey !== item.key)
142
- setExpandedKey(item.key);
143
- },
144
- onMouseLeave: () => {
145
- if (mode === "horizontal" && !isOverflowItem)
146
- setExpandedKey(void 0);
147
- }
148
- },
149
- /* @__PURE__ */ React.createElement("div", { className: "flex h-full justify-between rounded-none" }, /* @__PURE__ */ React.createElement("div", { className: (0, import_client.clsx)("flex items-center gap-1", labelClassName?.(checkIsActive(item.key))) }, item.icon, !inlineCollapsed && /* @__PURE__ */ React.createElement("div", { className: "text-base-content whitespace-nowrap" }, item.label)), item.children && mode === "inline" && /* @__PURE__ */ React.createElement(
150
- import_ai.AiFillCaretDown,
151
- {
152
- className: (0, import_client.clsx)(
153
- "text-xs transition-transform duration-400",
154
- expandedKey === item.key ? "rotate-180" : ""
155
- )
156
- }
157
- )),
158
- item.children && expandedKey === item.key && /* @__PURE__ */ React.createElement("div", { className: subMenuClassName }, item.children.map((child) => /* @__PURE__ */ React.createElement(
159
- "div",
160
- {
161
- onClick: (e) => {
162
- e.stopPropagation();
163
- onClick?.(child);
164
- setExpandedKey(void 0);
165
- },
166
- key: child.key,
167
- className: subMenuItemClassName
168
- },
169
- child.label
170
- )))
171
- );
172
- }),
173
- overflowMenuItems.length > 0 && mode === "horizontal" && /* @__PURE__ */ React.createElement(OverflowMenu, { overflowItems: overflowMenuItems, onClick })
174
- )
181
+ overflowMenuItems.length > 0 && mode === "horizontal" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(OverflowMenu, { overflowItems: overflowMenuItems, onClick })
182
+ ]
183
+ }
184
+ )
185
+ }
175
186
  );
176
187
  };
177
188
  const OverflowMenu = ({ overflowItems, onClick }) => {
@@ -183,33 +194,38 @@ const OverflowMenu = ({ overflowItems, onClick }) => {
183
194
  const handleMouseLeave = () => {
184
195
  setIsOpen(false);
185
196
  };
186
- return /* @__PURE__ */ React.createElement("li", { className: "relative h-full", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave }, /* @__PURE__ */ React.createElement("div", { className: "flex h-full items-center justify-center rounded-none" }, /* @__PURE__ */ React.createElement(import_ai.AiOutlineEllipsis, null)), isOpen && /* @__PURE__ */ React.createElement("div", { className: "bg-base-100 hover:bg-base-100 fixed -bottom-0 flex translate-y-[98%] flex-col rounded-xs border-0 p-2 shadow-lg" }, overflowItems.map((item) => /* @__PURE__ */ React.createElement(
187
- "div",
188
- {
189
- key: item.key,
190
- onClick: () => onClick?.(item),
191
- className: "btn btn-ghost text-primary-focus relative font-normal whitespace-nowrap",
192
- onMouseEnter: () => {
193
- if (item.children && expandedKey !== item.key)
194
- setExpandedKey(item.key);
195
- },
196
- onMouseLeave: () => {
197
- setExpandedKey(void 0);
198
- }
199
- },
200
- item.label,
201
- item.children && expandedKey === item.key && /* @__PURE__ */ React.createElement("div", { className: "bg-base-100 absolute top-0 left-0 -translate-x-full p-4 drop-shadow-sm" }, item.children.map((child) => /* @__PURE__ */ React.createElement(
197
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: "relative h-full", onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [
198
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "flex h-full items-center justify-center rounded-none", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlineEllipsis, {}) }),
199
+ isOpen && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bg-base-100 hover:bg-base-100 fixed -bottom-0 flex translate-y-[98%] flex-col rounded-xs border-0 p-2 shadow-lg", children: overflowItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
202
200
  "div",
203
201
  {
204
- onClick: (e) => {
205
- e.stopPropagation();
206
- onClick?.(child);
202
+ onClick: () => onClick?.(item),
203
+ className: "btn btn-ghost text-primary-focus relative font-normal whitespace-nowrap",
204
+ onMouseEnter: () => {
205
+ if (item.children && expandedKey !== item.key)
206
+ setExpandedKey(item.key);
207
+ },
208
+ onMouseLeave: () => {
207
209
  setExpandedKey(void 0);
208
210
  },
209
- key: child.key,
210
- className: "btn btn-ghost text-primary-focus flex items-center justify-center text-center font-normal"
211
+ children: [
212
+ item.label,
213
+ item.children && expandedKey === item.key && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bg-base-100 absolute top-0 left-0 -translate-x-full p-4 drop-shadow-sm", children: item.children.map((child) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
214
+ "div",
215
+ {
216
+ onClick: (e) => {
217
+ e.stopPropagation();
218
+ onClick?.(child);
219
+ setExpandedKey(void 0);
220
+ },
221
+ className: "btn btn-ghost text-primary-focus flex items-center justify-center text-center font-normal",
222
+ children: child.label
223
+ },
224
+ child.key
225
+ )) })
226
+ ]
211
227
  },
212
- child.label
213
- )))
214
- ))));
228
+ item.key
229
+ )) })
230
+ ] });
215
231
  };
package/cjs/Modal.js CHANGED
@@ -32,6 +32,7 @@ __export(Modal_exports, {
32
32
  Window: () => Window
33
33
  });
34
34
  module.exports = __toCommonJS(Modal_exports);
35
+ var import_jsx_runtime = require("react/jsx-runtime");
35
36
  var RadixDialog = __toESM(require("@radix-ui/react-dialog"));
36
37
  var import_bi = require("react-icons/bi");
37
38
  var import_Dialog = require("./Dialog");
@@ -45,31 +46,43 @@ const Modal = ({
45
46
  children,
46
47
  confirmClose = false
47
48
  }) => {
48
- return /* @__PURE__ */ React.createElement(import_Dialog.Dialog, { open }, /* @__PURE__ */ React.createElement(import_Dialog.Dialog.Modal, { className, onCancel, bodyClassName, confirmClose }, title ? /* @__PURE__ */ React.createElement(import_Dialog.Dialog.Title, null, title) : null, /* @__PURE__ */ React.createElement(import_Dialog.Dialog.Content, null, children), action ? /* @__PURE__ */ React.createElement(import_Dialog.Dialog.Action, null, action) : null));
49
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Dialog.Dialog, { open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Dialog.Dialog.Modal, { className, onCancel, bodyClassName, confirmClose, children: [
50
+ title ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Dialog.Dialog.Title, { children: title }) : null,
51
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Dialog.Dialog.Content, { children }),
52
+ action ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Dialog.Dialog.Action, { children: action }) : null
53
+ ] }) });
49
54
  };
50
55
  const Window = ({ open, onCancel, title, children }) => {
51
56
  if (!open)
52
57
  return null;
53
- return /* @__PURE__ */ React.createElement(RadixDialog.Root, { open }, /* @__PURE__ */ React.createElement(RadixDialog.Portal, null, /* @__PURE__ */ React.createElement(RadixDialog.Overlay, { className: "fixed inset-0 bg-black/40" }), /* @__PURE__ */ React.createElement(
54
- RadixDialog.Content,
55
- {
56
- className: "animate-fadeIn fixed top-1/2 left-1/2 z-[2] w-[90%] min-w-auto -translate-x-1/2 -translate-y-1/2 rounded-[10px] border-[3px] border-black text-black backdrop-blur-lg md:w-fit",
57
- style: {
58
- background: `rgba(255, 255, 255, 0.3)`,
59
- width: "406px"
60
- }
61
- },
62
- /* @__PURE__ */ React.createElement(RadixDialog.Title, { className: "height-[36px] relative overflow-hidden rounded-t-[6px] border-b-2 border-black bg-white/60 text-center" }, /* @__PURE__ */ React.createElement("div", { className: "m-0 text-[22px]" }, title), /* @__PURE__ */ React.createElement(
63
- RadixDialog.Close,
58
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadixDialog.Root, { open, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(RadixDialog.Portal, { children: [
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadixDialog.Overlay, { className: "fixed inset-0 bg-black/40" }),
60
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
61
+ RadixDialog.Content,
64
62
  {
65
- onClick: () => {
66
- onCancel();
63
+ className: "animate-fadeIn fixed top-1/2 left-1/2 z-[2] w-[90%] min-w-auto -translate-x-1/2 -translate-y-1/2 rounded-[10px] border-[3px] border-black text-black backdrop-blur-lg md:w-fit",
64
+ style: {
65
+ background: `rgba(255, 255, 255, 0.3)`,
66
+ width: "406px"
67
67
  },
68
- className: "absolute top-0 right-0 flex h-[34px] w-[40px] cursor-pointer items-center justify-center border-l-2 border-black"
69
- },
70
- /* @__PURE__ */ React.createElement(import_bi.BiX, { className: "text-[32px]" })
71
- )),
72
- /* @__PURE__ */ React.createElement(RadixDialog.Description, { className: "overflow-y-hidden rounded-b-[10px] p-2" }, children)
73
- )));
68
+ children: [
69
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(RadixDialog.Title, { className: "height-[36px] relative overflow-hidden rounded-t-[6px] border-b-2 border-black bg-white/60 text-center", children: [
70
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "m-0 text-[22px]", children: title }),
71
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
72
+ RadixDialog.Close,
73
+ {
74
+ onClick: () => {
75
+ onCancel();
76
+ },
77
+ className: "absolute top-0 right-0 flex h-[34px] w-[40px] cursor-pointer items-center justify-center border-l-2 border-black",
78
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_bi.BiX, { className: "text-[32px]" })
79
+ }
80
+ )
81
+ ] }),
82
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RadixDialog.Description, { className: "overflow-y-hidden rounded-b-[10px] p-2", children })
83
+ ]
84
+ }
85
+ )
86
+ ] }) });
74
87
  };
75
88
  Modal.Window = Window;
package/cjs/Model/Edit.js CHANGED
@@ -30,6 +30,7 @@ __export(Edit_exports, {
30
30
  default: () => Edit
31
31
  });
32
32
  module.exports = __toCommonJS(Edit_exports);
33
+ var import_jsx_runtime = require("react/jsx-runtime");
33
34
  var import_client = require("@akanjs/client");
34
35
  var import_next = require("@akanjs/next");
35
36
  var import_ai = require("react-icons/ai");
@@ -46,16 +47,21 @@ function Edit({
46
47
  renderTitle
47
48
  }) {
48
49
  const { l } = (0, import_next.usePage)();
49
- return /* @__PURE__ */ React.createElement("div", { className: (0, import_client.clsx)("inline", wrapperClassName) }, /* @__PURE__ */ React.createElement(
50
- import_EditWrapper.default,
51
- {
52
- className: (0, import_client.clsx)("flex w-full items-center justify-center gap-2", className),
53
- sliceName,
54
- modelId,
55
- modal
56
- },
57
- /* @__PURE__ */ React.createElement(import_ai.AiOutlineEdit, null),
58
- " ",
59
- type === "button" ? l("shared.edit") : null
60
- ), /* @__PURE__ */ React.createElement(import_EditModal.default, { renderTitle, sliceName, id: modelId }, children));
50
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_client.clsx)("inline", wrapperClassName), children: [
51
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
52
+ import_EditWrapper.default,
53
+ {
54
+ className: (0, import_client.clsx)("flex w-full items-center justify-center gap-2", className),
55
+ sliceName,
56
+ modelId,
57
+ modal,
58
+ children: [
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlineEdit, {}),
60
+ " ",
61
+ type === "button" ? l("shared.edit") : null
62
+ ]
63
+ }
64
+ ),
65
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_EditModal.default, { renderTitle, sliceName, id: modelId, children })
66
+ ] });
61
67
  }
@@ -1,9 +1,7 @@
1
1
  "use client";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,27 +15,20 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
  var EditModal_exports = {};
30
20
  __export(EditModal_exports, {
31
21
  default: () => EditModal
32
22
  });
33
23
  module.exports = __toCommonJS(EditModal_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
34
25
  var import_client = require("@akanjs/client");
35
26
  var import_common = require("@akanjs/common");
36
27
  var import_constant = require("@akanjs/constant");
37
28
  var import_next = require("@akanjs/next");
38
29
  var import_signal = require("@akanjs/signal");
39
30
  var import_store2 = require("@akanjs/store");
40
- var import_react = __toESM(require("react"));
31
+ var import_react = require("react");
41
32
  var import_ai = require("react-icons/ai");
42
33
  var import_Button = require("../Button");
43
34
  var import_Modal = require("../Modal");
@@ -78,10 +69,13 @@ const EditModel = ({
78
69
  const LoadingWrapper = (0, import_react.useMemo)(() => {
79
70
  return loadingWrapper === false ? ({ children: children2, className: className2 }) => children2 : typeof loadingWrapper === "function" ? loadingWrapper : ({ children: children2, className: className2 }) => {
80
71
  const modelFormLoading = storeUse[names.modelFormLoading]();
81
- return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_client.clsx)("", className2) }, children2, modelFormLoading ? /* @__PURE__ */ import_react.default.createElement("div", { className: "bg-base-100/50 absolute inset-0 animate-pulse" }) : null);
72
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_client.clsx)("", className2), children: [
73
+ children2,
74
+ modelFormLoading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "bg-base-100/50 absolute inset-0 animate-pulse" }) : null
75
+ ] });
82
76
  };
83
77
  }, []);
84
- return /* @__PURE__ */ import_react.default.createElement(LoadingWrapper, { className: (0, import_client.clsx)("w-full", className) }, children);
78
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LoadingWrapper, { className: (0, import_client.clsx)("w-full", className), children });
85
79
  };
86
80
  function EditModal({
87
81
  type = "modal",
@@ -172,10 +166,10 @@ function EditModal({
172
166
  const Title = () => {
173
167
  const modelFormLoading2 = storeUse[names.modelFormLoading]();
174
168
  const modelForm = storeUse[names.modelForm]();
175
- return modelFormLoading2 ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null) : renderTitle ? typeof renderTitle === "string" ? `${l(`${modelName}.modelName`)}${renderTitle === "default" ? "" : ` - ${modelForm[renderTitle]}`}` : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, renderTitle(modelForm)) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null);
169
+ return modelFormLoading2 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {}) : renderTitle ? typeof renderTitle === "string" ? `${l(`${modelName}.modelName`)}${renderTitle === "default" ? "" : ` - ${modelForm[renderTitle]}`}` : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: renderTitle(modelForm) }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {});
176
170
  };
177
171
  const Submit = (0, import_react.useMemo)(
178
- () => renderSubmit === false ? () => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null) : typeof renderSubmit === "function" ? () => renderSubmit(storeUse[names.modelForm]()) : () => {
172
+ () => renderSubmit === false ? () => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, {}) : typeof renderSubmit === "function" ? () => renderSubmit(storeUse[names.modelForm]()) : () => {
179
173
  const modelSubmit = storeUse[names.modelSubmit]();
180
174
  const handleSubmit = (0, import_react.useCallback)(async ({ onError } = {}) => {
181
175
  await storeDo[names.submitModel]({
@@ -191,7 +185,7 @@ function EditModal({
191
185
  else if (typeof onSubmit === "string")
192
186
  import_client.router.replace(onSubmit);
193
187
  }, []);
194
- return /* @__PURE__ */ import_react.default.createElement(
188
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
195
189
  import_Button.Button,
196
190
  {
197
191
  className: "btn btn-primary w-full gap-2 rounded-2xl",
@@ -200,18 +194,20 @@ function EditModal({
200
194
  await handleSubmit({ onError });
201
195
  },
202
196
  onSuccess: () => {
203
- }
204
- },
205
- modelFormId ? /* @__PURE__ */ import_react.default.createElement(import_ai.AiOutlineSave, null) : /* @__PURE__ */ import_react.default.createElement(import_ai.AiOutlinePlus, null),
206
- l(modelFormId ? "shared.updateModel" : "shared.createModel", {
207
- model: l.field(names.model, "modelName")
208
- })
197
+ },
198
+ children: [
199
+ modelFormId ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlineSave, {}) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlinePlus, {}),
200
+ l(modelFormId ? "shared.updateModel" : "shared.createModel", {
201
+ model: l.field(names.model, "modelName")
202
+ })
203
+ ]
204
+ }
209
205
  );
210
206
  },
211
207
  [disabled, modelFormId]
212
208
  );
213
209
  if (type === "modal")
214
- return /* @__PURE__ */ import_react.default.createElement(
210
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
215
211
  import_Modal.Modal,
216
212
  {
217
213
  open: isModalOpen,
@@ -219,25 +215,25 @@ function EditModal({
219
215
  handleCancel();
220
216
  },
221
217
  className: modalClassName,
222
- title: /* @__PURE__ */ import_react.default.createElement(Title, null),
223
- action: /* @__PURE__ */ import_react.default.createElement(Submit, null)
224
- },
225
- isModalOpen ? /* @__PURE__ */ import_react.default.createElement(
226
- EditModel,
227
- {
228
- type,
229
- sliceName,
230
- className,
231
- checkSubmit,
232
- edit,
233
- modal,
234
- loadingWrapper
235
- },
236
- children
237
- ) : null
218
+ title: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Title, {}),
219
+ action: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Submit, {}),
220
+ children: isModalOpen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
221
+ EditModel,
222
+ {
223
+ type,
224
+ sliceName,
225
+ className,
226
+ checkSubmit,
227
+ edit,
228
+ modal,
229
+ loadingWrapper,
230
+ children
231
+ }
232
+ ) : null
233
+ }
238
234
  );
239
235
  else if (isModalOpen)
240
- return /* @__PURE__ */ import_react.default.createElement(
236
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
241
237
  EditModel,
242
238
  {
243
239
  type,
@@ -246,10 +242,12 @@ function EditModal({
246
242
  checkSubmit,
247
243
  edit,
248
244
  modal,
249
- loadingWrapper
250
- },
251
- /* @__PURE__ */ import_react.default.createElement(Title, null),
252
- children,
253
- type === "form" ? /* @__PURE__ */ import_react.default.createElement("div", { className: "mt-4" }, /* @__PURE__ */ import_react.default.createElement(Submit, null)) : null
245
+ loadingWrapper,
246
+ children: [
247
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Title, {}),
248
+ children,
249
+ type === "form" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mt-4", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Submit, {}) }) : null
250
+ ]
251
+ }
254
252
  );
255
253
  }
@@ -21,6 +21,7 @@ __export(EditWrapper_exports, {
21
21
  default: () => EditWrapper
22
22
  });
23
23
  module.exports = __toCommonJS(EditWrapper_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
24
25
  var import_client = require("@akanjs/client");
25
26
  var import_common = require("@akanjs/common");
26
27
  var import_store = require("@akanjs/store");
@@ -31,7 +32,7 @@ function EditWrapper({ children, sliceName, modelId, className, modal, resets })
31
32
  editModel: `edit${(0, import_common.capitalize)(modelName)}`
32
33
  };
33
34
  const storeDo = import_store.st.do;
34
- return /* @__PURE__ */ React.createElement(
35
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
35
36
  "div",
36
37
  {
37
38
  className: (0, import_client.clsx)("cursor-pointer", className),
@@ -41,8 +42,8 @@ function EditWrapper({ children, sliceName, modelId, className, modal, resets })
41
42
  resets?.forEach((reset) => {
42
43
  void storeDo[`reset${(0, import_common.capitalize)(reset)}`]();
43
44
  });
44
- }
45
- },
46
- children
45
+ },
46
+ children
47
+ }
47
48
  );
48
49
  }
@@ -21,7 +21,8 @@ __export(LoadInit_exports, {
21
21
  default: () => LoadInit
22
22
  });
23
23
  module.exports = __toCommonJS(LoadInit_exports);
24
+ var import_jsx_runtime = require("react/jsx-runtime");
24
25
  var import_Load = require("../Load");
25
26
  function LoadInit({ init }) {
26
- return /* @__PURE__ */ React.createElement(import_Load.Load.Units, { init, renderList: () => null, loading: null, renderEmpty: null });
27
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Load.Load.Units, { init, renderList: () => null, loading: null, renderEmpty: null });
27
28
  }
package/cjs/Model/New.js CHANGED
@@ -30,6 +30,7 @@ __export(New_exports, {
30
30
  default: () => New
31
31
  });
32
32
  module.exports = __toCommonJS(New_exports);
33
+ var import_jsx_runtime = require("react/jsx-runtime");
33
34
  var import_client = require("@akanjs/client");
34
35
  var import_next = require("@akanjs/next");
35
36
  var import_ai = require("react-icons/ai");
@@ -46,16 +47,21 @@ function New({
46
47
  renderTitle
47
48
  }) {
48
49
  const { l } = (0, import_next.usePage)();
49
- return /* @__PURE__ */ React.createElement("div", { className: (0, import_client.clsx)("inline", wrapperClassName) }, /* @__PURE__ */ React.createElement(
50
- import_NewWrapper.default,
51
- {
52
- className: (0, import_client.clsx)("flex w-full items-center justify-center gap-2", className),
53
- sliceName,
54
- modal,
55
- partial
56
- },
57
- /* @__PURE__ */ React.createElement(import_ai.AiOutlinePlus, null),
58
- " ",
59
- type === "button" ? l("shared.new") : null
60
- ), /* @__PURE__ */ React.createElement(import_EditModal.default, { renderTitle, sliceName }, children));
50
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: (0, import_client.clsx)("inline", wrapperClassName), children: [
51
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
52
+ import_NewWrapper.default,
53
+ {
54
+ className: (0, import_client.clsx)("flex w-full items-center justify-center gap-2", className),
55
+ sliceName,
56
+ modal,
57
+ partial,
58
+ children: [
59
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ai.AiOutlinePlus, {}),
60
+ " ",
61
+ type === "button" ? l("shared.new") : null
62
+ ]
63
+ }
64
+ ),
65
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_EditModal.default, { renderTitle, sliceName, children })
66
+ ] });
61
67
  }
@@ -20,9 +20,10 @@ __export(NewWrapper_exports, {
20
20
  default: () => NewWrapper
21
21
  });
22
22
  module.exports = __toCommonJS(NewWrapper_exports);
23
+ var import_jsx_runtime = require("react/jsx-runtime");
23
24
  var import_common = require("@akanjs/common");
24
25
  var import_NewWrapper_Client = require("./NewWrapper_Client");
25
26
  function NewWrapper({ partial = {}, ...props }) {
26
27
  const serializedPartial = (0, import_common.deepObjectify)(typeof partial === "function" ? partial() : partial, { serializable: true });
27
- return /* @__PURE__ */ React.createElement(import_NewWrapper_Client.NewWrapper_Client, { ...props, partial: serializedPartial });
28
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_NewWrapper_Client.NewWrapper_Client, { ...props, partial: serializedPartial });
28
29
  }