@armtek/data 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dataTableStoreFactory-BTH4XExR.cjs +1 -0
- package/dist/dataTableStoreFactory-CTIqHKTT.js +1505 -0
- package/dist/dataTableStoreFactory.css +1 -0
- package/dist/dictionary.cjs +1 -0
- package/dist/dictionary.d.ts +2 -0
- package/dist/dictionary.js +6 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +15 -0
- package/dist/search.cjs +1 -0
- package/dist/search.d.ts +2 -0
- package/dist/search.js +4 -0
- package/dist/src/config/tests/changeDateField.d.ts +2 -0
- package/dist/src/config/tests/changeSelectField.d.ts +1 -0
- package/dist/src/config/tests/changeTextField.d.ts +1 -0
- package/dist/src/config/tests/clickBackdropOverlay.d.ts +1 -0
- package/dist/src/config/tests/createWrapper.d.ts +6 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/modules/dictionary/config/types.d.ts +1 -0
- package/dist/src/modules/dictionary/index.d.ts +3 -0
- package/dist/src/modules/dictionary/lib/useDictionary.d.ts +7 -0
- package/dist/src/modules/dictionary/lib/useDictionaryFetching.d.ts +1 -0
- package/dist/src/modules/dictionary/lib/useDictionaryItems.d.ts +1 -0
- package/dist/src/modules/dictionary/lib/useDictionaryRequested.d.ts +1 -0
- package/dist/src/modules/dictionary/model/dictionaryStore.d.ts +19 -0
- package/dist/src/modules/dictionary/ui/DictInput.d.ts +10 -0
- package/dist/src/modules/search/Search.d.ts +21 -0
- package/dist/src/modules/search/index.d.ts +1 -0
- package/dist/src/modules/table/index.d.ts +11 -0
- package/dist/src/modules/table/lib/GetDefaultFilters.d.ts +2 -0
- package/dist/src/modules/table/lib/const.d.ts +1 -0
- package/dist/src/modules/table/lib/deleteUrlParamByName.d.ts +1 -0
- package/dist/src/modules/table/lib/formatDate.d.ts +3 -0
- package/dist/src/modules/table/lib/getFilterDisplayValue.d.ts +3 -0
- package/dist/src/modules/table/lib/local_storage.d.ts +6 -0
- package/dist/src/modules/table/lib/makePaginatedFilterParams.d.ts +12 -0
- package/dist/src/modules/table/lib/sortByField.d.ts +3 -0
- package/dist/src/modules/table/lib/uuid.d.ts +1 -0
- package/dist/src/modules/table/model/dataTableContext.d.ts +36 -0
- package/dist/src/modules/table/model/dataTableStoreFactory.d.ts +97 -0
- package/dist/src/modules/table/model/types.d.ts +22 -0
- package/dist/src/modules/table/model/useDataTable.d.ts +2 -0
- package/dist/src/modules/table/ui/ActionList/ActionList.d.ts +13 -0
- package/dist/src/modules/table/ui/DataTable.d.ts +54 -0
- package/dist/src/modules/table/ui/DataTable.skeleton.d.ts +12 -0
- package/dist/src/modules/table/ui/DataTableActions/DataTableActions.d.ts +6 -0
- package/dist/src/modules/table/ui/FilterBar/FilterBar.d.ts +71 -0
- package/dist/src/modules/table/ui/FilterBar/FilterForm/FilterForm.d.ts +9 -0
- package/dist/src/modules/table/ui/FilterBar/FilterForm/FilterFormCheckbox.d.ts +24 -0
- package/dist/src/modules/table/ui/FilterBar/FilterForm/FilterFormDate.d.ts +16 -0
- package/dist/src/modules/table/ui/FilterBar/FilterForm/FilterFormField.d.ts +10 -0
- package/dist/src/modules/table/ui/FilterBar/FilterForm/FilterFormInput.d.ts +19 -0
- package/dist/src/modules/table/ui/FilterBar/FilterForm/FilterFormInterval.d.ts +19 -0
- package/dist/src/modules/table/ui/FilterBar/FilterForm/FilterFormPeriod.d.ts +24 -0
- package/dist/src/modules/table/ui/FilterBar/FilterForm/FilterFormSearch.d.ts +21 -0
- package/dist/src/modules/table/ui/FilterBar/FilterForm/FilterFormSelect.d.ts +31 -0
- package/dist/src/modules/table/ui/FilterBar/FilterSearch/FilterSearch.d.ts +7 -0
- package/dist/src/modules/table/ui/FilterBar/FilterSelector.d.ts +7 -0
- package/dist/src/modules/table/ui/FilterBar/TableFilterBar.d.ts +2 -0
- package/dist/src/modules/table/ui/Menu/ContextMenu.d.ts +9 -0
- package/dist/src/modules/table/ui/Menu/ContextMenuBtn.d.ts +13 -0
- package/dist/src/modules/table/ui/Table/Table.d.ts +20 -0
- package/dist/src/modules/table/ui/Table/TableBody.d.ts +19 -0
- package/dist/src/modules/table/ui/Table/TableHead.d.ts +20 -0
- package/dist/src/modules/table/ui/TableActionBar/DataTableActionBar.d.ts +6 -0
- package/dist/src/modules/table/ui/TableActionBar/TableActionBar.d.ts +11 -0
- package/dist/src/modules/table/ui/TableActionBar/TableRowSelect.d.ts +10 -0
- package/dist/src/modules/table/ui/TableActionCol.d.ts +9 -0
- package/dist/src/modules/table/ui/TableCell.d.ts +11 -0
- package/dist/src/modules/table/ui/TableContextMenu.d.ts +16 -0
- package/dist/src/modules/table/ui/TablePagination.d.ts +2 -0
- package/dist/src/modules/table/ui/TableSort.d.ts +10 -0
- package/dist/table.cjs +1 -0
- package/dist/table.d.ts +2 -0
- package/dist/table.js +11 -0
- package/dist/vite.config.d.ts +2 -0
- package/package.json +70 -0
|
@@ -0,0 +1,1505 @@
|
|
|
1
|
+
import { createFactory as rt } from "@withease/factories";
|
|
2
|
+
import { jsx as r, Fragment as S, jsxs as w } from "react/jsx-runtime";
|
|
3
|
+
import { useState as T, useContext as lt, memo as ze, useMemo as at, useEffect as ge, createContext as st } from "react";
|
|
4
|
+
import { Mi as ne } from "armtek-uikit-react/ui/Icon";
|
|
5
|
+
import fe from "armtek-uikit-react/ui/Popover";
|
|
6
|
+
import Pe from "armtek-uikit-react/ui/List";
|
|
7
|
+
import ct from "armtek-uikit-react/ui/Paper";
|
|
8
|
+
import { useUnit as m, useStoreMap as $e } from "effector-react";
|
|
9
|
+
import { TableCell as Z, TableRow as pe } from "armtek-uikit-react/ui/Table";
|
|
10
|
+
import Le from "armtek-uikit-react/ui/Form/Checkbox";
|
|
11
|
+
import de from "armtek-uikit-react/ui/ButtonIcon";
|
|
12
|
+
import Oe from "armtek-uikit-react/ui/Stack";
|
|
13
|
+
import ue from "classnames";
|
|
14
|
+
import le from "armtek-uikit-react/ui/Skeleton";
|
|
15
|
+
import { TableBase as ot } from "armtek-uikit-react/ui/Table/TableBase";
|
|
16
|
+
import it from "armtek-uikit-react/ui/Pagination";
|
|
17
|
+
import He from "armtek-uikit-react/ui/Form/TextField";
|
|
18
|
+
import dt from "armtek-uikit-react/ui/Form/Select";
|
|
19
|
+
import { createStore as D, createEvent as Y, createEffect as Be, sample as f, combine as oe } from "effector";
|
|
20
|
+
import ut from "armtek-uikit-react/ui/Form/DateField";
|
|
21
|
+
import ht from "armtek-uikit-react/ui/Form/Period";
|
|
22
|
+
import Ie from "armtek-uikit-react/ui/Loader";
|
|
23
|
+
import Ae from "armtek-uikit-react/ui/Adornment";
|
|
24
|
+
import gt from "armtek-uikit-react/lib/hooks/useClickOutside";
|
|
25
|
+
import { IntervalSlide as mt } from "armtek-uikit-react/ui/Form/Interval";
|
|
26
|
+
import ft from "armtek-uikit-react/ui/Button";
|
|
27
|
+
import pt from "armtek-uikit-react/ui/Chip";
|
|
28
|
+
function yt(e) {
|
|
29
|
+
let { actions: t, selected: a, onSelect: c } = e, [s, l] = T(null);
|
|
30
|
+
const d = () => l(null), n = (i) => {
|
|
31
|
+
d(), c(i);
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ w("div", { className: "bg-blue-50 flex justify-between", children: [
|
|
34
|
+
/* @__PURE__ */ w("div", { children: [
|
|
35
|
+
"Выбрано: ",
|
|
36
|
+
a.length
|
|
37
|
+
] }),
|
|
38
|
+
/* @__PURE__ */ w("div", { className: "bg-blue-a100 border-radius p-1 flex items-center justify-center", onClick: (i) => l(i.currentTarget), children: [
|
|
39
|
+
/* @__PURE__ */ r("span", { children: "Действие" }),
|
|
40
|
+
/* @__PURE__ */ r(ne, { icon: "expand_more" })
|
|
41
|
+
] }),
|
|
42
|
+
s && /* @__PURE__ */ r(
|
|
43
|
+
fe,
|
|
44
|
+
{
|
|
45
|
+
open: !!s,
|
|
46
|
+
anchorEl: s,
|
|
47
|
+
onClose: d,
|
|
48
|
+
placement: "bottom-end",
|
|
49
|
+
children: /* @__PURE__ */ r(ct, { style: { minWidth: "230px" }, children: t.map((i, o) => /* @__PURE__ */ r(Pe, { onClick: () => n(o), children: i.label }, o)) })
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
] }) });
|
|
53
|
+
}
|
|
54
|
+
const X = () => lt(Ze);
|
|
55
|
+
function St() {
|
|
56
|
+
const { $tableActions: e, $items: t } = X(), a = m(e), c = m(t);
|
|
57
|
+
if (a.length === 0) return null;
|
|
58
|
+
let s = c.filter((d) => d.dt_selected);
|
|
59
|
+
const l = (d) => {
|
|
60
|
+
let n = a.find((i, o) => o === d);
|
|
61
|
+
n && n.onClick(s);
|
|
62
|
+
};
|
|
63
|
+
return /* @__PURE__ */ r(S, { children: s.length > 0 && /* @__PURE__ */ r(yt, { actions: a, selected: s, onSelect: l }) });
|
|
64
|
+
}
|
|
65
|
+
const bt = "_rowCell__inner_e90xa_7", vt = "_rowHead_e90xa_21", _t = "_rowHead__inner_e90xa_29", Ct = "_TableSort__btn_e90xa_75", Dt = "_TableSort__btn_active_e90xa_83", wt = "_TableSort_e90xa_75", K = {
|
|
66
|
+
rowCell__inner: bt,
|
|
67
|
+
rowHead: vt,
|
|
68
|
+
rowHead__inner: _t,
|
|
69
|
+
TableSort__btn: Ct,
|
|
70
|
+
TableSort__btn_active: Dt,
|
|
71
|
+
TableSort: wt
|
|
72
|
+
}, je = (e) => {
|
|
73
|
+
let t = e.checked;
|
|
74
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(Z, { innerClassName: K.rowCell__inner, className: "prevent-click", children: /* @__PURE__ */ r(
|
|
75
|
+
Le,
|
|
76
|
+
{
|
|
77
|
+
onChange: e.onChange,
|
|
78
|
+
disabled: e.disabled,
|
|
79
|
+
size: "medium",
|
|
80
|
+
checked: t,
|
|
81
|
+
intermediate: e.indeterminate
|
|
82
|
+
}
|
|
83
|
+
) }) });
|
|
84
|
+
}, kt = (e) => {
|
|
85
|
+
const { order: t, children: a, code: c, onSort: s, active: l, ...d } = e;
|
|
86
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ w(Oe, { center: !0, spacing: "small", ...d, onClick: () => s(c), className: K.TableSort, children: [
|
|
87
|
+
a,
|
|
88
|
+
/* @__PURE__ */ r(de, { size: "small", className: ue(K.TableSort__btn, {
|
|
89
|
+
[K.TableSort__btn_active]: !!l
|
|
90
|
+
}), children: /* @__PURE__ */ r(ne, { icon: t === "asc" ? "arrow_downward" : "arrow_upward", size: "extraLarge" }) })
|
|
91
|
+
] }) });
|
|
92
|
+
}, De = (e) => {
|
|
93
|
+
let { code: t, sort: a, activeSort: c, order: s, onSort: l, children: d, ...n } = e;
|
|
94
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(Z, { ...n, className: ue(n.className, K.rowHead), innerClassName: K.rowHead__inner, head: !0, children: a && l ? /* @__PURE__ */ r(kt, { order: s, active: c, code: t, onSort: l, children: e.children }) : e.children }) });
|
|
95
|
+
};
|
|
96
|
+
function $t(e) {
|
|
97
|
+
let { structure: t, sort: a, displayIndex: c, displayActionCol: s, onSelect: l, selected: d, indeterminate: n, ...i } = e;
|
|
98
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ w(pe, { children: [
|
|
99
|
+
!!l && /* @__PURE__ */ r(je, { checked: d, indeterminate: n, onChange: l, head: !0 }),
|
|
100
|
+
c && /* @__PURE__ */ r(De, { code: "index", width: 64, children: "#" }),
|
|
101
|
+
t.map((o) => /* @__PURE__ */ r(
|
|
102
|
+
De,
|
|
103
|
+
{
|
|
104
|
+
code: String(o.id),
|
|
105
|
+
activeSort: o.sort && o.id === a,
|
|
106
|
+
sort: o.sort,
|
|
107
|
+
...i,
|
|
108
|
+
children: /* @__PURE__ */ r("div", { className: K.rowCellInner, children: o.getTitle ? o.getTitle() : o.label })
|
|
109
|
+
},
|
|
110
|
+
String(o.id)
|
|
111
|
+
)),
|
|
112
|
+
s && /* @__PURE__ */ r(De, { code: "actions", width: 56 })
|
|
113
|
+
] }) }) });
|
|
114
|
+
}
|
|
115
|
+
function xt(e) {
|
|
116
|
+
const {
|
|
117
|
+
$sort: t,
|
|
118
|
+
$order: a,
|
|
119
|
+
$items: c,
|
|
120
|
+
$displayActionCol: s,
|
|
121
|
+
$displayIndex: l,
|
|
122
|
+
$tableActions: d,
|
|
123
|
+
rowsSelected: n,
|
|
124
|
+
sortSet: i,
|
|
125
|
+
$structure: o
|
|
126
|
+
} = X(), h = m(t), p = m(a), C = m(c), F = m(s), y = m(d).length > 0, b = m(l), v = m(n), x = m(i), M = m(o), N = (A) => {
|
|
127
|
+
const I = A.target.checked;
|
|
128
|
+
let H = C.filter((B) => e.getIsRowActive ? e.getIsRowActive(B) : !0).map((B) => B.dt_id);
|
|
129
|
+
v({ rows: H, flag: I });
|
|
130
|
+
}, L = (A) => {
|
|
131
|
+
x(A);
|
|
132
|
+
};
|
|
133
|
+
let O = C.filter((A) => A.dt_selected).length, E = O > 0 && O === C.filter((A) => e.getIsRowActive ? e.getIsRowActive(A) : !0).length;
|
|
134
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(
|
|
135
|
+
$t,
|
|
136
|
+
{
|
|
137
|
+
structure: M,
|
|
138
|
+
sort: h,
|
|
139
|
+
order: p,
|
|
140
|
+
onSort: L,
|
|
141
|
+
onSelect: y ? N : void 0,
|
|
142
|
+
selected: E,
|
|
143
|
+
indeterminate: O > 0 && !E,
|
|
144
|
+
displayIndex: b,
|
|
145
|
+
displayActionCol: F
|
|
146
|
+
}
|
|
147
|
+
) });
|
|
148
|
+
}
|
|
149
|
+
const ye = (e) => {
|
|
150
|
+
let { items: t, onButtonClick: a, wrapperClassName: c } = e;
|
|
151
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r("div", { className: ue("py-1", c), children: t.map((s, l) => /* @__PURE__ */ r(Pe, { onClick: () => {
|
|
152
|
+
s.onClick ? s.onClick(s) : a && a(s);
|
|
153
|
+
}, children: s.label }, l)) }) });
|
|
154
|
+
}, Mt = (e) => {
|
|
155
|
+
let { children: t, items: a, ...c } = e;
|
|
156
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(fe, { ...c, classes: {
|
|
157
|
+
paper: "p-0"
|
|
158
|
+
}, children: /* @__PURE__ */ w("div", { "data-testid": "context-menu-actions", children: [
|
|
159
|
+
!!a && /* @__PURE__ */ r(ye, { items: a }),
|
|
160
|
+
t
|
|
161
|
+
] }) }) });
|
|
162
|
+
}, At = (e) => {
|
|
163
|
+
const { Button: t, children: a, disabled: c } = e;
|
|
164
|
+
let [s, l] = T(null);
|
|
165
|
+
const d = e.items.map((n) => ({
|
|
166
|
+
...n,
|
|
167
|
+
onClick: () => {
|
|
168
|
+
n.onClick?.(n), l(null);
|
|
169
|
+
}
|
|
170
|
+
}));
|
|
171
|
+
return c ? null : /* @__PURE__ */ w(S, { children: [
|
|
172
|
+
t ? /* @__PURE__ */ r(t, { onClick: (n) => l(n.target) }) : a ? /* @__PURE__ */ r("div", { onClick: (n) => l(n.target), children: a }) : /* @__PURE__ */ r(
|
|
173
|
+
de,
|
|
174
|
+
{
|
|
175
|
+
onClick: (n) => l(n.target),
|
|
176
|
+
variant: "transparent",
|
|
177
|
+
"data-testid": e["data-testid"] || "context-menu-btn",
|
|
178
|
+
color: "neutral",
|
|
179
|
+
size: "small",
|
|
180
|
+
children: /* @__PURE__ */ r(ne, { icon: "more_vert", className: "text-gray-800" })
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ r(
|
|
184
|
+
Mt,
|
|
185
|
+
{
|
|
186
|
+
anchorEl: s,
|
|
187
|
+
open: !!s,
|
|
188
|
+
onClose: () => l(null),
|
|
189
|
+
placement: "bottom-end",
|
|
190
|
+
items: d
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
] });
|
|
194
|
+
};
|
|
195
|
+
function Tt(e) {
|
|
196
|
+
const t = (a) => {
|
|
197
|
+
a && a(e.row);
|
|
198
|
+
};
|
|
199
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(Z, { innerClassName: K.rowCell__inner, children: /* @__PURE__ */ r(
|
|
200
|
+
At,
|
|
201
|
+
{
|
|
202
|
+
"data-testid": "dt-action-cell",
|
|
203
|
+
items: e.actions.map((a) => ({
|
|
204
|
+
onClick: () => t(a.onClick),
|
|
205
|
+
label: a.label
|
|
206
|
+
}))
|
|
207
|
+
}
|
|
208
|
+
) }) });
|
|
209
|
+
}
|
|
210
|
+
const Ft = "_dtactions_1taex_1", Nt = "_dtactions__actions_1taex_8", Te = {
|
|
211
|
+
dtactions: Ft,
|
|
212
|
+
dtactions__actions: Nt
|
|
213
|
+
}, Vt = (e) => /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r("div", { className: ue("DataTableRowActions", Te.dtactions), children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(ye, { items: e.actions, wrapperClassName: Te.dtactions__actions }) }) }) });
|
|
214
|
+
function Rt(e) {
|
|
215
|
+
let { col: t, row: a, hovered: c, actions: s } = e, l = !!t.displayActions && c;
|
|
216
|
+
const d = typeof t.className == "string" ? t.className : t.className?.(a);
|
|
217
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ w(Z, { className: ue("relative", d), "data-testid": "dt-cell", innerClassName: K.rowCell__inner, style: t.style, children: [
|
|
218
|
+
/* @__PURE__ */ r("div", { className: "TableCellContent", "data-testid": "dt-cell-" + String(t.id), style: {
|
|
219
|
+
display: l ? "none" : "block"
|
|
220
|
+
}, children: /* @__PURE__ */ r("div", { children: t.getValue ? t.getValue(e.row) : e.row[t.id] }) }),
|
|
221
|
+
l && s && /* @__PURE__ */ r(Yt, { row: a, actions: s })
|
|
222
|
+
] }) });
|
|
223
|
+
}
|
|
224
|
+
const Yt = (e) => {
|
|
225
|
+
let t = e.actions.map((a) => ({
|
|
226
|
+
label: a.label,
|
|
227
|
+
icon: a.icon,
|
|
228
|
+
onClick: () => a.onClick ? a.onClick(e.row) : null
|
|
229
|
+
}));
|
|
230
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(Vt, { actions: t }) });
|
|
231
|
+
}, Et = ze(Rt);
|
|
232
|
+
function zt(e) {
|
|
233
|
+
let { contextActions: t, x: a, y: c, anchorEl: s, onContextClick: l, row: d } = e, n = t.filter((i) => i.active ? typeof i.active == "boolean" ? i.active : i.active(d) : !0).map((i) => ({
|
|
234
|
+
label: i.label,
|
|
235
|
+
onClick: () => {
|
|
236
|
+
i.onClick && i.onClick(d), l && l();
|
|
237
|
+
}
|
|
238
|
+
}));
|
|
239
|
+
return /* @__PURE__ */ r(S, { children: s && /* @__PURE__ */ r(fe, { classes: { paper: "p-0" }, placement: "bottom-start", open: !0, anchorEl: s, anchorPosition: { x: a, y: c }, onClose: l, children: /* @__PURE__ */ r(ye, { items: n }) }) });
|
|
240
|
+
}
|
|
241
|
+
const Pt = (e) => /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(pe, { "data-testid": "dt-empty", children: /* @__PURE__ */ r(Z, { colSpan: e.cols || 1, children: e.children }) }) });
|
|
242
|
+
function Lt(e) {
|
|
243
|
+
let { getRowStyles: t, getIsRowActive: a, emptyResult: c, onRowClick: s, onContextMenu: l, rowClassName: d } = e;
|
|
244
|
+
const {
|
|
245
|
+
$items: n,
|
|
246
|
+
$structure: i,
|
|
247
|
+
$pageSize: o,
|
|
248
|
+
$page: h,
|
|
249
|
+
$local: p,
|
|
250
|
+
$displayActionCol: C,
|
|
251
|
+
$tableActions: F,
|
|
252
|
+
$displayIndex: y,
|
|
253
|
+
$requested: b
|
|
254
|
+
} = X();
|
|
255
|
+
let v = m(n);
|
|
256
|
+
const x = m(o), M = m(h), N = m(p), L = m(C), O = m(F).length > 0, E = m(y), A = m(b), I = m(i);
|
|
257
|
+
N && (v = v.filter((z) => !z.dt_hidden)), N && x && M && (v = v.slice(M * x - x, M * x));
|
|
258
|
+
let H = !!c && A && v.length === 0, B = (L ? 1 : 0) + (E ? 1 : 0) + (O ? 1 : 0) + I.length;
|
|
259
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ w("tbody", { children: [
|
|
260
|
+
H && /* @__PURE__ */ r(
|
|
261
|
+
Pt,
|
|
262
|
+
{
|
|
263
|
+
cols: B,
|
|
264
|
+
children: e.emptyResult
|
|
265
|
+
}
|
|
266
|
+
),
|
|
267
|
+
v.map((z, G) => {
|
|
268
|
+
let j = G + 1 + (x * M - x);
|
|
269
|
+
return /* @__PURE__ */ r(
|
|
270
|
+
Ot,
|
|
271
|
+
{
|
|
272
|
+
row: z,
|
|
273
|
+
index: j,
|
|
274
|
+
getRowStyles: t,
|
|
275
|
+
rowClassName: d,
|
|
276
|
+
getIsRowActive: a,
|
|
277
|
+
onRowClick: s,
|
|
278
|
+
onContextMenu: l ? (ee) => l(ee, z) : void 0
|
|
279
|
+
},
|
|
280
|
+
G
|
|
281
|
+
);
|
|
282
|
+
})
|
|
283
|
+
] }) });
|
|
284
|
+
}
|
|
285
|
+
function Ot(e) {
|
|
286
|
+
let { rowClassName: t, row: a, onRowClick: c } = e, [s, l] = T(!1);
|
|
287
|
+
const [d, n] = T(null), [i, o] = T(0), [h, p] = T(0), {
|
|
288
|
+
$tableActions: C,
|
|
289
|
+
$displayActionCol: F,
|
|
290
|
+
$displayIndex: y,
|
|
291
|
+
$rowActions: b,
|
|
292
|
+
$contextActions: v,
|
|
293
|
+
rowsSelected: x,
|
|
294
|
+
$structure: M
|
|
295
|
+
} = X(), N = m(C).length > 0, L = m(F), O = m(y), E = m(M), A = m(b), I = m(v), H = m(x), B = I.length > 0, z = A.length > 0, G = c ? (R) => {
|
|
296
|
+
!R.target.closest(".prevent-click") && c && c(R, a);
|
|
297
|
+
} : void 0, j = (R) => {
|
|
298
|
+
B && (R.preventDefault(), n(R.currentTarget), o(R.clientX), p(R.clientY));
|
|
299
|
+
}, ee = (R) => {
|
|
300
|
+
H({
|
|
301
|
+
rows: [e.row.dt_id],
|
|
302
|
+
flag: R.target.checked
|
|
303
|
+
});
|
|
304
|
+
};
|
|
305
|
+
let te = e.row.dt_selected, U = {
|
|
306
|
+
...c && { cursor: "pointer" }
|
|
307
|
+
};
|
|
308
|
+
const re = at(() => e.getRowStyles ? e.getRowStyles(e.row) : {}, []);
|
|
309
|
+
return U = {
|
|
310
|
+
...U,
|
|
311
|
+
...re
|
|
312
|
+
}, /* @__PURE__ */ w(S, { children: [
|
|
313
|
+
/* @__PURE__ */ w(
|
|
314
|
+
pe,
|
|
315
|
+
{
|
|
316
|
+
className: t && (typeof t == "string" ? t : t(e.row)),
|
|
317
|
+
"data-testid": "dt-row",
|
|
318
|
+
onClick: G,
|
|
319
|
+
onMouseEnter: () => l(!0),
|
|
320
|
+
onMouseLeave: () => l(!1),
|
|
321
|
+
onContextMenu: j,
|
|
322
|
+
style: U,
|
|
323
|
+
children: [
|
|
324
|
+
N && /* @__PURE__ */ r(je, { disabled: e.getIsRowActive ? !e.getIsRowActive(e.row) : !1, onChange: ee, checked: te }),
|
|
325
|
+
O && /* @__PURE__ */ r(Z, { innerClassName: K.rowCell__inner, children: e.index }),
|
|
326
|
+
E.map((R, W) => /* @__PURE__ */ r(
|
|
327
|
+
Et,
|
|
328
|
+
{
|
|
329
|
+
hovered: s && !!z && !L,
|
|
330
|
+
col: R,
|
|
331
|
+
actions: A,
|
|
332
|
+
row: e.row
|
|
333
|
+
},
|
|
334
|
+
W
|
|
335
|
+
)),
|
|
336
|
+
L && A && /* @__PURE__ */ r(Tt, { row: e.row, actions: A })
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
),
|
|
340
|
+
I && /* @__PURE__ */ r(
|
|
341
|
+
zt,
|
|
342
|
+
{
|
|
343
|
+
row: a,
|
|
344
|
+
x: i,
|
|
345
|
+
y: h,
|
|
346
|
+
anchorEl: d,
|
|
347
|
+
contextActions: I,
|
|
348
|
+
onContextClick: () => n(null)
|
|
349
|
+
}
|
|
350
|
+
)
|
|
351
|
+
] });
|
|
352
|
+
}
|
|
353
|
+
const Ht = () => /* @__PURE__ */ r("div", { className: "mb-2 flex items-center border-bottom border-gray-300", style: {
|
|
354
|
+
height: 72
|
|
355
|
+
}, children: /* @__PURE__ */ r(le, { width: 40, height: 40 }) }), Bt = () => /* @__PURE__ */ w(S, { children: [
|
|
356
|
+
/* @__PURE__ */ r(Ht, {}),
|
|
357
|
+
[...Array(10)].map((e, t) => /* @__PURE__ */ w("div", { children: [
|
|
358
|
+
/* @__PURE__ */ r(le, { height: "45px", width: "100%" }),
|
|
359
|
+
/* @__PURE__ */ r("div", { style: { height: "2px", width: "100%" } })
|
|
360
|
+
] }, t))
|
|
361
|
+
] }), It = (e) => /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r("tbody", { children: [...Array(e.pageSize)].map((t, a) => /* @__PURE__ */ w(pe, { children: [
|
|
362
|
+
e.useSelection && /* @__PURE__ */ r(Z, { width: 64, children: /* @__PURE__ */ r(le, { width: "100%", height: 30 }) }),
|
|
363
|
+
e.useIndexes && /* @__PURE__ */ r(Z, { width: 64, children: /* @__PURE__ */ r(le, { width: "100%", height: 30 }) }),
|
|
364
|
+
e.structure.map((c, s) => /* @__PURE__ */ r(Z, { style: c.style, innerClassName: K.rowCell__inner, children: /* @__PURE__ */ r(le, { width: "100%", height: 30 }) }, s)),
|
|
365
|
+
e.useActionCol && /* @__PURE__ */ r(Z, { width: 56, children: /* @__PURE__ */ r(le, { width: "100%", height: 30 }) })
|
|
366
|
+
] }, a)) }) }), dr = ze(Bt);
|
|
367
|
+
function jt(e) {
|
|
368
|
+
let {
|
|
369
|
+
emptyResult: t,
|
|
370
|
+
getRowStyles: a,
|
|
371
|
+
getIsRowActive: c,
|
|
372
|
+
onRowClick: s,
|
|
373
|
+
onContextMenu: l,
|
|
374
|
+
rowClassName: d,
|
|
375
|
+
...n
|
|
376
|
+
} = e;
|
|
377
|
+
const { $isFetching: i } = X(), o = m(i);
|
|
378
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ w(ot, { "data-testid": "data-table", ...n, children: [
|
|
379
|
+
/* @__PURE__ */ r(xt, { getIsRowActive: c }),
|
|
380
|
+
o ? /* @__PURE__ */ r(Ut, {}) : /* @__PURE__ */ r(
|
|
381
|
+
Lt,
|
|
382
|
+
{
|
|
383
|
+
getRowStyles: a,
|
|
384
|
+
getIsRowActive: c,
|
|
385
|
+
emptyResult: t,
|
|
386
|
+
onRowClick: s,
|
|
387
|
+
onContextMenu: l,
|
|
388
|
+
rowClassName: d
|
|
389
|
+
}
|
|
390
|
+
)
|
|
391
|
+
] }) });
|
|
392
|
+
}
|
|
393
|
+
const Ut = () => {
|
|
394
|
+
const { $structure: e, $tableActions: t, $displayIndex: a, $displayActionCol: c, $pageSize: s } = X();
|
|
395
|
+
let l = m(t).length > 0, d = m(a), n = m(c), i = m(s), o = m(e);
|
|
396
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(
|
|
397
|
+
It,
|
|
398
|
+
{
|
|
399
|
+
useSelection: l,
|
|
400
|
+
useIndexes: d,
|
|
401
|
+
useActionCol: n,
|
|
402
|
+
structure: o,
|
|
403
|
+
pageSize: i
|
|
404
|
+
}
|
|
405
|
+
) });
|
|
406
|
+
}, qt = [12, 24, 36, 48, 60], Qt = "Количество строк", Kt = () => {
|
|
407
|
+
const { $page: e, $pageSize: t, $count: a, pageSizeSet: c, pageSet: s } = X(), l = m(a), d = m(t), n = m(e), i = m(s), o = m(c);
|
|
408
|
+
let h = Math.ceil(l / d);
|
|
409
|
+
return !d || !l ? null : /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r("div", { className: "mt-2 flex justify-end", children: /* @__PURE__ */ r(
|
|
410
|
+
it,
|
|
411
|
+
{
|
|
412
|
+
pageSizeLabel: Qt,
|
|
413
|
+
pageSizes: qt,
|
|
414
|
+
total: h,
|
|
415
|
+
pageSize: d,
|
|
416
|
+
page: n,
|
|
417
|
+
onPageSizeSelect: o,
|
|
418
|
+
onChange: i
|
|
419
|
+
}
|
|
420
|
+
) }) });
|
|
421
|
+
}, V = [];
|
|
422
|
+
for (let e = 0; e < 256; e += 1)
|
|
423
|
+
V[e] = e.toString(16).padStart(2, "0");
|
|
424
|
+
const Wt = (e) => `${V[e[0]]}${V[e[1]]}${V[e[2]]}${V[e[3]]}-${V[e[4]]}${V[e[5]]}-${V[e[6]]}${V[e[7]]}-${V[e[8]]}${V[e[9]]}-${V[e[10]]}${V[e[11]]}${V[e[12]]}${V[e[13]]}${V[e[14]]}${V[e[15]]}`, Zt = (e) => {
|
|
425
|
+
if (typeof crypto < "u" && crypto.getRandomValues) {
|
|
426
|
+
crypto.getRandomValues(e);
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
for (let t = 0; t < e.length; t += 1)
|
|
430
|
+
e[t] = Math.floor(Math.random() * 256);
|
|
431
|
+
}, Jt = () => {
|
|
432
|
+
if (typeof crypto < "u" && crypto.randomUUID)
|
|
433
|
+
return crypto.randomUUID();
|
|
434
|
+
const e = new Uint8Array(16);
|
|
435
|
+
return Zt(e), e[6] = e[6] & 15 | 64, e[8] = e[8] & 63 | 128, Wt(e);
|
|
436
|
+
}, Xt = (e) => {
|
|
437
|
+
let { item: t, fieldProps: a, onChange: c, value: s = "" } = e;
|
|
438
|
+
const l = (n) => t.getDisplayValue ? t.getDisplayValue(t, n) : `${t.label}: ${n}`, d = (n) => {
|
|
439
|
+
c(n.currentTarget.value, l(n.currentTarget.value));
|
|
440
|
+
};
|
|
441
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(He, { name: String(t.code), onChange: d, value: s, style: {
|
|
442
|
+
width: "468px"
|
|
443
|
+
}, placeholder: "Поиск", endAdornment: /* @__PURE__ */ r(ne, { icon: "search" }), ...a }) });
|
|
444
|
+
}, ae = D({}), Se = Y(), Ue = Y(), qe = Be(async (e) => {
|
|
445
|
+
const { getData: t, ...a } = e;
|
|
446
|
+
return Je(a), await t();
|
|
447
|
+
});
|
|
448
|
+
f({
|
|
449
|
+
clock: Se,
|
|
450
|
+
fn: (e) => e.code,
|
|
451
|
+
target: Ue
|
|
452
|
+
});
|
|
453
|
+
f({
|
|
454
|
+
clock: Se,
|
|
455
|
+
target: qe
|
|
456
|
+
});
|
|
457
|
+
f({
|
|
458
|
+
source: ae,
|
|
459
|
+
clock: Ue,
|
|
460
|
+
fn: (e, t) => ({
|
|
461
|
+
...e,
|
|
462
|
+
[t]: {
|
|
463
|
+
...e[t],
|
|
464
|
+
isFetching: !0
|
|
465
|
+
}
|
|
466
|
+
}),
|
|
467
|
+
target: ae
|
|
468
|
+
});
|
|
469
|
+
f({
|
|
470
|
+
source: ae,
|
|
471
|
+
clock: qe.done,
|
|
472
|
+
fn: (e, t) => ({
|
|
473
|
+
...e,
|
|
474
|
+
[t.params.code]: {
|
|
475
|
+
code: t.params.code,
|
|
476
|
+
getData: t.params.getData,
|
|
477
|
+
requested: !0,
|
|
478
|
+
isFetching: !1,
|
|
479
|
+
items: t.result
|
|
480
|
+
}
|
|
481
|
+
}),
|
|
482
|
+
target: ae
|
|
483
|
+
});
|
|
484
|
+
function Qe(e) {
|
|
485
|
+
return $e({
|
|
486
|
+
store: ae,
|
|
487
|
+
keys: [e],
|
|
488
|
+
fn: (t) => t[e]?.items || [],
|
|
489
|
+
defaultValue: []
|
|
490
|
+
});
|
|
491
|
+
}
|
|
492
|
+
const Gt = (e) => $e({
|
|
493
|
+
store: ae,
|
|
494
|
+
keys: [e],
|
|
495
|
+
fn: (t) => !!t[e]?.requested
|
|
496
|
+
});
|
|
497
|
+
function Ke(e) {
|
|
498
|
+
return $e({
|
|
499
|
+
store: ae,
|
|
500
|
+
keys: [e],
|
|
501
|
+
fn: (t) => !!t[e]?.isFetching
|
|
502
|
+
});
|
|
503
|
+
}
|
|
504
|
+
function en(e, t) {
|
|
505
|
+
const a = Ke(e), c = Qe(e), s = Gt(e), l = m(Se);
|
|
506
|
+
return ge(() => {
|
|
507
|
+
s || c.length > 0 || l({
|
|
508
|
+
getData: t,
|
|
509
|
+
code: e
|
|
510
|
+
});
|
|
511
|
+
}, [s]), {
|
|
512
|
+
isFetching: a,
|
|
513
|
+
items: c
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
function We(e) {
|
|
517
|
+
let { value_key: t = "id", label_key: a = "name", getData: c, Component: s, code: l, ...d } = e, { isFetching: n, items: i } = en(l, c);
|
|
518
|
+
return n ? /* @__PURE__ */ r("div", { className: d.className, children: /* @__PURE__ */ r(le, { width: "100%", height: 56 }) }) : /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(s, { ...d, options: i.map((o) => ({
|
|
519
|
+
text: o[a],
|
|
520
|
+
label: o[a],
|
|
521
|
+
value: o[t]
|
|
522
|
+
})) }) });
|
|
523
|
+
}
|
|
524
|
+
const tn = (e) => {
|
|
525
|
+
let { item: t } = e;
|
|
526
|
+
return t.async ? /* @__PURE__ */ r(
|
|
527
|
+
We,
|
|
528
|
+
{
|
|
529
|
+
Component: Fe,
|
|
530
|
+
api: t.async.api,
|
|
531
|
+
endpoint: t.async.endpoint,
|
|
532
|
+
value_key: t.async.valueKey,
|
|
533
|
+
label_key: t.async.labelKey,
|
|
534
|
+
cache: !1,
|
|
535
|
+
...e
|
|
536
|
+
}
|
|
537
|
+
) : /* @__PURE__ */ r(Fe, { ...e });
|
|
538
|
+
}, Fe = (e) => {
|
|
539
|
+
let { item: t, onChange: a, value: c = "", error: s, options: l } = e;
|
|
540
|
+
try {
|
|
541
|
+
(!t.options || t.options.length === 0) && (t.options = l);
|
|
542
|
+
} catch {
|
|
543
|
+
console.error("Баг на запись в readonly объект");
|
|
544
|
+
}
|
|
545
|
+
const d = (i) => t.getDisplayValue ? t.getDisplayValue(t, i) : t.multiple ? `${t.label}: ${l?.filter((o) => i.includes(o.value))?.map((o) => o.text).join(", ")}` : `${t.label}: ${l.find((o) => o.value === i)?.text || i}`, n = (i) => {
|
|
546
|
+
const o = Array.isArray(i.target.value) ? i.target.value.filter(Boolean) : i.target.value;
|
|
547
|
+
a(o, d(o));
|
|
548
|
+
};
|
|
549
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(
|
|
550
|
+
dt,
|
|
551
|
+
{
|
|
552
|
+
"data-testid": "filter-select-" + String(t.code),
|
|
553
|
+
error: !!s,
|
|
554
|
+
helperText: s,
|
|
555
|
+
multiple: t.multiple,
|
|
556
|
+
clear: t.clear || !0,
|
|
557
|
+
search: t.search || !0,
|
|
558
|
+
listStyle: t.multiple ? "checkbox" : "default",
|
|
559
|
+
name: String(t.code),
|
|
560
|
+
label: t.label,
|
|
561
|
+
options: l,
|
|
562
|
+
onChange: n,
|
|
563
|
+
value: c
|
|
564
|
+
}
|
|
565
|
+
) });
|
|
566
|
+
}, nn = ["янв", "фев", "мар", "апр", "май", "июн", "июл", "авг", "сен", "окт", "ноя", "дек"], rn = ["январь", "февраль", "март", "апрель", "май", "июнь", "июль", "август", "сентябрь", "октябрь", "ноябрь", "декабрь"], ln = ["вс", "пн", "вт", "ср", "чт", "пт", "сб"], an = ["вск", "пнд", "втр", "срд", "чтв", "птн", "сбт"], sn = ["воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"], cn = /\[[^\]]*]|YYYY|YY|Y|MMMM|MMM|MM|M|DDDD|DDD|DD|Do|D|dddd|ddd|dd|d|HH|H|hh|h|mm|m|ss|s|SSS|SS|S|A|a|ZZ|Z|X|x|Q/g, ie = (e) => !Number.isNaN(e.getTime()), q = (e, t = 2) => String(e).padStart(t, "0"), on = (e) => {
|
|
567
|
+
const t = e % 100;
|
|
568
|
+
if (t >= 11 && t <= 13)
|
|
569
|
+
return `${e}th`;
|
|
570
|
+
const a = e % 10;
|
|
571
|
+
return a === 1 ? `${e}st` : a === 2 ? `${e}nd` : a === 3 ? `${e}rd` : `${e}th`;
|
|
572
|
+
}, Ne = (e) => {
|
|
573
|
+
const t = Date.UTC(e.getFullYear(), 0, 0), a = Date.UTC(e.getFullYear(), e.getMonth(), e.getDate());
|
|
574
|
+
return Math.floor((a - t) / 864e5);
|
|
575
|
+
}, Ve = (e, t) => {
|
|
576
|
+
const a = e.getTimezoneOffset(), c = a <= 0 ? "+" : "-", s = Math.abs(a), l = q(Math.floor(s / 60), 2), d = q(s % 60, 2);
|
|
577
|
+
return t ? `${c}${l}:${d}` : `${c}${l}${d}`;
|
|
578
|
+
}, dn = (e) => {
|
|
579
|
+
if (e instanceof Date)
|
|
580
|
+
return ie(e) ? new Date(e.getTime()) : null;
|
|
581
|
+
const t = e.trim();
|
|
582
|
+
if (!t)
|
|
583
|
+
return null;
|
|
584
|
+
const a = t.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
585
|
+
if (a) {
|
|
586
|
+
const s = Number(a[1]), l = Number(a[2]) - 1, d = Number(a[3]), n = new Date(s, l, d);
|
|
587
|
+
return ie(n) ? n : null;
|
|
588
|
+
}
|
|
589
|
+
if (/^\d{10}$/.test(t)) {
|
|
590
|
+
const s = new Date(Number(t) * 1e3);
|
|
591
|
+
return ie(s) ? s : null;
|
|
592
|
+
}
|
|
593
|
+
if (/^\d{13}$/.test(t)) {
|
|
594
|
+
const s = new Date(Number(t));
|
|
595
|
+
return ie(s) ? s : null;
|
|
596
|
+
}
|
|
597
|
+
const c = new Date(t);
|
|
598
|
+
return ie(c) ? c : null;
|
|
599
|
+
}, un = (e, t) => {
|
|
600
|
+
const a = e.getFullYear(), c = e.getMonth(), s = e.getDate(), l = e.getDay(), d = e.getHours(), n = e.getMinutes(), i = e.getSeconds(), o = e.getMilliseconds(), h = d >= 12 ? "PM" : "AM";
|
|
601
|
+
switch (t) {
|
|
602
|
+
case "Y":
|
|
603
|
+
return String(a);
|
|
604
|
+
case "YY":
|
|
605
|
+
return String(a).slice(-2);
|
|
606
|
+
case "YYYY":
|
|
607
|
+
return String(a);
|
|
608
|
+
case "M":
|
|
609
|
+
return String(c + 1);
|
|
610
|
+
case "MM":
|
|
611
|
+
return q(c + 1, 2);
|
|
612
|
+
case "MMM":
|
|
613
|
+
return nn[c];
|
|
614
|
+
case "MMMM":
|
|
615
|
+
return rn[c];
|
|
616
|
+
case "D":
|
|
617
|
+
return String(s);
|
|
618
|
+
case "DD":
|
|
619
|
+
return q(s, 2);
|
|
620
|
+
case "Do":
|
|
621
|
+
return on(s);
|
|
622
|
+
case "DDD":
|
|
623
|
+
return String(Ne(e));
|
|
624
|
+
case "DDDD":
|
|
625
|
+
return q(Ne(e), 3);
|
|
626
|
+
case "d":
|
|
627
|
+
return String(l);
|
|
628
|
+
case "dd":
|
|
629
|
+
return ln[l];
|
|
630
|
+
case "ddd":
|
|
631
|
+
return an[l];
|
|
632
|
+
case "dddd":
|
|
633
|
+
return sn[l];
|
|
634
|
+
case "H":
|
|
635
|
+
return String(d);
|
|
636
|
+
case "HH":
|
|
637
|
+
return q(d, 2);
|
|
638
|
+
case "h":
|
|
639
|
+
return String(d % 12 || 12);
|
|
640
|
+
case "hh":
|
|
641
|
+
return q(d % 12 || 12, 2);
|
|
642
|
+
case "m":
|
|
643
|
+
return String(n);
|
|
644
|
+
case "mm":
|
|
645
|
+
return q(n, 2);
|
|
646
|
+
case "s":
|
|
647
|
+
return String(i);
|
|
648
|
+
case "ss":
|
|
649
|
+
return q(i, 2);
|
|
650
|
+
case "S":
|
|
651
|
+
return String(Math.floor(o / 100));
|
|
652
|
+
case "SS":
|
|
653
|
+
return q(Math.floor(o / 10), 2);
|
|
654
|
+
case "SSS":
|
|
655
|
+
return q(o, 3);
|
|
656
|
+
case "A":
|
|
657
|
+
return h;
|
|
658
|
+
case "a":
|
|
659
|
+
return h.toLowerCase();
|
|
660
|
+
case "Z":
|
|
661
|
+
return Ve(e, !0);
|
|
662
|
+
case "ZZ":
|
|
663
|
+
return Ve(e, !1);
|
|
664
|
+
case "X":
|
|
665
|
+
return String(Math.floor(e.getTime() / 1e3));
|
|
666
|
+
case "x":
|
|
667
|
+
return String(e.getTime());
|
|
668
|
+
case "Q":
|
|
669
|
+
return String(Math.floor(c / 3) + 1);
|
|
670
|
+
default:
|
|
671
|
+
return t;
|
|
672
|
+
}
|
|
673
|
+
}, Q = (e, t = "DD.MM.YYYY") => {
|
|
674
|
+
const a = dn(e);
|
|
675
|
+
return a ? t.replace(cn, (c) => c.startsWith("[") && c.endsWith("]") ? c.slice(1, -1) : un(a, c)) : "Invalid date";
|
|
676
|
+
}, hn = (e) => {
|
|
677
|
+
let { item: t, onChange: a, value: c = null } = e;
|
|
678
|
+
const s = (d) => {
|
|
679
|
+
if (t.getDisplayValue)
|
|
680
|
+
return t.getDisplayValue(t, d);
|
|
681
|
+
let n = "";
|
|
682
|
+
return t.matchMode === "gt" && (n = "больше"), t.matchMode === "gte" && (n = "больше или равно"), t.matchMode === "lt" && (n = "меньше"), t.matchMode === "lte" && (n = "меньше или равно"), `${t.label} ${n}: ${Q(d, "DD.MM.YYYY")}`;
|
|
683
|
+
}, l = (d) => {
|
|
684
|
+
const n = d.target.value;
|
|
685
|
+
n && a(n, s(n));
|
|
686
|
+
};
|
|
687
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(ut, { name: String(t.code), label: t.label, showMonthYearDropdown: !0, onChange: l, value: c || null }) });
|
|
688
|
+
}, gn = (e) => {
|
|
689
|
+
let { item: t, onChange: a } = e;
|
|
690
|
+
const c = (l, d) => {
|
|
691
|
+
let n = Q(l), i = Q(d);
|
|
692
|
+
return t.getDisplayValue ? t.getDisplayValue(t, { start: l, end: d }) : `${t.label}: с ${n} по ${i}`;
|
|
693
|
+
};
|
|
694
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r(ht, { placeholder: "дд.мм.гггг — дд.мм.гггг", onChange: (l) => {
|
|
695
|
+
const [d, n] = l.target.value;
|
|
696
|
+
d && n && a({ start: d, end: n }, c(d, n));
|
|
697
|
+
} }) });
|
|
698
|
+
}, mn = (e) => {
|
|
699
|
+
let { item: t } = e;
|
|
700
|
+
return t.async ? /* @__PURE__ */ r(
|
|
701
|
+
We,
|
|
702
|
+
{
|
|
703
|
+
Component: Re,
|
|
704
|
+
api: t.async.api,
|
|
705
|
+
endpoint: t.async.endpoint,
|
|
706
|
+
value_key: t.async.valueKey,
|
|
707
|
+
label_key: t.async.labelKey,
|
|
708
|
+
cache: !1,
|
|
709
|
+
...e
|
|
710
|
+
}
|
|
711
|
+
) : /* @__PURE__ */ r(Re, { ...e });
|
|
712
|
+
}, Re = (e) => {
|
|
713
|
+
let { item: t, onChange: a, options: c } = e, [s, l] = T([]);
|
|
714
|
+
try {
|
|
715
|
+
(!t.options || t.options.length === 0) && (t.options = c);
|
|
716
|
+
} catch {
|
|
717
|
+
console.error("Баг на запись в readonly объект");
|
|
718
|
+
}
|
|
719
|
+
const d = (i) => t.getDisplayValue ? t.getDisplayValue(t, i) : `${t.label}: ${c?.filter((o) => i.includes(o.value || o.text))?.map((o) => o.text).join(", ")}`, n = (i) => {
|
|
720
|
+
const o = i.target.checked;
|
|
721
|
+
let h = [...s];
|
|
722
|
+
o ? h.push(i.target.value) : h = h.filter((p) => p !== i.target.value), a(h, d(h)), l(h);
|
|
723
|
+
};
|
|
724
|
+
return /* @__PURE__ */ r(S, { children: c.map((i, o) => /* @__PURE__ */ r("div", { className: "mb-1", children: /* @__PURE__ */ r(Le, { value: i.value, name: String(t.code), label: i.text, disabled: i.disabled, onChange: n }) }, o)) });
|
|
725
|
+
}, fn = "_SearchResult_1uw6b_1", pn = {
|
|
726
|
+
SearchResult: fn
|
|
727
|
+
};
|
|
728
|
+
function yn(e) {
|
|
729
|
+
let {
|
|
730
|
+
endpoint: t,
|
|
731
|
+
getValue: a = (k) => k.id,
|
|
732
|
+
getOption: c = (k) => k.name,
|
|
733
|
+
getTitle: s,
|
|
734
|
+
noResultNode: l = "",
|
|
735
|
+
defaultValue: d,
|
|
736
|
+
onSelect: n,
|
|
737
|
+
onChange: i,
|
|
738
|
+
onReset: o,
|
|
739
|
+
onClickAway: h,
|
|
740
|
+
recommendations: p,
|
|
741
|
+
label__recommendations: C,
|
|
742
|
+
inputProps: F,
|
|
743
|
+
getData: y,
|
|
744
|
+
code: b,
|
|
745
|
+
...v
|
|
746
|
+
} = e;
|
|
747
|
+
const [x] = m([Se]), M = Ke(b), N = Qe(b);
|
|
748
|
+
let [L, O] = T(null), [E, A] = T(!1), [I, H] = T(d || "");
|
|
749
|
+
const [B, z] = T(!!v.focused), G = () => {
|
|
750
|
+
j(), H(""), o && o();
|
|
751
|
+
}, j = () => {
|
|
752
|
+
A(!1), z(!1), h && h();
|
|
753
|
+
}, ee = gt(j);
|
|
754
|
+
s || (s = c);
|
|
755
|
+
const te = (k) => {
|
|
756
|
+
let $ = k.target.value;
|
|
757
|
+
if (N.length && A && A(!1), $.length >= 3) {
|
|
758
|
+
L && clearTimeout(L);
|
|
759
|
+
let se = setTimeout(() => {
|
|
760
|
+
typeof t != "string" && (t = t($)), x({
|
|
761
|
+
getData: y,
|
|
762
|
+
code: b
|
|
763
|
+
});
|
|
764
|
+
}, 500);
|
|
765
|
+
O(se);
|
|
766
|
+
}
|
|
767
|
+
i ? i($) : H($);
|
|
768
|
+
}, U = (k) => {
|
|
769
|
+
H(s(k)), z(!1), i && i(s(k)), n && n(a(k), k);
|
|
770
|
+
}, re = (k) => {
|
|
771
|
+
z(!0), v.onFocus?.(k);
|
|
772
|
+
}, R = (k) => {
|
|
773
|
+
z(!1), v.onBlur?.(k);
|
|
774
|
+
};
|
|
775
|
+
let W = e.value || I, he = /* @__PURE__ */ w(S, { children: [
|
|
776
|
+
!!W.length && /* @__PURE__ */ r(Ae, { position: "start", children: /* @__PURE__ */ r(de, { "data-testid": "search-reset", variant: "transparent", color: "neutral", size: "small", onClick: G, children: /* @__PURE__ */ r(ne, { icon: "close", className: "text-gray-600" }) }) }),
|
|
777
|
+
/* @__PURE__ */ r(Ae, { position: "start", children: M ? /* @__PURE__ */ r(Ie, {}) : /* @__PURE__ */ r(ne, { icon: "search", className: "text-gray-600" }) })
|
|
778
|
+
] });
|
|
779
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r("div", { className: "relative", "data-testid": "search", children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r("div", { ref: ee, children: /* @__PURE__ */ w("div", { children: [
|
|
780
|
+
/* @__PURE__ */ r(
|
|
781
|
+
He,
|
|
782
|
+
{
|
|
783
|
+
"data-testid": "search-input",
|
|
784
|
+
...v,
|
|
785
|
+
value: W,
|
|
786
|
+
...F,
|
|
787
|
+
onChange: te,
|
|
788
|
+
onFocus: re,
|
|
789
|
+
onBlur: R,
|
|
790
|
+
endAdornment: he
|
|
791
|
+
}
|
|
792
|
+
),
|
|
793
|
+
/* @__PURE__ */ r("div", { children: (N.length > 0 || E || p) && /* @__PURE__ */ r("div", { "data-testid": "search-result", className: pn.SearchResult, children: /* @__PURE__ */ w("div", { children: [
|
|
794
|
+
p && N.length === 0 && B && !E && /* @__PURE__ */ r(
|
|
795
|
+
Sn,
|
|
796
|
+
{
|
|
797
|
+
title: C,
|
|
798
|
+
items: p,
|
|
799
|
+
renderItem: c,
|
|
800
|
+
onSelect: U
|
|
801
|
+
}
|
|
802
|
+
),
|
|
803
|
+
N.map((k, $) => /* @__PURE__ */ r("div", { className: "SearchAnythingOption", "data-testid": "search-option", onClick: () => U(k), children: c(k) }, $)),
|
|
804
|
+
E && l
|
|
805
|
+
] }) }) })
|
|
806
|
+
] }) }) }) }) });
|
|
807
|
+
}
|
|
808
|
+
function Sn(e) {
|
|
809
|
+
let { title: t, items: a, renderItem: c, onSelect: s } = e;
|
|
810
|
+
return /* @__PURE__ */ w(S, { children: [
|
|
811
|
+
t && /* @__PURE__ */ r("div", { className: "py-2", children: /* @__PURE__ */ r("div", { className: "text-gray-500", "data-testid": "search-recommendations-title", children: t }) }),
|
|
812
|
+
/* @__PURE__ */ r("div", { "data-testid": "search-recommendations-result", children: a.map((l, d) => /* @__PURE__ */ r("div", { className: "py-1", "data-testid": "search-recommendations-item", onClick: () => s(l), children: c(l) }, d)) })
|
|
813
|
+
] });
|
|
814
|
+
}
|
|
815
|
+
const we = (e, t) => typeof t == "string" ? e[t] : t(e), bn = (e) => {
|
|
816
|
+
let { item: t, onChange: a, value: c = "" } = e, [s, l] = T(c);
|
|
817
|
+
const d = (o) => t.getDisplayValue ? t.getDisplayValue(t, o) : `${t.label}: ${o}`, n = (o, h) => {
|
|
818
|
+
a(o, d(we(h, t.async.labelKey || "name")));
|
|
819
|
+
};
|
|
820
|
+
let i = typeof t.async.endpoint == "string" ? t.async.endpoint : t.async.endpoint(s);
|
|
821
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(
|
|
822
|
+
yn,
|
|
823
|
+
{
|
|
824
|
+
onChange: l,
|
|
825
|
+
onSelect: n,
|
|
826
|
+
value: s,
|
|
827
|
+
endpoint: i,
|
|
828
|
+
getValue: (o) => o[t.async.valueKey || "id"],
|
|
829
|
+
getTitle: (o) => we(o, t.async.labelKey || "name"),
|
|
830
|
+
getOption: (o) => we(o, t.async.labelKey || "name")
|
|
831
|
+
}
|
|
832
|
+
) }) });
|
|
833
|
+
}, vn = (e) => {
|
|
834
|
+
let { item: t, onChange: a, min: c, max: s } = e;
|
|
835
|
+
const l = (n) => t.getDisplayValue ? t.getDisplayValue(t, n) : `${t.label}: ${n[0]} - ${n[1]}`;
|
|
836
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r("div", { className: "pb-5", style: { width: 360 }, children: /* @__PURE__ */ r(mt, { min: c, max: s, size: "small", defaultValue: [c, s], onChange: (n) => {
|
|
837
|
+
a(n, l(n));
|
|
838
|
+
} }) }) });
|
|
839
|
+
}, _n = (e) => {
|
|
840
|
+
let { item: t, value: a, onChange: c, error: s } = e;
|
|
841
|
+
return /* @__PURE__ */ w(S, { children: [
|
|
842
|
+
t.type === "string" && /* @__PURE__ */ r(Xt, { item: t, value: a, onChange: c, fieldProps: t.fieldProps }),
|
|
843
|
+
(t.type === "select" || t.type === "filter") && /* @__PURE__ */ r(tn, { error: s, type: t.type, item: t, value: a, options: t.options, onChange: c }),
|
|
844
|
+
t.type === "date" && /* @__PURE__ */ r(hn, { item: t, value: a, onChange: c }),
|
|
845
|
+
t.type === "period" && /* @__PURE__ */ r(gn, { item: t, value: a, onChange: c }),
|
|
846
|
+
t.type === "checkbox" && /* @__PURE__ */ r(mn, { item: t, value: a, options: t.options, onChange: c }),
|
|
847
|
+
t.type === "search" && /* @__PURE__ */ r(bn, { item: t, value: a, onChange: c }),
|
|
848
|
+
t.type === "interval" && /* @__PURE__ */ r(vn, { item: t, value: a, min: t.min, max: t.max, onChange: c })
|
|
849
|
+
] });
|
|
850
|
+
}, Cn = "_filter_close_o8fvt_1", Dn = {
|
|
851
|
+
filter_close: Cn
|
|
852
|
+
};
|
|
853
|
+
function wn(e) {
|
|
854
|
+
let { filter: t, onClose: a, onSubmit: c } = e, [s, l] = T(""), [d, n] = T("");
|
|
855
|
+
const i = (h, p) => {
|
|
856
|
+
l(h), n(p);
|
|
857
|
+
}, o = () => {
|
|
858
|
+
c(s, d);
|
|
859
|
+
};
|
|
860
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ w("div", { style: { minWidth: t.type === "search" ? "560px" : "360px" }, "data-testid": "filter-form", children: [
|
|
861
|
+
/* @__PURE__ */ w("div", { className: "relative mb-2 py-2 px-2 bg-gray-200", children: [
|
|
862
|
+
/* @__PURE__ */ r("div", { children: t.label }),
|
|
863
|
+
/* @__PURE__ */ r("div", { className: Dn.filter_close, children: /* @__PURE__ */ r(de, { onClick: a, size: "small", children: /* @__PURE__ */ r(ne, { icon: "close" }) }) })
|
|
864
|
+
] }),
|
|
865
|
+
/* @__PURE__ */ r("div", { className: "mb-2 px-2", children: /* @__PURE__ */ r(_n, { value: s, item: t, onChange: i }) }),
|
|
866
|
+
/* @__PURE__ */ r("div", { className: "px-2 py-1 border-top border-gray-200 flex justify-end", children: /* @__PURE__ */ r(ft, { onClick: o, size: "medium", color: "neutral", "data-testid": "filter-submit", disabled: !s, variant: "transparent", children: "Применить" }) })
|
|
867
|
+
] }) });
|
|
868
|
+
}
|
|
869
|
+
const kn = (e) => {
|
|
870
|
+
let { onSubmit: t, items: a } = e, [c, s] = T(null), [l, d] = T(null), [n, i] = T(null);
|
|
871
|
+
const o = (y) => {
|
|
872
|
+
i(y.currentTarget);
|
|
873
|
+
}, h = () => {
|
|
874
|
+
d(null), i(null);
|
|
875
|
+
}, p = (y) => {
|
|
876
|
+
let b = a.find((v) => v.code === y.value);
|
|
877
|
+
b.type === "button" ? (t(b, b.value, b.label), h()) : d(b);
|
|
878
|
+
}, C = (y, b) => {
|
|
879
|
+
l && (t(l, y, b), h());
|
|
880
|
+
};
|
|
881
|
+
let F = a.map((y) => ({
|
|
882
|
+
value: y.code,
|
|
883
|
+
label: y.label
|
|
884
|
+
}));
|
|
885
|
+
return /* @__PURE__ */ w(S, { children: [
|
|
886
|
+
/* @__PURE__ */ r(de, { size: "small", onClick: o, "data-testid": "filter-btn", children: /* @__PURE__ */ r(ne, { icon: "filter_list", size: "extraLarge", className: "text-extraLarge" }) }),
|
|
887
|
+
n && /* @__PURE__ */ r(
|
|
888
|
+
fe,
|
|
889
|
+
{
|
|
890
|
+
classes: { paper: "p-0" },
|
|
891
|
+
open: !!n,
|
|
892
|
+
anchorEl: n,
|
|
893
|
+
onClose: h,
|
|
894
|
+
placement: "bottom-start",
|
|
895
|
+
children: !l || l.type === "button" ? /* @__PURE__ */ r("div", { "data-testid": "filter-filters", children: /* @__PURE__ */ r(ye, { items: F, onButtonClick: p }) }) : /* @__PURE__ */ r(wn, { filter: l, onClose: h, onSubmit: C })
|
|
896
|
+
}
|
|
897
|
+
)
|
|
898
|
+
] });
|
|
899
|
+
}, $n = "_filter_search_input_1rpsv_1", xn = "_filter_search_loader_1rpsv_16", Ye = {
|
|
900
|
+
filter_search_input: $n,
|
|
901
|
+
filter_search_loader: xn
|
|
902
|
+
}, Mn = (e) => {
|
|
903
|
+
let [t, a] = T(e.value), [c, s] = T(null), [l, d] = T(!1);
|
|
904
|
+
const n = (i) => {
|
|
905
|
+
let o = i.currentTarget.value;
|
|
906
|
+
if (a(o), c && clearTimeout(c), e.onChange) {
|
|
907
|
+
d(!0);
|
|
908
|
+
let h = setTimeout(() => {
|
|
909
|
+
e.onChange(o), d(!1);
|
|
910
|
+
}, e.delay || 2e3);
|
|
911
|
+
s(h);
|
|
912
|
+
}
|
|
913
|
+
};
|
|
914
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ w("div", { className: "relative pr-3 flex items-center", children: [
|
|
915
|
+
/* @__PURE__ */ r("input", { className: Ye.filter_search_input, type: "text", placeholder: "Поиск", value: t, onChange: n }),
|
|
916
|
+
l && /* @__PURE__ */ r("div", { className: Ye.filter_search_loader, children: /* @__PURE__ */ r(Ie, { color: "neutral", size: "small" }) })
|
|
917
|
+
] }) });
|
|
918
|
+
}, An = (e, t, a) => {
|
|
919
|
+
let c = {}, s = {}, l;
|
|
920
|
+
const d = (n) => {
|
|
921
|
+
let i = n.matchMode || "exact", o = {};
|
|
922
|
+
if (n.value === void 0)
|
|
923
|
+
return o;
|
|
924
|
+
switch (n.type) {
|
|
925
|
+
case "string":
|
|
926
|
+
case "search":
|
|
927
|
+
case "select":
|
|
928
|
+
o = { value: n.getValue ? n.getValue(n.value) : n.value, matchMode: i, displayValue: n.displayValue };
|
|
929
|
+
break;
|
|
930
|
+
case "date":
|
|
931
|
+
let p = Q(n.value, "YYYY-MM-DD");
|
|
932
|
+
n.getValue && n.value && (p = n.getValue(n.value)), o = { value: p, matchMode: i, displayValue: n.displayValue };
|
|
933
|
+
break;
|
|
934
|
+
case "period":
|
|
935
|
+
let C = n.getEnd ? n.getEnd(n.value.end) : Q(n.value.end, n.endFormat || ""), y = [n.getStart ? n.getStart(n.value.start) : Q(n.value.start, n.startFormat || ""), C];
|
|
936
|
+
n.getValue && (y = n.getValue(n.value)), o = { value: y, matchMode: "range", displayValue: n.displayValue };
|
|
937
|
+
break;
|
|
938
|
+
case "checkbox":
|
|
939
|
+
o = { value: n.value, matchMode: "in", displayValue: n.displayValue };
|
|
940
|
+
break;
|
|
941
|
+
case "interval":
|
|
942
|
+
let b = n.value;
|
|
943
|
+
n.getValue && n.value && (b = n.getValue(n.value)), o = { value: b, matchMode: n.matchMode || "interval", displayValue: n.displayValue };
|
|
944
|
+
break;
|
|
945
|
+
default:
|
|
946
|
+
o = { value: n.value, matchMode: n.matchMode || "exact", displayValue: n.displayValue };
|
|
947
|
+
break;
|
|
948
|
+
}
|
|
949
|
+
return o;
|
|
950
|
+
};
|
|
951
|
+
return e.filter((n) => n.logic !== "sub").forEach((n) => {
|
|
952
|
+
c[String(n.code)] = d(n);
|
|
953
|
+
}), l = e.filter((n) => n.logic === "sub").map((n) => ({
|
|
954
|
+
sys_name: { value: String(n.code), matchMode: "exact" },
|
|
955
|
+
value: d(n),
|
|
956
|
+
sub_values_list: n.subLogic?.sub_values_list || "",
|
|
957
|
+
sub_app: n.subLogic?.sub_app || "",
|
|
958
|
+
sub_model: n.subLogic?.sub_model || ""
|
|
959
|
+
})), a && t && t.forEach((n) => {
|
|
960
|
+
s[n] = { value: a, matchMode: "contains" };
|
|
961
|
+
}), Object.values(c).length + Object.values(s).length + l.length > 0 ? {
|
|
962
|
+
and: c,
|
|
963
|
+
or: s,
|
|
964
|
+
sub: l
|
|
965
|
+
} : !1;
|
|
966
|
+
};
|
|
967
|
+
function Ee(e, t, a, c) {
|
|
968
|
+
const s = (l, d) => {
|
|
969
|
+
if (!l.value) return !1;
|
|
970
|
+
let n = !0, i = String(l.compareKey || l.code), o = String(l.getCompareValue ? l.getCompareValue(d) : d[i]);
|
|
971
|
+
if (l.getValid)
|
|
972
|
+
n = l.getValid(d, l);
|
|
973
|
+
else if (l.type === "string")
|
|
974
|
+
((l.matchMode === "contains" || l.matchMode === "icontains" || !l.matchMode) && (!o || !o.toLowerCase().includes(l.value.toLowerCase())) || l.matchMode === "exact" && o?.toLowerCase() !== l.value.toLowerCase()) && (n = !1);
|
|
975
|
+
else if (l.type === "search")
|
|
976
|
+
l.matchMode === "contains" || l.matchMode === "icontains" ? o?.includes(l.value) || (n = !1) : o !== l.value && (n = !1);
|
|
977
|
+
else if (l.type === "select") {
|
|
978
|
+
let h = l.options.find((p) => p.value === l.value);
|
|
979
|
+
n = !1, (l.matchMode === "contains" && h && (o.includes(h.text) || o.includes(h.value)) || h && (o === h.text || o === h.value)) && (n = !0);
|
|
980
|
+
} else if (l.type === "date" && l.value) {
|
|
981
|
+
let h = new Date(Q(new Date(o), "YYYY-MM-DD")), p = new Date(Q(l.value, "YYYY-MM-DD"));
|
|
982
|
+
(l.matchMode === "exact" && h.getTime() !== p.getTime() || l.matchMode === "gt" && h.getTime() <= p.getTime() || l.matchMode === "gte" && h.getTime() < p.getTime() || l.matchMode === "lt" && h.getTime() >= p.getTime() || l.matchMode === "lte" && h.getTime() > p.getTime()) && (n = !1);
|
|
983
|
+
} else if (l.type === "period" && l.value.end && l.value.start) {
|
|
984
|
+
let h = new Date(Q(l.value.start, "YYYY-MM-DD")), p = new Date(Q(l.value.end, "YYYY-MM-DD")), C = new Date(Q(new Date(o), "YYYY-MM-DD"));
|
|
985
|
+
(C.getTime() > p.getTime() || C.getTime() < h.getTime()) && (n = !1);
|
|
986
|
+
} else l.type === "checkbox" && (l.value.includes(o) || (n = !1));
|
|
987
|
+
return n;
|
|
988
|
+
};
|
|
989
|
+
return e.map((l) => {
|
|
990
|
+
let d = t.every((n) => s(n, l));
|
|
991
|
+
return {
|
|
992
|
+
...l,
|
|
993
|
+
dt_hidden: !d
|
|
994
|
+
};
|
|
995
|
+
});
|
|
996
|
+
}
|
|
997
|
+
function Tn(e) {
|
|
998
|
+
let { items: t, searchItems: a, selected: c, onSubmit: s, onDelete: l, onChange: d, searchDelay: n, searchQuery: i } = e, [o, h] = T(c || []);
|
|
999
|
+
const p = (y, b, v) => {
|
|
1000
|
+
let x = o.filter((M) => M.code !== y.code).concat({ ...y, value: b, displayValue: v });
|
|
1001
|
+
h(x), d && d(x), s && s(y, b, v);
|
|
1002
|
+
}, C = (y) => {
|
|
1003
|
+
let b = o.filter((v) => v.code !== y.code);
|
|
1004
|
+
h(b), d && d(b), l && l(String(y.code));
|
|
1005
|
+
};
|
|
1006
|
+
let F = o.filter((y) => !y.hidden);
|
|
1007
|
+
return /* @__PURE__ */ r(S, { children: /* @__PURE__ */ r("div", { className: "flex items-center border-bottom border-gray-300", style: { minHeight: 76 }, children: /* @__PURE__ */ w("div", { className: "flex items-center w-full", children: [
|
|
1008
|
+
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ r(kn, { items: t, onSubmit: p }) }),
|
|
1009
|
+
F.length > 0 && /* @__PURE__ */ r(Oe, { className: "ml-1", spacing: "small", children: F.map((y, b) => /* @__PURE__ */ r(
|
|
1010
|
+
pt,
|
|
1011
|
+
{
|
|
1012
|
+
"data-testid": "filter-chip",
|
|
1013
|
+
text: y.displayValue,
|
|
1014
|
+
onClose: () => C(y)
|
|
1015
|
+
},
|
|
1016
|
+
b
|
|
1017
|
+
)) }),
|
|
1018
|
+
!!a && a.length > 0 && e.onSearch && /* @__PURE__ */ r("div", { className: "text-gray-500 ml-1 block", children: /* @__PURE__ */ r(Mn, { value: i || "", onChange: e.onSearch, delay: n }) })
|
|
1019
|
+
] }) }) });
|
|
1020
|
+
}
|
|
1021
|
+
function Fn() {
|
|
1022
|
+
const {
|
|
1023
|
+
$search: e,
|
|
1024
|
+
$filters: t,
|
|
1025
|
+
$currentFilter: a,
|
|
1026
|
+
currentFilterSet: c,
|
|
1027
|
+
currentFilterDeleted: s,
|
|
1028
|
+
searchQuerySet: l,
|
|
1029
|
+
$searchQuery: d
|
|
1030
|
+
} = X(), n = m(e), i = m(t), o = m(a), h = m(l), p = m(s), C = m(c), F = m(d), y = i.filter((v) => !v.hidden), b = (v, x, M) => {
|
|
1031
|
+
const N = {
|
|
1032
|
+
...v,
|
|
1033
|
+
value: x,
|
|
1034
|
+
displayValue: M
|
|
1035
|
+
};
|
|
1036
|
+
C(N);
|
|
1037
|
+
};
|
|
1038
|
+
return y.length <= 0 ? null : /* @__PURE__ */ r("div", { "data-testid": "dt-filter", children: /* @__PURE__ */ r(
|
|
1039
|
+
Tn,
|
|
1040
|
+
{
|
|
1041
|
+
searchQuery: F,
|
|
1042
|
+
selected: o,
|
|
1043
|
+
items: y,
|
|
1044
|
+
searchItems: n,
|
|
1045
|
+
onSubmit: b,
|
|
1046
|
+
onDelete: p,
|
|
1047
|
+
onSearch: h,
|
|
1048
|
+
searchDelay: 1e3
|
|
1049
|
+
}
|
|
1050
|
+
) });
|
|
1051
|
+
}
|
|
1052
|
+
const me = (e) => e.map((t) => ({
|
|
1053
|
+
...t,
|
|
1054
|
+
dt_id: Jt(),
|
|
1055
|
+
dt_hidden: !1,
|
|
1056
|
+
dt_selected: !1
|
|
1057
|
+
}));
|
|
1058
|
+
function Nn(e) {
|
|
1059
|
+
let {
|
|
1060
|
+
structure: t,
|
|
1061
|
+
items: a,
|
|
1062
|
+
getRowStyles: c,
|
|
1063
|
+
onRowClick: s,
|
|
1064
|
+
rowClassName: l,
|
|
1065
|
+
onContextMenu: d,
|
|
1066
|
+
emptyResult: n
|
|
1067
|
+
} = e;
|
|
1068
|
+
const {
|
|
1069
|
+
dataTableInitialized: i,
|
|
1070
|
+
itemsSet: o,
|
|
1071
|
+
$isReady: h,
|
|
1072
|
+
dataFetched: p,
|
|
1073
|
+
// pageSet,
|
|
1074
|
+
// pageSizeSet,
|
|
1075
|
+
$local: C
|
|
1076
|
+
} = X(), F = m(i), y = m(o), b = m(h), v = m(C), x = m(p);
|
|
1077
|
+
return ge(() => {
|
|
1078
|
+
F({
|
|
1079
|
+
endpoint: e.endpoint || "",
|
|
1080
|
+
page: e.page,
|
|
1081
|
+
pageSize: e.pageSize,
|
|
1082
|
+
items: e.items ? me(e.items) : [],
|
|
1083
|
+
structure: t,
|
|
1084
|
+
sort: e.sort,
|
|
1085
|
+
order: e.order || "desc",
|
|
1086
|
+
local: v,
|
|
1087
|
+
contextActions: e.contextActions,
|
|
1088
|
+
enableRowClick: !!e.onRowClick,
|
|
1089
|
+
rowActions: e.rowActions,
|
|
1090
|
+
tableActions: e.tableActions,
|
|
1091
|
+
displayActionCol: e.displayActionCol,
|
|
1092
|
+
displayIndex: !!e.displayIndex,
|
|
1093
|
+
filters: e.filters
|
|
1094
|
+
});
|
|
1095
|
+
}, []), ge(() => {
|
|
1096
|
+
b && v && a && y({
|
|
1097
|
+
items: a,
|
|
1098
|
+
applyFilters: !0
|
|
1099
|
+
});
|
|
1100
|
+
}, [b, a, v]), ge(() => {
|
|
1101
|
+
b && x();
|
|
1102
|
+
}, [b]), b ? /* @__PURE__ */ w(S, { children: [
|
|
1103
|
+
/* @__PURE__ */ r(St, {}),
|
|
1104
|
+
/* @__PURE__ */ r(Fn, {}),
|
|
1105
|
+
/* @__PURE__ */ r("div", { style: { overflow: "auto" }, children: /* @__PURE__ */ r(
|
|
1106
|
+
jt,
|
|
1107
|
+
{
|
|
1108
|
+
getRowStyles: c,
|
|
1109
|
+
onRowClick: s,
|
|
1110
|
+
onContextMenu: d,
|
|
1111
|
+
rowClassName: l,
|
|
1112
|
+
emptyResult: n
|
|
1113
|
+
}
|
|
1114
|
+
) }),
|
|
1115
|
+
/* @__PURE__ */ r(Kt, {})
|
|
1116
|
+
] }) : null;
|
|
1117
|
+
}
|
|
1118
|
+
const Ze = st(null);
|
|
1119
|
+
function ur(e) {
|
|
1120
|
+
const { store: t, ...a } = e;
|
|
1121
|
+
return /* @__PURE__ */ r(Ze.Provider, { value: t, children: /* @__PURE__ */ r(Nn, { ...a }) });
|
|
1122
|
+
}
|
|
1123
|
+
const Vn = (e, t) => t === "asc" ? (a, c) => {
|
|
1124
|
+
let s = a[e], l = c[e];
|
|
1125
|
+
return typeof s == "number" && typeof l == "number" ? l - s : (s = String(s), l = String(l), s?.localeCompare(l));
|
|
1126
|
+
} : (a, c) => {
|
|
1127
|
+
let s = a[e], l = c[e];
|
|
1128
|
+
return typeof s == "number" && typeof l == "number" ? s - l : (s = String(s), l = String(l), l?.localeCompare(s));
|
|
1129
|
+
}, ke = {
|
|
1130
|
+
getArray(e) {
|
|
1131
|
+
let t = [], a = localStorage.getItem(e);
|
|
1132
|
+
if (a)
|
|
1133
|
+
try {
|
|
1134
|
+
t = JSON.parse(a);
|
|
1135
|
+
} catch {
|
|
1136
|
+
}
|
|
1137
|
+
return t;
|
|
1138
|
+
},
|
|
1139
|
+
setItem(e, t) {
|
|
1140
|
+
localStorage.setItem(e, t);
|
|
1141
|
+
},
|
|
1142
|
+
getItem(e) {
|
|
1143
|
+
return localStorage.getItem(e);
|
|
1144
|
+
},
|
|
1145
|
+
pushValue(e, t, a = 5, c, s) {
|
|
1146
|
+
let l = ke.getArray(e);
|
|
1147
|
+
if (a ? l = [t].concat(l) : l.push(t), c) {
|
|
1148
|
+
let d = l.reduce((n, i) => (n[i[c]] = i, n), {});
|
|
1149
|
+
l = Object.values(d);
|
|
1150
|
+
} else s && (l = Array.from(new Set(l)));
|
|
1151
|
+
a && (l = l.slice(0, a)), localStorage.setItem(e, JSON.stringify(l));
|
|
1152
|
+
}
|
|
1153
|
+
}, Rn = (e, t) => {
|
|
1154
|
+
let a = t.split("?");
|
|
1155
|
+
if (a[1]) {
|
|
1156
|
+
let c = new URLSearchParams(a[1]);
|
|
1157
|
+
return c.delete(e), Array.from(c).length > 0 ? `${a[0]}?${c.toString()}` : a[0];
|
|
1158
|
+
}
|
|
1159
|
+
return t;
|
|
1160
|
+
}, Yn = (e) => e.filter((t) => t.type === "period" && t.value?.start && t.value.end || t.type !== "period" && t.type !== "button" && t.value && !Array.isArray(t.value) || Array.isArray(t.value) && t.value.length > 0);
|
|
1161
|
+
function Je(e) {
|
|
1162
|
+
let { filter: t, searchQuery: a, searchFields: c, page: s, sort: l, order: d, pageSize: n } = e, i = new URLSearchParams();
|
|
1163
|
+
if (s && i.append("page", String(s || "1")), n && i.append("page_size", String(n)), t) {
|
|
1164
|
+
let o = An(t, c, a);
|
|
1165
|
+
o && (Object.values(o.and).length > 0 && i.append("filter64", JSON.stringify(o.and)), Object.values(o.or).length > 0 && i.append("filter64_or", JSON.stringify(o.or)), o.sub.length > 0 && o.sub.forEach((h) => {
|
|
1166
|
+
i.append("filter64_sub", JSON.stringify(h));
|
|
1167
|
+
}));
|
|
1168
|
+
}
|
|
1169
|
+
return l && d && i.append("sort_field", (d === "desc" ? "-" : "") + l), i;
|
|
1170
|
+
}
|
|
1171
|
+
const hr = rt((e) => {
|
|
1172
|
+
const t = new URLSearchParams(window.location.search), a = D(!1), c = D(e.structure || []), s = D(e.endpoint || ""), l = D(!1), d = D(e.filters || []), n = D([]), i = D(e.items || []), o = D(e.search || []), h = D(""), p = D(0), C = D(t.get("page") ? Number(t.get("page")) : 1);
|
|
1173
|
+
let F = ke.getItem("pageSize") ? parseInt(ke.getItem("pageSize")) : e.pageSize || 12;
|
|
1174
|
+
t.get("page_size") && (F = Number(t.get("page_size")));
|
|
1175
|
+
const y = D(F), b = D(!1), v = D(t.get("sort_field")?.replace(/^-/, "") || e.sort || "");
|
|
1176
|
+
let x = e.order || "asc";
|
|
1177
|
+
t.get("sort_field") && (x = t.get("sort_field")?.startsWith("-") ? "desc" : "asc");
|
|
1178
|
+
const M = D(x), N = D(!!e.local), L = D([]), O = D(!!e.displayActionCol), E = D([]), A = D(!!e.displayIndex), I = D(!1), H = D([]), B = D(e.getResult || null), z = D(e.getCount || null), G = D(e.mapper || null), j = Y(), ee = {
|
|
1179
|
+
endpoint: s,
|
|
1180
|
+
currentFilter: n,
|
|
1181
|
+
page: C,
|
|
1182
|
+
pageSize: y,
|
|
1183
|
+
sort: v,
|
|
1184
|
+
order: M,
|
|
1185
|
+
searchQuery: h,
|
|
1186
|
+
searchFields: o,
|
|
1187
|
+
local: N
|
|
1188
|
+
};
|
|
1189
|
+
f({
|
|
1190
|
+
clock: j,
|
|
1191
|
+
target: h
|
|
1192
|
+
});
|
|
1193
|
+
const te = Y(), U = Y();
|
|
1194
|
+
f({
|
|
1195
|
+
source: n,
|
|
1196
|
+
clock: U,
|
|
1197
|
+
fn: (u, g) => u.filter((P) => P.code !== g.code).concat(g),
|
|
1198
|
+
target: n
|
|
1199
|
+
}), f({
|
|
1200
|
+
source: n,
|
|
1201
|
+
clock: te,
|
|
1202
|
+
fn: (u, g) => u.filter((_) => _.code !== g),
|
|
1203
|
+
target: n
|
|
1204
|
+
}), f({
|
|
1205
|
+
clock: [j, U, te],
|
|
1206
|
+
fn: () => 1,
|
|
1207
|
+
target: C
|
|
1208
|
+
});
|
|
1209
|
+
const re = Y();
|
|
1210
|
+
f({
|
|
1211
|
+
source: oe(N, i, n),
|
|
1212
|
+
clock: n,
|
|
1213
|
+
filter: ([u, g]) => u && g.length > 0,
|
|
1214
|
+
fn: ([u, g, _]) => Ee(g, _),
|
|
1215
|
+
target: re
|
|
1216
|
+
}), f({
|
|
1217
|
+
clock: re,
|
|
1218
|
+
target: i
|
|
1219
|
+
}), f({
|
|
1220
|
+
clock: re,
|
|
1221
|
+
fn: (u) => u.filter((g) => !g.dt_hidden).length,
|
|
1222
|
+
target: p
|
|
1223
|
+
});
|
|
1224
|
+
const R = Y();
|
|
1225
|
+
f({
|
|
1226
|
+
source: i,
|
|
1227
|
+
clock: R,
|
|
1228
|
+
fn: (u, g) => {
|
|
1229
|
+
let { rows: _, flag: P } = g;
|
|
1230
|
+
return u.map((J) => _.includes(J.dt_id) ? {
|
|
1231
|
+
...J,
|
|
1232
|
+
dt_selected: P
|
|
1233
|
+
} : J);
|
|
1234
|
+
},
|
|
1235
|
+
target: i
|
|
1236
|
+
});
|
|
1237
|
+
const W = Y();
|
|
1238
|
+
f({
|
|
1239
|
+
clock: W,
|
|
1240
|
+
target: v
|
|
1241
|
+
}), f({
|
|
1242
|
+
source: oe(v, M),
|
|
1243
|
+
clock: W,
|
|
1244
|
+
fn: ([u, g], _) => u === _ && g === "asc" ? "desc" : "asc",
|
|
1245
|
+
target: M
|
|
1246
|
+
});
|
|
1247
|
+
const he = Y(), k = Be(async (u) => {
|
|
1248
|
+
let {
|
|
1249
|
+
endpoint: g,
|
|
1250
|
+
currentFilter: _,
|
|
1251
|
+
page: P,
|
|
1252
|
+
pageSize: J,
|
|
1253
|
+
sort: ce,
|
|
1254
|
+
order: Xe,
|
|
1255
|
+
searchQuery: Ge,
|
|
1256
|
+
searchFields: et
|
|
1257
|
+
} = u;
|
|
1258
|
+
const Me = Je({
|
|
1259
|
+
page: P,
|
|
1260
|
+
pageSize: J,
|
|
1261
|
+
sort: ce,
|
|
1262
|
+
order: Xe,
|
|
1263
|
+
filter: _,
|
|
1264
|
+
searchQuery: Ge,
|
|
1265
|
+
searchFields: et
|
|
1266
|
+
});
|
|
1267
|
+
g = Rn("filter64_sub", g);
|
|
1268
|
+
let tt = Me.toString().length > 0 || g.includes("?") ? (g.includes("?") ? "&" : "?") + Me.toString() : "/", nt = g + tt;
|
|
1269
|
+
return e.getData(nt);
|
|
1270
|
+
});
|
|
1271
|
+
f({
|
|
1272
|
+
clock: he,
|
|
1273
|
+
source: ee,
|
|
1274
|
+
filter: (u) => !u.local,
|
|
1275
|
+
target: k
|
|
1276
|
+
}), f({
|
|
1277
|
+
clock: k.pending,
|
|
1278
|
+
target: b
|
|
1279
|
+
}), f({
|
|
1280
|
+
source: oe(z, B),
|
|
1281
|
+
clock: k.doneData,
|
|
1282
|
+
fn: ([u, g], _) => u ? u(_) : Array.isArray(_) ? _.length : g ? g(_).length : 0,
|
|
1283
|
+
target: p
|
|
1284
|
+
}), f({
|
|
1285
|
+
source: oe(B, G),
|
|
1286
|
+
clock: k.doneData,
|
|
1287
|
+
fn: ([u, g], _) => {
|
|
1288
|
+
let P = u ? u(_) : _;
|
|
1289
|
+
return g && (P = P.map(g)), me(P);
|
|
1290
|
+
},
|
|
1291
|
+
target: i
|
|
1292
|
+
}), f({
|
|
1293
|
+
clock: k.doneData,
|
|
1294
|
+
fn: () => !0,
|
|
1295
|
+
target: l
|
|
1296
|
+
});
|
|
1297
|
+
const $ = Y(), se = Y();
|
|
1298
|
+
f({
|
|
1299
|
+
clock: $,
|
|
1300
|
+
filter: () => !e.endpoint,
|
|
1301
|
+
fn: (u) => u.endpoint || "",
|
|
1302
|
+
target: s
|
|
1303
|
+
}), f({
|
|
1304
|
+
clock: $,
|
|
1305
|
+
filter: () => !e.structure,
|
|
1306
|
+
fn: (u) => u.structure || [],
|
|
1307
|
+
target: c
|
|
1308
|
+
}), f({
|
|
1309
|
+
clock: $,
|
|
1310
|
+
filter: () => !e.filters,
|
|
1311
|
+
fn: (u) => u.filters || [],
|
|
1312
|
+
target: d
|
|
1313
|
+
}), f({
|
|
1314
|
+
clock: $,
|
|
1315
|
+
filter: () => !e.search,
|
|
1316
|
+
fn: (u) => u.search || [],
|
|
1317
|
+
target: o
|
|
1318
|
+
}), f({
|
|
1319
|
+
clock: $,
|
|
1320
|
+
fn: (u) => {
|
|
1321
|
+
let g = e.filters || u.filters;
|
|
1322
|
+
const _ = t.get("filter64");
|
|
1323
|
+
if (_ && g) {
|
|
1324
|
+
const P = JSON.parse(_);
|
|
1325
|
+
g = g.map((J) => {
|
|
1326
|
+
const ce = P[String(J.code)];
|
|
1327
|
+
return ce ? {
|
|
1328
|
+
...J,
|
|
1329
|
+
value: ce.value,
|
|
1330
|
+
displayValue: ce.displayValue
|
|
1331
|
+
} : J;
|
|
1332
|
+
});
|
|
1333
|
+
}
|
|
1334
|
+
return g ? Yn(g) : [];
|
|
1335
|
+
},
|
|
1336
|
+
target: n
|
|
1337
|
+
}), f({
|
|
1338
|
+
clock: $,
|
|
1339
|
+
fn: () => {
|
|
1340
|
+
const u = t.get("filter64_or");
|
|
1341
|
+
return u && Object.values(JSON.parse(u))[0].value || "";
|
|
1342
|
+
},
|
|
1343
|
+
target: h
|
|
1344
|
+
}), f({
|
|
1345
|
+
clock: $,
|
|
1346
|
+
fn: (u) => {
|
|
1347
|
+
const g = e.items || u.items;
|
|
1348
|
+
return g ? me(g) : [];
|
|
1349
|
+
},
|
|
1350
|
+
target: i
|
|
1351
|
+
}), f({
|
|
1352
|
+
source: n,
|
|
1353
|
+
clock: se,
|
|
1354
|
+
fn: (u, g) => g.applyFilters ? Ee(g.items, u) : g.items,
|
|
1355
|
+
target: i
|
|
1356
|
+
}), f({
|
|
1357
|
+
clock: se,
|
|
1358
|
+
fn: (u) => u.items.length,
|
|
1359
|
+
target: p
|
|
1360
|
+
}), f({
|
|
1361
|
+
clock: $,
|
|
1362
|
+
fn: (u) => u.items?.length || 0,
|
|
1363
|
+
target: p
|
|
1364
|
+
}), f({
|
|
1365
|
+
clock: $,
|
|
1366
|
+
fn: (u) => !!u.enableRowClick,
|
|
1367
|
+
target: I
|
|
1368
|
+
}), f({
|
|
1369
|
+
clock: $,
|
|
1370
|
+
fn: (u) => !!u.displayIndex,
|
|
1371
|
+
target: A
|
|
1372
|
+
}), f({
|
|
1373
|
+
clock: $,
|
|
1374
|
+
fn: (u) => !!u.displayActionCol,
|
|
1375
|
+
target: O
|
|
1376
|
+
}), f({
|
|
1377
|
+
clock: $,
|
|
1378
|
+
fn: (u) => u.tableActions || [],
|
|
1379
|
+
target: E
|
|
1380
|
+
}), f({
|
|
1381
|
+
clock: $,
|
|
1382
|
+
fn: (u) => u.contextActions || [],
|
|
1383
|
+
target: H
|
|
1384
|
+
}), f({
|
|
1385
|
+
clock: $,
|
|
1386
|
+
fn: (u) => u.rowActions || [],
|
|
1387
|
+
target: L
|
|
1388
|
+
}), f({
|
|
1389
|
+
clock: $,
|
|
1390
|
+
filter: (u) => !!u.order && !e.order,
|
|
1391
|
+
fn: (u) => u.order,
|
|
1392
|
+
target: M
|
|
1393
|
+
}), f({
|
|
1394
|
+
clock: $,
|
|
1395
|
+
filter: (u) => !!u.sort && !e.sort,
|
|
1396
|
+
fn: (u) => u.sort,
|
|
1397
|
+
target: v
|
|
1398
|
+
}), f({
|
|
1399
|
+
clock: $,
|
|
1400
|
+
fn: () => !0,
|
|
1401
|
+
target: a
|
|
1402
|
+
}), f({
|
|
1403
|
+
source: oe(N, i, M),
|
|
1404
|
+
clock: W,
|
|
1405
|
+
filter: ([u]) => u,
|
|
1406
|
+
fn: ([u, g, _], P) => ({ items: [...g].sort(Vn(P, _)) }),
|
|
1407
|
+
target: se
|
|
1408
|
+
});
|
|
1409
|
+
const be = Y(), ve = Y();
|
|
1410
|
+
f({
|
|
1411
|
+
clock: be,
|
|
1412
|
+
target: y
|
|
1413
|
+
}), f({
|
|
1414
|
+
clock: ve,
|
|
1415
|
+
target: C
|
|
1416
|
+
}), [ve, be, U, te, W, j].forEach((u) => {
|
|
1417
|
+
f({
|
|
1418
|
+
clock: u,
|
|
1419
|
+
filter: (g) => !g.local,
|
|
1420
|
+
source: ee,
|
|
1421
|
+
target: k
|
|
1422
|
+
});
|
|
1423
|
+
});
|
|
1424
|
+
const _e = Y();
|
|
1425
|
+
f({
|
|
1426
|
+
source: i,
|
|
1427
|
+
clock: _e,
|
|
1428
|
+
fn: (u, g) => u.filter((_) => _.dt_id !== g && _.id !== g),
|
|
1429
|
+
target: i
|
|
1430
|
+
}), f({
|
|
1431
|
+
source: p,
|
|
1432
|
+
clock: _e,
|
|
1433
|
+
fn: (u) => u - 1,
|
|
1434
|
+
target: p
|
|
1435
|
+
});
|
|
1436
|
+
const xe = Y();
|
|
1437
|
+
f({
|
|
1438
|
+
source: i,
|
|
1439
|
+
clock: xe,
|
|
1440
|
+
fn: (u, g) => u.map((_) => _.dt_id === g.dt_id ? { ..._, ...g } : _),
|
|
1441
|
+
target: i
|
|
1442
|
+
});
|
|
1443
|
+
const Ce = Y();
|
|
1444
|
+
return f({
|
|
1445
|
+
source: i,
|
|
1446
|
+
clock: Ce,
|
|
1447
|
+
fn: (u, g) => u.concat(me([g])),
|
|
1448
|
+
target: i
|
|
1449
|
+
}), f({
|
|
1450
|
+
source: p,
|
|
1451
|
+
clock: Ce,
|
|
1452
|
+
fn: (u) => u + 1,
|
|
1453
|
+
target: p
|
|
1454
|
+
}), {
|
|
1455
|
+
$endpoint: s,
|
|
1456
|
+
$isReady: a,
|
|
1457
|
+
dataTableInitialized: $,
|
|
1458
|
+
itemsSet: se,
|
|
1459
|
+
dataFetched: he,
|
|
1460
|
+
$tableActions: E,
|
|
1461
|
+
$items: i,
|
|
1462
|
+
$structure: c,
|
|
1463
|
+
$search: o,
|
|
1464
|
+
$searchQuery: h,
|
|
1465
|
+
$filters: d,
|
|
1466
|
+
$currentFilter: n,
|
|
1467
|
+
$isFetching: b,
|
|
1468
|
+
$sort: v,
|
|
1469
|
+
$order: M,
|
|
1470
|
+
$displayActionCol: O,
|
|
1471
|
+
$displayIndex: A,
|
|
1472
|
+
$local: N,
|
|
1473
|
+
$pageSize: y,
|
|
1474
|
+
$page: C,
|
|
1475
|
+
$count: p,
|
|
1476
|
+
$requested: l,
|
|
1477
|
+
$rowActions: L,
|
|
1478
|
+
$contextActions: H,
|
|
1479
|
+
searchQuerySet: j,
|
|
1480
|
+
currentFilterDeleted: te,
|
|
1481
|
+
currentFilterSet: U,
|
|
1482
|
+
rowsSelected: R,
|
|
1483
|
+
sortSet: W,
|
|
1484
|
+
pageSizeSet: be,
|
|
1485
|
+
pageSet: ve,
|
|
1486
|
+
itemDeleted: _e,
|
|
1487
|
+
itemAdded: Ce,
|
|
1488
|
+
itemUpdated: xe,
|
|
1489
|
+
fetchDataFx: k
|
|
1490
|
+
};
|
|
1491
|
+
});
|
|
1492
|
+
export {
|
|
1493
|
+
ur as D,
|
|
1494
|
+
Tn as F,
|
|
1495
|
+
yn as S,
|
|
1496
|
+
Tt as T,
|
|
1497
|
+
dr as a,
|
|
1498
|
+
We as b,
|
|
1499
|
+
_n as c,
|
|
1500
|
+
hr as d,
|
|
1501
|
+
Qe as e,
|
|
1502
|
+
Je as m,
|
|
1503
|
+
Vn as s,
|
|
1504
|
+
en as u
|
|
1505
|
+
};
|