@ryuzaki13/react-foundation-ui 1.5.10 → 1.5.11
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/advanced-search/index.js +182 -148
- package/dist/advanced-search/index.js.map +1 -1
- package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts +1 -1
- package/dist/advanced-search/model/useAdvancedSearchSelection.d.ts.map +1 -1
- package/dist/advanced-search/ui/AdvancedSearchModal.d.ts +12 -3
- package/dist/advanced-search/ui/AdvancedSearchModal.d.ts.map +1 -1
- package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts +15 -0
- package/dist/advanced-search/ui/AdvancedSearchModalSession.d.ts.map +1 -0
- package/dist/advanced-search/ui/AdvancedSearchSelect.d.ts.map +1 -1
- package/dist/badge/index.js +1 -1
- package/dist/base-table/index.js +1 -1
- package/dist/button/index.js +1 -1
- package/dist/check-box/index.js +1 -1
- package/dist/chunks/{CalendarView-BSshXZAX.js → CalendarView-DqA-PbAU.js} +42 -42
- package/dist/chunks/{CalendarView-BSshXZAX.js.map → CalendarView-DqA-PbAU.js.map} +1 -1
- package/dist/chunks/{ImageViewerRuntime-BMs3BBkV.js → ImageViewerRuntime-HGBWp9NM.js} +18 -18
- package/dist/chunks/{ImageViewerRuntime-BMs3BBkV.js.map → ImageViewerRuntime-HGBWp9NM.js.map} +1 -1
- package/dist/chunks/{TextEditorLexicalClient-CLjpATRu.js → TextEditorLexicalClient-B084kVzu.js} +322 -322
- package/dist/chunks/{TextEditorLexicalClient-CLjpATRu.js.map → TextEditorLexicalClient-B084kVzu.js.map} +1 -1
- package/dist/chunks/{badge-CaooZXYD.js → badge-DMM8cOHd.js} +16 -16
- package/dist/chunks/{badge-CaooZXYD.js.map → badge-DMM8cOHd.js.map} +1 -1
- package/dist/chunks/{base-table-fUJY__6M.js → base-table-CJdKCKhb.js} +125 -125
- package/dist/chunks/{base-table-fUJY__6M.js.map → base-table-CJdKCKhb.js.map} +1 -1
- package/dist/chunks/{button-C--u7uJj.js → button-CzUO5rzq.js} +17 -17
- package/dist/chunks/{button-C--u7uJj.js.map → button-CzUO5rzq.js.map} +1 -1
- package/dist/chunks/{check-box-BZiEBR9c.js → check-box-sfGjYczQ.js} +11 -11
- package/dist/chunks/{check-box-BZiEBR9c.js.map → check-box-sfGjYczQ.js.map} +1 -1
- package/dist/chunks/{context-menu-XZ-e0f6_.js → context-menu-6nJkPmKV.js} +83 -83
- package/dist/chunks/{context-menu-XZ-e0f6_.js.map → context-menu-6nJkPmKV.js.map} +1 -1
- package/dist/chunks/date-input-9T8AoG5U.js +341 -0
- package/dist/chunks/{date-input-Dr5QNVT6.js.map → date-input-9T8AoG5U.js.map} +1 -1
- package/dist/chunks/{input-BNszawm6.js → input-VC8jEoTa.js} +37 -37
- package/dist/chunks/{input-BNszawm6.js.map → input-VC8jEoTa.js.map} +1 -1
- package/dist/chunks/{input-files-DxLVr2PF.js → input-files-CoMjadk7.js} +22 -22
- package/dist/chunks/{input-files-DxLVr2PF.js.map → input-files-CoMjadk7.js.map} +1 -1
- package/dist/chunks/{input-search-C2OOhZlw.js → input-search-Bs_9SxT0.js} +2 -2
- package/dist/chunks/{input-search-C2OOhZlw.js.map → input-search-Bs_9SxT0.js.map} +1 -1
- package/dist/chunks/{misc-Cp_r022Z.js → misc-CkRRma5E.js} +55 -55
- package/dist/chunks/{misc-Cp_r022Z.js.map → misc-CkRRma5E.js.map} +1 -1
- package/dist/chunks/{modal-DK9M7lT5.js → modal-LHkNxBko.js} +38 -38
- package/dist/chunks/{modal-DK9M7lT5.js.map → modal-LHkNxBko.js.map} +1 -1
- package/dist/chunks/{multi-select-CFHaQPot.js → multi-select-BJ6Lst1E.js} +44 -44
- package/dist/chunks/{multi-select-CFHaQPot.js.map → multi-select-BJ6Lst1E.js.map} +1 -1
- package/dist/chunks/{picker-D3Fc15JH.js → picker-DLnfOgZj.js} +34 -34
- package/dist/chunks/{picker-D3Fc15JH.js.map → picker-DLnfOgZj.js.map} +1 -1
- package/dist/chunks/{popover-BTT7zSqx.js → popover-IExDrsF6.js} +67 -67
- package/dist/chunks/{popover-BTT7zSqx.js.map → popover-IExDrsF6.js.map} +1 -1
- package/dist/chunks/{select-BolFlcoY.js → select-CysiIrej.js} +5 -5
- package/dist/chunks/{select-BolFlcoY.js.map → select-CysiIrej.js.map} +1 -1
- package/dist/chunks/{sortable-DcTIAbjD.js → sortable-BKIwlqhI.js} +17 -17
- package/dist/chunks/{sortable-DcTIAbjD.js.map → sortable-BKIwlqhI.js.map} +1 -1
- package/dist/chunks/{table-BChs6bgR.js → table-CIWdAcPY.js} +2 -2
- package/dist/chunks/{table-BChs6bgR.js.map → table-CIWdAcPY.js.map} +1 -1
- package/dist/chunks/{types-CxXyru6U.js → types-D9Wj9wrg.js} +21 -21
- package/dist/chunks/{types-CxXyru6U.js.map → types-D9Wj9wrg.js.map} +1 -1
- package/dist/chunks/{useODataSelectBase-BhCMCzv_.js → useODataSelectBase-Bq36Wp1U.js} +8 -8
- package/dist/chunks/{useODataSelectBase-BhCMCzv_.js.map → useODataSelectBase-Bq36Wp1U.js.map} +1 -1
- package/dist/context-menu/index.js +1 -1
- package/dist/date-input/index.js +2 -2
- package/dist/date-time-input/index.js +32 -32
- package/dist/dialog/index.js +9 -9
- package/dist/disclosure/index.js +10 -10
- package/dist/drop-zone/index.js +8 -8
- package/dist/errors/index.js +8 -8
- package/dist/expandable-action-panel/index.js +16 -16
- package/dist/flex/useFlexClasses.d.ts +1 -1
- package/dist/fullscreen-portal/index.js +7 -7
- package/dist/image/index.js +27 -27
- package/dist/input/index.js +1 -1
- package/dist/input-date-time/index.js +1 -1
- package/dist/input-file/index.js +1 -1
- package/dist/input-files/index.js +1 -1
- package/dist/input-image/index.js +1 -1
- package/dist/input-search/index.js +1 -1
- package/dist/layout-picker/index.js +1 -1
- package/dist/list/index.js +25 -25
- package/dist/listbox/index.js +5 -5
- package/dist/misc/index.js +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/multi-select/index.js +1 -1
- package/dist/notifications/index.js +30 -30
- package/dist/picker/index.js +1 -1
- package/dist/popover/index.js +1 -1
- package/dist/preset-range-date-input/index.js +1 -1
- package/dist/preset-select/index.js +1 -1
- package/dist/radio-button/index.js +10 -10
- package/dist/select/index.js +1 -1
- package/dist/simple-table/index.js +1 -1
- package/dist/slider/index.js +3 -3
- package/dist/sortable/index.js +1 -1
- package/dist/state-select/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/switch/index.js +11 -11
- package/dist/table/index.js +1 -1
- package/dist/table-sorting/index.js +13 -13
- package/dist/tabs/index.js +1 -1
- package/dist/tag-input/index.js +55 -55
- package/dist/tag-input/index.js.map +1 -1
- package/dist/text/index.js +1 -1
- package/dist/text-editor/index.js +3 -3
- package/dist/textarea/index.js +1 -1
- package/dist/tree-select/index.js +134 -134
- package/dist/tree-select/index.js.map +1 -1
- package/dist/tree-table/index.js +16 -16
- package/package.json +1 -1
- package/storybook-static/project.json +1 -1
- package/dist/chunks/date-input-Dr5QNVT6.js +0 -341
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { t as e } from "../chunks/ui.module-DHVTOqZ0.js";
|
|
2
|
-
import { n as t
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { r as
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { n as
|
|
11
|
-
import { t as
|
|
12
|
-
import { useCallback as
|
|
13
|
-
import { odataQueryFn as
|
|
14
|
-
import { createFilterContains as
|
|
15
|
-
import { useInfiniteQuery as
|
|
16
|
-
import { cn as
|
|
17
|
-
import { ChevronRightIcon as O, XIcon as k } from "lucide-react";
|
|
2
|
+
import { n as t } from "../chunks/button-CzUO5rzq.js";
|
|
3
|
+
import { c as n, g as r, h as i } from "../chunks/misc-CkRRma5E.js";
|
|
4
|
+
import { o as a } from "../chunks/flex-C7njxZ74.js";
|
|
5
|
+
import { r as o } from "../chunks/grid-dI94AAbi.js";
|
|
6
|
+
import { a as s, i as c, n as l, r as u } from "../chunks/modal-LHkNxBko.js";
|
|
7
|
+
import { n as d, t as f } from "../chunks/badge-DMM8cOHd.js";
|
|
8
|
+
import { l as p, u as m } from "../chunks/input-VC8jEoTa.js";
|
|
9
|
+
import { t as h } from "../chunks/input-search-Bs_9SxT0.js";
|
|
10
|
+
import { n as g } from "../chunks/multi-select-BJ6Lst1E.js";
|
|
11
|
+
import { t as _ } from "../chunks/table-CIWdAcPY.js";
|
|
12
|
+
import { useCallback as v, useMemo as y, useState as b } from "react";
|
|
13
|
+
import { odataQueryFn as x, useODataTableColumns as S } from "@ryuzaki13/react-foundation-api/odata";
|
|
14
|
+
import { createFilterContains as C, createFilterEqual as w, unwrapODataQueryResult as T } from "@ryuzaki13/react-foundation-lib/odata-service";
|
|
15
|
+
import { useInfiniteQuery as E, useQuery as D } from "@tanstack/react-query";
|
|
16
|
+
import { cn as O, stableStringify as k } from "@ryuzaki13/react-foundation-lib/utils";
|
|
18
17
|
import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
|
|
18
|
+
import { ChevronRightIcon as N, XIcon as P } from "lucide-react";
|
|
19
19
|
//#region src/advanced-search/lib/searchParts.ts
|
|
20
|
-
function
|
|
20
|
+
function F(e) {
|
|
21
21
|
let t = e.trim();
|
|
22
22
|
return t ? t.split("*").map((e) => e.trim()).filter((e) => e.length) : [];
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function I(e, t, n) {
|
|
25
25
|
let r = t.map((e) => e.toLowerCase());
|
|
26
26
|
return e.filter((e) => {
|
|
27
27
|
for (let t of n) {
|
|
@@ -41,9 +41,9 @@ function P(e, t, n) {
|
|
|
41
41
|
}
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/advanced-search/model/useAdvancedSearch.ts
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
let [t, n] =
|
|
44
|
+
var L = 50;
|
|
45
|
+
function R(e) {
|
|
46
|
+
let [t, n] = b(""), [r, i] = b(() => Object.keys(e.segments ?? {}).reduce((e, t) => (e[t] = [], e), {})), a = F(t), o = a.length > 1, s = o ? 5e3 : L, c = E({
|
|
47
47
|
queryKey: [
|
|
48
48
|
"search",
|
|
49
49
|
e.odata.service,
|
|
@@ -52,7 +52,7 @@ function I(e) {
|
|
|
52
52
|
t
|
|
53
53
|
],
|
|
54
54
|
queryFn: async ({ pageParam: t = 0, signal: n, client: i }) => {
|
|
55
|
-
let c = e.columns.map((e) => e.key), l = await
|
|
55
|
+
let c = e.columns.map((e) => e.key), l = await x({
|
|
56
56
|
odata: {
|
|
57
57
|
service: e.odata.service,
|
|
58
58
|
target: e.odata.target
|
|
@@ -63,9 +63,9 @@ function I(e) {
|
|
|
63
63
|
select: c,
|
|
64
64
|
expression: {
|
|
65
65
|
and: !0,
|
|
66
|
-
filters: [{ filters: a ? e.searchKeys.map((e) => ({ filters: a.map((t) =>
|
|
66
|
+
filters: [{ filters: a ? e.searchKeys.map((e) => ({ filters: a.map((t) => C(e, t)) })) : [] }, {
|
|
67
67
|
and: !0,
|
|
68
|
-
filters: Object.keys(r).map((e) =>
|
|
68
|
+
filters: Object.keys(r).map((e) => w(e, r[e]))
|
|
69
69
|
}]
|
|
70
70
|
},
|
|
71
71
|
sorts: [{ key: e.leadingKey }]
|
|
@@ -74,20 +74,20 @@ function I(e) {
|
|
|
74
74
|
signal: n,
|
|
75
75
|
client: i
|
|
76
76
|
});
|
|
77
|
-
return o ?
|
|
77
|
+
return o ? I(l.data, a, e.searchKeys) : l.data;
|
|
78
78
|
},
|
|
79
79
|
getNextPageParam: (e, t) => {
|
|
80
80
|
if (!(e.length < s)) return t.length * s;
|
|
81
81
|
},
|
|
82
82
|
initialPageParam: 0
|
|
83
|
-
}), l =
|
|
83
|
+
}), l = v((e) => {
|
|
84
84
|
n(e);
|
|
85
|
-
}, []), u =
|
|
85
|
+
}, []), u = v(() => {
|
|
86
86
|
n("");
|
|
87
87
|
}, []);
|
|
88
88
|
return {
|
|
89
89
|
query: c,
|
|
90
|
-
items:
|
|
90
|
+
items: y(() => c.data?.pages.flatMap((e) => e) ?? [], [c.data?.pages]),
|
|
91
91
|
searchTerm: t,
|
|
92
92
|
setSearch: l,
|
|
93
93
|
clearSearch: u,
|
|
@@ -97,8 +97,8 @@ function I(e) {
|
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
99
99
|
//#region src/advanced-search/model/useAdvancedSearchInitialSelected.ts
|
|
100
|
-
function
|
|
101
|
-
let n =
|
|
100
|
+
function z(e, t = []) {
|
|
101
|
+
let n = D({
|
|
102
102
|
queryKey: [
|
|
103
103
|
"searchSelected",
|
|
104
104
|
e.odata.service,
|
|
@@ -111,14 +111,14 @@ function L(e, t = []) {
|
|
|
111
111
|
totalCount: void 0
|
|
112
112
|
};
|
|
113
113
|
let i = e.columns.map((e) => e.key);
|
|
114
|
-
return await
|
|
114
|
+
return await x({
|
|
115
115
|
odata: {
|
|
116
116
|
service: e.odata.service,
|
|
117
117
|
target: e.odata.target
|
|
118
118
|
},
|
|
119
119
|
options: {
|
|
120
120
|
select: i,
|
|
121
|
-
expression: { filters: t.map((t) =>
|
|
121
|
+
expression: { filters: t.map((t) => w(e.leadingKey, t)) }
|
|
122
122
|
}
|
|
123
123
|
})({
|
|
124
124
|
client: n,
|
|
@@ -127,171 +127,201 @@ function L(e, t = []) {
|
|
|
127
127
|
},
|
|
128
128
|
enabled: t.length > 0
|
|
129
129
|
});
|
|
130
|
-
return
|
|
130
|
+
return T(n);
|
|
131
131
|
}
|
|
132
132
|
//#endregion
|
|
133
133
|
//#region src/advanced-search/model/useAdvancedSearchSelection.ts
|
|
134
|
-
function
|
|
135
|
-
let
|
|
134
|
+
function B(e, t) {
|
|
135
|
+
let n = /* @__PURE__ */ new Map();
|
|
136
|
+
for (let r of e) n.set(String(r[t]), r);
|
|
137
|
+
return Array.from(n.values());
|
|
138
|
+
}
|
|
139
|
+
function V(e, t = []) {
|
|
140
|
+
let [n, r] = b(() => B(t, e.leadingKey)), i = v((t, n) => {
|
|
136
141
|
if (t.length !== n.length) return !1;
|
|
137
142
|
let r = new Set(n.map((t) => String(t[e.leadingKey])));
|
|
138
143
|
return t.every((t) => r.has(String(t[e.leadingKey])));
|
|
139
|
-
}, [e.leadingKey]),
|
|
140
|
-
|
|
141
|
-
let
|
|
142
|
-
|
|
143
|
-
let a = Array.from(i.values());
|
|
144
|
-
return r(n, a) ? n : a;
|
|
144
|
+
}, [e.leadingKey]), a = v((t) => {
|
|
145
|
+
r((n) => {
|
|
146
|
+
let r = B(t, e.leadingKey);
|
|
147
|
+
return i(n, r) ? n : r;
|
|
145
148
|
});
|
|
146
|
-
}, [
|
|
149
|
+
}, [i, e.leadingKey]);
|
|
147
150
|
return {
|
|
148
|
-
selectedItems:
|
|
149
|
-
select:
|
|
150
|
-
|
|
151
|
+
selectedItems: n,
|
|
152
|
+
select: v((t) => {
|
|
153
|
+
r((n) => n.some((n) => n[e.leadingKey] === t[e.leadingKey]) ? n : [...n, t]);
|
|
151
154
|
}, [e.leadingKey]),
|
|
152
|
-
deselect:
|
|
153
|
-
|
|
155
|
+
deselect: v((t) => {
|
|
156
|
+
r((n) => n.filter((n) => n[e.leadingKey] !== t));
|
|
154
157
|
}, [e.leadingKey]),
|
|
155
|
-
replaceSelection:
|
|
156
|
-
clearSelection:
|
|
157
|
-
|
|
158
|
+
replaceSelection: a,
|
|
159
|
+
clearSelection: v(() => {
|
|
160
|
+
r([]);
|
|
158
161
|
}, []),
|
|
159
|
-
isSelected:
|
|
162
|
+
isSelected: v((t) => n.some((n) => n[e.leadingKey] === t), [e.leadingKey, n])
|
|
160
163
|
};
|
|
161
164
|
}
|
|
162
165
|
//#endregion
|
|
163
|
-
//#region src/advanced-search/ui/
|
|
164
|
-
function
|
|
165
|
-
let
|
|
166
|
+
//#region src/advanced-search/ui/AdvancedSearchModalSession.tsx
|
|
167
|
+
function H({ onClose: e, onItemsSelect: r, config: i, initialSelectedItems: p }) {
|
|
168
|
+
let m = y(() => i.columns.map((e) => ({
|
|
166
169
|
id: e.key,
|
|
167
170
|
accessorKey: e.key,
|
|
168
171
|
header: e.label,
|
|
169
172
|
meta: { width: e.width || "auto" }
|
|
170
|
-
})), [
|
|
171
|
-
service:
|
|
172
|
-
target:
|
|
173
|
+
})), [i.columns]), { columns: b, isLoading: x } = S({
|
|
174
|
+
service: i.odata.service,
|
|
175
|
+
target: i.odata.target,
|
|
173
176
|
mode: "enrich",
|
|
174
|
-
columns:
|
|
175
|
-
}), { query:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
w.hasNextPage && !w.isFetchingNextPage && w.fetchNextPage();
|
|
181
|
-
}, [w]), H = g((e) => {
|
|
182
|
-
let t = new Set(e.map((e) => String(e[s.leadingKey]))), n = N.filter((e) => !B.has(String(e[s.leadingKey]))), r = T.filter((e) => t.has(String(e[s.leadingKey])));
|
|
183
|
-
F([...n, ...r]);
|
|
177
|
+
columns: m
|
|
178
|
+
}), { query: C, items: w, searchTerm: T, setSearch: E, clearSearch: D, filters: O, setFilters: k } = R(i), { selectedItems: A, deselect: N, replaceSelection: P } = V(i, p), F = v((e) => String(e[i.leadingKey]), [i.leadingKey]), I = y(() => A.map((e) => String(e[i.leadingKey])), [A, i.leadingKey]), L = y(() => new Set(w.map((e) => String(e[i.leadingKey]))), [w, i.leadingKey]), z = v(() => {
|
|
179
|
+
C.hasNextPage && !C.isFetchingNextPage && C.fetchNextPage();
|
|
180
|
+
}, [C]), B = v((e) => {
|
|
181
|
+
let t = new Set(e.map((e) => String(e[i.leadingKey]))), n = A.filter((e) => !L.has(String(e[i.leadingKey]))), r = w.filter((e) => t.has(String(e[i.leadingKey])));
|
|
182
|
+
P([...n, ...r]);
|
|
184
183
|
}, [
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
]),
|
|
191
|
-
|
|
192
|
-
}, [
|
|
193
|
-
|
|
184
|
+
i.leadingKey,
|
|
185
|
+
w,
|
|
186
|
+
P,
|
|
187
|
+
A,
|
|
188
|
+
L
|
|
189
|
+
]), H = v((e) => {
|
|
190
|
+
N(String(e[i.leadingKey]));
|
|
191
|
+
}, [i.leadingKey, N]), U = v(() => {
|
|
192
|
+
r(A), e();
|
|
194
193
|
}, [
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
A,
|
|
195
|
+
r,
|
|
197
196
|
e
|
|
198
|
-
]),
|
|
199
|
-
if ("segments" in
|
|
200
|
-
let e = Object.keys(
|
|
197
|
+
]), W = y(() => {
|
|
198
|
+
if ("segments" in i && i.segments) {
|
|
199
|
+
let e = Object.keys(i.segments);
|
|
201
200
|
if (e.length) return {
|
|
202
201
|
odata: {
|
|
203
|
-
...
|
|
202
|
+
...i.odata,
|
|
204
203
|
limitedKeys: e
|
|
205
204
|
},
|
|
206
|
-
segments:
|
|
207
|
-
model:
|
|
205
|
+
segments: i.segments,
|
|
206
|
+
model: i.model
|
|
208
207
|
};
|
|
209
208
|
}
|
|
210
|
-
}, [
|
|
211
|
-
return /* @__PURE__ */ M(
|
|
209
|
+
}, [i]);
|
|
210
|
+
return /* @__PURE__ */ M(l, {
|
|
212
211
|
isOpen: !0,
|
|
213
212
|
onClose: e,
|
|
214
|
-
title:
|
|
213
|
+
title: i.title,
|
|
215
214
|
size: "lg",
|
|
216
215
|
height: "min(50em, 80dvh)",
|
|
217
216
|
children: [
|
|
218
|
-
/* @__PURE__ */ j(
|
|
217
|
+
/* @__PURE__ */ j(s, { children: /* @__PURE__ */ M(a, {
|
|
219
218
|
gap: "sm",
|
|
220
|
-
children: [
|
|
221
|
-
odata:
|
|
222
|
-
segments:
|
|
223
|
-
model:
|
|
224
|
-
values:
|
|
225
|
-
onChange:
|
|
226
|
-
}), /* @__PURE__ */ j(
|
|
219
|
+
children: [W && /* @__PURE__ */ j(g, {
|
|
220
|
+
odata: W.odata,
|
|
221
|
+
segments: W.segments,
|
|
222
|
+
model: W.model,
|
|
223
|
+
values: O,
|
|
224
|
+
onChange: k
|
|
225
|
+
}), /* @__PURE__ */ j(h, {
|
|
227
226
|
size: "md",
|
|
228
|
-
placeholder:
|
|
229
|
-
value:
|
|
230
|
-
onChange:
|
|
231
|
-
onClear:
|
|
227
|
+
placeholder: i.searchLabel ?? "Введите поисковый запрос",
|
|
228
|
+
value: T,
|
|
229
|
+
onChange: E,
|
|
230
|
+
onClear: D,
|
|
232
231
|
className: "flexGrow"
|
|
233
232
|
})]
|
|
234
233
|
}) }),
|
|
235
|
-
/* @__PURE__ */ j(
|
|
234
|
+
/* @__PURE__ */ j(u, { children: /* @__PURE__ */ M(o, {
|
|
236
235
|
gap: "md",
|
|
237
236
|
templateRows: "1fr auto",
|
|
238
237
|
className: "h100",
|
|
239
|
-
children: [/* @__PURE__ */ j(
|
|
240
|
-
columns:
|
|
241
|
-
data:
|
|
238
|
+
children: [/* @__PURE__ */ j(_, {
|
|
239
|
+
columns: b,
|
|
240
|
+
data: w,
|
|
242
241
|
selectionMode: "multi",
|
|
243
|
-
selectedRowIds:
|
|
244
|
-
getRowId:
|
|
245
|
-
isLoading:
|
|
246
|
-
isFetching:
|
|
247
|
-
onRowSelectionChange:
|
|
248
|
-
onReachEnd:
|
|
242
|
+
selectedRowIds: I,
|
|
243
|
+
getRowId: F,
|
|
244
|
+
isLoading: C.isLoading || x,
|
|
245
|
+
isFetching: C.isFetching,
|
|
246
|
+
onRowSelectionChange: B,
|
|
247
|
+
onReachEnd: z,
|
|
249
248
|
className: "w100"
|
|
250
249
|
}), /* @__PURE__ */ j("div", {
|
|
251
250
|
className: "marginBlockMd border",
|
|
252
|
-
children: /* @__PURE__ */ j(
|
|
251
|
+
children: /* @__PURE__ */ j(n, {
|
|
253
252
|
className: "paddingSm",
|
|
254
253
|
height: "6em",
|
|
255
|
-
children: /* @__PURE__ */ j(
|
|
254
|
+
children: /* @__PURE__ */ j(f, { children: A.map((e) => /* @__PURE__ */ j(d, {
|
|
256
255
|
size: "md",
|
|
257
256
|
tone: "info",
|
|
258
257
|
appearance: "outline",
|
|
259
|
-
onRemove: () =>
|
|
260
|
-
children:
|
|
261
|
-
}, e[
|
|
258
|
+
onRemove: () => H(e),
|
|
259
|
+
children: i.leadingText && e[i.leadingText] || e[i.leadingKey]
|
|
260
|
+
}, e[i.leadingKey])) })
|
|
262
261
|
})
|
|
263
262
|
})]
|
|
264
263
|
}) }),
|
|
265
|
-
/* @__PURE__ */ M(
|
|
264
|
+
/* @__PURE__ */ M(c, { children: [/* @__PURE__ */ j(t, {
|
|
266
265
|
onClick: e,
|
|
267
266
|
children: "Отмена"
|
|
268
|
-
}), /* @__PURE__ */ j(
|
|
267
|
+
}), /* @__PURE__ */ j(t, {
|
|
269
268
|
variant: "successOutline",
|
|
270
|
-
onClick:
|
|
269
|
+
onClick: U,
|
|
271
270
|
children: "Выбрать"
|
|
272
271
|
})] })
|
|
273
272
|
]
|
|
274
273
|
});
|
|
275
274
|
}
|
|
276
275
|
//#endregion
|
|
276
|
+
//#region src/advanced-search/ui/AdvancedSearchModal.tsx
|
|
277
|
+
function U(e, t) {
|
|
278
|
+
return k({
|
|
279
|
+
leadingKey: String(e.leadingKey),
|
|
280
|
+
service: e.odata.service,
|
|
281
|
+
target: e.odata.target,
|
|
282
|
+
selectedIds: t.map((t) => String(t[e.leadingKey])).sort()
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
function W({ onClose: e, onItemsSelect: n, initialSelection: a, config: o }) {
|
|
286
|
+
return a.status === "ready" ? /* @__PURE__ */ j(H, {
|
|
287
|
+
config: o,
|
|
288
|
+
onClose: e,
|
|
289
|
+
onItemsSelect: n,
|
|
290
|
+
initialSelectedItems: a.items
|
|
291
|
+
}, U(o, a.items)) : /* @__PURE__ */ M(l, {
|
|
292
|
+
isOpen: !0,
|
|
293
|
+
onClose: e,
|
|
294
|
+
title: o.title,
|
|
295
|
+
size: "lg",
|
|
296
|
+
height: "min(50em, 80dvh)",
|
|
297
|
+
children: [/* @__PURE__ */ j(u, { children: a.status === "loading" ? /* @__PURE__ */ j(i, { text: "Загружаем выбранные элементы..." }) : /* @__PURE__ */ j(r, {
|
|
298
|
+
color: "error",
|
|
299
|
+
children: "Не удалось загрузить выбранные элементы"
|
|
300
|
+
}) }), /* @__PURE__ */ j(c, { children: /* @__PURE__ */ j(t, {
|
|
301
|
+
onClick: e,
|
|
302
|
+
children: "Закрыть"
|
|
303
|
+
}) })]
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
//#endregion
|
|
277
307
|
//#region src/advanced-search/ui/AdvancedSearchSelectUI.tsx
|
|
278
|
-
var
|
|
279
|
-
let { controlId:
|
|
308
|
+
var G = ({ label: t, description: n, disabled: r, size: i, placeholder: o = "Выбрать", token: s, onOpen: c, onClear: l }) => {
|
|
309
|
+
let { controlId: u, labelId: d, descriptionId: f } = p({
|
|
280
310
|
hasLabel: t != null,
|
|
281
311
|
hasDescription: !!n
|
|
282
|
-
}), h = !!
|
|
312
|
+
}), h = !!s;
|
|
283
313
|
return /* @__PURE__ */ M("div", {
|
|
284
|
-
"aria-disabled":
|
|
285
|
-
className:
|
|
314
|
+
"aria-disabled": r || void 0,
|
|
315
|
+
className: O(e.uiElement, e.uiSizable, i && e[i]),
|
|
286
316
|
children: [
|
|
287
317
|
t && /* @__PURE__ */ j("label", {
|
|
288
|
-
id:
|
|
289
|
-
htmlFor:
|
|
318
|
+
id: d,
|
|
319
|
+
htmlFor: u,
|
|
290
320
|
className: e.uiLabel,
|
|
291
321
|
children: t
|
|
292
322
|
}),
|
|
293
323
|
n && /* @__PURE__ */ j("p", {
|
|
294
|
-
id:
|
|
324
|
+
id: f,
|
|
295
325
|
className: e.uiDescription,
|
|
296
326
|
children: n
|
|
297
327
|
}),
|
|
@@ -299,38 +329,38 @@ var B = ({ label: t, description: n, disabled: i, size: a, placeholder: c = "В
|
|
|
299
329
|
className: e.uiInputContainer,
|
|
300
330
|
children: [/* @__PURE__ */ j("div", {
|
|
301
331
|
className: e.uiInputWithToggle,
|
|
302
|
-
children: !h && /* @__PURE__ */ j(
|
|
332
|
+
children: !h && /* @__PURE__ */ j(a, {
|
|
303
333
|
align: "center",
|
|
304
334
|
className: "h100",
|
|
305
335
|
children: /* @__PURE__ */ j("div", {
|
|
306
336
|
className: e.uiPlaceholder,
|
|
307
|
-
children:
|
|
337
|
+
children: o
|
|
308
338
|
})
|
|
309
339
|
})
|
|
310
340
|
}), /* @__PURE__ */ j("div", {
|
|
311
|
-
className:
|
|
341
|
+
className: m.controlEndAdornment,
|
|
312
342
|
children: /* @__PURE__ */ M("div", {
|
|
313
343
|
className: e.uiToggleButtonContainer,
|
|
314
344
|
children: [
|
|
315
345
|
/* @__PURE__ */ j("div", {
|
|
316
346
|
className: "flexEllipsis",
|
|
317
347
|
style: { maxWidth: "100%" },
|
|
318
|
-
children:
|
|
348
|
+
children: s
|
|
319
349
|
}),
|
|
320
350
|
/* @__PURE__ */ j("button", {
|
|
321
351
|
type: "button",
|
|
322
|
-
disabled: !
|
|
352
|
+
disabled: !s,
|
|
323
353
|
className: e.uiClearButton,
|
|
324
|
-
onClick:
|
|
354
|
+
onClick: l,
|
|
325
355
|
"aria-label": "Очистить все",
|
|
326
|
-
children: /* @__PURE__ */ j(
|
|
356
|
+
children: /* @__PURE__ */ j(P, {})
|
|
327
357
|
}),
|
|
328
358
|
/* @__PURE__ */ j("div", { className: e.uiButtonSeparator }),
|
|
329
359
|
/* @__PURE__ */ j("button", {
|
|
330
360
|
type: "button",
|
|
331
|
-
onClick:
|
|
361
|
+
onClick: c,
|
|
332
362
|
className: e.uiToggleButton,
|
|
333
|
-
children: /* @__PURE__ */ j(
|
|
363
|
+
children: /* @__PURE__ */ j(N, { className: e.uiToggleIcon })
|
|
334
364
|
})
|
|
335
365
|
]
|
|
336
366
|
})
|
|
@@ -338,26 +368,30 @@ var B = ({ label: t, description: n, disabled: i, size: a, placeholder: c = "В
|
|
|
338
368
|
})
|
|
339
369
|
]
|
|
340
370
|
});
|
|
341
|
-
};
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
371
|
+
}, K = [];
|
|
372
|
+
function q({ value: e = [], onChange: t, config: n, ...r }) {
|
|
373
|
+
let [i, a] = b(!1), o = z(n, e), s = o.data, c = e.length === 0 ? {
|
|
374
|
+
status: "ready",
|
|
375
|
+
items: K
|
|
376
|
+
} : s === void 0 ? o.isError ? { status: "error" } : { status: "loading" } : {
|
|
377
|
+
status: "ready",
|
|
378
|
+
items: s
|
|
379
|
+
}, l = v(() => a(!0), []), u = v(() => a(!1), []), d = v(() => t([]), [t]), f = v((e) => t(e.map((e) => String(e[n.leadingKey]))), [n.leadingKey, t]), p = v((e) => {
|
|
346
380
|
if (e?.length) return e.length > 1 ? `Выбрано ${e.length} элем.` : `${n.leadingText && e[0][n.leadingText] || e[0][n.leadingKey]}`;
|
|
347
381
|
}, [n.leadingKey, n.leadingText]);
|
|
348
|
-
return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(
|
|
382
|
+
return /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(G, {
|
|
349
383
|
...r,
|
|
350
|
-
token:
|
|
351
|
-
onOpen:
|
|
352
|
-
onClear:
|
|
353
|
-
}), i && /* @__PURE__ */ j(
|
|
384
|
+
token: p(s),
|
|
385
|
+
onOpen: l,
|
|
386
|
+
onClear: d
|
|
387
|
+
}), i && /* @__PURE__ */ j(W, {
|
|
354
388
|
config: n,
|
|
355
|
-
onClose:
|
|
356
|
-
onItemsSelect:
|
|
357
|
-
|
|
389
|
+
onClose: u,
|
|
390
|
+
onItemsSelect: f,
|
|
391
|
+
initialSelection: c
|
|
358
392
|
})] });
|
|
359
393
|
}
|
|
360
394
|
//#endregion
|
|
361
|
-
export {
|
|
395
|
+
export { q as AdvancedSearchSelect, R as useAdvancedSearch, z as useAdvancedSearchInitialSelected, V as useAdvancedSearchSelection };
|
|
362
396
|
|
|
363
397
|
//# sourceMappingURL=index.js.map
|