@krosoft/react 0.0.380 → 0.0.382

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 (220) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +13 -0
  2. package/dist/components/core/cards/DashboardCard.js +18 -0
  3. package/dist/components/core/cards/KpiCard.js +36 -0
  4. package/dist/components/core/cards/KpiCards.js +29 -0
  5. package/dist/components/core/cards/MetricCard.js +63 -0
  6. package/dist/components/core/cards/SkeletonCard.js +13 -0
  7. package/dist/components/core/cards/SkeletonCards.js +11 -0
  8. package/dist/components/core/cards/index.js +7 -1
  9. package/dist/components/core/changelog/AppChangelog.js +123 -0
  10. package/dist/components/core/changelog/AppChangelogEntry.js +85 -0
  11. package/dist/components/core/changelog/AppChangelogNav.js +39 -0
  12. package/dist/components/core/changelog/AppChangelogTagFilter.js +39 -0
  13. package/dist/components/core/changelog/index.js +1 -1
  14. package/dist/components/core/charts/BarChartHorizontal.js +80 -0
  15. package/dist/components/core/charts/BarChartVertical.js +68 -0
  16. package/dist/components/core/charts/ChartCard.js +44 -0
  17. package/dist/components/core/charts/CircularGauge.js +58 -0
  18. package/dist/components/core/charts/LineChart.js +69 -0
  19. package/dist/components/core/charts/PieChart.js +55 -0
  20. package/dist/components/core/charts/chartColors.js +10 -0
  21. package/dist/components/core/charts/chartTooltip.helper.js +15 -0
  22. package/dist/components/core/charts/index.js +8 -1
  23. package/dist/components/core/dialogs/AboutDialog.js +59 -0
  24. package/dist/components/core/dialogs/AppDialog.js +81 -0
  25. package/dist/components/core/dialogs/ConfirmationDialog.js +42 -0
  26. package/dist/components/core/dialogs/FormDialog.js +105 -0
  27. package/dist/components/core/dialogs/index.js +7 -4
  28. package/dist/components/core/filters/ActiveFilters.js +69 -0
  29. package/dist/components/core/filters/AdvancedFilters.js +103 -0
  30. package/dist/components/core/filters/ConditionFilter.js +162 -0
  31. package/dist/components/core/filters/ConditionFilterGroup.js +44 -0
  32. package/dist/components/core/filters/FilterField.js +64 -0
  33. package/dist/components/core/filters/FilterPills.js +13 -0
  34. package/dist/components/core/filters/FilterPillsGroup.js +39 -0
  35. package/dist/components/core/filters/FiltersContainer.js +54 -0
  36. package/dist/components/core/filters/FiltersMobileDrawer.js +57 -0
  37. package/dist/components/core/filters/TableFilter.js +101 -0
  38. package/dist/components/core/filters/index.js +11 -645
  39. package/dist/{GenericForm-Dxd6k7l-.js → components/core/forms/GenericForm.js} +45 -43
  40. package/dist/components/core/forms/index.js +1 -1
  41. package/dist/components/core/icons/FlagFrIcon.js +28 -0
  42. package/dist/{icons-n0m_1w7z.js → components/core/icons/FlagGbIcon.js} +3 -26
  43. package/dist/components/core/icons/index.js +3 -1
  44. package/dist/components/core/index.js +71 -27
  45. package/dist/components/core/inputs/DatePicker.js +46 -0
  46. package/dist/components/core/inputs/DateRangePicker.js +92 -0
  47. package/dist/{inputs-CBojnClc.js → components/core/inputs/FileDropzone.js} +8 -37
  48. package/dist/{ImageInput-BeIOm3GY.js → components/core/inputs/ImageInput.js} +5 -5
  49. package/dist/components/core/inputs/MultiSelect.js +191 -0
  50. package/dist/components/core/inputs/RatingInput.js +36 -0
  51. package/dist/{SearchInput-IT_Rvthr.js → components/core/inputs/SearchInput.js} +4 -4
  52. package/dist/components/core/inputs/SingleSelect.js +198 -0
  53. package/dist/components/core/inputs/index.js +9 -6
  54. package/dist/components/core/inputs/select.helper.js +46 -0
  55. package/dist/{language-DY0EYabh.js → components/core/language/LanguageSelector.js} +13 -12
  56. package/dist/components/core/language/index.js +1 -1
  57. package/dist/{AppActions-8HjAaTQK.js → components/core/layouts/AppActions.js} +19 -19
  58. package/dist/components/core/layouts/AppPageHeader.js +44 -0
  59. package/dist/{AppSubTitle-DI62BaaB.js → components/core/layouts/AppSubTitle.js} +3 -3
  60. package/dist/{AppTitle-BXoTrXQc.js → components/core/layouts/AppTitle.js} +3 -3
  61. package/dist/components/core/layouts/KpiCardsLayout.js +8 -0
  62. package/dist/components/core/layouts/index.js +6 -50
  63. package/dist/components/core/markdown/AppMarkdown.js +134 -0
  64. package/dist/components/core/markdown/AppMarkdownHeading.js +45 -0
  65. package/dist/components/core/markdown/index.js +1 -1
  66. package/dist/components/core/navbar/GlobalSearch.js +128 -0
  67. package/dist/components/core/navbar/NotificationsBell.js +133 -0
  68. package/dist/components/core/navbar/Sidebar.js +99 -0
  69. package/dist/components/core/navbar/SidebarHeader.js +26 -0
  70. package/dist/components/core/navbar/SidebarNavItem.js +72 -0
  71. package/dist/components/core/navbar/Topbar.js +25 -0
  72. package/dist/components/core/navbar/index.js +7 -1
  73. package/dist/{ErrorAlert-cJnfBL8H.js → components/core/states/ErrorAlert.js} +5 -5
  74. package/dist/{states-CJ8xE_Nm.js → components/core/states/ErrorState.js} +4 -11
  75. package/dist/components/core/states/LoadingState.js +12 -0
  76. package/dist/components/core/states/index.js +3 -2
  77. package/dist/components/core/table/DataTable.js +108 -0
  78. package/dist/components/core/table/JsonTableOutput.js +75 -0
  79. package/dist/components/core/table/TableActions.js +75 -0
  80. package/dist/components/core/table/TableBody.js +130 -0
  81. package/dist/components/core/table/TableBulkActions.js +47 -0
  82. package/dist/components/core/table/TableHeader.js +103 -0
  83. package/dist/components/core/table/TablePagination.js +102 -0
  84. package/dist/components/core/table/TableSettings.js +117 -0
  85. package/dist/components/core/table/index.js +9 -709
  86. package/dist/components/core/tabs/AppTabContainer.js +17 -0
  87. package/dist/components/core/tabs/AppTabHeader.js +19 -0
  88. package/dist/components/core/tabs/AppTabs.js +56 -0
  89. package/dist/components/core/tabs/AppVerticalTabs.js +105 -0
  90. package/dist/components/core/tabs/index.js +5 -188
  91. package/dist/{theme-DSumNHLX.js → components/core/theme/ThemeSelector.js} +13 -12
  92. package/dist/components/core/theme/index.js +1 -1
  93. package/dist/components/index.js +117 -34
  94. package/dist/components/ui/accordion.js +34 -0
  95. package/dist/components/ui/alert-dialog.js +54 -0
  96. package/dist/{alert-REQGK9bR.js → components/ui/alert.js} +2 -2
  97. package/dist/components/ui/aspect-ratio.js +5 -0
  98. package/dist/components/ui/avatar.js +25 -0
  99. package/dist/components/ui/badge.js +22 -0
  100. package/dist/components/ui/breadcrumb.js +60 -0
  101. package/dist/{tooltip-_geGvbS7.js → components/ui/button.js} +7 -17
  102. package/dist/components/ui/calendar.js +44 -0
  103. package/dist/components/ui/card.js +42 -0
  104. package/dist/components/ui/carousel.js +115 -0
  105. package/dist/{chart-wW-fwL3s.js → components/ui/chart.js} +51 -89
  106. package/dist/components/ui/checkbox.js +31 -0
  107. package/dist/components/ui/collapsible.js +5 -0
  108. package/dist/components/ui/command.js +84 -0
  109. package/dist/components/ui/context-menu.js +71 -0
  110. package/dist/components/ui/control.js +5 -0
  111. package/dist/components/ui/dialog.js +49 -0
  112. package/dist/components/ui/drawer.js +47 -0
  113. package/dist/components/ui/dropdown-menu.js +72 -0
  114. package/dist/components/ui/form.js +78 -0
  115. package/dist/components/ui/hover-card.js +15 -0
  116. package/dist/components/ui/index.js +49 -9
  117. package/dist/components/ui/input-otp.js +41 -0
  118. package/dist/components/ui/input.js +14 -0
  119. package/dist/components/ui/label.js +14 -0
  120. package/dist/components/ui/menubar.js +86 -0
  121. package/dist/components/ui/navigation-menu.js +58 -0
  122. package/dist/components/ui/pagination.js +62 -0
  123. package/dist/components/ui/popover.js +15 -0
  124. package/dist/components/ui/progress.js +17 -0
  125. package/dist/components/ui/radio-group.js +24 -0
  126. package/dist/components/ui/resizable.js +18 -0
  127. package/dist/components/ui/scroll-area.js +29 -0
  128. package/dist/{select-KWMg2_7Z.js → components/ui/select.js} +3 -3
  129. package/dist/components/ui/separator.js +15 -0
  130. package/dist/components/ui/sheet.js +58 -0
  131. package/dist/components/ui/simple-table.js +57 -0
  132. package/dist/{skeleton-D6Ga4BLw.js → components/ui/skeleton.js} +2 -2
  133. package/dist/components/ui/slider.js +17 -0
  134. package/dist/components/ui/sonner.js +23 -0
  135. package/dist/components/ui/switch.js +14 -0
  136. package/dist/components/ui/tabs.js +58 -0
  137. package/dist/components/ui/textarea.js +12 -0
  138. package/dist/components/ui/toast.js +53 -0
  139. package/dist/components/ui/toaster.js +22 -0
  140. package/dist/components/ui/toggle-group.js +37 -0
  141. package/dist/components/ui/toggle.js +34 -0
  142. package/dist/components/ui/tooltip.js +14 -0
  143. package/dist/{datatable-COQcYUrk.js → constants/datatable.js} +1 -1
  144. package/dist/constants/index.js +3 -5
  145. package/dist/constants/search.js +4 -0
  146. package/dist/contexts/index.js +3 -1
  147. package/dist/{sidebar.context-BahtU6hE.js → contexts/page.context.js} +2 -2
  148. package/dist/contexts/sidebar.context.js +5 -0
  149. package/dist/helpers/changelog.helper.js +69 -0
  150. package/dist/helpers/index.js +6 -166
  151. package/dist/{markdown.helper-YJE2H5KQ.js → helpers/markdown.helper.js} +1 -1
  152. package/dist/helpers/supabase.helper.js +41 -0
  153. package/dist/helpers/table.helper.js +56 -0
  154. package/dist/{tailwind.helper-CJaRYBmL.js → helpers/tailwind.helper.js} +1 -1
  155. package/dist/hooks/behavior/index.js +10 -1
  156. package/dist/hooks/behavior/useConfirmDeleteDialog.js +21 -0
  157. package/dist/hooks/behavior/useConfirmationDialog.js +23 -0
  158. package/dist/hooks/behavior/useDebounce.js +14 -0
  159. package/dist/hooks/behavior/useDebouncedValue.js +15 -0
  160. package/dist/hooks/behavior/useDialog.js +21 -0
  161. package/dist/hooks/behavior/usePage.js +10 -0
  162. package/dist/hooks/behavior/useSidebar.js +10 -0
  163. package/dist/hooks/behavior/useTable.js +83 -0
  164. package/dist/hooks/behavior/useUrlState.js +46 -0
  165. package/dist/hooks/index.js +20 -11
  166. package/dist/hooks/ui/index.js +11 -10
  167. package/dist/{useFixedColumns-Bo-Az3Hp.js → hooks/ui/useDataTable.js} +16 -52
  168. package/dist/{useDocumentTitle-VoQkict_.js → hooks/ui/useDocumentTitle.js} +2 -2
  169. package/dist/hooks/ui/useFixedColumns.js +38 -0
  170. package/dist/{useLanguage-DRnSb5H1.js → hooks/ui/useLanguage.js} +3 -3
  171. package/dist/{useMobile-pTQ8lWvt.js → hooks/ui/useMobile.js} +1 -1
  172. package/dist/{useNotifications-CyhTruIG.js → hooks/ui/useNotifications.js} +2 -2
  173. package/dist/{useScrollFade-D9kqJBDh.js → hooks/ui/useScrollFade.js} +1 -1
  174. package/dist/{ui-nQGnCss1.js → hooks/ui/useServerTable.js} +2 -2
  175. package/dist/{useTheme-DIZjiF5F.js → hooks/ui/useTheme.js} +3 -3
  176. package/dist/{useToast-UeDRLovh.js → hooks/ui/useToast.js} +1 -1
  177. package/dist/i18n/index.js +4 -1
  178. package/dist/i18n/krosoftLocales.js +13 -0
  179. package/dist/i18n/useDateFnsLocale.js +13 -0
  180. package/dist/i18n/useKrosoftTranslation.js +13 -0
  181. package/dist/locales/en.json.js +174 -0
  182. package/dist/locales/fr.json.js +174 -0
  183. package/dist/providers/SidebarProvider.js +42 -0
  184. package/dist/providers/index.js +1 -42
  185. package/dist/pwa/PwaUpdater.js +30 -0
  186. package/dist/pwa/index.js +3 -50
  187. package/dist/pwa/pwaUpdateToast.js +25 -0
  188. package/dist/seasonal/EffectSwitch.js +24 -0
  189. package/dist/seasonal/EmojiSnowfall.js +24 -0
  190. package/dist/seasonal/HalloweenEffect.js +17 -0
  191. package/dist/seasonal/SeasonalEffects.js +8 -0
  192. package/dist/seasonal/SeasonalEffectsSettings.js +35 -0
  193. package/dist/seasonal/SnowEffect.js +12 -0
  194. package/dist/seasonal/index.js +7 -120
  195. package/dist/seasonal/overlayStyle.js +12 -0
  196. package/dist/seasonal/seasons.js +7 -0
  197. package/dist/seasonal/useSeasonalEffects.js +20 -0
  198. package/dist/seasonal/useStoredToggle.js +21 -0
  199. package/dist/tailwind/index.js +7 -53
  200. package/dist/tokens/apply.js +16 -0
  201. package/dist/tokens/index.js +3 -38
  202. package/dist/tokens/radius.js +26 -0
  203. package/dist/types/index.js +0 -1
  204. package/dist/vendor/tailwindcss/lib/public/create-plugin.js +19 -0
  205. package/dist/vendor/tailwindcss/lib/util/createPlugin.js +30 -0
  206. package/dist/vendor/tailwindcss/plugin.js +10 -0
  207. package/package.json +4 -4
  208. package/dist/AppMarkdown-CAxm82x0.js +0 -171
  209. package/dist/MultiSelect-DPN046kI.js +0 -228
  210. package/dist/SingleSelect-DLY5WylQ.js +0 -313
  211. package/dist/behavior-B0BYivtN.js +0 -201
  212. package/dist/cards-DPzVebUM.js +0 -132
  213. package/dist/changelog-DyPFIscf.js +0 -257
  214. package/dist/charts-C7rKxkli.js +0 -342
  215. package/dist/dialogs-CG9Q7pqY.js +0 -269
  216. package/dist/i18n-BhLphJa3.js +0 -364
  217. package/dist/navbar-DD0V0pNE.js +0 -432
  218. package/dist/sheet-cWJO_wkT.js +0 -225
  219. package/dist/switch-DspImmo_.js +0 -24
  220. package/dist/ui-Fxy95kSJ.js +0 -1163
@@ -1,166 +1,6 @@
1
- import { t as e } from "../tailwind.helper-CJaRYBmL.js";
2
- import { t } from "../markdown.helper-YJE2H5KQ.js";
3
- //#region src/helpers/changelog.helper.ts
4
- var n = /^## +(.+?)\s*$/, r = /^(?:\[v?([^\]]+)\]\s*[-–]\s*)?(\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2})?)(?:\s*[-–]\s*(.+))?$/, i = /^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?/, a = (e) => e.trim().toLowerCase().replace(/[^\p{L}\p{N}\s_-]/gu, "").replace(/\s/g, "-"), o = (e) => {
5
- let t = i.exec(e);
6
- if (!t) return { hasTime: !1 };
7
- let [, n, r, a, o, s] = t, c = o !== void 0 && s !== void 0, l = new Date(Number(n), Number(r) - 1, Number(a), c ? Number(o) : 0, c ? Number(s) : 0);
8
- return Number.isNaN(l.getTime()) ? { hasTime: !1 } : {
9
- date: l,
10
- hasTime: c
11
- };
12
- }, s = (e) => {
13
- let t = r.exec(e);
14
- if (!t) return {
15
- title: e,
16
- hasTime: !1,
17
- anchorSource: e
18
- };
19
- let [, n, i, a] = t;
20
- return {
21
- ...n === void 0 ? {} : { version: n.trim() },
22
- ...a === void 0 ? {} : { title: a.trim() },
23
- ...o(i),
24
- anchorSource: i
25
- };
26
- }, c = (e) => {
27
- let t = [], r = /* @__PURE__ */ new Map(), i, o = () => {
28
- if (!i) return;
29
- let { anchorSource: e, ...n } = s(i.heading), o = a(e), c = r.get(o) ?? 0;
30
- r.set(o, c + 1), t.push({
31
- id: c === 0 ? o : `${o}-${String(c)}`,
32
- heading: i.heading,
33
- ...n,
34
- content: i.lines.join("\n").trim()
35
- });
36
- };
37
- for (let t of e.split(/\r?\n/)) {
38
- let e = n.exec(t)?.[1];
39
- e === void 0 ? i?.lines.push(t) : (o(), i = {
40
- heading: e,
41
- lines: []
42
- });
43
- }
44
- return o(), t;
45
- }, l = /^\*\*([^*\n]+?)\*\*\s*:\s*/, u = (e) => e.charAt(0).toLocaleUpperCase() + e.slice(1), d = (e) => {
46
- let t = [], n = e.split(/\r?\n\s*\r?\n/).map((e) => e.trim()).filter(Boolean);
47
- for (let e of n) {
48
- let n = l.exec(e), r = t.length > 0 ? t[t.length - 1] : void 0;
49
- n ? t.push({
50
- tag: n[1].trim(),
51
- content: u(e.slice(n[0].length))
52
- }) : r ? r.content = `${r.content}\n\n${e}` : t.push({ content: e });
53
- }
54
- return t;
55
- }, f = (e) => e.normalize("NFD").replace(/\p{M}/gu, "").toLowerCase(), p = (e, t, n = []) => {
56
- let r = f(t).split(/\s+/).filter(Boolean);
57
- return r.length === 0 && n.length === 0 ? e : e.filter((e) => {
58
- if (n.length > 0 && !d(e.content).some((e) => e.tag !== void 0 && n.includes(e.tag))) return !1;
59
- let t = f(`${e.heading}\n${e.content}`);
60
- return r.every((e) => t.includes(e));
61
- });
62
- }, m = (e) => [...new Set(e.flatMap((e) => d(e.content).flatMap((e) => e.tag === void 0 ? [] : [e.tag])))].sort((e, t) => e.localeCompare(t)), h = (e, t) => {
63
- let n = /* @__PURE__ */ new Map();
64
- return t.map((t) => {
65
- if (t.tag === void 0) return;
66
- let r = `${e}-${a(t.tag)}`, i = (n.get(r) ?? 0) + 1;
67
- return n.set(r, i), i === 1 ? r : `${r}-${String(i)}`;
68
- });
69
- };
70
- //#endregion
71
- //#region src/helpers/supabase.helper.ts
72
- function g(e, t, n = {}) {
73
- let r = e, i = t.debouncedSearchText ?? t.searchText;
74
- if (i?.trim() && n.searchColumns?.length) {
75
- let e = `%${i.trim()}%`, t = n.searchColumns.map((t) => `${t}.ilike.${e}`).join(",");
76
- r = r.or(t);
77
- }
78
- if (t.appliedFilters) {
79
- for (let e in t.appliedFilters) if (Object.prototype.hasOwnProperty.call(t.appliedFilters, e)) {
80
- let i = t.appliedFilters[e];
81
- if (i == null || i === "" || Array.isArray(i) && i.length === 0) continue;
82
- let a = n.filters?.[e], o = a?.column ?? e, s = a?.type ?? "eq";
83
- if (s === "custom") continue;
84
- s === "ilike" ? r = r.ilike(o, `%${String(i)}%`) : s === "eq" ? r = r.eq(o, i) : s === "in" && Array.isArray(i) && (r = r.in(o, i));
85
- }
86
- }
87
- if (t.sortColumn) {
88
- let e = n.sortColumns?.[t.sortColumn] ?? t.sortColumn;
89
- r = r.order(e, { ascending: t.sortDirection === "asc" });
90
- }
91
- let a = (t.currentPage - 1) * t.pageSize, o = a + t.pageSize - 1;
92
- return r = r.range(a, o), r;
93
- }
94
- function _(e, t) {
95
- return e ? e.map((e) => {
96
- let n = e[t];
97
- return Array.isArray(n) ? n[0] : n;
98
- }).filter((e) => !!e) : [];
99
- }
100
- function v(e, t) {
101
- if (!e) return null;
102
- let n = Array.isArray(e) ? e[0] : e;
103
- if (!n) return null;
104
- if (t) {
105
- let e = n[t];
106
- return Array.isArray(e) ? e[0] : e;
107
- }
108
- return n;
109
- }
110
- //#endregion
111
- //#region src/helpers/table.helper.ts
112
- var y = {
113
- left: "text-left",
114
- center: "text-center",
115
- right: "text-right"
116
- };
117
- function b(e) {
118
- if (e.align !== void 0) return e.align;
119
- let t = (e.className ?? "").split(/\s+/);
120
- return t.includes("text-right") ? "right" : t.includes("text-center") ? "center" : "left";
121
- }
122
- function x(e) {
123
- return y[e];
124
- }
125
- var S = "__selection__", C = "__actions__", w = {
126
- left: "border-r border-border",
127
- right: "border-l border-border"
128
- };
129
- function T(e, t) {
130
- if (e === void 0) return {
131
- className: "relative",
132
- style: {}
133
- };
134
- let n = t === "header";
135
- return {
136
- className: [
137
- "sticky bg-card",
138
- n ? "z-20" : "z-10",
139
- "before:absolute before:inset-0 before:-z-10 before:pointer-events-none",
140
- n ? "before:bg-muted/50" : "group-hover:before:bg-muted/50",
141
- e.isEdge ? w[e.side] : ""
142
- ].filter(Boolean).join(" "),
143
- style: e.side === "left" ? { left: e.offset } : { right: e.offset }
144
- };
145
- }
146
- function E(e) {
147
- return {
148
- read: () => {
149
- if (typeof window < "u") try {
150
- let t = window.localStorage.getItem(e);
151
- if (t === null) return;
152
- let n = JSON.parse(t);
153
- return typeof n != "object" || !n || Array.isArray(n) ? void 0 : Object.fromEntries(Object.entries(n).filter((e) => typeof e[1] == "boolean"));
154
- } catch {
155
- return;
156
- }
157
- },
158
- write: (t) => {
159
- if (typeof window < "u") try {
160
- window.localStorage.setItem(e, JSON.stringify(t));
161
- } catch {}
162
- }
163
- };
164
- }
165
- //#endregion
166
- export { C as ACTIONS_COLUMN_KEY, S as SELECTION_COLUMN_KEY, g as applyTableStateToQuery, e as cn, p as filterChangelog, x as getAlignmentClass, h as getChangelogItemAnchors, m as getChangelogTags, b as getColumnAlignment, T as getFixedCellProps, E as localStorageColumnVisibility, _ as mapNestedRelationMany, v as mapNestedRelationOne, c as parseChangelog, t as rehypeVersionSlug, a as slugifyChangelogTitle, d as splitChangelogItems };
1
+ import { filterChangelog as e, getChangelogItemAnchors as t, getChangelogTags as n, parseChangelog as r, slugifyChangelogTitle as i, splitChangelogItems as a } from "./changelog.helper.js";
2
+ import { cn as o } from "./tailwind.helper.js";
3
+ import { applyTableStateToQuery as s, mapNestedRelationMany as c, mapNestedRelationOne as l } from "./supabase.helper.js";
4
+ import { ACTIONS_COLUMN_KEY as u, SELECTION_COLUMN_KEY as d, getAlignmentClass as f, getColumnAlignment as p, getFixedCellProps as m, localStorageColumnVisibility as h } from "./table.helper.js";
5
+ import { rehypeVersionSlug as g } from "./markdown.helper.js";
6
+ export { u as ACTIONS_COLUMN_KEY, d as SELECTION_COLUMN_KEY, s as applyTableStateToQuery, o as cn, e as filterChangelog, f as getAlignmentClass, t as getChangelogItemAnchors, n as getChangelogTags, p as getColumnAlignment, m as getFixedCellProps, h as localStorageColumnVisibility, c as mapNestedRelationMany, l as mapNestedRelationOne, r as parseChangelog, g as rehypeVersionSlug, i as slugifyChangelogTitle, a as splitChangelogItems };
@@ -20,4 +20,4 @@ var e = /* @__PURE__ */ new Set([
20
20
  i(r);
21
21
  };
22
22
  //#endregion
23
- export { r as t };
23
+ export { r as rehypeVersionSlug };
@@ -0,0 +1,41 @@
1
+ //#region src/helpers/supabase.helper.ts
2
+ function e(e, t, n = {}) {
3
+ let r = e, i = t.debouncedSearchText ?? t.searchText;
4
+ if (i?.trim() && n.searchColumns?.length) {
5
+ let e = `%${i.trim()}%`, t = n.searchColumns.map((t) => `${t}.ilike.${e}`).join(",");
6
+ r = r.or(t);
7
+ }
8
+ if (t.appliedFilters) {
9
+ for (let e in t.appliedFilters) if (Object.prototype.hasOwnProperty.call(t.appliedFilters, e)) {
10
+ let i = t.appliedFilters[e];
11
+ if (i == null || i === "" || Array.isArray(i) && i.length === 0) continue;
12
+ let a = n.filters?.[e], o = a?.column ?? e, s = a?.type ?? "eq";
13
+ if (s === "custom") continue;
14
+ s === "ilike" ? r = r.ilike(o, `%${String(i)}%`) : s === "eq" ? r = r.eq(o, i) : s === "in" && Array.isArray(i) && (r = r.in(o, i));
15
+ }
16
+ }
17
+ if (t.sortColumn) {
18
+ let e = n.sortColumns?.[t.sortColumn] ?? t.sortColumn;
19
+ r = r.order(e, { ascending: t.sortDirection === "asc" });
20
+ }
21
+ let a = (t.currentPage - 1) * t.pageSize, o = a + t.pageSize - 1;
22
+ return r = r.range(a, o), r;
23
+ }
24
+ function t(e, t) {
25
+ return e ? e.map((e) => {
26
+ let n = e[t];
27
+ return Array.isArray(n) ? n[0] : n;
28
+ }).filter((e) => !!e) : [];
29
+ }
30
+ function n(e, t) {
31
+ if (!e) return null;
32
+ let n = Array.isArray(e) ? e[0] : e;
33
+ if (!n) return null;
34
+ if (t) {
35
+ let e = n[t];
36
+ return Array.isArray(e) ? e[0] : e;
37
+ }
38
+ return n;
39
+ }
40
+ //#endregion
41
+ export { e as applyTableStateToQuery, t as mapNestedRelationMany, n as mapNestedRelationOne };
@@ -0,0 +1,56 @@
1
+ //#region src/helpers/table.helper.ts
2
+ var e = {
3
+ left: "text-left",
4
+ center: "text-center",
5
+ right: "text-right"
6
+ };
7
+ function t(e) {
8
+ if (e.align !== void 0) return e.align;
9
+ let t = (e.className ?? "").split(/\s+/);
10
+ return t.includes("text-right") ? "right" : t.includes("text-center") ? "center" : "left";
11
+ }
12
+ function n(t) {
13
+ return e[t];
14
+ }
15
+ var r = "__selection__", i = "__actions__", a = {
16
+ left: "border-r border-border",
17
+ right: "border-l border-border"
18
+ };
19
+ function o(e, t) {
20
+ if (e === void 0) return {
21
+ className: "relative",
22
+ style: {}
23
+ };
24
+ let n = t === "header";
25
+ return {
26
+ className: [
27
+ "sticky bg-card",
28
+ n ? "z-20" : "z-10",
29
+ "before:absolute before:inset-0 before:-z-10 before:pointer-events-none",
30
+ n ? "before:bg-muted/50" : "group-hover:before:bg-muted/50",
31
+ e.isEdge ? a[e.side] : ""
32
+ ].filter(Boolean).join(" "),
33
+ style: e.side === "left" ? { left: e.offset } : { right: e.offset }
34
+ };
35
+ }
36
+ function s(e) {
37
+ return {
38
+ read: () => {
39
+ if (typeof window < "u") try {
40
+ let t = window.localStorage.getItem(e);
41
+ if (t === null) return;
42
+ let n = JSON.parse(t);
43
+ return typeof n != "object" || !n || Array.isArray(n) ? void 0 : Object.fromEntries(Object.entries(n).filter((e) => typeof e[1] == "boolean"));
44
+ } catch {
45
+ return;
46
+ }
47
+ },
48
+ write: (t) => {
49
+ if (typeof window < "u") try {
50
+ window.localStorage.setItem(e, JSON.stringify(t));
51
+ } catch {}
52
+ }
53
+ };
54
+ }
55
+ //#endregion
56
+ export { i as ACTIONS_COLUMN_KEY, r as SELECTION_COLUMN_KEY, n as getAlignmentClass, t as getColumnAlignment, o as getFixedCellProps, s as localStorageColumnVisibility };
@@ -5,4 +5,4 @@ function n(...n) {
5
5
  return t(e(n));
6
6
  }
7
7
  //#endregion
8
- export { n as t };
8
+ export { n as cn };
@@ -1 +1,10 @@
1
- export { t as URL_DATE_FORMAT, n as parseDateRange, r as serializeDateRange, p as useConfirmDeleteDialog, m as useConfirmationDialog, f as useDebounce, d as useDebouncedValue, h as useDialog, u as usePage, l as useSidebar, c as useTable, i as useUrlArrayState, a as useUrlDateRangeState, o as useUrlNumberState, s as useUrlState } from "../../behavior-B0BYivtN.js";
1
+ import { useDialog as e } from "./useDialog.js";
2
+ import { useConfirmationDialog as t } from "./useConfirmationDialog.js";
3
+ import { useConfirmDeleteDialog as n } from "./useConfirmDeleteDialog.js";
4
+ import { useDebounce as r } from "./useDebounce.js";
5
+ import { useDebouncedValue as i } from "./useDebouncedValue.js";
6
+ import { usePage as a } from "./usePage.js";
7
+ import { useSidebar as o } from "./useSidebar.js";
8
+ import { useTable as s } from "./useTable.js";
9
+ import { URL_DATE_FORMAT as c, parseDateRange as l, serializeDateRange as u, useUrlArrayState as d, useUrlDateRangeState as f, useUrlNumberState as p, useUrlState as m } from "./useUrlState.js";
10
+ export { c as URL_DATE_FORMAT, l as parseDateRange, u as serializeDateRange, n as useConfirmDeleteDialog, t as useConfirmationDialog, r as useDebounce, i as useDebouncedValue, e as useDialog, a as usePage, o as useSidebar, s as useTable, d as useUrlArrayState, f as useUrlDateRangeState, p as useUrlNumberState, m as useUrlState };
@@ -0,0 +1,21 @@
1
+ import { useKrosoftTranslation as e } from "../../i18n/useKrosoftTranslation.js";
2
+ import { useConfirmationDialog as t } from "./useConfirmationDialog.js";
3
+ import { TrashIcon as n } from "lucide-react";
4
+ //#region src/hooks/behavior/useConfirmDeleteDialog.ts
5
+ var r = ({ titleKey: r, descriptionKey: i, confirmKey: a, onConfirm: o, onReset: s }) => {
6
+ let { t: c } = e();
7
+ return {
8
+ ...t({
9
+ titleKey: r,
10
+ descriptionKey: i,
11
+ confirmKey: a ?? c("actions.delete"),
12
+ onConfirm: o,
13
+ onReset: s
14
+ }),
15
+ loadingKey: "actions.deleting",
16
+ icon: n,
17
+ titleClassName: "flex items-center gap-2 text-destructive"
18
+ };
19
+ };
20
+ //#endregion
21
+ export { r as useConfirmDeleteDialog };
@@ -0,0 +1,23 @@
1
+ import { useDialog as e } from "./useDialog.js";
2
+ //#region src/hooks/behavior/useConfirmationDialog.ts
3
+ var t = ({ titleKey: t, descriptionKey: n, confirmKey: r = "Confirmer", onConfirm: i, onReset: a }) => {
4
+ let o = e({ onReset: a });
5
+ return {
6
+ isOpen: o.isOpen,
7
+ itemName: o.name,
8
+ title: t,
9
+ description: n,
10
+ confirmKey: r,
11
+ openDialog: o.openDialog,
12
+ onClose: o.onClose,
13
+ onConfirm: async () => {
14
+ if (o.id) try {
15
+ await i(o.id), o.onClose();
16
+ } catch (e) {
17
+ console.error("Error confirming action:", e);
18
+ }
19
+ }
20
+ };
21
+ };
22
+ //#endregion
23
+ export { t as useConfirmationDialog };
@@ -0,0 +1,14 @@
1
+ import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
2
+ //#region src/hooks/behavior/useDebounce.ts
3
+ var i = (i, a) => {
4
+ let [o, s] = r(i), c = n(void 0);
5
+ return t(() => (c.current = setTimeout(() => {
6
+ s(i);
7
+ }, a), () => {
8
+ clearTimeout(c.current);
9
+ }), [i, a]), [o, e((e) => {
10
+ clearTimeout(c.current), s(e);
11
+ }, [])];
12
+ };
13
+ //#endregion
14
+ export { i as useDebounce };
@@ -0,0 +1,15 @@
1
+ import * as e from "react";
2
+ //#region src/hooks/behavior/useDebouncedValue.ts
3
+ var t = (t, n = 250) => {
4
+ let [r, i] = e.useState(t);
5
+ return e.useEffect(() => {
6
+ let e = setTimeout(() => {
7
+ i(t);
8
+ }, n);
9
+ return () => {
10
+ clearTimeout(e);
11
+ };
12
+ }, [t, n]), r;
13
+ };
14
+ //#endregion
15
+ export { t as useDebouncedValue };
@@ -0,0 +1,21 @@
1
+ import { useState as e } from "react";
2
+ //#region src/hooks/behavior/useDialog.ts
3
+ var t = (t) => {
4
+ let [n, r] = e(null);
5
+ return {
6
+ id: n?.id ?? null,
7
+ name: n?.name ?? null,
8
+ isOpen: !!n,
9
+ openDialog: (e, n) => {
10
+ t?.onReset?.(), r({
11
+ id: e,
12
+ name: n
13
+ });
14
+ },
15
+ onClose: () => {
16
+ r(null);
17
+ }
18
+ };
19
+ };
20
+ //#endregion
21
+ export { t as useDialog };
@@ -0,0 +1,10 @@
1
+ import { PageContext as e } from "../../contexts/page.context.js";
2
+ import { useContext as t } from "react";
3
+ //#region src/hooks/behavior/usePage.tsx
4
+ var n = () => {
5
+ let n = t(e);
6
+ if (n === void 0) throw Error("usePage must be used within an PageProvider");
7
+ return n;
8
+ };
9
+ //#endregion
10
+ export { n as usePage };
@@ -0,0 +1,10 @@
1
+ import { SidebarContext as e } from "../../contexts/sidebar.context.js";
2
+ import { useContext as t } from "react";
3
+ //#region src/hooks/behavior/useSidebar.ts
4
+ var n = () => {
5
+ let n = t(e);
6
+ if (n === void 0) throw Error("useSidebar must be used within a SidebarProvider");
7
+ return n;
8
+ };
9
+ //#endregion
10
+ export { n as useSidebar };
@@ -0,0 +1,83 @@
1
+ import { pageSizeDefault as e } from "../../constants/datatable.js";
2
+ import "../../constants/search.js";
3
+ import { useDebounce as t } from "./useDebounce.js";
4
+ import { useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
5
+ import { useSearchParams as s } from "react-router-dom";
6
+ import { useQuery as c } from "@tanstack/react-query";
7
+ //#region src/hooks/behavior/useTable.ts
8
+ var l = ({ queryKey: l, queryFn: u, defaultSortField: d = "", defaultSortDirection: f = "asc", defaultPageSize: p = e, additionalQueryParams: m = {}, resetUrlParams: h = [], onResetFilters: g = () => {}, enabled: _ = !0 }) => {
9
+ let [v, y] = s(), b = parseInt(v.get("page") || "1", 10), x = v.get("search") || "", S = v.get("sortField") || d, C = v.get("sortDirection") || f, [w, T] = o(b), [E, D] = o(p), O = n((e) => {
10
+ D(e), T(1);
11
+ }, []), [k, A] = o(x), [j, M] = o(S), [N, P] = o(C), [F, I] = t(k, 300), L = a(F);
12
+ r(() => {
13
+ L.current !== F && w !== 1 && T(1), L.current = F;
14
+ }, [F, w]), r(() => {
15
+ y((e) => (w === 1 ? e.delete("page") : e.set("page", w.toString()), F.trim() ? e.set("search", F.trim()) : e.delete("search"), j && j !== d ? e.set("sortField", j) : e.delete("sortField"), N === f ? e.delete("sortDirection") : e.set("sortDirection", N), e), { replace: !0 });
16
+ }, [
17
+ w,
18
+ F,
19
+ j,
20
+ N,
21
+ d,
22
+ f,
23
+ y
24
+ ]);
25
+ let R = i(() => ({
26
+ pageNumber: w,
27
+ pageSize: E,
28
+ text: F.trim() || void 0,
29
+ ...m
30
+ }), [
31
+ w,
32
+ E,
33
+ F,
34
+ m
35
+ ]), z = i(() => j ? [{
36
+ key: j,
37
+ order: N
38
+ }] : [], [j, N]), B = n((e) => {
39
+ e && (j === e ? P(N === "asc" ? "desc" : "asc") : (M(e), P("asc")));
40
+ }, [j, N]), V = n(() => {
41
+ A(""), I(""), T(1), M(d), P(f), y((e) => (e.delete("page"), e.delete("search"), e.delete("sortField"), e.delete("sortDirection"), h.forEach((t) => {
42
+ e.delete(t);
43
+ }), e), { replace: !0 }), g();
44
+ }, [
45
+ d,
46
+ f,
47
+ I,
48
+ y,
49
+ h,
50
+ g
51
+ ]), H = i(() => [
52
+ ...l,
53
+ R,
54
+ z
55
+ ], [
56
+ l,
57
+ R,
58
+ z
59
+ ]), { data: U, isLoading: W, error: G, refetch: K } = c({
60
+ queryKey: H,
61
+ queryFn: () => u(R, z),
62
+ enabled: _
63
+ });
64
+ return {
65
+ paginationResult: U,
66
+ isLoading: W,
67
+ error: G,
68
+ refetch: K,
69
+ pageNumber: w,
70
+ pageSize: E,
71
+ setPageNumber: T,
72
+ setPageSize: O,
73
+ search: k,
74
+ debouncedSearch: F,
75
+ setSearch: A,
76
+ sortField: j,
77
+ sortDirection: N,
78
+ handleSort: B,
79
+ resetFilters: V
80
+ };
81
+ };
82
+ //#endregion
83
+ export { l as useTable };
@@ -0,0 +1,46 @@
1
+ import { useCallback as e } from "react";
2
+ import { useSearchParams as t } from "react-router-dom";
3
+ import { format as n, parse as r } from "date-fns";
4
+ //#region src/hooks/behavior/useUrlState.ts
5
+ var i = "yyyy-MM-dd";
6
+ function a(n, r, i, a) {
7
+ let [o, s] = t(), c = o.get(n), l;
8
+ l = c === null ? r : i ? i(c) : c;
9
+ let u = e((e) => {
10
+ s((t) => {
11
+ let i = a ? a(e) : String(e);
12
+ return i === (a ? a(r) : String(r)) || i === "" || i === "undefined" ? t.delete(n) : t.set(n, i), t;
13
+ }, { replace: !0 });
14
+ }, [
15
+ n,
16
+ r,
17
+ a,
18
+ s
19
+ ]);
20
+ return [l, u];
21
+ }
22
+ function o(e, t = []) {
23
+ return a(e, t, (e) => e ? e.split(",").filter(Boolean) : [], (e) => e.join(","));
24
+ }
25
+ function s(e, t) {
26
+ return a(e, t, (e) => parseInt(e, 10) || t, (e) => e.toString());
27
+ }
28
+ var c = (e) => {
29
+ if (!e) return;
30
+ let [t, n] = e.split("_"), a = t ? r(t, i, /* @__PURE__ */ new Date()) : void 0;
31
+ if (!a || isNaN(a.getTime())) return;
32
+ let o = n ? r(n, i, /* @__PURE__ */ new Date()) : void 0;
33
+ return {
34
+ from: a,
35
+ to: o && !isNaN(o.getTime()) ? o : void 0
36
+ };
37
+ }, l = (e) => {
38
+ if (!e?.from) return "";
39
+ let t = n(e.from, i), r = e.to ? n(e.to, i) : "";
40
+ return r ? `${t}_${r}` : t;
41
+ };
42
+ function u(e) {
43
+ return a(e, void 0, c, l);
44
+ }
45
+ //#endregion
46
+ export { i as URL_DATE_FORMAT, c as parseDateRange, l as serializeDateRange, o as useUrlArrayState, u as useUrlDateRangeState, s as useUrlNumberState, a as useUrlState };
@@ -1,11 +1,20 @@
1
- import { t as e } from "../useScrollFade-D9kqJBDh.js";
2
- import { n as t, t as n } from "../useToast-UeDRLovh.js";
3
- import { t as r } from "../useNotifications-CyhTruIG.js";
4
- import { t as i } from "../useMobile-pTQ8lWvt.js";
5
- import { n as a, t as o } from "../useFixedColumns-Bo-Az3Hp.js";
6
- import { t as s } from "../useDocumentTitle-VoQkict_.js";
7
- import { t as c } from "../useLanguage-DRnSb5H1.js";
8
- import { t as l } from "../ui-nQGnCss1.js";
9
- import { t as u } from "../useTheme-DIZjiF5F.js";
10
- import { a as d, c as f, d as p, f as m, h, i as g, l as _, m as v, n as y, o as b, p as x, r as S, s as C, t as w, u as T } from "../behavior-B0BYivtN.js";
11
- export { w as URL_DATE_FORMAT, y as parseDateRange, S as serializeDateRange, n as toast, x as useConfirmDeleteDialog, v as useConfirmationDialog, a as useDataTable, m as useDebounce, p as useDebouncedValue, h as useDialog, s as useDocumentTitle, o as useFixedColumns, c as useLanguage, i as useMobile, r as useNotifications, T as usePage, e as useScrollFade, l as useServerTable, _ as useSidebar, f as useTable, u as useTheme, t as useToast, g as useUrlArrayState, d as useUrlDateRangeState, b as useUrlNumberState, C as useUrlState };
1
+ import { useScrollFade as e } from "./ui/useScrollFade.js";
2
+ import { toast as t, useToast as n } from "./ui/useToast.js";
3
+ import { useNotifications as r } from "./ui/useNotifications.js";
4
+ import { useMobile as i } from "./ui/useMobile.js";
5
+ import { useDataTable as a } from "./ui/useDataTable.js";
6
+ import { useDocumentTitle as o } from "./ui/useDocumentTitle.js";
7
+ import { useFixedColumns as s } from "./ui/useFixedColumns.js";
8
+ import { useLanguage as c } from "./ui/useLanguage.js";
9
+ import { useServerTable as l } from "./ui/useServerTable.js";
10
+ import { useTheme as u } from "./ui/useTheme.js";
11
+ import { useDialog as d } from "./behavior/useDialog.js";
12
+ import { useConfirmationDialog as f } from "./behavior/useConfirmationDialog.js";
13
+ import { useConfirmDeleteDialog as p } from "./behavior/useConfirmDeleteDialog.js";
14
+ import { useDebounce as m } from "./behavior/useDebounce.js";
15
+ import { useDebouncedValue as h } from "./behavior/useDebouncedValue.js";
16
+ import { usePage as g } from "./behavior/usePage.js";
17
+ import { useSidebar as _ } from "./behavior/useSidebar.js";
18
+ import { useTable as v } from "./behavior/useTable.js";
19
+ import { URL_DATE_FORMAT as y, parseDateRange as b, serializeDateRange as x, useUrlArrayState as S, useUrlDateRangeState as C, useUrlNumberState as w, useUrlState as T } from "./behavior/useUrlState.js";
20
+ export { y as URL_DATE_FORMAT, b as parseDateRange, x as serializeDateRange, t as toast, p as useConfirmDeleteDialog, f as useConfirmationDialog, a as useDataTable, m as useDebounce, h as useDebouncedValue, d as useDialog, o as useDocumentTitle, s as useFixedColumns, c as useLanguage, i as useMobile, r as useNotifications, g as usePage, e as useScrollFade, l as useServerTable, _ as useSidebar, v as useTable, u as useTheme, n as useToast, S as useUrlArrayState, C as useUrlDateRangeState, w as useUrlNumberState, T as useUrlState };
@@ -1,10 +1,11 @@
1
- import { t as e } from "../../useScrollFade-D9kqJBDh.js";
2
- import { n as t, t as n } from "../../useToast-UeDRLovh.js";
3
- import { t as r } from "../../useNotifications-CyhTruIG.js";
4
- import { t as i } from "../../useMobile-pTQ8lWvt.js";
5
- import { n as a, t as o } from "../../useFixedColumns-Bo-Az3Hp.js";
6
- import { t as s } from "../../useDocumentTitle-VoQkict_.js";
7
- import { t as c } from "../../useLanguage-DRnSb5H1.js";
8
- import { t as l } from "../../ui-nQGnCss1.js";
9
- import { t as u } from "../../useTheme-DIZjiF5F.js";
10
- export { n as toast, a as useDataTable, s as useDocumentTitle, o as useFixedColumns, c as useLanguage, i as useMobile, r as useNotifications, e as useScrollFade, l as useServerTable, u as useTheme, t as useToast };
1
+ import { useScrollFade as e } from "./useScrollFade.js";
2
+ import { toast as t, useToast as n } from "./useToast.js";
3
+ import { useNotifications as r } from "./useNotifications.js";
4
+ import { useMobile as i } from "./useMobile.js";
5
+ import { useDataTable as a } from "./useDataTable.js";
6
+ import { useDocumentTitle as o } from "./useDocumentTitle.js";
7
+ import { useFixedColumns as s } from "./useFixedColumns.js";
8
+ import { useLanguage as c } from "./useLanguage.js";
9
+ import { useServerTable as l } from "./useServerTable.js";
10
+ import { useTheme as u } from "./useTheme.js";
11
+ export { t as toast, a as useDataTable, o as useDocumentTitle, s as useFixedColumns, c as useLanguage, i as useMobile, r as useNotifications, e as useScrollFade, l as useServerTable, u as useTheme, n as useToast };