fuma 2.0.50 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/dist/action/index.d.ts +2 -5
  2. package/dist/action/index.js +2 -5
  3. package/dist/action/list/handlers.d.ts +6 -6
  4. package/dist/action/list/handlers.js +6 -5
  5. package/dist/action/list/index.d.ts +1 -1
  6. package/dist/action/list/index.js +11 -5
  7. package/dist/action/list/trigger.js +6 -2
  8. package/dist/action/list/utils.js +1 -1
  9. package/dist/action/tip.js +2 -2
  10. package/dist/command/command.svelte.d.ts +16 -0
  11. package/dist/command/command.svelte.js +68 -0
  12. package/dist/command/index.d.ts +1 -0
  13. package/dist/command/index.js +1 -0
  14. package/dist/data.d.ts +87 -0
  15. package/dist/data.js +51 -0
  16. package/dist/index.d.ts +5 -5
  17. package/dist/index.js +5 -5
  18. package/dist/input/InputBoolean.svelte +107 -0
  19. package/dist/input/InputBoolean.svelte.d.ts +12 -0
  20. package/dist/input/InputNumber.svelte +33 -0
  21. package/dist/input/InputNumber.svelte.d.ts +10 -0
  22. package/dist/input/InputRadio.svelte +56 -0
  23. package/dist/input/InputRadio.svelte.d.ts +11 -0
  24. package/dist/input/InputRange.svelte +30 -0
  25. package/dist/input/InputRange.svelte.d.ts +10 -0
  26. package/dist/input/InputRelation.svelte +119 -0
  27. package/dist/input/InputRelation.svelte.d.ts +39 -0
  28. package/dist/input/InputSelect.svelte +113 -0
  29. package/dist/input/InputSelect.svelte.d.ts +37 -0
  30. package/dist/input/InputSelectNative.svelte +56 -0
  31. package/dist/input/InputSelectNative.svelte.d.ts +12 -0
  32. package/dist/input/InputString.svelte +48 -0
  33. package/dist/input/InputString.svelte.d.ts +11 -0
  34. package/dist/input/InputTextarea.svelte +47 -0
  35. package/dist/input/InputTextarea.svelte.d.ts +11 -0
  36. package/dist/input/Issues.svelte +21 -0
  37. package/dist/input/Issues.svelte.d.ts +7 -0
  38. package/dist/input/index.d.ts +11 -0
  39. package/dist/input/index.js +10 -0
  40. package/dist/input/type.d.ts +5 -0
  41. package/dist/input/type.js +1 -0
  42. package/dist/popover/Popover.svelte +50 -0
  43. package/dist/popover/index.d.ts +2 -0
  44. package/dist/popover/index.js +2 -0
  45. package/dist/popover/popover.svelte.d.ts +26 -0
  46. package/dist/popover/popover.svelte.js +101 -0
  47. package/dist/remote/useForm.d.ts +6 -0
  48. package/dist/remote/useForm.js +22 -0
  49. package/dist/search/Spans.svelte +15 -0
  50. package/dist/search/Spans.svelte.d.ts +7 -0
  51. package/dist/search/index.d.ts +2 -0
  52. package/dist/search/index.js +2 -0
  53. package/dist/search/search.js +96 -0
  54. package/dist/server/index.d.ts +0 -4
  55. package/dist/server/index.js +0 -4
  56. package/dist/server/parseQuery.js +1 -1
  57. package/dist/server/sse.js +4 -4
  58. package/dist/server/table.js +1 -1
  59. package/dist/state/index.d.ts +1 -0
  60. package/dist/state/index.js +1 -0
  61. package/dist/state/param.svelte.d.ts +18 -0
  62. package/dist/state/param.svelte.js +66 -0
  63. package/dist/ui/button/ButtonDelete.svelte +49 -28
  64. package/dist/ui/button/ButtonDelete.svelte.d.ts +12 -31
  65. package/dist/ui/button/index.d.ts +0 -1
  66. package/dist/ui/button/index.js +0 -1
  67. package/dist/ui/copy/ButtonCopy.svelte +43 -0
  68. package/dist/ui/copy/ButtonCopy.svelte.d.ts +17 -0
  69. package/dist/ui/copy/index.d.ts +2 -0
  70. package/dist/ui/copy/index.js +2 -0
  71. package/dist/ui/copy/useCopy.svelte.d.ts +10 -0
  72. package/dist/ui/copy/useCopy.svelte.js +36 -0
  73. package/dist/ui/dialog/Dialog.svelte +56 -26
  74. package/dist/ui/dialog/Dialog.svelte.d.ts +14 -35
  75. package/dist/ui/dialog/index.d.ts +0 -1
  76. package/dist/ui/dialog/index.js +0 -1
  77. package/dist/ui/drawer/Drawer.svelte +53 -45
  78. package/dist/ui/drawer/Drawer.svelte.d.ts +8 -63
  79. package/dist/ui/drawer/drawerFly.js +1 -1
  80. package/dist/ui/drawer/useLayer.svelte.d.ts +5 -0
  81. package/dist/ui/drawer/useLayer.svelte.js +33 -0
  82. package/dist/ui/index.d.ts +4 -12
  83. package/dist/ui/index.js +4 -12
  84. package/dist/ui/menu/ContextMenu.svelte +27 -26
  85. package/dist/ui/menu/ContextMenu.svelte.d.ts +9 -35
  86. package/dist/ui/menu/DropDown.svelte +44 -26
  87. package/dist/ui/menu/DropDown.svelte.d.ts +18 -43
  88. package/dist/ui/menu/DropDownMenu.svelte +51 -41
  89. package/dist/ui/menu/DropDownMenu.svelte.d.ts +7 -29
  90. package/dist/ui/menu/dropdown.css +4 -4
  91. package/dist/ui/menu/index.d.ts +1 -1
  92. package/dist/ui/menu/index.js +2 -1
  93. package/dist/ui/mode/ToggleMode.svelte +25 -14
  94. package/dist/ui/mode/ToggleMode.svelte.d.ts +10 -35
  95. package/dist/ui/mode/index.d.ts +1 -1
  96. package/dist/ui/mode/index.js +1 -1
  97. package/dist/ui/mode/useMode.svelte.d.ts +8 -0
  98. package/dist/ui/mode/useMode.svelte.js +40 -0
  99. package/dist/ui/pagination/Pagination.svelte +18 -14
  100. package/dist/ui/pagination/Pagination.svelte.d.ts +4 -18
  101. package/dist/ui/range/RangePicker.svelte +3 -2
  102. package/dist/ui/range/RangePickerButton.svelte +49 -37
  103. package/dist/ui/range/RangePickerButton.svelte.d.ts +7 -21
  104. package/dist/ui/range/index.d.ts +1 -1
  105. package/dist/ui/range/index.js +1 -1
  106. package/dist/ui/table/Table.svelte +15 -21
  107. package/dist/ui/table/Table.svelte.d.ts +1 -1
  108. package/dist/ui/table/TableBody.svelte +1 -1
  109. package/dist/ui/table/TableBody.svelte.d.ts +1 -1
  110. package/dist/ui/table/TableFieldsEdition.svelte +90 -78
  111. package/dist/ui/table/TableFieldsEdition.svelte.d.ts +14 -13
  112. package/dist/ui/table/TableHead.svelte +1 -1
  113. package/dist/ui/table/TableViewSelect.svelte +69 -69
  114. package/dist/ui/table/TableViewSelect.svelte.d.ts +10 -23
  115. package/dist/ui/table/cell/TableCellArray.svelte +1 -1
  116. package/dist/ui/table/cell/TableCellBoolean.svelte +3 -4
  117. package/dist/ui/table/cell/index.d.ts +1 -1
  118. package/dist/ui/table/cell/index.js +1 -1
  119. package/dist/ui/table/head/OrderButtons.svelte +18 -13
  120. package/dist/ui/table/head/OrderButtons.svelte.d.ts +11 -23
  121. package/dist/ui/table/head/TableHeadBoolean.svelte +3 -3
  122. package/dist/ui/table/head/TableHeadDate.svelte +41 -53
  123. package/dist/ui/table/head/TableHeadDate.svelte.d.ts +1 -1
  124. package/dist/ui/table/head/TableHeadDefault.svelte +2 -1
  125. package/dist/ui/table/head/TableHeadNumber.svelte +94 -108
  126. package/dist/ui/table/head/TableHeadNumber.svelte.d.ts +13 -10
  127. package/dist/ui/table/head/TableHeadSelect.svelte +55 -52
  128. package/dist/ui/table/head/TableHeadSelect.svelte.d.ts +13 -10
  129. package/dist/ui/table/head/TableHeadString.svelte +28 -34
  130. package/dist/ui/table/head/index.d.ts +3 -3
  131. package/dist/ui/table/head/index.js +3 -3
  132. package/dist/ui/table/index.d.ts +5 -5
  133. package/dist/ui/table/index.js +4 -5
  134. package/dist/utils/csv.js +1 -1
  135. package/dist/utils/eventEmitter.d.ts +2 -2
  136. package/dist/utils/eventEmitter.js +18 -11
  137. package/dist/utils/index.d.ts +4 -6
  138. package/dist/utils/index.js +4 -6
  139. package/dist/utils/normalizePath.js +1 -1
  140. package/dist/utils/options.d.ts +6 -5
  141. package/dist/utils/options.js +3 -2
  142. package/dist/utils/tippy.d.ts +1 -1
  143. package/dist/utils/tippy.js +1 -1
  144. package/dist/validation/index.d.ts +0 -1
  145. package/dist/validation/index.js +0 -1
  146. package/dist/validation/zod.d.ts +12 -393
  147. package/dist/validation/zod.js +22 -82
  148. package/package.json +111 -134
  149. package/dist/action/heightScreen.d.ts +0 -10
  150. package/dist/action/heightScreen.js +0 -24
  151. package/dist/action/portal.d.ts +0 -3
  152. package/dist/action/portal.js +0 -9
  153. package/dist/action/selector.d.ts +0 -15
  154. package/dist/action/selector.js +0 -71
  155. package/dist/api/client.d.ts +0 -3
  156. package/dist/api/client.js +0 -24
  157. package/dist/api/config.d.ts +0 -46
  158. package/dist/api/config.js +0 -7
  159. package/dist/api/index.d.ts +0 -3
  160. package/dist/api/index.js +0 -3
  161. package/dist/api/server.d.ts +0 -11
  162. package/dist/api/server.js +0 -17
  163. package/dist/private/Meta.svelte +0 -16
  164. package/dist/private/Meta.svelte.d.ts +0 -30
  165. package/dist/private/api.d.ts +0 -61
  166. package/dist/private/api.js +0 -10
  167. package/dist/private/constant.d.ts +0 -14
  168. package/dist/private/constant.js +0 -6
  169. package/dist/private/model.d.ts +0 -70
  170. package/dist/private/model.js +0 -25
  171. package/dist/private/prisma.d.ts +0 -2
  172. package/dist/private/prisma.js +0 -2
  173. package/dist/private/store.d.ts +0 -1
  174. package/dist/private/store.js +0 -2
  175. package/dist/server/auth.d.ts +0 -12
  176. package/dist/server/auth.js +0 -15
  177. package/dist/server/formAction.d.ts +0 -13
  178. package/dist/server/formAction.js +0 -8
  179. package/dist/server/json.d.ts +0 -1
  180. package/dist/server/json.js +0 -16
  181. package/dist/server/parseFormData.d.ts +0 -10
  182. package/dist/server/parseFormData.js +0 -85
  183. package/dist/server/try.d.ts +0 -9
  184. package/dist/server/try.js +0 -41
  185. package/dist/store/index.d.ts +0 -2
  186. package/dist/store/index.js +0 -2
  187. package/dist/store/isSmallScreen.d.ts +0 -1
  188. package/dist/store/isSmallScreen.js +0 -14
  189. package/dist/store/param.d.ts +0 -22
  190. package/dist/store/param.js +0 -61
  191. package/dist/store/session.d.ts +0 -1
  192. package/dist/store/session.js +0 -13
  193. package/dist/ui/badge/Badge.svelte +0 -9
  194. package/dist/ui/badge/Badge.svelte.d.ts +0 -21
  195. package/dist/ui/badge/index.d.ts +0 -1
  196. package/dist/ui/badge/index.js +0 -1
  197. package/dist/ui/button/ButtonCopy.svelte +0 -59
  198. package/dist/ui/button/ButtonCopy.svelte.d.ts +0 -27
  199. package/dist/ui/card/Card.svelte +0 -43
  200. package/dist/ui/card/Card.svelte.d.ts +0 -41
  201. package/dist/ui/card/CardBasic.svelte +0 -15
  202. package/dist/ui/card/CardBasic.svelte.d.ts +0 -31
  203. package/dist/ui/card/CardCollapse.svelte +0 -71
  204. package/dist/ui/card/CardCollapse.svelte.d.ts +0 -39
  205. package/dist/ui/card/CardFullScreen.svelte +0 -31
  206. package/dist/ui/card/CardFullScreen.svelte.d.ts +0 -38
  207. package/dist/ui/card/CardLink.svelte +0 -22
  208. package/dist/ui/card/CardLink.svelte.d.ts +0 -31
  209. package/dist/ui/card/index.d.ts +0 -5
  210. package/dist/ui/card/index.js +0 -5
  211. package/dist/ui/context.d.ts +0 -6
  212. package/dist/ui/context.js +0 -12
  213. package/dist/ui/dialog/DialogConfirm.svelte +0 -24
  214. package/dist/ui/dialog/DialogConfirm.svelte.d.ts +0 -35
  215. package/dist/ui/drawer/layers.d.ts +0 -7
  216. package/dist/ui/drawer/layers.js +0 -68
  217. package/dist/ui/form/Form.svelte +0 -168
  218. package/dist/ui/form/Form.svelte.d.ts +0 -62
  219. package/dist/ui/form/FormInput.svelte +0 -15
  220. package/dist/ui/form/FormSection.svelte +0 -78
  221. package/dist/ui/form/FormSection.svelte.d.ts +0 -39
  222. package/dist/ui/form/form.d.ts +0 -37
  223. package/dist/ui/form/form.js +0 -57
  224. package/dist/ui/form/formInput.js +0 -33
  225. package/dist/ui/form/index.d.ts +0 -3
  226. package/dist/ui/form/index.js +0 -3
  227. package/dist/ui/icon/Icon.svelte +0 -53
  228. package/dist/ui/icon/Icon.svelte.d.ts +0 -29
  229. package/dist/ui/icon/index.d.ts +0 -1
  230. package/dist/ui/icon/index.js +0 -1
  231. package/dist/ui/input/FormControl.svelte +0 -77
  232. package/dist/ui/input/FormControl.svelte.d.ts +0 -34
  233. package/dist/ui/input/InputBoolean.svelte +0 -33
  234. package/dist/ui/input/InputBoolean.svelte.d.ts +0 -46
  235. package/dist/ui/input/InputCheckboxs.svelte +0 -71
  236. package/dist/ui/input/InputCheckboxs.svelte.d.ts +0 -57
  237. package/dist/ui/input/InputCheckboxsMenu.svelte +0 -106
  238. package/dist/ui/input/InputCheckboxsMenu.svelte.d.ts +0 -59
  239. package/dist/ui/input/InputCheckboxsTree.svelte +0 -18
  240. package/dist/ui/input/InputCheckboxsTree.svelte.d.ts +0 -25
  241. package/dist/ui/input/InputCheckboxsTreeNodes.svelte +0 -68
  242. package/dist/ui/input/InputCheckboxsTreeNodes.svelte.d.ts +0 -27
  243. package/dist/ui/input/InputCombo.svelte +0 -99
  244. package/dist/ui/input/InputCombo.svelte.d.ts +0 -59
  245. package/dist/ui/input/InputDate.svelte +0 -47
  246. package/dist/ui/input/InputDate.svelte.d.ts +0 -46
  247. package/dist/ui/input/InputDateTime.svelte +0 -41
  248. package/dist/ui/input/InputDateTime.svelte.d.ts +0 -23
  249. package/dist/ui/input/InputImage.svelte +0 -116
  250. package/dist/ui/input/InputImage.svelte.d.ts +0 -48
  251. package/dist/ui/input/InputImagePreview.svelte +0 -60
  252. package/dist/ui/input/InputImagePreview.svelte.d.ts +0 -27
  253. package/dist/ui/input/InputNumber.svelte +0 -31
  254. package/dist/ui/input/InputNumber.svelte.d.ts +0 -23
  255. package/dist/ui/input/InputOptionInParam.svelte +0 -36
  256. package/dist/ui/input/InputOptionInParam.svelte.d.ts +0 -24
  257. package/dist/ui/input/InputOptions.svelte +0 -85
  258. package/dist/ui/input/InputOptions.svelte.d.ts +0 -21
  259. package/dist/ui/input/InputPassword.svelte +0 -25
  260. package/dist/ui/input/InputPassword.svelte.d.ts +0 -45
  261. package/dist/ui/input/InputRadio.svelte +0 -84
  262. package/dist/ui/input/InputRadio.svelte.d.ts +0 -56
  263. package/dist/ui/input/InputRelation.svelte +0 -171
  264. package/dist/ui/input/InputRelation.svelte.d.ts +0 -76
  265. package/dist/ui/input/InputRelations.svelte +0 -166
  266. package/dist/ui/input/InputRelations.svelte.d.ts +0 -55
  267. package/dist/ui/input/InputSearch.svelte +0 -59
  268. package/dist/ui/input/InputSearch.svelte.d.ts +0 -29
  269. package/dist/ui/input/InputSelect.svelte +0 -84
  270. package/dist/ui/input/InputSelect.svelte.d.ts +0 -29
  271. package/dist/ui/input/InputText.svelte +0 -46
  272. package/dist/ui/input/InputText.svelte.d.ts +0 -30
  273. package/dist/ui/input/InputTextarea.svelte +0 -23
  274. package/dist/ui/input/InputTextarea.svelte.d.ts +0 -23
  275. package/dist/ui/input/InputTime.svelte +0 -47
  276. package/dist/ui/input/InputTime.svelte.d.ts +0 -46
  277. package/dist/ui/input/RelationAfter.svelte +0 -34
  278. package/dist/ui/input/RelationAfter.svelte.d.ts +0 -26
  279. package/dist/ui/input/SelectorList.svelte +0 -50
  280. package/dist/ui/input/SelectorList.svelte.d.ts +0 -49
  281. package/dist/ui/input/action.d.ts +0 -13
  282. package/dist/ui/input/action.js +0 -56
  283. package/dist/ui/input/index.d.ts +0 -26
  284. package/dist/ui/input/index.js +0 -26
  285. package/dist/ui/input/textRich/InputTextRich.svelte +0 -72
  286. package/dist/ui/input/textRich/InputTextRich.svelte.d.ts +0 -48
  287. package/dist/ui/input/textRich/SuggesionList.svelte +0 -25
  288. package/dist/ui/input/textRich/SuggesionList.svelte.d.ts +0 -23
  289. package/dist/ui/input/textRich/ToolMark.svelte +0 -22
  290. package/dist/ui/input/textRich/ToolMark.svelte.d.ts +0 -25
  291. package/dist/ui/input/textRich/ToolMarkColor.svelte +0 -36
  292. package/dist/ui/input/textRich/ToolMarkColor.svelte.d.ts +0 -23
  293. package/dist/ui/input/textRich/ToolMarkLink.svelte +0 -72
  294. package/dist/ui/input/textRich/ToolMarkLink.svelte.d.ts +0 -21
  295. package/dist/ui/input/textRich/ToolMenu.svelte +0 -66
  296. package/dist/ui/input/textRich/ToolMenu.svelte.d.ts +0 -33
  297. package/dist/ui/input/textRich/ToolMenuAlign.svelte +0 -50
  298. package/dist/ui/input/textRich/ToolMenuAlign.svelte.d.ts +0 -21
  299. package/dist/ui/input/textRich/ToolMenuInsert.svelte +0 -54
  300. package/dist/ui/input/textRich/ToolMenuInsert.svelte.d.ts +0 -23
  301. package/dist/ui/input/textRich/ToolMenuNode.svelte +0 -60
  302. package/dist/ui/input/textRich/ToolMenuNode.svelte.d.ts +0 -21
  303. package/dist/ui/input/textRich/ToolsBar.svelte +0 -61
  304. package/dist/ui/input/textRich/ToolsBar.svelte.d.ts +0 -24
  305. package/dist/ui/input/textRich/extensions.d.ts +0 -2
  306. package/dist/ui/input/textRich/extensions.js +0 -62
  307. package/dist/ui/input/textRich/indent.d.ts +0 -13
  308. package/dist/ui/input/textRich/indent.js +0 -112
  309. package/dist/ui/input/textRich/index.d.ts +0 -3
  310. package/dist/ui/input/textRich/index.js +0 -3
  311. package/dist/ui/input/textRich/suggestion.d.ts +0 -7
  312. package/dist/ui/input/textRich/suggestion.js +0 -55
  313. package/dist/ui/input/textRich/tiptapParser.d.ts +0 -4
  314. package/dist/ui/input/textRich/tiptapParser.js +0 -29
  315. package/dist/ui/input/types.d.ts +0 -15
  316. package/dist/ui/input/types.js +0 -1
  317. package/dist/ui/login/Login.svelte +0 -99
  318. package/dist/ui/login/Login.svelte.d.ts +0 -20
  319. package/dist/ui/login/index.d.ts +0 -1
  320. package/dist/ui/login/index.js +0 -1
  321. package/dist/ui/placeholder/Placeholder.svelte +0 -12
  322. package/dist/ui/placeholder/Placeholder.svelte.d.ts +0 -30
  323. package/dist/ui/placeholder/PlaceholderImage.svelte +0 -16
  324. package/dist/ui/placeholder/PlaceholderImage.svelte.d.ts +0 -30
  325. package/dist/ui/placeholder/index.d.ts +0 -2
  326. package/dist/ui/placeholder/index.js +0 -2
  327. package/dist/ui/tabs/Tabs.svelte +0 -32
  328. package/dist/ui/tabs/Tabs.svelte.d.ts +0 -22
  329. package/dist/ui/tabs/TabsIcon.svelte +0 -60
  330. package/dist/ui/tabs/TabsIcon.svelte.d.ts +0 -24
  331. package/dist/ui/tabs/index.d.ts +0 -8
  332. package/dist/ui/tabs/index.js +0 -2
  333. package/dist/utils/avatar.d.ts +0 -1
  334. package/dist/utils/avatar.js +0 -5
  335. package/dist/utils/component.d.ts +0 -6
  336. package/dist/utils/component.js +0 -3
  337. package/dist/validation/form.d.ts +0 -34
  338. package/dist/validation/form.js +0 -103
@@ -4,12 +4,13 @@ export function createEventEmitter() {
4
4
  on(eventKey, callback) {
5
5
  if (!events[eventKey])
6
6
  events[eventKey] = [];
7
- events[eventKey].push(callback);
7
+ events[eventKey]?.push(callback);
8
8
  return function unsubscribe() {
9
9
  if (!events[eventKey])
10
10
  events[eventKey] = [];
11
- const index = events[eventKey].indexOf(callback);
12
- events[eventKey].splice(index, 1);
11
+ const index = events[eventKey]?.indexOf(callback);
12
+ if (index !== undefined && index > -1)
13
+ events[eventKey]?.splice(index, 1);
13
14
  };
14
15
  },
15
16
  once(eventKey, callback) {
@@ -17,22 +18,25 @@ export function createEventEmitter() {
17
18
  events[eventKey] = [];
18
19
  const _callback = (arg) => {
19
20
  callback(arg);
20
- const index = events[eventKey].indexOf(callback);
21
- events[eventKey].splice(index, 1);
21
+ const index = events[eventKey]?.indexOf(callback);
22
+ if (index !== undefined && index > -1)
23
+ events[eventKey]?.splice(index, 1);
22
24
  };
23
- events[eventKey].push(_callback);
25
+ events[eventKey]?.push(_callback);
24
26
  return function unsubscribe() {
25
27
  if (!events[eventKey])
26
28
  events[eventKey] = [];
27
- const index = events[eventKey].indexOf(callback);
28
- events[eventKey].splice(index, 1);
29
+ const index = events[eventKey]?.indexOf(callback);
30
+ if (index !== undefined && index > -1)
31
+ events[eventKey]?.splice(index, 1);
29
32
  };
30
33
  },
31
34
  off(eventKey, callback) {
32
35
  if (!events[eventKey])
33
36
  events[eventKey] = [];
34
- const index = events[eventKey].indexOf(callback);
35
- events[eventKey].splice(index, 1);
37
+ const index = events[eventKey]?.indexOf(callback);
38
+ if (index !== undefined && index > -1)
39
+ events[eventKey]?.splice(index, 1);
36
40
  },
37
41
  clean(eventKey) {
38
42
  events[eventKey] = [];
@@ -40,7 +44,10 @@ export function createEventEmitter() {
40
44
  emit(...args) {
41
45
  if (!events[args[0]])
42
46
  events[args[0]] = [];
43
- events[args[0]].forEach((callback) => callback(args[1]));
47
+ const param = args[1];
48
+ events[args[0]]?.forEach((callback) => {
49
+ callback(param);
50
+ });
44
51
  }
45
52
  };
46
53
  }
@@ -1,10 +1,8 @@
1
- export * from './component.js';
1
+ export * from './constant.js';
2
+ export * from './csv.js';
3
+ export * from './eventEmitter.js';
2
4
  export * from './jsonParse.js';
5
+ export * from './nestedPaths.js';
3
6
  export * from './normalizePath.js';
4
7
  export * from './options.js';
5
- export * from './avatar.js';
6
8
  export * from './tippy.js';
7
- export * from './nestedPaths.js';
8
- export * from './constant.js';
9
- export * from './csv.js';
10
- export * from './eventEmitter.js';
@@ -1,10 +1,8 @@
1
- export * from './component.js';
1
+ export * from './constant.js';
2
+ export * from './csv.js';
3
+ export * from './eventEmitter.js';
2
4
  export * from './jsonParse.js';
5
+ export * from './nestedPaths.js';
3
6
  export * from './normalizePath.js';
4
7
  export * from './options.js';
5
- export * from './avatar.js';
6
8
  export * from './tippy.js';
7
- export * from './nestedPaths.js';
8
- export * from './constant.js';
9
- export * from './csv.js';
10
- export * from './eventEmitter.js';
@@ -6,6 +6,6 @@ export function normalizePath(str) {
6
6
  .normalize('NFD')
7
7
  .replace(/[\u0300-\u036f]/g, '')
8
8
  .replaceAll(' ', '-')
9
- .replace(/[\.\:\/\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=]/g, '')
9
+ .replace(/[.:/?#[\]@!$&'()*+,;=]/g, '')
10
10
  .toLowerCase();
11
11
  }
@@ -1,10 +1,11 @@
1
- import type { Snippet } from 'svelte';
1
+ import type { IconProps } from '@lucide/svelte';
2
+ import type { Component } from 'svelte';
3
+ import type { InputProps } from '../input/type.ts';
2
4
  export type Option = {
3
5
  value: string;
4
6
  label: string;
5
- icon?: string | Snippet;
6
- disable?: boolean;
7
- };
7
+ icon?: Component<IconProps>;
8
+ } & Omit<InputProps, 'id'>;
8
9
  export type OptionRecord<Values extends string> = Record<Values, Omit<Option, 'value'>>;
9
- export type Options = string | string[] | Option[] | Record<string, string> | OptionRecord<string>;
10
+ export type Options = string | readonly string[] | readonly Option[] | Record<string, string> | OptionRecord<string>;
10
11
  export declare function parseOptions(options: Options): Option[];
@@ -1,7 +1,8 @@
1
- import { jsonParse } from './jsonParse.js';
1
+ import z from 'zod';
2
+ import { zodCoerceJsonValue } from '../validation/zod.ts';
2
3
  export function parseOptions(options) {
3
4
  if (typeof options === 'string') {
4
- options = jsonParse(options, []);
5
+ options = zodCoerceJsonValue.pipe(z.array(z.string())).default([]).parse(options);
5
6
  }
6
7
  if (Array.isArray(options)) {
7
8
  return options.filter(Boolean).map((opt) => {
@@ -1,5 +1,5 @@
1
1
  import 'tippy.js/dist/tippy.css';
2
- import { type Tippy, type Props as TippyProps, type Instance as TippyInstance, hideAll, delegate, createSingleton, animateFill, followCursor, inlinePositioning, sticky, roundArrow } from 'tippy.js';
2
+ import { animateFill, createSingleton, delegate, followCursor, hideAll, inlinePositioning, roundArrow, sticky, type Tippy, type Instance as TippyInstance, type Props as TippyProps } from 'tippy.js';
3
3
  export declare const tippy: Tippy;
4
4
  export type { TippyProps, TippyInstance };
5
5
  export { hideAll, delegate, createSingleton, animateFill, followCursor, inlinePositioning, sticky, roundArrow };
@@ -1,4 +1,4 @@
1
1
  import 'tippy.js/dist/tippy.css';
2
- import tippyBadTyped, { hideAll, delegate, createSingleton, animateFill, followCursor, inlinePositioning, sticky, roundArrow } from 'tippy.js';
2
+ import tippyBadTyped, { animateFill, createSingleton, delegate, followCursor, hideAll, inlinePositioning, roundArrow, sticky } from 'tippy.js';
3
3
  export const tippy = tippyBadTyped;
4
4
  export { hideAll, delegate, createSingleton, animateFill, followCursor, inlinePositioning, sticky, roundArrow };
@@ -1,2 +1 @@
1
- export * from './form.js';
2
1
  export * from './zod.js';
@@ -1,2 +1 @@
1
- export * from './form.js';
2
1
  export * from './zod.js';
@@ -1,394 +1,13 @@
1
- import zod from 'zod';
2
- declare function json<T extends zod.ZodRawShape>(shap: T): zod.ZodUnion<readonly [zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>, zod.ZodPipe<zod.ZodPipe<zod.ZodString, zod.ZodTransform<zod.z.core.$RefinementCtx<string>, string>>, zod.z.core.$ZodType<any, zod.z.core.$RefinementCtx<string>, zod.z.core.$ZodTypeInternals<any, zod.z.core.$RefinementCtx<string>>>>]>;
3
- declare function jsonArray<T extends zod.ZodTypeAny>(shap: T): zod.ZodUnion<readonly [zod.ZodArray<T>, zod.ZodPipe<zod.ZodPipe<zod.ZodString, zod.ZodTransform<zod.z.core.$RefinementCtx<string>, string>>, zod.z.core.$ZodType<any, zod.z.core.$RefinementCtx<string>, zod.z.core.$ZodTypeInternals<any, zod.z.core.$RefinementCtx<string>>>>]>;
4
- type RelationsOperation = 'set' | 'disconnect' | 'delete' | 'connect';
5
- export declare const z: {
6
- json: typeof json;
7
- jsonArray: typeof jsonArray;
8
- relation: {
9
- connect: zod.ZodPipe<zod.ZodObject<{
10
- id: zod.ZodString;
11
- }, zod.z.core.$strip>, zod.ZodTransform<{
12
- connect: {
13
- id: string;
14
- };
15
- }, {
16
- id: string;
17
- }>>;
18
- create<T extends zod.ZodRawShape>(shap: T): zod.ZodPipe<zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>, zod.ZodTransform<{
19
- create: zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>;
20
- }, zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>>>;
21
- connectOrCreate<T extends zod.ZodRawShape>(shap: T): zod.ZodPipe<zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>, zod.ZodTransform<{
22
- connectOrCreate: zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>;
23
- }, zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>>>;
24
- upsert<T extends zod.ZodRawShape>(shap: T): zod.ZodPipe<zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>, zod.ZodTransform<{
25
- upsert: zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>;
26
- }, zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>>>;
27
- update<T extends zod.ZodRawShape>(shap: T): zod.ZodPipe<zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>, zod.ZodTransform<{
28
- update: zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>;
29
- }, zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>>>;
30
- };
31
- relations: {
32
- set: zod.ZodPipe<zod.ZodArray<zod.ZodObject<{
33
- id: zod.ZodString;
34
- }, zod.z.core.$strip>>, zod.ZodTransform<Partial<Record<RelationsOperation, {
35
- id: string;
36
- }[]>>, {
37
- id: string;
38
- }[]>>;
39
- disconnect: zod.ZodPipe<zod.ZodArray<zod.ZodObject<{
40
- id: zod.ZodString;
41
- }, zod.z.core.$strip>>, zod.ZodTransform<Partial<Record<RelationsOperation, {
42
- id: string;
43
- }[]>>, {
44
- id: string;
45
- }[]>>;
46
- delete: zod.ZodPipe<zod.ZodArray<zod.ZodObject<{
47
- id: zod.ZodString;
48
- }, zod.z.core.$strip>>, zod.ZodTransform<Partial<Record<RelationsOperation, {
49
- id: string;
50
- }[]>>, {
51
- id: string;
52
- }[]>>;
53
- connect: zod.ZodPipe<zod.ZodArray<zod.ZodObject<{
54
- id: zod.ZodString;
55
- }, zod.z.core.$strip>>, zod.ZodTransform<Partial<Record<RelationsOperation, {
56
- id: string;
57
- }[]>>, {
58
- id: string;
59
- }[]>>;
60
- create<T extends zod.ZodRawShape>(shap: T): zod.ZodPipe<zod.ZodUnion<readonly [zod.ZodArray<zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>>, zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>]>, zod.ZodTransform<{
61
- create: zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[];
62
- }, zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[]>>;
63
- connectOrCreate<T extends zod.ZodRawShape>(shap: T): zod.ZodPipe<zod.ZodUnion<readonly [zod.ZodArray<zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>>, zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>]>, zod.ZodTransform<{
64
- connectOrCreate: zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[];
65
- }, zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[]>>;
66
- upsert<T extends zod.ZodRawShape>(shap: T): zod.ZodPipe<zod.ZodUnion<readonly [zod.ZodArray<zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>>, zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>]>, zod.ZodTransform<{
67
- upsert: zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[];
68
- }, zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[]>>;
69
- createMany<T extends zod.ZodRawShape>(shap: T): zod.ZodPipe<zod.ZodUnion<readonly [zod.ZodArray<zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>>, zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>]>, zod.ZodTransform<{
70
- createMany: zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[];
71
- }, zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[]>>;
72
- update<T extends zod.ZodRawShape>(shap: T): zod.ZodPipe<zod.ZodUnion<readonly [zod.ZodArray<zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>>, zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>]>, zod.ZodTransform<{
73
- update: zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[];
74
- }, zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[]>>;
75
- updateMany<T extends zod.ZodRawShape>(shap: T): zod.ZodPipe<zod.ZodUnion<readonly [zod.ZodArray<zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>>, zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>]>, zod.ZodTransform<{
76
- updateMany: zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[];
77
- }, zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[]>>;
78
- deleteMany<T extends zod.ZodRawShape>(shap: T): zod.ZodPipe<zod.ZodUnion<readonly [zod.ZodArray<zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>>, zod.ZodObject<{ -readonly [P in keyof T]: T[P]; }, zod.z.core.$strip>]>, zod.ZodTransform<{
79
- deleteMany: zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[];
80
- }, zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}> | zod.z.core.$InferObjectOutput<{ -readonly [P in keyof T]: T[P]; }, {}>[]>>;
81
- };
82
- filter: {
83
- number: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
84
- min: zod.ZodOptional<zod.ZodNumber>;
85
- max: zod.ZodOptional<zod.ZodNumber>;
86
- order: zod.ZodOptional<zod.ZodEnum<{
87
- desc: "desc";
88
- asc: "asc";
89
- }>>;
90
- }, zod.z.core.$strip>, zod.ZodPipe<zod.ZodPipe<zod.ZodString, zod.ZodTransform<zod.z.core.$RefinementCtx<string>, string>>, zod.z.core.$ZodType<any, zod.z.core.$RefinementCtx<string>, zod.z.core.$ZodTypeInternals<any, zod.z.core.$RefinementCtx<string>>>>]>>;
91
- multiselect: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodArray<zod.ZodString>, zod.ZodPipe<zod.ZodPipe<zod.ZodString, zod.ZodTransform<zod.z.core.$RefinementCtx<string>, string>>, zod.z.core.$ZodType<any, zod.z.core.$RefinementCtx<string>, zod.z.core.$ZodTypeInternals<any, zod.z.core.$RefinementCtx<string>>>>]>>;
92
- range: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
93
- start: zod.ZodOptional<zod.z.ZodCoercedDate<unknown>>;
94
- end: zod.ZodOptional<zod.z.ZodCoercedDate<unknown>>;
95
- order: zod.ZodOptional<zod.ZodEnum<{
96
- desc: "desc";
97
- asc: "asc";
98
- }>>;
99
- }, zod.z.core.$strip>, zod.ZodPipe<zod.ZodPipe<zod.ZodString, zod.ZodTransform<zod.z.core.$RefinementCtx<string>, string>>, zod.z.core.$ZodType<any, zod.z.core.$RefinementCtx<string>, zod.z.core.$ZodTypeInternals<any, zod.z.core.$RefinementCtx<string>>>>]>>;
100
- boolean: zod.ZodOptional<zod.ZodPipe<zod.ZodEnum<{
101
- true: "true";
102
- false: "false";
103
- }>, zod.ZodTransform<boolean, "true" | "false">>>;
104
- };
105
- z: typeof zod.z;
106
- default: typeof zod.z;
107
- core: typeof zod.z.core;
108
- globalRegistry: zod.z.core.$ZodRegistry<zod.z.core.GlobalMeta, zod.z.core.$ZodType<unknown, unknown, zod.z.core.$ZodTypeInternals<unknown, unknown>>>;
109
- registry: typeof zod.z.core.registry;
110
- config: typeof zod.z.core.config;
111
- $output: typeof zod.z.core.$output;
112
- $input: typeof zod.z.core.$input;
113
- $brand: typeof zod.z.core.$brand;
114
- clone: typeof zod.z.core.util.clone;
115
- regexes: typeof zod.z.core.regexes;
116
- treeifyError: typeof zod.z.core.treeifyError;
117
- prettifyError: typeof zod.z.core.prettifyError;
118
- formatError: typeof zod.z.core.formatError;
119
- flattenError: typeof zod.z.core.flattenError;
120
- toJSONSchema: typeof zod.z.core.toJSONSchema;
121
- TimePrecision: {
122
- readonly Any: null;
123
- readonly Minute: -1;
124
- readonly Second: 0;
125
- readonly Millisecond: 3;
126
- readonly Microsecond: 6;
127
- };
128
- util: typeof zod.z.core.util;
129
- NEVER: never;
130
- locales: typeof zod.z.core.locales;
131
- ZodISODateTime: zod.z.core.$constructor<zod.z.ZodISODateTime, zod.z.core.$ZodISODateTimeDef>;
132
- ZodISODate: zod.z.core.$constructor<zod.z.ZodISODate, zod.z.core.$ZodStringFormatDef<"date">>;
133
- ZodISOTime: zod.z.core.$constructor<zod.z.ZodISOTime, zod.z.core.$ZodISOTimeDef>;
134
- ZodISODuration: zod.z.core.$constructor<zod.z.ZodISODuration, zod.z.core.$ZodStringFormatDef<"duration">>;
135
- iso: typeof zod.z.iso;
136
- coerce: typeof zod.z.coerce;
137
- string(params?: string | zod.z.core.$ZodStringParams): zod.ZodString;
138
- string<T extends string>(params?: string | zod.z.core.$ZodStringParams): zod.z.core.$ZodType<T, T>;
139
- email(params?: string | zod.z.core.$ZodEmailParams): zod.ZodEmail;
140
- guid(params?: string | zod.z.core.$ZodGUIDParams): zod.ZodGUID;
141
- uuid(params?: string | zod.z.core.$ZodUUIDParams): zod.ZodUUID;
142
- uuidv4(params?: string | zod.z.core.$ZodUUIDv4Params): zod.ZodUUID;
143
- uuidv6(params?: string | zod.z.core.$ZodUUIDv6Params): zod.ZodUUID;
144
- uuidv7(params?: string | zod.z.core.$ZodUUIDv7Params): zod.ZodUUID;
145
- url(params?: string | zod.z.core.$ZodURLParams): zod.ZodURL;
146
- httpUrl(params?: string | Omit<zod.z.core.$ZodURLParams, "protocol" | "hostname">): zod.ZodURL;
147
- emoji(params?: string | zod.z.core.$ZodEmojiParams): zod.ZodEmoji;
148
- nanoid(params?: string | zod.z.core.$ZodNanoIDParams): zod.ZodNanoID;
149
- cuid(params?: string | zod.z.core.$ZodCUIDParams): zod.ZodCUID;
150
- cuid2(params?: string | zod.z.core.$ZodCUID2Params): zod.ZodCUID2;
151
- ulid(params?: string | zod.z.core.$ZodULIDParams): zod.ZodULID;
152
- xid(params?: string | zod.z.core.$ZodXIDParams): zod.ZodXID;
153
- ksuid(params?: string | zod.z.core.$ZodKSUIDParams): zod.ZodKSUID;
154
- ipv4(params?: string | zod.z.core.$ZodIPv4Params): zod.ZodIPv4;
155
- ipv6(params?: string | zod.z.core.$ZodIPv6Params): zod.ZodIPv6;
156
- cidrv4(params?: string | zod.z.core.$ZodCIDRv4Params): zod.ZodCIDRv4;
157
- cidrv6(params?: string | zod.z.core.$ZodCIDRv6Params): zod.ZodCIDRv6;
158
- base64(params?: string | zod.z.core.$ZodBase64Params): zod.ZodBase64;
159
- base64url(params?: string | zod.z.core.$ZodBase64URLParams): zod.ZodBase64URL;
160
- e164(params?: string | zod.z.core.$ZodE164Params): zod.ZodE164;
161
- jwt(params?: string | zod.z.core.$ZodJWTParams): zod.ZodJWT;
162
- stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => zod.z.core.util.MaybeAsync<unknown>) | RegExp, _params?: string | zod.z.core.$ZodStringFormatParams): zod.ZodCustomStringFormat<Format>;
163
- hostname(_params?: string | zod.z.core.$ZodStringFormatParams): zod.ZodCustomStringFormat<"hostname">;
164
- hex(_params?: string | zod.z.core.$ZodStringFormatParams): zod.ZodCustomStringFormat<"hex">;
165
- hash<Alg extends zod.z.core.util.HashAlgorithm, Enc extends zod.z.core.util.HashEncoding = "hex">(alg: Alg, params?: {
166
- enc?: Enc;
167
- } & zod.z.core.$ZodStringFormatParams): zod.ZodCustomStringFormat<`${Alg}_${Enc}`>;
168
- number(params?: string | zod.z.core.$ZodNumberParams): zod.ZodNumber;
169
- int(params?: string | zod.z.core.$ZodCheckNumberFormatParams): zod.ZodInt;
170
- float32(params?: string | zod.z.core.$ZodCheckNumberFormatParams): zod.ZodFloat32;
171
- float64(params?: string | zod.z.core.$ZodCheckNumberFormatParams): zod.ZodFloat64;
172
- int32(params?: string | zod.z.core.$ZodCheckNumberFormatParams): zod.ZodInt32;
173
- uint32(params?: string | zod.z.core.$ZodCheckNumberFormatParams): zod.ZodUInt32;
174
- boolean(params?: string | zod.z.core.$ZodBooleanParams): zod.ZodBoolean;
175
- bigint(params?: string | zod.z.core.$ZodBigIntParams): zod.ZodBigInt;
176
- int64(params?: string | zod.z.core.$ZodBigIntFormatParams): zod.ZodBigIntFormat;
177
- uint64(params?: string | zod.z.core.$ZodBigIntFormatParams): zod.ZodBigIntFormat;
178
- symbol(params?: string | zod.z.core.$ZodSymbolParams): zod.ZodSymbol;
179
- any(): zod.ZodAny;
180
- unknown(): zod.ZodUnknown;
181
- never(params?: string | zod.z.core.$ZodNeverParams): zod.ZodNever;
182
- date(params?: string | zod.z.core.$ZodDateParams): zod.ZodDate;
183
- array<T extends zod.z.core.SomeType>(element: T, params?: string | zod.z.core.$ZodArrayParams): zod.ZodArray<T>;
184
- keyof<T extends zod.ZodObject>(schema: T): zod.ZodEnum<zod.z.core.util.KeysEnum<T["_zod"]["output"]>>;
185
- object<T extends zod.z.core.$ZodLooseShape = Partial<Record<never, zod.z.core.SomeType>>>(shape?: T, params?: string | zod.z.core.$ZodObjectParams): zod.ZodObject<zod.z.core.util.Writeable<T>, zod.z.core.$strip>;
186
- strictObject<T extends zod.z.core.$ZodLooseShape>(shape: T, params?: string | zod.z.core.$ZodObjectParams): zod.ZodObject<T, zod.z.core.$strict>;
187
- looseObject<T extends zod.z.core.$ZodLooseShape>(shape: T, params?: string | zod.z.core.$ZodObjectParams): zod.ZodObject<T, zod.z.core.$loose>;
188
- union<const T extends readonly zod.z.core.SomeType[]>(options: T, params?: string | zod.z.core.$ZodUnionParams): zod.ZodUnion<T>;
189
- discriminatedUnion<Types extends readonly [zod.z.core.$ZodTypeDiscriminable, ...zod.z.core.$ZodTypeDiscriminable[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | zod.z.core.$ZodDiscriminatedUnionParams): zod.ZodDiscriminatedUnion<Types, Disc>;
190
- intersection<T extends zod.z.core.SomeType, U extends zod.z.core.SomeType>(left: T, right: U): zod.ZodIntersection<T, U>;
191
- tuple<T extends readonly [zod.z.core.SomeType, ...zod.z.core.SomeType[]]>(items: T, params?: string | zod.z.core.$ZodTupleParams): zod.ZodTuple<T, null>;
192
- tuple<T extends readonly [zod.z.core.SomeType, ...zod.z.core.SomeType[]], Rest extends zod.z.core.SomeType>(items: T, rest: Rest, params?: string | zod.z.core.$ZodTupleParams): zod.ZodTuple<T, Rest>;
193
- tuple(items: [], params?: string | zod.z.core.$ZodTupleParams): zod.ZodTuple<[], null>;
194
- record<Key extends zod.z.core.$ZodRecordKey, Value extends zod.z.core.SomeType>(keyType: Key, valueType: Value, params?: string | zod.z.core.$ZodRecordParams): zod.ZodRecord<Key, Value>;
195
- partialRecord<Key extends zod.z.core.$ZodRecordKey, Value extends zod.z.core.SomeType>(keyType: Key, valueType: Value, params?: string | zod.z.core.$ZodRecordParams): zod.ZodRecord<Key & zod.z.core.$partial, Value>;
196
- map<Key extends zod.z.core.SomeType, Value extends zod.z.core.SomeType>(keyType: Key, valueType: Value, params?: string | zod.z.core.$ZodMapParams): zod.ZodMap<Key, Value>;
197
- set<Value extends zod.z.core.SomeType>(valueType: Value, params?: string | zod.z.core.$ZodSetParams): zod.ZodSet<Value>;
198
- nativeEnum<T extends zod.z.core.util.EnumLike>(entries: T, params?: string | zod.z.core.$ZodEnumParams): zod.ZodEnum<T>;
199
- literal<const T extends ReadonlyArray<zod.z.core.util.Literal>>(value: T, params?: string | zod.z.core.$ZodLiteralParams): zod.ZodLiteral<T[number]>;
200
- literal<const T extends zod.z.core.util.Literal>(value: T, params?: string | zod.z.core.$ZodLiteralParams): zod.ZodLiteral<T>;
201
- file(params?: string | zod.z.core.$ZodFileParams): zod.ZodFile;
202
- transform<I = unknown, O = I>(fn: (input: I, ctx: zod.z.core.ParsePayload) => O): zod.ZodTransform<Awaited<O>, I>;
203
- optional<T extends zod.z.core.SomeType>(innerType: T): zod.ZodOptional<T>;
204
- nullable<T extends zod.z.core.SomeType>(innerType: T): zod.ZodNullable<T>;
205
- nullish<T extends zod.z.core.SomeType>(innerType: T): zod.ZodOptional<zod.ZodNullable<T>>;
206
- _default<T extends zod.z.core.SomeType>(innerType: T, defaultValue: zod.z.core.util.NoUndefined<zod.z.core.output<T>> | (() => zod.z.core.util.NoUndefined<zod.z.core.output<T>>)): zod.ZodDefault<T>;
207
- prefault<T extends zod.z.core.SomeType>(innerType: T, defaultValue: zod.z.core.input<T> | (() => zod.z.core.input<T>)): zod.ZodPrefault<T>;
208
- nonoptional<T extends zod.z.core.SomeType>(innerType: T, params?: string | zod.z.core.$ZodNonOptionalParams): zod.ZodNonOptional<T>;
209
- success<T extends zod.z.core.SomeType>(innerType: T): zod.ZodSuccess<T>;
210
- nan(params?: string | zod.z.core.$ZodNaNParams): zod.ZodNaN;
211
- pipe<const A extends zod.z.core.SomeType, B extends zod.z.core.$ZodType<unknown, zod.z.core.output<A>> = zod.z.core.$ZodType<unknown, zod.z.core.output<A>, zod.z.core.$ZodTypeInternals<unknown, zod.z.core.output<A>>>>(in_: A, out: B | zod.z.core.$ZodType<unknown, zod.z.core.output<A>>): zod.ZodPipe<A, B>;
212
- codec<const A extends zod.z.core.SomeType, B extends zod.z.core.SomeType = zod.z.core.$ZodType<unknown, unknown, zod.z.core.$ZodTypeInternals<unknown, unknown>>>(in_: A, out: B, params: {
213
- decode: (value: zod.z.core.output<A>, payload: zod.z.core.ParsePayload<zod.z.core.output<A>>) => zod.z.core.util.MaybeAsync<zod.z.core.input<B>>;
214
- encode: (value: zod.z.core.input<B>, payload: zod.z.core.ParsePayload<zod.z.core.input<B>>) => zod.z.core.util.MaybeAsync<zod.z.core.output<A>>;
215
- }): zod.ZodCodec<A, B>;
216
- readonly<T extends zod.z.core.SomeType>(innerType: T): zod.ZodReadonly<T>;
217
- templateLiteral<const Parts extends zod.z.core.$ZodTemplateLiteralPart[]>(parts: Parts, params?: string | zod.z.core.$ZodTemplateLiteralParams): zod.ZodTemplateLiteral<zod.z.core.$PartsToTemplateLiteral<Parts>>;
218
- lazy<T extends zod.z.core.SomeType>(getter: () => T): zod.ZodLazy<T>;
219
- promise<T extends zod.z.core.SomeType>(innerType: T): zod.ZodPromise<T>;
220
- _function(): zod.ZodFunction;
221
- _function<const In extends ReadonlyArray<zod.z.core.$ZodType>>(params: {
222
- input: In;
223
- }): zod.ZodFunction<zod.ZodTuple<In, null>, zod.z.core.$ZodFunctionOut>;
224
- _function<const In extends ReadonlyArray<zod.z.core.$ZodType>, const Out extends zod.z.core.$ZodFunctionOut = zod.z.core.$ZodFunctionOut>(params: {
225
- input: In;
226
- output: Out;
227
- }): zod.ZodFunction<zod.ZodTuple<In, null>, Out>;
228
- _function<const In extends zod.z.core.$ZodFunctionIn = zod.z.core.$ZodFunctionArgs>(params: {
229
- input: In;
230
- }): zod.ZodFunction<In, zod.z.core.$ZodFunctionOut>;
231
- _function<const Out extends zod.z.core.$ZodFunctionOut = zod.z.core.$ZodFunctionOut>(params: {
232
- output: Out;
233
- }): zod.ZodFunction<zod.z.core.$ZodFunctionIn, Out>;
234
- _function<In extends zod.z.core.$ZodFunctionIn = zod.z.core.$ZodFunctionArgs, Out extends zod.z.core.$ZodType = zod.z.core.$ZodType<unknown, unknown, zod.z.core.$ZodTypeInternals<unknown, unknown>>>(params?: {
235
- input: In;
236
- output: Out;
237
- }): zod.ZodFunction<In, Out>;
238
- check<O = unknown>(fn: zod.z.core.CheckFn<O>): zod.z.core.$ZodCheck<O>;
239
- custom<O>(fn?: (data: unknown) => unknown, _params?: string | zod.z.core.$ZodCustomParams | undefined): zod.ZodCustom<O, O>;
240
- refine<T>(fn: (arg: NoInfer<T>) => zod.z.core.util.MaybeAsync<unknown>, _params?: string | zod.z.core.$ZodCustomParams): zod.z.core.$ZodCheck<T>;
241
- superRefine<T>(fn: (arg: T, payload: zod.z.core.$RefinementCtx<T>) => void | Promise<void>): zod.z.core.$ZodCheck<T>;
242
- preprocess<A, U extends zod.z.core.SomeType, B = unknown>(fn: (arg: B, ctx: zod.z.core.$RefinementCtx) => A, schema: U): zod.ZodPipe<zod.ZodTransform<A, B>, U>;
243
- ZodType: zod.z.core.$constructor<zod.ZodType>;
244
- _ZodString: zod.z.core.$constructor<zod._ZodString>;
245
- ZodString: zod.z.core.$constructor<zod.ZodString>;
246
- ZodStringFormat: zod.z.core.$constructor<zod.ZodStringFormat>;
247
- ZodEmail: zod.z.core.$constructor<zod.ZodEmail>;
248
- ZodGUID: zod.z.core.$constructor<zod.ZodGUID>;
249
- ZodUUID: zod.z.core.$constructor<zod.ZodUUID>;
250
- ZodURL: zod.z.core.$constructor<zod.ZodURL>;
251
- ZodEmoji: zod.z.core.$constructor<zod.ZodEmoji>;
252
- ZodNanoID: zod.z.core.$constructor<zod.ZodNanoID>;
253
- ZodCUID: zod.z.core.$constructor<zod.ZodCUID>;
254
- ZodCUID2: zod.z.core.$constructor<zod.ZodCUID2>;
255
- ZodULID: zod.z.core.$constructor<zod.ZodULID>;
256
- ZodXID: zod.z.core.$constructor<zod.ZodXID>;
257
- ZodKSUID: zod.z.core.$constructor<zod.ZodKSUID>;
258
- ZodIPv4: zod.z.core.$constructor<zod.ZodIPv4>;
259
- ZodIPv6: zod.z.core.$constructor<zod.ZodIPv6>;
260
- ZodCIDRv4: zod.z.core.$constructor<zod.ZodCIDRv4>;
261
- ZodCIDRv6: zod.z.core.$constructor<zod.ZodCIDRv6>;
262
- ZodBase64: zod.z.core.$constructor<zod.ZodBase64>;
263
- ZodBase64URL: zod.z.core.$constructor<zod.ZodBase64URL>;
264
- ZodE164: zod.z.core.$constructor<zod.ZodE164>;
265
- ZodJWT: zod.z.core.$constructor<zod.ZodJWT>;
266
- ZodCustomStringFormat: zod.z.core.$constructor<zod.ZodCustomStringFormat>;
267
- ZodNumber: zod.z.core.$constructor<zod.ZodNumber>;
268
- ZodNumberFormat: zod.z.core.$constructor<zod.ZodNumberFormat>;
269
- ZodBoolean: zod.z.core.$constructor<zod.ZodBoolean>;
270
- ZodBigInt: zod.z.core.$constructor<zod.ZodBigInt>;
271
- ZodBigIntFormat: zod.z.core.$constructor<zod.ZodBigIntFormat>;
272
- ZodSymbol: zod.z.core.$constructor<zod.ZodSymbol>;
273
- ZodUndefined: zod.z.core.$constructor<zod.ZodUndefined>;
274
- undefined: typeof zod.z.undefined;
275
- ZodNull: zod.z.core.$constructor<zod.ZodNull>;
276
- null: typeof zod.z.null;
277
- ZodAny: zod.z.core.$constructor<zod.ZodAny>;
278
- ZodUnknown: zod.z.core.$constructor<zod.ZodUnknown>;
279
- ZodNever: zod.z.core.$constructor<zod.ZodNever>;
280
- ZodVoid: zod.z.core.$constructor<zod.ZodVoid>;
281
- void: typeof zod.z.void;
282
- ZodDate: zod.z.core.$constructor<zod.ZodDate>;
283
- ZodArray: zod.z.core.$constructor<zod.ZodArray>;
284
- ZodObject: zod.z.core.$constructor<zod.ZodObject>;
285
- ZodUnion: zod.z.core.$constructor<zod.ZodUnion>;
286
- ZodDiscriminatedUnion: zod.z.core.$constructor<zod.ZodDiscriminatedUnion>;
287
- ZodIntersection: zod.z.core.$constructor<zod.ZodIntersection>;
288
- ZodTuple: zod.z.core.$constructor<zod.ZodTuple>;
289
- ZodRecord: zod.z.core.$constructor<zod.ZodRecord>;
290
- ZodMap: zod.z.core.$constructor<zod.ZodMap>;
291
- ZodSet: zod.z.core.$constructor<zod.ZodSet>;
292
- ZodEnum: zod.z.core.$constructor<zod.ZodEnum>;
293
- enum: typeof zod.z.enum;
294
- ZodLiteral: zod.z.core.$constructor<zod.ZodLiteral>;
295
- ZodFile: zod.z.core.$constructor<zod.ZodFile>;
296
- ZodTransform: zod.z.core.$constructor<zod.ZodTransform>;
297
- ZodOptional: zod.z.core.$constructor<zod.ZodOptional>;
298
- ZodNullable: zod.z.core.$constructor<zod.ZodNullable>;
299
- ZodDefault: zod.z.core.$constructor<zod.ZodDefault>;
300
- ZodPrefault: zod.z.core.$constructor<zod.ZodPrefault>;
301
- ZodNonOptional: zod.z.core.$constructor<zod.ZodNonOptional>;
302
- ZodSuccess: zod.z.core.$constructor<zod.ZodSuccess>;
303
- ZodCatch: zod.z.core.$constructor<zod.ZodCatch>;
304
- catch: typeof zod.z.catch;
305
- ZodNaN: zod.z.core.$constructor<zod.ZodNaN>;
306
- ZodPipe: zod.z.core.$constructor<zod.ZodPipe>;
307
- ZodCodec: zod.z.core.$constructor<zod.ZodCodec>;
308
- ZodReadonly: zod.z.core.$constructor<zod.ZodReadonly>;
309
- ZodTemplateLiteral: zod.z.core.$constructor<zod.ZodTemplateLiteral>;
310
- ZodLazy: zod.z.core.$constructor<zod.ZodLazy>;
311
- ZodPromise: zod.z.core.$constructor<zod.ZodPromise>;
312
- ZodFunction: zod.z.core.$constructor<zod.ZodFunction>;
313
- function: typeof zod._function;
314
- ZodCustom: zod.z.core.$constructor<zod.ZodCustom>;
315
- instanceof: typeof zod.z.instanceof;
316
- stringbool: (_params?: string | zod.z.core.$ZodStringBoolParams) => zod.ZodCodec<zod.ZodString, zod.ZodBoolean>;
317
- lt: typeof zod.z.core._lt;
318
- lte: typeof zod.z.core._lte;
319
- gt: typeof zod.z.core._gt;
320
- gte: typeof zod.z.core._gte;
321
- positive: typeof zod.z.core._positive;
322
- negative: typeof zod.z.core._negative;
323
- nonpositive: typeof zod.z.core._nonpositive;
324
- nonnegative: typeof zod.z.core._nonnegative;
325
- multipleOf: typeof zod.z.core._multipleOf;
326
- maxSize: typeof zod.z.core._maxSize;
327
- minSize: typeof zod.z.core._minSize;
328
- size: typeof zod.z.core._size;
329
- maxLength: typeof zod.z.core._maxLength;
330
- minLength: typeof zod.z.core._minLength;
331
- length: typeof zod.z.core._length;
332
- regex: typeof zod.z.core._regex;
333
- lowercase: typeof zod.z.core._lowercase;
334
- uppercase: typeof zod.z.core._uppercase;
335
- includes: typeof zod.z.core._includes;
336
- startsWith: typeof zod.z.core._startsWith;
337
- endsWith: typeof zod.z.core._endsWith;
338
- property: typeof zod.z.core._property;
339
- mime: typeof zod.z.core._mime;
340
- overwrite: typeof zod.z.core._overwrite;
341
- normalize: typeof zod.z.core._normalize;
342
- trim: typeof zod.z.core._trim;
343
- toLowerCase: typeof zod.z.core._toLowerCase;
344
- toUpperCase: typeof zod.z.core._toUpperCase;
345
- ZodError: zod.z.core.$constructor<zod.ZodError>;
346
- ZodRealError: zod.z.core.$constructor<zod.ZodError>;
347
- parse: <T extends zod.z.core.$ZodType>(schema: T, value: unknown, _ctx?: zod.z.core.ParseContext<zod.z.core.$ZodIssue>, _params?: {
348
- callee?: zod.z.core.util.AnyFunc;
349
- Err?: zod.z.core.$ZodErrorClass;
350
- }) => zod.z.core.output<T>;
351
- parseAsync: <T extends zod.z.core.$ZodType>(schema: T, value: unknown, _ctx?: zod.z.core.ParseContext<zod.z.core.$ZodIssue>, _params?: {
352
- callee?: zod.z.core.util.AnyFunc;
353
- Err?: zod.z.core.$ZodErrorClass;
354
- }) => Promise<zod.z.core.output<T>>;
355
- safeParse: <T extends zod.z.core.$ZodType>(schema: T, value: unknown, _ctx?: zod.z.core.ParseContext<zod.z.core.$ZodIssue>) => zod.ZodSafeParseResult<zod.z.core.output<T>>;
356
- safeParseAsync: <T extends zod.z.core.$ZodType>(schema: T, value: unknown, _ctx?: zod.z.core.ParseContext<zod.z.core.$ZodIssue>) => Promise<zod.ZodSafeParseResult<zod.z.core.output<T>>>;
357
- encode: <T extends zod.z.core.$ZodType>(schema: T, value: zod.z.core.output<T>, _ctx?: zod.z.core.ParseContext<zod.z.core.$ZodIssue>) => zod.z.core.input<T>;
358
- decode: <T extends zod.z.core.$ZodType>(schema: T, value: zod.z.core.input<T>, _ctx?: zod.z.core.ParseContext<zod.z.core.$ZodIssue>) => zod.z.core.output<T>;
359
- encodeAsync: <T extends zod.z.core.$ZodType>(schema: T, value: zod.z.core.output<T>, _ctx?: zod.z.core.ParseContext<zod.z.core.$ZodIssue>) => Promise<zod.z.core.input<T>>;
360
- decodeAsync: <T extends zod.z.core.$ZodType>(schema: T, value: zod.z.core.input<T>, _ctx?: zod.z.core.ParseContext<zod.z.core.$ZodIssue>) => Promise<zod.z.core.output<T>>;
361
- safeEncode: <T extends zod.z.core.$ZodType>(schema: T, value: zod.z.core.output<T>, _ctx?: zod.z.core.ParseContext<zod.z.core.$ZodIssue>) => zod.ZodSafeParseResult<zod.z.core.input<T>>;
362
- safeDecode: <T extends zod.z.core.$ZodType>(schema: T, value: zod.z.core.input<T>, _ctx?: zod.z.core.ParseContext<zod.z.core.$ZodIssue>) => zod.ZodSafeParseResult<zod.z.core.output<T>>;
363
- safeEncodeAsync: <T extends zod.z.core.$ZodType>(schema: T, value: zod.z.core.output<T>, _ctx?: zod.z.core.ParseContext<zod.z.core.$ZodIssue>) => Promise<zod.ZodSafeParseResult<zod.z.core.input<T>>>;
364
- safeDecodeAsync: <T extends zod.z.core.$ZodType>(schema: T, value: zod.z.core.input<T>, _ctx?: zod.z.core.ParseContext<zod.z.core.$ZodIssue>) => Promise<zod.ZodSafeParseResult<zod.z.core.output<T>>>;
365
- setErrorMap(map: zod.z.core.$ZodErrorMap): void;
366
- getErrorMap(): zod.z.core.$ZodErrorMap<zod.z.core.$ZodIssue> | undefined;
367
- ZodIssueCode: {
368
- readonly invalid_type: "invalid_type";
369
- readonly too_big: "too_big";
370
- readonly too_small: "too_small";
371
- readonly invalid_format: "invalid_format";
372
- readonly not_multiple_of: "not_multiple_of";
373
- readonly unrecognized_keys: "unrecognized_keys";
374
- readonly invalid_union: "invalid_union";
375
- readonly invalid_key: "invalid_key";
376
- readonly invalid_element: "invalid_element";
377
- readonly invalid_value: "invalid_value";
378
- readonly custom: "custom";
379
- };
380
- ZodFirstPartyTypeKind: typeof zod.ZodFirstPartyTypeKind;
1
+ import z from 'zod';
2
+ export type ShapeOf<T extends Record<string, unknown>> = Readonly<Readonly<{
3
+ [K in keyof T]: z.core.$ZodType<T[K], unknown, z.core.$ZodTypeInternals<T[K], unknown>>;
4
+ }>>;
5
+ export type JsonValue = string | number | boolean | null | JsonValue[] | JsonRecord;
6
+ export type JsonRecord = {
7
+ [key: string]: JsonValue;
381
8
  };
382
- export type ZodInfer<T extends zod.ZodType<any, any, any>> = T['_output'];
383
- export type SuperRefinement<T> = zod.SuperRefinement<T>;
384
- /**
385
- * @example type MyModel = {name: z.string()} satisfies ZodObj<{name: string}>
386
- */
387
- export type ZodObj<T = Record<PropertyKey, unknown>> = {
388
- [key in keyof T]: zod.ZodType<T[key], zod.ZodTypeDef, Date | boolean | number | string | undefined | null | object>;
389
- };
390
- export declare const toTuple: <T extends {}>(o: T) => UnionToTuple<keyof T>;
391
- type UnionToIntersection<U> = (U extends unknown ? (arg: U) => 0 : never) extends (arg: infer I) => 0 ? I : never;
392
- type LastInUnion<U> = UnionToIntersection<U extends unknown ? (x: U) => 0 : never> extends (x: infer L) => 0 ? L : never;
393
- export type UnionToTuple<U, Last = LastInUnion<U>> = [U] extends [never] ? [] : [...UnionToTuple<Exclude<U, Last>>, Last];
394
- export {};
9
+ export declare const zodJsonValue: z.core.$ZodType<JsonValue>;
10
+ export declare const zodJsonRecord: z.core.$ZodType<JsonRecord>;
11
+ export declare const zodCoerceJson: z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>;
12
+ export declare const zodCoerceJsonValue: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>, z.z.core.$ZodType<JsonValue, unknown, z.z.core.$ZodTypeInternals<JsonValue, unknown>>>;
13
+ export declare const zodCoerceJsonRecord: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<any, string>>, z.z.core.$ZodType<JsonRecord, unknown, z.z.core.$ZodTypeInternals<JsonRecord, unknown>>>;