@furcrer/fullstack-components 0.1.0 → 1.0.1
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/README.md +2 -2
- package/dist/index.js +2015 -1088
- package/dist/styles.css +1 -1
- package/dist/types/components/containers/Grid/Grid.d.ts +1 -0
- package/dist/types/components/containers/Stack/Stack.d.ts +1 -0
- package/dist/types/components/data/CrudExample/CrudExample.d.ts +1 -0
- package/dist/types/components/data/ResourceTable/ResourceTable.d.ts +3 -2
- package/dist/types/components/data/ResultsCount/ResultsCount.d.ts +11 -0
- package/dist/types/components/data/ResultsCount/ResultsCount.fixture.d.ts +2 -0
- package/dist/types/components/data/ResultsCount/ResultsCount.variants.d.ts +11 -0
- package/dist/types/components/data/ResultsCount/index.d.ts +2 -0
- package/dist/types/components/forms/ColorInput/ColorInput.d.ts +6 -0
- package/dist/types/components/forms/DateInput/DateInput.d.ts +9 -0
- package/dist/types/components/forms/FileInput/FileInput.d.ts +6 -0
- package/dist/types/components/forms/MultiSelectFilter/MultiSelectFilter.d.ts +23 -0
- package/dist/types/components/forms/MultiSelectFilter/MultiSelectFilter.fixture.d.ts +2 -0
- package/dist/types/components/forms/MultiSelectFilter/MultiSelectFilter.variants.d.ts +9 -0
- package/dist/types/components/forms/MultiSelectFilter/index.d.ts +2 -0
- package/dist/types/components/forms/NumberInput/NumberInput.d.ts +8 -0
- package/dist/types/components/forms/PasswordInput/PasswordInput.d.ts +6 -0
- package/dist/types/components/forms/RadioGroup/RadioGroup.d.ts +8 -0
- package/dist/types/components/forms/SearchInput/SearchInput.d.ts +4 -0
- package/dist/types/components/forms/SelectFilter/SelectFilter.d.ts +19 -0
- package/dist/types/components/forms/SelectFilter/SelectFilter.fixture.d.ts +2 -0
- package/dist/types/components/forms/SelectFilter/SelectFilter.variants.d.ts +9 -0
- package/dist/types/components/forms/SelectFilter/index.d.ts +2 -0
- package/dist/types/components/forms/Slider/Slider.d.ts +10 -0
- package/dist/types/components/ohm/ActionBar/ActionBar.d.ts +17 -0
- package/dist/types/components/ohm/ActionBar/ActionBar.fixture.d.ts +2 -0
- package/dist/types/components/ohm/ActionBar/ActionBar.variants.d.ts +13 -0
- package/dist/types/components/ohm/ActionBar/index.d.ts +2 -0
- package/dist/types/components/ohm/DataField/DataField.d.ts +27 -0
- package/dist/types/components/ohm/DataField/DataField.fixture.d.ts +2 -0
- package/dist/types/components/ohm/DataField/DataField.variants.d.ts +5 -0
- package/dist/types/components/ohm/DataField/index.d.ts +2 -0
- package/dist/types/components/ohm/DocumentList/DocumentList.d.ts +21 -0
- package/dist/types/components/ohm/DocumentList/DocumentList.fixture.d.ts +2 -0
- package/dist/types/components/ohm/DocumentList/DocumentList.variants.d.ts +5 -0
- package/dist/types/components/ohm/DocumentList/index.d.ts +2 -0
- package/dist/types/components/ohm/EntityCard/EntityCard.d.ts +14 -0
- package/dist/types/components/ohm/EntityCard/EntityCard.fixture.d.ts +2 -0
- package/dist/types/components/ohm/EntityCard/EntityCard.variants.d.ts +7 -0
- package/dist/types/components/ohm/EntityCard/index.d.ts +2 -0
- package/dist/types/components/ohm/Main/Main.d.ts +8 -0
- package/dist/types/components/ohm/Main/Main.fixture.d.ts +3 -0
- package/dist/types/components/ohm/Main/Main.variants.d.ts +5 -0
- package/dist/types/components/ohm/Main/index.d.ts +2 -0
- package/dist/types/components/ohm/Navbar/Navbar.d.ts +115 -0
- package/dist/types/components/ohm/Navbar/Navbar.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Navbar/Navbar.variants.d.ts +75 -0
- package/dist/types/components/ohm/Navbar/index.d.ts +2 -0
- package/dist/types/components/ohm/PageHeader/PageHeader.d.ts +11 -0
- package/dist/types/components/ohm/PageHeader/PageHeader.fixture.d.ts +2 -0
- package/dist/types/components/ohm/PageHeader/PageHeader.variants.d.ts +15 -0
- package/dist/types/components/ohm/PageHeader/index.d.ts +2 -0
- package/dist/types/components/ohm/PhotoGrid/PhotoGrid.d.ts +19 -0
- package/dist/types/components/ohm/PhotoGrid/PhotoGrid.fixture.d.ts +2 -0
- package/dist/types/components/ohm/PhotoGrid/PhotoGrid.variants.d.ts +5 -0
- package/dist/types/components/ohm/PhotoGrid/index.d.ts +2 -0
- package/dist/types/components/ohm/SearchFilterSection/SearchFilterSection.d.ts +20 -0
- package/dist/types/components/ohm/SearchFilterSection/SearchFilterSection.fixture.d.ts +1 -0
- package/dist/types/components/ohm/SearchFilterSection/SearchFilterSection.variants.d.ts +5 -0
- package/dist/types/components/ohm/SearchFilterSection/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/Table.d.ts +5 -0
- package/dist/types/{data → components/ohm/Table}/Table.fixture.d.ts +1 -1
- package/dist/types/components/ohm/Table/Table.types.d.ts +43 -0
- package/dist/types/components/ohm/Table/Table.variants.d.ts +23 -0
- package/dist/types/components/ohm/Table/TableAction/TableAction.d.ts +6 -0
- package/dist/types/components/ohm/Table/TableAction/TableAction.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableAction/TableAction.variants.d.ts +22 -0
- package/dist/types/components/ohm/Table/TableAction/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableActions/TableActions.d.ts +11 -0
- package/dist/types/components/ohm/Table/TableActions/TableActions.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableActions/TableActions.variants.d.ts +28 -0
- package/dist/types/components/ohm/Table/TableActions/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableBody/TableBody.d.ts +6 -0
- package/dist/types/components/ohm/Table/TableBody/TableBody.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableBody/TableBody.variants.d.ts +7 -0
- package/dist/types/components/ohm/Table/TableBody/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableCell/TableCell.d.ts +7 -0
- package/dist/types/components/ohm/Table/TableCell/TableCell.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableCell/TableCell.variants.d.ts +7 -0
- package/dist/types/components/ohm/Table/TableCell/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableEmpty/TableEmpty.d.ts +6 -0
- package/dist/types/components/ohm/Table/TableEmpty/TableEmpty.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableEmpty/TableEmpty.variants.d.ts +8 -0
- package/dist/types/components/ohm/Table/TableEmpty/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableError/TableError.d.ts +6 -0
- package/dist/types/components/ohm/Table/TableError/TableError.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableError/TableError.variants.d.ts +8 -0
- package/dist/types/components/ohm/Table/TableError/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableExpand/TableExpand.d.ts +7 -0
- package/dist/types/components/ohm/Table/TableExpand/TableExpand.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableExpand/TableExpand.variants.d.ts +7 -0
- package/dist/types/components/ohm/Table/TableExpand/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableFooter/TableFooter.d.ts +6 -0
- package/dist/types/components/ohm/Table/TableFooter/TableFooter.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableFooter/TableFooter.variants.d.ts +7 -0
- package/dist/types/components/ohm/Table/TableFooter/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableHeader/TableHeader.d.ts +6 -0
- package/dist/types/components/ohm/Table/TableHeader/TableHeader.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableHeader/TableHeader.variants.d.ts +7 -0
- package/dist/types/components/ohm/Table/TableHeader/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableHeaderCell/TableHeaderCell.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableHeaderCell/TableHeaderCell.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableHeaderCell/TableHeaderCell.variants.d.ts +15 -0
- package/dist/types/components/ohm/Table/TableHeaderCell/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableLoading/TableLoading.d.ts +5 -0
- package/dist/types/components/ohm/Table/TableLoading/TableLoading.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableLoading/TableLoading.variants.d.ts +7 -0
- package/dist/types/components/ohm/Table/TableLoading/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TablePagination/TablePagination.d.ts +6 -0
- package/dist/types/components/ohm/Table/TablePagination/TablePagination.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TablePagination/TablePagination.variants.d.ts +8 -0
- package/dist/types/components/ohm/Table/TablePagination/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableRow/TableRow.d.ts +8 -0
- package/dist/types/components/ohm/Table/TableRow/TableRow.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableRow/TableRow.variants.d.ts +7 -0
- package/dist/types/components/ohm/Table/TableRow/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableRowActions/TableRowActions.d.ts +6 -0
- package/dist/types/components/ohm/Table/TableRowActions/TableRowActions.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableRowActions/TableRowActions.variants.d.ts +7 -0
- package/dist/types/components/ohm/Table/TableRowActions/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableSelection/TableSelection.d.ts +7 -0
- package/dist/types/components/ohm/Table/TableSelection/TableSelection.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableSelection/TableSelection.variants.d.ts +7 -0
- package/dist/types/components/ohm/Table/TableSelection/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableSort/TableSort.d.ts +8 -0
- package/dist/types/components/ohm/Table/TableSort/TableSort.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableSort/TableSort.variants.d.ts +8 -0
- package/dist/types/components/ohm/Table/TableSort/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableStructure/TableStructure.d.ts +11 -0
- package/dist/types/components/ohm/Table/TableStructure/TableStructure.fixture.d.ts +2 -0
- package/dist/types/components/ohm/Table/TableStructure/TableStructure.variants.d.ts +14 -0
- package/dist/types/components/ohm/Table/TableStructure/index.d.ts +2 -0
- package/dist/types/components/ohm/Table/index.d.ts +21 -0
- package/dist/types/components/overlays/FilterMenu/FilterMenu.d.ts +17 -0
- package/dist/types/components/overlays/FilterMenu/FilterMenu.fixture.d.ts +2 -0
- package/dist/types/components/overlays/FilterMenu/FilterMenu.variants.d.ts +9 -0
- package/dist/types/components/overlays/FilterMenu/index.d.ts +2 -0
- package/dist/types/components/primitives/Accordion/Accordion.d.ts +1 -0
- package/dist/types/components/primitives/Alert/Alert.d.ts +1 -0
- package/dist/types/components/primitives/Avatar/Avatar.d.ts +1 -0
- package/dist/types/components/primitives/Button/Button.types.d.ts +2 -0
- package/dist/types/components/primitives/Button/Button.variants.d.ts +34 -0
- package/dist/types/components/primitives/Carousel/Carousel.d.ts +1 -0
- package/dist/types/components/primitives/Combobox/Combobox.d.ts +1 -0
- package/dist/types/components/primitives/CommandPalette/CommandPalette.d.ts +1 -0
- package/dist/types/components/primitives/ContextMenu/ContextMenu.d.ts +1 -0
- package/dist/types/components/primitives/DatePicker/DatePicker.d.ts +1 -0
- package/dist/types/components/primitives/Drawer/Drawer.d.ts +5 -0
- package/dist/types/components/primitives/DropdownMenu/DropdownMenu.d.ts +1 -0
- package/dist/types/components/primitives/FileUpload/FileUpload.d.ts +1 -0
- package/dist/types/components/primitives/FormField/FormField.variants.d.ts +19 -0
- package/dist/types/components/primitives/Heading/Heading.d.ts +3 -0
- package/dist/types/components/primitives/Link/Link.d.ts +1 -0
- package/dist/types/components/primitives/Menubar/Menubar.d.ts +1 -0
- package/dist/types/components/primitives/MultiSelect/MultiSelect.d.ts +1 -0
- package/dist/types/components/primitives/NavigationMenu/NavigationMenu.d.ts +1 -0
- package/dist/types/components/primitives/Pagination/Pagination.d.ts +4 -0
- package/dist/types/components/primitives/Popover/Popover.d.ts +4 -0
- package/dist/types/components/primitives/Progress/Progress.d.ts +4 -0
- package/dist/types/components/primitives/ResizablePanel/ResizablePanel.d.ts +1 -0
- package/dist/types/components/primitives/SearchBar/SearchBar.d.ts +1 -0
- package/dist/types/components/primitives/Separator/Separator.d.ts +1 -0
- package/dist/types/components/primitives/Sidebar/Sidebar.d.ts +1 -0
- package/dist/types/components/primitives/Skeleton/Skeleton.d.ts +1 -0
- package/dist/types/components/primitives/Spinner/Spinner.d.ts +1 -0
- package/dist/types/components/primitives/Stepper/Stepper.d.ts +1 -0
- package/dist/types/components/primitives/Tabs/Tabs.d.ts +1 -0
- package/dist/types/components/primitives/Text/Text.d.ts +1 -0
- package/dist/types/components/primitives/Toast/Toast.d.ts +1 -0
- package/dist/types/components/primitives/Tooltip/Tooltip.d.ts +2 -0
- package/dist/types/components/primitives/TreeView/TreeView.d.ts +1 -0
- package/dist/types/data/index.d.ts +0 -1
- package/dist/types/forms/FormActions.d.ts +2 -0
- package/dist/types/forms/FormField.d.ts +4 -0
- package/dist/types/forms/react-form.d.ts +6 -0
- package/dist/types/forms/react.d.ts +6 -1
- package/dist/types/generated/component-registry.d.ts +2913 -50
- package/dist/types/generated/public-exports.d.ts +92 -0
- package/dist/types/types/metadata.d.ts +23 -3
- package/package.json +3 -2
- package/dist/types/data/Table.d.ts +0 -13
- package/dist/types/data/resource-controller.test.d.ts +0 -1
- package/dist/types/theme/theme.test.d.ts +0 -1
- package/dist/types/tooling/discovery/discover.d.ts +0 -9
- package/dist/types/tooling/discovery/discover.test.d.ts +0 -1
- package/dist/types/tooling/discovery/generate-exports.d.ts +0 -6
- package/dist/types/tooling/discovery/generate-registry.d.ts +0 -6
- package/dist/types/tooling/discovery/generate-registry.test.d.ts +0 -1
- package/dist/types/tooling/discovery/generate.d.ts +0 -1
- package/dist/types/tooling/discovery/vite-plugin.d.ts +0 -8
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import Re, { createContext as ae, useState as w, useEffect as P, useMemo as I, useContext as H, useRef as A, useSyncExternalStore as Z, useCallback as R, useId as fe } from "react";
|
|
2
|
+
const Pe = {
|
|
3
3
|
0: "0rem",
|
|
4
4
|
1: "0.25rem",
|
|
5
5
|
2: "0.5rem",
|
|
@@ -11,13 +11,13 @@ const Se = {
|
|
|
11
11
|
10: "2.5rem",
|
|
12
12
|
12: "3rem",
|
|
13
13
|
16: "4rem"
|
|
14
|
-
},
|
|
14
|
+
}, Oe = {
|
|
15
15
|
none: "0",
|
|
16
16
|
small: "0.25rem",
|
|
17
17
|
medium: "0.5rem",
|
|
18
18
|
large: "0.75rem",
|
|
19
19
|
full: "9999px"
|
|
20
|
-
},
|
|
20
|
+
}, Ae = {
|
|
21
21
|
xs: "0.75rem",
|
|
22
22
|
sm: "0.875rem",
|
|
23
23
|
md: "1rem",
|
|
@@ -25,24 +25,24 @@ const Se = {
|
|
|
25
25
|
xl: "1.25rem",
|
|
26
26
|
"2xl": "1.5rem",
|
|
27
27
|
"3xl": "1.875rem"
|
|
28
|
-
},
|
|
28
|
+
}, ze = {
|
|
29
29
|
regular: 400,
|
|
30
30
|
medium: 500,
|
|
31
31
|
semibold: 600,
|
|
32
32
|
bold: 700
|
|
33
|
-
},
|
|
33
|
+
}, $e = {
|
|
34
34
|
none: "none",
|
|
35
35
|
sm: "0 1px 2px rgb(0 0 0 / 0.08)",
|
|
36
36
|
md: "0 4px 10px rgb(0 0 0 / 0.12)",
|
|
37
37
|
lg: "0 12px 28px rgb(0 0 0 / 0.16)"
|
|
38
|
-
},
|
|
38
|
+
}, Le = {
|
|
39
39
|
base: 0,
|
|
40
40
|
dropdown: 100,
|
|
41
41
|
sticky: 200,
|
|
42
42
|
overlay: 300,
|
|
43
43
|
modal: 400,
|
|
44
44
|
toast: 500
|
|
45
|
-
},
|
|
45
|
+
}, M = {
|
|
46
46
|
colors: {
|
|
47
47
|
surface: "#ffffff",
|
|
48
48
|
surfaceMuted: "#f7f7f7",
|
|
@@ -69,26 +69,26 @@ const Se = {
|
|
|
69
69
|
warningContrast: "#ffffff",
|
|
70
70
|
warningSurface: "#fffbeb"
|
|
71
71
|
},
|
|
72
|
-
spacing:
|
|
73
|
-
radius:
|
|
74
|
-
fontSize:
|
|
75
|
-
fontWeight:
|
|
76
|
-
shadows:
|
|
77
|
-
zIndex:
|
|
72
|
+
spacing: Pe,
|
|
73
|
+
radius: Oe,
|
|
74
|
+
fontSize: Ae,
|
|
75
|
+
fontWeight: ze,
|
|
76
|
+
shadows: $e,
|
|
77
|
+
zIndex: Le
|
|
78
78
|
};
|
|
79
|
-
function
|
|
79
|
+
function Ie(e = {}) {
|
|
80
80
|
return {
|
|
81
|
-
colors: { ...
|
|
82
|
-
states: { ...
|
|
83
|
-
spacing: { ...
|
|
84
|
-
radius: { ...
|
|
85
|
-
fontSize: { ...
|
|
86
|
-
fontWeight: { ...
|
|
87
|
-
shadows: { ...
|
|
88
|
-
zIndex: { ...
|
|
81
|
+
colors: { ...M.colors, ...e.colors },
|
|
82
|
+
states: { ...M.states, ...e.states },
|
|
83
|
+
spacing: { ...M.spacing, ...e.spacing },
|
|
84
|
+
radius: { ...M.radius, ...e.radius },
|
|
85
|
+
fontSize: { ...M.fontSize, ...e.fontSize },
|
|
86
|
+
fontWeight: { ...M.fontWeight, ...e.fontWeight },
|
|
87
|
+
shadows: { ...M.shadows, ...e.shadows },
|
|
88
|
+
zIndex: { ...M.zIndex, ...e.zIndex }
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
|
-
const
|
|
91
|
+
const Fe = Ie({
|
|
92
92
|
colors: {
|
|
93
93
|
surface: "#171717",
|
|
94
94
|
surfaceMuted: "#262626",
|
|
@@ -116,10 +116,10 @@ const _e = Re({
|
|
|
116
116
|
warningSurface: "#422006"
|
|
117
117
|
}
|
|
118
118
|
});
|
|
119
|
-
function
|
|
119
|
+
function Me(e) {
|
|
120
120
|
return e.replace(/[A-Z]/g, (r) => `-${r.toLowerCase()}`);
|
|
121
121
|
}
|
|
122
|
-
const
|
|
122
|
+
const De = {
|
|
123
123
|
colors: "color",
|
|
124
124
|
states: "state",
|
|
125
125
|
spacing: "space",
|
|
@@ -129,364 +129,364 @@ const Oe = {
|
|
|
129
129
|
shadows: "shadow",
|
|
130
130
|
zIndex: "z-index"
|
|
131
131
|
};
|
|
132
|
-
function
|
|
132
|
+
function Se(e) {
|
|
133
133
|
const r = {};
|
|
134
|
-
for (const [
|
|
135
|
-
const s =
|
|
136
|
-
for (const [o, i] of Object.entries(
|
|
137
|
-
r[`--fsc-${s}-${
|
|
134
|
+
for (const [n, a] of Object.entries(e)) {
|
|
135
|
+
const s = De[n];
|
|
136
|
+
for (const [o, i] of Object.entries(a))
|
|
137
|
+
r[`--fsc-${s}-${Me(o)}`] = String(i);
|
|
138
138
|
}
|
|
139
139
|
return r;
|
|
140
140
|
}
|
|
141
|
-
function
|
|
142
|
-
const r =
|
|
141
|
+
function Qt(e) {
|
|
142
|
+
const r = Se(e);
|
|
143
143
|
return `:root {
|
|
144
|
-
${Object.entries(r).map(([
|
|
144
|
+
${Object.entries(r).map(([a, s]) => ` ${a}: ${s};`).join(`
|
|
145
145
|
`)}
|
|
146
146
|
}`;
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function Be(e) {
|
|
149
149
|
const r = [];
|
|
150
|
-
for (const [
|
|
151
|
-
if (!
|
|
152
|
-
r.push(`Missing theme group: ${
|
|
150
|
+
for (const [n, a] of Object.entries(e)) {
|
|
151
|
+
if (!a || typeof a != "object") {
|
|
152
|
+
r.push(`Missing theme group: ${n}`);
|
|
153
153
|
continue;
|
|
154
154
|
}
|
|
155
|
-
for (const [s, o] of Object.entries(
|
|
156
|
-
(o == null || typeof o == "string" && o.trim() === "") && r.push(`Missing theme value: ${
|
|
155
|
+
for (const [s, o] of Object.entries(a))
|
|
156
|
+
(o == null || typeof o == "string" && o.trim() === "") && r.push(`Missing theme value: ${n}.${s}`);
|
|
157
157
|
}
|
|
158
158
|
return r;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
const
|
|
162
|
-
if (
|
|
163
|
-
throw new Error(`Invalid theme: ${
|
|
164
|
-
const s =
|
|
165
|
-
for (const [
|
|
166
|
-
o.set(
|
|
167
|
-
return
|
|
168
|
-
for (const [
|
|
169
|
-
|
|
170
|
-
|
|
160
|
+
function Ve(e, r, n) {
|
|
161
|
+
const a = Be(r);
|
|
162
|
+
if (a.length > 0)
|
|
163
|
+
throw new Error(`Invalid theme: ${a.join(", ")}`);
|
|
164
|
+
const s = Se(r), o = /* @__PURE__ */ new Map(), i = e.style.colorScheme, l = e.dataset.theme;
|
|
165
|
+
for (const [c, d] of Object.entries(s))
|
|
166
|
+
o.set(c, e.style.getPropertyValue(c)), e.style.setProperty(c, d);
|
|
167
|
+
return n && (e.dataset.theme = n, e.style.colorScheme = n), () => {
|
|
168
|
+
for (const [c, d] of o)
|
|
169
|
+
d ? e.style.setProperty(c, d) : e.style.removeProperty(c);
|
|
170
|
+
l === void 0 ? delete e.dataset.theme : e.dataset.theme = l, e.style.colorScheme = i;
|
|
171
171
|
};
|
|
172
172
|
}
|
|
173
|
-
var
|
|
174
|
-
var
|
|
175
|
-
function
|
|
176
|
-
if (
|
|
177
|
-
|
|
173
|
+
var te = { exports: {} }, J = {};
|
|
174
|
+
var pe;
|
|
175
|
+
function Ue() {
|
|
176
|
+
if (pe) return J;
|
|
177
|
+
pe = 1;
|
|
178
178
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), r = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
179
|
-
function
|
|
179
|
+
function n(a, s, o) {
|
|
180
180
|
var i = null;
|
|
181
181
|
if (o !== void 0 && (i = "" + o), s.key !== void 0 && (i = "" + s.key), "key" in s) {
|
|
182
182
|
o = {};
|
|
183
|
-
for (var
|
|
184
|
-
|
|
183
|
+
for (var l in s)
|
|
184
|
+
l !== "key" && (o[l] = s[l]);
|
|
185
185
|
} else o = s;
|
|
186
186
|
return s = o.ref, {
|
|
187
187
|
$$typeof: e,
|
|
188
|
-
type:
|
|
188
|
+
type: a,
|
|
189
189
|
key: i,
|
|
190
190
|
ref: s !== void 0 ? s : null,
|
|
191
191
|
props: o
|
|
192
192
|
};
|
|
193
193
|
}
|
|
194
|
-
return
|
|
195
|
-
}
|
|
196
|
-
var
|
|
197
|
-
var
|
|
198
|
-
function
|
|
199
|
-
return
|
|
200
|
-
function e(
|
|
201
|
-
if (
|
|
202
|
-
if (typeof
|
|
203
|
-
return
|
|
204
|
-
if (typeof
|
|
205
|
-
switch (
|
|
206
|
-
case
|
|
194
|
+
return J.Fragment = r, J.jsx = n, J.jsxs = n, J;
|
|
195
|
+
}
|
|
196
|
+
var G = {};
|
|
197
|
+
var be;
|
|
198
|
+
function We() {
|
|
199
|
+
return be || (be = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
200
|
+
function e(u) {
|
|
201
|
+
if (u == null) return null;
|
|
202
|
+
if (typeof u == "function")
|
|
203
|
+
return u.$$typeof === U ? null : u.displayName || u.name || null;
|
|
204
|
+
if (typeof u == "string") return u;
|
|
205
|
+
switch (u) {
|
|
206
|
+
case p:
|
|
207
207
|
return "Fragment";
|
|
208
208
|
case C:
|
|
209
209
|
return "Profiler";
|
|
210
|
-
case
|
|
210
|
+
case j:
|
|
211
211
|
return "StrictMode";
|
|
212
|
-
case
|
|
212
|
+
case q:
|
|
213
213
|
return "Suspense";
|
|
214
|
-
case
|
|
214
|
+
case le:
|
|
215
215
|
return "SuspenseList";
|
|
216
|
-
case
|
|
216
|
+
case ce:
|
|
217
217
|
return "Activity";
|
|
218
|
-
case
|
|
218
|
+
case F:
|
|
219
219
|
return "ViewTransition";
|
|
220
220
|
}
|
|
221
|
-
if (typeof
|
|
222
|
-
switch (typeof
|
|
221
|
+
if (typeof u == "object")
|
|
222
|
+
switch (typeof u.tag == "number" && console.error(
|
|
223
223
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
224
|
-
),
|
|
225
|
-
case
|
|
224
|
+
), u.$$typeof) {
|
|
225
|
+
case b:
|
|
226
226
|
return "Portal";
|
|
227
|
-
case
|
|
228
|
-
return
|
|
229
|
-
case
|
|
230
|
-
return (
|
|
231
|
-
case
|
|
232
|
-
var
|
|
233
|
-
return
|
|
234
|
-
case
|
|
235
|
-
return
|
|
236
|
-
case
|
|
237
|
-
|
|
227
|
+
case oe:
|
|
228
|
+
return u.displayName || "Context";
|
|
229
|
+
case T:
|
|
230
|
+
return (u._context.displayName || "Context") + ".Consumer";
|
|
231
|
+
case ie:
|
|
232
|
+
var y = u.render;
|
|
233
|
+
return u = u.displayName, u || (u = y.displayName || y.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
|
|
234
|
+
case K:
|
|
235
|
+
return y = u.displayName || null, y !== null ? y : e(u.type) || "Memo";
|
|
236
|
+
case V:
|
|
237
|
+
y = u._payload, u = u._init;
|
|
238
238
|
try {
|
|
239
|
-
return e(
|
|
239
|
+
return e(u(y));
|
|
240
240
|
} catch {
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
return null;
|
|
244
244
|
}
|
|
245
|
-
function r(
|
|
246
|
-
return "" +
|
|
245
|
+
function r(u) {
|
|
246
|
+
return "" + u;
|
|
247
247
|
}
|
|
248
|
-
function
|
|
248
|
+
function n(u) {
|
|
249
249
|
try {
|
|
250
|
-
r(
|
|
251
|
-
var
|
|
250
|
+
r(u);
|
|
251
|
+
var y = !1;
|
|
252
252
|
} catch {
|
|
253
|
-
|
|
253
|
+
y = !0;
|
|
254
254
|
}
|
|
255
|
-
if (
|
|
256
|
-
|
|
257
|
-
var
|
|
258
|
-
return
|
|
259
|
-
|
|
255
|
+
if (y) {
|
|
256
|
+
y = console;
|
|
257
|
+
var N = y.error, E = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
|
|
258
|
+
return N.call(
|
|
259
|
+
y,
|
|
260
260
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
261
|
-
|
|
262
|
-
), r(
|
|
261
|
+
E
|
|
262
|
+
), r(u);
|
|
263
263
|
}
|
|
264
264
|
}
|
|
265
|
-
function
|
|
266
|
-
if (
|
|
267
|
-
if (typeof
|
|
265
|
+
function a(u) {
|
|
266
|
+
if (u === p) return "<>";
|
|
267
|
+
if (typeof u == "object" && u !== null && u.$$typeof === V)
|
|
268
268
|
return "<...>";
|
|
269
269
|
try {
|
|
270
|
-
var
|
|
271
|
-
return
|
|
270
|
+
var y = e(u);
|
|
271
|
+
return y ? "<" + y + ">" : "<...>";
|
|
272
272
|
} catch {
|
|
273
273
|
return "<...>";
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
function s() {
|
|
277
|
-
var
|
|
278
|
-
return
|
|
277
|
+
var u = D.A;
|
|
278
|
+
return u === null ? null : u.getOwner();
|
|
279
279
|
}
|
|
280
280
|
function o() {
|
|
281
281
|
return Error("react-stack-top-frame");
|
|
282
282
|
}
|
|
283
|
-
function i(
|
|
284
|
-
if (
|
|
285
|
-
var
|
|
286
|
-
if (
|
|
283
|
+
function i(u) {
|
|
284
|
+
if ($.call(u, "key")) {
|
|
285
|
+
var y = Object.getOwnPropertyDescriptor(u, "key").get;
|
|
286
|
+
if (y && y.isReactWarning) return !1;
|
|
287
287
|
}
|
|
288
|
-
return
|
|
288
|
+
return u.key !== void 0;
|
|
289
289
|
}
|
|
290
|
-
function
|
|
291
|
-
function
|
|
292
|
-
|
|
290
|
+
function l(u, y) {
|
|
291
|
+
function N() {
|
|
292
|
+
L || (L = !0, console.error(
|
|
293
293
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
294
|
-
|
|
294
|
+
y
|
|
295
295
|
));
|
|
296
296
|
}
|
|
297
|
-
|
|
298
|
-
get:
|
|
297
|
+
N.isReactWarning = !0, Object.defineProperty(u, "key", {
|
|
298
|
+
get: N,
|
|
299
299
|
configurable: !0
|
|
300
300
|
});
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
var
|
|
304
|
-
return
|
|
302
|
+
function c() {
|
|
303
|
+
var u = e(this.type);
|
|
304
|
+
return B[u] || (B[u] = !0, console.error(
|
|
305
305
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
306
|
-
)),
|
|
306
|
+
)), u = this.props.ref, u !== void 0 ? u : null;
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
var
|
|
310
|
-
return
|
|
311
|
-
$$typeof:
|
|
312
|
-
type:
|
|
313
|
-
key:
|
|
314
|
-
props:
|
|
315
|
-
_owner:
|
|
316
|
-
}, (
|
|
308
|
+
function d(u, y, N, E, g, S) {
|
|
309
|
+
var _ = N.ref;
|
|
310
|
+
return u = {
|
|
311
|
+
$$typeof: x,
|
|
312
|
+
type: u,
|
|
313
|
+
key: y,
|
|
314
|
+
props: N,
|
|
315
|
+
_owner: E
|
|
316
|
+
}, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(u, "ref", {
|
|
317
317
|
enumerable: !1,
|
|
318
|
-
get:
|
|
319
|
-
}) : Object.defineProperty(
|
|
318
|
+
get: c
|
|
319
|
+
}) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", {
|
|
320
320
|
configurable: !1,
|
|
321
321
|
enumerable: !1,
|
|
322
322
|
writable: !0,
|
|
323
323
|
value: 0
|
|
324
|
-
}), Object.defineProperty(
|
|
324
|
+
}), Object.defineProperty(u, "_debugInfo", {
|
|
325
325
|
configurable: !1,
|
|
326
326
|
enumerable: !1,
|
|
327
327
|
writable: !0,
|
|
328
328
|
value: null
|
|
329
|
-
}), Object.defineProperty(
|
|
329
|
+
}), Object.defineProperty(u, "_debugStack", {
|
|
330
330
|
configurable: !1,
|
|
331
331
|
enumerable: !1,
|
|
332
332
|
writable: !0,
|
|
333
|
-
value:
|
|
334
|
-
}), Object.defineProperty(
|
|
333
|
+
value: g
|
|
334
|
+
}), Object.defineProperty(u, "_debugTask", {
|
|
335
335
|
configurable: !1,
|
|
336
336
|
enumerable: !1,
|
|
337
337
|
writable: !0,
|
|
338
|
-
value:
|
|
339
|
-
}), Object.freeze && (Object.freeze(
|
|
338
|
+
value: S
|
|
339
|
+
}), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
var
|
|
343
|
-
if (
|
|
344
|
-
if (
|
|
345
|
-
if (
|
|
346
|
-
for (
|
|
347
|
-
|
|
348
|
-
Object.freeze && Object.freeze(
|
|
341
|
+
function m(u, y, N, E, g, S) {
|
|
342
|
+
var _ = y.children;
|
|
343
|
+
if (_ !== void 0)
|
|
344
|
+
if (E)
|
|
345
|
+
if (Q(_)) {
|
|
346
|
+
for (E = 0; E < _.length; E++)
|
|
347
|
+
f(_[E]);
|
|
348
|
+
Object.freeze && Object.freeze(_);
|
|
349
349
|
} else
|
|
350
350
|
console.error(
|
|
351
351
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
352
352
|
);
|
|
353
|
-
else
|
|
354
|
-
if (
|
|
355
|
-
|
|
356
|
-
var
|
|
357
|
-
return
|
|
353
|
+
else f(_);
|
|
354
|
+
if ($.call(y, "key")) {
|
|
355
|
+
_ = e(u);
|
|
356
|
+
var k = Object.keys(y).filter(function(z) {
|
|
357
|
+
return z !== "key";
|
|
358
358
|
});
|
|
359
|
-
|
|
359
|
+
E = 0 < k.length ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}", ee[_ + E] || (k = 0 < k.length ? "{" + k.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
360
360
|
`A props object containing a "key" prop is being spread into JSX:
|
|
361
361
|
let props = %s;
|
|
362
362
|
<%s {...props} />
|
|
363
363
|
React keys must be passed directly to JSX without using spread:
|
|
364
364
|
let props = %s;
|
|
365
365
|
<%s key={someKey} {...props} />`,
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
),
|
|
366
|
+
E,
|
|
367
|
+
_,
|
|
368
|
+
k,
|
|
369
|
+
_
|
|
370
|
+
), ee[_ + E] = !0);
|
|
371
371
|
}
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
for (var
|
|
375
|
-
|
|
376
|
-
} else
|
|
377
|
-
return
|
|
378
|
-
|
|
379
|
-
typeof
|
|
380
|
-
),
|
|
381
|
-
|
|
382
|
-
w,
|
|
383
|
-
y,
|
|
384
|
-
s(),
|
|
372
|
+
if (_ = null, N !== void 0 && (n(N), _ = "" + N), i(y) && (n(y.key), _ = "" + y.key), "key" in y) {
|
|
373
|
+
N = {};
|
|
374
|
+
for (var O in y)
|
|
375
|
+
O !== "key" && (N[O] = y[O]);
|
|
376
|
+
} else N = y;
|
|
377
|
+
return _ && l(
|
|
378
|
+
N,
|
|
379
|
+
typeof u == "function" ? u.displayName || u.name || "Unknown" : u
|
|
380
|
+
), d(
|
|
381
|
+
u,
|
|
385
382
|
_,
|
|
386
|
-
|
|
383
|
+
N,
|
|
384
|
+
s(),
|
|
385
|
+
g,
|
|
386
|
+
S
|
|
387
387
|
);
|
|
388
388
|
}
|
|
389
|
-
function
|
|
390
|
-
|
|
389
|
+
function f(u) {
|
|
390
|
+
v(u) ? u._store && (u._store.validated = 1) : typeof u == "object" && u !== null && u.$$typeof === V && (u._payload.status === "fulfilled" ? v(u._payload.value) && u._payload.value._store && (u._payload.value._store.validated = 1) : u._store && (u._store.validated = 1));
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
return typeof
|
|
392
|
+
function v(u) {
|
|
393
|
+
return typeof u == "object" && u !== null && u.$$typeof === x;
|
|
394
394
|
}
|
|
395
|
-
var
|
|
395
|
+
var h = Re, x = /* @__PURE__ */ Symbol.for("react.transitional.element"), b = /* @__PURE__ */ Symbol.for("react.portal"), p = /* @__PURE__ */ Symbol.for("react.fragment"), j = /* @__PURE__ */ Symbol.for("react.strict_mode"), C = /* @__PURE__ */ Symbol.for("react.profiler"), T = /* @__PURE__ */ Symbol.for("react.consumer"), oe = /* @__PURE__ */ Symbol.for("react.context"), ie = /* @__PURE__ */ Symbol.for("react.forward_ref"), q = /* @__PURE__ */ Symbol.for("react.suspense"), le = /* @__PURE__ */ Symbol.for("react.suspense_list"), K = /* @__PURE__ */ Symbol.for("react.memo"), V = /* @__PURE__ */ Symbol.for("react.lazy"), ce = /* @__PURE__ */ Symbol.for("react.activity"), F = /* @__PURE__ */ Symbol.for("react.view_transition"), U = /* @__PURE__ */ Symbol.for("react.client.reference"), D = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $ = Object.prototype.hasOwnProperty, Q = Array.isArray, W = console.createTask ? console.createTask : function() {
|
|
396
396
|
return null;
|
|
397
397
|
};
|
|
398
|
-
|
|
399
|
-
react_stack_bottom_frame: function(
|
|
400
|
-
return
|
|
398
|
+
h = {
|
|
399
|
+
react_stack_bottom_frame: function(u) {
|
|
400
|
+
return u();
|
|
401
401
|
}
|
|
402
402
|
};
|
|
403
|
-
var
|
|
404
|
-
|
|
403
|
+
var L, B = {}, Y = h.react_stack_bottom_frame.bind(
|
|
404
|
+
h,
|
|
405
405
|
o
|
|
406
|
-
)(),
|
|
407
|
-
|
|
408
|
-
var
|
|
409
|
-
if (
|
|
410
|
-
var
|
|
406
|
+
)(), X = W(a(o)), ee = {};
|
|
407
|
+
G.Fragment = p, G.jsx = function(u, y, N) {
|
|
408
|
+
var E = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
409
|
+
if (E) {
|
|
410
|
+
var g = Error.stackTraceLimit;
|
|
411
411
|
Error.stackTraceLimit = 10;
|
|
412
|
-
var
|
|
413
|
-
Error.stackTraceLimit =
|
|
414
|
-
} else
|
|
415
|
-
return
|
|
416
|
-
|
|
417
|
-
p,
|
|
412
|
+
var S = Error("react-stack-top-frame");
|
|
413
|
+
Error.stackTraceLimit = g;
|
|
414
|
+
} else S = Y;
|
|
415
|
+
return m(
|
|
416
|
+
u,
|
|
418
417
|
y,
|
|
418
|
+
N,
|
|
419
419
|
!1,
|
|
420
|
-
|
|
421
|
-
|
|
420
|
+
S,
|
|
421
|
+
E ? W(a(u)) : X
|
|
422
422
|
);
|
|
423
|
-
},
|
|
424
|
-
var
|
|
425
|
-
if (
|
|
426
|
-
var
|
|
423
|
+
}, G.jsxs = function(u, y, N) {
|
|
424
|
+
var E = 1e4 > D.recentlyCreatedOwnerStacks++;
|
|
425
|
+
if (E) {
|
|
426
|
+
var g = Error.stackTraceLimit;
|
|
427
427
|
Error.stackTraceLimit = 10;
|
|
428
|
-
var
|
|
429
|
-
Error.stackTraceLimit =
|
|
430
|
-
} else
|
|
431
|
-
return
|
|
432
|
-
|
|
433
|
-
p,
|
|
428
|
+
var S = Error("react-stack-top-frame");
|
|
429
|
+
Error.stackTraceLimit = g;
|
|
430
|
+
} else S = Y;
|
|
431
|
+
return m(
|
|
432
|
+
u,
|
|
434
433
|
y,
|
|
434
|
+
N,
|
|
435
435
|
!0,
|
|
436
|
-
|
|
437
|
-
|
|
436
|
+
S,
|
|
437
|
+
E ? W(a(u)) : X
|
|
438
438
|
);
|
|
439
439
|
};
|
|
440
|
-
})()),
|
|
440
|
+
})()), G;
|
|
441
441
|
}
|
|
442
|
-
var
|
|
443
|
-
function
|
|
444
|
-
return
|
|
442
|
+
var xe;
|
|
443
|
+
function Ye() {
|
|
444
|
+
return xe || (xe = 1, process.env.NODE_ENV === "production" ? te.exports = Ue() : te.exports = We()), te.exports;
|
|
445
445
|
}
|
|
446
|
-
var
|
|
447
|
-
const
|
|
448
|
-
function
|
|
446
|
+
var t = Ye();
|
|
447
|
+
const we = ae(null);
|
|
448
|
+
function Ze() {
|
|
449
449
|
return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
450
450
|
}
|
|
451
|
-
function
|
|
452
|
-
return
|
|
451
|
+
function Qe() {
|
|
452
|
+
return Ze() ? "dark" : "light";
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function Jt({
|
|
455
455
|
children: e,
|
|
456
456
|
mode: r,
|
|
457
|
-
defaultMode:
|
|
458
|
-
lightTheme:
|
|
459
|
-
darkTheme: s =
|
|
457
|
+
defaultMode: n = "system",
|
|
458
|
+
lightTheme: a = M,
|
|
459
|
+
darkTheme: s = Fe,
|
|
460
460
|
container: o
|
|
461
461
|
}) {
|
|
462
|
-
const [i,
|
|
463
|
-
|
|
462
|
+
const [i, l] = w(n), c = r ?? i, [d, m] = w(Qe);
|
|
463
|
+
P(() => {
|
|
464
464
|
if (typeof window > "u" || typeof window.matchMedia != "function") return;
|
|
465
|
-
const
|
|
466
|
-
return
|
|
465
|
+
const x = window.matchMedia("(prefers-color-scheme: dark)"), b = () => m(x.matches ? "dark" : "light");
|
|
466
|
+
return b(), x.addEventListener?.("change", b), () => x.removeEventListener?.("change", b);
|
|
467
467
|
}, []);
|
|
468
|
-
const
|
|
468
|
+
const f = c === "system" ? d : c, v = f === "dark" ? s : a, h = I(
|
|
469
469
|
() => ({
|
|
470
|
-
mode:
|
|
471
|
-
resolvedMode:
|
|
472
|
-
theme:
|
|
473
|
-
setMode:
|
|
470
|
+
mode: c,
|
|
471
|
+
resolvedMode: f,
|
|
472
|
+
theme: v,
|
|
473
|
+
setMode: l
|
|
474
474
|
}),
|
|
475
|
-
[
|
|
475
|
+
[c, f, v]
|
|
476
476
|
);
|
|
477
|
-
return
|
|
478
|
-
const
|
|
479
|
-
if (
|
|
480
|
-
return
|
|
481
|
-
}, [o,
|
|
482
|
-
}
|
|
483
|
-
function
|
|
484
|
-
const e =
|
|
477
|
+
return P(() => {
|
|
478
|
+
const x = o ?? (typeof document < "u" ? document.documentElement : null);
|
|
479
|
+
if (x)
|
|
480
|
+
return Ve(x, v, f);
|
|
481
|
+
}, [o, f, v]), /* @__PURE__ */ t.jsx(we.Provider, { value: h, children: e });
|
|
482
|
+
}
|
|
483
|
+
function Gt() {
|
|
484
|
+
const e = H(we);
|
|
485
485
|
if (!e) throw new Error("useTheme must be used within a ThemeProvider.");
|
|
486
486
|
return e;
|
|
487
487
|
}
|
|
488
|
-
function
|
|
489
|
-
let r = { ...e.initialValues },
|
|
488
|
+
function me(e) {
|
|
489
|
+
let r = { ...e.initialValues }, n = {
|
|
490
490
|
values: { ...r },
|
|
491
491
|
errors: {},
|
|
492
492
|
touched: {},
|
|
@@ -494,39 +494,39 @@ function Y(e) {
|
|
|
494
494
|
submitting: !1,
|
|
495
495
|
status: "idle"
|
|
496
496
|
};
|
|
497
|
-
const
|
|
498
|
-
for (const
|
|
499
|
-
}, o = (
|
|
500
|
-
|
|
497
|
+
const a = /* @__PURE__ */ new Set(), s = () => {
|
|
498
|
+
for (const d of a) d();
|
|
499
|
+
}, o = (d) => {
|
|
500
|
+
n = d, s();
|
|
501
501
|
}, i = async () => {
|
|
502
502
|
if (!e.validate)
|
|
503
|
-
return Object.keys(
|
|
504
|
-
const
|
|
505
|
-
return o({ ...
|
|
503
|
+
return Object.keys(n.errors).length === 0 ? {} : (o({ ...n, errors: {} }), {});
|
|
504
|
+
const d = await e.validate(n.values);
|
|
505
|
+
return o({ ...n, errors: d }), d;
|
|
506
506
|
};
|
|
507
507
|
return {
|
|
508
|
-
getState: () =>
|
|
509
|
-
setValue: (
|
|
508
|
+
getState: () => n,
|
|
509
|
+
setValue: (d, m) => {
|
|
510
510
|
o({
|
|
511
|
-
...
|
|
512
|
-
values: { ...
|
|
511
|
+
...n,
|
|
512
|
+
values: { ...n.values, [d]: m },
|
|
513
513
|
dirty: !0,
|
|
514
|
-
status:
|
|
514
|
+
status: n.status === "success" || n.status === "error" ? "idle" : n.status,
|
|
515
515
|
submitError: void 0
|
|
516
516
|
});
|
|
517
517
|
},
|
|
518
|
-
setTouched: (
|
|
518
|
+
setTouched: (d, m = !0) => {
|
|
519
519
|
o({
|
|
520
|
-
...
|
|
521
|
-
touched: { ...
|
|
520
|
+
...n,
|
|
521
|
+
touched: { ...n.touched, [d]: m }
|
|
522
522
|
});
|
|
523
523
|
},
|
|
524
|
-
setErrors: (
|
|
525
|
-
o({ ...
|
|
524
|
+
setErrors: (d) => {
|
|
525
|
+
o({ ...n, errors: d, status: "error" });
|
|
526
526
|
},
|
|
527
|
-
reset: (
|
|
528
|
-
r = { ...
|
|
529
|
-
values: { ...
|
|
527
|
+
reset: (d = r) => {
|
|
528
|
+
r = { ...d }, o({
|
|
529
|
+
values: { ...d },
|
|
530
530
|
errors: {},
|
|
531
531
|
touched: {},
|
|
532
532
|
dirty: !1,
|
|
@@ -537,352 +537,354 @@ function Y(e) {
|
|
|
537
537
|
},
|
|
538
538
|
validate: i,
|
|
539
539
|
submit: async () => {
|
|
540
|
-
if (
|
|
541
|
-
const
|
|
542
|
-
if (Object.keys(
|
|
543
|
-
return o({ ...
|
|
544
|
-
const
|
|
545
|
-
o({ ...
|
|
540
|
+
if (n.submitting) return !1;
|
|
541
|
+
const d = await i();
|
|
542
|
+
if (Object.keys(d).length > 0)
|
|
543
|
+
return o({ ...n, errors: d, status: "error", submitting: !1 }), !1;
|
|
544
|
+
const m = n.values;
|
|
545
|
+
o({ ...n, submitting: !0, status: "submitting", submitError: void 0 });
|
|
546
546
|
try {
|
|
547
|
-
return await e.onSubmit(
|
|
548
|
-
} catch (
|
|
547
|
+
return await e.onSubmit(m), o({ ...n, submitting: !1, status: "success", errors: {} }), !0;
|
|
548
|
+
} catch (f) {
|
|
549
549
|
return o({
|
|
550
|
-
...
|
|
550
|
+
...n,
|
|
551
551
|
submitting: !1,
|
|
552
552
|
status: "error",
|
|
553
|
-
submitError:
|
|
553
|
+
submitError: f instanceof Error ? f.message : String(f)
|
|
554
554
|
}), !1;
|
|
555
555
|
}
|
|
556
556
|
},
|
|
557
|
-
subscribe: (
|
|
557
|
+
subscribe: (d) => (a.add(d), () => a.delete(d))
|
|
558
558
|
};
|
|
559
559
|
}
|
|
560
|
-
function
|
|
561
|
-
let
|
|
560
|
+
function Je(e, r) {
|
|
561
|
+
let n, a;
|
|
562
562
|
return {
|
|
563
563
|
name: r,
|
|
564
564
|
getState: () => {
|
|
565
565
|
const o = e.getState();
|
|
566
|
-
return o ===
|
|
566
|
+
return o === n && a || (n = o, a = {
|
|
567
567
|
value: o.values[r],
|
|
568
568
|
error: o.errors[r],
|
|
569
569
|
touched: o.touched[r] === !0,
|
|
570
570
|
dirty: o.dirty,
|
|
571
571
|
submitting: o.submitting
|
|
572
|
-
}),
|
|
572
|
+
}), a;
|
|
573
573
|
},
|
|
574
574
|
setValue: (o) => e.setValue(r, o),
|
|
575
575
|
setTouched: (o = !0) => e.setTouched(r, o)
|
|
576
576
|
};
|
|
577
577
|
}
|
|
578
|
-
const
|
|
579
|
-
function
|
|
578
|
+
const Ne = ae(null);
|
|
579
|
+
function ke({
|
|
580
|
+
/** Form store exposed to descendants. */
|
|
580
581
|
store: e,
|
|
582
|
+
/** Descendant form fields and actions. */
|
|
581
583
|
children: r
|
|
582
584
|
}) {
|
|
583
|
-
return /* @__PURE__ */
|
|
585
|
+
return /* @__PURE__ */ t.jsx(Ne.Provider, { value: e, children: r });
|
|
584
586
|
}
|
|
585
|
-
function
|
|
586
|
-
const e =
|
|
587
|
+
function he() {
|
|
588
|
+
const e = H(Ne);
|
|
587
589
|
if (!e)
|
|
588
590
|
throw new Error("useFormStore must be used inside a FormProvider.");
|
|
589
591
|
return e;
|
|
590
592
|
}
|
|
591
|
-
function
|
|
592
|
-
const r =
|
|
593
|
-
r.current || (r.current =
|
|
594
|
-
const
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
593
|
+
function Ht(e) {
|
|
594
|
+
const r = A(null);
|
|
595
|
+
r.current || (r.current = me(e));
|
|
596
|
+
const n = r.current, a = Z(
|
|
597
|
+
n.subscribe,
|
|
598
|
+
n.getState,
|
|
599
|
+
n.getState
|
|
598
600
|
);
|
|
599
601
|
return {
|
|
600
|
-
store:
|
|
601
|
-
state:
|
|
602
|
-
submit:
|
|
603
|
-
reset:
|
|
604
|
-
validate:
|
|
602
|
+
store: n,
|
|
603
|
+
state: a,
|
|
604
|
+
submit: n.submit,
|
|
605
|
+
reset: n.reset,
|
|
606
|
+
validate: n.validate
|
|
605
607
|
};
|
|
606
608
|
}
|
|
607
|
-
function
|
|
608
|
-
const e =
|
|
609
|
-
return
|
|
609
|
+
function Ge() {
|
|
610
|
+
const e = he();
|
|
611
|
+
return Z(
|
|
610
612
|
e.subscribe,
|
|
611
613
|
e.getState,
|
|
612
614
|
e.getState
|
|
613
615
|
);
|
|
614
616
|
}
|
|
615
|
-
function
|
|
616
|
-
const r =
|
|
617
|
-
() =>
|
|
617
|
+
function Ee(e) {
|
|
618
|
+
const r = he(), n = I(
|
|
619
|
+
() => Je(r, e),
|
|
618
620
|
[r, e]
|
|
619
621
|
);
|
|
620
622
|
return {
|
|
621
|
-
...
|
|
623
|
+
...Z(
|
|
622
624
|
r.subscribe,
|
|
623
|
-
|
|
624
|
-
|
|
625
|
+
n.getState,
|
|
626
|
+
n.getState
|
|
625
627
|
),
|
|
626
|
-
setValue:
|
|
627
|
-
setTouched:
|
|
628
|
+
setValue: n.setValue,
|
|
629
|
+
setTouched: n.setTouched
|
|
628
630
|
};
|
|
629
631
|
}
|
|
630
|
-
function
|
|
632
|
+
function qt({
|
|
631
633
|
store: e,
|
|
632
634
|
children: r,
|
|
633
|
-
onSubmitResult:
|
|
634
|
-
onReset:
|
|
635
|
+
onSubmitResult: n,
|
|
636
|
+
onReset: a,
|
|
635
637
|
...s
|
|
636
638
|
}) {
|
|
637
|
-
const o = async (
|
|
638
|
-
|
|
639
|
-
const
|
|
640
|
-
await
|
|
641
|
-
}, i = (
|
|
642
|
-
|
|
639
|
+
const o = async (l) => {
|
|
640
|
+
l.preventDefault();
|
|
641
|
+
const c = await e.submit();
|
|
642
|
+
await n?.(c);
|
|
643
|
+
}, i = (l) => {
|
|
644
|
+
l.preventDefault(), e.reset(), a?.();
|
|
643
645
|
};
|
|
644
|
-
return /* @__PURE__ */
|
|
646
|
+
return /* @__PURE__ */ t.jsx(ke, { store: e, children: /* @__PURE__ */ t.jsx("form", { ...s, onSubmit: o, onReset: i, children: r }) });
|
|
645
647
|
}
|
|
646
|
-
function
|
|
647
|
-
const
|
|
648
|
+
function ve({ name: e, children: r, ...n }) {
|
|
649
|
+
const a = Ee(e);
|
|
648
650
|
if (r)
|
|
649
|
-
return r(
|
|
650
|
-
const s =
|
|
651
|
-
return /* @__PURE__ */
|
|
651
|
+
return r(a);
|
|
652
|
+
const s = a.value, o = typeof s == "string" || typeof s == "number" ? s : "";
|
|
653
|
+
return /* @__PURE__ */ t.jsx(
|
|
652
654
|
"input",
|
|
653
655
|
{
|
|
654
|
-
...
|
|
656
|
+
...n,
|
|
655
657
|
name: String(e),
|
|
656
658
|
value: o,
|
|
657
|
-
onChange: (i) =>
|
|
658
|
-
onBlur: () =>
|
|
659
|
-
"aria-invalid":
|
|
659
|
+
onChange: (i) => a.setValue(i.target.value),
|
|
660
|
+
onBlur: () => a.setTouched(),
|
|
661
|
+
"aria-invalid": a.error ? !0 : void 0
|
|
660
662
|
}
|
|
661
663
|
);
|
|
662
664
|
}
|
|
663
|
-
function
|
|
665
|
+
function Ce(e, r) {
|
|
664
666
|
return e ? `${r} ${e}` : r;
|
|
665
667
|
}
|
|
666
|
-
function
|
|
667
|
-
const { children: r = "Submit", disabled:
|
|
668
|
-
return /* @__PURE__ */
|
|
668
|
+
function He(e) {
|
|
669
|
+
const { children: r = "Submit", disabled: n, className: a, ...s } = e, { submitting: o } = he().getState();
|
|
670
|
+
return /* @__PURE__ */ t.jsx(
|
|
669
671
|
"button",
|
|
670
672
|
{
|
|
671
673
|
...s,
|
|
672
|
-
className:
|
|
674
|
+
className: Ce(a, "fsc-form-action"),
|
|
673
675
|
type: "submit",
|
|
674
|
-
disabled:
|
|
676
|
+
disabled: n || o,
|
|
675
677
|
"aria-busy": o || void 0,
|
|
676
678
|
children: r
|
|
677
679
|
}
|
|
678
680
|
);
|
|
679
681
|
}
|
|
680
|
-
function
|
|
681
|
-
const { children: r = "Reset", className:
|
|
682
|
-
return /* @__PURE__ */
|
|
682
|
+
function qe(e) {
|
|
683
|
+
const { children: r = "Reset", className: n, ...a } = e;
|
|
684
|
+
return /* @__PURE__ */ t.jsx(
|
|
683
685
|
"button",
|
|
684
686
|
{
|
|
685
|
-
...
|
|
686
|
-
className:
|
|
687
|
+
...a,
|
|
688
|
+
className: Ce(n, "fsc-form-action"),
|
|
687
689
|
type: "reset",
|
|
688
690
|
children: r
|
|
689
691
|
}
|
|
690
692
|
);
|
|
691
693
|
}
|
|
692
|
-
function
|
|
693
|
-
const
|
|
694
|
+
function Kt({ name: e, render: r }) {
|
|
695
|
+
const n = Ee(e);
|
|
694
696
|
return r({
|
|
695
|
-
value:
|
|
696
|
-
onChange:
|
|
697
|
-
onBlur: () =>
|
|
698
|
-
error:
|
|
697
|
+
value: n.value,
|
|
698
|
+
onChange: n.setValue,
|
|
699
|
+
onBlur: () => n.setTouched(),
|
|
700
|
+
error: n.error
|
|
699
701
|
});
|
|
700
702
|
}
|
|
701
|
-
function
|
|
702
|
-
return function(
|
|
703
|
-
const { field:
|
|
704
|
-
return /* @__PURE__ */
|
|
703
|
+
function Xt(e) {
|
|
704
|
+
return function(n) {
|
|
705
|
+
const { field: a, ...s } = n;
|
|
706
|
+
return /* @__PURE__ */ t.jsx(e, { ...s, ...a });
|
|
705
707
|
};
|
|
706
708
|
}
|
|
707
|
-
function
|
|
708
|
-
const { resource: r, mode:
|
|
709
|
-
if (
|
|
709
|
+
function er(e) {
|
|
710
|
+
const { resource: r, mode: n, id: a, initialValues: s, validate: o, transform: i, onSuccess: l } = e;
|
|
711
|
+
if (n === "edit" && a === void 0)
|
|
710
712
|
throw new Error("An id is required when creating an edit resource form.");
|
|
711
|
-
return
|
|
713
|
+
return me({
|
|
712
714
|
initialValues: s,
|
|
713
715
|
validate: o,
|
|
714
|
-
onSubmit: async (
|
|
715
|
-
const
|
|
716
|
-
let
|
|
717
|
-
if (
|
|
716
|
+
onSubmit: async (d) => {
|
|
717
|
+
const m = i ? i(d) : d;
|
|
718
|
+
let f;
|
|
719
|
+
if (n === "create") {
|
|
718
720
|
if (!r.create)
|
|
719
721
|
throw new Error(`Resource "${r.name}" does not support create.`);
|
|
720
|
-
|
|
722
|
+
f = await r.create(m);
|
|
721
723
|
} else {
|
|
722
724
|
if (!r.update)
|
|
723
725
|
throw new Error(`Resource "${r.name}" does not support update.`);
|
|
724
|
-
|
|
726
|
+
f = await r.update(a, m);
|
|
725
727
|
}
|
|
726
|
-
await
|
|
728
|
+
await l?.(f);
|
|
727
729
|
}
|
|
728
730
|
});
|
|
729
731
|
}
|
|
730
|
-
function
|
|
732
|
+
function Ke(e) {
|
|
731
733
|
const r = /* @__PURE__ */ new Set();
|
|
732
|
-
for (const
|
|
733
|
-
for (const
|
|
734
|
-
return [...r].map((
|
|
735
|
-
key:
|
|
736
|
-
header:
|
|
734
|
+
for (const n of e)
|
|
735
|
+
for (const a of Object.keys(n)) r.add(a);
|
|
736
|
+
return [...r].map((n) => ({
|
|
737
|
+
key: n,
|
|
738
|
+
header: n
|
|
737
739
|
}));
|
|
738
740
|
}
|
|
739
|
-
function
|
|
741
|
+
function Xe(e, r) {
|
|
740
742
|
return e === r ? 0 : e == null ? -1 : r == null ? 1 : String(e).localeCompare(String(r), void 0, { numeric: !0, sensitivity: "base" });
|
|
741
743
|
}
|
|
742
|
-
function
|
|
743
|
-
let
|
|
744
|
+
function et(e, r) {
|
|
745
|
+
let n = [...r];
|
|
744
746
|
return {
|
|
745
747
|
name: e,
|
|
746
|
-
async list(
|
|
747
|
-
let s = [...
|
|
748
|
-
if (
|
|
749
|
-
const i =
|
|
748
|
+
async list(a = {}) {
|
|
749
|
+
let s = [...n];
|
|
750
|
+
if (a.search) {
|
|
751
|
+
const i = a.search.trim().toLowerCase();
|
|
750
752
|
i && (s = s.filter(
|
|
751
|
-
(
|
|
752
|
-
(
|
|
753
|
+
(l) => Object.values(l).some(
|
|
754
|
+
(c) => String(c ?? "").toLowerCase().includes(i)
|
|
753
755
|
)
|
|
754
756
|
));
|
|
755
757
|
}
|
|
756
|
-
if (
|
|
757
|
-
const { field: i, direction:
|
|
758
|
-
s.sort((
|
|
759
|
-
const
|
|
760
|
-
return
|
|
758
|
+
if (a.sort) {
|
|
759
|
+
const { field: i, direction: l } = a.sort;
|
|
760
|
+
s.sort((c, d) => {
|
|
761
|
+
const m = Xe(c[i], d[i]);
|
|
762
|
+
return l === "desc" ? -m : m;
|
|
761
763
|
});
|
|
762
764
|
}
|
|
763
765
|
const o = s.length;
|
|
764
|
-
if (
|
|
765
|
-
const
|
|
766
|
-
s = s.slice(
|
|
766
|
+
if (a.pageSize && a.pageSize > 0) {
|
|
767
|
+
const l = (Math.max(a.page ?? 1, 1) - 1) * a.pageSize;
|
|
768
|
+
s = s.slice(l, l + a.pageSize);
|
|
767
769
|
}
|
|
768
770
|
return { data: s, total: o };
|
|
769
771
|
},
|
|
770
|
-
async get(
|
|
771
|
-
const s =
|
|
772
|
-
if (!s) throw new Error(`${e} record "${
|
|
772
|
+
async get(a) {
|
|
773
|
+
const s = n.find((o) => String(o.id) === a);
|
|
774
|
+
if (!s) throw new Error(`${e} record "${a}" was not found.`);
|
|
773
775
|
return s;
|
|
774
776
|
},
|
|
775
|
-
async create(
|
|
777
|
+
async create(a) {
|
|
776
778
|
const s = {
|
|
777
|
-
...
|
|
779
|
+
...a,
|
|
778
780
|
id: globalThis.crypto.randomUUID()
|
|
779
781
|
};
|
|
780
|
-
return
|
|
782
|
+
return n.push(s), s;
|
|
781
783
|
},
|
|
782
|
-
async update(
|
|
783
|
-
const o =
|
|
784
|
-
if (o < 0) throw new Error(`${e} record "${
|
|
785
|
-
const i = { ...
|
|
786
|
-
return
|
|
784
|
+
async update(a, s) {
|
|
785
|
+
const o = n.findIndex((l) => String(l.id) === a);
|
|
786
|
+
if (o < 0) throw new Error(`${e} record "${a}" was not found.`);
|
|
787
|
+
const i = { ...n[o], ...s };
|
|
788
|
+
return n[o] = i, i;
|
|
787
789
|
},
|
|
788
|
-
async delete(
|
|
789
|
-
const s =
|
|
790
|
-
if (s < 0) throw new Error(`${e} record "${
|
|
791
|
-
|
|
790
|
+
async delete(a) {
|
|
791
|
+
const s = n.findIndex((o) => String(o.id) === a);
|
|
792
|
+
if (s < 0) throw new Error(`${e} record "${a}" was not found.`);
|
|
793
|
+
n.splice(s, 1);
|
|
792
794
|
}
|
|
793
795
|
};
|
|
794
796
|
}
|
|
795
|
-
function
|
|
796
|
-
let
|
|
797
|
+
function tt(e, r = {}) {
|
|
798
|
+
let n = {
|
|
797
799
|
data: [],
|
|
798
800
|
operation: "idle",
|
|
799
801
|
lastQuery: r.initialQuery
|
|
800
802
|
};
|
|
801
|
-
const
|
|
802
|
-
for (const
|
|
803
|
-
}, o = (
|
|
804
|
-
|
|
805
|
-
...
|
|
806
|
-
...
|
|
803
|
+
const a = /* @__PURE__ */ new Set(), s = () => {
|
|
804
|
+
for (const p of a) p();
|
|
805
|
+
}, o = (p) => {
|
|
806
|
+
n = {
|
|
807
|
+
...n,
|
|
808
|
+
...p,
|
|
807
809
|
lastUpdated: Date.now()
|
|
808
810
|
}, s();
|
|
809
|
-
}, i = (
|
|
810
|
-
o({ operation:
|
|
811
|
+
}, i = (p) => p instanceof Error ? p : new Error(String(p)), l = async (p, j) => {
|
|
812
|
+
o({ operation: p, error: void 0 });
|
|
811
813
|
try {
|
|
812
|
-
const C = await
|
|
814
|
+
const C = await j();
|
|
813
815
|
return o({ operation: "idle" }), C;
|
|
814
816
|
} catch (C) {
|
|
815
|
-
const
|
|
817
|
+
const T = i(C);
|
|
816
818
|
throw o({
|
|
817
819
|
operation: "idle",
|
|
818
|
-
error:
|
|
819
|
-
}),
|
|
820
|
+
error: T
|
|
821
|
+
}), T;
|
|
820
822
|
}
|
|
821
|
-
},
|
|
822
|
-
const
|
|
823
|
+
}, c = async (p = n.lastQuery ?? {}) => {
|
|
824
|
+
const j = await e.list(p);
|
|
823
825
|
return o({
|
|
824
|
-
data:
|
|
825
|
-
total:
|
|
826
|
-
lastQuery:
|
|
827
|
-
}),
|
|
828
|
-
},
|
|
829
|
-
const
|
|
830
|
-
return o({ selected:
|
|
831
|
-
}),
|
|
826
|
+
data: j.data,
|
|
827
|
+
total: j.total,
|
|
828
|
+
lastQuery: p
|
|
829
|
+
}), j;
|
|
830
|
+
}, d = (p = n.lastQuery ?? {}) => l("listing", () => c(p)), m = (p) => l("reading", async () => {
|
|
831
|
+
const j = await e.get(p);
|
|
832
|
+
return o({ selected: j }), j;
|
|
833
|
+
}), f = (p) => {
|
|
832
834
|
if (!e.create) {
|
|
833
|
-
const
|
|
835
|
+
const j = new Error(
|
|
834
836
|
`Resource "${e.name}" does not support create().`
|
|
835
837
|
);
|
|
836
|
-
return o({ operation: "idle", error:
|
|
838
|
+
return o({ operation: "idle", error: j }), Promise.reject(j);
|
|
837
839
|
}
|
|
838
|
-
return
|
|
839
|
-
const
|
|
840
|
-
return await
|
|
840
|
+
return l("creating", async () => {
|
|
841
|
+
const j = await e.create(p);
|
|
842
|
+
return await x(), o({ selected: j }), j;
|
|
841
843
|
});
|
|
842
|
-
},
|
|
844
|
+
}, v = (p, j) => {
|
|
843
845
|
if (!e.update) {
|
|
844
846
|
const C = new Error(
|
|
845
847
|
`Resource "${e.name}" does not support update().`
|
|
846
848
|
);
|
|
847
849
|
return o({ operation: "idle", error: C }), Promise.reject(C);
|
|
848
850
|
}
|
|
849
|
-
return
|
|
850
|
-
const C = await e.update(
|
|
851
|
-
return await
|
|
851
|
+
return l("updating", async () => {
|
|
852
|
+
const C = await e.update(p, j);
|
|
853
|
+
return await x(), o({ selected: C }), C;
|
|
852
854
|
});
|
|
853
|
-
},
|
|
855
|
+
}, h = (p) => {
|
|
854
856
|
if (!e.delete) {
|
|
855
|
-
const
|
|
857
|
+
const j = new Error(
|
|
856
858
|
`Resource "${e.name}" does not support delete().`
|
|
857
859
|
);
|
|
858
|
-
return o({ operation: "idle", error:
|
|
860
|
+
return o({ operation: "idle", error: j }), Promise.reject(j);
|
|
859
861
|
}
|
|
860
|
-
return
|
|
861
|
-
await e.delete(
|
|
862
|
+
return l("deleting", async () => {
|
|
863
|
+
await e.delete(p), await x(), n.selected && String(n.selected.id) === String(p) && o({ selected: void 0 });
|
|
862
864
|
});
|
|
863
|
-
},
|
|
864
|
-
const
|
|
865
|
+
}, x = async () => {
|
|
866
|
+
const p = n.lastQuery ?? {}, j = await e.list(p);
|
|
865
867
|
o({
|
|
866
|
-
data:
|
|
867
|
-
total:
|
|
868
|
-
lastQuery:
|
|
868
|
+
data: j.data,
|
|
869
|
+
total: j.total,
|
|
870
|
+
lastQuery: p
|
|
869
871
|
});
|
|
870
872
|
};
|
|
871
873
|
return {
|
|
872
|
-
getState: () =>
|
|
873
|
-
list:
|
|
874
|
-
get:
|
|
875
|
-
create:
|
|
876
|
-
update:
|
|
877
|
-
remove:
|
|
878
|
-
refresh: () =>
|
|
879
|
-
select: (
|
|
874
|
+
getState: () => n,
|
|
875
|
+
list: d,
|
|
876
|
+
get: m,
|
|
877
|
+
create: f,
|
|
878
|
+
update: v,
|
|
879
|
+
remove: h,
|
|
880
|
+
refresh: () => d(n.lastQuery ?? {}),
|
|
881
|
+
select: (p) => o({ selected: p }),
|
|
880
882
|
clearSelection: () => o({ selected: void 0 }),
|
|
881
883
|
clearError: () => o({ error: void 0 }),
|
|
882
|
-
subscribe: (
|
|
884
|
+
subscribe: (p) => (a.add(p), () => a.delete(p))
|
|
883
885
|
};
|
|
884
886
|
}
|
|
885
|
-
function
|
|
887
|
+
function rt(e) {
|
|
886
888
|
let r = {
|
|
887
889
|
data: [],
|
|
888
890
|
columns: e.columns ?? [],
|
|
@@ -894,171 +896,155 @@ function Qe(e) {
|
|
|
894
896
|
search: "",
|
|
895
897
|
sort: void 0
|
|
896
898
|
};
|
|
897
|
-
const
|
|
898
|
-
r =
|
|
899
|
+
const n = /* @__PURE__ */ new Set(), a = () => n.forEach((f) => f()), s = (f) => {
|
|
900
|
+
r = f, a();
|
|
899
901
|
}, o = async () => {
|
|
900
|
-
const
|
|
901
|
-
s({ ...
|
|
902
|
+
const f = r;
|
|
903
|
+
s({ ...f, loading: !0, error: null });
|
|
902
904
|
try {
|
|
903
|
-
const
|
|
904
|
-
page:
|
|
905
|
-
pageSize:
|
|
906
|
-
search:
|
|
907
|
-
sort:
|
|
905
|
+
const v = await e.resource.list({
|
|
906
|
+
page: f.page,
|
|
907
|
+
pageSize: f.pageSize,
|
|
908
|
+
search: f.search || void 0,
|
|
909
|
+
sort: f.sort
|
|
908
910
|
});
|
|
909
|
-
if (r.page !==
|
|
911
|
+
if (r.page !== f.page || r.pageSize !== f.pageSize || r.search !== f.search || r.sort !== f.sort)
|
|
910
912
|
return;
|
|
911
913
|
s({
|
|
912
914
|
...r,
|
|
913
|
-
data:
|
|
914
|
-
columns: e.columns ??
|
|
915
|
-
total:
|
|
915
|
+
data: v.data,
|
|
916
|
+
columns: e.columns ?? Ke(v.data),
|
|
917
|
+
total: v.total,
|
|
916
918
|
loading: !1,
|
|
917
919
|
error: null
|
|
918
920
|
});
|
|
919
|
-
} catch (
|
|
920
|
-
if (r.page !==
|
|
921
|
+
} catch (v) {
|
|
922
|
+
if (r.page !== f.page || r.pageSize !== f.pageSize || r.search !== f.search || r.sort !== f.sort)
|
|
921
923
|
return;
|
|
922
924
|
s({
|
|
923
925
|
...r,
|
|
924
926
|
loading: !1,
|
|
925
|
-
error:
|
|
927
|
+
error: v instanceof Error ? v : new Error(String(v))
|
|
926
928
|
});
|
|
927
929
|
}
|
|
928
930
|
};
|
|
929
931
|
return {
|
|
930
932
|
getState: () => r,
|
|
931
933
|
load: o,
|
|
932
|
-
setSearch: async (
|
|
933
|
-
s({ ...r, search:
|
|
934
|
+
setSearch: async (f) => {
|
|
935
|
+
s({ ...r, search: f, page: 1 }), await o();
|
|
934
936
|
},
|
|
935
|
-
setPage: async (
|
|
936
|
-
!Number.isInteger(
|
|
937
|
+
setPage: async (f) => {
|
|
938
|
+
!Number.isInteger(f) || f < 1 || (s({ ...r, page: f }), await o());
|
|
937
939
|
},
|
|
938
|
-
setPageSize: async (
|
|
939
|
-
!Number.isInteger(
|
|
940
|
+
setPageSize: async (f) => {
|
|
941
|
+
!Number.isInteger(f) || f < 1 || (s({ ...r, pageSize: f, page: 1 }), await o());
|
|
940
942
|
},
|
|
941
|
-
setSort: async (
|
|
942
|
-
const
|
|
943
|
-
s({ ...r, sort: { field:
|
|
943
|
+
setSort: async (f) => {
|
|
944
|
+
const v = r.sort, h = v?.field === f && v.direction === "asc" ? "desc" : "asc";
|
|
945
|
+
s({ ...r, sort: { field: f, direction: h }, page: 1 }), await o();
|
|
944
946
|
},
|
|
945
947
|
reset: async () => {
|
|
946
948
|
s({ ...r, data: [], page: 1, search: "", sort: void 0, error: null }), await o();
|
|
947
949
|
},
|
|
948
|
-
subscribe: (
|
|
950
|
+
subscribe: (f) => (n.add(f), () => n.delete(f))
|
|
949
951
|
};
|
|
950
952
|
}
|
|
951
|
-
function
|
|
952
|
-
const r =
|
|
953
|
-
() =>
|
|
953
|
+
function nt(e) {
|
|
954
|
+
const r = I(
|
|
955
|
+
() => rt(e),
|
|
954
956
|
[e.resource, e.columns, e.pageSize]
|
|
955
|
-
),
|
|
957
|
+
), n = R(
|
|
956
958
|
(o) => r.subscribe(o),
|
|
957
959
|
[r]
|
|
958
|
-
),
|
|
960
|
+
), a = R(() => r.getState(), [r]), s = Z(n, a, a);
|
|
959
961
|
return { controller: r, state: s };
|
|
960
962
|
}
|
|
961
|
-
|
|
962
|
-
data: e,
|
|
963
|
-
columns: r,
|
|
964
|
-
emptyState: t = null,
|
|
965
|
-
caption: n,
|
|
966
|
-
...s
|
|
967
|
-
}) {
|
|
968
|
-
return /* @__PURE__ */ a.jsxs("table", { ...s, children: [
|
|
969
|
-
n !== void 0 ? /* @__PURE__ */ a.jsx("caption", { children: n }) : null,
|
|
970
|
-
/* @__PURE__ */ a.jsx("thead", { children: /* @__PURE__ */ a.jsx("tr", { children: r.map((o) => /* @__PURE__ */ a.jsx("th", { scope: "col", children: o.header ?? o.key }, o.key)) }) }),
|
|
971
|
-
/* @__PURE__ */ a.jsx("tbody", { children: e.length === 0 ? /* @__PURE__ */ a.jsx("tr", { children: /* @__PURE__ */ a.jsx("td", { colSpan: Math.max(r.length, 1), children: t }) }) : e.map((o, i) => /* @__PURE__ */ a.jsx("tr", { children: r.map((c) => {
|
|
972
|
-
const u = o[c.key];
|
|
973
|
-
return /* @__PURE__ */ a.jsx("td", { children: c.render ? c.render(u, o) : String(u ?? "") }, c.key);
|
|
974
|
-
}) }, String(o.id ?? i))) })
|
|
975
|
-
] });
|
|
976
|
-
}
|
|
977
|
-
class Ze extends Error {
|
|
963
|
+
class at extends Error {
|
|
978
964
|
status;
|
|
979
965
|
code;
|
|
980
966
|
details;
|
|
981
|
-
constructor(r,
|
|
982
|
-
super(
|
|
967
|
+
constructor(r, n) {
|
|
968
|
+
super(n?.message ?? `API request failed with status ${r}.`), this.name = "ApiError", this.status = r, this.code = n?.code, this.details = n?.details;
|
|
983
969
|
}
|
|
984
970
|
}
|
|
985
|
-
function
|
|
986
|
-
const
|
|
971
|
+
function st(e, r) {
|
|
972
|
+
const n = new URLSearchParams();
|
|
987
973
|
for (const [s, o] of Object.entries(r))
|
|
988
|
-
o != null && (typeof o == "object" ?
|
|
989
|
-
const
|
|
990
|
-
return
|
|
974
|
+
o != null && (typeof o == "object" ? n.set(s, JSON.stringify(o)) : n.set(s, String(o)));
|
|
975
|
+
const a = n.toString();
|
|
976
|
+
return a ? `${e}${e.includes("?") ? "&" : "?"}${a}` : e;
|
|
991
977
|
}
|
|
992
|
-
function
|
|
978
|
+
function je(e) {
|
|
993
979
|
return (e.headers.get("content-type") ?? "").toLowerCase().includes("application/json");
|
|
994
980
|
}
|
|
995
|
-
function
|
|
996
|
-
const r = async (
|
|
997
|
-
const s = await fetch(`${e}${
|
|
998
|
-
...
|
|
981
|
+
function tr(e = "") {
|
|
982
|
+
const r = async (n, a) => {
|
|
983
|
+
const s = await fetch(`${e}${n}`, {
|
|
984
|
+
...a,
|
|
999
985
|
headers: {
|
|
1000
986
|
Accept: "application/json",
|
|
1001
|
-
...
|
|
1002
|
-
...
|
|
987
|
+
...a?.body !== void 0 ? { "Content-Type": "application/json" } : {},
|
|
988
|
+
...a?.headers
|
|
1003
989
|
}
|
|
1004
990
|
});
|
|
1005
991
|
if (!s.ok) {
|
|
1006
992
|
let o;
|
|
1007
|
-
if (
|
|
993
|
+
if (je(s))
|
|
1008
994
|
try {
|
|
1009
995
|
o = await s.json();
|
|
1010
996
|
} catch {
|
|
1011
997
|
o = void 0;
|
|
1012
998
|
}
|
|
1013
|
-
throw new
|
|
999
|
+
throw new at(s.status, o);
|
|
1014
1000
|
}
|
|
1015
|
-
if (s.status !== 204 &&
|
|
1001
|
+
if (s.status !== 204 && je(s))
|
|
1016
1002
|
return await s.json();
|
|
1017
1003
|
};
|
|
1018
1004
|
return {
|
|
1019
1005
|
request: r,
|
|
1020
|
-
get: (
|
|
1021
|
-
post: (
|
|
1022
|
-
patch: (
|
|
1023
|
-
delete: (
|
|
1006
|
+
get: (n, a = {}) => r(st(n, a)),
|
|
1007
|
+
post: (n, a) => r(n, { method: "POST", body: JSON.stringify(a) }),
|
|
1008
|
+
patch: (n, a) => r(n, { method: "PATCH", body: JSON.stringify(a) }),
|
|
1009
|
+
delete: (n) => r(n, { method: "DELETE" })
|
|
1024
1010
|
};
|
|
1025
1011
|
}
|
|
1026
|
-
function
|
|
1027
|
-
const { client: r, path:
|
|
1012
|
+
function rr(e) {
|
|
1013
|
+
const { client: r, path: n } = e;
|
|
1028
1014
|
return {
|
|
1029
|
-
name:
|
|
1030
|
-
async list(
|
|
1031
|
-
return r.get(
|
|
1015
|
+
name: n.replace(/^\/+/, "").replace(/\/+$/, "") || "resource",
|
|
1016
|
+
async list(a = {}) {
|
|
1017
|
+
return r.get(n, a);
|
|
1032
1018
|
},
|
|
1033
|
-
get: (
|
|
1034
|
-
create: (
|
|
1035
|
-
update: (
|
|
1036
|
-
delete: async (
|
|
1037
|
-
await r.delete(`${
|
|
1019
|
+
get: (a) => r.get(`${n}/${encodeURIComponent(String(a))}`),
|
|
1020
|
+
create: (a) => r.post(n, a),
|
|
1021
|
+
update: (a, s) => r.patch(`${n}/${encodeURIComponent(String(a))}`, s),
|
|
1022
|
+
delete: async (a) => {
|
|
1023
|
+
await r.delete(`${n}/${encodeURIComponent(String(a))}`);
|
|
1038
1024
|
}
|
|
1039
1025
|
};
|
|
1040
1026
|
}
|
|
1041
|
-
function
|
|
1027
|
+
function ot({ resource: e }) {
|
|
1042
1028
|
let r = {
|
|
1043
1029
|
status: "idle",
|
|
1044
1030
|
error: null
|
|
1045
1031
|
};
|
|
1046
|
-
const
|
|
1047
|
-
r = i,
|
|
1032
|
+
const n = /* @__PURE__ */ new Set(), a = () => n.forEach((i) => i()), s = (i) => {
|
|
1033
|
+
r = i, a();
|
|
1048
1034
|
}, o = async (i) => {
|
|
1049
1035
|
s({ ...r, status: "loading", error: null });
|
|
1050
1036
|
try {
|
|
1051
|
-
const
|
|
1037
|
+
const l = await i();
|
|
1052
1038
|
return s({
|
|
1053
1039
|
status: "success",
|
|
1054
|
-
data:
|
|
1040
|
+
data: l && typeof l == "object" ? l : r.data,
|
|
1055
1041
|
error: null
|
|
1056
|
-
}),
|
|
1057
|
-
} catch (
|
|
1042
|
+
}), l;
|
|
1043
|
+
} catch (l) {
|
|
1058
1044
|
s({
|
|
1059
1045
|
...r,
|
|
1060
1046
|
status: "error",
|
|
1061
|
-
error:
|
|
1047
|
+
error: l instanceof Error ? l : new Error(String(l))
|
|
1062
1048
|
});
|
|
1063
1049
|
return;
|
|
1064
1050
|
}
|
|
@@ -1068,247 +1054,491 @@ function Xe({ resource: e }) {
|
|
|
1068
1054
|
get: (i) => o(() => e.get(i)),
|
|
1069
1055
|
create: async (i) => {
|
|
1070
1056
|
if (!e.create) {
|
|
1071
|
-
const
|
|
1072
|
-
s({ ...r, status: "error", error:
|
|
1057
|
+
const l = new Error(`Resource "${e.name}" does not support create.`);
|
|
1058
|
+
s({ ...r, status: "error", error: l });
|
|
1073
1059
|
return;
|
|
1074
1060
|
}
|
|
1075
1061
|
return o(() => e.create(i));
|
|
1076
1062
|
},
|
|
1077
|
-
update: async (i,
|
|
1063
|
+
update: async (i, l) => {
|
|
1078
1064
|
if (!e.update) {
|
|
1079
|
-
const
|
|
1080
|
-
s({ ...r, status: "error", error:
|
|
1065
|
+
const c = new Error(`Resource "${e.name}" does not support update.`);
|
|
1066
|
+
s({ ...r, status: "error", error: c });
|
|
1081
1067
|
return;
|
|
1082
1068
|
}
|
|
1083
|
-
return o(() => e.update(i,
|
|
1069
|
+
return o(() => e.update(i, l));
|
|
1084
1070
|
},
|
|
1085
1071
|
remove: async (i) => {
|
|
1086
1072
|
if (!e.delete) {
|
|
1087
|
-
const
|
|
1088
|
-
return s({ ...r, status: "error", error:
|
|
1073
|
+
const c = new Error(`Resource "${e.name}" does not support delete.`);
|
|
1074
|
+
return s({ ...r, status: "error", error: c }), !1;
|
|
1089
1075
|
}
|
|
1090
1076
|
return await o(async () => (await e.delete(i), !0)) === !0;
|
|
1091
1077
|
},
|
|
1092
1078
|
reset: () => s({ status: "idle", error: null }),
|
|
1093
|
-
subscribe: (i) => (
|
|
1079
|
+
subscribe: (i) => (n.add(i), () => n.delete(i))
|
|
1094
1080
|
};
|
|
1095
1081
|
}
|
|
1096
|
-
function
|
|
1097
|
-
const r =
|
|
1082
|
+
function nr(e) {
|
|
1083
|
+
const r = A(null);
|
|
1098
1084
|
(!r.current || r.current.resource !== e) && (r.current = {
|
|
1099
1085
|
resource: e,
|
|
1100
|
-
controller:
|
|
1086
|
+
controller: ot({ resource: e })
|
|
1101
1087
|
});
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1088
|
+
const n = r.current.controller, a = Z(
|
|
1089
|
+
n.subscribe,
|
|
1090
|
+
n.getState,
|
|
1091
|
+
n.getState
|
|
1106
1092
|
);
|
|
1107
1093
|
return {
|
|
1108
|
-
...
|
|
1109
|
-
...
|
|
1094
|
+
...n,
|
|
1095
|
+
...a
|
|
1110
1096
|
};
|
|
1111
1097
|
}
|
|
1112
|
-
function
|
|
1113
|
-
const r =
|
|
1098
|
+
function it(e) {
|
|
1099
|
+
const r = A(null);
|
|
1114
1100
|
(!r.current || r.current.resource !== e) && (r.current = {
|
|
1115
1101
|
resource: e,
|
|
1116
|
-
controller:
|
|
1102
|
+
controller: tt(e)
|
|
1117
1103
|
});
|
|
1118
|
-
const
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
), s =
|
|
1123
|
-
(
|
|
1124
|
-
[
|
|
1125
|
-
), o =
|
|
1126
|
-
(
|
|
1127
|
-
[
|
|
1128
|
-
),
|
|
1104
|
+
const n = r.current.controller, a = Z(
|
|
1105
|
+
n.subscribe,
|
|
1106
|
+
n.getState,
|
|
1107
|
+
n.getState
|
|
1108
|
+
), s = R(
|
|
1109
|
+
(h) => n.list(h),
|
|
1110
|
+
[n]
|
|
1111
|
+
), o = R((h) => n.get(h), [n]), i = R((h) => n.create(h), [n]), l = R(
|
|
1112
|
+
(h, x) => n.update(h, x),
|
|
1113
|
+
[n]
|
|
1114
|
+
), c = R((h) => n.remove(h), [n]), d = R(() => n.refresh(), [n]), m = R((h) => n.select(h), [n]), f = R(() => n.clearSelection(), [n]), v = R(() => n.clearError(), [n]);
|
|
1129
1115
|
return {
|
|
1130
|
-
...t,
|
|
1131
1116
|
...n,
|
|
1117
|
+
...a,
|
|
1132
1118
|
list: s,
|
|
1133
1119
|
get: o,
|
|
1134
1120
|
create: i,
|
|
1135
|
-
update:
|
|
1136
|
-
remove:
|
|
1137
|
-
refresh:
|
|
1138
|
-
select:
|
|
1139
|
-
clearSelection:
|
|
1140
|
-
clearError:
|
|
1121
|
+
update: l,
|
|
1122
|
+
remove: c,
|
|
1123
|
+
refresh: d,
|
|
1124
|
+
select: m,
|
|
1125
|
+
clearSelection: f,
|
|
1126
|
+
clearError: v
|
|
1141
1127
|
};
|
|
1142
1128
|
}
|
|
1143
|
-
function
|
|
1129
|
+
function ar({ children: e, columns: r = 1, gap: n, ...a }) {
|
|
1144
1130
|
const s = typeof r == "number" ? "repeat(" + r + ", minmax(0, 1fr))" : r;
|
|
1145
|
-
return /* @__PURE__ */
|
|
1131
|
+
return /* @__PURE__ */ t.jsx("div", { ...a, style: { display: "grid", gridTemplateColumns: s, gap: n, ...a.style }, children: e });
|
|
1146
1132
|
}
|
|
1147
|
-
function
|
|
1148
|
-
return /* @__PURE__ */
|
|
1133
|
+
function sr({ children: e, direction: r = "column", gap: n, ...a }) {
|
|
1134
|
+
return /* @__PURE__ */ t.jsx("div", { ...a, "data-direction": r, style: { display: "flex", flexDirection: r, gap: n, ...a.style }, children: e });
|
|
1149
1135
|
}
|
|
1150
|
-
function
|
|
1136
|
+
function lt({
|
|
1151
1137
|
label: e = "Loading…",
|
|
1152
1138
|
"aria-label": r,
|
|
1153
|
-
...
|
|
1139
|
+
...n
|
|
1154
1140
|
}) {
|
|
1155
|
-
const
|
|
1156
|
-
return /* @__PURE__ */
|
|
1141
|
+
const a = r ?? (typeof e == "string" || typeof e == "number" ? String(e) : void 0);
|
|
1142
|
+
return /* @__PURE__ */ t.jsx(
|
|
1157
1143
|
"div",
|
|
1158
1144
|
{
|
|
1159
|
-
...
|
|
1145
|
+
...n,
|
|
1160
1146
|
role: "status",
|
|
1161
|
-
"aria-label":
|
|
1147
|
+
"aria-label": a,
|
|
1162
1148
|
"aria-live": "polite",
|
|
1163
1149
|
"aria-busy": "true",
|
|
1164
1150
|
children: e
|
|
1165
1151
|
}
|
|
1166
1152
|
);
|
|
1167
1153
|
}
|
|
1168
|
-
function
|
|
1154
|
+
function ct({ icon: e, label: r, className: n, type: a = "button", onClick: s, ...o }) {
|
|
1155
|
+
return /* @__PURE__ */ t.jsx(
|
|
1156
|
+
"button",
|
|
1157
|
+
{
|
|
1158
|
+
...o,
|
|
1159
|
+
type: a,
|
|
1160
|
+
className: ["fsc-ohm-table__action", n].filter(Boolean).join(" "),
|
|
1161
|
+
"aria-label": o["aria-label"] ?? r,
|
|
1162
|
+
title: o.title ?? r,
|
|
1163
|
+
onClick: (i) => {
|
|
1164
|
+
i.stopPropagation(), s?.(i);
|
|
1165
|
+
},
|
|
1166
|
+
children: e
|
|
1167
|
+
}
|
|
1168
|
+
);
|
|
1169
|
+
}
|
|
1170
|
+
function de({ children: e }) {
|
|
1171
|
+
return /* @__PURE__ */ t.jsx("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: e });
|
|
1172
|
+
}
|
|
1173
|
+
const dt = [
|
|
1174
|
+
{ id: "edit", label: "Upraviť", icon: /* @__PURE__ */ t.jsxs(de, { children: [
|
|
1175
|
+
/* @__PURE__ */ t.jsx("path", { d: "M12 20h9" }),
|
|
1176
|
+
/* @__PURE__ */ t.jsx("path", { d: "M16.5 3.5a2.12 2.12 0 0 1 3 3L8 18l-4 1 1-4Z" })
|
|
1177
|
+
] }) },
|
|
1178
|
+
{ id: "share", label: "Zdieľať", icon: /* @__PURE__ */ t.jsxs(de, { children: [
|
|
1179
|
+
/* @__PURE__ */ t.jsx("circle", { cx: "18", cy: "5", r: "2" }),
|
|
1180
|
+
/* @__PURE__ */ t.jsx("circle", { cx: "6", cy: "12", r: "2" }),
|
|
1181
|
+
/* @__PURE__ */ t.jsx("circle", { cx: "18", cy: "19", r: "2" }),
|
|
1182
|
+
/* @__PURE__ */ t.jsx("path", { d: "m8 11 8-5" }),
|
|
1183
|
+
/* @__PURE__ */ t.jsx("path", { d: "m8 13 8 5" })
|
|
1184
|
+
] }) },
|
|
1185
|
+
{ id: "delete", label: "Vymazať", icon: /* @__PURE__ */ t.jsxs(de, { children: [
|
|
1186
|
+
/* @__PURE__ */ t.jsx("path", { d: "M4 7h16" }),
|
|
1187
|
+
/* @__PURE__ */ t.jsx("path", { d: "M10 11v6" }),
|
|
1188
|
+
/* @__PURE__ */ t.jsx("path", { d: "M14 11v6" }),
|
|
1189
|
+
/* @__PURE__ */ t.jsx("path", { d: "M6 7l1 13h10l1-13" }),
|
|
1190
|
+
/* @__PURE__ */ t.jsx("path", { d: "M9 7V4h6v3" })
|
|
1191
|
+
] }) }
|
|
1192
|
+
];
|
|
1193
|
+
function ut({ row: e, actions: r = dt, className: n }) {
|
|
1194
|
+
return /* @__PURE__ */ t.jsx("div", { className: ["fsc-ohm-table__actions", n].filter(Boolean).join(" "), children: r.map(({ id: a, onClick: s, ...o }) => /* @__PURE__ */ t.jsx(ct, { ...o, onClick: () => s?.(e) }, a)) });
|
|
1195
|
+
}
|
|
1196
|
+
function ft({ children: e, className: r }) {
|
|
1197
|
+
return /* @__PURE__ */ t.jsx("tbody", { className: r, children: e });
|
|
1198
|
+
}
|
|
1199
|
+
function re({ children: e, className: r, colSpan: n }) {
|
|
1200
|
+
return /* @__PURE__ */ t.jsx("td", { className: r, colSpan: n, children: e });
|
|
1201
|
+
}
|
|
1202
|
+
function mt({ colSpan: e, children: r }) {
|
|
1203
|
+
return /* @__PURE__ */ t.jsx("tr", { className: "fsc-ohm-table__state-row", children: /* @__PURE__ */ t.jsx("td", { colSpan: e, children: r }) });
|
|
1204
|
+
}
|
|
1205
|
+
function ht({ colSpan: e, children: r }) {
|
|
1206
|
+
return /* @__PURE__ */ t.jsx("tr", { className: "fsc-ohm-table__state-row fsc-ohm-table__state-row--error", children: /* @__PURE__ */ t.jsx("td", { colSpan: e, children: r }) });
|
|
1207
|
+
}
|
|
1208
|
+
function pt({ children: e, className: r }) {
|
|
1209
|
+
return /* @__PURE__ */ t.jsx("thead", { className: r, children: e });
|
|
1210
|
+
}
|
|
1211
|
+
function bt({ direction: e }) {
|
|
1212
|
+
return /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-table__sort-icon", "aria-hidden": "true", children: /* @__PURE__ */ t.jsx("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: e === "asc" ? /* @__PURE__ */ t.jsx("path", { d: "m4 10 4-4 4 4" }) : e === "desc" ? /* @__PURE__ */ t.jsx("path", { d: "m4 6 4 4 4-4" }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
1213
|
+
/* @__PURE__ */ t.jsx("path", { d: "m4 6 4-3 4 3" }),
|
|
1214
|
+
/* @__PURE__ */ t.jsx("path", { d: "m4 10 4 3 4-3" })
|
|
1215
|
+
] }) }) });
|
|
1216
|
+
}
|
|
1217
|
+
function xt({ direction: e, onClick: r, children: n }) {
|
|
1218
|
+
return /* @__PURE__ */ t.jsxs("button", { type: "button", className: "fsc-ohm-table__sort", onClick: r, "aria-label": "Zoradiť", children: [
|
|
1219
|
+
/* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-table__sort-label", children: n }),
|
|
1220
|
+
/* @__PURE__ */ t.jsx(bt, { direction: e })
|
|
1221
|
+
] });
|
|
1222
|
+
}
|
|
1223
|
+
function ne({ children: e, sortable: r = !1, sortDirection: n, onSort: a, scope: s = "col", className: o }) {
|
|
1224
|
+
return /* @__PURE__ */ t.jsx("th", { scope: s, className: o, children: r ? /* @__PURE__ */ t.jsx(xt, { direction: n, onClick: a, children: e }) : e });
|
|
1225
|
+
}
|
|
1226
|
+
function vt({ colSpan: e, rows: r = 3 }) {
|
|
1227
|
+
return /* @__PURE__ */ t.jsx(t.Fragment, { children: Array.from({ length: r }, (n, a) => /* @__PURE__ */ t.jsx("tr", { className: "fsc-ohm-table__state-row", "aria-busy": "true", children: /* @__PURE__ */ t.jsx("td", { colSpan: e, children: /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-table__skeleton" }) }) }, a)) });
|
|
1228
|
+
}
|
|
1229
|
+
function jt({ page: e, pageCount: r, onPageChange: n }) {
|
|
1230
|
+
return r > 1 ? /* @__PURE__ */ t.jsxs("nav", { className: "fsc-ohm-table__pagination", "aria-label": "Stránkovanie", children: [
|
|
1231
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", disabled: e <= 1, onClick: () => n?.(e - 1), children: "Predchádzajúca" }),
|
|
1232
|
+
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
1233
|
+
"Strana ",
|
|
1234
|
+
e,
|
|
1235
|
+
" / ",
|
|
1236
|
+
r
|
|
1237
|
+
] }),
|
|
1238
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", disabled: e >= r, onClick: () => n?.(e + 1), children: "Ďalšia" })
|
|
1239
|
+
] }) : null;
|
|
1240
|
+
}
|
|
1241
|
+
function gt({ children: e, className: r, selected: n = !1, onClick: a }) {
|
|
1242
|
+
const s = (o) => {
|
|
1243
|
+
a && (o.key !== "Enter" && o.key !== " " || (o.preventDefault(), a()));
|
|
1244
|
+
};
|
|
1245
|
+
return /* @__PURE__ */ t.jsx(
|
|
1246
|
+
"tr",
|
|
1247
|
+
{
|
|
1248
|
+
className: ["fsc-ohm-table__row", r].filter(Boolean).join(" "),
|
|
1249
|
+
"data-selected": n || void 0,
|
|
1250
|
+
"data-clickable": a ? !0 : void 0,
|
|
1251
|
+
tabIndex: a ? 0 : void 0,
|
|
1252
|
+
onClick: a,
|
|
1253
|
+
onKeyDown: s,
|
|
1254
|
+
children: e
|
|
1255
|
+
}
|
|
1256
|
+
);
|
|
1257
|
+
}
|
|
1258
|
+
function yt({ children: e, className: r }) {
|
|
1259
|
+
return /* @__PURE__ */ t.jsx("div", { className: ["fsc-ohm-table__row-actions", r].filter(Boolean).join(" "), children: e });
|
|
1260
|
+
}
|
|
1261
|
+
function ge({ checked: e = !1, onChange: r, disabled: n = !1, "aria-label": a = "Vybrať riadok" }) {
|
|
1262
|
+
return /* @__PURE__ */ t.jsx("input", { type: "checkbox", checked: e, disabled: n, "aria-label": a, onChange: (s) => r?.(s.target.checked) });
|
|
1263
|
+
}
|
|
1264
|
+
function _t(e, r) {
|
|
1265
|
+
const n = e.id;
|
|
1266
|
+
return n == null ? String(r) : String(n);
|
|
1267
|
+
}
|
|
1268
|
+
function St({
|
|
1269
|
+
data: e,
|
|
1270
|
+
columns: r,
|
|
1271
|
+
caption: n,
|
|
1272
|
+
sortable: a = !1,
|
|
1273
|
+
pagination: s = !1,
|
|
1274
|
+
pageSize: o = 10,
|
|
1275
|
+
actions: i = !1,
|
|
1276
|
+
actionItems: l,
|
|
1277
|
+
selectable: c = !1,
|
|
1278
|
+
selectedRowIds: d,
|
|
1279
|
+
getRowId: m = _t,
|
|
1280
|
+
onSelectionChange: f,
|
|
1281
|
+
onRowClick: v,
|
|
1282
|
+
renderRowActions: h,
|
|
1283
|
+
renderExpandedRow: x,
|
|
1284
|
+
loading: b = !1,
|
|
1285
|
+
emptyState: p,
|
|
1286
|
+
error: j,
|
|
1287
|
+
className: C
|
|
1288
|
+
}) {
|
|
1289
|
+
const [T, oe] = w(null), [ie, q] = w(1), [le, K] = w([]), [V, ce] = w([]), F = d ?? le, U = i || !!h, D = !!x, $ = Math.max(1, o), Q = I(() => T ? [...e].sort((g, S) => {
|
|
1290
|
+
const _ = g[T.key], k = S[T.key];
|
|
1291
|
+
if (_ == null && k == null) return 0;
|
|
1292
|
+
if (_ == null) return 1;
|
|
1293
|
+
if (k == null) return -1;
|
|
1294
|
+
const O = String(_).localeCompare(String(k), void 0, {
|
|
1295
|
+
numeric: !0,
|
|
1296
|
+
sensitivity: "base"
|
|
1297
|
+
});
|
|
1298
|
+
return T.direction === "asc" ? O : -O;
|
|
1299
|
+
}) : e, [e, T]), W = s ? Math.max(1, Math.ceil(Q.length / $)) : 1, L = Math.min(ie, W), B = s ? Q.slice((L - 1) * $, L * $) : Q, Y = r.length + Number(c) + Number(U) + Number(D), X = (g) => {
|
|
1300
|
+
!a || g.sortable === !1 || (oe((S) => !S || S.key !== g.key ? { key: g.key, direction: "asc" } : S.direction === "asc" ? { key: g.key, direction: "desc" } : null), q(1));
|
|
1301
|
+
}, ee = (g, S) => {
|
|
1302
|
+
const _ = S ? [...F, g] : F.filter((k) => k !== g);
|
|
1303
|
+
d === void 0 && K(_), f?.(_, e.filter((k, O) => _.includes(m(k, O))));
|
|
1304
|
+
}, u = B.map(
|
|
1305
|
+
(g, S) => m(g, (L - 1) * $ + S)
|
|
1306
|
+
), y = u.length > 0 && u.every((g) => F.includes(g)), N = (g) => {
|
|
1307
|
+
const S = g ? Array.from(/* @__PURE__ */ new Set([...F, ...u])) : F.filter((_) => !u.includes(_));
|
|
1308
|
+
d === void 0 && K(S), f?.(S, e.filter((_, k) => S.includes(m(_, k))));
|
|
1309
|
+
}, E = (g) => {
|
|
1310
|
+
ce(
|
|
1311
|
+
(S) => S.includes(g) ? S.filter((_) => _ !== g) : [...S, g]
|
|
1312
|
+
);
|
|
1313
|
+
};
|
|
1314
|
+
return /* @__PURE__ */ t.jsxs("div", { className: ["fsc-ohm-table__container", C].filter(Boolean).join(" "), children: [
|
|
1315
|
+
/* @__PURE__ */ t.jsxs("table", { className: "fsc-ohm-table", children: [
|
|
1316
|
+
n && /* @__PURE__ */ t.jsx("caption", { className: "fsc-ohm-table__caption", children: n }),
|
|
1317
|
+
/* @__PURE__ */ t.jsxs("colgroup", { children: [
|
|
1318
|
+
U && /* @__PURE__ */ t.jsx("col", { style: { width: "8.5rem" } }),
|
|
1319
|
+
D && /* @__PURE__ */ t.jsx("col", { style: { width: "3rem" } }),
|
|
1320
|
+
c && /* @__PURE__ */ t.jsx("col", { style: { width: "3rem" } }),
|
|
1321
|
+
r.map((g) => /* @__PURE__ */ t.jsx("col", { style: g.width ? { width: g.width } : void 0 }, g.key))
|
|
1322
|
+
] }),
|
|
1323
|
+
/* @__PURE__ */ t.jsx(pt, { children: /* @__PURE__ */ t.jsxs("tr", { children: [
|
|
1324
|
+
U && /* @__PURE__ */ t.jsx(ne, { className: "fsc-ohm-table__actions-header", scope: "col", children: "Akcie" }),
|
|
1325
|
+
D && /* @__PURE__ */ t.jsx(ne, { scope: "col", children: "Rozbaliť" }),
|
|
1326
|
+
c && /* @__PURE__ */ t.jsx(ne, { scope: "col", children: /* @__PURE__ */ t.jsx(
|
|
1327
|
+
ge,
|
|
1328
|
+
{
|
|
1329
|
+
checked: y,
|
|
1330
|
+
onChange: N,
|
|
1331
|
+
"aria-label": "Vybrať všetky riadky"
|
|
1332
|
+
}
|
|
1333
|
+
) }),
|
|
1334
|
+
r.map((g) => /* @__PURE__ */ t.jsx(
|
|
1335
|
+
ne,
|
|
1336
|
+
{
|
|
1337
|
+
scope: "col",
|
|
1338
|
+
sortable: a && g.sortable !== !1,
|
|
1339
|
+
sortDirection: T?.key === g.key ? T.direction : void 0,
|
|
1340
|
+
onSort: () => X(g),
|
|
1341
|
+
children: g.header
|
|
1342
|
+
},
|
|
1343
|
+
g.key
|
|
1344
|
+
))
|
|
1345
|
+
] }) }),
|
|
1346
|
+
/* @__PURE__ */ t.jsx(ft, { children: b ? /* @__PURE__ */ t.jsx(vt, { colSpan: Y }) : j ? /* @__PURE__ */ t.jsx(ht, { colSpan: Y, children: j }) : B.length === 0 ? /* @__PURE__ */ t.jsx(mt, { colSpan: Y, children: p ?? "Žiadne záznamy." }) : B.map((g, S) => {
|
|
1347
|
+
const _ = s ? (L - 1) * $ + S : S, k = m(g, _), O = V.includes(k);
|
|
1348
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1349
|
+
gt,
|
|
1350
|
+
{
|
|
1351
|
+
selected: F.includes(k),
|
|
1352
|
+
onClick: v ? () => v(g) : void 0,
|
|
1353
|
+
children: [
|
|
1354
|
+
U && /* @__PURE__ */ t.jsxs(re, { className: "fsc-ohm-table__actions-cell", children: [
|
|
1355
|
+
/* @__PURE__ */ t.jsx(ut, { row: g, actions: l }),
|
|
1356
|
+
h ? /* @__PURE__ */ t.jsx(yt, { children: h(g) }) : null
|
|
1357
|
+
] }),
|
|
1358
|
+
D && /* @__PURE__ */ t.jsx(re, { children: /* @__PURE__ */ t.jsx(
|
|
1359
|
+
"button",
|
|
1360
|
+
{
|
|
1361
|
+
type: "button",
|
|
1362
|
+
className: "fsc-ohm-table__icon-button",
|
|
1363
|
+
onClick: (z) => {
|
|
1364
|
+
z.stopPropagation(), E(k);
|
|
1365
|
+
},
|
|
1366
|
+
"aria-expanded": O,
|
|
1367
|
+
"aria-label": O ? "Zbaliť riadok" : "Rozbaliť riadok",
|
|
1368
|
+
children: O ? "−" : "+"
|
|
1369
|
+
}
|
|
1370
|
+
) }),
|
|
1371
|
+
c && /* @__PURE__ */ t.jsx(re, { children: /* @__PURE__ */ t.jsx(
|
|
1372
|
+
ge,
|
|
1373
|
+
{
|
|
1374
|
+
checked: F.includes(k),
|
|
1375
|
+
onChange: (z) => ee(k, z),
|
|
1376
|
+
"aria-label": `Vybrať riadok ${k}`
|
|
1377
|
+
}
|
|
1378
|
+
) }),
|
|
1379
|
+
r.map((z) => /* @__PURE__ */ t.jsx(re, { children: z.render ? z.render(g[z.key], g) : String(g[z.key] ?? "—") }, z.key))
|
|
1380
|
+
]
|
|
1381
|
+
},
|
|
1382
|
+
k
|
|
1383
|
+
);
|
|
1384
|
+
}) })
|
|
1385
|
+
] }),
|
|
1386
|
+
B.some(
|
|
1387
|
+
(g, S) => x && V.includes(m(g, (L - 1) * $ + S))
|
|
1388
|
+
) && /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-table__expanded-content", children: B.map((g, S) => {
|
|
1389
|
+
const _ = m(g, (L - 1) * $ + S);
|
|
1390
|
+
return V.includes(_) ? /* @__PURE__ */ t.jsx("div", { children: x?.(g) }, _) : null;
|
|
1391
|
+
}) }),
|
|
1392
|
+
s && !b && !j && /* @__PURE__ */ t.jsx(jt, { page: L, pageCount: W, onPageChange: q })
|
|
1393
|
+
] });
|
|
1394
|
+
}
|
|
1395
|
+
function wt({
|
|
1169
1396
|
resource: e,
|
|
1170
1397
|
columns: r,
|
|
1171
|
-
pageSize:
|
|
1172
|
-
emptyState:
|
|
1398
|
+
pageSize: n,
|
|
1399
|
+
emptyState: a = "No records.",
|
|
1173
1400
|
reloadKey: s,
|
|
1174
1401
|
className: o,
|
|
1175
1402
|
...i
|
|
1176
1403
|
}) {
|
|
1177
|
-
const { controller:
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1404
|
+
const { controller: l, state: c } = nt({ resource: e, columns: r, pageSize: n }), d = c.columns.map((m) => ({
|
|
1405
|
+
...m,
|
|
1406
|
+
header: m.header ?? m.key
|
|
1407
|
+
}));
|
|
1408
|
+
return P(() => {
|
|
1409
|
+
l.load();
|
|
1410
|
+
}, [l, s]), /* @__PURE__ */ t.jsx(
|
|
1411
|
+
St,
|
|
1182
1412
|
{
|
|
1183
1413
|
...i,
|
|
1184
1414
|
className: o ? `fsc-resource-table ${o}` : "fsc-resource-table",
|
|
1185
|
-
data:
|
|
1186
|
-
columns:
|
|
1187
|
-
emptyState:
|
|
1415
|
+
data: c.data,
|
|
1416
|
+
columns: d,
|
|
1417
|
+
emptyState: c.loading ? /* @__PURE__ */ t.jsx(lt, {}) : c.error?.message ?? a
|
|
1188
1418
|
}
|
|
1189
1419
|
);
|
|
1190
1420
|
}
|
|
1191
|
-
const
|
|
1421
|
+
const Nt = [
|
|
1192
1422
|
{ id: "1", name: "Phone", price: 499 },
|
|
1193
1423
|
{ id: "2", name: "Vacuum", price: 299 },
|
|
1194
1424
|
{ id: "3", name: "Tablet", price: 349 }
|
|
1195
|
-
],
|
|
1196
|
-
function
|
|
1197
|
-
return e ? { name: e.name, price: String(e.price) } :
|
|
1425
|
+
], kt = { name: "", price: "" };
|
|
1426
|
+
function Et(e) {
|
|
1427
|
+
return e ? { name: e.name, price: String(e.price) } : kt;
|
|
1198
1428
|
}
|
|
1199
|
-
function
|
|
1429
|
+
function Ct({
|
|
1200
1430
|
store: e,
|
|
1201
1431
|
operation: r,
|
|
1202
|
-
controllerError:
|
|
1203
|
-
editing:
|
|
1432
|
+
controllerError: n,
|
|
1433
|
+
editing: a,
|
|
1204
1434
|
onSuccess: s,
|
|
1205
1435
|
onCancel: o
|
|
1206
1436
|
}) {
|
|
1207
|
-
const i =
|
|
1208
|
-
return /* @__PURE__ */
|
|
1437
|
+
const i = Ge(), l = i.submitting || r === "creating" || r === "updating";
|
|
1438
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1209
1439
|
"form",
|
|
1210
1440
|
{
|
|
1211
1441
|
className: "fsc-crud-example__editor",
|
|
1212
|
-
onSubmit: async (
|
|
1213
|
-
|
|
1442
|
+
onSubmit: async (c) => {
|
|
1443
|
+
c.preventDefault(), await e.submit() && s();
|
|
1214
1444
|
},
|
|
1215
|
-
onReset: (
|
|
1216
|
-
|
|
1445
|
+
onReset: (c) => {
|
|
1446
|
+
c.preventDefault(), e.reset();
|
|
1217
1447
|
},
|
|
1218
1448
|
children: [
|
|
1219
|
-
/* @__PURE__ */
|
|
1220
|
-
/* @__PURE__ */
|
|
1221
|
-
/* @__PURE__ */
|
|
1222
|
-
/* @__PURE__ */
|
|
1449
|
+
/* @__PURE__ */ t.jsx("strong", { children: a ? "Upraviť záznam" : "Nový záznam" }),
|
|
1450
|
+
/* @__PURE__ */ t.jsx(ve, { name: "name", children: (c) => /* @__PURE__ */ t.jsxs("label", { className: "fsc-crud-example__field", children: [
|
|
1451
|
+
/* @__PURE__ */ t.jsx("span", { children: "Názov" }),
|
|
1452
|
+
/* @__PURE__ */ t.jsx(
|
|
1223
1453
|
"input",
|
|
1224
1454
|
{
|
|
1225
|
-
value:
|
|
1226
|
-
onChange: (
|
|
1227
|
-
onBlur: () =>
|
|
1228
|
-
disabled:
|
|
1229
|
-
"aria-invalid":
|
|
1455
|
+
value: c.value,
|
|
1456
|
+
onChange: (d) => c.setValue(d.target.value),
|
|
1457
|
+
onBlur: () => c.setTouched(),
|
|
1458
|
+
disabled: l,
|
|
1459
|
+
"aria-invalid": c.error ? !0 : void 0
|
|
1230
1460
|
}
|
|
1231
1461
|
),
|
|
1232
|
-
|
|
1462
|
+
c.error ? /* @__PURE__ */ t.jsx("small", { role: "alert", children: c.error }) : null
|
|
1233
1463
|
] }) }),
|
|
1234
|
-
/* @__PURE__ */
|
|
1235
|
-
/* @__PURE__ */
|
|
1236
|
-
/* @__PURE__ */
|
|
1464
|
+
/* @__PURE__ */ t.jsx(ve, { name: "price", children: (c) => /* @__PURE__ */ t.jsxs("label", { className: "fsc-crud-example__field", children: [
|
|
1465
|
+
/* @__PURE__ */ t.jsx("span", { children: "Cena (€)" }),
|
|
1466
|
+
/* @__PURE__ */ t.jsx(
|
|
1237
1467
|
"input",
|
|
1238
1468
|
{
|
|
1239
1469
|
type: "number",
|
|
1240
1470
|
min: "0",
|
|
1241
1471
|
step: "0.01",
|
|
1242
|
-
value:
|
|
1243
|
-
onChange: (
|
|
1244
|
-
onBlur: () =>
|
|
1245
|
-
disabled:
|
|
1246
|
-
"aria-invalid":
|
|
1472
|
+
value: c.value,
|
|
1473
|
+
onChange: (d) => c.setValue(d.target.value),
|
|
1474
|
+
onBlur: () => c.setTouched(),
|
|
1475
|
+
disabled: l,
|
|
1476
|
+
"aria-invalid": c.error ? !0 : void 0
|
|
1247
1477
|
}
|
|
1248
1478
|
),
|
|
1249
|
-
|
|
1479
|
+
c.error ? /* @__PURE__ */ t.jsx("small", { role: "alert", children: c.error }) : null
|
|
1250
1480
|
] }) }),
|
|
1251
|
-
|
|
1252
|
-
i.submitError && !
|
|
1253
|
-
/* @__PURE__ */
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
/* @__PURE__ */
|
|
1256
|
-
/* @__PURE__ */
|
|
1257
|
-
|
|
1481
|
+
n ? /* @__PURE__ */ t.jsx("small", { role: "alert", children: n.message }) : null,
|
|
1482
|
+
i.submitError && !n ? /* @__PURE__ */ t.jsx("small", { role: "alert", children: i.submitError }) : null,
|
|
1483
|
+
/* @__PURE__ */ t.jsxs("div", { className: "fsc-crud-example__actions", children: [
|
|
1484
|
+
/* @__PURE__ */ t.jsx(He, { disabled: l, children: r === "creating" ? "Vytváram…" : r === "updating" ? "Ukladám…" : a ? "Uložiť zmeny" : "Vytvoriť" }),
|
|
1485
|
+
/* @__PURE__ */ t.jsx(qe, { disabled: l, children: "Reset" }),
|
|
1486
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", onClick: o, disabled: l, children: "Zrušiť" }),
|
|
1487
|
+
l ? /* @__PURE__ */ t.jsx("span", { "aria-live": "polite", children: "Spracovávam…" }) : null
|
|
1258
1488
|
] })
|
|
1259
1489
|
]
|
|
1260
1490
|
}
|
|
1261
1491
|
);
|
|
1262
1492
|
}
|
|
1263
|
-
function
|
|
1264
|
-
return /* @__PURE__ */
|
|
1493
|
+
function Tt(e) {
|
|
1494
|
+
return /* @__PURE__ */ t.jsx(ke, { store: e.store, children: /* @__PURE__ */ t.jsx(Ct, { ...e }) });
|
|
1265
1495
|
}
|
|
1266
|
-
function
|
|
1267
|
-
const r =
|
|
1268
|
-
() =>
|
|
1496
|
+
function or({ onEvent: e } = {}) {
|
|
1497
|
+
const r = I(
|
|
1498
|
+
() => et("crud-example", Nt),
|
|
1269
1499
|
[]
|
|
1270
|
-
),
|
|
1500
|
+
), n = it(r), [a, s] = w(!1), [o, i] = w(), [l, c] = w(0), d = R(() => {
|
|
1271
1501
|
i(void 0), s(!0);
|
|
1272
|
-
}, []),
|
|
1273
|
-
i(
|
|
1274
|
-
}, []),
|
|
1275
|
-
async (
|
|
1276
|
-
if (
|
|
1502
|
+
}, []), m = R((b) => {
|
|
1503
|
+
i(b), s(!0);
|
|
1504
|
+
}, []), f = R(
|
|
1505
|
+
async (b) => {
|
|
1506
|
+
if (n.operation === "idle")
|
|
1277
1507
|
try {
|
|
1278
|
-
await
|
|
1508
|
+
await n.remove(b.id), c((p) => p + 1), e?.("delete");
|
|
1279
1509
|
} catch {
|
|
1280
1510
|
e?.("error");
|
|
1281
1511
|
}
|
|
1282
1512
|
},
|
|
1283
|
-
[
|
|
1284
|
-
),
|
|
1285
|
-
() =>
|
|
1286
|
-
initialValues:
|
|
1287
|
-
validate: async (
|
|
1288
|
-
const
|
|
1289
|
-
|
|
1290
|
-
const
|
|
1291
|
-
return (!
|
|
1513
|
+
[n, e]
|
|
1514
|
+
), v = I(
|
|
1515
|
+
() => me({
|
|
1516
|
+
initialValues: Et(o),
|
|
1517
|
+
validate: async (b) => {
|
|
1518
|
+
const p = {};
|
|
1519
|
+
b.name.trim() || (p.name = "Názov je povinný.");
|
|
1520
|
+
const j = Number(b.price);
|
|
1521
|
+
return (!b.price.trim() || !Number.isFinite(j) || j < 0) && (p.price = "Zadajte platnú cenu."), p;
|
|
1292
1522
|
},
|
|
1293
|
-
onSubmit: async (
|
|
1294
|
-
const
|
|
1295
|
-
o ? (await
|
|
1523
|
+
onSubmit: async (b) => {
|
|
1524
|
+
const p = { name: b.name.trim(), price: Number(b.price) };
|
|
1525
|
+
o ? (await n.update(o.id, p), e?.("update")) : (await n.create(p), e?.("create"));
|
|
1296
1526
|
}
|
|
1297
1527
|
}),
|
|
1298
|
-
[
|
|
1299
|
-
),
|
|
1528
|
+
[n.create, n.update, o, e]
|
|
1529
|
+
), h = I(
|
|
1300
1530
|
() => [
|
|
1301
1531
|
{
|
|
1302
1532
|
key: "name",
|
|
1303
1533
|
header: "Produkt",
|
|
1304
|
-
render: (
|
|
1305
|
-
/* @__PURE__ */
|
|
1306
|
-
/* @__PURE__ */
|
|
1534
|
+
render: (b, p) => /* @__PURE__ */ t.jsxs("div", { className: "fsc-crud-example__row-action", children: [
|
|
1535
|
+
/* @__PURE__ */ t.jsx("span", { children: String(b) }),
|
|
1536
|
+
/* @__PURE__ */ t.jsx(
|
|
1307
1537
|
"button",
|
|
1308
1538
|
{
|
|
1309
1539
|
type: "button",
|
|
1310
|
-
onClick: () =>
|
|
1311
|
-
disabled:
|
|
1540
|
+
onClick: () => m(p),
|
|
1541
|
+
disabled: n.operation !== "idle",
|
|
1312
1542
|
children: "Upraviť"
|
|
1313
1543
|
}
|
|
1314
1544
|
)
|
|
@@ -1317,54 +1547,54 @@ function wt({ onEvent: e } = {}) {
|
|
|
1317
1547
|
{
|
|
1318
1548
|
key: "price",
|
|
1319
1549
|
header: "Cena",
|
|
1320
|
-
render: (
|
|
1550
|
+
render: (b) => `${String(b)} €`
|
|
1321
1551
|
},
|
|
1322
1552
|
{
|
|
1323
1553
|
key: "id",
|
|
1324
1554
|
header: "Akcie",
|
|
1325
|
-
render: (
|
|
1555
|
+
render: (b, p) => /* @__PURE__ */ t.jsx(
|
|
1326
1556
|
"button",
|
|
1327
1557
|
{
|
|
1328
1558
|
type: "button",
|
|
1329
1559
|
onClick: () => {
|
|
1330
|
-
|
|
1560
|
+
f(p);
|
|
1331
1561
|
},
|
|
1332
|
-
disabled:
|
|
1562
|
+
disabled: n.operation !== "idle",
|
|
1333
1563
|
children: "Zmazať"
|
|
1334
1564
|
}
|
|
1335
1565
|
)
|
|
1336
1566
|
}
|
|
1337
1567
|
],
|
|
1338
|
-
[
|
|
1339
|
-
),
|
|
1340
|
-
|
|
1568
|
+
[n.operation, f, m]
|
|
1569
|
+
), x = R(() => {
|
|
1570
|
+
c((b) => b + 1), s(!1), i(void 0);
|
|
1341
1571
|
}, []);
|
|
1342
|
-
return /* @__PURE__ */
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1572
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "fsc-crud-example", children: [
|
|
1573
|
+
/* @__PURE__ */ t.jsxs("div", { className: "fsc-crud-example__toolbar", children: [
|
|
1574
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", onClick: d, disabled: n.operation !== "idle", children: "Vytvoriť nový záznam" }),
|
|
1575
|
+
/* @__PURE__ */ t.jsxs("span", { "aria-live": "polite", children: [
|
|
1346
1576
|
"Stav: ",
|
|
1347
|
-
|
|
1577
|
+
n.operation === "idle" ? "Pripravené" : n.operation
|
|
1348
1578
|
] }),
|
|
1349
|
-
|
|
1579
|
+
n.error ? /* @__PURE__ */ t.jsx("small", { role: "alert", children: n.error.message }) : null
|
|
1350
1580
|
] }),
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
-
|
|
1581
|
+
/* @__PURE__ */ t.jsx(
|
|
1582
|
+
wt,
|
|
1353
1583
|
{
|
|
1354
1584
|
resource: r,
|
|
1355
|
-
columns:
|
|
1585
|
+
columns: h,
|
|
1356
1586
|
pageSize: 10,
|
|
1357
|
-
reloadKey:
|
|
1587
|
+
reloadKey: l
|
|
1358
1588
|
}
|
|
1359
1589
|
),
|
|
1360
|
-
|
|
1361
|
-
|
|
1590
|
+
a ? /* @__PURE__ */ t.jsx(
|
|
1591
|
+
Tt,
|
|
1362
1592
|
{
|
|
1363
|
-
store:
|
|
1364
|
-
operation:
|
|
1365
|
-
controllerError:
|
|
1593
|
+
store: v,
|
|
1594
|
+
operation: n.operation,
|
|
1595
|
+
controllerError: n.error,
|
|
1366
1596
|
editing: !!o,
|
|
1367
|
-
onSuccess:
|
|
1597
|
+
onSuccess: x,
|
|
1368
1598
|
onCancel: () => {
|
|
1369
1599
|
s(!1), i(void 0);
|
|
1370
1600
|
}
|
|
@@ -1372,318 +1602,970 @@ function wt({ onEvent: e } = {}) {
|
|
|
1372
1602
|
) : null
|
|
1373
1603
|
] });
|
|
1374
1604
|
}
|
|
1375
|
-
function
|
|
1376
|
-
|
|
1605
|
+
function ir({
|
|
1606
|
+
count: e,
|
|
1607
|
+
singularLabel: r = "result",
|
|
1608
|
+
pluralLabel: n = "results",
|
|
1609
|
+
className: a,
|
|
1610
|
+
...s
|
|
1611
|
+
}) {
|
|
1612
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1613
|
+
"span",
|
|
1614
|
+
{
|
|
1615
|
+
...s,
|
|
1616
|
+
className: a ? `fsc-results-count ${a}` : "fsc-results-count",
|
|
1617
|
+
"aria-live": "polite",
|
|
1618
|
+
children: [
|
|
1619
|
+
e,
|
|
1620
|
+
" ",
|
|
1621
|
+
e === 1 ? r : n
|
|
1622
|
+
]
|
|
1623
|
+
}
|
|
1624
|
+
);
|
|
1377
1625
|
}
|
|
1378
|
-
function
|
|
1379
|
-
return /* @__PURE__ */
|
|
1626
|
+
function lr(e) {
|
|
1627
|
+
return /* @__PURE__ */ t.jsx("input", { ...e, type: "color" });
|
|
1380
1628
|
}
|
|
1381
|
-
function
|
|
1382
|
-
return /* @__PURE__ */
|
|
1629
|
+
function cr(e) {
|
|
1630
|
+
return /* @__PURE__ */ t.jsx("input", { ...e, type: "date" });
|
|
1383
1631
|
}
|
|
1384
|
-
function
|
|
1385
|
-
return /* @__PURE__ */
|
|
1632
|
+
function dr(e) {
|
|
1633
|
+
return /* @__PURE__ */ t.jsx("input", { ...e, type: "file" });
|
|
1386
1634
|
}
|
|
1387
|
-
function
|
|
1388
|
-
|
|
1635
|
+
function ur({
|
|
1636
|
+
label: e,
|
|
1637
|
+
options: r,
|
|
1638
|
+
value: n = [],
|
|
1639
|
+
onValueChange: a,
|
|
1640
|
+
disabled: s = !1
|
|
1641
|
+
}) {
|
|
1642
|
+
const o = new Set(n), i = (l) => {
|
|
1643
|
+
const c = new Set(o);
|
|
1644
|
+
c.has(l) ? c.delete(l) : c.add(l), a?.([...c]);
|
|
1645
|
+
};
|
|
1646
|
+
return /* @__PURE__ */ t.jsxs("fieldset", { className: "fsc-multi-select-filter", disabled: s, children: [
|
|
1647
|
+
e ? /* @__PURE__ */ t.jsx("legend", { className: "fsc-multi-select-filter__label", children: e }) : null,
|
|
1648
|
+
/* @__PURE__ */ t.jsx("div", { className: "fsc-multi-select-filter__options", children: r.map((l) => /* @__PURE__ */ t.jsxs("label", { className: "fsc-multi-select-filter__option", children: [
|
|
1649
|
+
/* @__PURE__ */ t.jsx(
|
|
1650
|
+
"input",
|
|
1651
|
+
{
|
|
1652
|
+
type: "checkbox",
|
|
1653
|
+
checked: o.has(l.value),
|
|
1654
|
+
disabled: l.disabled,
|
|
1655
|
+
onChange: () => i(l.value)
|
|
1656
|
+
}
|
|
1657
|
+
),
|
|
1658
|
+
/* @__PURE__ */ t.jsx("span", { children: l.label })
|
|
1659
|
+
] }, l.value)) })
|
|
1660
|
+
] });
|
|
1661
|
+
}
|
|
1662
|
+
function fr(e) {
|
|
1663
|
+
return /* @__PURE__ */ t.jsx("input", { ...e, type: "number" });
|
|
1664
|
+
}
|
|
1665
|
+
function mr(e) {
|
|
1666
|
+
return /* @__PURE__ */ t.jsx("input", { ...e, type: "password" });
|
|
1389
1667
|
}
|
|
1390
|
-
function
|
|
1391
|
-
return /* @__PURE__ */
|
|
1392
|
-
/* @__PURE__ */
|
|
1668
|
+
function hr({ name: e, options: r, value: n, onValueChange: a }) {
|
|
1669
|
+
return /* @__PURE__ */ t.jsx("div", { role: "radiogroup", children: r.map((s) => /* @__PURE__ */ t.jsxs("label", { children: [
|
|
1670
|
+
/* @__PURE__ */ t.jsx("input", { type: "radio", name: e, value: s.value, checked: n === s.value, disabled: s.disabled, onChange: () => a?.(s.value) }),
|
|
1393
1671
|
s.label
|
|
1394
1672
|
] }, s.value)) });
|
|
1395
1673
|
}
|
|
1396
|
-
function
|
|
1397
|
-
return /* @__PURE__ */
|
|
1674
|
+
function pr(e) {
|
|
1675
|
+
return /* @__PURE__ */ t.jsx("input", { ...e, type: "search" });
|
|
1398
1676
|
}
|
|
1399
|
-
function
|
|
1400
|
-
|
|
1677
|
+
function br({
|
|
1678
|
+
label: e,
|
|
1679
|
+
options: r,
|
|
1680
|
+
onValueChange: n,
|
|
1681
|
+
value: a,
|
|
1682
|
+
defaultValue: s,
|
|
1683
|
+
id: o,
|
|
1684
|
+
...i
|
|
1685
|
+
}) {
|
|
1686
|
+
return /* @__PURE__ */ t.jsxs("label", { className: "fsc-select-filter", children: [
|
|
1687
|
+
e ? /* @__PURE__ */ t.jsx("span", { className: "fsc-select-filter__label", children: e }) : null,
|
|
1688
|
+
/* @__PURE__ */ t.jsx(
|
|
1689
|
+
"select",
|
|
1690
|
+
{
|
|
1691
|
+
...i,
|
|
1692
|
+
id: o,
|
|
1693
|
+
value: a,
|
|
1694
|
+
defaultValue: s,
|
|
1695
|
+
onChange: (l) => n?.(l.target.value),
|
|
1696
|
+
"data-size": "medium",
|
|
1697
|
+
children: r.map((l) => /* @__PURE__ */ t.jsx("option", { value: l.value, disabled: l.disabled, children: l.label }, l.value))
|
|
1698
|
+
}
|
|
1699
|
+
)
|
|
1700
|
+
] });
|
|
1701
|
+
}
|
|
1702
|
+
function xr(e) {
|
|
1703
|
+
return /* @__PURE__ */ t.jsx("input", { ...e, type: "range" });
|
|
1704
|
+
}
|
|
1705
|
+
function vr({
|
|
1706
|
+
search: e,
|
|
1707
|
+
filters: r,
|
|
1708
|
+
leading: n,
|
|
1709
|
+
results: a,
|
|
1710
|
+
actions: s,
|
|
1711
|
+
ariaLabel: o = "Page actions",
|
|
1712
|
+
className: i,
|
|
1713
|
+
...l
|
|
1714
|
+
}) {
|
|
1715
|
+
const c = ["fsc-ohm-action-bar", i].filter(Boolean).join(" ");
|
|
1716
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1717
|
+
"div",
|
|
1718
|
+
{
|
|
1719
|
+
...l,
|
|
1720
|
+
className: c,
|
|
1721
|
+
role: "toolbar",
|
|
1722
|
+
"aria-label": o,
|
|
1723
|
+
children: [
|
|
1724
|
+
/* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-action-bar__controls", children: [
|
|
1725
|
+
n ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-action-bar__leading", children: n }) : null,
|
|
1726
|
+
e ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-action-bar__search", children: e }) : null,
|
|
1727
|
+
r ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-action-bar__filters", children: r }) : null
|
|
1728
|
+
] }),
|
|
1729
|
+
/* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-action-bar__meta", children: [
|
|
1730
|
+
a ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-action-bar__results", children: a }) : null,
|
|
1731
|
+
s ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-action-bar__actions", children: s }) : null
|
|
1732
|
+
] })
|
|
1733
|
+
]
|
|
1734
|
+
}
|
|
1735
|
+
);
|
|
1736
|
+
}
|
|
1737
|
+
function Rt({
|
|
1738
|
+
value: e,
|
|
1739
|
+
options: r,
|
|
1740
|
+
placeholder: n,
|
|
1741
|
+
searchPlaceholder: a,
|
|
1742
|
+
add: s,
|
|
1743
|
+
disabled: o,
|
|
1744
|
+
onChange: i
|
|
1745
|
+
}) {
|
|
1746
|
+
const [l, c] = w(!1), [d, m] = w(""), f = A(null), v = A(null), h = r.find((j) => String(j.value) === String(e)), x = d.trim().toLocaleLowerCase(), b = x ? r.filter((j) => String(j.label).toLocaleLowerCase().includes(x)) : r;
|
|
1747
|
+
P(() => {
|
|
1748
|
+
if (!l) return;
|
|
1749
|
+
const j = (C) => {
|
|
1750
|
+
f.current?.contains(C.target) || (c(!1), m(""));
|
|
1751
|
+
};
|
|
1752
|
+
return document.addEventListener("mousedown", j), requestAnimationFrame(() => v.current?.focus()), () => document.removeEventListener("mousedown", j);
|
|
1753
|
+
}, [l]);
|
|
1754
|
+
const p = (j) => {
|
|
1755
|
+
i(j.value), c(!1), m("");
|
|
1756
|
+
};
|
|
1757
|
+
return /* @__PURE__ */ t.jsxs("div", { ref: f, className: "fsc-ohm-data-field__select-search", children: [
|
|
1758
|
+
/* @__PURE__ */ t.jsxs(
|
|
1759
|
+
"button",
|
|
1760
|
+
{
|
|
1761
|
+
type: "button",
|
|
1762
|
+
className: "fsc-ohm-data-field__select-search-trigger",
|
|
1763
|
+
"aria-expanded": l,
|
|
1764
|
+
disabled: o,
|
|
1765
|
+
onClick: () => c((j) => !j),
|
|
1766
|
+
children: [
|
|
1767
|
+
/* @__PURE__ */ t.jsx("span", { className: h ? "fsc-ohm-data-field__select-search-value" : "fsc-ohm-data-field__select-search-placeholder", children: h?.label ?? n }),
|
|
1768
|
+
/* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-data-field__select-search-chevron", "aria-hidden": "true" })
|
|
1769
|
+
]
|
|
1770
|
+
}
|
|
1771
|
+
),
|
|
1772
|
+
l ? /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-data-field__select-search-dropdown", children: [
|
|
1773
|
+
/* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-data-field__select-search-input", children: /* @__PURE__ */ t.jsx(
|
|
1774
|
+
"input",
|
|
1775
|
+
{
|
|
1776
|
+
ref: v,
|
|
1777
|
+
value: d,
|
|
1778
|
+
placeholder: a,
|
|
1779
|
+
"aria-label": a,
|
|
1780
|
+
onChange: (j) => m(j.target.value)
|
|
1781
|
+
}
|
|
1782
|
+
) }),
|
|
1783
|
+
/* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-data-field__select-search-options", children: [
|
|
1784
|
+
s ? /* @__PURE__ */ t.jsx(
|
|
1785
|
+
"button",
|
|
1786
|
+
{
|
|
1787
|
+
type: "button",
|
|
1788
|
+
className: "fsc-ohm-data-field__select-search-option fsc-ohm-data-field__select-search-option--add",
|
|
1789
|
+
onClick: () => s.onAdd(),
|
|
1790
|
+
children: s.label ?? "+ Pridať"
|
|
1791
|
+
}
|
|
1792
|
+
) : null,
|
|
1793
|
+
b.map((j) => /* @__PURE__ */ t.jsx(
|
|
1794
|
+
"button",
|
|
1795
|
+
{
|
|
1796
|
+
type: "button",
|
|
1797
|
+
className: "fsc-ohm-data-field__select-search-option",
|
|
1798
|
+
"aria-pressed": String(j.value) === String(e),
|
|
1799
|
+
onClick: () => p(j),
|
|
1800
|
+
children: j.label
|
|
1801
|
+
},
|
|
1802
|
+
j.value
|
|
1803
|
+
)),
|
|
1804
|
+
b.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-data-field__select-search-empty", children: "Žiadne výsledky" }) : null
|
|
1805
|
+
] })
|
|
1806
|
+
] }) : null
|
|
1807
|
+
] });
|
|
1401
1808
|
}
|
|
1402
|
-
function
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1809
|
+
function jr({
|
|
1810
|
+
label: e,
|
|
1811
|
+
value: r = "",
|
|
1812
|
+
state: n = "display",
|
|
1813
|
+
type: a = "text",
|
|
1814
|
+
options: s = [],
|
|
1815
|
+
add: o = !1,
|
|
1816
|
+
placeholder: i,
|
|
1817
|
+
disabled: l = !1,
|
|
1818
|
+
required: c = !1,
|
|
1819
|
+
className: d,
|
|
1820
|
+
onChange: m
|
|
1821
|
+
}) {
|
|
1822
|
+
const f = [
|
|
1823
|
+
"fsc-ohm-data-field",
|
|
1824
|
+
"fsc-ohm-data-field--" + n,
|
|
1825
|
+
d
|
|
1826
|
+
].filter(Boolean).join(" "), v = a === "select" || a === "select-search" ? s.find((b) => String(b.value) === String(r))?.label ?? r : r, h = (b) => {
|
|
1827
|
+
m?.(b);
|
|
1828
|
+
}, x = o === !0 ? { label: "+ Pridať", onAdd: () => {
|
|
1829
|
+
} } : o === !1 ? void 0 : o;
|
|
1830
|
+
return /* @__PURE__ */ t.jsxs("div", { className: f, children: [
|
|
1831
|
+
/* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-data-field__label", children: e }),
|
|
1832
|
+
n === "display" ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-data-field__value", children: v === "" || v === void 0 ? /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-data-field__empty", children: "—" }) : v }) : /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-data-field__control", children: a === "textarea" ? /* @__PURE__ */ t.jsx(
|
|
1833
|
+
"textarea",
|
|
1834
|
+
{
|
|
1835
|
+
value: String(r),
|
|
1836
|
+
placeholder: i,
|
|
1837
|
+
disabled: l,
|
|
1838
|
+
required: c,
|
|
1839
|
+
onChange: (b) => h(b.target.value)
|
|
1840
|
+
}
|
|
1841
|
+
) : a === "select-search" ? /* @__PURE__ */ t.jsx(
|
|
1842
|
+
Rt,
|
|
1843
|
+
{
|
|
1844
|
+
value: r,
|
|
1845
|
+
options: s,
|
|
1846
|
+
placeholder: i ?? "Vybrať...",
|
|
1847
|
+
searchPlaceholder: "Hľadať...",
|
|
1848
|
+
add: x,
|
|
1849
|
+
disabled: l,
|
|
1850
|
+
onChange: h
|
|
1851
|
+
}
|
|
1852
|
+
) : a === "select" ? /* @__PURE__ */ t.jsx(
|
|
1853
|
+
"select",
|
|
1854
|
+
{
|
|
1855
|
+
value: String(r),
|
|
1856
|
+
disabled: l,
|
|
1857
|
+
required: c,
|
|
1858
|
+
onChange: (b) => h(b.target.value),
|
|
1859
|
+
children: s.map((b) => /* @__PURE__ */ t.jsx("option", { value: b.value, children: b.label }, b.value))
|
|
1860
|
+
}
|
|
1861
|
+
) : /* @__PURE__ */ t.jsx(
|
|
1862
|
+
"input",
|
|
1863
|
+
{
|
|
1864
|
+
type: a,
|
|
1865
|
+
value: String(r),
|
|
1866
|
+
placeholder: i,
|
|
1867
|
+
disabled: l,
|
|
1868
|
+
required: c,
|
|
1869
|
+
onChange: (b) => h(b.target.value)
|
|
1870
|
+
}
|
|
1871
|
+
) })
|
|
1872
|
+
] });
|
|
1873
|
+
}
|
|
1874
|
+
function Pt({
|
|
1875
|
+
document: e,
|
|
1876
|
+
onPreview: r
|
|
1877
|
+
}) {
|
|
1878
|
+
return /* @__PURE__ */ t.jsx(
|
|
1879
|
+
"button",
|
|
1880
|
+
{
|
|
1881
|
+
type: "button",
|
|
1882
|
+
className: "fsc-ohm-document-list__preview",
|
|
1883
|
+
"aria-label": `Náhľad dokumentu ${e.name}`,
|
|
1884
|
+
disabled: !r,
|
|
1885
|
+
onClick: () => r?.(e),
|
|
1886
|
+
children: e.previewUrl ? /* @__PURE__ */ t.jsx("img", { src: e.previewUrl, alt: "" }) : /* @__PURE__ */ t.jsxs("span", { className: "fsc-ohm-document-list__preview-sheet", "aria-hidden": "true", children: [
|
|
1887
|
+
/* @__PURE__ */ t.jsx("span", {}),
|
|
1888
|
+
/* @__PURE__ */ t.jsx("span", {}),
|
|
1889
|
+
/* @__PURE__ */ t.jsx("span", {})
|
|
1890
|
+
] })
|
|
1891
|
+
}
|
|
1892
|
+
);
|
|
1893
|
+
}
|
|
1894
|
+
function gr({
|
|
1895
|
+
documents: e = [],
|
|
1896
|
+
emptyState: r = "Žiadne dokumenty",
|
|
1897
|
+
className: n,
|
|
1898
|
+
onPreview: a,
|
|
1899
|
+
onDelete: s,
|
|
1900
|
+
onDownload: o,
|
|
1901
|
+
onShare: i
|
|
1902
|
+
}) {
|
|
1903
|
+
const l = [
|
|
1904
|
+
"fsc-ohm-document-list",
|
|
1905
|
+
n
|
|
1906
|
+
].filter(Boolean).join(" ");
|
|
1907
|
+
return /* @__PURE__ */ t.jsx("div", { className: l, children: e.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-document-list__empty", children: r }) : /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-document-list__items", children: e.map((c) => /* @__PURE__ */ t.jsxs("article", { className: "fsc-ohm-document-list__item", children: [
|
|
1908
|
+
/* @__PURE__ */ t.jsx(Pt, { document: c, onPreview: a }),
|
|
1909
|
+
/* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-document-list__info", children: [
|
|
1910
|
+
/* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-document-list__name", title: c.name, children: c.name }),
|
|
1911
|
+
/* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-document-list__meta", children: [
|
|
1912
|
+
c.type ? /* @__PURE__ */ t.jsx("span", { children: c.type }) : null,
|
|
1913
|
+
c.size ? /* @__PURE__ */ t.jsx("span", { children: c.size }) : null,
|
|
1914
|
+
c.date ? /* @__PURE__ */ t.jsx("span", { children: c.date }) : null
|
|
1915
|
+
] })
|
|
1916
|
+
] }),
|
|
1917
|
+
/* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-document-list__actions", "aria-label": "Akcie dokumentu", children: [
|
|
1918
|
+
/* @__PURE__ */ t.jsx(
|
|
1919
|
+
"button",
|
|
1920
|
+
{
|
|
1921
|
+
type: "button",
|
|
1922
|
+
className: "fsc-ohm-document-list__action",
|
|
1923
|
+
"aria-label": `Stiahnuť ${c.name}`,
|
|
1924
|
+
disabled: !o,
|
|
1925
|
+
onClick: () => o?.(c),
|
|
1926
|
+
children: "Stiahnuť"
|
|
1927
|
+
}
|
|
1928
|
+
),
|
|
1929
|
+
/* @__PURE__ */ t.jsx(
|
|
1930
|
+
"button",
|
|
1931
|
+
{
|
|
1932
|
+
type: "button",
|
|
1933
|
+
className: "fsc-ohm-document-list__action",
|
|
1934
|
+
"aria-label": `Zdieľať ${c.name}`,
|
|
1935
|
+
disabled: !i,
|
|
1936
|
+
onClick: () => i?.(c),
|
|
1937
|
+
children: "Zdieľať"
|
|
1938
|
+
}
|
|
1939
|
+
),
|
|
1940
|
+
/* @__PURE__ */ t.jsx(
|
|
1941
|
+
"button",
|
|
1942
|
+
{
|
|
1943
|
+
type: "button",
|
|
1944
|
+
className: "fsc-ohm-document-list__action fsc-ohm-document-list__action--danger",
|
|
1945
|
+
"aria-label": `Odstrániť ${c.name}`,
|
|
1946
|
+
disabled: !s,
|
|
1947
|
+
onClick: () => s?.(c),
|
|
1948
|
+
children: "Odstrániť"
|
|
1949
|
+
}
|
|
1950
|
+
)
|
|
1951
|
+
] })
|
|
1952
|
+
] }, c.id)) }) });
|
|
1953
|
+
}
|
|
1954
|
+
function yr({
|
|
1955
|
+
title: e,
|
|
1956
|
+
description: r,
|
|
1957
|
+
children: n,
|
|
1958
|
+
variant: a = "default",
|
|
1959
|
+
collapsible: s = !1,
|
|
1960
|
+
defaultCollapsed: o = !1,
|
|
1961
|
+
collapsed: i,
|
|
1962
|
+
onCollapsedChange: l,
|
|
1963
|
+
className: c,
|
|
1964
|
+
...d
|
|
1965
|
+
}) {
|
|
1966
|
+
const [m, f] = w(o), v = fe(), h = i !== void 0, x = h ? i : m, b = (p) => {
|
|
1967
|
+
h || f(p), l?.(p);
|
|
1968
|
+
};
|
|
1969
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1970
|
+
"article",
|
|
1971
|
+
{
|
|
1972
|
+
...d,
|
|
1973
|
+
className: ["fsc-ohm-entity-card", `fsc-ohm-entity-card--${a}`, c].filter(Boolean).join(" "),
|
|
1974
|
+
"data-state": x ? "collapsed" : "expanded",
|
|
1975
|
+
children: [
|
|
1976
|
+
/* @__PURE__ */ t.jsxs("header", { className: "fsc-ohm-entity-card__header", children: [
|
|
1977
|
+
/* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-entity-card__heading", children: [
|
|
1978
|
+
/* @__PURE__ */ t.jsx("h2", { className: "fsc-ohm-entity-card__title", children: e }),
|
|
1979
|
+
r ? /* @__PURE__ */ t.jsx("p", { className: "fsc-ohm-entity-card__description", children: r }) : null
|
|
1980
|
+
] }),
|
|
1981
|
+
s ? /* @__PURE__ */ t.jsx(
|
|
1982
|
+
"button",
|
|
1983
|
+
{
|
|
1984
|
+
type: "button",
|
|
1985
|
+
className: "fsc-ohm-entity-card__toggle",
|
|
1986
|
+
"aria-expanded": !x,
|
|
1987
|
+
"aria-controls": v,
|
|
1988
|
+
"aria-label": x ? "Rozbaliť sekciu" : "Zbaliť sekciu",
|
|
1989
|
+
onClick: () => b(!x),
|
|
1990
|
+
children: /* @__PURE__ */ t.jsx("span", { className: `fsc-ohm-entity-card__chevron ${x ? "fsc-ohm-entity-card__chevron--down" : "fsc-ohm-entity-card__chevron--up"}`, "aria-hidden": "true" })
|
|
1991
|
+
}
|
|
1992
|
+
) : null
|
|
1993
|
+
] }),
|
|
1994
|
+
/* @__PURE__ */ t.jsx("div", { id: v, className: "fsc-ohm-entity-card__content", hidden: x, children: n })
|
|
1995
|
+
]
|
|
1996
|
+
}
|
|
1997
|
+
);
|
|
1998
|
+
}
|
|
1999
|
+
function _r({ children: e, className: r }) {
|
|
2000
|
+
return /* @__PURE__ */ t.jsx("main", { className: r ? `fsc-ohm-main ${r}` : "fsc-ohm-main", children: e });
|
|
2001
|
+
}
|
|
2002
|
+
const Te = ae(null), ue = ae(!1);
|
|
2003
|
+
function se() {
|
|
2004
|
+
const e = H(Te);
|
|
2005
|
+
if (!e) throw new Error("Navbar child components must be inside Navbar.");
|
|
2006
|
+
return e;
|
|
2007
|
+
}
|
|
2008
|
+
function Ot(e, r) {
|
|
2009
|
+
const n = e.mobile ?? 768, a = e.desktop ?? 1024;
|
|
2010
|
+
if (n >= a) throw new Error("Navbar responsive.mobile must be smaller than responsive.desktop.");
|
|
2011
|
+
const [s, o] = w(a);
|
|
2012
|
+
return P(() => {
|
|
2013
|
+
const i = r.current;
|
|
2014
|
+
if (!i) return;
|
|
2015
|
+
const l = () => {
|
|
2016
|
+
const c = Number.parseFloat(
|
|
2017
|
+
getComputedStyle(i).getPropertyValue("--fsc-preview-viewport-width")
|
|
2018
|
+
), d = Number.isFinite(c) && c > 0 ? c : i.getBoundingClientRect().width || i.clientWidth;
|
|
2019
|
+
d > 0 && o(d);
|
|
2020
|
+
};
|
|
2021
|
+
if (l(), typeof ResizeObserver < "u") {
|
|
2022
|
+
const c = new ResizeObserver(l);
|
|
2023
|
+
return c.observe(i), () => c.disconnect();
|
|
2024
|
+
}
|
|
2025
|
+
return window.addEventListener("resize", l), () => window.removeEventListener("resize", l);
|
|
2026
|
+
}, [r]), { mobile: s < n, collapsedMode: s >= n && s < a };
|
|
2027
|
+
}
|
|
2028
|
+
function Sr({ children: e, responsive: r, width: n, sections: a, profile: s, brand: o }) {
|
|
2029
|
+
const i = A(null), l = Ot(r ?? {}, i), [c, d] = w(!1), [m, f] = w(!1), v = A(null);
|
|
2030
|
+
P(() => {
|
|
2031
|
+
try {
|
|
2032
|
+
const p = localStorage.getItem("fsc-navbar-collapsed");
|
|
2033
|
+
p && d(p === "true");
|
|
2034
|
+
} catch {
|
|
2035
|
+
}
|
|
2036
|
+
}, []), P(() => {
|
|
2037
|
+
if (!l.mobile) try {
|
|
2038
|
+
localStorage.setItem("fsc-navbar-collapsed", String(c));
|
|
2039
|
+
} catch {
|
|
2040
|
+
}
|
|
2041
|
+
}, [c, l.mobile]), P(() => {
|
|
2042
|
+
l.mobile && f(!1);
|
|
2043
|
+
}, [l.mobile]), P(() => {
|
|
2044
|
+
document.documentElement.style.setProperty("--fsc-navbar-current-width", l.mobile ? "0px" : l.collapsedMode || c ? n?.collapsed ?? "64px" : n?.expanded ?? "280px");
|
|
2045
|
+
}, [l.mobile, l.collapsedMode, c, n?.collapsed, n?.expanded]);
|
|
2046
|
+
const h = () => f(!1), x = I(() => ({ mobile: l.mobile, collapsed: l.collapsedMode || c, open: m, setOpen: f, setCollapsed: d, toggleRef: v, closeMobile: h }), [l.mobile, l.collapsedMode, c, m]), b = a ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
|
|
2047
|
+
/* @__PURE__ */ t.jsxs(At, { children: [
|
|
2048
|
+
o ? /* @__PURE__ */ t.jsxs(zt, { href: o.href, children: [
|
|
2049
|
+
/* @__PURE__ */ t.jsx($t, { children: o.logo }),
|
|
2050
|
+
/* @__PURE__ */ t.jsx(Lt, { children: o.name })
|
|
2051
|
+
] }) : null,
|
|
2052
|
+
/* @__PURE__ */ t.jsx(It, {})
|
|
2053
|
+
] }),
|
|
2054
|
+
/* @__PURE__ */ t.jsx(Ft, { children: a.map((p, j) => /* @__PURE__ */ t.jsx(Mt, { ...p, children: p.items.map((C, T) => /* @__PURE__ */ t.jsx(Bt, { ...C }, T)) }, j)) }),
|
|
2055
|
+
s ? /* @__PURE__ */ t.jsx(Vt, { children: /* @__PURE__ */ t.jsx(Ut, { ...s }) }) : null
|
|
2056
|
+
] }) : e;
|
|
2057
|
+
return /* @__PURE__ */ t.jsx(Te.Provider, { value: x, children: /* @__PURE__ */ t.jsxs("div", { ref: i, className: "fsc-ohm-navbar__anchor", children: [
|
|
2058
|
+
/* @__PURE__ */ t.jsx("aside", { className: "fsc-ohm-navbar", "data-mobile": l.mobile || void 0, "data-open": m || void 0, "data-collapsed": !l.mobile && x.collapsed || void 0, style: { "--fsc-navbar-mobile-width": n?.mobile ?? "100%", "--fsc-navbar-collapsed-width": n?.collapsed ?? "64px", "--fsc-navbar-expanded-width": n?.expanded ?? "280px" }, children: b }),
|
|
2059
|
+
l.mobile && m ? /* @__PURE__ */ t.jsx("button", { className: "fsc-ohm-navbar__backdrop", "aria-label": "Close navigation", onClick: h }) : null
|
|
2060
|
+
] }) });
|
|
2061
|
+
}
|
|
2062
|
+
function At({ children: e }) {
|
|
2063
|
+
return /* @__PURE__ */ t.jsx("header", { className: "fsc-ohm-navbar__header", children: e });
|
|
2064
|
+
}
|
|
2065
|
+
function zt({ children: e, href: r }) {
|
|
2066
|
+
return /* @__PURE__ */ t.jsx("a", { className: "fsc-ohm-navbar__brand", href: r, children: e });
|
|
2067
|
+
}
|
|
2068
|
+
function $t({ children: e }) {
|
|
2069
|
+
return /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-navbar__brand-logo", "aria-hidden": "true", children: e });
|
|
2070
|
+
}
|
|
2071
|
+
function Lt({ children: e }) {
|
|
2072
|
+
return /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-navbar__brand-name", children: e });
|
|
2073
|
+
}
|
|
2074
|
+
function It({ expandedIcon: e = "‹", collapsedIcon: r = "›", mobileOpenIcon: n = "×", mobileClosedIcon: a = "☰" }) {
|
|
2075
|
+
const { mobile: s, collapsed: o, open: i, setOpen: l, setCollapsed: c, toggleRef: d } = se();
|
|
2076
|
+
return P(() => {
|
|
2077
|
+
if (!s || !i) return;
|
|
2078
|
+
const m = d.current?.closest(".fsc-ohm-navbar"), f = () => Array.from(m?.querySelectorAll('a[href],button:not([disabled]),[tabindex]:not([tabindex="-1"])') ?? []), v = (h) => {
|
|
2079
|
+
if (h.key === "Escape") {
|
|
2080
|
+
h.preventDefault(), l(!1), d.current?.focus();
|
|
2081
|
+
return;
|
|
2082
|
+
}
|
|
2083
|
+
if (h.key !== "Tab") return;
|
|
2084
|
+
const x = f();
|
|
2085
|
+
if (!x.length) return;
|
|
2086
|
+
const b = x[0], p = x[x.length - 1];
|
|
2087
|
+
!b || !p || (h.shiftKey && document.activeElement === b ? (h.preventDefault(), p.focus()) : !h.shiftKey && document.activeElement === p && (h.preventDefault(), b.focus()));
|
|
2088
|
+
};
|
|
2089
|
+
return document.addEventListener("keydown", v), requestAnimationFrame(() => f()[0]?.focus()), () => document.removeEventListener("keydown", v);
|
|
2090
|
+
}, [s, i, l, d]), /* @__PURE__ */ t.jsx("button", { ref: d, className: "fsc-ohm-navbar__toggle", type: "button", "aria-label": s ? i ? "Close navigation" : "Open navigation" : o ? "Expand navigation" : "Collapse navigation", "aria-expanded": s ? i : !o, onClick: () => s ? l(!i) : c(!o), children: s ? i ? n : a : o ? r : e });
|
|
2091
|
+
}
|
|
2092
|
+
function Ft({ children: e }) {
|
|
2093
|
+
const { mobile: r, open: n } = se();
|
|
2094
|
+
return /* @__PURE__ */ t.jsx("nav", { className: "fsc-ohm-navbar__main", "aria-label": "Primary navigation", "data-mobile-open": r && n || void 0, children: e });
|
|
2095
|
+
}
|
|
2096
|
+
function Mt({ name: e, icon: r, disabled: n = !1, hidden: a = !1, children: s }) {
|
|
2097
|
+
const o = H(ue);
|
|
2098
|
+
return a ? null : /* @__PURE__ */ t.jsxs("section", { className: "fsc-ohm-navbar__section", "data-disabled": n || void 0, children: [
|
|
2099
|
+
/* @__PURE__ */ t.jsx(Dt, { name: e, icon: r }),
|
|
2100
|
+
/* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-navbar__section-items", children: /* @__PURE__ */ t.jsx(ue.Provider, { value: o || n, children: s }) })
|
|
2101
|
+
] });
|
|
2102
|
+
}
|
|
2103
|
+
function Dt({ name: e, icon: r }) {
|
|
2104
|
+
return /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-navbar__section-name", children: [
|
|
2105
|
+
/* @__PURE__ */ t.jsx("span", { "aria-hidden": "true", children: r }),
|
|
2106
|
+
/* @__PURE__ */ t.jsx("span", { children: e })
|
|
2107
|
+
] });
|
|
2108
|
+
}
|
|
2109
|
+
function ye(e) {
|
|
2110
|
+
if (typeof window > "u") return !1;
|
|
2111
|
+
const r = window.location.pathname, n = e.split(/[?#]/), a = e === "/" ? "/" : (n[0] ?? "").replace(/\/$/, "") || "/";
|
|
2112
|
+
return a === "/" ? r === "/" : r === a || r.startsWith(a + "/");
|
|
2113
|
+
}
|
|
2114
|
+
function Bt({ name: e, href: r, icon: n, disabled: a = !1, hidden: s = !1, tooltip: o, ariaLabel: i }) {
|
|
2115
|
+
const { collapsed: l, closeMobile: c } = se(), d = H(ue), m = a || d, [f, v] = w(() => ye(r));
|
|
2116
|
+
if (P(() => {
|
|
2117
|
+
const x = () => v(ye(r));
|
|
2118
|
+
return addEventListener("popstate", x), addEventListener("hashchange", x), x(), () => {
|
|
2119
|
+
removeEventListener("popstate", x), removeEventListener("hashchange", x);
|
|
2120
|
+
};
|
|
2121
|
+
}, [r]), s) return null;
|
|
2122
|
+
const h = o ?? e;
|
|
2123
|
+
return /* @__PURE__ */ t.jsxs("a", { className: "fsc-ohm-navbar__item", href: m ? void 0 : r, "aria-label": i, "aria-current": f ? "page" : void 0, "aria-disabled": m || void 0, "data-active": f || void 0, "data-disabled": m || void 0, title: l && typeof h == "string" ? h : void 0, onClick: (x) => {
|
|
2124
|
+
m ? x.preventDefault() : c();
|
|
2125
|
+
}, children: [
|
|
2126
|
+
/* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-navbar__item-icon", "aria-hidden": "true", children: n }),
|
|
2127
|
+
/* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-navbar__item-name", children: e })
|
|
2128
|
+
] });
|
|
2129
|
+
}
|
|
2130
|
+
function wr({ children: e }) {
|
|
2131
|
+
return /* @__PURE__ */ t.jsx("span", { "aria-hidden": "true", children: e });
|
|
2132
|
+
}
|
|
2133
|
+
function Nr({ children: e }) {
|
|
2134
|
+
return /* @__PURE__ */ t.jsx("span", { children: e });
|
|
2135
|
+
}
|
|
2136
|
+
function Vt({ children: e }) {
|
|
2137
|
+
return /* @__PURE__ */ t.jsx("footer", { className: "fsc-ohm-navbar__footer", children: e });
|
|
2138
|
+
}
|
|
2139
|
+
function _e({ src: e, fallback: r }) {
|
|
2140
|
+
const [n, a] = w(!1);
|
|
2141
|
+
return !e || n ? /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-navbar__profile-picture", children: r ?? "U" }) : /* @__PURE__ */ t.jsx("img", { className: "fsc-ohm-navbar__profile-picture", src: e, alt: "", onError: () => a(!0) });
|
|
2142
|
+
}
|
|
2143
|
+
function Ut({ picture: e, name: r, profileHref: n, settingsHref: a, onLogout: s, settingsIcon: o = "⚙", logoutIcon: i = "↪" }) {
|
|
2144
|
+
const { collapsed: l } = se(), [c, d] = w(!1), m = A(null);
|
|
2145
|
+
return P(() => {
|
|
2146
|
+
if (!c) return;
|
|
2147
|
+
const f = (h) => {
|
|
2148
|
+
(!(h.target instanceof Node) || !m.current?.parentElement?.contains(h.target)) && d(!1);
|
|
2149
|
+
}, v = (h) => {
|
|
2150
|
+
h.key === "Escape" && (d(!1), m.current?.focus());
|
|
2151
|
+
};
|
|
2152
|
+
return document.addEventListener("mousedown", f), document.addEventListener("keydown", v), () => {
|
|
2153
|
+
document.removeEventListener("mousedown", f), document.removeEventListener("keydown", v);
|
|
2154
|
+
};
|
|
2155
|
+
}, [c]), l ? /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-navbar__profile fsc-ohm-navbar__profile--collapsed", children: [
|
|
2156
|
+
/* @__PURE__ */ t.jsx("button", { ref: m, type: "button", "aria-label": typeof r == "string" ? r : "Profile", "aria-expanded": c, onClick: () => d(!c), children: /* @__PURE__ */ t.jsx(_e, { ...e }) }),
|
|
2157
|
+
c ? /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-navbar__profile-popup", role: "menu", children: [
|
|
2158
|
+
/* @__PURE__ */ t.jsx("a", { role: "menuitem", href: n, children: "Profile" }),
|
|
2159
|
+
/* @__PURE__ */ t.jsx("a", { role: "menuitem", href: a, children: "Settings" }),
|
|
2160
|
+
/* @__PURE__ */ t.jsx("button", { role: "menuitem", type: "button", onClick: () => {
|
|
2161
|
+
d(!1), s();
|
|
2162
|
+
}, children: "Logout" })
|
|
2163
|
+
] }) : null
|
|
2164
|
+
] }) : /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-navbar__profile", children: [
|
|
2165
|
+
/* @__PURE__ */ t.jsxs("a", { href: n, children: [
|
|
2166
|
+
/* @__PURE__ */ t.jsx(_e, { ...e }),
|
|
2167
|
+
/* @__PURE__ */ t.jsx("span", { children: r })
|
|
2168
|
+
] }),
|
|
2169
|
+
/* @__PURE__ */ t.jsx("a", { href: a, "aria-label": "Settings", title: "Settings", children: o }),
|
|
2170
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", onClick: s, "aria-label": "Logout", title: "Logout", children: i })
|
|
2171
|
+
] });
|
|
2172
|
+
}
|
|
2173
|
+
function kr({
|
|
2174
|
+
title: e,
|
|
2175
|
+
description: r,
|
|
2176
|
+
breadcrumb: n,
|
|
2177
|
+
backAction: a,
|
|
2178
|
+
actions: s,
|
|
2179
|
+
className: o
|
|
2180
|
+
}) {
|
|
2181
|
+
const i = ["fsc-ohm-page-header", o].filter(Boolean).join(" ");
|
|
2182
|
+
return /* @__PURE__ */ t.jsxs("header", { className: i, children: [
|
|
2183
|
+
(n || a) && /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-page-header__navigation", children: [
|
|
2184
|
+
a,
|
|
2185
|
+
n && /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-page-header__breadcrumb", children: n })
|
|
2186
|
+
] }),
|
|
2187
|
+
/* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-page-header__main", children: [
|
|
2188
|
+
/* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-page-header__content", children: [
|
|
2189
|
+
/* @__PURE__ */ t.jsx("h1", { className: "fsc-ohm-page-header__title", children: e }),
|
|
2190
|
+
r && /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-page-header__description", children: r })
|
|
2191
|
+
] }),
|
|
2192
|
+
s && /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-page-header__actions", children: s })
|
|
2193
|
+
] })
|
|
2194
|
+
] });
|
|
2195
|
+
}
|
|
2196
|
+
function Er({ photos: e = [], columns: r = 4, emptyState: n = "Žiadne fotografie", className: a, onOpen: s, onShare: o, onDelete: i }) {
|
|
2197
|
+
const l = ["fsc-ohm-photo-grid", a].filter(Boolean).join(" "), c = { "--fsc-ohm-photo-grid-columns": Math.max(1, r) };
|
|
2198
|
+
return /* @__PURE__ */ t.jsx("div", { className: l, style: c, children: e.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-photo-grid__empty", children: n }) : /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-photo-grid__items", children: e.map((d) => /* @__PURE__ */ t.jsxs("article", { className: "fsc-ohm-photo-grid__item", children: [
|
|
2199
|
+
/* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-photo-grid__media", children: [
|
|
2200
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", className: "fsc-ohm-photo-grid__preview", "aria-label": "Otvoriť fotografiu " + (d.alt ?? ""), onClick: () => s?.(d), children: /* @__PURE__ */ t.jsx("img", { src: d.src, alt: d.alt ?? "" }) }),
|
|
2201
|
+
o || i ? /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-photo-grid__overlay", children: [
|
|
2202
|
+
/* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-photo-grid__overlay-left", children: o ? /* @__PURE__ */ t.jsx("button", { type: "button", className: "fsc-ohm-photo-grid__overlay-action", "aria-label": "Zdieľať fotografiu " + (d.alt ?? ""), onClick: () => o(d), children: "Zdieľať" }) : null }),
|
|
2203
|
+
/* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-photo-grid__overlay-right", children: i ? /* @__PURE__ */ t.jsx("button", { type: "button", className: "fsc-ohm-photo-grid__overlay-action", "aria-label": "Odstrániť fotografiu " + (d.alt ?? ""), onClick: () => i(d), children: "Odstrániť" }) : null })
|
|
2204
|
+
] }) : null
|
|
2205
|
+
] }),
|
|
2206
|
+
d.title ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-photo-grid__footer", children: /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-photo-grid__title", title: String(d.title), children: d.title }) }) : null
|
|
2207
|
+
] }, d.id)) }) });
|
|
2208
|
+
}
|
|
2209
|
+
function Cr({
|
|
2210
|
+
search: e,
|
|
2211
|
+
filters: r,
|
|
2212
|
+
actions: n,
|
|
2213
|
+
className: a,
|
|
2214
|
+
"aria-label": s = "Vyhľadávanie a filtre",
|
|
2215
|
+
...o
|
|
2216
|
+
}) {
|
|
2217
|
+
const i = ["ohm-search-filter-section", a].filter(Boolean).join(" ");
|
|
2218
|
+
return /* @__PURE__ */ t.jsxs(
|
|
2219
|
+
"section",
|
|
2220
|
+
{
|
|
2221
|
+
...o,
|
|
2222
|
+
className: i,
|
|
2223
|
+
"aria-label": s,
|
|
2224
|
+
"data-has-filters": r ? "true" : "false",
|
|
2225
|
+
"data-has-actions": n ? "true" : "false",
|
|
2226
|
+
children: [
|
|
2227
|
+
/* @__PURE__ */ t.jsxs("div", { className: "ohm-search-filter-section__controls", children: [
|
|
2228
|
+
/* @__PURE__ */ t.jsx("div", { className: "ohm-search-filter-section__search", children: e }),
|
|
2229
|
+
r ? /* @__PURE__ */ t.jsx("div", { className: "ohm-search-filter-section__filters", children: r }) : null
|
|
2230
|
+
] }),
|
|
2231
|
+
n ? /* @__PURE__ */ t.jsx("div", { className: "ohm-search-filter-section__actions", children: n }) : null
|
|
2232
|
+
]
|
|
2233
|
+
}
|
|
2234
|
+
);
|
|
2235
|
+
}
|
|
2236
|
+
function Tr({ children: e, className: r }) {
|
|
2237
|
+
return /* @__PURE__ */ t.jsx("div", { className: ["fsc-ohm-table__structure", r].filter(Boolean).join(" "), children: e });
|
|
2238
|
+
}
|
|
2239
|
+
function Rr({ children: e, className: r }) {
|
|
2240
|
+
return /* @__PURE__ */ t.jsx("div", { className: ["fsc-ohm-table__standalone-caption", r].filter(Boolean).join(" "), children: e });
|
|
2241
|
+
}
|
|
2242
|
+
function Pr({ children: e, className: r }) {
|
|
2243
|
+
return /* @__PURE__ */ t.jsx("tfoot", { className: r, children: e });
|
|
2244
|
+
}
|
|
2245
|
+
function Or({ expanded: e = !1, onChange: r, disabled: n = !1, label: a = "Rozbaliť riadok" }) {
|
|
2246
|
+
return /* @__PURE__ */ t.jsx("button", { type: "button", className: "fsc-ohm-table__icon-button", disabled: n, "aria-expanded": e, "aria-label": a, onClick: () => r?.(!e), children: e ? "−" : "+" });
|
|
2247
|
+
}
|
|
2248
|
+
function Ar({
|
|
2249
|
+
trigger: e,
|
|
2250
|
+
children: r,
|
|
2251
|
+
open: n,
|
|
2252
|
+
defaultOpen: a = !1,
|
|
2253
|
+
onOpenChange: s,
|
|
2254
|
+
ariaLabel: o = "Filters"
|
|
2255
|
+
}) {
|
|
2256
|
+
const [i, l] = w(a), c = A(null), d = n !== void 0, m = d ? n : i, f = (v) => {
|
|
2257
|
+
d || l(v), s?.(v);
|
|
2258
|
+
};
|
|
2259
|
+
return P(() => {
|
|
2260
|
+
if (!m) return;
|
|
2261
|
+
const v = (x) => {
|
|
2262
|
+
c.current?.contains(x.target) || f(!1);
|
|
2263
|
+
}, h = (x) => {
|
|
2264
|
+
x.key === "Escape" && f(!1);
|
|
2265
|
+
};
|
|
2266
|
+
return document.addEventListener("pointerdown", v), document.addEventListener("keydown", h), () => {
|
|
2267
|
+
document.removeEventListener("pointerdown", v), document.removeEventListener("keydown", h);
|
|
2268
|
+
};
|
|
2269
|
+
}, [m]), /* @__PURE__ */ t.jsxs("div", { ref: c, className: "fsc-filter-menu", children: [
|
|
2270
|
+
/* @__PURE__ */ t.jsx(
|
|
2271
|
+
"button",
|
|
2272
|
+
{
|
|
2273
|
+
type: "button",
|
|
2274
|
+
className: "fsc-filter-menu__trigger",
|
|
2275
|
+
"aria-haspopup": "dialog",
|
|
2276
|
+
"aria-expanded": m,
|
|
2277
|
+
onClick: () => f(!m),
|
|
2278
|
+
children: e
|
|
2279
|
+
}
|
|
2280
|
+
),
|
|
2281
|
+
m ? /* @__PURE__ */ t.jsx("div", { className: "fsc-filter-menu__popup", role: "dialog", "aria-label": o, children: r }) : null
|
|
2282
|
+
] });
|
|
2283
|
+
}
|
|
2284
|
+
function zr({ items: e }) {
|
|
2285
|
+
return /* @__PURE__ */ t.jsx("div", { children: e.map((r) => /* @__PURE__ */ t.jsxs("details", { children: [
|
|
2286
|
+
/* @__PURE__ */ t.jsx("summary", { children: r.title }),
|
|
2287
|
+
/* @__PURE__ */ t.jsx("div", { children: r.content })
|
|
1406
2288
|
] }, r.id)) });
|
|
1407
2289
|
}
|
|
1408
|
-
function $
|
|
1409
|
-
return /* @__PURE__ */
|
|
2290
|
+
function $r({ children: e, variant: r = "info", ...n }) {
|
|
2291
|
+
return /* @__PURE__ */ t.jsx("div", { ...n, role: "alert", "data-variant": r, children: e });
|
|
1410
2292
|
}
|
|
1411
|
-
function
|
|
1412
|
-
return e ? /* @__PURE__ */
|
|
2293
|
+
function Lr({ src: e, alt: r = "", fallback: n, ...a }) {
|
|
2294
|
+
return e ? /* @__PURE__ */ t.jsx("img", { ...a, src: e, alt: r }) : /* @__PURE__ */ t.jsx("span", { ...a, role: "img", "aria-label": r, children: n });
|
|
1413
2295
|
}
|
|
1414
|
-
function
|
|
2296
|
+
function Ir({
|
|
1415
2297
|
children: e,
|
|
1416
2298
|
variant: r = "neutral",
|
|
1417
|
-
size:
|
|
1418
|
-
...
|
|
2299
|
+
size: n = "medium",
|
|
2300
|
+
...a
|
|
1419
2301
|
}) {
|
|
1420
|
-
return /* @__PURE__ */
|
|
2302
|
+
return /* @__PURE__ */ t.jsx(
|
|
1421
2303
|
"span",
|
|
1422
2304
|
{
|
|
1423
|
-
...
|
|
2305
|
+
...a,
|
|
1424
2306
|
"data-variant": r,
|
|
1425
|
-
"data-size":
|
|
2307
|
+
"data-size": n,
|
|
1426
2308
|
children: e
|
|
1427
2309
|
}
|
|
1428
2310
|
);
|
|
1429
2311
|
}
|
|
1430
|
-
function
|
|
2312
|
+
function Fr({
|
|
1431
2313
|
children: e,
|
|
1432
2314
|
variant: r = "primary",
|
|
1433
|
-
size:
|
|
1434
|
-
loading:
|
|
2315
|
+
size: n = "medium",
|
|
2316
|
+
loading: a = !1,
|
|
1435
2317
|
disabled: s = !1,
|
|
1436
2318
|
type: o = "button",
|
|
1437
2319
|
className: i,
|
|
1438
|
-
...
|
|
2320
|
+
...l
|
|
1439
2321
|
}) {
|
|
1440
|
-
const
|
|
1441
|
-
return /* @__PURE__ */
|
|
2322
|
+
const c = s || a;
|
|
2323
|
+
return /* @__PURE__ */ t.jsx(
|
|
1442
2324
|
"button",
|
|
1443
2325
|
{
|
|
1444
|
-
...
|
|
2326
|
+
...l,
|
|
1445
2327
|
className: i ? `fsc-button ${i}` : "fsc-button",
|
|
1446
2328
|
type: o,
|
|
1447
2329
|
"data-variant": r,
|
|
1448
|
-
"data-size":
|
|
1449
|
-
"data-loading":
|
|
1450
|
-
"aria-busy":
|
|
1451
|
-
"aria-disabled":
|
|
1452
|
-
disabled:
|
|
2330
|
+
"data-size": n,
|
|
2331
|
+
"data-loading": a || void 0,
|
|
2332
|
+
"aria-busy": a || void 0,
|
|
2333
|
+
"aria-disabled": c || void 0,
|
|
2334
|
+
disabled: c,
|
|
1453
2335
|
children: e
|
|
1454
2336
|
}
|
|
1455
2337
|
);
|
|
1456
2338
|
}
|
|
1457
|
-
function
|
|
2339
|
+
function Mr({
|
|
1458
2340
|
children: e,
|
|
1459
2341
|
padding: r = "medium",
|
|
1460
|
-
variant:
|
|
1461
|
-
...
|
|
2342
|
+
variant: n = "default",
|
|
2343
|
+
...a
|
|
1462
2344
|
}) {
|
|
1463
|
-
return /* @__PURE__ */
|
|
2345
|
+
return /* @__PURE__ */ t.jsx(
|
|
1464
2346
|
"div",
|
|
1465
2347
|
{
|
|
1466
|
-
...
|
|
2348
|
+
...a,
|
|
1467
2349
|
"data-padding": r,
|
|
1468
|
-
"data-variant":
|
|
2350
|
+
"data-variant": n,
|
|
1469
2351
|
children: e
|
|
1470
2352
|
}
|
|
1471
2353
|
);
|
|
1472
2354
|
}
|
|
1473
|
-
function
|
|
1474
|
-
const [
|
|
2355
|
+
function Dr({ items: e, initialIndex: r = 0, onIndexChange: n }) {
|
|
2356
|
+
const [a, s] = w(r);
|
|
1475
2357
|
if (!e.length) return null;
|
|
1476
2358
|
const o = (i) => {
|
|
1477
|
-
const
|
|
1478
|
-
s(
|
|
2359
|
+
const l = (i + e.length) % e.length;
|
|
2360
|
+
s(l), n?.(l);
|
|
1479
2361
|
};
|
|
1480
|
-
return /* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1482
|
-
/* @__PURE__ */
|
|
1483
|
-
/* @__PURE__ */
|
|
1484
|
-
|
|
2362
|
+
return /* @__PURE__ */ t.jsxs("section", { "aria-roledescription": "carousel", children: [
|
|
2363
|
+
/* @__PURE__ */ t.jsx("div", { "aria-live": "polite", children: e[a] }),
|
|
2364
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", onClick: () => o(a - 1), children: "Previous" }),
|
|
2365
|
+
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
2366
|
+
a + 1,
|
|
1485
2367
|
" / ",
|
|
1486
2368
|
e.length
|
|
1487
2369
|
] }),
|
|
1488
|
-
/* @__PURE__ */
|
|
2370
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", onClick: () => o(a + 1), children: "Next" })
|
|
1489
2371
|
] });
|
|
1490
2372
|
}
|
|
1491
|
-
function
|
|
2373
|
+
function Br({
|
|
1492
2374
|
size: e = "medium",
|
|
1493
2375
|
disabled: r = !1,
|
|
1494
|
-
...
|
|
2376
|
+
...n
|
|
1495
2377
|
}) {
|
|
1496
|
-
return /* @__PURE__ */
|
|
2378
|
+
return /* @__PURE__ */ t.jsx(
|
|
1497
2379
|
"input",
|
|
1498
2380
|
{
|
|
1499
|
-
...
|
|
2381
|
+
...n,
|
|
1500
2382
|
type: "checkbox",
|
|
1501
2383
|
"data-size": e,
|
|
1502
2384
|
disabled: r
|
|
1503
2385
|
}
|
|
1504
2386
|
);
|
|
1505
2387
|
}
|
|
1506
|
-
function
|
|
1507
|
-
const [o, i] =
|
|
1508
|
-
return /* @__PURE__ */
|
|
1509
|
-
/* @__PURE__ */
|
|
1510
|
-
/* @__PURE__ */
|
|
1511
|
-
|
|
1512
|
-
}, children:
|
|
2388
|
+
function Vr({ options: e, value: r, defaultValue: n, placeholder: a = "Select...", onValueChange: s }) {
|
|
2389
|
+
const [o, i] = w(""), [l, c] = w(n ?? ""), d = r ?? l, m = I(() => e.filter((f) => String(f.label).toLowerCase().includes(o.toLowerCase())), [e, o]);
|
|
2390
|
+
return /* @__PURE__ */ t.jsxs("div", { children: [
|
|
2391
|
+
/* @__PURE__ */ t.jsx("input", { role: "combobox", value: o, placeholder: d ? String(e.find((f) => f.value === d)?.label ?? d) : a, onChange: (f) => i(f.target.value), "aria-expanded": "true" }),
|
|
2392
|
+
/* @__PURE__ */ t.jsx("ul", { role: "listbox", children: m.map((f) => /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx("button", { type: "button", role: "option", "aria-selected": f.value === d, disabled: f.disabled, onClick: () => {
|
|
2393
|
+
c(f.value), s?.(f.value), i("");
|
|
2394
|
+
}, children: f.label }) }, f.value)) })
|
|
1513
2395
|
] });
|
|
1514
2396
|
}
|
|
1515
|
-
function
|
|
1516
|
-
const [
|
|
1517
|
-
return r ? /* @__PURE__ */
|
|
1518
|
-
/* @__PURE__ */
|
|
1519
|
-
/* @__PURE__ */
|
|
2397
|
+
function Ur({ items: e, open: r = !0, placeholder: n = "Search commands" }) {
|
|
2398
|
+
const [a, s] = w(""), o = I(() => e.filter((i) => (String(i.label) + " " + (i.keywords ?? []).join(" ")).toLowerCase().includes(a.toLowerCase())), [e, a]);
|
|
2399
|
+
return r ? /* @__PURE__ */ t.jsxs("div", { role: "dialog", "aria-label": "Command palette", children: [
|
|
2400
|
+
/* @__PURE__ */ t.jsx("input", { autoFocus: !0, value: a, placeholder: n, onChange: (i) => s(i.target.value) }),
|
|
2401
|
+
/* @__PURE__ */ t.jsx("div", { role: "listbox", children: o.map((i) => /* @__PURE__ */ t.jsx("button", { type: "button", role: "option", disabled: i.disabled, onClick: i.onSelect, children: i.label }, i.id)) })
|
|
1520
2402
|
] }) : null;
|
|
1521
2403
|
}
|
|
1522
|
-
function
|
|
1523
|
-
const [
|
|
1524
|
-
return /* @__PURE__ */
|
|
1525
|
-
s.preventDefault(),
|
|
1526
|
-
}, onBlur: () =>
|
|
2404
|
+
function Wr({ children: e, items: r }) {
|
|
2405
|
+
const [n, a] = w(!1);
|
|
2406
|
+
return /* @__PURE__ */ t.jsxs("div", { onContextMenu: (s) => {
|
|
2407
|
+
s.preventDefault(), a(!0);
|
|
2408
|
+
}, onBlur: () => a(!1), tabIndex: 0, children: [
|
|
1527
2409
|
e,
|
|
1528
|
-
|
|
1529
|
-
s.onSelect?.(),
|
|
2410
|
+
n && /* @__PURE__ */ t.jsx("div", { role: "menu", children: r.map((s, o) => /* @__PURE__ */ t.jsx("button", { type: "button", role: "menuitem", disabled: s.disabled, onClick: () => {
|
|
2411
|
+
s.onSelect?.(), a(!1);
|
|
1530
2412
|
}, children: s.label }, o)) })
|
|
1531
2413
|
] });
|
|
1532
2414
|
}
|
|
1533
|
-
function
|
|
1534
|
-
const [o, i] =
|
|
1535
|
-
return /* @__PURE__ */
|
|
1536
|
-
i(
|
|
2415
|
+
function Yr({ value: e, defaultValue: r, min: n, max: a, onValueChange: s }) {
|
|
2416
|
+
const [o, i] = w(r ?? ""), l = e ?? o;
|
|
2417
|
+
return /* @__PURE__ */ t.jsx("input", { type: "date", value: l, min: n, max: a, onChange: (c) => {
|
|
2418
|
+
i(c.target.value), s?.(c.target.value);
|
|
1537
2419
|
} });
|
|
1538
2420
|
}
|
|
1539
|
-
function
|
|
1540
|
-
return e ? /* @__PURE__ */
|
|
1541
|
-
|
|
1542
|
-
/* @__PURE__ */
|
|
2421
|
+
function Zr({ open: e, children: r, title: n, onClose: a, side: s = "right" }) {
|
|
2422
|
+
return e ? /* @__PURE__ */ t.jsxs("aside", { "data-side": s, "aria-label": typeof n == "string" ? n : void 0, children: [
|
|
2423
|
+
n && /* @__PURE__ */ t.jsx("h2", { children: n }),
|
|
2424
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", onClick: a, children: "Close" }),
|
|
1543
2425
|
r
|
|
1544
2426
|
] }) : null;
|
|
1545
2427
|
}
|
|
1546
|
-
function
|
|
1547
|
-
return /* @__PURE__ */
|
|
1548
|
-
/* @__PURE__ */
|
|
1549
|
-
/* @__PURE__ */
|
|
2428
|
+
function Qr({ label: e, items: r }) {
|
|
2429
|
+
return /* @__PURE__ */ t.jsxs("details", { children: [
|
|
2430
|
+
/* @__PURE__ */ t.jsx("summary", { children: e }),
|
|
2431
|
+
/* @__PURE__ */ t.jsx("div", { role: "menu", children: r.map((n, a) => /* @__PURE__ */ t.jsx("button", { type: "button", role: "menuitem", disabled: n.disabled, onClick: n.onSelect, children: n.label }, a)) })
|
|
1550
2432
|
] });
|
|
1551
2433
|
}
|
|
1552
|
-
function
|
|
2434
|
+
function Jr({
|
|
1553
2435
|
title: e,
|
|
1554
2436
|
description: r,
|
|
1555
|
-
action:
|
|
1556
|
-
...
|
|
2437
|
+
action: n,
|
|
2438
|
+
...a
|
|
1557
2439
|
}) {
|
|
1558
|
-
return /* @__PURE__ */
|
|
1559
|
-
/* @__PURE__ */
|
|
1560
|
-
r ? /* @__PURE__ */
|
|
1561
|
-
|
|
2440
|
+
return /* @__PURE__ */ t.jsxs("div", { ...a, role: "status", "aria-live": "polite", children: [
|
|
2441
|
+
/* @__PURE__ */ t.jsx("h2", { children: e }),
|
|
2442
|
+
r ? /* @__PURE__ */ t.jsx("p", { children: r }) : null,
|
|
2443
|
+
n ? /* @__PURE__ */ t.jsx("div", { children: n }) : null
|
|
1562
2444
|
] });
|
|
1563
2445
|
}
|
|
1564
|
-
function
|
|
2446
|
+
function Gr({
|
|
1565
2447
|
title: e = "Something went wrong",
|
|
1566
2448
|
description: r,
|
|
1567
|
-
action:
|
|
1568
|
-
...
|
|
2449
|
+
action: n,
|
|
2450
|
+
...a
|
|
1569
2451
|
}) {
|
|
1570
|
-
return /* @__PURE__ */
|
|
1571
|
-
/* @__PURE__ */
|
|
1572
|
-
r ? /* @__PURE__ */
|
|
1573
|
-
|
|
2452
|
+
return /* @__PURE__ */ t.jsxs("div", { ...a, role: "alert", "aria-live": "assertive", children: [
|
|
2453
|
+
/* @__PURE__ */ t.jsx("h2", { children: e }),
|
|
2454
|
+
r ? /* @__PURE__ */ t.jsx("p", { children: r }) : null,
|
|
2455
|
+
n ? /* @__PURE__ */ t.jsx("div", { children: n }) : null
|
|
1574
2456
|
] });
|
|
1575
2457
|
}
|
|
1576
|
-
function
|
|
1577
|
-
const s = (o) =>
|
|
1578
|
-
return /* @__PURE__ */
|
|
1579
|
-
|
|
1580
|
-
/* @__PURE__ */
|
|
2458
|
+
function Hr({ accept: e, multiple: r, children: n = "Choose files", onFilesChange: a }) {
|
|
2459
|
+
const s = (o) => a?.(Array.from(o.target.files ?? []));
|
|
2460
|
+
return /* @__PURE__ */ t.jsxs("label", { children: [
|
|
2461
|
+
n,
|
|
2462
|
+
/* @__PURE__ */ t.jsx("input", { type: "file", hidden: !0, accept: e, multiple: r, onChange: s })
|
|
1581
2463
|
] });
|
|
1582
2464
|
}
|
|
1583
|
-
function
|
|
2465
|
+
function qr({
|
|
1584
2466
|
label: e,
|
|
1585
2467
|
description: r,
|
|
1586
|
-
error:
|
|
1587
|
-
size:
|
|
2468
|
+
error: n,
|
|
2469
|
+
size: a = "medium",
|
|
1588
2470
|
id: s,
|
|
1589
2471
|
required: o = !1,
|
|
1590
2472
|
className: i,
|
|
1591
|
-
...
|
|
2473
|
+
...l
|
|
1592
2474
|
}) {
|
|
1593
|
-
const
|
|
1594
|
-
return /* @__PURE__ */
|
|
2475
|
+
const c = fe(), d = s ?? c, m = r ? `${d}-description` : void 0, f = n ? `${d}-error` : void 0, h = [l["aria-describedby"], m, f].filter(Boolean).join(" ") || void 0, x = l["aria-invalid"];
|
|
2476
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1595
2477
|
"div",
|
|
1596
2478
|
{
|
|
1597
2479
|
className: i ? `fsc-form-field ${i}` : "fsc-form-field",
|
|
1598
|
-
"data-size":
|
|
1599
|
-
"data-invalid":
|
|
2480
|
+
"data-size": a,
|
|
2481
|
+
"data-invalid": n ? "true" : void 0,
|
|
1600
2482
|
children: [
|
|
1601
|
-
/* @__PURE__ */
|
|
2483
|
+
/* @__PURE__ */ t.jsxs("label", { htmlFor: d, children: [
|
|
1602
2484
|
e,
|
|
1603
|
-
o ? /* @__PURE__ */
|
|
2485
|
+
o ? /* @__PURE__ */ t.jsx("span", { "aria-hidden": "true", children: " *" }) : null
|
|
1604
2486
|
] }),
|
|
1605
|
-
/* @__PURE__ */
|
|
2487
|
+
/* @__PURE__ */ t.jsx(
|
|
1606
2488
|
"input",
|
|
1607
2489
|
{
|
|
1608
|
-
...
|
|
1609
|
-
id:
|
|
2490
|
+
...l,
|
|
2491
|
+
id: d,
|
|
1610
2492
|
required: o,
|
|
1611
|
-
"aria-describedby":
|
|
1612
|
-
"aria-invalid":
|
|
2493
|
+
"aria-describedby": h,
|
|
2494
|
+
"aria-invalid": n ? !0 : x
|
|
1613
2495
|
}
|
|
1614
2496
|
),
|
|
1615
|
-
r ? /* @__PURE__ */
|
|
1616
|
-
|
|
2497
|
+
r ? /* @__PURE__ */ t.jsx("div", { "data-role": "description", id: m, children: r }) : null,
|
|
2498
|
+
n ? /* @__PURE__ */ t.jsx("div", { "data-role": "error", id: f, role: "alert", children: n }) : null
|
|
1617
2499
|
]
|
|
1618
2500
|
}
|
|
1619
2501
|
);
|
|
1620
2502
|
}
|
|
1621
|
-
function
|
|
1622
|
-
const
|
|
1623
|
-
return /* @__PURE__ */
|
|
2503
|
+
function Kr({ children: e, level: r = 2, ...n }) {
|
|
2504
|
+
const a = { 1: "h1", 2: "h2", 3: "h3", 4: "h4", 5: "h5", 6: "h6" }[r];
|
|
2505
|
+
return /* @__PURE__ */ t.jsx(a, { ...n, children: e });
|
|
1624
2506
|
}
|
|
1625
|
-
function
|
|
2507
|
+
function Xr({
|
|
1626
2508
|
icon: e,
|
|
1627
2509
|
label: r,
|
|
1628
|
-
variant:
|
|
1629
|
-
size:
|
|
2510
|
+
variant: n = "ghost",
|
|
2511
|
+
size: a = "medium",
|
|
1630
2512
|
loading: s = !1,
|
|
1631
2513
|
disabled: o = !1,
|
|
1632
2514
|
type: i = "button",
|
|
1633
|
-
...
|
|
2515
|
+
...l
|
|
1634
2516
|
}) {
|
|
1635
|
-
return /* @__PURE__ */
|
|
2517
|
+
return /* @__PURE__ */ t.jsx(
|
|
1636
2518
|
"button",
|
|
1637
2519
|
{
|
|
1638
|
-
...
|
|
2520
|
+
...l,
|
|
1639
2521
|
type: i,
|
|
1640
2522
|
"aria-label": r,
|
|
1641
2523
|
"aria-busy": s || void 0,
|
|
1642
|
-
"data-variant":
|
|
1643
|
-
"data-size":
|
|
2524
|
+
"data-variant": n,
|
|
2525
|
+
"data-size": a,
|
|
1644
2526
|
disabled: o || s,
|
|
1645
2527
|
children: e
|
|
1646
2528
|
}
|
|
1647
2529
|
);
|
|
1648
2530
|
}
|
|
1649
|
-
function
|
|
2531
|
+
function en({
|
|
1650
2532
|
size: e = "medium",
|
|
1651
2533
|
disabled: r = !1,
|
|
1652
|
-
className:
|
|
1653
|
-
...
|
|
2534
|
+
className: n,
|
|
2535
|
+
...a
|
|
1654
2536
|
}) {
|
|
1655
|
-
return /* @__PURE__ */
|
|
2537
|
+
return /* @__PURE__ */ t.jsx(
|
|
1656
2538
|
"input",
|
|
1657
2539
|
{
|
|
1658
|
-
...
|
|
1659
|
-
className:
|
|
2540
|
+
...a,
|
|
2541
|
+
className: n ? `fsc-input ${n}` : "fsc-input",
|
|
1660
2542
|
"data-size": e,
|
|
1661
2543
|
disabled: r
|
|
1662
2544
|
}
|
|
1663
2545
|
);
|
|
1664
2546
|
}
|
|
1665
|
-
function
|
|
2547
|
+
function tn({
|
|
1666
2548
|
children: e,
|
|
1667
2549
|
required: r = !1,
|
|
1668
|
-
"aria-label":
|
|
1669
|
-
...
|
|
2550
|
+
"aria-label": n,
|
|
2551
|
+
...a
|
|
1670
2552
|
}) {
|
|
1671
|
-
const s =
|
|
1672
|
-
return /* @__PURE__ */
|
|
2553
|
+
const s = n ?? (r && typeof e == "string" ? e : void 0);
|
|
2554
|
+
return /* @__PURE__ */ t.jsxs("label", { ...a, "aria-label": s, children: [
|
|
1673
2555
|
e,
|
|
1674
|
-
r ? /* @__PURE__ */
|
|
2556
|
+
r ? /* @__PURE__ */ t.jsx("span", { "aria-hidden": "true", children: " *" }) : null
|
|
1675
2557
|
] });
|
|
1676
2558
|
}
|
|
1677
|
-
function
|
|
1678
|
-
return /* @__PURE__ */
|
|
2559
|
+
function rn({ children: e, ...r }) {
|
|
2560
|
+
return /* @__PURE__ */ t.jsx("a", { ...r, children: e });
|
|
1679
2561
|
}
|
|
1680
|
-
function
|
|
1681
|
-
return /* @__PURE__ */
|
|
1682
|
-
/* @__PURE__ */
|
|
1683
|
-
r.items && /* @__PURE__ */
|
|
1684
|
-
] },
|
|
2562
|
+
function nn({ items: e }) {
|
|
2563
|
+
return /* @__PURE__ */ t.jsx("nav", { "aria-label": "Menu", children: /* @__PURE__ */ t.jsx("ul", { role: "menubar", children: e.map((r, n) => /* @__PURE__ */ t.jsxs("li", { children: [
|
|
2564
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", role: "menuitem", children: r.label }),
|
|
2565
|
+
r.items && /* @__PURE__ */ t.jsx("ul", { role: "menu", children: r.items.map((a, s) => /* @__PURE__ */ t.jsx("li", { children: a }, s)) })
|
|
2566
|
+
] }, n)) }) });
|
|
1685
2567
|
}
|
|
1686
|
-
const
|
|
2568
|
+
const Wt = [
|
|
1687
2569
|
"a[href]",
|
|
1688
2570
|
"area[href]",
|
|
1689
2571
|
"button:not([disabled])",
|
|
@@ -1693,163 +2575,163 @@ const it = [
|
|
|
1693
2575
|
'[contenteditable="true"]',
|
|
1694
2576
|
'[tabindex]:not([tabindex="-1"])'
|
|
1695
2577
|
].join(",");
|
|
1696
|
-
function
|
|
2578
|
+
function an({
|
|
1697
2579
|
open: e,
|
|
1698
2580
|
title: r,
|
|
1699
|
-
children:
|
|
1700
|
-
onClose:
|
|
2581
|
+
children: n,
|
|
2582
|
+
onClose: a,
|
|
1701
2583
|
dismissible: s = !0,
|
|
1702
2584
|
...o
|
|
1703
2585
|
}) {
|
|
1704
|
-
const i =
|
|
1705
|
-
return
|
|
2586
|
+
const i = fe(), l = A(null), c = A(null), d = A(a);
|
|
2587
|
+
return d.current = a, P(() => {
|
|
1706
2588
|
if (!e) return;
|
|
1707
|
-
|
|
1708
|
-
const
|
|
2589
|
+
c.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
|
|
2590
|
+
const m = document.body.style.overflow;
|
|
1709
2591
|
document.body.style.overflow = "hidden";
|
|
1710
|
-
const
|
|
1711
|
-
|
|
1712
|
-
}),
|
|
1713
|
-
if (
|
|
1714
|
-
|
|
2592
|
+
const f = requestAnimationFrame(() => {
|
|
2593
|
+
l.current?.focus();
|
|
2594
|
+
}), v = (h) => {
|
|
2595
|
+
if (h.key === "Escape" && s) {
|
|
2596
|
+
h.preventDefault(), d.current?.();
|
|
1715
2597
|
return;
|
|
1716
2598
|
}
|
|
1717
|
-
if (
|
|
1718
|
-
const
|
|
1719
|
-
if (!
|
|
1720
|
-
const
|
|
1721
|
-
|
|
1722
|
-
).filter((
|
|
1723
|
-
if (
|
|
1724
|
-
|
|
2599
|
+
if (h.key !== "Tab") return;
|
|
2600
|
+
const x = l.current;
|
|
2601
|
+
if (!x) return;
|
|
2602
|
+
const b = Array.from(
|
|
2603
|
+
x.querySelectorAll(Wt)
|
|
2604
|
+
).filter((T) => T.getAttribute("aria-hidden") !== "true");
|
|
2605
|
+
if (b.length === 0) {
|
|
2606
|
+
h.preventDefault(), x.focus();
|
|
1725
2607
|
return;
|
|
1726
2608
|
}
|
|
1727
|
-
const
|
|
1728
|
-
if (
|
|
1729
|
-
(
|
|
2609
|
+
const p = document.activeElement, j = b.indexOf(p);
|
|
2610
|
+
if (h.preventDefault(), p === x || j === -1) {
|
|
2611
|
+
(h.shiftKey ? b[b.length - 1] : b[0]).focus();
|
|
1730
2612
|
return;
|
|
1731
2613
|
}
|
|
1732
|
-
const C =
|
|
1733
|
-
|
|
2614
|
+
const C = h.shiftKey ? (j - 1 + b.length) % b.length : (j + 1) % b.length;
|
|
2615
|
+
b[C].focus();
|
|
1734
2616
|
};
|
|
1735
|
-
return document.addEventListener("keydown",
|
|
1736
|
-
cancelAnimationFrame(
|
|
2617
|
+
return document.addEventListener("keydown", v), () => {
|
|
2618
|
+
cancelAnimationFrame(f), document.removeEventListener("keydown", v), document.body.style.overflow = m, c.current?.focus();
|
|
1737
2619
|
};
|
|
1738
|
-
}, [s, e]), e ? /* @__PURE__ */
|
|
2620
|
+
}, [s, e]), e ? /* @__PURE__ */ t.jsx(
|
|
1739
2621
|
"div",
|
|
1740
2622
|
{
|
|
1741
2623
|
role: "presentation",
|
|
1742
2624
|
"data-modal-backdrop": "true",
|
|
1743
|
-
onMouseDown: (
|
|
1744
|
-
s &&
|
|
2625
|
+
onMouseDown: (m) => {
|
|
2626
|
+
s && m.target === m.currentTarget && d.current?.();
|
|
1745
2627
|
},
|
|
1746
|
-
children: /* @__PURE__ */
|
|
2628
|
+
children: /* @__PURE__ */ t.jsxs(
|
|
1747
2629
|
"div",
|
|
1748
2630
|
{
|
|
1749
2631
|
...o,
|
|
1750
|
-
ref:
|
|
2632
|
+
ref: l,
|
|
1751
2633
|
role: "dialog",
|
|
1752
2634
|
"aria-modal": "true",
|
|
1753
2635
|
"aria-labelledby": i,
|
|
1754
2636
|
tabIndex: -1,
|
|
1755
2637
|
children: [
|
|
1756
|
-
/* @__PURE__ */
|
|
1757
|
-
/* @__PURE__ */
|
|
2638
|
+
/* @__PURE__ */ t.jsx("header", { children: /* @__PURE__ */ t.jsx("h2", { id: i, children: r }) }),
|
|
2639
|
+
/* @__PURE__ */ t.jsx("div", { children: n })
|
|
1758
2640
|
]
|
|
1759
2641
|
}
|
|
1760
2642
|
)
|
|
1761
2643
|
}
|
|
1762
2644
|
) : null;
|
|
1763
2645
|
}
|
|
1764
|
-
function
|
|
1765
|
-
const [s, o] =
|
|
1766
|
-
const
|
|
1767
|
-
o(
|
|
2646
|
+
function sn({ options: e, value: r, defaultValue: n = [], onValueChange: a }) {
|
|
2647
|
+
const [s, o] = w(n), i = r ?? s, l = (c) => {
|
|
2648
|
+
const d = i.includes(c) ? i.filter((m) => m !== c) : [...i, c];
|
|
2649
|
+
o(d), a?.(d);
|
|
1768
2650
|
};
|
|
1769
|
-
return /* @__PURE__ */
|
|
1770
|
-
/* @__PURE__ */
|
|
1771
|
-
|
|
1772
|
-
] },
|
|
1773
|
-
}
|
|
1774
|
-
function
|
|
1775
|
-
const r = (
|
|
1776
|
-
|
|
1777
|
-
|
|
2651
|
+
return /* @__PURE__ */ t.jsx("div", { role: "group", children: e.map((c) => /* @__PURE__ */ t.jsxs("label", { children: [
|
|
2652
|
+
/* @__PURE__ */ t.jsx("input", { type: "checkbox", checked: i.includes(c.value), disabled: c.disabled, onChange: () => l(c.value) }),
|
|
2653
|
+
c.label
|
|
2654
|
+
] }, c.value)) });
|
|
2655
|
+
}
|
|
2656
|
+
function on({ items: e }) {
|
|
2657
|
+
const r = (n) => n.map((a, s) => /* @__PURE__ */ t.jsxs("li", { children: [
|
|
2658
|
+
a.href ? /* @__PURE__ */ t.jsx("a", { href: a.href, children: a.label }) : /* @__PURE__ */ t.jsx("span", { children: a.label }),
|
|
2659
|
+
a.children && /* @__PURE__ */ t.jsx("ul", { children: r(a.children) })
|
|
1778
2660
|
] }, s));
|
|
1779
|
-
return /* @__PURE__ */
|
|
2661
|
+
return /* @__PURE__ */ t.jsx("nav", { "aria-label": "Navigation", children: /* @__PURE__ */ t.jsx("ul", { children: r(e) }) });
|
|
1780
2662
|
}
|
|
1781
|
-
function
|
|
1782
|
-
return /* @__PURE__ */
|
|
1783
|
-
/* @__PURE__ */
|
|
1784
|
-
/* @__PURE__ */
|
|
2663
|
+
function ln({ page: e, pageCount: r, onPageChange: n, ...a }) {
|
|
2664
|
+
return /* @__PURE__ */ t.jsxs("nav", { ...a, "aria-label": "Pagination", children: [
|
|
2665
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", disabled: e <= 1, onClick: () => n?.(e - 1), children: "Previous" }),
|
|
2666
|
+
/* @__PURE__ */ t.jsxs("span", { children: [
|
|
1785
2667
|
e,
|
|
1786
2668
|
" / ",
|
|
1787
2669
|
r
|
|
1788
2670
|
] }),
|
|
1789
|
-
/* @__PURE__ */
|
|
2671
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", disabled: e >= r, onClick: () => n?.(e + 1), children: "Next" })
|
|
1790
2672
|
] });
|
|
1791
2673
|
}
|
|
1792
|
-
function
|
|
1793
|
-
const [s, o] =
|
|
1794
|
-
o(
|
|
2674
|
+
function cn({ trigger: e, children: r, open: n, onOpenChange: a }) {
|
|
2675
|
+
const [s, o] = w(!1), i = n ?? s, l = (c) => {
|
|
2676
|
+
o(c), a?.(c);
|
|
1795
2677
|
};
|
|
1796
|
-
return /* @__PURE__ */
|
|
1797
|
-
/* @__PURE__ */
|
|
1798
|
-
i && /* @__PURE__ */
|
|
2678
|
+
return /* @__PURE__ */ t.jsxs("div", { children: [
|
|
2679
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", onClick: () => l(!i), "aria-expanded": i, children: e }),
|
|
2680
|
+
i && /* @__PURE__ */ t.jsxs("div", { role: "dialog", children: [
|
|
1799
2681
|
r,
|
|
1800
|
-
/* @__PURE__ */
|
|
2682
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", onClick: () => l(!1), children: "Close" })
|
|
1801
2683
|
] })
|
|
1802
2684
|
] });
|
|
1803
2685
|
}
|
|
1804
|
-
function
|
|
1805
|
-
return /* @__PURE__ */
|
|
2686
|
+
function dn({ value: e = 0, max: r = 100, label: n, ...a }) {
|
|
2687
|
+
return /* @__PURE__ */ t.jsx("div", { ...a, role: "progressbar", "aria-label": n, "aria-valuenow": e, "aria-valuemin": 0, "aria-valuemax": r });
|
|
1806
2688
|
}
|
|
1807
|
-
function
|
|
2689
|
+
function un({
|
|
1808
2690
|
size: e = "medium",
|
|
1809
2691
|
disabled: r = !1,
|
|
1810
|
-
...
|
|
2692
|
+
...n
|
|
1811
2693
|
}) {
|
|
1812
|
-
return /* @__PURE__ */
|
|
2694
|
+
return /* @__PURE__ */ t.jsx(
|
|
1813
2695
|
"input",
|
|
1814
2696
|
{
|
|
1815
|
-
...
|
|
2697
|
+
...n,
|
|
1816
2698
|
type: "radio",
|
|
1817
2699
|
"data-size": e,
|
|
1818
2700
|
disabled: r
|
|
1819
2701
|
}
|
|
1820
2702
|
);
|
|
1821
2703
|
}
|
|
1822
|
-
function
|
|
1823
|
-
const [s, o] =
|
|
1824
|
-
return /* @__PURE__ */
|
|
1825
|
-
/* @__PURE__ */
|
|
1826
|
-
/* @__PURE__ */
|
|
2704
|
+
function fn({ children: e, initialSize: r = 300, minSize: n = 120, maxSize: a = 800 }) {
|
|
2705
|
+
const [s, o] = w(r);
|
|
2706
|
+
return /* @__PURE__ */ t.jsxs("div", { style: { width: s }, children: [
|
|
2707
|
+
/* @__PURE__ */ t.jsx("div", { children: e }),
|
|
2708
|
+
/* @__PURE__ */ t.jsx("input", { "aria-label": "Panel size", type: "range", min: n, max: a, value: s, onChange: (i) => o(Number(i.target.value)) })
|
|
1827
2709
|
] });
|
|
1828
2710
|
}
|
|
1829
|
-
function
|
|
1830
|
-
return /* @__PURE__ */
|
|
1831
|
-
/* @__PURE__ */
|
|
1832
|
-
e && /* @__PURE__ */
|
|
2711
|
+
function mn({ onClear: e, ...r }) {
|
|
2712
|
+
return /* @__PURE__ */ t.jsxs("div", { children: [
|
|
2713
|
+
/* @__PURE__ */ t.jsx("input", { ...r, type: "search" }),
|
|
2714
|
+
e && /* @__PURE__ */ t.jsx("button", { type: "button", onClick: e, children: "Clear" })
|
|
1833
2715
|
] });
|
|
1834
2716
|
}
|
|
1835
|
-
const
|
|
2717
|
+
const Yt = [
|
|
1836
2718
|
{ value: "first", label: "First option" },
|
|
1837
2719
|
{ value: "second", label: "Second option" },
|
|
1838
2720
|
{ value: "third", label: "Third option" }
|
|
1839
2721
|
];
|
|
1840
|
-
function
|
|
2722
|
+
function hn({
|
|
1841
2723
|
size: e = "medium",
|
|
1842
|
-
options: r =
|
|
1843
|
-
disabled:
|
|
1844
|
-
...
|
|
2724
|
+
options: r = Yt,
|
|
2725
|
+
disabled: n = !1,
|
|
2726
|
+
...a
|
|
1845
2727
|
}) {
|
|
1846
|
-
return /* @__PURE__ */
|
|
2728
|
+
return /* @__PURE__ */ t.jsx(
|
|
1847
2729
|
"select",
|
|
1848
2730
|
{
|
|
1849
|
-
...
|
|
2731
|
+
...a,
|
|
1850
2732
|
"data-size": e,
|
|
1851
|
-
disabled:
|
|
1852
|
-
children: r.map((s) => /* @__PURE__ */
|
|
2733
|
+
disabled: n,
|
|
2734
|
+
children: r.map((s) => /* @__PURE__ */ t.jsx(
|
|
1853
2735
|
"option",
|
|
1854
2736
|
{
|
|
1855
2737
|
value: s.value,
|
|
@@ -1861,57 +2743,57 @@ function dr({
|
|
|
1861
2743
|
}
|
|
1862
2744
|
);
|
|
1863
2745
|
}
|
|
1864
|
-
function
|
|
1865
|
-
return /* @__PURE__ */
|
|
2746
|
+
function pn({ orientation: e = "horizontal", ...r }) {
|
|
2747
|
+
return /* @__PURE__ */ t.jsx("hr", { ...r, "aria-orientation": e });
|
|
1866
2748
|
}
|
|
1867
|
-
function
|
|
1868
|
-
return /* @__PURE__ */
|
|
2749
|
+
function bn({ children: e, open: r = !0, width: n = "280px" }) {
|
|
2750
|
+
return /* @__PURE__ */ t.jsx("aside", { hidden: !r, style: { width: n }, "aria-label": "Sidebar", children: e });
|
|
1869
2751
|
}
|
|
1870
|
-
function
|
|
1871
|
-
return /* @__PURE__ */
|
|
2752
|
+
function xn({ width: e, height: r, variant: n = "rect", style: a, ...s }) {
|
|
2753
|
+
return /* @__PURE__ */ t.jsx("div", { ...s, "aria-hidden": "true", "data-variant": n, style: { width: e, height: r, ...a } });
|
|
1872
2754
|
}
|
|
1873
|
-
function
|
|
1874
|
-
return /* @__PURE__ */
|
|
2755
|
+
function vn({ label: e = "Loading", ...r }) {
|
|
2756
|
+
return /* @__PURE__ */ t.jsx("span", { ...r, role: "status", "aria-label": e });
|
|
1875
2757
|
}
|
|
1876
|
-
function
|
|
2758
|
+
function jn({
|
|
1877
2759
|
label: e,
|
|
1878
2760
|
value: r,
|
|
1879
|
-
description:
|
|
1880
|
-
trend:
|
|
2761
|
+
description: n,
|
|
2762
|
+
trend: a = "neutral",
|
|
1881
2763
|
trendValue: s,
|
|
1882
2764
|
className: o,
|
|
1883
2765
|
...i
|
|
1884
2766
|
}) {
|
|
1885
|
-
return /* @__PURE__ */
|
|
2767
|
+
return /* @__PURE__ */ t.jsxs(
|
|
1886
2768
|
"div",
|
|
1887
2769
|
{
|
|
1888
2770
|
...i,
|
|
1889
2771
|
className: o ? `fsc-stat-card ${o}` : "fsc-stat-card",
|
|
1890
|
-
"data-trend":
|
|
2772
|
+
"data-trend": a,
|
|
1891
2773
|
children: [
|
|
1892
|
-
/* @__PURE__ */
|
|
1893
|
-
/* @__PURE__ */
|
|
1894
|
-
|
|
1895
|
-
s ? /* @__PURE__ */
|
|
2774
|
+
/* @__PURE__ */ t.jsx("span", { "data-role": "label", children: e }),
|
|
2775
|
+
/* @__PURE__ */ t.jsx("strong", { "data-role": "value", children: r }),
|
|
2776
|
+
n ? /* @__PURE__ */ t.jsx("span", { "data-role": "description", children: n }) : null,
|
|
2777
|
+
s ? /* @__PURE__ */ t.jsx("span", { "data-role": "trend", children: s }) : null
|
|
1896
2778
|
]
|
|
1897
2779
|
}
|
|
1898
2780
|
);
|
|
1899
2781
|
}
|
|
1900
|
-
function
|
|
1901
|
-
return /* @__PURE__ */
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
] },
|
|
2782
|
+
function gn({ steps: e, current: r, orientation: n = "horizontal" }) {
|
|
2783
|
+
return /* @__PURE__ */ t.jsx("ol", { "data-orientation": n, children: e.map((a, s) => /* @__PURE__ */ t.jsxs("li", { "aria-current": s === r ? "step" : void 0, "aria-disabled": a.disabled, children: [
|
|
2784
|
+
a.label,
|
|
2785
|
+
a.description && /* @__PURE__ */ t.jsx("small", { children: a.description })
|
|
2786
|
+
] }, a.id)) });
|
|
1905
2787
|
}
|
|
1906
|
-
function
|
|
2788
|
+
function yn({
|
|
1907
2789
|
size: e = "medium",
|
|
1908
2790
|
disabled: r = !1,
|
|
1909
|
-
...
|
|
2791
|
+
...n
|
|
1910
2792
|
}) {
|
|
1911
|
-
return /* @__PURE__ */
|
|
2793
|
+
return /* @__PURE__ */ t.jsx(
|
|
1912
2794
|
"input",
|
|
1913
2795
|
{
|
|
1914
|
-
...
|
|
2796
|
+
...n,
|
|
1915
2797
|
type: "checkbox",
|
|
1916
2798
|
role: "switch",
|
|
1917
2799
|
"data-size": e,
|
|
@@ -1919,149 +2801,194 @@ function vr({
|
|
|
1919
2801
|
}
|
|
1920
2802
|
);
|
|
1921
2803
|
}
|
|
1922
|
-
function
|
|
1923
|
-
const s = r ??
|
|
1924
|
-
return /* @__PURE__ */
|
|
1925
|
-
/* @__PURE__ */
|
|
1926
|
-
e.map((o) => o.id === s ? /* @__PURE__ */
|
|
2804
|
+
function _n({ items: e, value: r, defaultValue: n, onValueChange: a }) {
|
|
2805
|
+
const s = r ?? n ?? e[0]?.id;
|
|
2806
|
+
return /* @__PURE__ */ t.jsxs("div", { children: [
|
|
2807
|
+
/* @__PURE__ */ t.jsx("div", { role: "tablist", children: e.map((o) => /* @__PURE__ */ t.jsx("button", { type: "button", role: "tab", "aria-selected": o.id === s, disabled: o.disabled, onClick: () => a?.(o.id), children: o.label }, o.id)) }),
|
|
2808
|
+
e.map((o) => o.id === s ? /* @__PURE__ */ t.jsx("div", { role: "tabpanel", children: o.content }, o.id) : null)
|
|
1927
2809
|
] });
|
|
1928
2810
|
}
|
|
1929
|
-
function
|
|
1930
|
-
const
|
|
1931
|
-
return /* @__PURE__ */
|
|
2811
|
+
function Sn({ children: e, as: r = "p", ...n }) {
|
|
2812
|
+
const a = r;
|
|
2813
|
+
return /* @__PURE__ */ t.jsx(a, { ...n, children: e });
|
|
1932
2814
|
}
|
|
1933
|
-
function
|
|
2815
|
+
function wn({
|
|
1934
2816
|
size: e = "medium",
|
|
1935
2817
|
rows: r = 4,
|
|
1936
|
-
disabled:
|
|
1937
|
-
...
|
|
2818
|
+
disabled: n = !1,
|
|
2819
|
+
...a
|
|
1938
2820
|
}) {
|
|
1939
|
-
return /* @__PURE__ */
|
|
2821
|
+
return /* @__PURE__ */ t.jsx(
|
|
1940
2822
|
"textarea",
|
|
1941
2823
|
{
|
|
1942
|
-
...
|
|
2824
|
+
...a,
|
|
1943
2825
|
rows: r,
|
|
1944
2826
|
"data-size": e,
|
|
1945
|
-
disabled:
|
|
2827
|
+
disabled: n
|
|
1946
2828
|
}
|
|
1947
2829
|
);
|
|
1948
2830
|
}
|
|
1949
|
-
function
|
|
1950
|
-
return e ? /* @__PURE__ */
|
|
2831
|
+
function Nn({ open: e = !0, children: r, variant: n = "info", onClose: a }) {
|
|
2832
|
+
return e ? /* @__PURE__ */ t.jsxs("div", { role: "status", "data-variant": n, children: [
|
|
1951
2833
|
r,
|
|
1952
|
-
/* @__PURE__ */
|
|
2834
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", onClick: a, children: "Close" })
|
|
1953
2835
|
] }) : null;
|
|
1954
2836
|
}
|
|
1955
|
-
function
|
|
1956
|
-
return /* @__PURE__ */
|
|
2837
|
+
function kn({ content: e, children: r }) {
|
|
2838
|
+
return /* @__PURE__ */ t.jsx("span", { title: typeof e == "string" ? e : void 0, children: r });
|
|
1957
2839
|
}
|
|
1958
|
-
function
|
|
1959
|
-
const
|
|
1960
|
-
/* @__PURE__ */
|
|
1961
|
-
s.children &&
|
|
2840
|
+
function En({ nodes: e, onSelect: r }) {
|
|
2841
|
+
const n = (a) => /* @__PURE__ */ t.jsx("ul", { role: "tree", children: a.map((s) => /* @__PURE__ */ t.jsxs("li", { role: "treeitem", "aria-disabled": s.disabled, children: [
|
|
2842
|
+
/* @__PURE__ */ t.jsx("button", { type: "button", disabled: s.disabled, onClick: () => r?.(s.id), children: s.label }),
|
|
2843
|
+
s.children && n(s.children)
|
|
1962
2844
|
] }, s.id)) });
|
|
1963
|
-
return
|
|
2845
|
+
return n(e);
|
|
1964
2846
|
}
|
|
1965
2847
|
export {
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2848
|
+
zr as Accordion,
|
|
2849
|
+
vr as ActionBar,
|
|
2850
|
+
$r as Alert,
|
|
2851
|
+
at as ApiError,
|
|
2852
|
+
Lr as Avatar,
|
|
2853
|
+
Ir as Badge,
|
|
2854
|
+
ve as BoundFormField,
|
|
2855
|
+
Fr as Button,
|
|
2856
|
+
Mr as Card,
|
|
2857
|
+
Dr as Carousel,
|
|
2858
|
+
Br as Checkbox,
|
|
2859
|
+
lr as ColorInput,
|
|
2860
|
+
Vr as Combobox,
|
|
2861
|
+
Ur as CommandPalette,
|
|
2862
|
+
Wr as ContextMenu,
|
|
2863
|
+
or as CrudExample,
|
|
2864
|
+
jr as DataField,
|
|
2865
|
+
cr as DateInput,
|
|
2866
|
+
Yr as DatePicker,
|
|
2867
|
+
gr as DocumentList,
|
|
2868
|
+
Zr as Drawer,
|
|
2869
|
+
Qr as DropdownMenu,
|
|
2870
|
+
Jr as EmptyState,
|
|
2871
|
+
yr as EntityCard,
|
|
2872
|
+
Gr as ErrorState,
|
|
2873
|
+
dr as FileInput,
|
|
2874
|
+
Hr as FileUpload,
|
|
2875
|
+
Ar as FilterMenu,
|
|
2876
|
+
qt as Form,
|
|
2877
|
+
qr as FormField,
|
|
2878
|
+
Kt as FormFieldAdapter,
|
|
2879
|
+
ke as FormProvider,
|
|
2880
|
+
qe as FormReset,
|
|
2881
|
+
He as FormSubmit,
|
|
2882
|
+
ar as Grid,
|
|
2883
|
+
Kr as Heading,
|
|
2884
|
+
Xr as IconButton,
|
|
2885
|
+
en as Input,
|
|
2886
|
+
tn as Label,
|
|
2887
|
+
rn as Link,
|
|
2888
|
+
lt as LoadingState,
|
|
2889
|
+
_r as Main,
|
|
2890
|
+
nn as Menubar,
|
|
2891
|
+
an as Modal,
|
|
2892
|
+
sn as MultiSelect,
|
|
2893
|
+
ur as MultiSelectFilter,
|
|
2894
|
+
Sr as Navbar,
|
|
2895
|
+
zt as NavbarBrand,
|
|
2896
|
+
$t as NavbarBrandLogo,
|
|
2897
|
+
Lt as NavbarBrandName,
|
|
2898
|
+
Vt as NavbarFooter,
|
|
2899
|
+
At as NavbarHeader,
|
|
2900
|
+
Bt as NavbarItem,
|
|
2901
|
+
wr as NavbarItemIcon,
|
|
2902
|
+
Nr as NavbarItemName,
|
|
2903
|
+
Ft as NavbarMain,
|
|
2904
|
+
Ut as NavbarProfile,
|
|
2905
|
+
_e as NavbarProfilePicture,
|
|
2906
|
+
Mt as NavbarSection,
|
|
2907
|
+
Dt as NavbarSectionName,
|
|
2908
|
+
It as NavbarToggle,
|
|
2909
|
+
on as NavigationMenu,
|
|
2910
|
+
fr as NumberInput,
|
|
2911
|
+
kr as PageHeader,
|
|
2912
|
+
ln as Pagination,
|
|
2913
|
+
mr as PasswordInput,
|
|
2914
|
+
Er as PhotoGrid,
|
|
2915
|
+
cn as Popover,
|
|
2916
|
+
dn as Progress,
|
|
2917
|
+
un as Radio,
|
|
2918
|
+
hr as RadioGroup,
|
|
2919
|
+
fn as ResizablePanel,
|
|
2920
|
+
wt as ResourceTable,
|
|
2921
|
+
ir as ResultsCount,
|
|
2922
|
+
mn as SearchBar,
|
|
2923
|
+
Cr as SearchFilterSection,
|
|
2924
|
+
pr as SearchInput,
|
|
2925
|
+
hn as Select,
|
|
2926
|
+
br as SelectFilter,
|
|
2927
|
+
pn as Separator,
|
|
2928
|
+
bn as Sidebar,
|
|
2929
|
+
xn as Skeleton,
|
|
2930
|
+
xr as Slider,
|
|
2931
|
+
vn as Spinner,
|
|
2932
|
+
sr as Stack,
|
|
2933
|
+
jn as StatCard,
|
|
2934
|
+
gn as Stepper,
|
|
2935
|
+
yn as Switch,
|
|
2936
|
+
St as Table,
|
|
2937
|
+
ct as TableAction,
|
|
2938
|
+
ut as TableActions,
|
|
2939
|
+
ft as TableBody,
|
|
2940
|
+
Rr as TableCaption,
|
|
2941
|
+
re as TableCell,
|
|
2942
|
+
mt as TableEmpty,
|
|
2943
|
+
ht as TableError,
|
|
2944
|
+
Or as TableExpand,
|
|
2945
|
+
Pr as TableFooter,
|
|
2946
|
+
pt as TableHeader,
|
|
2947
|
+
ne as TableHeaderCell,
|
|
2948
|
+
vt as TableLoading,
|
|
2949
|
+
jt as TablePagination,
|
|
2950
|
+
gt as TableRow,
|
|
2951
|
+
yt as TableRowActions,
|
|
2952
|
+
ge as TableSelection,
|
|
2953
|
+
xt as TableSort,
|
|
2954
|
+
Tr as TableStructure,
|
|
2955
|
+
_n as Tabs,
|
|
2956
|
+
Sn as Text,
|
|
2957
|
+
wn as Textarea,
|
|
2958
|
+
Jt as ThemeProvider,
|
|
2959
|
+
Nn as Toast,
|
|
2960
|
+
kn as Tooltip,
|
|
2961
|
+
En as TreeView,
|
|
2962
|
+
Ve as applyTheme,
|
|
2963
|
+
rr as createApiResource,
|
|
2964
|
+
et as createArrayResource,
|
|
2965
|
+
ot as createCrudController,
|
|
2966
|
+
tr as createFetchApiClient,
|
|
2967
|
+
Xt as createFieldAdapter,
|
|
2968
|
+
Je as createFieldController,
|
|
2969
|
+
me as createFormStore,
|
|
2970
|
+
tt as createResourceController,
|
|
2971
|
+
er as createResourceForm,
|
|
2972
|
+
rt as createTableController,
|
|
2973
|
+
Ie as createTheme,
|
|
2974
|
+
Fe as darkTheme,
|
|
2975
|
+
M as defaultTheme,
|
|
2976
|
+
Ae as fontSize,
|
|
2977
|
+
ze as fontWeight,
|
|
2978
|
+
Ke as inferTableColumns,
|
|
2979
|
+
Oe as radius,
|
|
2980
|
+
$e as shadows,
|
|
2981
|
+
Pe as spacing,
|
|
2982
|
+
Qt as themeToCss,
|
|
2983
|
+
Se as themeToCssVariables,
|
|
2984
|
+
nr as useCrud,
|
|
2985
|
+
Ee as useField,
|
|
2986
|
+
Ht as useForm,
|
|
2987
|
+
Ge as useFormState,
|
|
2988
|
+
he as useFormStore,
|
|
2989
|
+
it as useResourceCrud,
|
|
2990
|
+
nt as useTable,
|
|
2991
|
+
Gt as useTheme,
|
|
2992
|
+
Be as validateTheme,
|
|
2993
|
+
Le as zIndex
|
|
2067
2994
|
};
|