@krosoft/react 0.0.391 → 0.0.392
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 +1 -2
- package/dist/components/core/cards/DashboardCard.js +7 -8
- package/dist/components/core/cards/KpiCard.js +13 -14
- package/dist/components/core/cards/KpiCards.js +1 -2
- package/dist/components/core/cards/MetricCard.js +1 -2
- package/dist/components/core/cards/SkeletonCard.js +1 -2
- package/dist/components/core/cards/SkeletonCards.js +1 -2
- package/dist/components/core/changelog/AppChangelog.js +13 -14
- package/dist/components/core/changelog/AppChangelogEntry.js +19 -20
- package/dist/components/core/changelog/AppChangelogNav.js +1 -2
- package/dist/components/core/changelog/AppChangelogTagFilter.js +11 -12
- package/dist/components/core/charts/BarChartHorizontal.js +6 -7
- package/dist/components/core/charts/BarChartVertical.js +6 -7
- package/dist/components/core/charts/ChartCard.js +7 -8
- package/dist/components/core/charts/CircularGauge.js +1 -2
- package/dist/components/core/charts/LineChart.js +6 -7
- package/dist/components/core/charts/PieChart.js +12 -13
- package/dist/components/core/charts/chartColors.js +1 -2
- package/dist/components/core/charts/chartTooltip.helper.js +1 -2
- package/dist/components/core/dialogs/AboutDialog.js +11 -12
- package/dist/components/core/dialogs/AppDialog.js +27 -28
- package/dist/components/core/dialogs/ConfirmationDialog.js +15 -16
- package/dist/components/core/dialogs/FormDialog.js +7 -8
- package/dist/components/core/dialogs/index.js +4 -4
- package/dist/components/core/filters/ActiveFilters.js +1 -2
- package/dist/components/core/filters/AdvancedFilters.js +1 -2
- package/dist/components/core/filters/ConditionFilter.js +19 -20
- package/dist/components/core/filters/ConditionFilterGroup.js +1 -2
- package/dist/components/core/filters/FilterField.js +9 -10
- package/dist/components/core/filters/FilterPills.js +1 -2
- package/dist/components/core/filters/FilterPillsGroup.js +1 -2
- package/dist/components/core/filters/FiltersContainer.js +6 -7
- package/dist/components/core/filters/FiltersMobileDrawer.js +1 -2
- package/dist/components/core/filters/TableFilter.js +5 -6
- package/dist/components/core/filters/index.js +7 -7
- package/dist/components/core/forms/GenericForm.js +119 -120
- package/dist/components/core/icons/FlagFrIcon.js +1 -2
- package/dist/components/core/icons/FlagGbIcon.js +1 -2
- package/dist/components/core/inputs/DatePicker.js +9 -10
- package/dist/components/core/inputs/DateRangePicker.js +19 -20
- package/dist/components/core/inputs/FileDropzone.js +2 -3
- package/dist/components/core/inputs/ImageInput.js +9 -10
- package/dist/components/core/inputs/MultiSelect.js +89 -90
- package/dist/components/core/inputs/RatingInput.js +1 -2
- package/dist/components/core/inputs/SearchInput.js +7 -8
- package/dist/components/core/inputs/SingleSelect.js +36 -37
- package/dist/components/core/inputs/index.js +5 -5
- package/dist/components/core/inputs/select.helper.js +1 -2
- package/dist/components/core/language/LanguageSelector.js +1 -2
- package/dist/components/core/layouts/AppActions.js +44 -45
- package/dist/components/core/layouts/AppPageHeader.js +9 -10
- package/dist/components/core/layouts/AppSubTitle.js +1 -2
- package/dist/components/core/layouts/AppTitle.js +1 -2
- package/dist/components/core/layouts/KpiCardsLayout.js +1 -2
- package/dist/components/core/layouts/index.js +4 -4
- package/dist/components/core/markdown/AppMarkdown.js +1 -2
- package/dist/components/core/markdown/AppMarkdownHeading.js +4 -5
- package/dist/components/core/navbar/GlobalSearch.js +16 -17
- package/dist/components/core/navbar/NotificationsBell.js +21 -22
- package/dist/components/core/navbar/Sidebar.js +32 -33
- package/dist/components/core/navbar/SidebarHeader.js +1 -2
- package/dist/components/core/navbar/SidebarNavItem.js +20 -21
- package/dist/components/core/navbar/Topbar.js +5 -6
- package/dist/components/core/navbar/index.js +4 -4
- package/dist/components/core/states/ErrorAlert.js +1 -2
- package/dist/components/core/states/ErrorState.js +1 -2
- package/dist/components/core/states/LoadingState.js +1 -2
- package/dist/components/core/table/DataTable.js +1 -2
- package/dist/components/core/table/JsonTableOutput.js +17 -18
- package/dist/components/core/table/TableActions.js +31 -32
- package/dist/components/core/table/TableBody.js +25 -26
- package/dist/components/core/table/TableBulkActions.js +11 -12
- package/dist/components/core/table/TableHeader.js +15 -16
- package/dist/components/core/table/TablePagination.js +1 -2
- package/dist/components/core/table/TableSettings.js +20 -21
- package/dist/components/core/table/index.js +7 -7
- package/dist/components/core/tabs/AppTabContainer.js +1 -2
- package/dist/components/core/tabs/AppTabHeader.js +1 -2
- package/dist/components/core/tabs/AppTabs.js +10 -11
- package/dist/components/core/tabs/AppVerticalTabs.js +10 -11
- package/dist/components/core/tabs/index.js +3 -3
- package/dist/components/core/theme/ThemeSelector.js +1 -2
- package/dist/components/ui/accordion.js +1 -2
- package/dist/components/ui/alert-dialog.js +1 -2
- package/dist/components/ui/alert.js +1 -2
- package/dist/components/ui/aspect-ratio.js +1 -2
- package/dist/components/ui/avatar.js +1 -2
- package/dist/components/ui/badge.js +1 -2
- package/dist/components/ui/breadcrumb.js +1 -2
- package/dist/components/ui/button.js +1 -2
- package/dist/components/ui/calendar.js +8 -9
- package/dist/components/ui/card.js +1 -2
- package/dist/components/ui/carousel.js +1 -2
- package/dist/components/ui/chart.js +1 -2
- package/dist/components/ui/checkbox.js +1 -2
- package/dist/components/ui/collapsible.js +1 -2
- package/dist/components/ui/command.js +19 -20
- package/dist/components/ui/context-menu.js +1 -2
- package/dist/components/ui/control.js +1 -2
- package/dist/components/ui/dialog.js +1 -2
- package/dist/components/ui/drawer.js +1 -2
- package/dist/components/ui/dropdown-menu.js +1 -2
- package/dist/components/ui/form.js +1 -2
- package/dist/components/ui/hover-card.js +1 -2
- package/dist/components/ui/index.js +19 -19
- package/dist/components/ui/input-otp.js +1 -2
- package/dist/components/ui/input.js +1 -2
- package/dist/components/ui/label.js +1 -2
- package/dist/components/ui/menubar.js +1 -2
- package/dist/components/ui/navigation-menu.js +1 -2
- package/dist/components/ui/pagination.js +1 -2
- package/dist/components/ui/popover.js +1 -2
- package/dist/components/ui/progress.js +1 -2
- package/dist/components/ui/radio-group.js +1 -2
- package/dist/components/ui/resizable.js +1 -2
- package/dist/components/ui/scroll-area.js +1 -2
- package/dist/components/ui/select.js +1 -2
- package/dist/components/ui/separator.js +1 -2
- package/dist/components/ui/sheet.js +1 -2
- package/dist/components/ui/simple-table.js +1 -2
- package/dist/components/ui/skeleton.js +1 -2
- package/dist/components/ui/slider.js +1 -2
- package/dist/components/ui/sonner.js +1 -2
- package/dist/components/ui/switch.js +1 -2
- package/dist/components/ui/tabs.js +1 -2
- package/dist/components/ui/textarea.js +1 -2
- package/dist/components/ui/toast.js +1 -2
- package/dist/components/ui/toaster.js +10 -11
- package/dist/components/ui/toggle-group.js +1 -2
- package/dist/components/ui/toggle.js +1 -2
- package/dist/components/ui/tooltip.js +1 -2
- package/dist/constants/datatable.js +1 -2
- package/dist/constants/search.js +1 -2
- package/dist/contexts/page.context.js +1 -2
- package/dist/contexts/sidebar.context.js +1 -2
- package/dist/helpers/changelog.helper.js +1 -2
- package/dist/helpers/markdown.helper.js +1 -2
- package/dist/helpers/supabase.helper.js +1 -2
- package/dist/helpers/table.helper.js +1 -2
- package/dist/helpers/tailwind.helper.js +1 -2
- package/dist/hooks/behavior/index.js +6 -6
- package/dist/hooks/behavior/useConfirmDeleteDialog.js +1 -2
- package/dist/hooks/behavior/useConfirmationDialog.js +1 -2
- package/dist/hooks/behavior/useDebounce.js +1 -2
- package/dist/hooks/behavior/useDebouncedValue.js +1 -2
- package/dist/hooks/behavior/useDialog.js +1 -2
- package/dist/hooks/behavior/usePage.js +1 -2
- package/dist/hooks/behavior/useSidebar.js +1 -2
- package/dist/hooks/behavior/useTable.js +1 -2
- package/dist/hooks/behavior/useUrlState.js +1 -2
- package/dist/hooks/ui/index.js +10 -10
- package/dist/hooks/ui/useDataTable.js +1 -2
- package/dist/hooks/ui/useDocumentTitle.js +1 -2
- package/dist/hooks/ui/useFixedColumns.js +1 -2
- package/dist/hooks/ui/useLanguage.js +1 -2
- package/dist/hooks/ui/useMobile.js +1 -2
- package/dist/hooks/ui/useNotifications.js +1 -2
- package/dist/hooks/ui/useScrollFade.js +1 -2
- package/dist/hooks/ui/useServerTable.js +1 -2
- package/dist/hooks/ui/useTheme.js +1 -2
- package/dist/hooks/ui/useToast.js +1 -2
- package/dist/i18n/krosoftLocales.js +1 -2
- package/dist/i18n/translateKrosoft.js +1 -2
- package/dist/i18n/useDateFnsLocale.js +1 -2
- package/dist/i18n/useKrosoftTranslation.js +1 -2
- package/dist/locales/en.json.js +1 -2
- package/dist/locales/fr.json.js +1 -2
- package/dist/providers/SidebarProvider.js +5 -6
- package/dist/pwa/PwaUpdater.js +1 -2
- package/dist/pwa/index.js +3 -3
- package/dist/pwa/pwaUpdateToast.js +1 -2
- package/dist/query/createQueryClient.js +1 -2
- package/dist/seasonal/EffectSwitch.js +1 -2
- package/dist/seasonal/EmojiSnowfall.js +1 -2
- package/dist/seasonal/HalloweenEffect.js +5 -6
- package/dist/seasonal/SeasonalEffects.js +4 -5
- package/dist/seasonal/SeasonalEffectsSettings.js +8 -9
- package/dist/seasonal/SnowEffect.js +5 -6
- package/dist/seasonal/overlayStyle.js +1 -2
- package/dist/seasonal/seasons.js +1 -2
- package/dist/seasonal/useSeasonalEffects.js +1 -2
- package/dist/seasonal/useStoredToggle.js +1 -2
- package/dist/tailwind/index.js +1 -2
- package/dist/tokens/apply.js +1 -2
- package/dist/tokens/radius.js +1 -2
- package/dist/vendor/tailwindcss/lib/public/create-plugin.js +1 -2
- package/dist/vendor/tailwindcss/lib/util/createPlugin.js +1 -2
- package/dist/vendor/tailwindcss/plugin.js +1 -2
- package/package.json +2 -2
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { cn as e } from "../../helpers/tailwind.helper.js";
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/components/ui/textarea.tsx
|
|
5
5
|
var r = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("textarea", {
|
|
6
6
|
className: e("flex min-h-[80px] w-full rounded-control border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", t),
|
|
7
7
|
ref: i,
|
|
8
8
|
...r
|
|
9
9
|
}));
|
|
10
10
|
r.displayName = "Textarea";
|
|
11
|
-
//#endregion
|
|
12
11
|
export { r as Textarea };
|
|
@@ -4,7 +4,7 @@ import { jsx as n } from "react/jsx-runtime";
|
|
|
4
4
|
import { XIcon as r } from "lucide-react";
|
|
5
5
|
import { cva as i } from "class-variance-authority";
|
|
6
6
|
import * as a from "@radix-ui/react-toast";
|
|
7
|
-
|
|
7
|
+
// src/components/ui/toast.tsx
|
|
8
8
|
var o = a.Provider, s = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n(a.Viewport, {
|
|
9
9
|
ref: i,
|
|
10
10
|
className: e("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]", t),
|
|
@@ -49,5 +49,4 @@ var p = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n(a.Descript
|
|
|
49
49
|
...r
|
|
50
50
|
}));
|
|
51
51
|
p.displayName = a.Description.displayName;
|
|
52
|
-
//#endregion
|
|
53
52
|
export { l as Toast, u as ToastAction, d as ToastClose, p as ToastDescription, o as ToastProvider, f as ToastTitle, s as ToastViewport };
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { useToast as e } from "../../hooks/ui/useToast.js";
|
|
2
|
+
import { Toast as t, ToastClose as n, ToastDescription as r, ToastProvider as i, ToastTitle as a, ToastViewport as o } from "./toast.js";
|
|
3
3
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
4
|
-
|
|
4
|
+
// src/components/ui/toaster.tsx
|
|
5
5
|
function l() {
|
|
6
|
-
let { toasts: l } =
|
|
7
|
-
return /* @__PURE__ */ c(
|
|
8
|
-
return /* @__PURE__ */ c(
|
|
6
|
+
let { toasts: l } = e();
|
|
7
|
+
return /* @__PURE__ */ c(i, { children: [l.map(function({ id: e, title: i, description: o, action: l, ...u }) {
|
|
8
|
+
return /* @__PURE__ */ c(t, {
|
|
9
9
|
...u,
|
|
10
10
|
children: [
|
|
11
11
|
/* @__PURE__ */ c("div", {
|
|
12
12
|
className: "grid gap-1",
|
|
13
|
-
children: [
|
|
13
|
+
children: [i && /* @__PURE__ */ s(a, { children: i }), o && /* @__PURE__ */ s(r, { children: o })]
|
|
14
14
|
}),
|
|
15
15
|
l,
|
|
16
|
-
/* @__PURE__ */ s(
|
|
16
|
+
/* @__PURE__ */ s(n, {})
|
|
17
17
|
]
|
|
18
|
-
},
|
|
19
|
-
}), /* @__PURE__ */ s(
|
|
18
|
+
}, e);
|
|
19
|
+
}), /* @__PURE__ */ s(o, {})] });
|
|
20
20
|
}
|
|
21
|
-
//#endregion
|
|
22
21
|
export { l as Toaster };
|
|
@@ -3,7 +3,7 @@ import { toggleVariants as t } from "./toggle.js";
|
|
|
3
3
|
import * as n from "react";
|
|
4
4
|
import { jsx as r } from "react/jsx-runtime";
|
|
5
5
|
import * as i from "@radix-ui/react-toggle-group";
|
|
6
|
-
|
|
6
|
+
// src/components/ui/toggle-group.tsx
|
|
7
7
|
var a = n.createContext({
|
|
8
8
|
size: "default",
|
|
9
9
|
variant: "default"
|
|
@@ -33,5 +33,4 @@ var s = n.forwardRef(({ className: o, children: s, variant: c, size: l, ...u },
|
|
|
33
33
|
});
|
|
34
34
|
});
|
|
35
35
|
s.displayName = i.Item.displayName;
|
|
36
|
-
//#endregion
|
|
37
36
|
export { o as ToggleGroup, s as ToggleGroupItem };
|
|
@@ -3,7 +3,7 @@ import * as t from "react";
|
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
import { cva as r } from "class-variance-authority";
|
|
5
5
|
import * as i from "@radix-ui/react-toggle";
|
|
6
|
-
|
|
6
|
+
// src/components/ui/toggle.tsx
|
|
7
7
|
var a = r("inline-flex items-center justify-center rounded-control text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground", {
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
@@ -30,5 +30,4 @@ var a = r("inline-flex items-center justify-center rounded-control text-sm font-
|
|
|
30
30
|
...s
|
|
31
31
|
}));
|
|
32
32
|
o.displayName = i.Root.displayName;
|
|
33
|
-
//#endregion
|
|
34
33
|
export { o as Toggle, a as toggleVariants };
|
|
@@ -2,7 +2,7 @@ import { cn as e } from "../../helpers/tailwind.helper.js";
|
|
|
2
2
|
import * as t from "react";
|
|
3
3
|
import { jsx as n } from "react/jsx-runtime";
|
|
4
4
|
import * as r from "@radix-ui/react-tooltip";
|
|
5
|
-
|
|
5
|
+
// src/components/ui/tooltip.tsx
|
|
6
6
|
var i = r.Provider, a = r.Root, o = r.Trigger, s = t.forwardRef(({ className: t, sideOffset: i = 4, ...a }, o) => /* @__PURE__ */ n(r.Content, {
|
|
7
7
|
ref: o,
|
|
8
8
|
sideOffset: i,
|
|
@@ -10,5 +10,4 @@ var i = r.Provider, a = r.Root, o = r.Trigger, s = t.forwardRef(({ className: t,
|
|
|
10
10
|
...a
|
|
11
11
|
}));
|
|
12
12
|
s.displayName = r.Content.displayName;
|
|
13
|
-
//#endregion
|
|
14
13
|
export { a as Tooltip, s as TooltipContent, i as TooltipProvider, o as TooltipTrigger };
|
package/dist/constants/search.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/helpers/changelog.helper.ts
|
|
2
2
|
var e = /^## +(.+?)\s*$/, t = /^(?:\[v?([^\]]+)\]\s*[-–]\s*)?(\d{4}-\d{2}-\d{2}(?:[ T]\d{2}:\d{2})?)(?:\s*[-–]\s*(.+))?$/, n = /^(\d{4})-(\d{2})-(\d{2})(?:[ T](\d{2}):(\d{2}))?/, r = (e) => e.trim().toLowerCase().replace(/[^\p{L}\p{N}\s_-]/gu, "").replace(/\s/g, "-"), i = (e) => {
|
|
3
3
|
let t = n.exec(e);
|
|
4
4
|
if (!t) return { hasTime: !1 };
|
|
@@ -65,5 +65,4 @@ var e = /^## +(.+?)\s*$/, t = /^(?:\[v?([^\]]+)\]\s*[-–]\s*)?(\d{4}-\d{2}-\d{2
|
|
|
65
65
|
return n.set(i, a), a === 1 ? i : `${i}-${String(a)}`;
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
|
-
//#endregion
|
|
69
68
|
export { d as filterChangelog, p as getChangelogItemAnchors, f as getChangelogTags, o as parseChangelog, r as slugifyChangelogTitle, l as splitChangelogItems };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/helpers/supabase.helper.ts
|
|
2
2
|
function e(e, t, n = {}) {
|
|
3
3
|
let r = e, i = t.debouncedSearchText ?? t.searchText;
|
|
4
4
|
if (i?.trim() && n.searchColumns?.length) {
|
|
@@ -37,5 +37,4 @@ function n(e, t) {
|
|
|
37
37
|
}
|
|
38
38
|
return n;
|
|
39
39
|
}
|
|
40
|
-
//#endregion
|
|
41
40
|
export { e as applyTableStateToQuery, t as mapNestedRelationMany, n as mapNestedRelationOne };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/helpers/table.helper.ts
|
|
2
2
|
var e = {
|
|
3
3
|
left: "text-left",
|
|
4
4
|
center: "text-center",
|
|
@@ -52,5 +52,4 @@ function s(e) {
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
//#endregion
|
|
56
55
|
export { i as ACTIONS_COLUMN_KEY, r as SELECTION_COLUMN_KEY, n as getAlignmentClass, t as getColumnAlignment, o as getFixedCellProps, s as localStorageColumnVisibility };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { useConfirmationDialog as e } from "./useConfirmationDialog.js";
|
|
2
|
+
import { useConfirmDeleteDialog as t } from "./useConfirmDeleteDialog.js";
|
|
3
|
+
import { useDebounce as n } from "./useDebounce.js";
|
|
4
|
+
import { useDebouncedValue as r } from "./useDebouncedValue.js";
|
|
5
|
+
import { useDialog as i } from "./useDialog.js";
|
|
6
6
|
import { usePage as a } from "./usePage.js";
|
|
7
7
|
import { useSidebar as o } from "./useSidebar.js";
|
|
8
8
|
import { useTable as s } from "./useTable.js";
|
|
9
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,
|
|
10
|
+
export { c as URL_DATE_FORMAT, l as parseDateRange, u as serializeDateRange, t as useConfirmDeleteDialog, e as useConfirmationDialog, n as useDebounce, r as useDebouncedValue, i as useDialog, a as usePage, o as useSidebar, s as useTable, d as useUrlArrayState, f as useUrlDateRangeState, p as useUrlNumberState, m as useUrlState };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useKrosoftTranslation as e } from "../../i18n/useKrosoftTranslation.js";
|
|
2
2
|
import { useConfirmationDialog as t } from "./useConfirmationDialog.js";
|
|
3
3
|
import { TrashIcon as n } from "lucide-react";
|
|
4
|
-
|
|
4
|
+
// src/hooks/behavior/useConfirmDeleteDialog.ts
|
|
5
5
|
var r = ({ titleKey: r, descriptionKey: i, confirmKey: a, onConfirm: o, onReset: s }) => {
|
|
6
6
|
let { t: c } = e();
|
|
7
7
|
return {
|
|
@@ -17,5 +17,4 @@ var r = ({ titleKey: r, descriptionKey: i, confirmKey: a, onConfirm: o, onReset:
|
|
|
17
17
|
titleClassName: "flex items-center gap-2 text-destructive"
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
export { r as useConfirmDeleteDialog };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useDialog as e } from "./useDialog.js";
|
|
2
|
-
|
|
2
|
+
// src/hooks/behavior/useConfirmationDialog.ts
|
|
3
3
|
var t = ({ titleKey: t, descriptionKey: n, confirmKey: r = "Confirmer", onConfirm: i, onReset: a }) => {
|
|
4
4
|
let o = e({ onReset: a });
|
|
5
5
|
return {
|
|
@@ -19,5 +19,4 @@ var t = ({ titleKey: t, descriptionKey: n, confirmKey: r = "Confirmer", onConfir
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
//#endregion
|
|
23
22
|
export { t as useConfirmationDialog };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
|
|
2
|
-
|
|
2
|
+
// src/hooks/behavior/useDebounce.ts
|
|
3
3
|
var i = (i, a) => {
|
|
4
4
|
let [o, s] = r(i), c = n(void 0);
|
|
5
5
|
return t(() => (c.current = setTimeout(() => {
|
|
@@ -10,5 +10,4 @@ var i = (i, a) => {
|
|
|
10
10
|
clearTimeout(c.current), s(e);
|
|
11
11
|
}, [])];
|
|
12
12
|
};
|
|
13
|
-
//#endregion
|
|
14
13
|
export { i as useDebounce };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
|
-
|
|
2
|
+
// src/hooks/behavior/useDebouncedValue.ts
|
|
3
3
|
var t = (t, n = 250) => {
|
|
4
4
|
let [r, i] = e.useState(t);
|
|
5
5
|
return e.useEffect(() => {
|
|
@@ -11,5 +11,4 @@ var t = (t, n = 250) => {
|
|
|
11
11
|
};
|
|
12
12
|
}, [t, n]), r;
|
|
13
13
|
};
|
|
14
|
-
//#endregion
|
|
15
14
|
export { t as useDebouncedValue };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState as e } from "react";
|
|
2
|
-
|
|
2
|
+
// src/hooks/behavior/useDialog.ts
|
|
3
3
|
var t = (t) => {
|
|
4
4
|
let [n, r] = e(null);
|
|
5
5
|
return {
|
|
@@ -17,5 +17,4 @@ var t = (t) => {
|
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
export { t as useDialog };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { PageContext as e } from "../../contexts/page.context.js";
|
|
2
2
|
import { useContext as t } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/behavior/usePage.tsx
|
|
4
4
|
var n = () => {
|
|
5
5
|
let n = t(e);
|
|
6
6
|
if (n === void 0) throw Error("usePage must be used within an PageProvider");
|
|
7
7
|
return n;
|
|
8
8
|
};
|
|
9
|
-
//#endregion
|
|
10
9
|
export { n as usePage };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { SidebarContext as e } from "../../contexts/sidebar.context.js";
|
|
2
2
|
import { useContext as t } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/behavior/useSidebar.ts
|
|
4
4
|
var n = () => {
|
|
5
5
|
let n = t(e);
|
|
6
6
|
if (n === void 0) throw Error("useSidebar must be used within a SidebarProvider");
|
|
7
7
|
return n;
|
|
8
8
|
};
|
|
9
|
-
//#endregion
|
|
10
9
|
export { n as useSidebar };
|
|
@@ -4,7 +4,7 @@ import { useDebounce as t } from "./useDebounce.js";
|
|
|
4
4
|
import { useCallback as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
5
5
|
import { useSearchParams as s } from "react-router-dom";
|
|
6
6
|
import { useQuery as c } from "@tanstack/react-query";
|
|
7
|
-
|
|
7
|
+
// src/hooks/behavior/useTable.ts
|
|
8
8
|
var l = ({ queryKey: l, queryFn: u, defaultSortField: d = "", defaultSortDirection: f = "asc", defaultPageSize: p = e, additionalQueryParams: m = {}, resetUrlParams: h = [], onResetFilters: g = () => {}, enabled: _ = !0 }) => {
|
|
9
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
10
|
D(e), T(1);
|
|
@@ -79,5 +79,4 @@ var l = ({ queryKey: l, queryFn: u, defaultSortField: d = "", defaultSortDirecti
|
|
|
79
79
|
resetFilters: V
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
-
//#endregion
|
|
83
82
|
export { l as useTable };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback as e } from "react";
|
|
2
2
|
import { useSearchParams as t } from "react-router-dom";
|
|
3
3
|
import { format as n, parse as r } from "date-fns";
|
|
4
|
-
|
|
4
|
+
// src/hooks/behavior/useUrlState.ts
|
|
5
5
|
var i = "yyyy-MM-dd";
|
|
6
6
|
function a(n, r, i, a) {
|
|
7
7
|
let [o, s] = t(), c = o.get(n), l;
|
|
@@ -42,5 +42,4 @@ var c = (e) => {
|
|
|
42
42
|
function u(e) {
|
|
43
43
|
return a(e, void 0, c, l);
|
|
44
44
|
}
|
|
45
|
-
//#endregion
|
|
46
45
|
export { i as URL_DATE_FORMAT, c as parseDateRange, l as serializeDateRange, o as useUrlArrayState, u as useUrlDateRangeState, s as useUrlNumberState, a as useUrlState };
|
package/dist/hooks/ui/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { useDataTable as e } from "./useDataTable.js";
|
|
2
|
+
import { useDocumentTitle as t } from "./useDocumentTitle.js";
|
|
3
|
+
import { useFixedColumns as n } from "./useFixedColumns.js";
|
|
4
|
+
import { useLanguage as r } from "./useLanguage.js";
|
|
4
5
|
import { useMobile as i } from "./useMobile.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
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 };
|
|
6
|
+
import { useNotifications as a } from "./useNotifications.js";
|
|
7
|
+
import { useScrollFade as o } from "./useScrollFade.js";
|
|
8
|
+
import { useServerTable as s } from "./useServerTable.js";
|
|
9
|
+
import { useTheme as c } from "./useTheme.js";
|
|
10
|
+
import { toast as l, useToast as u } from "./useToast.js";
|
|
11
|
+
export { l as toast, e as useDataTable, t as useDocumentTitle, n as useFixedColumns, r as useLanguage, i as useMobile, a as useNotifications, o as useScrollFade, s as useServerTable, c as useTheme, u as useToast };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback as e, useMemo as t, useRef as n, useState as r } from "react";
|
|
2
|
-
|
|
2
|
+
// src/hooks/ui/useDataTable.ts
|
|
3
3
|
var i = 100, a = (e) => e.defaultVisible !== !1, ee = (e, t) => {
|
|
4
4
|
let n = new Map(t.map((e) => [e.key, e])), r = e.filter((e) => n.has(e)), i = new Set(r);
|
|
5
5
|
return t.forEach((e, n) => {
|
|
@@ -149,5 +149,4 @@ function o({ data: o, columns: s, rowKey: c, rowSelectable: l, pageSizeDefault:
|
|
|
149
149
|
}
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
|
-
//#endregion
|
|
153
152
|
export { o as useDataTable };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useKrosoftTranslation as e } from "../../i18n/useKrosoftTranslation.js";
|
|
2
2
|
import { useEffect as t } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/ui/useDocumentTitle.ts
|
|
4
4
|
var n = (n, r, i) => {
|
|
5
5
|
let { t: a } = e();
|
|
6
6
|
t(() => {
|
|
@@ -15,5 +15,4 @@ var n = (n, r, i) => {
|
|
|
15
15
|
n
|
|
16
16
|
]);
|
|
17
17
|
};
|
|
18
|
-
//#endregion
|
|
19
18
|
export { n as useDocumentTitle };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useLayoutEffect as e, useState as t } from "react";
|
|
2
|
-
|
|
2
|
+
// src/hooks/ui/useFixedColumns.ts
|
|
3
3
|
var n = (e, t) => {
|
|
4
4
|
let n = Object.keys(e);
|
|
5
5
|
return n.length === Object.keys(t).length && n.every((n) => {
|
|
@@ -34,5 +34,4 @@ function r(r) {
|
|
|
34
34
|
};
|
|
35
35
|
}), i;
|
|
36
36
|
}
|
|
37
|
-
//#endregion
|
|
38
37
|
export { r as useFixedColumns };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useKrosoftTranslation as e } from "../../i18n/useKrosoftTranslation.js";
|
|
2
2
|
import { useNotifications as t } from "./useNotifications.js";
|
|
3
3
|
import { useTranslation as n } from "react-i18next";
|
|
4
|
-
|
|
4
|
+
// src/hooks/ui/useLanguage.ts
|
|
5
5
|
function r(r) {
|
|
6
6
|
let { i18n: i } = n(), { t: a } = e(), { showSuccess: o } = t(), s = i.language ?? "", c = s.split("-")[0], l = r.find((e) => e.value === s) ?? r.find((e) => e.value === c) ?? r[0], u = r.findIndex((e) => e.value === l?.value), d = r.length > 0 ? r[(u + 1) % r.length] : void 0, f = (e) => {
|
|
7
7
|
i.changeLanguage(e);
|
|
@@ -19,5 +19,4 @@ function r(r) {
|
|
|
19
19
|
}
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
//#endregion
|
|
23
22
|
export { r as useLanguage };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect as e, useState as t } from "react";
|
|
2
|
-
|
|
2
|
+
// src/hooks/ui/useMobile.tsx
|
|
3
3
|
var n = 768;
|
|
4
4
|
function r() {
|
|
5
5
|
let [r, i] = t(!1);
|
|
@@ -12,5 +12,4 @@ function r() {
|
|
|
12
12
|
};
|
|
13
13
|
}, []), r;
|
|
14
14
|
}
|
|
15
|
-
//#endregion
|
|
16
15
|
export { r as useMobile };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toast as e } from "./useToast.js";
|
|
2
|
-
|
|
2
|
+
// src/hooks/ui/useNotifications.ts
|
|
3
3
|
var t = () => ({
|
|
4
4
|
showSuccess: (t, n, r) => {
|
|
5
5
|
e({
|
|
@@ -16,5 +16,4 @@ var t = () => ({
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
//#endregion
|
|
20
19
|
export { t as useNotifications };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useLayoutEffect as e, useState as t } from "react";
|
|
2
|
-
|
|
2
|
+
// src/hooks/ui/useScrollFade.ts
|
|
3
3
|
var n = "1.5rem";
|
|
4
4
|
function r(r) {
|
|
5
5
|
let [i, a] = t({
|
|
@@ -23,5 +23,4 @@ function r(r) {
|
|
|
23
23
|
};
|
|
24
24
|
}), !i.start && !i.end ? {} : { maskImage: `linear-gradient(to right, transparent 0, #000 ${i.start ? n : "0px"}, #000 calc(100% - ${i.end ? n : "0px"}), transparent 100%)` };
|
|
25
25
|
}
|
|
26
|
-
//#endregion
|
|
27
26
|
export { r as useScrollFade };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../constants/search.js";
|
|
2
2
|
import { useCallback as e, useEffect as t, useState as n } from "react";
|
|
3
|
-
|
|
3
|
+
// src/hooks/ui/useServerTable.ts
|
|
4
4
|
function r(r, i = "nom", a = {}) {
|
|
5
5
|
let [o, s] = n(a.initialPage ?? 1), [c, l] = n(a.initialPageSize ?? 10), [u, d] = n(i), [f, p] = n(a.initialSortDirection ?? "asc"), [m, h] = n(a.initialSearchText ?? ""), [g, _] = n(a.initialSearchText ?? ""), [v, y] = n(r);
|
|
6
6
|
t(() => {
|
|
@@ -35,5 +35,4 @@ function r(r, i = "nom", a = {}) {
|
|
|
35
35
|
onFiltersChange: x
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
//#endregion
|
|
39
38
|
export { r as useServerTable };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useKrosoftTranslation as e } from "../../i18n/useKrosoftTranslation.js";
|
|
2
2
|
import { useNotifications as t } from "./useNotifications.js";
|
|
3
3
|
import { useTheme as n } from "next-themes";
|
|
4
|
-
|
|
4
|
+
// src/hooks/ui/useTheme.ts
|
|
5
5
|
function r(r) {
|
|
6
6
|
let { t: i } = e(), { showSuccess: a } = t(), { theme: o, setTheme: s } = n(), c = (e) => {
|
|
7
7
|
s(e);
|
|
@@ -21,5 +21,4 @@ function r(r) {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
|
-
//#endregion
|
|
25
24
|
export { r as useTheme };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
|
-
|
|
2
|
+
// src/hooks/ui/useToast.ts
|
|
3
3
|
var t = 1, n = 1e6, r = 0;
|
|
4
4
|
function i() {
|
|
5
5
|
return r = (r + 1) % (2 ** 53 - 1), r.toString();
|
|
@@ -99,5 +99,4 @@ function f() {
|
|
|
99
99
|
}
|
|
100
100
|
};
|
|
101
101
|
}
|
|
102
|
-
//#endregion
|
|
103
102
|
export { s as reducer, d as toast, f as useToast };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "../locales/en.json.js";
|
|
2
2
|
import t from "../locales/fr.json.js";
|
|
3
|
-
|
|
3
|
+
// src/i18n/krosoftLocales.ts
|
|
4
4
|
var n = "krosoft", r = {
|
|
5
5
|
fr: t,
|
|
6
6
|
en: e
|
|
@@ -9,5 +9,4 @@ var n = "krosoft", r = {
|
|
|
9
9
|
e.addResourceBundle?.(r, n, i, !0, t);
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
|
-
//#endregion
|
|
13
12
|
export { n as KROSOFT_NAMESPACE, r as krosoftLocales, i as registerKrosoftLocales };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import e from "../locales/fr.json.js";
|
|
2
2
|
import { KROSOFT_NAMESPACE as t } from "./krosoftLocales.js";
|
|
3
|
-
|
|
3
|
+
// src/i18n/translateKrosoft.ts
|
|
4
4
|
var n = (t) => {
|
|
5
5
|
let n = t.split(".").reduce((e, t) => typeof e == "object" && e ? e[t] : void 0, e);
|
|
6
6
|
return typeof n == "string" ? n : void 0;
|
|
@@ -14,5 +14,4 @@ var n = (t) => {
|
|
|
14
14
|
}
|
|
15
15
|
return r(n(i) ?? i, a);
|
|
16
16
|
};
|
|
17
|
-
//#endregion
|
|
18
17
|
export { r as interpolate, n as readBundled, i as translateKrosoft };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { KROSOFT_NAMESPACE as e } from "./krosoftLocales.js";
|
|
2
2
|
import { enGB as t, fr as n } from "date-fns/locale";
|
|
3
3
|
import { useTranslation as r } from "react-i18next";
|
|
4
|
-
|
|
4
|
+
// src/i18n/useDateFnsLocale.ts
|
|
5
5
|
var i = {
|
|
6
6
|
fr: n,
|
|
7
7
|
en: t
|
|
@@ -9,5 +9,4 @@ var i = {
|
|
|
9
9
|
let { i18n: t, ready: n } = r(e, { useSuspense: !1 });
|
|
10
10
|
return o(n ? t.resolvedLanguage ?? t.language : void 0);
|
|
11
11
|
};
|
|
12
|
-
//#endregion
|
|
13
12
|
export { o as dateFnsLocale, s as useDateFnsLocale };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { KROSOFT_NAMESPACE as e } from "./krosoftLocales.js";
|
|
2
2
|
import { interpolate as t, readBundled as n } from "./translateKrosoft.js";
|
|
3
3
|
import { useTranslation as r } from "react-i18next";
|
|
4
|
-
|
|
4
|
+
// src/i18n/useKrosoftTranslation.ts
|
|
5
5
|
var i = () => {
|
|
6
6
|
let { t: i, i18n: a, ready: o } = r(e, { useSuspense: !1 }), { t: s } = r(void 0, { useSuspense: !1 });
|
|
7
7
|
return { t: (e, r) => o && a.exists(e) ? s(e, r ?? {}) : o && a.exists(e, { ns: "krosoft" }) ? i(e, r ?? {}) : t(n(e) ?? e, r) };
|
|
8
8
|
};
|
|
9
|
-
//#endregion
|
|
10
9
|
export { i as useKrosoftTranslation };
|
package/dist/locales/en.json.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locales/en.json
|
|
2
2
|
var e = {
|
|
3
3
|
cancel: "Cancel",
|
|
4
4
|
save: "Save",
|
|
@@ -174,5 +174,4 @@ var e = {
|
|
|
174
174
|
markdown: v,
|
|
175
175
|
changelog: y
|
|
176
176
|
};
|
|
177
|
-
//#endregion
|
|
178
177
|
export { _ as about, e as actions, y as changelog, a as date, b as default, l as dropzone, o as filters, s as form, c as image, f as language, v as markdown, r as notifications, m as pwa, h as query, n as search, g as seasonal, i as select, d as sidebar, t as states, u as table, p as theme };
|
package/dist/locales/fr.json.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/locales/fr.json
|
|
2
2
|
var e = {
|
|
3
3
|
cancel: "Annuler",
|
|
4
4
|
save: "Enregistrer",
|
|
@@ -174,5 +174,4 @@ var e = {
|
|
|
174
174
|
markdown: v,
|
|
175
175
|
changelog: y
|
|
176
176
|
};
|
|
177
|
-
//#endregion
|
|
178
177
|
export { _ as about, e as actions, y as changelog, a as date, b as default, l as dropzone, o as filters, s as form, c as image, f as language, v as markdown, r as notifications, m as pwa, h as query, n as search, g as seasonal, i as select, d as sidebar, t as states, u as table, p as theme };
|