fuma 2.0.49 → 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
@@ -1,8 +1,8 @@
1
1
  <script lang="ts">
2
- import { onMount, onDestroy, createEventDispatcher } from 'svelte'
2
+ import dayjs from 'dayjs'
3
3
  import type { Litepicker } from 'litepicker'
4
+ import { createEventDispatcher, onDestroy, onMount } from 'svelte'
4
5
  import type { RangeAsDate, RangeDate } from './types.js'
5
- import dayjs from 'dayjs'
6
6
 
7
7
  export let numberOfMonths = 3
8
8
  export let numberOfColumns = numberOfMonths
@@ -49,6 +49,7 @@
49
49
  startDate: range?.start ? dayjs(range.start).toDate() : undefined,
50
50
  endDate: range?.end ? dayjs(range.end).toDate() : undefined,
51
51
  setup: (picker: Litepicker) => {
52
+ // biome-ignore lint/suspicious/noExplicitAny: Litepicker external type
52
53
  picker.on('selected', (date1: any, date2: any) => {
53
54
  range = {
54
55
  start: new Date(
@@ -1,42 +1,49 @@
1
1
  <script lang="ts">
2
- import { mdiCalendarMonthOutline } from '@mdi/js'
3
- import { goto } from '$app/navigation'
2
+ import { CalendarRangeIcon } from '@lucide/svelte'
4
3
  import { slide } from 'svelte/transition'
5
-
6
- import { urlParam } from '../../store/param.js'
7
- import { formatRangeShort } from './format.js'
8
- import { Icon } from '../icon/index.js'
4
+ import { goto } from '$app/navigation'
5
+ import { param, urlParam } from '../../state/param.svelte.ts'
9
6
  import { DropDown } from '../menu/index.js'
10
- import { InputTime } from '../input/index.js'
7
+ import { formatRangeShort } from './format.js'
11
8
  import { type RangeAsDate, RangePicker } from './index.js'
12
9
  import { jsonParse } from '../../utils/jsonParse.js'
13
10
 
14
11
  let dropDown: DropDown
15
12
  let rangePicker: RangePicker
16
- let klass = ''
17
13
 
18
- export let key = 'range'
19
- export let range: RangeAsDate = jsonParse<RangeAsDate>($urlParam.get(key), {
20
- start: null,
21
- end: null
22
- })
23
- export let minDate: Date | number | string | undefined = undefined
24
- export let maxDate: Date | number | string | undefined = undefined
25
- export { klass as class }
26
- export let classLabel = ''
14
+ let {
15
+ key = 'range',
16
+ range = $bindable(
17
+ jsonParse<RangeAsDate>(param.get(key), {
18
+ start: null,
19
+ end: null
20
+ })
21
+ ),
22
+ minDate,
23
+ maxDate,
24
+ class: klass = '',
25
+ classLabel = ''
26
+ }: {
27
+ key?: string
28
+ range: RangeAsDate
29
+ minDate?: Date | number | string
30
+ maxDate?: Date | number | string
31
+ class?: string
32
+ classLabel?: string
33
+ } = $props()
27
34
 
28
- $: isValidPeriod = !!range.start && !!range.end
35
+ let isValidPeriod = $derived(!!range.start && !!range.end)
29
36
 
30
37
  function getLabel(_range?: Partial<RangeAsDate>) {
31
38
  if (!_range || !_range.start || !_range.end) return ''
32
39
  return formatRangeShort(_range as RangeAsDate)
33
40
  }
34
41
 
35
- async function writeURL() {
42
+ async function updateURL() {
36
43
  const url =
37
44
  !range.start && !range.end
38
- ? $urlParam.without(key)
39
- : $urlParam.with({
45
+ ? urlParam.without(key)
46
+ : urlParam.with({
40
47
  [key]: JSON.stringify({
41
48
  start: range.start?.toJSON(),
42
49
  end: range.end?.toJSON()
@@ -46,24 +53,29 @@
46
53
  }
47
54
  </script>
48
55
 
49
- <DropDown bind:this={dropDown} tippyProps={{ onHidden: writeURL }} class="max-h-full">
50
- <button slot="activator" class="min-width-0 btn btn-sm flex-nowrap {klass}">
51
- <Icon path={mdiCalendarMonthOutline} class="opacity-60" size={20} />
52
- {#if isValidPeriod}
53
- <span
54
- transition:slide={{ axis: 'x', duration: 200 }}
55
- class="whitespace-nowrap text-xs font-medium opacity-80 {classLabel}"
56
- >
57
- {getLabel(range)}
58
- </span>
59
- {/if}
60
- </button>
56
+ <DropDown bind:this={dropDown} tippyProps={{ onHidden: updateURL }} class="max-h-full">
57
+ {#snippet activator()}
58
+ <button class="min-width-0 btn flex-nowrap btn-sm {klass}">
59
+ <CalendarRangeIcon class="opacity-60" size={20} />
60
+ {#if isValidPeriod}
61
+ <span
62
+ transition:slide={{ axis: 'x', duration: 200 }}
63
+ class="text-xs font-medium whitespace-nowrap opacity-80 {classLabel}"
64
+ >
65
+ {getLabel(range)}
66
+ </span>
67
+ {/if}
68
+ </button>
69
+ {/snippet}
61
70
 
62
71
  <RangePicker bind:this={rangePicker} numberOfMonths={1} bind:range {minDate} {maxDate} />
63
72
 
64
73
  <div class="flex gap-2 p-2">
65
- <InputTime label="A partir de" bind:value={range.start} enhanceDisabled class="grow" />
66
- <InputTime label="Jusqu'à" bind:value={range.end} enhanceDisabled class="grow" />
74
+ <!--
75
+ <InputString label="A partir de" bind:value={range.start} class="grow" />
76
+ <InputString label="Jusqu'à" bind:value={range.end} class="grow" />
77
+ -->
78
+ <span>TODO: same problème with input...</span>
67
79
  </div>
68
80
 
69
81
  <div class="m-2 flex justify-end gap-2">
@@ -71,7 +83,7 @@
71
83
  <button
72
84
  transition:slide
73
85
  class="btn btn-ghost"
74
- on:click={() => {
86
+ onclick={() => {
75
87
  range = { start: null, end: null }
76
88
  rangePicker.clear()
77
89
  dropDown.hide()
@@ -80,6 +92,6 @@
80
92
  Effacer
81
93
  </button>
82
94
  {/if}
83
- <button class="btn" on:click={() => dropDown.hide()}> Valider </button>
95
+ <button class="btn" onclick={() => dropDown.hide()}> Valider </button>
84
96
  </div>
85
97
  </DropDown>
@@ -1,26 +1,12 @@
1
1
  import { type RangeAsDate } from './index.js';
2
- interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
3
- new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
4
- $$bindings?: Bindings;
5
- } & Exports;
6
- (internal: unknown, props: Props & {
7
- $$events?: Events;
8
- $$slots?: Slots;
9
- }): Exports & {
10
- $set?: any;
11
- $on?: any;
12
- };
13
- z_$$bindings?: Bindings;
14
- }
15
- declare const RangePickerButton: $$__sveltets_2_IsomorphicComponent<{
2
+ type $$ComponentProps = {
16
3
  key?: string;
17
- range?: RangeAsDate;
18
- minDate?: Date | number | string | undefined;
19
- maxDate?: Date | number | string | undefined;
4
+ range: RangeAsDate;
5
+ minDate?: Date | number | string;
6
+ maxDate?: Date | number | string;
20
7
  class?: string;
21
8
  classLabel?: string;
22
- }, {
23
- [evt: string]: CustomEvent<any>;
24
- }, {}, {}, string>;
25
- type RangePickerButton = InstanceType<typeof RangePickerButton>;
9
+ };
10
+ declare const RangePickerButton: import("svelte").Component<$$ComponentProps, {}, "range">;
11
+ type RangePickerButton = ReturnType<typeof RangePickerButton>;
26
12
  export default RangePickerButton;
@@ -1,4 +1,4 @@
1
+ export * from './format.js';
1
2
  export { default as RangePicker } from './RangePicker.svelte';
2
3
  export { default as RangePickerButton } from './RangePickerButton.svelte';
3
- export * from './format.js';
4
4
  export * from './types.js';
@@ -1,4 +1,4 @@
1
+ export * from './format.js';
1
2
  export { default as RangePicker } from './RangePicker.svelte';
2
3
  export { default as RangePickerButton } from './RangePickerButton.svelte';
3
- export * from './format.js';
4
4
  export * from './types.js';
@@ -1,16 +1,14 @@
1
1
  <script lang="ts" generics="Item extends ItemBase">
2
2
  import { afterNavigate } from '$app/navigation'
3
- import { maxHeightScreen } from '../../action/maxHeightScreen.js'
4
- import { Placeholder } from '../placeholder/index.js'
5
3
 
6
4
  import {
7
- type TableField,
8
- type ItemBase,
9
- TableHead,
10
- TableBody,
11
5
  context,
12
6
  createKeys,
13
- syncFieldsWithParams
7
+ type ItemBase,
8
+ syncFieldsWithParams,
9
+ TableBody,
10
+ type TableField,
11
+ TableHead
14
12
  } from './index.js'
15
13
  import type { SnippetLike } from './type.js'
16
14
 
@@ -40,11 +38,13 @@
40
38
  screenPadding?: number
41
39
  } = $props()
42
40
 
43
- const { KEY_FIELDS_VISIBLE, KEY_FIELDS_HIDDEN, KEY_FIELDS_ORDER } = createKeys(key)
44
- context.set(key, {
45
- KEY_FIELDS_VISIBLE,
46
- KEY_FIELDS_HIDDEN,
47
- KEY_FIELDS_ORDER
41
+ $effect(() => {
42
+ const { KEY_FIELDS_VISIBLE, KEY_FIELDS_HIDDEN, KEY_FIELDS_ORDER } = createKeys(key)
43
+ context.set(key, {
44
+ KEY_FIELDS_VISIBLE,
45
+ KEY_FIELDS_HIDDEN,
46
+ KEY_FIELDS_ORDER
47
+ })
48
48
  })
49
49
 
50
50
  const initFields = () => (fields = syncFieldsWithParams(key, fields))
@@ -52,12 +52,8 @@
52
52
  afterNavigate(initFields)
53
53
  </script>
54
54
 
55
- <div
56
- class="{klass} bg-base-100 overflow-x-auto rounded-lg border"
57
- class:min-h-[320px]={!hideBody}
58
- use:maxHeightScreen={{ padding: screenPadding }}
59
- >
60
- <table class="relative table">
55
+ <div class="{klass} overflow-x-auto rounded-lg border bg-base-100" class:min-h-[320px]={!hideBody}>
56
+ <table class="table relative">
61
57
  <TableHead {fields} {key} {onCreateField} />
62
58
  {#if !hideBody && items.length}
63
59
  <TableBody {fields} {items} {actions} {classRow} {onclick} />
@@ -65,8 +61,6 @@
65
61
  </table>
66
62
 
67
63
  {#if hideBody && !items.length}
68
- <Placeholder class="rounded-t-none">
69
- {placholder}
70
- </Placeholder>
64
+ {placholder}
71
65
  {/if}
72
66
  </div>
@@ -1,4 +1,4 @@
1
- import { type TableField, type ItemBase } from './index.js';
1
+ import { type ItemBase, type TableField } from './index.js';
2
2
  import type { SnippetLike } from './type.js';
3
3
  declare function $$render<Item extends ItemBase>(): {
4
4
  props: {
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" generics="Item extends ItemBase">
2
- import { TableCell, type ItemBase, type TableField } from './index.js'
3
2
  import type { Snippet } from 'svelte'
3
+ import { type ItemBase, TableCell, type TableField } from './index.js'
4
4
 
5
5
  let {
6
6
  items,
@@ -1,5 +1,5 @@
1
- import { type ItemBase, type TableField } from './index.js';
2
1
  import type { Snippet } from 'svelte';
2
+ import { type ItemBase, type TableField } from './index.js';
3
3
  declare function $$render<Item extends ItemBase>(): {
4
4
  props: {
5
5
  items: Item[];
@@ -1,30 +1,33 @@
1
1
  <script lang="ts" generics="Item extends ItemBase">
2
2
  import {
3
- mdiCheck,
4
- mdiCheckCircleOutline,
5
- mdiCircleSmall,
6
- mdiDotsHorizontal,
7
- mdiDrag,
8
- mdiPlus
9
- } from '@mdi/js'
10
- import type { TippyInstance } from '../../utils/tippy.js'
3
+ CheckIcon,
4
+ CircleCheckIcon,
5
+ CircleIcon,
6
+ EllipsisIcon,
7
+ GripIcon,
8
+ PlusIcon
9
+ } from '@lucide/svelte'
11
10
  import { goto } from '$app/navigation'
12
- import { page } from '$app/stores'
13
- import { urlParam } from '../../store/param.js'
11
+ import { page } from '$app/state'
14
12
  import { listEditable } from '../../action/list/index.js'
15
- import { jsonParse } from '../../utils/jsonParse.js'
16
- import { context } from './context.js'
17
- import { Icon } from '../icon/index.js'
13
+ import { tip } from '../../action/tip.js'
14
+ import { param, urlParam } from '../../state/param.svelte.ts'
18
15
  import { DropDown } from '../menu/index.js'
16
+ import { context } from './context.js'
19
17
  import type { ItemBase, TableField } from './index.js'
18
+ import { jsonParse } from '../../utils/jsonParse.js'
20
19
 
21
- export let fields: TableField<Item>[]
22
- export let key: string
23
- export let onCreateField: (() => void) | undefined = undefined
24
-
25
- let tip: TippyInstance
20
+ let {
21
+ fields,
22
+ key,
23
+ onCreateField
24
+ }: {
25
+ fields: TableField<Item>[]
26
+ key: string
27
+ onCreateField?: () => void
28
+ } = $props()
26
29
 
27
- const { KEY_FIELDS_VISIBLE, KEY_FIELDS_HIDDEN, KEY_FIELDS_ORDER } = context.get(key)
30
+ let { KEY_FIELDS_VISIBLE, KEY_FIELDS_HIDDEN, KEY_FIELDS_ORDER } = $derived(context.get(key))
28
31
 
29
32
  function getFieldHref(field: TableField<Item>) {
30
33
  if (field.locked) return
@@ -38,8 +41,8 @@
38
41
  }
39
42
 
40
43
  function toggleParam(paramKey: string, fieldKey: string): URL {
41
- const url = new URL($page.url)
42
- const fieldsKeys = jsonParse<string[]>($page.url.searchParams.get(paramKey), [])
44
+ const url = new URL(page.url)
45
+ const fieldsKeys = jsonParse<string[]>(page.url.searchParams.get(paramKey), [])
43
46
  if (!fieldsKeys.includes(fieldKey)) fieldsKeys.push(fieldKey)
44
47
  else fieldsKeys.splice(fieldsKeys.indexOf(fieldKey), 1)
45
48
 
@@ -52,78 +55,87 @@
52
55
  function handleReorder(newFieldsOrder: TableField<Item>[]) {
53
56
  fields = newFieldsOrder
54
57
  const fieldsOrder = fields.map((f) => f.key)
55
- const newUrl = $urlParam.with({ [KEY_FIELDS_ORDER]: JSON.stringify(fieldsOrder) })
58
+ const newUrl = urlParam.with({
59
+ [KEY_FIELDS_ORDER]: JSON.stringify(fieldsOrder)
60
+ })
56
61
  goto(newUrl, { replaceState: true, noScroll: true, keepFocus: true })
57
62
  }
58
63
  </script>
59
64
 
60
65
  <th class="sticky right-0 z-10 p-0 px-1" align="right">
61
66
  <DropDown
62
- bind:tip
63
67
  hideOnNav={false}
64
68
  class="max-h-none px-0"
65
69
  tippyProps={{ appendTo: () => document.body, placement: 'bottom-end' }}
66
70
  >
67
- <button slot="activator" type="button" class="btn btn-square btn-ghost btn-sm backdrop-blur">
68
- <Icon path={mdiDotsHorizontal} title="Définir les champs" />
69
- </button>
71
+ {#snippet activator()}
72
+ <button
73
+ type="button"
74
+ class="btn btn-square btn-ghost backdrop-blur btn-sm"
75
+ use:tip={{ content: 'Dénfinir les champs' }}
76
+ >
77
+ <EllipsisIcon />
78
+ </button>
79
+ {/snippet}
80
+
81
+ {#snippet children({ tip })}
82
+ {#if onCreateField}
83
+ <div class="bordered flex items-center gap-2 border-b pr-1 pb-1 pl-2">
84
+ <span class=" font-semibold opacity-70">Champs</span>
85
+ <button
86
+ type="button"
87
+ class="btn ml-auto btn-square btn-sm"
88
+ onclick={() => {
89
+ if (onCreateField) onCreateField()
90
+ tip?.hide()
91
+ }}
92
+ >
93
+ <PlusIcon title="Ajouter un champ" />
94
+ </button>
95
+ </div>
96
+ {/if}
70
97
 
71
- {#if onCreateField}
72
- <div class="bordered flex items-center gap-2 border-b pr-1 pb-1 pl-2">
73
- <span class=" font-semibold opacity-70">Champs</span>
74
- <button
75
- type="button"
76
- class="btn btn-square btn-sm ml-auto"
77
- on:click={() => {
78
- if (onCreateField) onCreateField()
79
- tip.hide()
98
+ <div class="max-h-125 overflow-auto px-1 pt-1">
99
+ <div
100
+ use:listEditable={{
101
+ items: fields,
102
+ onChange: handleReorder,
103
+ dragElementsSelector: '.drag-button'
80
104
  }}
81
105
  >
82
- <Icon path={mdiPlus} title="Ajouter un champ" />
83
- </button>
84
- </div>
85
- {/if}
86
-
87
- <div class="max-h-[500px] overflow-auto px-1 pt-1">
88
- <div
89
- use:listEditable={{
90
- items: fields,
91
- onChange: handleReorder,
92
- dragElementsSelector: '.drag-button'
93
- }}
94
- >
95
- {#each fields as field (field.key)}
96
- <a
97
- draggable="false"
98
- href={getFieldHref(field)}
99
- class="menu-item w-full"
100
- class:disabled={field.locked}
101
- data-sveltekit-keepfocus
102
- data-sveltekit-replacestate
103
- data-sveltekit-noscroll
104
- >
105
- {#if field.locked}
106
- <Icon path={mdiCheck} class="fill-base-content/50" size={21} />
107
- {:else if $urlParam.has(field.key)}
108
- <Icon path={mdiCheckCircleOutline} class="fill-primary" size={21} />
109
- {:else if field._visible}
110
- <Icon path={mdiCheck} class="fill-success" size={21} />
111
- {:else}
112
- <Icon path={mdiCircleSmall} class="fill-base-content/50" size={21} />
113
- {/if}
106
+ {#each fields as field (field.key)}
107
+ <a
108
+ draggable="false"
109
+ href={getFieldHref(field)}
110
+ class="menu-item w-full"
111
+ class:disabled={field.locked}
112
+ data-sveltekit-keepfocus
113
+ data-sveltekit-replacestate
114
+ data-sveltekit-noscroll
115
+ >
116
+ {#if field.locked}
117
+ <CheckIcon class="fill-base-content/50" size={21} />
118
+ {:else if param.has(field.key)}
119
+ <CircleCheckIcon class="fill-primary" size={21} />
120
+ {:else if field._visible}
121
+ <CheckIcon class="fill-success" size={21} />
122
+ {:else}
123
+ <CircleIcon class="fill-base-content/50" size={21} />
124
+ {/if}
114
125
 
115
- <span>{field.label}</span>
126
+ <span>{field.label}</span>
116
127
 
117
- <span
118
- class="drag-button btn btn-square btn-ghost btn-xs ml-auto"
119
- on:click|preventDefault
120
- role="none"
121
- >
122
- <Icon path={mdiDrag} size={18} class="fill-base-content/80" />
123
- </span>
124
- </a>
125
- {/each}
128
+ <span
129
+ class="drag-button btn ml-auto btn-square btn-ghost btn-xs"
130
+ onclick={(e) => e.preventDefault()}
131
+ role="none"
132
+ >
133
+ <GripIcon size={18} class="fill-base-content/80" />
134
+ </span>
135
+ </a>
136
+ {/each}
137
+ </div>
126
138
  </div>
127
- </div>
139
+ {/snippet}
128
140
  </DropDown>
129
141
  </th>
@@ -1,26 +1,27 @@
1
1
  import type { ItemBase, TableField } from './index.js';
2
- declare class __sveltets_Render<Item extends ItemBase> {
3
- props(): {
2
+ declare function $$render<Item extends ItemBase>(): {
3
+ props: {
4
4
  fields: TableField<Item>[];
5
5
  key: string;
6
- onCreateField?: (() => void) | undefined;
7
- };
8
- events(): {
9
- click: PointerEvent;
10
- } & {
11
- [evt: string]: CustomEvent<any>;
6
+ onCreateField?: () => void;
12
7
  };
13
- slots(): {};
14
- bindings(): string;
8
+ exports: {};
9
+ bindings: "";
10
+ slots: {};
11
+ events: {};
12
+ };
13
+ declare class __sveltets_Render<Item extends ItemBase> {
14
+ props(): ReturnType<typeof $$render<Item>>['props'];
15
+ events(): ReturnType<typeof $$render<Item>>['events'];
16
+ slots(): ReturnType<typeof $$render<Item>>['slots'];
17
+ bindings(): "";
15
18
  exports(): {};
16
19
  }
17
20
  interface $$IsomorphicComponent {
18
21
  new <Item extends ItemBase>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Item>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Item>['props']>, ReturnType<__sveltets_Render<Item>['events']>, ReturnType<__sveltets_Render<Item>['slots']>> & {
19
22
  $$bindings?: ReturnType<__sveltets_Render<Item>['bindings']>;
20
23
  } & ReturnType<__sveltets_Render<Item>['exports']>;
21
- <Item extends ItemBase>(internal: unknown, props: ReturnType<__sveltets_Render<Item>['props']> & {
22
- $$events?: ReturnType<__sveltets_Render<Item>['events']>;
23
- }): ReturnType<__sveltets_Render<Item>['exports']>;
24
+ <Item extends ItemBase>(internal: unknown, props: ReturnType<__sveltets_Render<Item>['props']> & {}): ReturnType<__sveltets_Render<Item>['exports']>;
24
25
  z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
25
26
  }
26
27
  declare const TableFieldsEdition: $$IsomorphicComponent;
@@ -20,7 +20,7 @@
20
20
  } = $props()
21
21
  </script>
22
22
 
23
- <thead class="bg-base-100 sticky top-0 z-10">
23
+ <thead class="sticky top-0 z-10 bg-base-100">
24
24
  <tr class="shadow">
25
25
  {#each fields.filter((f) => f._visible) as field (field.key)}
26
26
  {#if !field.type}