dinocollab-core 1.0.1 → 1.0.2

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 (385) hide show
  1. package/dist/_virtual/_rollupPluginBabelHelpers.js +67 -10
  2. package/dist/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
  3. package/dist/{src/api-context → api-context}/alert-global.js +49 -34
  4. package/dist/api-context/alert-global.js.map +1 -0
  5. package/dist/{src/api-context → api-context}/drawer-global.js +40 -33
  6. package/dist/api-context/drawer-global.js.map +1 -0
  7. package/dist/{src/api-context → api-context}/global-modal.js +40 -32
  8. package/dist/api-context/global-modal.js.map +1 -0
  9. package/dist/{src/api-context → api-context}/popover-global.js +44 -36
  10. package/dist/api-context/popover-global.js.map +1 -0
  11. package/dist/api-context/popover.js +94 -0
  12. package/dist/api-context/popover.js.map +1 -0
  13. package/dist/{src/api-context → api-context}/ui.units.js +12 -10
  14. package/dist/api-context/ui.units.js.map +1 -0
  15. package/dist/components/breadcrumbs.js +65 -0
  16. package/dist/components/breadcrumbs.js.map +1 -0
  17. package/dist/{src/components → components}/copy-to-clipboard.js +39 -32
  18. package/dist/components/copy-to-clipboard.js.map +1 -0
  19. package/dist/components/help-tooltip.js +104 -0
  20. package/dist/components/help-tooltip.js.map +1 -0
  21. package/dist/components/image-with-fallback.js +51 -0
  22. package/dist/components/image-with-fallback.js.map +1 -0
  23. package/dist/{src/components → components}/text-editor.js +24 -23
  24. package/dist/components/text-editor.js.map +1 -0
  25. package/dist/components/text-editor.preview.js +27 -0
  26. package/dist/components/text-editor.preview.js.map +1 -0
  27. package/dist/form/create.autocomplete.chips.js +228 -0
  28. package/dist/form/create.autocomplete.chips.js.map +1 -0
  29. package/dist/{src/form → form}/create.date-expired.js +71 -61
  30. package/dist/form/create.date-expired.js.map +1 -0
  31. package/dist/{src/form → form}/create.date-picker.js +40 -37
  32. package/dist/form/create.date-picker.js.map +1 -0
  33. package/dist/{src/form → form}/create.form-base.js +47 -41
  34. package/dist/form/create.form-base.js.map +1 -0
  35. package/dist/form/create.form-comfirm.js +131 -0
  36. package/dist/form/create.form-comfirm.js.map +1 -0
  37. package/dist/form/create.form-grid-layout.js +188 -0
  38. package/dist/form/create.form-grid-layout.js.map +1 -0
  39. package/dist/{src/form → form}/create.form-grid-layout.units.js +17 -14
  40. package/dist/form/create.form-grid-layout.units.js.map +1 -0
  41. package/dist/form/create.input.file.js +79 -0
  42. package/dist/form/create.input.file.js.map +1 -0
  43. package/dist/form/create.input.js +276 -0
  44. package/dist/form/create.input.js.map +1 -0
  45. package/dist/form/create.select-simple.js +114 -0
  46. package/dist/form/create.select-simple.js.map +1 -0
  47. package/dist/form/create.select-with-api.js +277 -0
  48. package/dist/form/create.select-with-api.js.map +1 -0
  49. package/dist/form/create.text-editor.js +181 -0
  50. package/dist/form/create.text-editor.js.map +1 -0
  51. package/dist/{src/form → form}/dino-form.js +17 -18
  52. package/dist/form/dino-form.js.map +1 -0
  53. package/dist/{src/form → form}/helper.js +14 -14
  54. package/dist/form/helper.js.map +1 -0
  55. package/dist/{src/form → form}/modal-wrapper.js +32 -25
  56. package/dist/form/modal-wrapper.js.map +1 -0
  57. package/dist/{src/form → form}/validator.js +47 -43
  58. package/dist/form/validator.js.map +1 -0
  59. package/dist/{src/hooks → hooks}/index.js +1 -1
  60. package/dist/hooks/index.js.map +1 -0
  61. package/dist/index.d.ts +928 -0
  62. package/dist/{src/index.js → index.js} +10 -3
  63. package/dist/{src/index.js.map → index.js.map} +1 -1
  64. package/dist/redux/create.hoc-lazy.js +71 -0
  65. package/dist/redux/create.hoc-lazy.js.map +1 -0
  66. package/dist/{src/redux → redux}/dino.js +2 -2
  67. package/dist/redux/dino.js.map +1 -0
  68. package/dist/redux/types.js.map +1 -0
  69. package/dist/redux/ui.error-page.js +89 -0
  70. package/dist/redux/ui.error-page.js.map +1 -0
  71. package/dist/redux/vector-404.webp.js.map +1 -0
  72. package/dist/{src/table → table}/context.js +5 -2
  73. package/dist/table/context.js.map +1 -0
  74. package/dist/table/create.action-row.js +144 -0
  75. package/dist/table/create.action-row.js.map +1 -0
  76. package/dist/table/create.table.js +246 -0
  77. package/dist/table/create.table.js.map +1 -0
  78. package/dist/{src/table → table}/custom.filter-operators.js +2 -2
  79. package/dist/table/custom.filter-operators.js.map +1 -0
  80. package/dist/table/dino.js +136 -0
  81. package/dist/table/dino.js.map +1 -0
  82. package/dist/{src/table → table}/helpers.js +31 -32
  83. package/dist/table/helpers.js.map +1 -0
  84. package/dist/table/model-filter.js.map +1 -0
  85. package/dist/table/toolbar-pannel.js +143 -0
  86. package/dist/table/toolbar-pannel.js.map +1 -0
  87. package/dist/table/ui.buttons.js +67 -0
  88. package/dist/table/ui.buttons.js.map +1 -0
  89. package/dist/table/ui.units.js +248 -0
  90. package/dist/table/ui.units.js.map +1 -0
  91. package/dist/types/api-context/alert-global.d.ts +29 -0
  92. package/dist/types/api-context/drawer-global.d.ts +32 -0
  93. package/dist/types/api-context/global-modal.d.ts +37 -0
  94. package/dist/types/api-context/index.d.ts +9 -0
  95. package/dist/types/api-context/popover-global.d.ts +37 -0
  96. package/dist/types/api-context/popover.d.ts +32 -0
  97. package/dist/types/api-context/ui.units.d.ts +2 -0
  98. package/dist/types/components/breadcrumbs.d.ts +13 -0
  99. package/dist/types/components/copy-to-clipboard.d.ts +26 -0
  100. package/dist/types/components/help-tooltip.d.ts +15 -0
  101. package/dist/types/components/image-with-fallback.d.ts +13 -0
  102. package/dist/types/components/index.d.ts +11 -0
  103. package/dist/types/components/input-debounce-timer.d.ts +9 -0
  104. package/dist/types/components/loading-buttons.d.ts +6 -0
  105. package/dist/types/components/text-editor.d.ts +26 -0
  106. package/dist/types/components/text-editor.preview.d.ts +5 -0
  107. package/dist/types/form/create.autocomplete.chips.d.ts +16 -0
  108. package/dist/types/form/create.date-expired.d.ts +19 -0
  109. package/dist/types/form/create.date-picker.d.ts +19 -0
  110. package/dist/types/form/create.form-base.d.ts +30 -0
  111. package/dist/types/form/create.form-comfirm.d.ts +20 -0
  112. package/dist/types/form/create.form-grid-layout.d.ts +44 -0
  113. package/dist/types/form/create.form-grid-layout.units.d.ts +8 -0
  114. package/dist/types/form/create.input.d.ts +29 -0
  115. package/dist/types/form/create.input.file.d.ts +16 -0
  116. package/dist/types/form/create.select-simple.d.ts +24 -0
  117. package/dist/types/form/create.select-with-api.d.ts +29 -0
  118. package/dist/types/form/create.text-editor.d.ts +42 -0
  119. package/dist/types/form/dino-form.d.ts +26 -0
  120. package/dist/types/form/helper.d.ts +14 -0
  121. package/dist/types/form/index.d.ts +7 -0
  122. package/dist/types/form/modal-wrapper.d.ts +14 -0
  123. package/dist/types/form/types.d.ts +15 -0
  124. package/dist/types/form/validator.d.ts +64 -0
  125. package/dist/types/hooks/index.d.ts +4 -0
  126. package/dist/types/index.d.ts +7 -0
  127. package/dist/types/lab/create.autocomplete.simple.d.ts +19 -0
  128. package/dist/types/lab/create.dino-store.d.ts +1 -0
  129. package/dist/types/lab/create.multi-select-dropdown.d.ts +23 -0
  130. package/dist/types/lab/create.select-mul-with-api/index.d.ts +26 -0
  131. package/dist/types/lab/create.select-mul-with-api/table-custom.d.ts +43 -0
  132. package/dist/types/lab/create.select-mul-with-api/types.d.ts +21 -0
  133. package/dist/types/lab/create.select-mul-with-api/ui.units.d.ts +29 -0
  134. package/dist/types/lab/filter-bar/base.d.ts +34 -0
  135. package/dist/types/lab/filter-bar/create.filter-bar.d.ts +92 -0
  136. package/dist/types/lab/filter-bar/create.filter-menu.d.ts +66 -0
  137. package/dist/types/lab/filter-bar/create.filter-panel.d.ts +117 -0
  138. package/dist/types/lab/filter-bar/create.filtered.d.ts +59 -0
  139. package/dist/types/lab/filter-bar/create.sort-menu.d.ts +7 -0
  140. package/dist/types/lab/filter-bar/demo.d.ts +3 -0
  141. package/dist/types/lab/filter-bar/index.d.ts +4 -0
  142. package/dist/types/lab/filter-bar/types.d.ts +81 -0
  143. package/dist/types/lab/filter-bar/ui.units.d.ts +13 -0
  144. package/dist/types/lab/grafana-dashboard/configs.d.ts +4 -0
  145. package/dist/types/lab/grafana-dashboard/date-time-range/absolute-time-rage.d.ts +14 -0
  146. package/dist/types/lab/grafana-dashboard/date-time-range/helpers.d.ts +36 -0
  147. package/dist/types/lab/grafana-dashboard/date-time-range/index.d.ts +24 -0
  148. package/dist/types/lab/grafana-dashboard/date-time-range/menu-wrap.d.ts +19 -0
  149. package/dist/types/lab/grafana-dashboard/date-time-range/quick-ranges.d.ts +20 -0
  150. package/dist/types/lab/grafana-dashboard/date-time-range/types.d.ts +8 -0
  151. package/dist/types/lab/grafana-dashboard/date-time-range/units.d.ts +2 -0
  152. package/dist/types/lab/grafana-dashboard/helper.d.ts +7 -0
  153. package/dist/types/lab/grafana-dashboard/hooks.d.ts +10 -0
  154. package/dist/types/lab/grafana-dashboard/icons.d.ts +5 -0
  155. package/dist/types/lab/grafana-dashboard/index.d.ts +12 -0
  156. package/dist/types/lab/grafana-dashboard/top-bar.d.ts +19 -0
  157. package/dist/types/lab/grafana-dashboard/top-bar.types.d.ts +4 -0
  158. package/dist/types/lab/grafana-dashboard/types.d.ts +8 -0
  159. package/dist/types/lab/media-player.core1.d.ts +14 -0
  160. package/dist/types/lab/media-player.muted.d.ts +10 -0
  161. package/dist/types/lab/media-player.units.d.ts +36 -0
  162. package/dist/types/lab/table-grid/create.table-grid.d.ts +4 -0
  163. package/dist/types/lab/table-grid/demo.d.ts +3 -0
  164. package/dist/types/lab/table-grid/dino.d.ts +6 -0
  165. package/dist/types/lab/table-grid/helpers.d.ts +11 -0
  166. package/dist/types/lab/table-grid/index.d.ts +2 -0
  167. package/dist/types/lab/table-grid/item-actions.d.ts +93 -0
  168. package/dist/types/lab/table-grid/toolbar-pannel.d.ts +27 -0
  169. package/dist/types/lab/table-grid/types.d.ts +56 -0
  170. package/dist/types/redux/create.hoc-lazy.d.ts +19 -0
  171. package/dist/types/redux/dino.d.ts +6 -0
  172. package/dist/types/redux/index.d.ts +4 -0
  173. package/dist/types/redux/types.d.ts +22 -0
  174. package/dist/types/redux/ui.error-page.d.ts +3 -0
  175. package/dist/types/redux/ui.units.d.ts +9 -0
  176. package/dist/types/table/context.d.ts +8 -0
  177. package/dist/types/table/create.action-row.d.ts +16 -0
  178. package/dist/types/table/create.table.d.ts +33 -0
  179. package/dist/types/table/custom.filter-operators.d.ts +2 -0
  180. package/dist/types/table/dino.d.ts +41 -0
  181. package/dist/types/table/helpers.d.ts +23 -0
  182. package/dist/types/table/index.d.ts +7 -0
  183. package/dist/types/table/model-filter.d.ts +38 -0
  184. package/dist/types/table/toolbar-pannel.d.ts +18 -0
  185. package/dist/types/table/types.d.ts +40 -0
  186. package/dist/types/table/ui.buttons.d.ts +16 -0
  187. package/dist/types/table/ui.units.d.ts +62 -0
  188. package/dist/types/utils/dayjs-config.d.ts +2 -0
  189. package/dist/types/utils/helpers.d.ts +35 -0
  190. package/dist/types/utils/index.d.ts +4 -0
  191. package/dist/types/utils/json-object.d.ts +9 -0
  192. package/dist/types/utils/mfe-events.d.ts +12 -0
  193. package/dist/types/utils/query-param.d.ts +25 -0
  194. package/dist/utils/dayjs-config.js.map +1 -0
  195. package/dist/{src/utils → utils}/helpers.js +11 -9
  196. package/dist/utils/helpers.js.map +1 -0
  197. package/dist/{src/utils → utils}/json-object.js +13 -13
  198. package/dist/utils/json-object.js.map +1 -0
  199. package/dist/{src/utils → utils}/query-param.js +17 -17
  200. package/dist/utils/query-param.js.map +1 -0
  201. package/package.json +18 -4
  202. package/dist/node_modules/.pnpm/@rollup_plugin-typescript@1_d0d2002d9033600b6738d939bd598bc6/node_modules/tslib/tslib.es6.js +0 -46
  203. package/dist/node_modules/.pnpm/@rollup_plugin-typescript@1_d0d2002d9033600b6738d939bd598bc6/node_modules/tslib/tslib.es6.js.map +0 -1
  204. package/dist/src/api-context/alert-global.js.map +0 -1
  205. package/dist/src/api-context/drawer-global.js.map +0 -1
  206. package/dist/src/api-context/global-modal.js.map +0 -1
  207. package/dist/src/api-context/popover-global.js.map +0 -1
  208. package/dist/src/api-context/popover.js +0 -86
  209. package/dist/src/api-context/popover.js.map +0 -1
  210. package/dist/src/api-context/ui.units.js.map +0 -1
  211. package/dist/src/components/copy-to-clipboard.js.map +0 -1
  212. package/dist/src/components/custom.breadcrumbs.js +0 -61
  213. package/dist/src/components/custom.breadcrumbs.js.map +0 -1
  214. package/dist/src/components/help-tooltip.js +0 -91
  215. package/dist/src/components/help-tooltip.js.map +0 -1
  216. package/dist/src/components/image-with-fallback.js +0 -48
  217. package/dist/src/components/image-with-fallback.js.map +0 -1
  218. package/dist/src/components/text-editor.js.map +0 -1
  219. package/dist/src/form/create.autocomplete.chips.js +0 -218
  220. package/dist/src/form/create.autocomplete.chips.js.map +0 -1
  221. package/dist/src/form/create.date-expired.js.map +0 -1
  222. package/dist/src/form/create.date-picker.js.map +0 -1
  223. package/dist/src/form/create.form-base.js.map +0 -1
  224. package/dist/src/form/create.form-comfirm.js +0 -119
  225. package/dist/src/form/create.form-comfirm.js.map +0 -1
  226. package/dist/src/form/create.form-grid-layout.js +0 -177
  227. package/dist/src/form/create.form-grid-layout.js.map +0 -1
  228. package/dist/src/form/create.form-grid-layout.units.js.map +0 -1
  229. package/dist/src/form/create.input-base.js +0 -260
  230. package/dist/src/form/create.input-base.js.map +0 -1
  231. package/dist/src/form/create.input.file.js +0 -74
  232. package/dist/src/form/create.input.file.js.map +0 -1
  233. package/dist/src/form/create.select-simple.js +0 -104
  234. package/dist/src/form/create.select-simple.js.map +0 -1
  235. package/dist/src/form/create.select-with-api.js +0 -271
  236. package/dist/src/form/create.select-with-api.js.map +0 -1
  237. package/dist/src/form/create.text-editor.js +0 -156
  238. package/dist/src/form/create.text-editor.js.map +0 -1
  239. package/dist/src/form/dino-form.js.map +0 -1
  240. package/dist/src/form/helper.js.map +0 -1
  241. package/dist/src/form/modal-wrapper.js.map +0 -1
  242. package/dist/src/form/validator.js.map +0 -1
  243. package/dist/src/hooks/index.js.map +0 -1
  244. package/dist/src/redux/create.hoc-lazy.js +0 -67
  245. package/dist/src/redux/create.hoc-lazy.js.map +0 -1
  246. package/dist/src/redux/dino.js.map +0 -1
  247. package/dist/src/redux/types.js.map +0 -1
  248. package/dist/src/redux/ui.error-page.js +0 -80
  249. package/dist/src/redux/ui.error-page.js.map +0 -1
  250. package/dist/src/redux/vector-404.webp.js.map +0 -1
  251. package/dist/src/table/context.js.map +0 -1
  252. package/dist/src/table/create.action-row.js +0 -135
  253. package/dist/src/table/create.action-row.js.map +0 -1
  254. package/dist/src/table/create.status-cell.js +0 -49
  255. package/dist/src/table/create.status-cell.js.map +0 -1
  256. package/dist/src/table/create.table.js +0 -233
  257. package/dist/src/table/create.table.js.map +0 -1
  258. package/dist/src/table/custom.filter-operators.js.map +0 -1
  259. package/dist/src/table/dino.js +0 -129
  260. package/dist/src/table/dino.js.map +0 -1
  261. package/dist/src/table/helpers.js.map +0 -1
  262. package/dist/src/table/model-filter.js.map +0 -1
  263. package/dist/src/table/toolbar-pannel.js +0 -134
  264. package/dist/src/table/toolbar-pannel.js.map +0 -1
  265. package/dist/src/table/ui.buttons.js +0 -60
  266. package/dist/src/table/ui.buttons.js.map +0 -1
  267. package/dist/src/table/ui.units.js +0 -201
  268. package/dist/src/table/ui.units.js.map +0 -1
  269. package/dist/src/utils/dayjs-config.js.map +0 -1
  270. package/dist/src/utils/helpers.js.map +0 -1
  271. package/dist/src/utils/json-object.js.map +0 -1
  272. package/dist/src/utils/query-param.js.map +0 -1
  273. package/rollup.config.js +0 -39
  274. package/src/@types/global.d.ts +0 -5
  275. package/src/api-context/alert-global.tsx +0 -174
  276. package/src/api-context/drawer-global.tsx +0 -116
  277. package/src/api-context/global-modal.tsx +0 -109
  278. package/src/api-context/index.ts +0 -13
  279. package/src/api-context/popover-global.tsx +0 -107
  280. package/src/api-context/popover.tsx +0 -89
  281. package/src/api-context/ui.units.tsx +0 -10
  282. package/src/components/copy-to-clipboard.tsx +0 -86
  283. package/src/components/custom.breadcrumbs.tsx +0 -67
  284. package/src/components/help-tooltip.tsx +0 -75
  285. package/src/components/image-with-fallback.tsx +0 -51
  286. package/src/components/index.tsx +0 -1
  287. package/src/components/input-debounce-timer.tsx +0 -138
  288. package/src/components/loading-buttons.tsx +0 -35
  289. package/src/components/text-editor.preview.tsx +0 -30
  290. package/src/components/text-editor.tsx +0 -125
  291. package/src/form/README.md +0 -55
  292. package/src/form/create.autocomplete.chips.tsx +0 -199
  293. package/src/form/create.date-expired.tsx +0 -195
  294. package/src/form/create.date-picker.tsx +0 -122
  295. package/src/form/create.form-base.tsx +0 -102
  296. package/src/form/create.form-comfirm.tsx +0 -83
  297. package/src/form/create.form-grid-layout.tsx +0 -170
  298. package/src/form/create.form-grid-layout.units.tsx +0 -37
  299. package/src/form/create.input-base.tsx +0 -222
  300. package/src/form/create.input.file.tsx +0 -76
  301. package/src/form/create.select-simple.tsx +0 -101
  302. package/src/form/create.select-with-api.tsx +0 -213
  303. package/src/form/create.text-editor.tsx +0 -161
  304. package/src/form/dino-form.tsx +0 -40
  305. package/src/form/helper.ts +0 -132
  306. package/src/form/index.ts +0 -12
  307. package/src/form/modal-wrapper.tsx +0 -75
  308. package/src/form/types.ts +0 -16
  309. package/src/form/validator.ts +0 -202
  310. package/src/hooks/index.ts +0 -44
  311. package/src/index.ts +0 -7
  312. package/src/lab/create.autocomplete.simple.tsx +0 -57
  313. package/src/lab/create.dino-store.ts +0 -59
  314. package/src/lab/create.multi-select-dropdown.tsx +0 -189
  315. package/src/lab/create.select-mul-with-api/index.tsx +0 -271
  316. package/src/lab/create.select-mul-with-api/table-custom.tsx +0 -194
  317. package/src/lab/create.select-mul-with-api/types.ts +0 -26
  318. package/src/lab/create.select-mul-with-api/ui.units.tsx +0 -163
  319. package/src/lab/filter-bar/base.tsx +0 -162
  320. package/src/lab/filter-bar/create.filter-bar.tsx +0 -190
  321. package/src/lab/filter-bar/create.filter-menu.tsx +0 -156
  322. package/src/lab/filter-bar/create.filter-panel.tsx +0 -95
  323. package/src/lab/filter-bar/create.filtered.tsx +0 -41
  324. package/src/lab/filter-bar/create.sort-menu.tsx +0 -43
  325. package/src/lab/filter-bar/demo.tsx +0 -50
  326. package/src/lab/filter-bar/index.ts +0 -6
  327. package/src/lab/filter-bar/types.ts +0 -105
  328. package/src/lab/filter-bar/ui.units.tsx +0 -70
  329. package/src/lab/grafana-dashboard/configs.ts +0 -43
  330. package/src/lab/grafana-dashboard/date-time-range/absolute-time-rage.tsx +0 -137
  331. package/src/lab/grafana-dashboard/date-time-range/helpers.ts +0 -126
  332. package/src/lab/grafana-dashboard/date-time-range/index.tsx +0 -62
  333. package/src/lab/grafana-dashboard/date-time-range/menu-wrap.tsx +0 -101
  334. package/src/lab/grafana-dashboard/date-time-range/quick-ranges.tsx +0 -161
  335. package/src/lab/grafana-dashboard/date-time-range/types.ts +0 -9
  336. package/src/lab/grafana-dashboard/date-time-range/units.tsx +0 -18
  337. package/src/lab/grafana-dashboard/helper.ts +0 -25
  338. package/src/lab/grafana-dashboard/hooks.tsx +0 -79
  339. package/src/lab/grafana-dashboard/icons.tsx +0 -67
  340. package/src/lab/grafana-dashboard/index.tsx +0 -120
  341. package/src/lab/grafana-dashboard/top-bar.tsx +0 -62
  342. package/src/lab/grafana-dashboard/top-bar.types.ts +0 -5
  343. package/src/lab/grafana-dashboard/types.ts +0 -8
  344. package/src/lab/media-player.core1.tsx +0 -273
  345. package/src/lab/media-player.muted.tsx +0 -62
  346. package/src/lab/media-player.units.ts +0 -80
  347. package/src/lab/table-grid/create.table-grid.tsx +0 -183
  348. package/src/lab/table-grid/demo.tsx +0 -53
  349. package/src/lab/table-grid/dino.tsx +0 -8
  350. package/src/lab/table-grid/helpers.tsx +0 -11
  351. package/src/lab/table-grid/index.ts +0 -3
  352. package/src/lab/table-grid/item-actions.tsx +0 -138
  353. package/src/lab/table-grid/toolbar-pannel.tsx +0 -98
  354. package/src/lab/table-grid/types.ts +0 -68
  355. package/src/redux/create.hoc-lazy.tsx +0 -80
  356. package/src/redux/dino.ts +0 -9
  357. package/src/redux/index.ts +0 -6
  358. package/src/redux/types.ts +0 -27
  359. package/src/redux/ui.error-page.tsx +0 -62
  360. package/src/redux/ui.units.tsx +0 -41
  361. package/src/redux/vector-404.webp +0 -0
  362. package/src/table/context.tsx +0 -16
  363. package/src/table/create.action-row.tsx +0 -91
  364. package/src/table/create.status-cell.tsx +0 -51
  365. package/src/table/create.table.tsx +0 -239
  366. package/src/table/custom.filter-operators.ts +0 -94
  367. package/src/table/dino.tsx +0 -120
  368. package/src/table/helpers.ts +0 -94
  369. package/src/table/index.ts +0 -13
  370. package/src/table/model-filter.ts +0 -43
  371. package/src/table/toolbar-pannel.tsx +0 -106
  372. package/src/table/types.ts +0 -50
  373. package/src/table/ui.buttons.tsx +0 -54
  374. package/src/table/ui.units.tsx +0 -189
  375. package/src/utils/dayjs-config.ts +0 -13
  376. package/src/utils/helpers.ts +0 -171
  377. package/src/utils/index.ts +0 -7
  378. package/src/utils/json-object.ts +0 -29
  379. package/src/utils/mfe-events.tsx +0 -34
  380. package/src/utils/query-param.ts +0 -129
  381. package/tsconfig.json +0 -20
  382. /package/dist/{src/redux → redux}/types.js +0 -0
  383. /package/dist/{src/redux → redux}/vector-404.webp.js +0 -0
  384. /package/dist/{src/table → table}/model-filter.js +0 -0
  385. /package/dist/{src/utils → utils}/dayjs-config.js +0 -0
@@ -0,0 +1,22 @@
1
+ export declare enum ELazyStatus {
2
+ Loading = "Loading",
3
+ Loaded = "Loaded",
4
+ Error = "Error"
5
+ }
6
+ export interface IDinoReduxState {
7
+ status: ELazyStatus;
8
+ requestedId?: string;
9
+ }
10
+ export interface IReturnDispatch {
11
+ abort?: () => void;
12
+ }
13
+ export interface IDinoReduxDispatch<P = any> {
14
+ fetchData?: (params?: P, signal?: AbortSignal) => IReturnDispatch;
15
+ setStatus: (status: ELazyStatus) => void;
16
+ }
17
+ export interface IBaseActions<T, Id extends keyof T> {
18
+ create: (value: Partial<T>, signal?: AbortSignal) => Promise<void>;
19
+ update: (id: T[Id], value: Partial<T>, signal?: AbortSignal) => Promise<void>;
20
+ delete: (id: T[Id], value?: Partial<T>, signal?: AbortSignal) => Promise<void>;
21
+ }
22
+ export type IDinoReduxActions<T, Id extends keyof T, K extends keyof IBaseActions<T, Id> = keyof IBaseActions<T, Id>> = Pick<IBaseActions<T, Id>, K>;
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ declare const UIErrorPage: FC;
3
+ export default UIErrorPage;
@@ -0,0 +1,9 @@
1
+ import { FC, PropsWithChildren } from 'react';
2
+ export interface IErrorViewDefaultProps {
3
+ }
4
+ export declare const ErrorViewDefault: FC<IErrorViewDefaultProps>;
5
+ export interface IHocLazyWrapperProps extends PropsWithChildren {
6
+ loading?: boolean;
7
+ backdrop?: boolean;
8
+ }
9
+ export declare const HocLazyWrapper: FC<IHocLazyWrapperProps>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { TCloseModal, TShowModal } from '../api-context';
3
+ export interface ITableBaseContext {
4
+ showModal: TShowModal;
5
+ closeModal: TCloseModal;
6
+ }
7
+ export declare const TableBaseContext: React.Context<ITableBaseContext>;
8
+ export declare const MapTableBaseContext: (context: (context: ITableBaseContext) => React.ReactNode) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import React, { ComponentType } from 'react';
2
+ import { BoxProps } from '@mui/material';
3
+ import { GlobalModalState } from '../api-context';
4
+ import { ITableBaseContext } from './context';
5
+ export interface IActionRowProps<T> {
6
+ value: T;
7
+ formEdit?: (value: T, tableContext: ITableBaseContext) => React.ReactNode;
8
+ formDelete?: (value: T, tableContext: ITableBaseContext) => React.ReactNode;
9
+ after?: (value: T, tableContext: ITableBaseContext) => React.ReactNode;
10
+ before?: (value: T, tableContext: ITableBaseContext) => React.ReactNode;
11
+ wrapProps?: BoxProps;
12
+ buttonEditConfig?: GlobalModalState;
13
+ buttonDeleteConfig?: GlobalModalState;
14
+ }
15
+ declare function CreateActionRow<T>(params?: Omit<IActionRowProps<T>, 'value'>): ComponentType<IActionRowProps<T>>;
16
+ export default CreateActionRow;
@@ -0,0 +1,33 @@
1
+ import React, { ComponentType } from 'react';
2
+ import { DataGridProps, GridColDef, GridFeatureMode, GridFilterOperator } from '@mui/x-data-grid';
3
+ import { GridValidRowModel, GridRowIdGetter } from '@mui/x-data-grid';
4
+ import { GridDensity } from '@mui/x-data-grid';
5
+ import { IActionRowProps } from './create.action-row';
6
+ import { ICustomGridColDef, ITableData, ITableQueryParams } from './types';
7
+ import { IToolbarPannelProps } from './toolbar-pannel';
8
+ export interface ITableSlots<T> {
9
+ maxSelection?: number;
10
+ density?: GridDensity;
11
+ toolbar?: React.ComponentType<IToolbarPannelProps>;
12
+ actionRow?: React.ComponentType<IActionRowProps<T>>;
13
+ toolbarProps?: IToolbarPannelProps;
14
+ dataGridProps?: DataGridProps;
15
+ }
16
+ export type ITableParamsSlots<T> = Pick<ITableSlots<T>, 'maxSelection' | 'toolbarProps' | 'dataGridProps'>;
17
+ export interface ITableProps<T> {
18
+ data?: ITableData<T>;
19
+ query?: ITableQueryParams<T>;
20
+ onChange?: (query: ITableQueryParams<T>) => void;
21
+ onRowSelectionChange?: DataGridProps['onRowSelectionModelChange'];
22
+ slots?: ITableSlots<T>;
23
+ }
24
+ export interface ITableParams<T extends GridValidRowModel> extends ITableParamsSlots<T> {
25
+ featureMode?: GridFeatureMode;
26
+ getRowId: GridRowIdGetter<T>;
27
+ columns: ICustomGridColDef<T>;
28
+ filterOperators?: (config: GridColDef) => GridFilterOperator[];
29
+ columnVisibilityModel?: Partial<Record<keyof T, boolean>>;
30
+ actionRow?: Omit<GridColDef, 'field'>;
31
+ }
32
+ declare function CreateTable<T extends GridValidRowModel>(params: ITableParams<T>): ComponentType<ITableProps<T>>;
33
+ export default CreateTable;
@@ -0,0 +1,2 @@
1
+ import { GridColDef } from '@mui/x-data-grid';
2
+ export declare const customFilterOperators: (option: GridColDef) => import("@mui/x-data-grid").GridFilterOperator<any, string | number | null, any>[] | import("@mui/x-data-grid").GridFilterOperator<any, boolean | null, any>[] | import("@mui/x-data-grid").GridFilterOperator<any, Date, any>[];
@@ -0,0 +1,41 @@
1
+ import { FC } from 'react';
2
+ import { GridRenderCellParams, GridTreeNodeWithRender, GridValueFormatterParams } from '@mui/x-data-grid';
3
+ import { CellBaseOptions, CellChipsProps, CellDatePropsOwner } from './ui.units';
4
+ import { IBreadcrumbConfig } from '../components';
5
+ import { IStatusCellOptions, IStatusCellConfig } from './ui.units';
6
+ import ToolbarPannel, { IToolbarPannelProps } from './toolbar-pannel';
7
+ import CreateTable from './create.table';
8
+ import CreateActionRow from './create.action-row';
9
+ type RenderCellBaseParams<T> = Omit<CellBaseOptions, 'imageUrl'> & {
10
+ imageUrl?: (value: any, model: T) => string;
11
+ valueFormatter?: (value: any, model: T) => string;
12
+ };
13
+ interface FormatterDateOptions {
14
+ formatString?: string;
15
+ showRelative?: boolean;
16
+ }
17
+ declare class DinoTableBase {
18
+ createTable: typeof CreateTable;
19
+ createActionRow: typeof CreateActionRow;
20
+ setUrlQuery: <TModel>(tableInfo: Partial<import("./types").ITableQueryParams<TModel>>, defaultValue: import("./types").ITableQueryParams<TModel>) => void;
21
+ getUrlQuery: <TModel>(defaultValue: import("./types").ITableQueryParams<TModel>) => import("./types").ITableQueryParams<TModel>;
22
+ mapContext: (context: (context: import("./context").ITableBaseContext) => import("react").ReactNode) => import("react/jsx-runtime").JSX.Element;
23
+ ToolbarPannel: typeof ToolbarPannel;
24
+ createToolbar: (props: IToolbarPannelProps) => FC<IToolbarPannelProps>;
25
+ BtnFormDetail: FC<import("./ui.buttons").IBtnFormDetailProps>;
26
+ BtnDetail: FC<import("./ui.buttons").IBtnDetailProps>;
27
+ createBreadcrumbConfigs: (value: IBreadcrumbConfig[]) => IBreadcrumbConfig[];
28
+ createBreadcrumbs: (value: IBreadcrumbConfig[]) => FC;
29
+ createStatusCell: <T extends string>(config: IStatusCellConfig<T>, options?: IStatusCellOptions | undefined) => import("react").ComponentType<import("./ui.units").IStatusCellProps<T>>;
30
+ formatterDate: (value: any, options?: FormatterDateOptions) => string;
31
+ valueFormatterDate: (options?: FormatterDateOptions) => (params: GridValueFormatterParams<any>) => string;
32
+ renderCellChips: (params?: CellChipsProps) => (tableRow: GridRenderCellParams<any, any, any, GridTreeNodeWithRender>) => import("react/jsx-runtime").JSX.Element;
33
+ renderCellStatus: <E extends string>(config: IStatusCellConfig<E>, options?: IStatusCellOptions) => (tableRow: GridRenderCellParams<any, any, any, GridTreeNodeWithRender>) => import("react/jsx-runtime").JSX.Element;
34
+ renderCellBase: <T = any>(options?: RenderCellBaseParams<T> | undefined) => (tableRow: GridRenderCellParams<any, any, any, GridTreeNodeWithRender>) => import("react/jsx-runtime").JSX.Element;
35
+ renderCellImage: <T>(selectImage: (value: T) => T[keyof T], options?: {
36
+ fallbackSrc?: string;
37
+ }) => (tableRow: GridRenderCellParams<any, any, any, GridTreeNodeWithRender>) => import("react/jsx-runtime").JSX.Element;
38
+ renderCellDate: (params?: CellDatePropsOwner) => (tableRow: GridRenderCellParams<any, any, any, GridTreeNodeWithRender>) => import("react/jsx-runtime").JSX.Element;
39
+ }
40
+ declare const DinoTable: DinoTableBase;
41
+ export default DinoTable;
@@ -0,0 +1,23 @@
1
+ import { GridFilterModel, GridSortModel } from '@mui/x-data-grid';
2
+ import { GridInitialStateCommunity } from '@mui/x-data-grid/models/gridStateCommunity';
3
+ import { ICustomGridSortModel, ITableQueryParams, ITableQueryDetail } from './types';
4
+ export declare const dinoTableClasses: {
5
+ whiteSpacePre: string;
6
+ };
7
+ export interface ITableQueryParamModel {
8
+ table?: string;
9
+ }
10
+ declare class TableHelperBase {
11
+ private extractTableQueryParams;
12
+ isEmpty: <T>(value: ITableQueryParams<T>, defaultValue?: ITableQueryParams<T> | undefined) => boolean;
13
+ equalTableQueryParams: <T>(ti1?: ITableQueryParams<T> | undefined, ti2?: ITableQueryParams<T> | undefined) => boolean;
14
+ mapInitialState: <T>(value?: ITableQueryParams<T> | undefined, initialState?: GridInitialStateCommunity) => GridInitialStateCommunity;
15
+ mapSortModel: <T>(value?: ICustomGridSortModel<T> | undefined) => GridSortModel | undefined;
16
+ detectSearchType: (data: GridFilterModel) => ITableQueryDetail;
17
+ private extractToUrlQuery;
18
+ private equals;
19
+ setUrlQuery: <TModel>(tableInfo: Partial<ITableQueryParams<TModel>>, defaultValue: ITableQueryParams<TModel>) => void;
20
+ getUrlQuery: <TModel>(defaultValue: ITableQueryParams<TModel>) => ITableQueryParams<TModel>;
21
+ }
22
+ declare const TableHelper: TableHelperBase;
23
+ export default TableHelper;
@@ -0,0 +1,7 @@
1
+ export * from './types';
2
+ export * from './model-filter';
3
+ export * from './create.action-row';
4
+ export { default as CreateTable } from './create.table';
5
+ export { default as DinoTable } from './dino';
6
+ export { dinoTableClasses } from './helpers';
7
+ export type { IStatusCellConfig } from './ui.units';
@@ -0,0 +1,38 @@
1
+ export declare enum ELogic {
2
+ And = 0,
3
+ Or = 1
4
+ }
5
+ export declare enum EOperator {
6
+ GreaterThan = 0,
7
+ LessThan = 1,
8
+ GreaterThanOrEqual = 2,
9
+ LessThanOrEqual = 3,
10
+ NotEqual = 4,
11
+ Equal = 5,
12
+ Contains = 6
13
+ }
14
+ export declare enum EOrder {
15
+ Ascending = 0,
16
+ Descending = 1
17
+ }
18
+ export interface IFieldFilter<T> {
19
+ Logic?: ELogic;
20
+ Operator?: EOperator;
21
+ FieldName: keyof T;
22
+ Value: string;
23
+ }
24
+ export interface IScopeFilter<T> {
25
+ Logic?: ELogic;
26
+ Scopes: IPropFilter<T>[];
27
+ }
28
+ export type IPropFilter<T> = IFieldFilter<T> | IScopeFilter<T>;
29
+ export interface IPropOrderBy<T> {
30
+ Type: EOrder;
31
+ FieldName: keyof T;
32
+ }
33
+ export interface IModelFilter<T> {
34
+ Page?: number;
35
+ Amount?: number;
36
+ PropFilters?: IPropFilter<T>[];
37
+ PropOrders?: IPropOrderBy<T>[];
38
+ }
@@ -0,0 +1,18 @@
1
+ import React, { Component } from 'react';
2
+ import { IBreadcrumbConfig } from '../components';
3
+ export interface IToolbarPannelOptions {
4
+ searchInclude?: string[];
5
+ formCreate?: React.ReactNode;
6
+ afterAction?: React.ReactNode;
7
+ breadcrumbs?: IBreadcrumbConfig[];
8
+ }
9
+ export interface IToolbarPannelProps extends IToolbarPannelOptions {
10
+ title?: React.ReactNode;
11
+ afterTitle?: React.ReactNode;
12
+ }
13
+ declare class ToolbarPannel extends Component<React.PropsWithChildren<IToolbarPannelProps>> {
14
+ render(): import("react/jsx-runtime").JSX.Element;
15
+ renderTitle: () => import("react/jsx-runtime").JSX.Element;
16
+ renderEndAdornment: () => import("react/jsx-runtime").JSX.Element;
17
+ }
18
+ export default ToolbarPannel;
@@ -0,0 +1,40 @@
1
+ import { GridColDef, GridLogicOperator, GridPaginationModel, GridSortDirection, GridValidRowModel } from '@mui/x-data-grid';
2
+ export type ICustomGridColDef<T extends GridValidRowModel> = {
3
+ [key in keyof T]?: Omit<GridColDef, 'field'>;
4
+ };
5
+ export type ITableQueryDetail = 'filter' | 'quickSearch' | 'sort' | 'pagination' | undefined;
6
+ export interface ICustomGridSortItem<T> {
7
+ field: keyof T;
8
+ sort: GridSortDirection;
9
+ }
10
+ export type ICustomGridSortModel<T> = ICustomGridSortItem<T>[];
11
+ export interface ICustomGridFilterItem<T> {
12
+ id?: number | string;
13
+ field: keyof T;
14
+ value?: any;
15
+ operator: GridLogicOperator;
16
+ }
17
+ export interface ICustomGridFilterModel<T> {
18
+ items: ICustomGridFilterItem<T>[];
19
+ logicOperator?: GridLogicOperator;
20
+ quickFilterValues?: any[];
21
+ quickFilterLogicOperator?: GridLogicOperator;
22
+ quickFilterExcludeHiddenColumns?: boolean;
23
+ }
24
+ export interface ITableQueryParams<T> {
25
+ pagination?: GridPaginationModel;
26
+ filter?: ICustomGridFilterModel<T>;
27
+ sort?: ICustomGridSortModel<T>;
28
+ loading?: boolean;
29
+ detail?: ITableQueryDetail;
30
+ }
31
+ export interface ITableData<T> {
32
+ items?: T[];
33
+ rowTotal?: number;
34
+ }
35
+ export interface ITableState<T> {
36
+ tableData: ITableData<T>;
37
+ tableQueryParams: ITableQueryParams<T>;
38
+ tableQueryThunk: ITableQueryParams<T>;
39
+ }
40
+ export type ITableStateRedux<T, K extends keyof ITableState<T> = keyof ITableState<T>> = Pick<ITableState<T>, K>;
@@ -0,0 +1,16 @@
1
+ import React, { FC } from 'react';
2
+ import { IconButtonProps } from '@mui/material';
3
+ import { TModalReason } from '../api-context';
4
+ export declare const BtnFormCreate: FC<{
5
+ children: React.ReactNode;
6
+ }>;
7
+ export interface IBtnFormDetailProps {
8
+ formDetail: React.ReactNode;
9
+ onOpenModal?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
10
+ onCloseModal?: (reason?: TModalReason) => void;
11
+ }
12
+ export declare const BtnFormDetail: FC<IBtnFormDetailProps>;
13
+ export interface IBtnDetailProps {
14
+ onClick?: IconButtonProps['onClick'];
15
+ }
16
+ export declare const BtnDetail: FC<IBtnDetailProps>;
@@ -0,0 +1,62 @@
1
+ import React, { ComponentType, FC, PropsWithChildren } from 'react';
2
+ import { BoxProps, SxProps, Theme, TypographyProps } from '@mui/material';
3
+ export type IStatusCellConfig<T extends string> = {
4
+ [key in T]: SxProps<Theme>;
5
+ };
6
+ export interface IStatusCellOptions {
7
+ sx?: SxProps<Theme>;
8
+ }
9
+ export interface IStatusCellProps<T extends string> extends PropsWithChildren {
10
+ value?: T;
11
+ title?: string;
12
+ sx?: SxProps<Theme>;
13
+ onClick?: TypographyProps['onClick'];
14
+ slots?: {
15
+ typographyProps?: TypographyProps;
16
+ };
17
+ }
18
+ export declare const CreateStatusCell: <T extends string>(config: IStatusCellConfig<T>, options?: IStatusCellOptions) => React.ComponentType<IStatusCellProps<T>>;
19
+ interface CellImageSmallProps {
20
+ value: string;
21
+ imageUri?: string;
22
+ fallbackSrc?: string;
23
+ }
24
+ export declare const CellImageSmall: FC<CellImageSmallProps>;
25
+ interface ImageSmallFallbackProps {
26
+ imageUri?: string;
27
+ imageFallback?: string;
28
+ sx?: SxProps<Theme>;
29
+ }
30
+ export declare const ImageSmallFallback: FC<ImageSmallFallbackProps>;
31
+ export interface CellBaseOptions {
32
+ openInNewTab?: boolean;
33
+ beforeLine?: boolean;
34
+ copyToClipboard?: boolean;
35
+ imageUrl?: string;
36
+ imageFallbackSrc?: string;
37
+ valueFormatter?: (value?: string) => string;
38
+ wrapProps?: BoxProps;
39
+ typographyProps?: TypographyProps;
40
+ }
41
+ interface CellBaseProps extends CellBaseOptions {
42
+ value?: string;
43
+ valueFormatted?: string;
44
+ }
45
+ export declare const CellBase: FC<CellBaseProps>;
46
+ export interface CellChipsProps {
47
+ value?: string;
48
+ separator?: string;
49
+ maximum?: number;
50
+ }
51
+ export declare const CellChips: FC<CellChipsProps>;
52
+ export interface CellDatePropsOwner {
53
+ formatString?: string;
54
+ showRelative?: boolean;
55
+ typographyProps?: TypographyProps;
56
+ styledGetter?: (value: any) => SxProps<Theme>;
57
+ }
58
+ export interface CellDateProps extends CellDatePropsOwner {
59
+ value: any;
60
+ }
61
+ export declare const CellDate: FC<CellDateProps>;
62
+ export {};
@@ -0,0 +1,2 @@
1
+ import dayjs from 'dayjs';
2
+ export default dayjs;
@@ -0,0 +1,35 @@
1
+ export declare const sleep: (sec: number) => Promise<unknown>;
2
+ export declare const fetchDelay: <TModel>(action: () => Promise<TModel>, sec: number) => Promise<TModel>;
3
+ export declare const windowScrollToTop: (options?: ScrollToOptions, delay?: number) => void;
4
+ export declare const mergeClasses: (...classes: string[]) => string;
5
+ export declare const encodeBase64: (input: string) => string;
6
+ export declare const decodeBase64: (encoded: string) => string | undefined;
7
+ export declare const tryParseObject: <T>(value: any, defaultValue: T) => T;
8
+ export declare const tryParseArray: <T>(value: any, defaultValue?: T[]) => T[];
9
+ export declare const tryParseIntRequired: (value: any, defaultValue: number) => number;
10
+ type DeepPartial<T> = {
11
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
12
+ } | undefined;
13
+ export declare const mergeObjects: <T>(...objects: DeepPartial<T>[]) => T;
14
+ export declare const formatFileSize: (sizeInKb: number) => string;
15
+ export declare const formatCurrency: (value?: any, prefix?: string, suffix?: string) => string;
16
+ export declare const formatNumberWithCommas: (number: number) => string;
17
+ export declare const formatCapitalizeFirstText: (value?: string) => string;
18
+ declare const formatDatetimeStyle: {
19
+ style1: string;
20
+ style2: string;
21
+ style3: string;
22
+ };
23
+ /**
24
+ * Formats a datetime string using one of the predefined styles.
25
+ *
26
+ * Available format styles:
27
+ * - style1: DD/MM/YYYY HH:mm → e.g., '25/04/2025 14:30'
28
+ * - style2: 'MMMM D, YYYY' → e.g., 'April 25, 2025'
29
+ * - style2: 'MM-DD-YYYY' → e.g., '04-25-2025'
30
+ * @param value - A datetime string (ISO format or any format parsable by dayjs).
31
+ * @param format - Format style key: 'style1' or 'style2'. Defaults to 'style1'.
32
+ * @returns A formatted datetime string, or 'unknown' if the input is invalid or unparsable.
33
+ */
34
+ export declare const formatDatetime: (value: string, format?: keyof typeof formatDatetimeStyle) => string;
35
+ export {};
@@ -0,0 +1,4 @@
1
+ export * from './helpers';
2
+ export { default as JObject } from './json-object';
3
+ export { default as QueryParam } from './query-param';
4
+ export { default as dayjsCustom } from './dayjs-config';
@@ -0,0 +1,9 @@
1
+ export default class JObject {
2
+ private value;
3
+ constructor(value?: any);
4
+ static fromJson(value?: any): JObject;
5
+ toValue: <T extends Record<string, any>, TK extends keyof T = keyof T>(key: TK) => T[TK] | undefined;
6
+ toJObject: <T extends Record<string, any>, TK extends keyof T = keyof T>(key: TK) => JObject;
7
+ setValue: <T extends Record<string, any>, TK extends keyof T = keyof T>(key: TK, value: any) => void;
8
+ toObject: <T>() => Partial<T>;
9
+ }
@@ -0,0 +1,12 @@
1
+ import { FC } from 'react';
2
+ import { NavigateOptions } from 'react-router-dom';
3
+ export interface MFEventNavigate {
4
+ to: string;
5
+ options?: NavigateOptions & {
6
+ target?: '_self' | '_blank';
7
+ };
8
+ }
9
+ export declare const MFEventProvider: FC;
10
+ export declare const useMFEvent: () => {
11
+ navigate: (params: MFEventNavigate) => void;
12
+ };
@@ -0,0 +1,25 @@
1
+ import queryString from 'query-string';
2
+ declare class QueryParamBase {
3
+ private _GetValues;
4
+ private _GetValuesMap;
5
+ private _GetkeysMap;
6
+ private getPath;
7
+ stringify: <TParam extends Record<string, any> = any>(param: TParam) => string;
8
+ Replace<TParam extends {} = any, TState = any>(param: TParam, state?: TState): void;
9
+ Patch<TParam extends {
10
+ [key: string]: any;
11
+ } = any, TState = any>(param: TParam, state?: TState): void;
12
+ ReplacePatch<TParam extends {
13
+ [key: string]: any;
14
+ } = any, TState = any>(param: TParam, state?: TState): void;
15
+ Put<TParam extends {} = any, TState = any>(param: TParam, state?: TState): void;
16
+ Deletes<TValue extends {} = any>(...keys: (keyof TValue)[]): void;
17
+ ReplaceDeletes<TValue extends {} = any>(...keys: (keyof TValue)[]): void;
18
+ ReplaceDeletesWithState<TValue extends {} = any, TState = any>(keys: (keyof TValue)[], state?: TState): void;
19
+ DeletesWithState<TValue extends {} = any, TState = any>(keys: (keyof TValue)[], state?: TState): void;
20
+ DeleteAll(): void;
21
+ GetAll: () => queryString.ParsedQuery<string>;
22
+ Gets<TValue extends {} = any>(...keys: (keyof TValue)[]): Partial<TValue>;
23
+ }
24
+ export declare const QueryParam: QueryParamBase;
25
+ export default QueryParam;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dayjs-config.js","sources":["../../src/utils/dayjs-config.ts"],"sourcesContent":["import dayjs from 'dayjs'\r\nimport utc from 'dayjs/plugin/utc'\r\nimport timezone from 'dayjs/plugin/timezone'\r\nimport relativeTime from 'dayjs/plugin/relativeTime'\r\n\r\ndayjs.extend(utc)\r\ndayjs.extend(timezone)\r\ndayjs.extend(relativeTime)\r\n\r\n// Thiết lập múi giờ mặc định theo trình duyệt\r\ndayjs.tz.setDefault(Intl.DateTimeFormat().resolvedOptions().timeZone)\r\n\r\nexport default dayjs\r\n"],"names":["dayjs","extend","utc","timezone","relativeTime","tz","setDefault","Intl","DateTimeFormat","resolvedOptions","timeZone"],"mappings":";;;;;;AAKAA,KAAK,CAACC,MAAM,CAACC,GAAG,CAAC;AACjBF,KAAK,CAACC,MAAM,CAACE,QAAQ,CAAC;AACtBH,KAAK,CAACC,MAAM,CAACG,YAAY,CAAC;AAE1B;AACAJ,KAAK,CAACK,EAAE,CAACC,UAAU,CAACC,IAAI,CAACC,cAAc,EAAE,CAACC,eAAe,EAAE,CAACC,QAAQ,CAAC"}
@@ -1,5 +1,4 @@
1
- import { regeneratorRuntime as _regeneratorRuntime, slicedToArray as _slicedToArray, typeof as _typeof, toArray as _toArray } from '../../_virtual/_rollupPluginBabelHelpers.js';
2
- import { __awaiter } from '../../node_modules/.pnpm/@rollup_plugin-typescript@1_d0d2002d9033600b6738d939bd598bc6/node_modules/tslib/tslib.es6.js';
1
+ import { asyncToGenerator as _asyncToGenerator, typeof as _typeof, regeneratorRuntime as _regeneratorRuntime, slicedToArray as _slicedToArray, objectSpread2 as _objectSpread2, toArray as _toArray } from '../_virtual/_rollupPluginBabelHelpers.js';
3
2
  import dayjs from 'dayjs';
4
3
 
5
4
  var sleep = function sleep(sec) {
@@ -7,8 +6,8 @@ var sleep = function sleep(sec) {
7
6
  return setTimeout(res, sec);
8
7
  });
9
8
  };
10
- var fetchDelay = function fetchDelay(action, sec) {
11
- return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9
+ var fetchDelay = /*#__PURE__*/function () {
10
+ var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(action, sec) {
12
11
  var _yield$Promise$all, _yield$Promise$all2, res;
13
12
  return _regeneratorRuntime().wrap(function _callee$(_context) {
14
13
  while (1) switch (_context.prev = _context.next) {
@@ -26,10 +25,13 @@ var fetchDelay = function fetchDelay(action, sec) {
26
25
  }
27
26
  }, _callee);
28
27
  }));
29
- };
28
+ return function fetchDelay(_x, _x2) {
29
+ return _ref.apply(this, arguments);
30
+ };
31
+ }();
30
32
  var windowScrollToTop = function windowScrollToTop(options, delay) {
31
33
  setTimeout(function () {
32
- window.scrollTo(Object.assign({
34
+ window.scrollTo(_objectSpread2({
33
35
  top: 0,
34
36
  left: 0,
35
37
  behavior: 'smooth'
@@ -74,7 +76,7 @@ var tryParseObject = function tryParseObject(value, defaultValue) {
74
76
  throw new Error('Value is required!');
75
77
  }
76
78
  return JSON.parse(value);
77
- } catch (_a) {
79
+ } catch (_unused) {
78
80
  // console.log(error)
79
81
  return defaultValue;
80
82
  }
@@ -85,7 +87,7 @@ var tryParseArray = function tryParseArray(value) {
85
87
  if (!value) return [];
86
88
  var parseValue = JSON.parse(value);
87
89
  return Array.isArray(parseValue) ? parseValue : [];
88
- } catch (_a) {
90
+ } catch (_unused2) {
89
91
  return defaultValue;
90
92
  }
91
93
  };
@@ -93,7 +95,7 @@ var tryParseIntRequired = function tryParseIntRequired(value, defaultValue) {
93
95
  try {
94
96
  if (!value) return defaultValue;
95
97
  return parseInt(value);
96
- } catch (_a) {
98
+ } catch (_unused3) {
97
99
  return defaultValue;
98
100
  }
99
101
  };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sources":["../../src/utils/helpers.ts"],"sourcesContent":["import dayjs from 'dayjs'\r\n\r\nexport const sleep = (sec: number) => new Promise((res) => setTimeout(res, sec))\r\n\r\nexport const fetchDelay = async function <TModel>(action: () => Promise<TModel>, sec: number) {\r\n const [res] = await Promise.all([action(), sleep(sec)])\r\n return res\r\n}\r\n\r\nexport const windowScrollToTop = (options?: ScrollToOptions, delay?: number) => {\r\n setTimeout(() => {\r\n window.scrollTo({ top: 0, left: 0, behavior: 'smooth', ...options })\r\n }, delay || 50)\r\n}\r\n\r\nexport const mergeClasses = (...classes: string[]) => {\r\n return classes.join(' ')\r\n}\r\n\r\nexport const encodeBase64 = (input: string): string => {\r\n try {\r\n const utf8Bytes = new TextEncoder().encode(input)\r\n let binaryString = ''\r\n utf8Bytes.forEach((byte) => {\r\n binaryString += String.fromCharCode(byte)\r\n })\r\n return btoa(binaryString)\r\n } catch (error) {\r\n console.error('Error encoding to base64', error)\r\n return ''\r\n }\r\n}\r\n\r\nexport const decodeBase64 = (encoded: string): string | undefined => {\r\n try {\r\n const binaryString = atob(encoded)\r\n const utf8Bytes = new Uint8Array(binaryString.length)\r\n for (let i = 0; i < binaryString.length; i++) {\r\n utf8Bytes[i] = binaryString.charCodeAt(i)\r\n }\r\n return new TextDecoder().decode(utf8Bytes)\r\n } catch (error) {\r\n console.error('Error decoding base64', error)\r\n return\r\n }\r\n}\r\n\r\nexport const tryParseObject = function <T>(value: any, defaultValue: T): T {\r\n try {\r\n if (!value) {\r\n throw new Error('Value is required!')\r\n }\r\n return JSON.parse(value)\r\n } catch {\r\n // console.log(error)\r\n return defaultValue\r\n }\r\n}\r\n\r\nexport const tryParseArray = function <T>(value: any, defaultValue: T[] = []): T[] {\r\n try {\r\n if (!value) return []\r\n const parseValue = JSON.parse(value)\r\n return Array.isArray(parseValue) ? parseValue : []\r\n } catch {\r\n return defaultValue\r\n }\r\n}\r\n\r\nexport const tryParseIntRequired = function (value: any, defaultValue: number): number {\r\n try {\r\n if (!value) return defaultValue\r\n return parseInt(value)\r\n } catch {\r\n return defaultValue\r\n }\r\n}\r\n\r\n/**\r\n * Simple object check.\r\n * @param item\r\n * @returns {boolean}\r\n */\r\nconst isObject = (obj: any) => {\r\n return obj && typeof obj === 'object' && !Array.isArray(obj)\r\n}\r\n\r\ntype DeepPartial<T> = { [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P] } | undefined\r\n\r\nexport const mergeObjects = <T>(...objects: DeepPartial<T>[]): T => {\r\n return objects.reduce((prev, obj) => {\r\n if (!obj) return prev\r\n Object.keys(obj).forEach((key) => {\r\n if (isObject((prev as any)[key]) && isObject((obj as any)[key])) {\r\n ;(prev as any)[key] = mergeObjects((prev as any)[key], (obj as any)[key])\r\n } else {\r\n ;(prev as any)[key] = (obj as any)[key]\r\n }\r\n })\r\n return prev\r\n }, {} as T) as any\r\n}\r\n\r\n//#region Format\r\nexport const formatFileSize = (sizeInKb: number) => {\r\n if (sizeInKb < 1024) {\r\n return sizeInKb.toFixed(2) + ' Kb'\r\n } else if (sizeInKb < 1024 * 1024) {\r\n return (sizeInKb / 1024).toFixed(2) + ' Mb'\r\n } else if (sizeInKb < 1024 * 1024 * 1024) {\r\n return (sizeInKb / (1024 * 1024)).toFixed(2) + ' Gb'\r\n } else {\r\n return (sizeInKb / (1024 * 1024 * 1024)).toFixed(2) + ' Tb'\r\n }\r\n}\r\n\r\nexport const formatCurrency = (value?: any, prefix = '$ ', suffix = ''): string => {\r\n let parsedValue\r\n try {\r\n parsedValue = parseFloat(value)\r\n if (isNaN(parsedValue)) parsedValue = 0\r\n } catch (e) {\r\n parsedValue = 0\r\n }\r\n const roundedValue = parsedValue.toFixed(2)\r\n const [integerPart, decimalPart] = roundedValue.split('.')\r\n const formattedIntegerPart = integerPart.replace(/\\B(?=(\\d{3})+(?!\\d))/g, ' ')\r\n\r\n let formattedValue = formattedIntegerPart\r\n if (decimalPart !== '00') {\r\n formattedValue = `${formattedIntegerPart}.${decimalPart}`\r\n }\r\n return `${prefix}${formattedValue}${suffix}`\r\n}\r\n\r\nexport const formatNumberWithCommas = (number: number): string => {\r\n return number.toLocaleString('en-US')\r\n}\r\n\r\nexport const formatCapitalizeFirstText = (value: string = '') => {\r\n if (!value) return value\r\n const [first, ...data] = Array.from(value)\r\n return `${first.toUpperCase()}${data.join('')}`\r\n}\r\n\r\nconst formatDatetimeStyle = {\r\n style1: 'DD/MM/YYYY HH:mm',\r\n style2: 'MMMM D, YYYY',\r\n style3: 'MM-DD-YYYY'\r\n}\r\n\r\n/**\r\n * Formats a datetime string using one of the predefined styles.\r\n *\r\n * Available format styles:\r\n * - style1: DD/MM/YYYY HH:mm → e.g., '25/04/2025 14:30'\r\n * - style2: 'MMMM D, YYYY' → e.g., 'April 25, 2025'\r\n * - style2: 'MM-DD-YYYY' → e.g., '04-25-2025'\r\n * @param value - A datetime string (ISO format or any format parsable by dayjs).\r\n * @param format - Format style key: 'style1' or 'style2'. Defaults to 'style1'.\r\n * @returns A formatted datetime string, or 'unknown' if the input is invalid or unparsable.\r\n */\r\nexport const formatDatetime = (value: string, format: keyof typeof formatDatetimeStyle = 'style1'): string => {\r\n try {\r\n if (!value) throw new Error()\r\n return dayjs(value).format(formatDatetimeStyle[format])\r\n } catch (error) {\r\n return 'unknown'\r\n }\r\n}\r\n//#endregion\r\n"],"names":["sleep","sec","Promise","res","setTimeout","fetchDelay","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","action","_yield$Promise$all","_yield$Promise$all2","wrap","_callee$","_context","prev","next","all","sent","_slicedToArray","abrupt","stop","_x","_x2","apply","arguments","windowScrollToTop","options","delay","window","scrollTo","_objectSpread","top","left","behavior","mergeClasses","_len","length","classes","Array","_key","join","encodeBase64","input","utf8Bytes","TextEncoder","encode","binaryString","forEach","byte","String","fromCharCode","btoa","error","console","decodeBase64","encoded","atob","Uint8Array","i","charCodeAt","TextDecoder","decode","tryParseObject","value","defaultValue","Error","JSON","parse","_unused","tryParseArray","parseValue","isArray","_unused2","tryParseIntRequired","parseInt","_unused3","isObject","obj","_typeof","mergeObjects","_len2","objects","_key2","reduce","Object","keys","key","formatFileSize","sizeInKb","toFixed","formatCurrency","prefix","undefined","suffix","parsedValue","parseFloat","isNaN","e","roundedValue","_roundedValue$split","split","_roundedValue$split2","integerPart","decimalPart","formattedIntegerPart","replace","formattedValue","concat","formatNumberWithCommas","number","toLocaleString","formatCapitalizeFirstText","_Array$from","from","_Array$from2","_toArray","first","data","slice","toUpperCase","formatDatetimeStyle","style1","style2","style3","formatDatetime","format","dayjs"],"mappings":";;;IAEaA,KAAK,GAAG,SAARA,KAAKA,CAAIC,GAAW,EAAA;AAAA,EAAA,OAAK,IAAIC,OAAO,CAAC,UAACC,GAAG,EAAA;AAAA,IAAA,OAAKC,U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IAAAA,KAAK,GAAAF,YAAA,CAAA,CAAA,CAAA;IAAKG,IAAI,GAAAH,YAAA,CAAAI,KAAA,CAAA,CAAA,CAAA;AACrB,EAAA,OAAA,EAAA,CAAAX,MAAA,CAAUS,KAAK,CAACG,WAAW,EAAE,CAAAZ,CAAAA,MAAA,CAAGU,IAAI,CAAC7E,IAAI,CAAC,EAAE,CAAC,CAAA;AAC/C;AAEA,IAAMgF,mBAAmB,GAAG;AAC1BC,EAAAA,MAAM,EAAE,kBAAkB;AAC1BC,EAAAA,MAAM,EAAE,cAAc;AACtBC,EAAAA,MAAM,EAAE;CACT;AAED;;;;;;;;;;AAUG;IACUC,cAAc,GAAG,SAAjBA,cAAcA,CAAI7D,KAAa,EAAiE;AAAA,EAAA,IAA/D8D,MAAA,GAAArG,SAAA,CAAAY,MAAA,GAAA,CAAA,IAAAZ,SAAA,CAAA,CAAA,CAAA,KAAAoE,SAAA,GAAApE,SAAA,CAAA,CAAA,CAAA,GAA2C,QAAQ;EAC/F,IAAI;AACF,IAAA,IAAI,CAACuC,KAAK,EAAE,MAAM,IAAIE,KAAK,EAAE;IAC7B,OAAO6D,KAAK,CAAC/D,KAAK,CAAC,CAAC8D,MAAM,CAACL,mBAAmB,CAACK,MAAM,CAAC,CAAC;GACxD,CAAC,OAAOzE,KAAK,EAAE;AACd,IAAA,OAAO,SAAS;AACjB;AACH;AACA;;;;"}
@@ -1,26 +1,26 @@
1
- import { createClass as _createClass, classCallCheck as _classCallCheck } from '../../_virtual/_rollupPluginBabelHelpers.js';
1
+ import { createClass as _createClass, classCallCheck as _classCallCheck, defineProperty as _defineProperty } from '../_virtual/_rollupPluginBabelHelpers.js';
2
2
 
3
3
  var JObject = /*#__PURE__*/function () {
4
- function JObject(value) {
4
+ function JObject(_value) {
5
5
  var _this = this;
6
6
  _classCallCheck(this, JObject);
7
- this.toValue = function (key) {
7
+ _defineProperty(this, "toValue", function (key) {
8
8
  return _this.value[key];
9
- };
10
- this.toJObject = function (key) {
9
+ });
10
+ _defineProperty(this, "toJObject", function (key) {
11
11
  return new JObject(_this.value[key]);
12
- };
13
- this.setValue = function (key, value) {
12
+ });
13
+ _defineProperty(this, "setValue", function (key, value) {
14
14
  _this.value[key] = value;
15
- };
16
- this.toObject = function () {
15
+ });
16
+ _defineProperty(this, "toObject", function () {
17
17
  return _this.value;
18
- };
18
+ });
19
19
  try {
20
- if (typeof value === 'string') {
21
- this.value = JSON.parse(value !== null && value !== void 0 ? value : '{}');
20
+ if (typeof _value === 'string') {
21
+ this.value = JSON.parse(_value !== null && _value !== void 0 ? _value : '{}');
22
22
  } else {
23
- this.value = value !== null && value !== void 0 ? value : {};
23
+ this.value = _value !== null && _value !== void 0 ? _value : {};
24
24
  }
25
25
  } catch (error) {
26
26
  this.value = {};
@@ -0,0 +1 @@
1
+ {"version":3,"file":"json-object.js","sources":["../../src/utils/json-object.ts"],"sourcesContent":["export default class JObject {\r\n private value: Record<string, any>\r\n constructor(value?: any) {\r\n try {\r\n if (typeof value === 'string') {\r\n this.value = JSON.parse(value ?? '{}')\r\n } else {\r\n this.value = value ?? {}\r\n }\r\n } catch (error) {\r\n this.value = {}\r\n }\r\n }\r\n static fromJson(value?: any) {\r\n return new JObject(value)\r\n }\r\n toValue = <T extends Record<string, any>, TK extends keyof T = keyof T>(key: TK): T[TK] | undefined => {\r\n return this.value[key as any]\r\n }\r\n toJObject = <T extends Record<string, any>, TK extends keyof T = keyof T>(key: TK): JObject => {\r\n return new JObject(this.value[key as any])\r\n }\r\n setValue = <T extends Record<string, any>, TK extends keyof T = keyof T>(key: TK, value: any) => {\r\n this.value[key as any] = value\r\n }\r\n toObject = <T>(): Partial<T> => {\r\n return this.value as T\r\n }\r\n}\r\n"],"names":["JObject","value","_this","_classCallCheck","_defineProperty","key","JSON","parse","error","_createClass","fromJson"],"mappings":";;IAAqBA,OAAO,gBAAA,YAAA;EAE1B,SAAAA,OAAAA,CAAYC,MAAW,EAAA;AAAA,IAAA,IAAAC,KAAA,GAAA,I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