@krosoft/react 0.0.381 → 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.
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/core/cards/DashboardCard.js +18 -0
- package/dist/components/core/cards/KpiCard.js +36 -0
- package/dist/components/core/cards/KpiCards.js +29 -0
- package/dist/components/core/cards/MetricCard.js +63 -0
- package/dist/components/core/cards/SkeletonCard.js +13 -0
- package/dist/components/core/cards/SkeletonCards.js +11 -0
- package/dist/components/core/cards/index.js +7 -1
- package/dist/components/core/changelog/AppChangelog.js +123 -0
- package/dist/components/core/changelog/AppChangelogEntry.js +85 -0
- package/dist/components/core/changelog/AppChangelogNav.js +39 -0
- package/dist/components/core/changelog/AppChangelogTagFilter.js +39 -0
- package/dist/components/core/changelog/index.js +1 -1
- package/dist/components/core/charts/BarChartHorizontal.js +80 -0
- package/dist/components/core/charts/BarChartVertical.js +68 -0
- package/dist/components/core/charts/ChartCard.js +44 -0
- package/dist/components/core/charts/CircularGauge.js +58 -0
- package/dist/components/core/charts/LineChart.js +69 -0
- package/dist/components/core/charts/PieChart.js +55 -0
- package/dist/components/core/charts/chartColors.js +10 -0
- package/dist/components/core/charts/chartTooltip.helper.js +15 -0
- package/dist/components/core/charts/index.js +8 -1
- package/dist/components/core/dialogs/AboutDialog.js +59 -0
- package/dist/components/core/dialogs/AppDialog.js +81 -0
- package/dist/components/core/dialogs/ConfirmationDialog.js +42 -0
- package/dist/components/core/dialogs/FormDialog.js +105 -0
- package/dist/components/core/dialogs/index.js +7 -4
- package/dist/components/core/filters/ActiveFilters.js +69 -0
- package/dist/components/core/filters/AdvancedFilters.js +103 -0
- package/dist/components/core/filters/ConditionFilter.js +162 -0
- package/dist/components/core/filters/ConditionFilterGroup.js +44 -0
- package/dist/components/core/filters/FilterField.js +64 -0
- package/dist/components/core/filters/FilterPills.js +13 -0
- package/dist/components/core/filters/FilterPillsGroup.js +39 -0
- package/dist/components/core/filters/FiltersContainer.js +54 -0
- package/dist/components/core/filters/FiltersMobileDrawer.js +57 -0
- package/dist/components/core/filters/TableFilter.js +101 -0
- package/dist/components/core/filters/index.js +11 -645
- package/dist/{GenericForm-Dxd6k7l-.js → components/core/forms/GenericForm.js} +45 -43
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/icons/FlagFrIcon.js +28 -0
- package/dist/{icons-n0m_1w7z.js → components/core/icons/FlagGbIcon.js} +3 -26
- package/dist/components/core/icons/index.js +3 -1
- package/dist/components/core/index.js +71 -27
- package/dist/components/core/inputs/DatePicker.js +46 -0
- package/dist/components/core/inputs/DateRangePicker.js +92 -0
- package/dist/{inputs-CBojnClc.js → components/core/inputs/FileDropzone.js} +8 -37
- package/dist/{ImageInput-BeIOm3GY.js → components/core/inputs/ImageInput.js} +5 -5
- package/dist/components/core/inputs/MultiSelect.js +191 -0
- package/dist/components/core/inputs/RatingInput.js +36 -0
- package/dist/{SearchInput-IT_Rvthr.js → components/core/inputs/SearchInput.js} +4 -4
- package/dist/components/core/inputs/SingleSelect.js +198 -0
- package/dist/components/core/inputs/index.js +9 -6
- package/dist/components/core/inputs/select.helper.js +46 -0
- package/dist/{language-DY0EYabh.js → components/core/language/LanguageSelector.js} +13 -12
- package/dist/components/core/language/index.js +1 -1
- package/dist/{AppActions-8HjAaTQK.js → components/core/layouts/AppActions.js} +19 -19
- package/dist/components/core/layouts/AppPageHeader.js +44 -0
- package/dist/{AppSubTitle-DI62BaaB.js → components/core/layouts/AppSubTitle.js} +3 -3
- package/dist/{AppTitle-BXoTrXQc.js → components/core/layouts/AppTitle.js} +3 -3
- package/dist/components/core/layouts/KpiCardsLayout.js +8 -0
- package/dist/components/core/layouts/index.js +6 -50
- package/dist/components/core/markdown/AppMarkdown.js +134 -0
- package/dist/components/core/markdown/AppMarkdownHeading.js +45 -0
- package/dist/components/core/markdown/index.js +1 -1
- package/dist/components/core/navbar/GlobalSearch.js +128 -0
- package/dist/components/core/navbar/NotificationsBell.js +133 -0
- package/dist/components/core/navbar/Sidebar.js +99 -0
- package/dist/components/core/navbar/SidebarHeader.js +26 -0
- package/dist/components/core/navbar/SidebarNavItem.js +72 -0
- package/dist/components/core/navbar/Topbar.js +25 -0
- package/dist/components/core/navbar/index.js +7 -1
- package/dist/{ErrorAlert-cJnfBL8H.js → components/core/states/ErrorAlert.js} +5 -5
- package/dist/{states-CJ8xE_Nm.js → components/core/states/ErrorState.js} +4 -11
- package/dist/components/core/states/LoadingState.js +12 -0
- package/dist/components/core/states/index.js +3 -2
- package/dist/components/core/table/DataTable.js +108 -0
- package/dist/components/core/table/JsonTableOutput.js +75 -0
- package/dist/components/core/table/TableActions.js +75 -0
- package/dist/components/core/table/TableBody.js +130 -0
- package/dist/components/core/table/TableBulkActions.js +47 -0
- package/dist/components/core/table/TableHeader.js +103 -0
- package/dist/components/core/table/TablePagination.js +102 -0
- package/dist/components/core/table/TableSettings.js +117 -0
- package/dist/components/core/table/index.js +9 -709
- package/dist/components/core/tabs/AppTabContainer.js +17 -0
- package/dist/components/core/tabs/AppTabHeader.js +19 -0
- package/dist/components/core/tabs/AppTabs.js +56 -0
- package/dist/components/core/tabs/AppVerticalTabs.js +105 -0
- package/dist/components/core/tabs/index.js +5 -188
- package/dist/{theme-DSumNHLX.js → components/core/theme/ThemeSelector.js} +13 -12
- package/dist/components/core/theme/index.js +1 -1
- package/dist/components/index.js +117 -34
- package/dist/components/ui/accordion.js +34 -0
- package/dist/components/ui/alert-dialog.js +54 -0
- package/dist/{alert-REQGK9bR.js → components/ui/alert.js} +2 -2
- package/dist/components/ui/aspect-ratio.js +5 -0
- package/dist/components/ui/avatar.js +25 -0
- package/dist/components/ui/badge.js +22 -0
- package/dist/components/ui/breadcrumb.js +60 -0
- package/dist/{tooltip-_geGvbS7.js → components/ui/button.js} +7 -17
- package/dist/components/ui/calendar.js +44 -0
- package/dist/components/ui/card.js +42 -0
- package/dist/components/ui/carousel.js +115 -0
- package/dist/{chart-wW-fwL3s.js → components/ui/chart.js} +51 -89
- package/dist/components/ui/checkbox.js +31 -0
- package/dist/components/ui/collapsible.js +5 -0
- package/dist/components/ui/command.js +84 -0
- package/dist/components/ui/context-menu.js +71 -0
- package/dist/components/ui/control.js +5 -0
- package/dist/components/ui/dialog.js +49 -0
- package/dist/components/ui/drawer.js +47 -0
- package/dist/components/ui/dropdown-menu.js +72 -0
- package/dist/components/ui/form.js +78 -0
- package/dist/components/ui/hover-card.js +15 -0
- package/dist/components/ui/index.js +49 -9
- package/dist/components/ui/input-otp.js +41 -0
- package/dist/components/ui/input.js +14 -0
- package/dist/components/ui/label.js +14 -0
- package/dist/components/ui/menubar.js +86 -0
- package/dist/components/ui/navigation-menu.js +58 -0
- package/dist/components/ui/pagination.js +62 -0
- package/dist/components/ui/popover.js +15 -0
- package/dist/components/ui/progress.js +17 -0
- package/dist/components/ui/radio-group.js +24 -0
- package/dist/components/ui/resizable.js +18 -0
- package/dist/components/ui/scroll-area.js +29 -0
- package/dist/{select-KWMg2_7Z.js → components/ui/select.js} +3 -3
- package/dist/components/ui/separator.js +15 -0
- package/dist/components/ui/sheet.js +58 -0
- package/dist/components/ui/simple-table.js +57 -0
- package/dist/{skeleton-D6Ga4BLw.js → components/ui/skeleton.js} +2 -2
- package/dist/components/ui/slider.js +17 -0
- package/dist/components/ui/sonner.js +23 -0
- package/dist/components/ui/switch.js +14 -0
- package/dist/components/ui/tabs.js +58 -0
- package/dist/components/ui/textarea.js +12 -0
- package/dist/components/ui/toast.js +53 -0
- package/dist/components/ui/toaster.js +22 -0
- package/dist/components/ui/toggle-group.js +37 -0
- package/dist/components/ui/toggle.js +34 -0
- package/dist/components/ui/tooltip.js +14 -0
- package/dist/{datatable-COQcYUrk.js → constants/datatable.js} +1 -1
- package/dist/constants/index.js +3 -5
- package/dist/constants/search.js +4 -0
- package/dist/contexts/index.js +3 -1
- package/dist/{sidebar.context-BahtU6hE.js → contexts/page.context.js} +2 -2
- package/dist/contexts/sidebar.context.js +5 -0
- package/dist/helpers/changelog.helper.js +69 -0
- package/dist/helpers/index.js +6 -166
- package/dist/{markdown.helper-YJE2H5KQ.js → helpers/markdown.helper.js} +1 -1
- package/dist/helpers/supabase.helper.js +41 -0
- package/dist/helpers/table.helper.js +56 -0
- package/dist/{tailwind.helper-CJaRYBmL.js → helpers/tailwind.helper.js} +1 -1
- package/dist/hooks/behavior/index.js +10 -1
- package/dist/hooks/behavior/useConfirmDeleteDialog.js +21 -0
- package/dist/hooks/behavior/useConfirmationDialog.js +23 -0
- package/dist/hooks/behavior/useDebounce.js +14 -0
- package/dist/hooks/behavior/useDebouncedValue.js +15 -0
- package/dist/hooks/behavior/useDialog.js +21 -0
- package/dist/hooks/behavior/usePage.js +10 -0
- package/dist/hooks/behavior/useSidebar.js +10 -0
- package/dist/hooks/behavior/useTable.js +83 -0
- package/dist/hooks/behavior/useUrlState.js +46 -0
- package/dist/hooks/index.js +20 -11
- package/dist/hooks/ui/index.js +11 -10
- package/dist/{useFixedColumns-Bo-Az3Hp.js → hooks/ui/useDataTable.js} +16 -52
- package/dist/{useDocumentTitle-VoQkict_.js → hooks/ui/useDocumentTitle.js} +2 -2
- package/dist/hooks/ui/useFixedColumns.js +38 -0
- package/dist/{useLanguage-DRnSb5H1.js → hooks/ui/useLanguage.js} +3 -3
- package/dist/{useMobile-pTQ8lWvt.js → hooks/ui/useMobile.js} +1 -1
- package/dist/{useNotifications-CyhTruIG.js → hooks/ui/useNotifications.js} +2 -2
- package/dist/{useScrollFade-D9kqJBDh.js → hooks/ui/useScrollFade.js} +1 -1
- package/dist/{ui-nQGnCss1.js → hooks/ui/useServerTable.js} +2 -2
- package/dist/{useTheme-DIZjiF5F.js → hooks/ui/useTheme.js} +3 -3
- package/dist/{useToast-UeDRLovh.js → hooks/ui/useToast.js} +1 -1
- package/dist/i18n/index.js +4 -1
- package/dist/i18n/krosoftLocales.js +13 -0
- package/dist/i18n/useDateFnsLocale.js +13 -0
- package/dist/i18n/useKrosoftTranslation.js +13 -0
- package/dist/locales/en.json.js +174 -0
- package/dist/locales/fr.json.js +174 -0
- package/dist/providers/SidebarProvider.js +42 -0
- package/dist/providers/index.js +1 -42
- package/dist/pwa/PwaUpdater.js +30 -0
- package/dist/pwa/index.js +3 -50
- package/dist/pwa/pwaUpdateToast.js +25 -0
- package/dist/seasonal/EffectSwitch.js +24 -0
- package/dist/seasonal/EmojiSnowfall.js +24 -0
- package/dist/seasonal/HalloweenEffect.js +17 -0
- package/dist/seasonal/SeasonalEffects.js +8 -0
- package/dist/seasonal/SeasonalEffectsSettings.js +35 -0
- package/dist/seasonal/SnowEffect.js +12 -0
- package/dist/seasonal/index.js +7 -120
- package/dist/seasonal/overlayStyle.js +12 -0
- package/dist/seasonal/seasons.js +7 -0
- package/dist/seasonal/useSeasonalEffects.js +20 -0
- package/dist/seasonal/useStoredToggle.js +21 -0
- package/dist/tailwind/index.js +7 -53
- package/dist/tokens/apply.js +16 -0
- package/dist/tokens/index.js +3 -38
- package/dist/tokens/radius.js +26 -0
- package/dist/types/index.js +0 -1
- package/dist/vendor/tailwindcss/lib/public/create-plugin.js +19 -0
- package/dist/vendor/tailwindcss/lib/util/createPlugin.js +30 -0
- package/dist/vendor/tailwindcss/plugin.js +10 -0
- package/package.json +3 -3
- package/dist/AppMarkdown-CAxm82x0.js +0 -171
- package/dist/MultiSelect-DPN046kI.js +0 -228
- package/dist/SingleSelect-DLY5WylQ.js +0 -313
- package/dist/behavior-B0BYivtN.js +0 -201
- package/dist/cards-DPzVebUM.js +0 -132
- package/dist/changelog-DyPFIscf.js +0 -257
- package/dist/charts-C7rKxkli.js +0 -342
- package/dist/dialogs-CG9Q7pqY.js +0 -269
- package/dist/i18n-BhLphJa3.js +0 -364
- package/dist/navbar-DD0V0pNE.js +0 -432
- package/dist/sheet-cWJO_wkT.js +0 -225
- package/dist/switch-DspImmo_.js +0 -24
- package/dist/ui-Fxy95kSJ.js +0 -1163
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { cn as e } from "../../../helpers/tailwind.helper.js";
|
|
2
|
+
import { Card as t, CardContent as n, CardHeader as r } from "../../ui/card.js";
|
|
3
|
+
import { useKrosoftTranslation as i } from "../../../i18n/useKrosoftTranslation.js";
|
|
4
|
+
import { Button as a } from "../../ui/button.js";
|
|
5
|
+
import { Checkbox as o } from "../../ui/checkbox.js";
|
|
6
|
+
import { Form as s, FormControl as c, FormField as l, FormItem as u, FormLabel as d, FormMessage as f } from "../../ui/form.js";
|
|
7
|
+
import { Input as p } from "../../ui/input.js";
|
|
8
|
+
import { Select as m, SelectContent as h, SelectItem as g, SelectTrigger as _, SelectValue as v } from "../../ui/select.js";
|
|
9
|
+
import { Textarea as y } from "../../ui/textarea.js";
|
|
10
|
+
import { useToast as b } from "../../../hooks/ui/useToast.js";
|
|
11
|
+
import { ImageInput as x } from "../inputs/ImageInput.js";
|
|
12
|
+
import { AppSubTitle as S } from "../layouts/AppSubTitle.js";
|
|
13
|
+
import { MultiSelect as C } from "../inputs/MultiSelect.js";
|
|
14
|
+
import { useEffect as ee, useRef as w, useState as T } from "react";
|
|
13
15
|
import { jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
14
16
|
import { useForm as O } from "react-hook-form";
|
|
15
17
|
import { zodResolver as k } from "@hookform/resolvers/zod";
|
|
@@ -46,11 +48,11 @@ var j = (e) => {
|
|
|
46
48
|
});
|
|
47
49
|
}), n;
|
|
48
50
|
}, P = ({ schema: P, isLoading: F, error: I, onSubmit: L, onCancel: R, initialData: z, disabled: B = !1, renderActions: V = !0, id: H, defaultCols: U = 4 }) => {
|
|
49
|
-
let { t: W } = i(), { toast: G } =
|
|
51
|
+
let { t: W } = i(), { toast: G } = b(), [K, q] = T(!1), [J, Y] = T(() => N(P, z)), X = O({
|
|
50
52
|
resolver: k(j(P)),
|
|
51
53
|
defaultValues: M(P, z)
|
|
52
54
|
}), Z = w(!!P);
|
|
53
|
-
|
|
55
|
+
ee(() => {
|
|
54
56
|
P && !Z.current && (Z.current = !0, X.reset(M(P, z)), Y(N(P, z)));
|
|
55
57
|
}, [
|
|
56
58
|
X,
|
|
@@ -111,7 +113,7 @@ var j = (e) => {
|
|
|
111
113
|
let r = !!X.formState.errors[t.key], i = B;
|
|
112
114
|
switch (t.type) {
|
|
113
115
|
case "text":
|
|
114
|
-
case "color": return /* @__PURE__ */ E(
|
|
116
|
+
case "color": return /* @__PURE__ */ E(p, {
|
|
115
117
|
type: t.type,
|
|
116
118
|
...n,
|
|
117
119
|
placeholder: t.placeholderKey ? W(t.placeholderKey) : "",
|
|
@@ -121,7 +123,7 @@ var j = (e) => {
|
|
|
121
123
|
});
|
|
122
124
|
case "image": {
|
|
123
125
|
let a = t, o = t.key, s = typeof n.value == "string" ? n.value : void 0, c = a.value === void 0 ? s ?? J[o] : a.value;
|
|
124
|
-
return /* @__PURE__ */ E(
|
|
126
|
+
return /* @__PURE__ */ E(x, {
|
|
125
127
|
value: c ?? "",
|
|
126
128
|
onChange: (e) => {
|
|
127
129
|
if (a.onChange && a.onChange(e), n.onChange(e), e) {
|
|
@@ -138,14 +140,14 @@ var j = (e) => {
|
|
|
138
140
|
className: e(r && "border-destructive")
|
|
139
141
|
});
|
|
140
142
|
}
|
|
141
|
-
case "date": return /* @__PURE__ */ E(
|
|
143
|
+
case "date": return /* @__PURE__ */ E(p, {
|
|
142
144
|
type: "date",
|
|
143
145
|
...n,
|
|
144
146
|
className: e(r && "border-destructive"),
|
|
145
147
|
disabled: i,
|
|
146
148
|
value: n.value ?? ""
|
|
147
149
|
});
|
|
148
|
-
case "time": return /* @__PURE__ */ E(
|
|
150
|
+
case "time": return /* @__PURE__ */ E(p, {
|
|
149
151
|
type: "time",
|
|
150
152
|
...n,
|
|
151
153
|
className: e(r && "border-destructive"),
|
|
@@ -154,7 +156,7 @@ var j = (e) => {
|
|
|
154
156
|
});
|
|
155
157
|
case "checkbox": return /* @__PURE__ */ D("div", {
|
|
156
158
|
className: "flex items-center space-x-2",
|
|
157
|
-
children: [/* @__PURE__ */ E(
|
|
159
|
+
children: [/* @__PURE__ */ E(o, {
|
|
158
160
|
id: t.key,
|
|
159
161
|
checked: n.value === !0,
|
|
160
162
|
onCheckedChange: (e) => {
|
|
@@ -168,7 +170,7 @@ var j = (e) => {
|
|
|
168
170
|
children: W(t.labelKey)
|
|
169
171
|
})]
|
|
170
172
|
}, t.key);
|
|
171
|
-
case "textarea": return /* @__PURE__ */ E(
|
|
173
|
+
case "textarea": return /* @__PURE__ */ E(y, {
|
|
172
174
|
...n,
|
|
173
175
|
placeholder: t.placeholderKey ? W(t.placeholderKey) : "",
|
|
174
176
|
className: e(r && "border-destructive", "min-h-[100px]"),
|
|
@@ -177,7 +179,7 @@ var j = (e) => {
|
|
|
177
179
|
});
|
|
178
180
|
case "number": {
|
|
179
181
|
let a = t;
|
|
180
|
-
return /* @__PURE__ */ E(
|
|
182
|
+
return /* @__PURE__ */ E(p, {
|
|
181
183
|
type: "number",
|
|
182
184
|
...n,
|
|
183
185
|
step: a.step,
|
|
@@ -193,14 +195,14 @@ var j = (e) => {
|
|
|
193
195
|
});
|
|
194
196
|
}
|
|
195
197
|
case "select": {
|
|
196
|
-
let a = t, o = ne(t.rules),
|
|
197
|
-
return /* @__PURE__ */ D(
|
|
198
|
-
value:
|
|
198
|
+
let a = t, o = ne(t.rules), s = n.value === null || n.value === void 0 ? "" : n.value, l = a.options, u = l.find((e) => e.value === s);
|
|
199
|
+
return /* @__PURE__ */ D(m, {
|
|
200
|
+
value: s,
|
|
199
201
|
onValueChange: n.onChange,
|
|
200
202
|
disabled: i,
|
|
201
|
-
children: [/* @__PURE__ */ E(
|
|
203
|
+
children: [/* @__PURE__ */ E(c, { children: /* @__PURE__ */ E(_, {
|
|
202
204
|
className: e(r && "border-destructive"),
|
|
203
|
-
onClear: o &&
|
|
205
|
+
onClear: o && s ? (e) => {
|
|
204
206
|
e.preventDefault(), e.stopPropagation(), n.onChange(null);
|
|
205
207
|
} : void 0,
|
|
206
208
|
children: /* @__PURE__ */ E(v, {
|
|
@@ -213,7 +215,7 @@ var j = (e) => {
|
|
|
213
215
|
}), u.label]
|
|
214
216
|
}) : void 0
|
|
215
217
|
})
|
|
216
|
-
}) }), /* @__PURE__ */ E(
|
|
218
|
+
}) }), /* @__PURE__ */ E(h, { children: l.map((e, t) => /* @__PURE__ */ E(g, {
|
|
217
219
|
value: e.value,
|
|
218
220
|
children: /* @__PURE__ */ D("div", {
|
|
219
221
|
className: "flex items-center gap-2",
|
|
@@ -227,7 +229,7 @@ var j = (e) => {
|
|
|
227
229
|
}
|
|
228
230
|
case "multiSelect": {
|
|
229
231
|
let e = t, r = n.value ?? [];
|
|
230
|
-
return /* @__PURE__ */ E(
|
|
232
|
+
return /* @__PURE__ */ E(C, {
|
|
231
233
|
options: e.options,
|
|
232
234
|
selected: r,
|
|
233
235
|
onToggle: (e) => {
|
|
@@ -247,34 +249,34 @@ var j = (e) => {
|
|
|
247
249
|
case "html": return t.render(X.getValues(), t);
|
|
248
250
|
default: return null;
|
|
249
251
|
}
|
|
250
|
-
}, ae = (i,
|
|
251
|
-
let
|
|
252
|
+
}, ae = (i, a) => {
|
|
253
|
+
let o = /* @__PURE__ */ E("div", {
|
|
252
254
|
className: e("grid grid-cols-4 gap-4"),
|
|
253
|
-
children: i.fields.map((t) => /* @__PURE__ */ E(
|
|
255
|
+
children: i.fields.map((t) => /* @__PURE__ */ E(l, {
|
|
254
256
|
control: X.control,
|
|
255
257
|
name: t.key,
|
|
256
|
-
render: ({ field: n }) => /* @__PURE__ */ D(
|
|
258
|
+
render: ({ field: n }) => /* @__PURE__ */ D(u, {
|
|
257
259
|
className: e(Q(t.layout?.cols ?? U)),
|
|
258
260
|
children: [
|
|
259
|
-
t.type !== "checkbox" && t.type !== "html" && /* @__PURE__ */ D(
|
|
261
|
+
t.type !== "checkbox" && t.type !== "html" && /* @__PURE__ */ D(d, { children: [W(t.labelKey), re(t.rules) && /* @__PURE__ */ E("span", {
|
|
260
262
|
className: "text-destructive ml-1",
|
|
261
263
|
children: "*"
|
|
262
264
|
})] }),
|
|
263
|
-
/* @__PURE__ */ E(
|
|
264
|
-
/* @__PURE__ */ E(
|
|
265
|
+
/* @__PURE__ */ E(c, { children: ie(t, n) }),
|
|
266
|
+
/* @__PURE__ */ E(f, {})
|
|
265
267
|
]
|
|
266
268
|
})
|
|
267
269
|
}, t.key))
|
|
268
270
|
});
|
|
269
271
|
return P?.useCards === !1 ? /* @__PURE__ */ D("div", {
|
|
270
272
|
className: "space-y-4 mb-6",
|
|
271
|
-
children: [i.titleKey && /* @__PURE__ */ E(
|
|
272
|
-
},
|
|
273
|
+
children: [i.titleKey && /* @__PURE__ */ E(S, { titleKey: i.titleKey }), o]
|
|
274
|
+
}, a) : /* @__PURE__ */ D(t, {
|
|
273
275
|
className: "mb-6",
|
|
274
|
-
children: [i.titleKey && /* @__PURE__ */ E(
|
|
275
|
-
},
|
|
276
|
+
children: [i.titleKey && /* @__PURE__ */ E(r, { children: /* @__PURE__ */ E(S, { titleKey: i.titleKey }) }), /* @__PURE__ */ E(n, { children: o })]
|
|
277
|
+
}, a);
|
|
276
278
|
};
|
|
277
|
-
return P ? /* @__PURE__ */ E(
|
|
279
|
+
return P ? /* @__PURE__ */ E(s, {
|
|
278
280
|
...X,
|
|
279
281
|
children: /* @__PURE__ */ D("form", {
|
|
280
282
|
id: H,
|
|
@@ -290,13 +292,13 @@ var j = (e) => {
|
|
|
290
292
|
})]
|
|
291
293
|
}), !B && V && /* @__PURE__ */ D("div", {
|
|
292
294
|
className: "flex justify-end gap-3 mt-6 border-t pt-4",
|
|
293
|
-
children: [R && /* @__PURE__ */ E(
|
|
295
|
+
children: [R && /* @__PURE__ */ E(a, {
|
|
294
296
|
type: "button",
|
|
295
297
|
variant: "outline",
|
|
296
298
|
onClick: R,
|
|
297
299
|
disabled: K || F,
|
|
298
300
|
children: W("actions.cancel")
|
|
299
|
-
}), /* @__PURE__ */ E(
|
|
301
|
+
}), /* @__PURE__ */ E(a, {
|
|
300
302
|
variant: "default",
|
|
301
303
|
type: "submit",
|
|
302
304
|
disabled: K || (F ?? !1) || X.formState.isSubmitting,
|
|
@@ -307,4 +309,4 @@ var j = (e) => {
|
|
|
307
309
|
}) : null;
|
|
308
310
|
};
|
|
309
311
|
//#endregion
|
|
310
|
-
export { P as
|
|
312
|
+
export { P as GenericForm };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { GenericForm } from "./GenericForm.js";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
//#region src/components/core/icons/FlagFrIcon.tsx
|
|
3
|
+
var n = ({ className: n }) => /* @__PURE__ */ t("svg", {
|
|
4
|
+
viewBox: "0 0 640 480",
|
|
5
|
+
preserveAspectRatio: "xMidYMid slice",
|
|
6
|
+
className: `rounded-[2px] ${n ?? ""}`,
|
|
7
|
+
"aria-hidden": "true",
|
|
8
|
+
children: [
|
|
9
|
+
/* @__PURE__ */ e("rect", {
|
|
10
|
+
width: "640",
|
|
11
|
+
height: "480",
|
|
12
|
+
fill: "#fff"
|
|
13
|
+
}),
|
|
14
|
+
/* @__PURE__ */ e("rect", {
|
|
15
|
+
width: "213.34",
|
|
16
|
+
height: "480",
|
|
17
|
+
fill: "#002395"
|
|
18
|
+
}),
|
|
19
|
+
/* @__PURE__ */ e("rect", {
|
|
20
|
+
x: "426.66",
|
|
21
|
+
width: "213.34",
|
|
22
|
+
height: "480",
|
|
23
|
+
fill: "#ED2939"
|
|
24
|
+
})
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { n as FlagFrIcon };
|
|
@@ -1,30 +1,7 @@
|
|
|
1
1
|
import { useId as e } from "react";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
-
//#region src/components/core/icons/
|
|
4
|
-
var r = ({ className:
|
|
5
|
-
viewBox: "0 0 640 480",
|
|
6
|
-
preserveAspectRatio: "xMidYMid slice",
|
|
7
|
-
className: `rounded-[2px] ${e ?? ""}`,
|
|
8
|
-
"aria-hidden": "true",
|
|
9
|
-
children: [
|
|
10
|
-
/* @__PURE__ */ t("rect", {
|
|
11
|
-
width: "640",
|
|
12
|
-
height: "480",
|
|
13
|
-
fill: "#fff"
|
|
14
|
-
}),
|
|
15
|
-
/* @__PURE__ */ t("rect", {
|
|
16
|
-
width: "213.34",
|
|
17
|
-
height: "480",
|
|
18
|
-
fill: "#002395"
|
|
19
|
-
}),
|
|
20
|
-
/* @__PURE__ */ t("rect", {
|
|
21
|
-
x: "426.66",
|
|
22
|
-
width: "213.34",
|
|
23
|
-
height: "480",
|
|
24
|
-
fill: "#ED2939"
|
|
25
|
-
})
|
|
26
|
-
]
|
|
27
|
-
}), i = ({ className: r }) => {
|
|
3
|
+
//#region src/components/core/icons/FlagGbIcon.tsx
|
|
4
|
+
var r = ({ className: r }) => {
|
|
28
5
|
let i = e().replace(/:/g, ""), a = `flag-gb-field-${i}`, o = `flag-gb-saltire-${i}`;
|
|
29
6
|
return /* @__PURE__ */ n("svg", {
|
|
30
7
|
viewBox: "0 0 60 30",
|
|
@@ -74,4 +51,4 @@ var r = ({ className: e }) => /* @__PURE__ */ n("svg", {
|
|
|
74
51
|
});
|
|
75
52
|
};
|
|
76
53
|
//#endregion
|
|
77
|
-
export { r as
|
|
54
|
+
export { r as FlagGbIcon };
|
|
@@ -1,27 +1,71 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import
|
|
27
|
-
|
|
1
|
+
import { DashboardCard as e } from "./cards/DashboardCard.js";
|
|
2
|
+
import { Dialog as t, DialogClose as n, DialogContent as r, DialogDescription as i, DialogFooter as a, DialogHeader as o, DialogOverlay as s, DialogPortal as c, DialogTitle as l, DialogTrigger as u } from "../ui/dialog.js";
|
|
3
|
+
import { Progress as d } from "../ui/progress.js";
|
|
4
|
+
import { KpiCard as f } from "./cards/KpiCard.js";
|
|
5
|
+
import { KpiCards as p } from "./cards/KpiCards.js";
|
|
6
|
+
import { MetricCard as m } from "./cards/MetricCard.js";
|
|
7
|
+
import { SkeletonCard as h } from "./cards/SkeletonCard.js";
|
|
8
|
+
import { SkeletonCards as g } from "./cards/SkeletonCards.js";
|
|
9
|
+
import { SearchInput as _ } from "./inputs/SearchInput.js";
|
|
10
|
+
import { AppMarkdown as v } from "./markdown/AppMarkdown.js";
|
|
11
|
+
import { AppChangelog as y } from "./changelog/AppChangelog.js";
|
|
12
|
+
import { BarChartHorizontal as b } from "./charts/BarChartHorizontal.js";
|
|
13
|
+
import { BarChartVertical as x } from "./charts/BarChartVertical.js";
|
|
14
|
+
import { CHART_COLORS as S, getChartColor as C } from "./charts/chartColors.js";
|
|
15
|
+
import { ChartCard as w } from "./charts/ChartCard.js";
|
|
16
|
+
import { CircularGauge as T } from "./charts/CircularGauge.js";
|
|
17
|
+
import { LineChart as E } from "./charts/LineChart.js";
|
|
18
|
+
import { PieChart as D } from "./charts/PieChart.js";
|
|
19
|
+
import { ErrorAlert as O } from "./states/ErrorAlert.js";
|
|
20
|
+
import { AppDialog as k } from "./dialogs/AppDialog.js";
|
|
21
|
+
import { ImageInput as A } from "./inputs/ImageInput.js";
|
|
22
|
+
import { AppActions as j } from "./layouts/AppActions.js";
|
|
23
|
+
import { AppSubTitle as M } from "./layouts/AppSubTitle.js";
|
|
24
|
+
import { MultiSelect as N } from "./inputs/MultiSelect.js";
|
|
25
|
+
import { GenericForm as P } from "./forms/GenericForm.js";
|
|
26
|
+
import F from "./dialogs/FormDialog.js";
|
|
27
|
+
import { ConfirmationDialog as I } from "./dialogs/ConfirmationDialog.js";
|
|
28
|
+
import { AboutDialog as L } from "./dialogs/AboutDialog.js";
|
|
29
|
+
import { ActiveFilters as R } from "./filters/ActiveFilters.js";
|
|
30
|
+
import { DatePicker as z } from "./inputs/DatePicker.js";
|
|
31
|
+
import { DateRangePicker as B } from "./inputs/DateRangePicker.js";
|
|
32
|
+
import { SingleSelect as V } from "./inputs/SingleSelect.js";
|
|
33
|
+
import { FilterField as H } from "./filters/FilterField.js";
|
|
34
|
+
import { AdvancedFilters as U } from "./filters/AdvancedFilters.js";
|
|
35
|
+
import { FilterPillsGroup as W } from "./filters/FilterPillsGroup.js";
|
|
36
|
+
import { FilterPills as G } from "./filters/FilterPills.js";
|
|
37
|
+
import { FiltersMobileDrawer as K } from "./filters/FiltersMobileDrawer.js";
|
|
38
|
+
import { FiltersContainer as q } from "./filters/FiltersContainer.js";
|
|
39
|
+
import { TableFilter as J } from "./filters/TableFilter.js";
|
|
40
|
+
import { ConditionFilter as Y } from "./filters/ConditionFilter.js";
|
|
41
|
+
import { ConditionFilterGroup as X } from "./filters/ConditionFilterGroup.js";
|
|
42
|
+
import { FlagFrIcon as Z } from "./icons/FlagFrIcon.js";
|
|
43
|
+
import { FlagGbIcon as Q } from "./icons/FlagGbIcon.js";
|
|
44
|
+
import { FileDropzone as $ } from "./inputs/FileDropzone.js";
|
|
45
|
+
import { RatingInput as ee } from "./inputs/RatingInput.js";
|
|
46
|
+
import { LanguageSelector as te } from "./language/LanguageSelector.js";
|
|
47
|
+
import { AppTitle as ne } from "./layouts/AppTitle.js";
|
|
48
|
+
import { AppPageHeader as re } from "./layouts/AppPageHeader.js";
|
|
49
|
+
import { ErrorState as ie } from "./states/ErrorState.js";
|
|
50
|
+
import { LoadingState as ae } from "./states/LoadingState.js";
|
|
51
|
+
import { KpiCardsLayout as oe } from "./layouts/KpiCardsLayout.js";
|
|
52
|
+
import { GlobalSearch as se } from "./navbar/GlobalSearch.js";
|
|
53
|
+
import { NotificationsBell as ce } from "./navbar/NotificationsBell.js";
|
|
54
|
+
import { SidebarNavItem as le } from "./navbar/SidebarNavItem.js";
|
|
55
|
+
import { Sidebar as ue } from "./navbar/Sidebar.js";
|
|
56
|
+
import { SidebarHeader as de } from "./navbar/SidebarHeader.js";
|
|
57
|
+
import { Topbar as fe } from "./navbar/Topbar.js";
|
|
58
|
+
import { TableActions as pe } from "./table/TableActions.js";
|
|
59
|
+
import { TableBody as me } from "./table/TableBody.js";
|
|
60
|
+
import { TableBulkActions as he } from "./table/TableBulkActions.js";
|
|
61
|
+
import { TableHeader as ge } from "./table/TableHeader.js";
|
|
62
|
+
import { TablePagination as _e } from "./table/TablePagination.js";
|
|
63
|
+
import { TableSettings as ve } from "./table/TableSettings.js";
|
|
64
|
+
import { DataTable as ye } from "./table/DataTable.js";
|
|
65
|
+
import { JsonTableOutput as be } from "./table/JsonTableOutput.js";
|
|
66
|
+
import { AppTabHeader as xe } from "./tabs/AppTabHeader.js";
|
|
67
|
+
import { AppTabContainer as Se } from "./tabs/AppTabContainer.js";
|
|
68
|
+
import { AppTabs as Ce } from "./tabs/AppTabs.js";
|
|
69
|
+
import { AppVerticalTabs as we } from "./tabs/AppVerticalTabs.js";
|
|
70
|
+
import { ThemeSelector as Te } from "./theme/ThemeSelector.js";
|
|
71
|
+
export { L as AboutDialog, R as ActiveFilters, U as AdvancedFilters, j as AppActions, y as AppChangelog, k as AppDialog, v as AppMarkdown, re as AppPageHeader, M as AppSubTitle, Se as AppTabContainer, xe as AppTabHeader, Ce as AppTabs, ne as AppTitle, we as AppVerticalTabs, b as BarChartHorizontal, x as BarChartVertical, S as CHART_COLORS, w as ChartCard, T as CircularGauge, Y as ConditionFilter, X as ConditionFilterGroup, I as ConfirmationDialog, e as DashboardCard, ye as DataTable, z as DatePicker, B as DateRangePicker, t as Dialog, n as DialogClose, r as DialogContent, i as DialogDescription, a as DialogFooter, o as DialogHeader, s as DialogOverlay, c as DialogPortal, l as DialogTitle, u as DialogTrigger, O as ErrorAlert, ie as ErrorState, $ as FileDropzone, H as FilterField, G as FilterPills, W as FilterPillsGroup, q as FiltersContainer, K as FiltersMobileDrawer, Z as FlagFrIcon, Q as FlagGbIcon, F as FormDialog, P as GenericForm, se as GlobalSearch, A as ImageInput, be as JsonTableOutput, f as KpiCard, p as KpiCards, oe as KpiCardsLayout, te as LanguageSelector, E as LineChart, ae as LoadingState, m as MetricCard, N as MultiSelect, ce as NotificationsBell, D as PieChart, d as Progress, ee as RatingInput, _ as SearchInput, ue as Sidebar, de as SidebarHeader, le as SidebarNavItem, V as SingleSelect, h as SkeletonCard, g as SkeletonCards, pe as TableActions, me as TableBody, he as TableBulkActions, J as TableFilter, ge as TableHeader, _e as TablePagination, ve as TableSettings, Te as ThemeSelector, fe as Topbar, C as getChartColor };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { cn as e } from "../../../helpers/tailwind.helper.js";
|
|
2
|
+
import { useDateFnsLocale as t } from "../../../i18n/useDateFnsLocale.js";
|
|
3
|
+
import { Button as n } from "../../ui/button.js";
|
|
4
|
+
import { Calendar as r } from "../../ui/calendar.js";
|
|
5
|
+
import { useEffect as i, useRef as a, useState as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { CalendarIcon as l } from "lucide-react";
|
|
8
|
+
import { format as u } from "date-fns";
|
|
9
|
+
//#region src/components/core/inputs/DatePicker.tsx
|
|
10
|
+
var d = ({ date: d, onDateChange: f, placeholder: p }) => {
|
|
11
|
+
let m = t(), [h, g] = o(!1), _ = a(null);
|
|
12
|
+
return i(() => {
|
|
13
|
+
if (!h) return;
|
|
14
|
+
let e = (e) => {
|
|
15
|
+
_.current !== null && !_.current.contains(e.target) && g(!1);
|
|
16
|
+
};
|
|
17
|
+
return document.addEventListener("mousedown", e), () => {
|
|
18
|
+
document.removeEventListener("mousedown", e);
|
|
19
|
+
};
|
|
20
|
+
}, [h]), /* @__PURE__ */ c("div", {
|
|
21
|
+
ref: _,
|
|
22
|
+
className: "relative w-full",
|
|
23
|
+
children: [/* @__PURE__ */ c(n, {
|
|
24
|
+
variant: "outline",
|
|
25
|
+
type: "button",
|
|
26
|
+
onClick: () => {
|
|
27
|
+
g((e) => !e);
|
|
28
|
+
},
|
|
29
|
+
className: e("w-full justify-start text-left font-normal focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2", h && "ring-2 ring-ring ring-offset-2", d === void 0 && "text-muted-foreground"),
|
|
30
|
+
children: [/* @__PURE__ */ s(l, { className: "mr-2 size-4 shrink-0" }), d === void 0 ? /* @__PURE__ */ s("span", { children: p }) : u(d, "dd/MM/yyyy", { locale: m })]
|
|
31
|
+
}), h ? /* @__PURE__ */ s("div", {
|
|
32
|
+
className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-surface border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2",
|
|
33
|
+
children: /* @__PURE__ */ s(r, {
|
|
34
|
+
mode: "single",
|
|
35
|
+
locale: m,
|
|
36
|
+
defaultMonth: d,
|
|
37
|
+
selected: d,
|
|
38
|
+
onSelect: (e) => {
|
|
39
|
+
f(e), g(!1);
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
}) : null]
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { d as DatePicker };
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { cn as e } from "../../../helpers/tailwind.helper.js";
|
|
2
|
+
import { useDateFnsLocale as t } from "../../../i18n/useDateFnsLocale.js";
|
|
3
|
+
import { useKrosoftTranslation as n } from "../../../i18n/useKrosoftTranslation.js";
|
|
4
|
+
import { Button as r } from "../../ui/button.js";
|
|
5
|
+
import { Calendar as i } from "../../ui/calendar.js";
|
|
6
|
+
import { Popover as a, PopoverContent as o, PopoverTrigger as s } from "../../ui/popover.js";
|
|
7
|
+
import * as c from "react";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
import { CalendarIcon as d, XIcon as f } from "lucide-react";
|
|
10
|
+
import { format as p } from "date-fns";
|
|
11
|
+
//#region src/components/core/inputs/DateRangePicker.tsx
|
|
12
|
+
var m = (e) => e ? {
|
|
13
|
+
from: e.from,
|
|
14
|
+
to: e.to
|
|
15
|
+
} : void 0, h = ({ value: h, onChange: g, placeholder: _, className: v }) => {
|
|
16
|
+
let { t: y } = n(), b = t(), [x, S] = c.useState(!1), [C, w] = c.useState(m(h));
|
|
17
|
+
return c.useEffect(() => {
|
|
18
|
+
x && w(m(h));
|
|
19
|
+
}, [x, h]), /* @__PURE__ */ l("div", {
|
|
20
|
+
className: e("grid gap-2", v),
|
|
21
|
+
children: /* @__PURE__ */ u(a, {
|
|
22
|
+
open: x,
|
|
23
|
+
onOpenChange: S,
|
|
24
|
+
children: [/* @__PURE__ */ l(s, {
|
|
25
|
+
asChild: !0,
|
|
26
|
+
children: /* @__PURE__ */ u(r, {
|
|
27
|
+
id: "date",
|
|
28
|
+
variant: "outline",
|
|
29
|
+
className: e("w-[300px] justify-start text-left font-normal", !h?.from && "text-muted-foreground"),
|
|
30
|
+
children: [
|
|
31
|
+
/* @__PURE__ */ l(d, { className: "mr-2 size-4" }),
|
|
32
|
+
((e) => e?.from ? !e.to || e.from.getTime() === e.to.getTime() ? p(e.from, "dd MMM yyyy", { locale: b }) : `${p(e.from, "dd MMM yyyy", { locale: b })} - ${p(e.to, "dd MMM yyyy", { locale: b })}` : _ ?? y("date.pickPeriod"))(h),
|
|
33
|
+
h?.from && /* @__PURE__ */ l(r, {
|
|
34
|
+
type: "button",
|
|
35
|
+
variant: "ghost",
|
|
36
|
+
size: "icon",
|
|
37
|
+
"aria-label": y("date.clearPeriod"),
|
|
38
|
+
className: "ml-auto h-5 w-5 opacity-50 hover:opacity-100",
|
|
39
|
+
onClick: (e) => {
|
|
40
|
+
e.stopPropagation(), g(void 0), S(!1);
|
|
41
|
+
},
|
|
42
|
+
children: /* @__PURE__ */ l(f, { className: "size-4" })
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
})
|
|
46
|
+
}), /* @__PURE__ */ u(o, {
|
|
47
|
+
className: "w-auto p-0",
|
|
48
|
+
align: "start",
|
|
49
|
+
side: "bottom",
|
|
50
|
+
sideOffset: 4,
|
|
51
|
+
children: [/* @__PURE__ */ l(i, {
|
|
52
|
+
mode: "range",
|
|
53
|
+
resetOnSelect: !0,
|
|
54
|
+
defaultMonth: C?.from,
|
|
55
|
+
selected: C,
|
|
56
|
+
onSelect: w,
|
|
57
|
+
numberOfMonths: 2,
|
|
58
|
+
locale: b,
|
|
59
|
+
className: "pointer-events-auto p-3"
|
|
60
|
+
}), /* @__PURE__ */ u("div", {
|
|
61
|
+
className: "flex items-center justify-between border-t border-border px-3 py-2",
|
|
62
|
+
children: [/* @__PURE__ */ l(r, {
|
|
63
|
+
variant: "ghost",
|
|
64
|
+
size: "sm",
|
|
65
|
+
onClick: () => {
|
|
66
|
+
w(void 0);
|
|
67
|
+
},
|
|
68
|
+
children: y("actions.clear")
|
|
69
|
+
}), /* @__PURE__ */ u("div", {
|
|
70
|
+
className: "flex gap-2",
|
|
71
|
+
children: [/* @__PURE__ */ l(r, {
|
|
72
|
+
variant: "ghost",
|
|
73
|
+
size: "sm",
|
|
74
|
+
onClick: () => {
|
|
75
|
+
w(m(h)), S(!1);
|
|
76
|
+
},
|
|
77
|
+
children: y("actions.cancel")
|
|
78
|
+
}), /* @__PURE__ */ l(r, {
|
|
79
|
+
size: "sm",
|
|
80
|
+
onClick: () => {
|
|
81
|
+
g(C), S(!1);
|
|
82
|
+
},
|
|
83
|
+
children: y("actions.apply")
|
|
84
|
+
})]
|
|
85
|
+
})]
|
|
86
|
+
})]
|
|
87
|
+
})]
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
export { h as DateRangePicker };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "
|
|
1
|
+
import { cn as e } from "../../../helpers/tailwind.helper.js";
|
|
2
|
+
import { useKrosoftTranslation as t } from "../../../i18n/useKrosoftTranslation.js";
|
|
3
3
|
import { useRef as n, useState as r } from "react";
|
|
4
4
|
import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
-
import {
|
|
5
|
+
import { Loader2 as s, UploadIcon as c } from "lucide-react";
|
|
6
6
|
//#region src/components/core/inputs/FileDropzone.tsx
|
|
7
|
-
var
|
|
7
|
+
var l = ({ onFiles: l, accept: u, multiple: d = !0, title: f, hint: p, formats: m, uploading: h = !1, uploadingLabel: g, icon: _ = c, className: v }) => {
|
|
8
8
|
let { t: y } = t(), b = n(null), [x, S] = r(!1), C = (e) => {
|
|
9
9
|
let t = Array.from(e ?? []);
|
|
10
|
-
t.length > 0 &&
|
|
10
|
+
t.length > 0 && l(t);
|
|
11
11
|
};
|
|
12
12
|
return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ a("input", {
|
|
13
13
|
ref: b,
|
|
14
14
|
type: "file",
|
|
15
|
-
accept:
|
|
15
|
+
accept: u,
|
|
16
16
|
multiple: d,
|
|
17
17
|
className: "hidden",
|
|
18
18
|
onChange: (e) => {
|
|
@@ -35,7 +35,7 @@ var d = ({ onFiles: s, accept: l, multiple: d = !0, title: f, hint: p, formats:
|
|
|
35
35
|
children: h ? /* @__PURE__ */ o("span", {
|
|
36
36
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
37
37
|
children: [
|
|
38
|
-
/* @__PURE__ */ a(
|
|
38
|
+
/* @__PURE__ */ a(s, { className: "size-5 animate-spin" }),
|
|
39
39
|
" ",
|
|
40
40
|
g ?? y("dropzone.uploading")
|
|
41
41
|
]
|
|
@@ -63,35 +63,6 @@ var d = ({ onFiles: s, accept: l, multiple: d = !0, title: f, hint: p, formats:
|
|
|
63
63
|
]
|
|
64
64
|
})] })
|
|
65
65
|
})] });
|
|
66
|
-
}, f = {
|
|
67
|
-
heart: {
|
|
68
|
-
Icon: s,
|
|
69
|
-
filledClassName: "fill-rose-500 text-rose-500",
|
|
70
|
-
unit: "cœur"
|
|
71
|
-
},
|
|
72
|
-
star: {
|
|
73
|
-
Icon: l,
|
|
74
|
-
filledClassName: "fill-amber-400 text-amber-400",
|
|
75
|
-
unit: "étoile"
|
|
76
|
-
}
|
|
77
66
|
};
|
|
78
|
-
function p({ value: t, onChange: n, max: r = 5, size: i = "md", icon: o = "star", colorClassName: s, className: c }) {
|
|
79
|
-
let { Icon: l, filledClassName: u, unit: d } = f[o], p = !n, m = i === "sm" ? "h-3.5 w-3.5" : "h-5 w-5", h = s ?? u;
|
|
80
|
-
return /* @__PURE__ */ a("div", {
|
|
81
|
-
className: e("flex items-center gap-0.5", c),
|
|
82
|
-
role: p ? "img" : void 0,
|
|
83
|
-
"aria-label": p ? `${t}/${r} ${d}${t > 1 ? "s" : ""}` : void 0,
|
|
84
|
-
children: Array.from({ length: r }, (r, i) => {
|
|
85
|
-
let o = i + 1, s = /* @__PURE__ */ a(l, { className: e(m, o <= t ? h : "text-muted-foreground/40") });
|
|
86
|
-
return p ? /* @__PURE__ */ a("span", { children: s }, o) : /* @__PURE__ */ a("button", {
|
|
87
|
-
type: "button",
|
|
88
|
-
onClick: () => n?.(t === o ? 0 : o),
|
|
89
|
-
"aria-label": `${o} ${d}${o > 1 ? "s" : ""}`,
|
|
90
|
-
className: "leading-none transition-transform hover:scale-110",
|
|
91
|
-
children: s
|
|
92
|
-
}, o);
|
|
93
|
-
})
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
67
|
//#endregion
|
|
97
|
-
export {
|
|
68
|
+
export { l as FileDropzone };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { cn as e } from "../../../helpers/tailwind.helper.js";
|
|
2
|
+
import { useKrosoftTranslation as t } from "../../../i18n/useKrosoftTranslation.js";
|
|
3
|
+
import { Button as n } from "../../ui/button.js";
|
|
4
|
+
import { useNotifications as r } from "../../../hooks/ui/useNotifications.js";
|
|
5
5
|
import { forwardRef as i, useRef as a, useState as o } from "react";
|
|
6
6
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
7
|
import { ImageIcon as l, UploadIcon as u, XIcon as d } from "lucide-react";
|
|
@@ -80,4 +80,4 @@ var f = i(({ value: i, onChange: f, accept: p = "image/jpeg,image/png,image/webp
|
|
|
80
80
|
});
|
|
81
81
|
f.displayName = "ImageInput";
|
|
82
82
|
//#endregion
|
|
83
|
-
export { f as
|
|
83
|
+
export { f as ImageInput };
|