@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.
- 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 +4 -4
- 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,645 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
13
|
-
import { getLocale as R } from "@krosoft/core/helpers";
|
|
14
|
-
import { ChevronDownIcon as z, Filter as B, FilterIcon as V, FilterXIcon as H, PlusIcon as U, XIcon as W } from "lucide-react";
|
|
15
|
-
//#region src/components/core/filters/ActiveFilters.tsx
|
|
16
|
-
var G = (e, t, n, r = {}) => {
|
|
17
|
-
if (t instanceof Date) return t.toLocaleDateString(R());
|
|
18
|
-
let i = String(t), a = r[`${e}_${i}`];
|
|
19
|
-
return a === void 0 ? e.includes("ok") || t === "true" || t === "false" ? n(t === "true" ? "filters.yes" : "filters.no") : i : a;
|
|
20
|
-
};
|
|
21
|
-
function K({ filters: e, onRemoveFilter: n, onClearAll: r, filterLabelKeys: i = {}, optionLabels: a = {} }) {
|
|
22
|
-
let { t: s } = t(), c = Object.entries(e).filter(([e, t]) => !(t == null || t === "" || Array.isArray(t) && t.length === 0));
|
|
23
|
-
return c.length === 0 ? null : /* @__PURE__ */ L("div", {
|
|
24
|
-
className: "flex flex-wrap items-center gap-2 mb-4",
|
|
25
|
-
children: [
|
|
26
|
-
/* @__PURE__ */ I("span", {
|
|
27
|
-
className: "text-sm text-muted-foreground font-medium",
|
|
28
|
-
children: s("filters.active")
|
|
29
|
-
}),
|
|
30
|
-
c.flatMap(([e, t]) => {
|
|
31
|
-
let r = i[e], c = r === void 0 ? e : s(r);
|
|
32
|
-
if (Array.isArray(t)) return t.map((t) => {
|
|
33
|
-
let r = G(e, t, s, a);
|
|
34
|
-
return /* @__PURE__ */ L(o, {
|
|
35
|
-
variant: "secondary",
|
|
36
|
-
className: "flex items-center gap-1 px-3 py-1 bg-primary/10 text-primary border border-primary/20 hover:bg-primary/20",
|
|
37
|
-
children: [
|
|
38
|
-
c,
|
|
39
|
-
": ",
|
|
40
|
-
r,
|
|
41
|
-
/* @__PURE__ */ I("button", {
|
|
42
|
-
onClick: () => {
|
|
43
|
-
n(e, t);
|
|
44
|
-
},
|
|
45
|
-
className: "ml-1 hover:bg-primary/20 rounded-full p-0.5",
|
|
46
|
-
children: /* @__PURE__ */ I(W, { className: "size-4" })
|
|
47
|
-
})
|
|
48
|
-
]
|
|
49
|
-
}, `${e}_${String(t)}`);
|
|
50
|
-
});
|
|
51
|
-
let l = G(e, t, s, a);
|
|
52
|
-
return /* @__PURE__ */ L(o, {
|
|
53
|
-
variant: "secondary",
|
|
54
|
-
className: "flex items-center gap-1 px-3 py-1 bg-primary/10 text-primary border border-primary/20 hover:bg-primary/20",
|
|
55
|
-
children: [
|
|
56
|
-
c,
|
|
57
|
-
": ",
|
|
58
|
-
l,
|
|
59
|
-
/* @__PURE__ */ I("button", {
|
|
60
|
-
onClick: () => {
|
|
61
|
-
n(e);
|
|
62
|
-
},
|
|
63
|
-
className: "ml-1 hover:bg-primary/20 rounded-full p-0.5",
|
|
64
|
-
children: /* @__PURE__ */ I(W, { className: "size-4" })
|
|
65
|
-
})
|
|
66
|
-
]
|
|
67
|
-
}, e);
|
|
68
|
-
}),
|
|
69
|
-
c.length > 0 && /* @__PURE__ */ I("button", {
|
|
70
|
-
onClick: r,
|
|
71
|
-
className: "text-xs text-destructive hover:text-destructive/80 transition-colors font-medium ml-auto",
|
|
72
|
-
children: s("filters.clearAll")
|
|
73
|
-
})
|
|
74
|
-
]
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
//#endregion
|
|
78
|
-
//#region src/components/core/filters/FilterField.tsx
|
|
79
|
-
var q = ({ field: e, value: n, onChange: r, onToggleMultiSelect: i }) => {
|
|
80
|
-
let { t: a } = t();
|
|
81
|
-
switch (e.type) {
|
|
82
|
-
case "text": return /* @__PURE__ */ I(h, {
|
|
83
|
-
placeholder: e.placeholder,
|
|
84
|
-
value: n ?? "",
|
|
85
|
-
onChange: (e) => {
|
|
86
|
-
r(e.target.value);
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
case "number": return /* @__PURE__ */ I(h, {
|
|
90
|
-
type: "number",
|
|
91
|
-
placeholder: e.placeholder,
|
|
92
|
-
value: n ?? "",
|
|
93
|
-
onChange: (e) => {
|
|
94
|
-
r(e.target.value);
|
|
95
|
-
},
|
|
96
|
-
min: e.min,
|
|
97
|
-
max: e.max
|
|
98
|
-
});
|
|
99
|
-
case "select": return /* @__PURE__ */ I(A, {
|
|
100
|
-
options: e.options ?? [],
|
|
101
|
-
value: n,
|
|
102
|
-
onChange: r,
|
|
103
|
-
searchable: e.searchable === !0,
|
|
104
|
-
placeholder: e.placeholder,
|
|
105
|
-
searchPlaceholder: e.searchPlaceholder
|
|
106
|
-
});
|
|
107
|
-
case "date": return /* @__PURE__ */ I(k, {
|
|
108
|
-
date: n,
|
|
109
|
-
onDateChange: r,
|
|
110
|
-
placeholder: e.placeholder ?? a("date.pickDate")
|
|
111
|
-
});
|
|
112
|
-
case "date-range": return /* @__PURE__ */ I(O, {
|
|
113
|
-
value: n,
|
|
114
|
-
onChange: r,
|
|
115
|
-
placeholder: e.placeholder
|
|
116
|
-
});
|
|
117
|
-
case "multi-select": return /* @__PURE__ */ I(D, {
|
|
118
|
-
options: e.options ?? [],
|
|
119
|
-
selected: n ?? [],
|
|
120
|
-
onToggle: i,
|
|
121
|
-
onClear: () => {
|
|
122
|
-
r([]);
|
|
123
|
-
},
|
|
124
|
-
onSelectAll: r,
|
|
125
|
-
placeholder: e.placeholder,
|
|
126
|
-
searchable: e.searchable,
|
|
127
|
-
searchPlaceholder: e.searchPlaceholder
|
|
128
|
-
});
|
|
129
|
-
default: return null;
|
|
130
|
-
}
|
|
131
|
-
}, J = (e) => !(e == null || e === "" || Array.isArray(e) && e.length === 0);
|
|
132
|
-
function Y({ sections: e, filters: n, onFiltersChange: r, buttonText: i, sheetTitle: a }) {
|
|
133
|
-
let { t: o } = t(), [s, c] = P(!1), [l, u] = P(n);
|
|
134
|
-
j(() => {
|
|
135
|
-
u(n);
|
|
136
|
-
}, [n, s]);
|
|
137
|
-
let d = (e, t) => {
|
|
138
|
-
u((n) => ({
|
|
139
|
-
...n,
|
|
140
|
-
[e]: t
|
|
141
|
-
}));
|
|
142
|
-
}, f = (e, t) => {
|
|
143
|
-
let n = l[e], r = Array.isArray(n) ? n : [], i = r.includes(t) ? r.filter((e) => e !== t) : [...r, t];
|
|
144
|
-
d(e, i);
|
|
145
|
-
}, h = () => {
|
|
146
|
-
r(l), c(!1);
|
|
147
|
-
}, g = () => {
|
|
148
|
-
u({}), r({}), c(!1);
|
|
149
|
-
}, v = M(() => {
|
|
150
|
-
let t = new Set(e.flatMap((e) => e.filters.map((e) => e.key)));
|
|
151
|
-
return Object.entries(n).filter(([e, n]) => t.has(e) && J(n)).length;
|
|
152
|
-
}, [e, n]);
|
|
153
|
-
return /* @__PURE__ */ L(S, {
|
|
154
|
-
open: s,
|
|
155
|
-
onOpenChange: c,
|
|
156
|
-
children: [/* @__PURE__ */ I(C, {
|
|
157
|
-
asChild: !0,
|
|
158
|
-
children: /* @__PURE__ */ L(p, {
|
|
159
|
-
variant: "outline",
|
|
160
|
-
className: "gap-2",
|
|
161
|
-
children: [
|
|
162
|
-
/* @__PURE__ */ I(B, { className: "size-4 shrink-0" }),
|
|
163
|
-
i ?? o("filters.more"),
|
|
164
|
-
v > 0 && /* @__PURE__ */ I("span", {
|
|
165
|
-
className: "ml-1 flex h-5 min-w-5 items-center justify-center rounded-full bg-primary px-1.5 text-xs font-semibold text-primary-foreground",
|
|
166
|
-
children: v
|
|
167
|
-
})
|
|
168
|
-
]
|
|
169
|
-
})
|
|
170
|
-
}), /* @__PURE__ */ L(x, {
|
|
171
|
-
side: "right",
|
|
172
|
-
className: "w-[400px] sm:w-[500px] flex flex-col p-0",
|
|
173
|
-
children: [
|
|
174
|
-
/* @__PURE__ */ I(y, {
|
|
175
|
-
className: "p-6 pb-0",
|
|
176
|
-
children: /* @__PURE__ */ I(_, { children: a ?? o("filters.advanced") })
|
|
177
|
-
}),
|
|
178
|
-
/* @__PURE__ */ I("div", {
|
|
179
|
-
className: "flex-1 overflow-y-auto p-6 pt-6",
|
|
180
|
-
children: /* @__PURE__ */ I("div", {
|
|
181
|
-
className: "space-y-6",
|
|
182
|
-
children: e.map((e, t) => /* @__PURE__ */ L("div", {
|
|
183
|
-
className: "space-y-4",
|
|
184
|
-
children: [/* @__PURE__ */ I("h3", {
|
|
185
|
-
className: "font-semibold text-sm text-foreground border-b pb-2",
|
|
186
|
-
children: o(e.titleKey)
|
|
187
|
-
}), e.filters.map((e) => /* @__PURE__ */ L("div", {
|
|
188
|
-
className: "space-y-2",
|
|
189
|
-
children: [/* @__PURE__ */ I(w, {
|
|
190
|
-
htmlFor: e.key,
|
|
191
|
-
children: o(e.labelKey)
|
|
192
|
-
}), /* @__PURE__ */ I(q, {
|
|
193
|
-
field: e,
|
|
194
|
-
value: l[e.key],
|
|
195
|
-
onChange: (t) => {
|
|
196
|
-
d(e.key, t);
|
|
197
|
-
},
|
|
198
|
-
onToggleMultiSelect: (t) => {
|
|
199
|
-
f(e.key, t);
|
|
200
|
-
}
|
|
201
|
-
})]
|
|
202
|
-
}, e.key))]
|
|
203
|
-
}, t))
|
|
204
|
-
})
|
|
205
|
-
}),
|
|
206
|
-
/* @__PURE__ */ L(m, {
|
|
207
|
-
className: "gap-2 p-6 border-t bg-background",
|
|
208
|
-
children: [/* @__PURE__ */ I(p, {
|
|
209
|
-
variant: "outline",
|
|
210
|
-
className: "flex-1",
|
|
211
|
-
onClick: g,
|
|
212
|
-
children: o("filters.clear")
|
|
213
|
-
}), /* @__PURE__ */ I(p, {
|
|
214
|
-
className: "flex-1",
|
|
215
|
-
onClick: h,
|
|
216
|
-
children: o("filters.apply")
|
|
217
|
-
})]
|
|
218
|
-
})
|
|
219
|
-
]
|
|
220
|
-
})]
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
//#endregion
|
|
224
|
-
//#region src/components/core/filters/FilterPillsGroup.tsx
|
|
225
|
-
var X = {
|
|
226
|
-
solid: "border-foreground bg-foreground text-background",
|
|
227
|
-
outline: "border-primary bg-primary/10 text-primary font-medium"
|
|
228
|
-
};
|
|
229
|
-
function ee(t, n, r) {
|
|
230
|
-
return r === void 0 ? t ? X[n] : "border-border bg-background text-muted-foreground hover:text-foreground hover:border-foreground/40" : e(r, t ? "font-semibold" : "opacity-60 hover:opacity-100");
|
|
231
|
-
}
|
|
232
|
-
function Z({ options: t, values: n, onToggle: r, variant: i = "solid" }) {
|
|
233
|
-
return /* @__PURE__ */ I("div", {
|
|
234
|
-
className: "flex flex-wrap gap-1.5",
|
|
235
|
-
children: t.map(({ value: t, label: a, count: o, icon: s, className: c }) => {
|
|
236
|
-
let l = ee(n.includes(t), i, c);
|
|
237
|
-
return /* @__PURE__ */ L("button", {
|
|
238
|
-
onClick: () => {
|
|
239
|
-
r(t);
|
|
240
|
-
},
|
|
241
|
-
className: e("inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-control border transition-colors", l),
|
|
242
|
-
children: [
|
|
243
|
-
s && /* @__PURE__ */ I(s, { className: "size-3 shrink-0" }),
|
|
244
|
-
a,
|
|
245
|
-
" ",
|
|
246
|
-
o !== void 0 && /* @__PURE__ */ L("span", {
|
|
247
|
-
className: "opacity-60",
|
|
248
|
-
children: [
|
|
249
|
-
"(",
|
|
250
|
-
o,
|
|
251
|
-
")"
|
|
252
|
-
]
|
|
253
|
-
})
|
|
254
|
-
]
|
|
255
|
-
}, String(t));
|
|
256
|
-
})
|
|
257
|
-
});
|
|
258
|
-
}
|
|
259
|
-
//#endregion
|
|
260
|
-
//#region src/components/core/filters/FilterPills.tsx
|
|
261
|
-
function te({ options: e, value: t, onChange: n, variant: r = "solid" }) {
|
|
262
|
-
return /* @__PURE__ */ I(Z, {
|
|
263
|
-
options: e,
|
|
264
|
-
values: [t],
|
|
265
|
-
onToggle: n,
|
|
266
|
-
variant: r
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
//#endregion
|
|
270
|
-
//#region src/components/core/filters/FiltersMobileDrawer.tsx
|
|
271
|
-
function Q({ children: e, activeFiltersCount: o = 0, onReset: u, onApply: d }) {
|
|
272
|
-
let { t: f } = t(), [m, h] = P(!1);
|
|
273
|
-
return /* @__PURE__ */ L(c, {
|
|
274
|
-
open: m,
|
|
275
|
-
onOpenChange: h,
|
|
276
|
-
children: [/* @__PURE__ */ I(n, {
|
|
277
|
-
asChild: !0,
|
|
278
|
-
children: /* @__PURE__ */ L(p, {
|
|
279
|
-
variant: "outline",
|
|
280
|
-
className: "relative",
|
|
281
|
-
children: [
|
|
282
|
-
/* @__PURE__ */ I(V, { className: "h-4 w-4 mr-2" }),
|
|
283
|
-
f("filters.filter"),
|
|
284
|
-
o > 0 && /* @__PURE__ */ I("span", {
|
|
285
|
-
className: "absolute -top-2 -right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-xs text-primary-foreground",
|
|
286
|
-
children: o
|
|
287
|
-
})
|
|
288
|
-
]
|
|
289
|
-
})
|
|
290
|
-
}), /* @__PURE__ */ L(a, { children: [
|
|
291
|
-
/* @__PURE__ */ I(l, { children: /* @__PURE__ */ I(s, { children: f("filters.title") }) }),
|
|
292
|
-
/* @__PURE__ */ I("div", {
|
|
293
|
-
className: "flex flex-col gap-4 px-4 pb-4",
|
|
294
|
-
children: e
|
|
295
|
-
}),
|
|
296
|
-
/* @__PURE__ */ L(i, {
|
|
297
|
-
className: "flex-row gap-2",
|
|
298
|
-
children: [/* @__PURE__ */ L(p, {
|
|
299
|
-
variant: "outline",
|
|
300
|
-
onClick: () => {
|
|
301
|
-
u?.(), h(!1);
|
|
302
|
-
},
|
|
303
|
-
className: "flex-1",
|
|
304
|
-
children: [/* @__PURE__ */ I(H, { className: "h-4 w-4 mr-2" }), f("filters.reset")]
|
|
305
|
-
}), /* @__PURE__ */ I(r, {
|
|
306
|
-
asChild: !0,
|
|
307
|
-
children: /* @__PURE__ */ I(p, {
|
|
308
|
-
onClick: () => {
|
|
309
|
-
d?.(), h(!1);
|
|
310
|
-
},
|
|
311
|
-
className: "flex-1",
|
|
312
|
-
children: f("actions.apply")
|
|
313
|
-
})
|
|
314
|
-
})]
|
|
315
|
-
})
|
|
316
|
-
] })]
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
//#endregion
|
|
320
|
-
//#region src/components/core/filters/FiltersContainer.tsx
|
|
321
|
-
function ne({ children: e, search: n, searchPlaceholder: r, activeFiltersCount: i = 0, onReset: a, onSearch: o }) {
|
|
322
|
-
let { t: s } = t();
|
|
323
|
-
return E() ? /* @__PURE__ */ L("div", {
|
|
324
|
-
className: "flex items-center gap-2",
|
|
325
|
-
children: [o !== void 0 && /* @__PURE__ */ I("div", {
|
|
326
|
-
className: "flex-1",
|
|
327
|
-
children: /* @__PURE__ */ I(T, {
|
|
328
|
-
search: n ?? "",
|
|
329
|
-
onSearch: o,
|
|
330
|
-
placeholder: r
|
|
331
|
-
})
|
|
332
|
-
}), /* @__PURE__ */ I(Q, {
|
|
333
|
-
activeFiltersCount: i,
|
|
334
|
-
onReset: a,
|
|
335
|
-
children: e
|
|
336
|
-
})]
|
|
337
|
-
}) : /* @__PURE__ */ L("div", {
|
|
338
|
-
className: "flex justify-between",
|
|
339
|
-
children: [/* @__PURE__ */ L("div", {
|
|
340
|
-
className: "flex flex-wrap gap-2",
|
|
341
|
-
children: [o !== void 0 && /* @__PURE__ */ I(T, {
|
|
342
|
-
search: n ?? "",
|
|
343
|
-
onSearch: o,
|
|
344
|
-
placeholder: r
|
|
345
|
-
}), e]
|
|
346
|
-
}), a && /* @__PURE__ */ I("div", {
|
|
347
|
-
className: "flex flex-wrap gap-4",
|
|
348
|
-
children: /* @__PURE__ */ L(p, {
|
|
349
|
-
variant: "outline",
|
|
350
|
-
onClick: a,
|
|
351
|
-
className: "relative",
|
|
352
|
-
children: [
|
|
353
|
-
/* @__PURE__ */ I(H, {}),
|
|
354
|
-
s("filters.reset"),
|
|
355
|
-
i > 0 && /* @__PURE__ */ I("span", {
|
|
356
|
-
className: "absolute -top-2 -right-2 flex h-5 w-5 items-center justify-center rounded-full bg-primary text-xs text-primary-foreground",
|
|
357
|
-
children: i
|
|
358
|
-
})
|
|
359
|
-
]
|
|
360
|
-
})
|
|
361
|
-
})]
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
//#endregion
|
|
365
|
-
//#region src/components/core/filters/TableFilter.tsx
|
|
366
|
-
function re({ searchQuery: e, onSearchChange: n, searchPlaceholder: r, filters: i, onFiltersChange: a, sections: o, advancedButtonText: s, sheetTitle: c }) {
|
|
367
|
-
let { t: l } = t(), u = (e, t) => {
|
|
368
|
-
let n = i[e], r = Array.isArray(n) ? n : [], o = r.includes(t) ? r.filter((e) => e !== t) : [...r, t], s = { ...i };
|
|
369
|
-
o.length === 0 ? delete s[e] : s[e] = o, a(s);
|
|
370
|
-
}, d = (e) => {
|
|
371
|
-
let t = { ...i };
|
|
372
|
-
delete t[e], a(t);
|
|
373
|
-
}, f = () => {
|
|
374
|
-
a({});
|
|
375
|
-
}, p = (e, t) => {
|
|
376
|
-
let n = { ...i }, r = n[e];
|
|
377
|
-
Array.isArray(r) ? t === void 0 ? delete n[e] : (n[e] = r.filter((e) => e !== t), Array.isArray(n[e]) && n[e].length === 0 && delete n[e]) : delete n[e], a(n);
|
|
378
|
-
}, m = M(() => {
|
|
379
|
-
let e = [];
|
|
380
|
-
return o.forEach((t) => {
|
|
381
|
-
t.filters.forEach((t) => {
|
|
382
|
-
t.isQuickFilter === !0 && e.push({
|
|
383
|
-
key: t.key,
|
|
384
|
-
labelKey: t.labelKey,
|
|
385
|
-
options: t.options ?? [],
|
|
386
|
-
searchable: t.searchable,
|
|
387
|
-
searchPlaceholder: t.searchPlaceholder
|
|
388
|
-
});
|
|
389
|
-
});
|
|
390
|
-
}), e;
|
|
391
|
-
}, [o]), h = M(() => {
|
|
392
|
-
let e = {};
|
|
393
|
-
return o.forEach((t) => {
|
|
394
|
-
t.filters.forEach((t) => {
|
|
395
|
-
e[t.key] = t.badgeLabelKey ?? t.labelKey;
|
|
396
|
-
});
|
|
397
|
-
}), e;
|
|
398
|
-
}, [o]), g = M(() => {
|
|
399
|
-
let e = {};
|
|
400
|
-
return o.forEach((t) => {
|
|
401
|
-
t.filters.forEach((t) => {
|
|
402
|
-
t.options !== void 0 && t.options.forEach((n) => {
|
|
403
|
-
e[`${t.key}_${n.value}`] = n.label;
|
|
404
|
-
});
|
|
405
|
-
});
|
|
406
|
-
}), e;
|
|
407
|
-
}, [o]);
|
|
408
|
-
return /* @__PURE__ */ L("div", {
|
|
409
|
-
className: "space-y-4 w-full",
|
|
410
|
-
children: [/* @__PURE__ */ L("div", {
|
|
411
|
-
className: "flex flex-wrap items-center gap-2 justify-between",
|
|
412
|
-
children: [/* @__PURE__ */ L("div", {
|
|
413
|
-
className: "flex flex-wrap items-center gap-2",
|
|
414
|
-
children: [n === void 0 ? null : /* @__PURE__ */ I(T, {
|
|
415
|
-
searchQuery: e,
|
|
416
|
-
onSearch: n,
|
|
417
|
-
onClear: () => {
|
|
418
|
-
n("");
|
|
419
|
-
},
|
|
420
|
-
placeholder: r ?? l("search.placeholder")
|
|
421
|
-
}), m.map((e) => /* @__PURE__ */ I(D, {
|
|
422
|
-
variant: "pill",
|
|
423
|
-
labelKey: e.labelKey,
|
|
424
|
-
options: e.options,
|
|
425
|
-
selected: Array.isArray(i[e.key]) ? i[e.key] : [],
|
|
426
|
-
onToggle: (t) => {
|
|
427
|
-
u(e.key, t);
|
|
428
|
-
},
|
|
429
|
-
onClear: () => {
|
|
430
|
-
d(e.key);
|
|
431
|
-
},
|
|
432
|
-
onSelectAll: (t) => {
|
|
433
|
-
a({
|
|
434
|
-
...i,
|
|
435
|
-
[e.key]: t
|
|
436
|
-
});
|
|
437
|
-
},
|
|
438
|
-
searchable: e.searchable,
|
|
439
|
-
searchPlaceholder: e.searchPlaceholder
|
|
440
|
-
}, e.key))]
|
|
441
|
-
}), o.length > 0 && /* @__PURE__ */ I(Y, {
|
|
442
|
-
sections: o,
|
|
443
|
-
filters: i,
|
|
444
|
-
onFiltersChange: a,
|
|
445
|
-
buttonText: s,
|
|
446
|
-
sheetTitle: c
|
|
447
|
-
})]
|
|
448
|
-
}), /* @__PURE__ */ I(K, {
|
|
449
|
-
filters: i,
|
|
450
|
-
onRemoveFilter: p,
|
|
451
|
-
onClearAll: f,
|
|
452
|
-
filterLabelKeys: h,
|
|
453
|
-
optionLabels: g
|
|
454
|
-
})]
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
//#endregion
|
|
458
|
-
//#region src/components/core/filters/ConditionFilter.tsx
|
|
459
|
-
var ie = (e) => e?.requiresValue !== !1;
|
|
460
|
-
function $({ fields: n, operators: r, value: i, onChange: a, labelKey: o, icon: s, disabled: c = !1, className: l }) {
|
|
461
|
-
let { t: m } = t(), [_, y] = P(!1), [x, S] = P({ value: "" }), C = i === void 0 ? void 0 : n.find((e) => e.value === i.field), T = i === void 0 ? void 0 : r.find((e) => e.value === i.operator), E = i !== void 0, D = r.find((e) => e.value === x.operator), O = ie(D), k = D?.numeric === !0, j = x.value.trim(), M = O && k && j !== "" && Number.isNaN(Number(j)), N = x.field !== void 0 && D !== void 0 && (!O || j !== "") && !M, R = (e) => {
|
|
462
|
-
e && S(i === void 0 ? { value: "" } : { ...i }), y(e);
|
|
463
|
-
}, B = () => {
|
|
464
|
-
N && x.field !== void 0 && D !== void 0 && (a({
|
|
465
|
-
field: x.field,
|
|
466
|
-
operator: D.value,
|
|
467
|
-
value: O ? j : ""
|
|
468
|
-
}), y(!1));
|
|
469
|
-
}, V = () => {
|
|
470
|
-
a(void 0), y(!1);
|
|
471
|
-
}, H = m(o === void 0 ? "filters.condition.label" : o);
|
|
472
|
-
return /* @__PURE__ */ L(b, {
|
|
473
|
-
open: _,
|
|
474
|
-
onOpenChange: R,
|
|
475
|
-
children: [/* @__PURE__ */ I(g, {
|
|
476
|
-
asChild: !0,
|
|
477
|
-
children: /* @__PURE__ */ L("button", {
|
|
478
|
-
type: "button",
|
|
479
|
-
disabled: c,
|
|
480
|
-
className: e(f, "inline-flex items-center justify-between gap-1.5 whitespace-nowrap transition-colors", E ? "border-primary bg-primary/10 text-primary" : "hover:bg-muted", !E && "w-full md:w-[200px]", l),
|
|
481
|
-
children: [/* @__PURE__ */ L("span", {
|
|
482
|
-
className: "flex min-w-0 items-center gap-1.5",
|
|
483
|
-
children: [s !== void 0 && /* @__PURE__ */ I(s, { className: "size-3.5 shrink-0 opacity-70" }), /* @__PURE__ */ I("span", {
|
|
484
|
-
className: "truncate",
|
|
485
|
-
children: i === void 0 ? H : /* @__PURE__ */ L(F, { children: [
|
|
486
|
-
H,
|
|
487
|
-
" :",
|
|
488
|
-
" ",
|
|
489
|
-
/* @__PURE__ */ I("span", {
|
|
490
|
-
className: "font-semibold",
|
|
491
|
-
children: C?.label ?? i.field
|
|
492
|
-
}),
|
|
493
|
-
" ",
|
|
494
|
-
T?.label ?? i.operator,
|
|
495
|
-
i.value !== "" && /* @__PURE__ */ L("span", {
|
|
496
|
-
className: "font-semibold",
|
|
497
|
-
children: [" ", i.value]
|
|
498
|
-
})
|
|
499
|
-
] })
|
|
500
|
-
})]
|
|
501
|
-
}), /* @__PURE__ */ L("span", {
|
|
502
|
-
className: "flex shrink-0 items-center gap-1",
|
|
503
|
-
children: [E && !c && /* @__PURE__ */ I("span", {
|
|
504
|
-
role: "button",
|
|
505
|
-
tabIndex: -1,
|
|
506
|
-
"aria-label": m("filters.condition.clear"),
|
|
507
|
-
onClick: (e) => {
|
|
508
|
-
e.stopPropagation();
|
|
509
|
-
},
|
|
510
|
-
onPointerDown: (e) => {
|
|
511
|
-
e.preventDefault(), e.stopPropagation(), a(void 0);
|
|
512
|
-
},
|
|
513
|
-
className: "opacity-70 hover:opacity-100",
|
|
514
|
-
children: /* @__PURE__ */ I(W, { className: "size-3.5" })
|
|
515
|
-
}), /* @__PURE__ */ I(z, { className: e("size-3.5 opacity-60 transition-transform", _ && "rotate-180") })]
|
|
516
|
-
})]
|
|
517
|
-
})
|
|
518
|
-
}), /* @__PURE__ */ L(v, {
|
|
519
|
-
align: "start",
|
|
520
|
-
className: "w-80 space-y-4",
|
|
521
|
-
children: [
|
|
522
|
-
/* @__PURE__ */ L("div", {
|
|
523
|
-
className: "space-y-1.5",
|
|
524
|
-
children: [/* @__PURE__ */ I(w, { children: m("filters.condition.field") }), /* @__PURE__ */ I(A, {
|
|
525
|
-
options: n,
|
|
526
|
-
value: x.field,
|
|
527
|
-
onChange: (e) => {
|
|
528
|
-
S((t) => ({
|
|
529
|
-
...t,
|
|
530
|
-
field: e
|
|
531
|
-
}));
|
|
532
|
-
},
|
|
533
|
-
placeholder: m("filters.condition.selectField")
|
|
534
|
-
})]
|
|
535
|
-
}),
|
|
536
|
-
/* @__PURE__ */ L("div", {
|
|
537
|
-
className: "space-y-1.5",
|
|
538
|
-
children: [/* @__PURE__ */ I(w, { children: m("filters.condition.operator") }), /* @__PURE__ */ I(d, {
|
|
539
|
-
type: "single",
|
|
540
|
-
variant: "outline",
|
|
541
|
-
size: "sm",
|
|
542
|
-
className: "flex-wrap justify-start",
|
|
543
|
-
value: x.operator ?? "",
|
|
544
|
-
onValueChange: (e) => {
|
|
545
|
-
S((t) => {
|
|
546
|
-
let n = r.find((t) => t.value === e)?.numeric !== !0 || !Number.isNaN(Number(t.value.trim()));
|
|
547
|
-
return {
|
|
548
|
-
...t,
|
|
549
|
-
operator: e === "" ? void 0 : e,
|
|
550
|
-
value: n ? t.value : ""
|
|
551
|
-
};
|
|
552
|
-
});
|
|
553
|
-
},
|
|
554
|
-
children: r.map((e) => /* @__PURE__ */ I(u, {
|
|
555
|
-
value: e.value,
|
|
556
|
-
title: e.title,
|
|
557
|
-
"aria-label": e.title ?? e.label,
|
|
558
|
-
className: "min-w-9 px-2",
|
|
559
|
-
children: e.label
|
|
560
|
-
}, e.value))
|
|
561
|
-
})]
|
|
562
|
-
}),
|
|
563
|
-
O && /* @__PURE__ */ L("div", {
|
|
564
|
-
className: "space-y-1.5",
|
|
565
|
-
children: [
|
|
566
|
-
/* @__PURE__ */ I(w, {
|
|
567
|
-
htmlFor: "condition-filter-value",
|
|
568
|
-
children: m("filters.condition.value")
|
|
569
|
-
}),
|
|
570
|
-
/* @__PURE__ */ I(h, {
|
|
571
|
-
id: "condition-filter-value",
|
|
572
|
-
value: x.value,
|
|
573
|
-
type: k ? "number" : "text",
|
|
574
|
-
step: "any",
|
|
575
|
-
onChange: (e) => {
|
|
576
|
-
S((t) => ({
|
|
577
|
-
...t,
|
|
578
|
-
value: e.target.value
|
|
579
|
-
}));
|
|
580
|
-
},
|
|
581
|
-
onKeyDown: (e) => {
|
|
582
|
-
e.key === "Enter" && (e.preventDefault(), B());
|
|
583
|
-
}
|
|
584
|
-
}),
|
|
585
|
-
" "
|
|
586
|
-
]
|
|
587
|
-
}),
|
|
588
|
-
/* @__PURE__ */ L("div", {
|
|
589
|
-
className: "flex justify-end gap-2",
|
|
590
|
-
children: [E && /* @__PURE__ */ I(p, {
|
|
591
|
-
variant: "ghost",
|
|
592
|
-
size: "sm",
|
|
593
|
-
onClick: V,
|
|
594
|
-
children: m("filters.condition.clear")
|
|
595
|
-
}), /* @__PURE__ */ I(p, {
|
|
596
|
-
size: "sm",
|
|
597
|
-
onClick: B,
|
|
598
|
-
disabled: !N,
|
|
599
|
-
children: m("filters.condition.apply")
|
|
600
|
-
})]
|
|
601
|
-
})
|
|
602
|
-
]
|
|
603
|
-
})]
|
|
604
|
-
});
|
|
605
|
-
}
|
|
606
|
-
//#endregion
|
|
607
|
-
//#region src/components/core/filters/ConditionFilterGroup.tsx
|
|
608
|
-
var ae = (e, t) => e.field === t.field && e.operator === t.operator && e.value === t.value;
|
|
609
|
-
function oe({ fields: t, operators: n, values: r, onChange: i, labelKey: a, max: o = 5, disabled: s = !1, className: c }) {
|
|
610
|
-
let l = N(!1), u = (e) => {
|
|
611
|
-
e === void 0 || r.some((t) => ae(t, e)) || i([...r, e]);
|
|
612
|
-
}, d = (e, t) => {
|
|
613
|
-
t === void 0 ? (l.current = !0, i(r.filter((t, n) => n !== e))) : i(r.map((n, r) => r === e ? t : n));
|
|
614
|
-
}, f = r.length === 0, p = () => {
|
|
615
|
-
l.current = !1;
|
|
616
|
-
};
|
|
617
|
-
return /* @__PURE__ */ L("div", {
|
|
618
|
-
className: e("flex flex-wrap items-center gap-2", c),
|
|
619
|
-
onPointerDownCapture: p,
|
|
620
|
-
onKeyDownCapture: p,
|
|
621
|
-
onClickCapture: (e) => {
|
|
622
|
-
l.current && (l.current = !1, e.preventDefault(), e.stopPropagation());
|
|
623
|
-
},
|
|
624
|
-
children: [r.map((e, r) => /* @__PURE__ */ I($, {
|
|
625
|
-
fields: t,
|
|
626
|
-
operators: n,
|
|
627
|
-
value: e,
|
|
628
|
-
onChange: (e) => {
|
|
629
|
-
d(r, e);
|
|
630
|
-
},
|
|
631
|
-
labelKey: a,
|
|
632
|
-
disabled: s
|
|
633
|
-
}, r)), r.length < o && /* @__PURE__ */ I($, {
|
|
634
|
-
fields: t,
|
|
635
|
-
operators: n,
|
|
636
|
-
value: void 0,
|
|
637
|
-
onChange: u,
|
|
638
|
-
labelKey: f ? a : "filters.condition.add",
|
|
639
|
-
icon: f ? void 0 : U,
|
|
640
|
-
disabled: s
|
|
641
|
-
})]
|
|
642
|
-
});
|
|
643
|
-
}
|
|
644
|
-
//#endregion
|
|
645
|
-
export { K as ActiveFilters, Y as AdvancedFilters, $ as ConditionFilter, oe as ConditionFilterGroup, q as FilterField, te as FilterPills, Z as FilterPillsGroup, ne as FiltersContainer, Q as FiltersMobileDrawer, re as TableFilter };
|
|
1
|
+
import { ActiveFilters as e } from "./ActiveFilters.js";
|
|
2
|
+
import { FilterField as t } from "./FilterField.js";
|
|
3
|
+
import { AdvancedFilters as n } from "./AdvancedFilters.js";
|
|
4
|
+
import { FilterPillsGroup as r } from "./FilterPillsGroup.js";
|
|
5
|
+
import { FilterPills as i } from "./FilterPills.js";
|
|
6
|
+
import { FiltersMobileDrawer as a } from "./FiltersMobileDrawer.js";
|
|
7
|
+
import { FiltersContainer as o } from "./FiltersContainer.js";
|
|
8
|
+
import { TableFilter as s } from "./TableFilter.js";
|
|
9
|
+
import { ConditionFilter as c } from "./ConditionFilter.js";
|
|
10
|
+
import { ConditionFilterGroup as l } from "./ConditionFilterGroup.js";
|
|
11
|
+
export { e as ActiveFilters, n as AdvancedFilters, c as ConditionFilter, l as ConditionFilterGroup, t as FilterField, i as FilterPills, r as FilterPillsGroup, o as FiltersContainer, a as FiltersMobileDrawer, s as TableFilter };
|