@ethisyscore/plugin-ui 1.62.0 → 1.64.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/components/data-grid/index.cjs +161 -0
- package/dist/components/data-grid/index.cjs.map +1 -0
- package/dist/components/data-grid/index.d.cts +234 -0
- package/dist/components/data-grid/index.d.ts +234 -0
- package/dist/components/data-grid/index.js +145 -0
- package/dist/components/data-grid/index.js.map +1 -0
- package/dist/components/layout/index.cjs +637 -25
- package/dist/components/layout/index.cjs.map +1 -1
- package/dist/components/layout/index.js +593 -3
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/shared/index.cjs +750 -57
- package/dist/components/shared/index.cjs.map +1 -1
- package/dist/components/shared/index.d.cts +21 -1
- package/dist/components/shared/index.d.ts +21 -1
- package/dist/components/shared/index.js +720 -50
- package/dist/components/shared/index.js.map +1 -1
- package/dist/components/ui/index.cjs +619 -0
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.cts +64 -1
- package/dist/components/ui/index.d.ts +64 -1
- package/dist/components/ui/index.js +594 -3
- package/dist/components/ui/index.js.map +1 -1
- package/dist/platform-react/index.cjs +2 -1
- package/dist/platform-react/index.cjs.map +1 -1
- package/dist/platform-react/index.js +2 -1
- package/dist/platform-react/index.js.map +1 -1
- package/package.json +21 -1
|
@@ -1,9 +1,37 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React = require('react');
|
|
4
4
|
var material = require('@mui/material');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var reactRouterDom = require('react-router-dom');
|
|
7
|
+
var dayjs2 = require('dayjs');
|
|
8
|
+
var LocalizationProvider = require('@mui/x-date-pickers/LocalizationProvider');
|
|
9
|
+
var AdapterDayjs = require('@mui/x-date-pickers/AdapterDayjs');
|
|
10
|
+
var DatePicker = require('@mui/x-date-pickers/DatePicker');
|
|
11
|
+
var DateTimePicker = require('@mui/x-date-pickers/DateTimePicker');
|
|
12
|
+
|
|
13
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
|
|
15
|
+
function _interopNamespace(e) {
|
|
16
|
+
if (e && e.__esModule) return e;
|
|
17
|
+
var n = Object.create(null);
|
|
18
|
+
if (e) {
|
|
19
|
+
Object.keys(e).forEach(function (k) {
|
|
20
|
+
if (k !== 'default') {
|
|
21
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return e[k]; }
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
n.default = e;
|
|
30
|
+
return Object.freeze(n);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
34
|
+
var dayjs2__default = /*#__PURE__*/_interopDefault(dayjs2);
|
|
7
35
|
|
|
8
36
|
// src/components/layout/FillGrid.tsx
|
|
9
37
|
|
|
@@ -115,15 +143,599 @@ function fillItemClass(span, gap) {
|
|
|
115
143
|
}
|
|
116
144
|
return parts.join(" ");
|
|
117
145
|
}
|
|
118
|
-
var FillGapContext =
|
|
146
|
+
var FillGapContext = React.createContext(5);
|
|
119
147
|
function FillGrid({ gap = 5, className, children }) {
|
|
120
148
|
const gapClass = gap === 2.5 ? "gap-2.5" : "gap-5";
|
|
121
149
|
return /* @__PURE__ */ jsxRuntime.jsx(FillGapContext.Provider, { value: gap, children: /* @__PURE__ */ jsxRuntime.jsx(material.Box, { className: ["flex w-full flex-wrap", gapClass, className].filter(Boolean).join(" "), children }) });
|
|
122
150
|
}
|
|
123
151
|
function FillGridItem({ span = { xs: 12 }, className, children }) {
|
|
124
|
-
const gap =
|
|
152
|
+
const gap = React.useContext(FillGapContext);
|
|
125
153
|
return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { className: [fillItemClass(span, gap), className].filter(Boolean).join(" "), children });
|
|
126
154
|
}
|
|
155
|
+
function NiCalendar({
|
|
156
|
+
className,
|
|
157
|
+
variant = "outlined",
|
|
158
|
+
size = "medium",
|
|
159
|
+
oneTone = false
|
|
160
|
+
}) {
|
|
161
|
+
const iconSize = sizeHelper(size);
|
|
162
|
+
const iconStrokeWidth = strokeSizeHelper(iconSize);
|
|
163
|
+
if (variant === "outlined") {
|
|
164
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
165
|
+
"svg",
|
|
166
|
+
{
|
|
167
|
+
width: iconSize,
|
|
168
|
+
height: iconSize,
|
|
169
|
+
className,
|
|
170
|
+
viewBox: "0 0 24 24",
|
|
171
|
+
fill: "none",
|
|
172
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
175
|
+
"path",
|
|
176
|
+
{
|
|
177
|
+
d: "M15.4356 3.38173C18.6934 3.74372 21.2712 6.30485 21.6542 9.56029V9.56029C21.8839 11.5134 21.8839 13.4866 21.6542 15.4397V15.4397C21.2712 18.6951 18.6934 21.2563 15.4356 21.6183L14.9973 21.667C13.0052 21.8883 10.9948 21.8883 9.0027 21.667L8.56439 21.6183C5.30655 21.2563 2.72884 18.6951 2.34585 15.4397V15.4397C2.11607 13.4866 2.11607 11.5134 2.34585 9.56029V9.56029C2.72884 6.30485 5.30656 3.74371 8.5644 3.38173L9.0027 3.33303C10.9948 3.11169 13.0052 3.11169 14.9973 3.33303L15.4356 3.38173Z",
|
|
178
|
+
stroke: "currentColor",
|
|
179
|
+
strokeWidth: iconStrokeWidth
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
183
|
+
"path",
|
|
184
|
+
{
|
|
185
|
+
opacity: oneTone ? 1 : 0.6,
|
|
186
|
+
d: "M8.5 11L7.5 11",
|
|
187
|
+
stroke: "currentColor",
|
|
188
|
+
strokeWidth: iconStrokeWidth,
|
|
189
|
+
strokeLinecap: "round"
|
|
190
|
+
}
|
|
191
|
+
),
|
|
192
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
193
|
+
"path",
|
|
194
|
+
{
|
|
195
|
+
opacity: oneTone ? 1 : 0.6,
|
|
196
|
+
d: "M8.5 15L7.5 15",
|
|
197
|
+
stroke: "currentColor",
|
|
198
|
+
strokeWidth: iconStrokeWidth,
|
|
199
|
+
strokeLinecap: "round"
|
|
200
|
+
}
|
|
201
|
+
),
|
|
202
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
203
|
+
"path",
|
|
204
|
+
{
|
|
205
|
+
opacity: oneTone ? 1 : 0.6,
|
|
206
|
+
d: "M12.5 11L11.5 11",
|
|
207
|
+
stroke: "currentColor",
|
|
208
|
+
strokeWidth: iconStrokeWidth,
|
|
209
|
+
strokeLinecap: "round"
|
|
210
|
+
}
|
|
211
|
+
),
|
|
212
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
213
|
+
"path",
|
|
214
|
+
{
|
|
215
|
+
opacity: oneTone ? 1 : 0.6,
|
|
216
|
+
d: "M12.5 15L11.5 15",
|
|
217
|
+
stroke: "currentColor",
|
|
218
|
+
strokeWidth: iconStrokeWidth,
|
|
219
|
+
strokeLinecap: "round"
|
|
220
|
+
}
|
|
221
|
+
),
|
|
222
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
223
|
+
"path",
|
|
224
|
+
{
|
|
225
|
+
opacity: oneTone ? 1 : 0.6,
|
|
226
|
+
d: "M16.5 11L15.5 11",
|
|
227
|
+
stroke: "currentColor",
|
|
228
|
+
strokeWidth: iconStrokeWidth,
|
|
229
|
+
strokeLinecap: "round"
|
|
230
|
+
}
|
|
231
|
+
),
|
|
232
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
233
|
+
"path",
|
|
234
|
+
{
|
|
235
|
+
opacity: oneTone ? 1 : 0.6,
|
|
236
|
+
d: "M16.5 15L15.5 15",
|
|
237
|
+
stroke: "currentColor",
|
|
238
|
+
strokeWidth: iconStrokeWidth,
|
|
239
|
+
strokeLinecap: "round"
|
|
240
|
+
}
|
|
241
|
+
),
|
|
242
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M8 2L8 5", stroke: "currentColor", strokeWidth: iconStrokeWidth, strokeLinecap: "round" }),
|
|
243
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16 2L16 5", stroke: "currentColor", strokeWidth: iconStrokeWidth, strokeLinecap: "round" })
|
|
244
|
+
]
|
|
245
|
+
}
|
|
246
|
+
);
|
|
247
|
+
} else {
|
|
248
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
249
|
+
"svg",
|
|
250
|
+
{
|
|
251
|
+
width: iconSize,
|
|
252
|
+
height: iconSize,
|
|
253
|
+
className,
|
|
254
|
+
viewBox: "0 0 24 24",
|
|
255
|
+
fill: "none",
|
|
256
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
257
|
+
children: [
|
|
258
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
259
|
+
"path",
|
|
260
|
+
{
|
|
261
|
+
fillRule: "evenodd",
|
|
262
|
+
clipRule: "evenodd",
|
|
263
|
+
d: "M16.0002 1.25C16.4142 1.25024 16.7502 1.58594 16.7502 2V2.87598C19.7568 3.71245 22.0243 6.29258 22.3986 9.47266C22.6352 11.4837 22.6352 13.5163 22.3986 15.5273C21.9747 19.1291 19.1222 21.9627 15.5178 22.3633L15.0793 22.4121C13.0325 22.6395 10.9659 22.6395 8.91912 22.4121L8.48065 22.3633C4.87659 21.9623 2.02462 19.1288 1.60076 15.5273C1.3642 13.5163 1.3642 11.4837 1.60076 9.47266C1.97507 6.29232 4.24318 3.71226 7.25018 2.87598V2C7.25018 1.58579 7.58596 1.25 8.00018 1.25C8.41419 1.25024 8.75018 1.58594 8.75018 2V2.60645L8.91912 2.58789C10.9659 2.36048 13.0325 2.36054 15.0793 2.58789L15.2502 2.60645V2C15.2502 1.58579 15.586 1.25 16.0002 1.25ZM7.50018 14.25L7.42303 14.2539C7.04506 14.2925 6.75018 14.6118 6.75018 15C6.75018 15.3882 7.04506 15.7075 7.42303 15.7461L7.50018 15.75H8.50018C8.91425 15.7498 9.25018 15.4141 9.25018 15C9.25018 14.5859 8.91425 14.2502 8.50018 14.25H7.50018ZM11.5002 14.25L11.423 14.2539C11.0451 14.2925 10.7502 14.6118 10.7502 15C10.7502 15.3882 11.0451 15.7075 11.423 15.7461L11.5002 15.75H12.5002C12.9142 15.7498 13.2502 15.4141 13.2502 15C13.2502 14.5859 12.9142 14.2502 12.5002 14.25H11.5002ZM15.5002 14.25L15.423 14.2539C15.0451 14.2925 14.7502 14.6118 14.7502 15C14.7502 15.3882 15.0451 15.7075 15.423 15.7461L15.5002 15.75H16.5002C16.9142 15.7498 17.2502 15.4141 17.2502 15C17.2502 14.5859 16.9142 14.2502 16.5002 14.25H15.5002ZM7.50018 10.25L7.42303 10.2539C7.04506 10.2925 6.75018 10.6118 6.75018 11C6.75018 11.3882 7.04506 11.7075 7.42303 11.7461L7.50018 11.75H8.50018C8.91425 11.7498 9.25018 11.4141 9.25018 11C9.25018 10.5859 8.91425 10.2502 8.50018 10.25H7.50018ZM11.5002 10.25L11.423 10.2539C11.0451 10.2925 10.7502 10.6118 10.7502 11C10.7502 11.3882 11.0451 11.7075 11.423 11.7461L11.5002 11.75H12.5002C12.9142 11.7498 13.2502 11.4141 13.2502 11C13.2502 10.5859 12.9142 10.2502 12.5002 10.25H11.5002ZM15.5002 10.25L15.423 10.2539C15.0451 10.2925 14.7502 10.6118 14.7502 11C14.7502 11.3882 15.0451 11.7075 15.423 11.7461L15.5002 11.75H16.5002C16.9142 11.7498 17.2502 11.4141 17.2502 11C17.2502 10.5859 16.9142 10.2502 16.5002 10.25H15.5002Z",
|
|
264
|
+
fill: "currentColor"
|
|
265
|
+
}
|
|
266
|
+
),
|
|
267
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
268
|
+
"path",
|
|
269
|
+
{
|
|
270
|
+
opacity: oneTone ? 0 : 0.4,
|
|
271
|
+
d: "M8.5 14.25C8.91421 14.25 9.25 14.5858 9.25 15C9.25 15.4142 8.91421 15.75 8.5 15.75H7.5L7.42285 15.7461C7.04488 15.7075 6.75 15.3882 6.75 15C6.75 14.6118 7.04488 14.2925 7.42285 14.2539L7.5 14.25H8.5Z",
|
|
272
|
+
fill: "currentColor"
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
276
|
+
"path",
|
|
277
|
+
{
|
|
278
|
+
opacity: oneTone ? 0 : 0.4,
|
|
279
|
+
d: "M12.5 14.25C12.9142 14.25 13.25 14.5858 13.25 15C13.25 15.4142 12.9142 15.75 12.5 15.75H11.5L11.4229 15.7461C11.0449 15.7075 10.75 15.3882 10.75 15C10.75 14.6118 11.0449 14.2925 11.4229 14.2539L11.5 14.25H12.5Z",
|
|
280
|
+
fill: "currentColor"
|
|
281
|
+
}
|
|
282
|
+
),
|
|
283
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
284
|
+
"path",
|
|
285
|
+
{
|
|
286
|
+
opacity: oneTone ? 0 : 0.4,
|
|
287
|
+
d: "M16.5 14.25C16.9142 14.25 17.25 14.5858 17.25 15C17.25 15.4142 16.9142 15.75 16.5 15.75H15.5L15.4229 15.7461C15.0449 15.7075 14.75 15.3882 14.75 15C14.75 14.6118 15.0449 14.2925 15.4229 14.2539L15.5 14.25H16.5Z",
|
|
288
|
+
fill: "currentColor"
|
|
289
|
+
}
|
|
290
|
+
),
|
|
291
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
292
|
+
"path",
|
|
293
|
+
{
|
|
294
|
+
opacity: oneTone ? 0 : 0.4,
|
|
295
|
+
d: "M8.5 10.25C8.91421 10.25 9.25 10.5858 9.25 11C9.25 11.4142 8.91421 11.75 8.5 11.75H7.5L7.42285 11.7461C7.04488 11.7075 6.75 11.3882 6.75 11C6.75 10.6118 7.04488 10.2925 7.42285 10.2539L7.5 10.25H8.5Z",
|
|
296
|
+
fill: "currentColor"
|
|
297
|
+
}
|
|
298
|
+
),
|
|
299
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
300
|
+
"path",
|
|
301
|
+
{
|
|
302
|
+
opacity: oneTone ? 0 : 0.4,
|
|
303
|
+
d: "M12.5 10.25C12.9142 10.25 13.25 10.5858 13.25 11C13.25 11.4142 12.9142 11.75 12.5 11.75H11.5L11.4229 11.7461C11.0449 11.7075 10.75 11.3882 10.75 11C10.75 10.6118 11.0449 10.2925 11.4229 10.2539L11.5 10.25H12.5Z",
|
|
304
|
+
fill: "currentColor"
|
|
305
|
+
}
|
|
306
|
+
),
|
|
307
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
308
|
+
"path",
|
|
309
|
+
{
|
|
310
|
+
opacity: oneTone ? 0 : 0.4,
|
|
311
|
+
d: "M16.5 10.25C16.9142 10.25 17.25 10.5858 17.25 11C17.25 11.4142 16.9142 11.75 16.5 11.75H15.5L15.4229 11.7461C15.0449 11.7075 14.75 11.3882 14.75 11C14.75 10.6118 15.0449 10.2925 15.4229 10.2539L15.5 10.25H16.5Z",
|
|
312
|
+
fill: "currentColor"
|
|
313
|
+
}
|
|
314
|
+
)
|
|
315
|
+
]
|
|
316
|
+
}
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
function NiChevronDownSmall({ className, variant = "outlined", size = "medium" }) {
|
|
321
|
+
const iconSize = sizeHelper(size);
|
|
322
|
+
const iconStrokeWidth = strokeSizeHelper(iconSize);
|
|
323
|
+
if (variant === "outlined") {
|
|
324
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
325
|
+
"svg",
|
|
326
|
+
{
|
|
327
|
+
width: iconSize,
|
|
328
|
+
height: iconSize,
|
|
329
|
+
className,
|
|
330
|
+
viewBox: "0 0 24 24",
|
|
331
|
+
fill: "none",
|
|
332
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
333
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
334
|
+
"path",
|
|
335
|
+
{
|
|
336
|
+
d: "M8 10L11.1515 13.1515C11.6201 13.6201 12.3799 13.6201 12.8485 13.1515L16 10",
|
|
337
|
+
stroke: "currentColor",
|
|
338
|
+
strokeWidth: iconStrokeWidth,
|
|
339
|
+
strokeLinecap: "round"
|
|
340
|
+
}
|
|
341
|
+
)
|
|
342
|
+
}
|
|
343
|
+
);
|
|
344
|
+
} else {
|
|
345
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
346
|
+
"svg",
|
|
347
|
+
{
|
|
348
|
+
width: iconSize,
|
|
349
|
+
height: iconSize,
|
|
350
|
+
className,
|
|
351
|
+
viewBox: "0 0 24 24",
|
|
352
|
+
fill: "none",
|
|
353
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
354
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
355
|
+
"path",
|
|
356
|
+
{
|
|
357
|
+
d: "M7.46967 9.46967C7.17678 9.76256 7.17678 10.2373 7.46967 10.5302L10.621 13.6816C11.3826 14.4431 12.6173 14.4431 13.3788 13.6816L16.5302 10.5302C16.8231 10.2373 16.8231 9.76256 16.5302 9.46967C16.2373 9.17678 15.7626 9.17678 15.4697 9.46967L12.3183 12.621C12.1426 12.7968 11.8573 12.7968 11.6816 12.621L8.53022 9.46967C8.23732 9.17678 7.76256 9.17678 7.46967 9.46967Z",
|
|
358
|
+
fill: "currentColor"
|
|
359
|
+
}
|
|
360
|
+
)
|
|
361
|
+
}
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
function NiChevronLeftSmall({ className, variant = "outlined", size = "medium" }) {
|
|
366
|
+
const iconSize = sizeHelper(size);
|
|
367
|
+
const iconStrokeWidth = strokeSizeHelper(iconSize);
|
|
368
|
+
if (variant === "outlined") {
|
|
369
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
370
|
+
"svg",
|
|
371
|
+
{
|
|
372
|
+
width: iconSize,
|
|
373
|
+
height: iconSize,
|
|
374
|
+
className,
|
|
375
|
+
viewBox: "0 0 24 24",
|
|
376
|
+
fill: "none",
|
|
377
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
378
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
379
|
+
"path",
|
|
380
|
+
{
|
|
381
|
+
d: "M14 8L10.8485 11.1515C10.3799 11.6201 10.3799 12.3799 10.8485 12.8485L14 16",
|
|
382
|
+
stroke: "currentColor",
|
|
383
|
+
strokeWidth: iconStrokeWidth,
|
|
384
|
+
strokeLinecap: "round"
|
|
385
|
+
}
|
|
386
|
+
)
|
|
387
|
+
}
|
|
388
|
+
);
|
|
389
|
+
} else {
|
|
390
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
391
|
+
"svg",
|
|
392
|
+
{
|
|
393
|
+
width: iconSize,
|
|
394
|
+
height: iconSize,
|
|
395
|
+
className,
|
|
396
|
+
viewBox: "0 0 24 24",
|
|
397
|
+
fill: "none",
|
|
398
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
399
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
400
|
+
"path",
|
|
401
|
+
{
|
|
402
|
+
d: "M14.5303 7.46967C14.2374 7.17678 13.7627 7.17678 13.4698 7.46967L10.3184 10.621C9.55689 11.3826 9.55689 12.6173 10.3184 13.3788L13.4698 16.5302C13.7627 16.8231 14.2374 16.8231 14.5303 16.5302C14.8232 16.2373 14.8232 15.7626 14.5303 15.4697L11.379 12.3183C11.2032 12.1426 11.2032 11.8573 11.379 11.6816L14.5303 8.53022C14.8232 8.23732 14.8232 7.76256 14.5303 7.46967Z",
|
|
403
|
+
fill: "currentColor"
|
|
404
|
+
}
|
|
405
|
+
)
|
|
406
|
+
}
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
function NiChevronRightSmall({ className, variant = "outlined", size = "medium" }) {
|
|
411
|
+
const iconSize = sizeHelper(size);
|
|
412
|
+
const iconStrokeWidth = strokeSizeHelper(iconSize);
|
|
413
|
+
if (variant === "outlined") {
|
|
414
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
415
|
+
"svg",
|
|
416
|
+
{
|
|
417
|
+
width: iconSize,
|
|
418
|
+
height: iconSize,
|
|
419
|
+
className,
|
|
420
|
+
viewBox: "0 0 24 24",
|
|
421
|
+
fill: "none",
|
|
422
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
423
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
424
|
+
"path",
|
|
425
|
+
{
|
|
426
|
+
d: "M10 16L13.1515 12.8485C13.6201 12.3799 13.6201 11.6201 13.1515 11.1515L10 8",
|
|
427
|
+
stroke: "currentColor",
|
|
428
|
+
strokeWidth: iconStrokeWidth,
|
|
429
|
+
strokeLinecap: "round"
|
|
430
|
+
}
|
|
431
|
+
)
|
|
432
|
+
}
|
|
433
|
+
);
|
|
434
|
+
} else {
|
|
435
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
436
|
+
"svg",
|
|
437
|
+
{
|
|
438
|
+
width: iconSize,
|
|
439
|
+
height: iconSize,
|
|
440
|
+
className,
|
|
441
|
+
viewBox: "0 0 24 24",
|
|
442
|
+
fill: "none",
|
|
443
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
444
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
445
|
+
"path",
|
|
446
|
+
{
|
|
447
|
+
d: "M9.46967 16.5303C9.76256 16.8232 10.2373 16.8232 10.5302 16.5303L13.6816 13.379C14.4431 12.6174 14.4431 11.3827 13.6816 10.6212L10.5302 7.46978C10.2373 7.17689 9.76256 7.17689 9.46967 7.46978C9.17678 7.76268 9.17678 8.23744 9.46967 8.53033L12.621 11.6817C12.7968 11.8574 12.7968 12.1427 12.621 12.3184L9.46967 15.4698C9.17678 15.7627 9.17678 16.2374 9.46967 16.5303Z",
|
|
448
|
+
fill: "currentColor"
|
|
449
|
+
}
|
|
450
|
+
)
|
|
451
|
+
}
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
function NiCross({ className, variant = "outlined", size = "medium" }) {
|
|
456
|
+
const iconSize = sizeHelper(size);
|
|
457
|
+
const iconStrokeWidth = strokeSizeHelper(iconSize);
|
|
458
|
+
if (variant === "outlined") {
|
|
459
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
460
|
+
"svg",
|
|
461
|
+
{
|
|
462
|
+
width: iconSize,
|
|
463
|
+
height: iconSize,
|
|
464
|
+
className,
|
|
465
|
+
viewBox: "0 0 24 24",
|
|
466
|
+
fill: "none",
|
|
467
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
468
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
469
|
+
"path",
|
|
470
|
+
{
|
|
471
|
+
d: "M8.00016 8L12.0001 12M12.0001 12L16 16.0002M12.0001 12L16 8.00015M12.0001 12L8 16.0002",
|
|
472
|
+
stroke: "currentColor",
|
|
473
|
+
strokeWidth: iconStrokeWidth,
|
|
474
|
+
strokeLinecap: "round"
|
|
475
|
+
}
|
|
476
|
+
)
|
|
477
|
+
}
|
|
478
|
+
);
|
|
479
|
+
} else {
|
|
480
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
481
|
+
"svg",
|
|
482
|
+
{
|
|
483
|
+
width: iconSize,
|
|
484
|
+
height: iconSize,
|
|
485
|
+
className,
|
|
486
|
+
viewBox: "0 0 24 24",
|
|
487
|
+
fill: "none",
|
|
488
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
489
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
490
|
+
"path",
|
|
491
|
+
{
|
|
492
|
+
d: "M15.4698 7.46963C15.7626 7.17684 16.2374 7.17684 16.5303 7.46963C16.8232 7.7625 16.8231 8.23728 16.5303 8.53018L13.0606 11.9999L16.5303 15.4696C16.8232 15.7625 16.8231 16.2373 16.5303 16.5302C16.2557 16.8048 15.821 16.8223 15.5264 16.5819L15.4698 16.5302L12 13.0604L8.53032 16.5302C8.23743 16.8231 7.76267 16.8231 7.46977 16.5302C7.17697 16.2373 7.17691 15.7625 7.46977 15.4696L10.9395 11.9999L7.46977 8.53018L7.41801 8.47354C7.1778 8.17898 7.19527 7.74421 7.46977 7.46963C7.76264 7.17676 8.23742 7.17682 8.53032 7.46963L12 10.9394L15.4698 7.46963Z",
|
|
493
|
+
fill: "currentColor"
|
|
494
|
+
}
|
|
495
|
+
)
|
|
496
|
+
}
|
|
497
|
+
);
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
function NiSearch({
|
|
501
|
+
className,
|
|
502
|
+
variant = "outlined",
|
|
503
|
+
size = "medium",
|
|
504
|
+
oneTone = false
|
|
505
|
+
}) {
|
|
506
|
+
const iconSize = sizeHelper(size);
|
|
507
|
+
const iconStrokeWidth = strokeSizeHelper(iconSize);
|
|
508
|
+
if (variant === "outlined") {
|
|
509
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
510
|
+
"svg",
|
|
511
|
+
{
|
|
512
|
+
width: iconSize,
|
|
513
|
+
height: iconSize,
|
|
514
|
+
className,
|
|
515
|
+
viewBox: "0 0 24 24",
|
|
516
|
+
fill: "none",
|
|
517
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
518
|
+
children: [
|
|
519
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
520
|
+
"path",
|
|
521
|
+
{
|
|
522
|
+
opacity: oneTone ? 1 : 0.6,
|
|
523
|
+
d: "M22 22L18.5 18.5",
|
|
524
|
+
stroke: "currentColor",
|
|
525
|
+
strokeWidth: iconStrokeWidth,
|
|
526
|
+
strokeLinecap: "round"
|
|
527
|
+
}
|
|
528
|
+
),
|
|
529
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "11.5", cy: "11.5", r: "9.5", stroke: "currentColor", strokeWidth: iconStrokeWidth })
|
|
530
|
+
]
|
|
531
|
+
}
|
|
532
|
+
);
|
|
533
|
+
} else {
|
|
534
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
535
|
+
"svg",
|
|
536
|
+
{
|
|
537
|
+
width: iconSize,
|
|
538
|
+
height: iconSize,
|
|
539
|
+
className,
|
|
540
|
+
viewBox: "0 0 24 24",
|
|
541
|
+
fill: "none",
|
|
542
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
543
|
+
children: [
|
|
544
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
545
|
+
"path",
|
|
546
|
+
{
|
|
547
|
+
opacity: oneTone ? 1 : 0.4,
|
|
548
|
+
d: "M19.0303 17.9697C18.7374 17.6768 18.2627 17.6768 17.9698 17.9697C17.6769 18.2626 17.6769 18.7373 17.9698 19.0302L21.4698 22.5302C21.7627 22.8231 22.2374 22.8231 22.5303 22.5302C22.8232 22.2373 22.8232 21.7626 22.5303 21.4697L19.0303 17.9697Z",
|
|
549
|
+
fill: "currentColor"
|
|
550
|
+
}
|
|
551
|
+
),
|
|
552
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
553
|
+
"path",
|
|
554
|
+
{
|
|
555
|
+
d: "M11.5 1.25C17.1609 1.25 21.75 5.83908 21.75 11.5C21.75 17.1609 17.1609 21.75 11.5 21.75C5.83908 21.75 1.25 17.1609 1.25 11.5C1.25 5.83908 5.83908 1.25 11.5 1.25Z",
|
|
556
|
+
fill: "currentColor"
|
|
557
|
+
}
|
|
558
|
+
)
|
|
559
|
+
]
|
|
560
|
+
}
|
|
561
|
+
);
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
var sizeHelper = (size) => {
|
|
565
|
+
if (typeof size === "number") {
|
|
566
|
+
return size;
|
|
567
|
+
} else if (size === "large") {
|
|
568
|
+
return 24;
|
|
569
|
+
} else if (size === "small" || size === "tiny") {
|
|
570
|
+
return 16;
|
|
571
|
+
} else {
|
|
572
|
+
return 20;
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
var strokeSizeHelper = (size) => {
|
|
576
|
+
if (size === 32) {
|
|
577
|
+
return 1.15;
|
|
578
|
+
} else if (size >= 20) {
|
|
579
|
+
return 1.5;
|
|
580
|
+
} else {
|
|
581
|
+
return 1.75;
|
|
582
|
+
}
|
|
583
|
+
};
|
|
584
|
+
React.memo(function DebouncedSearchInput2({
|
|
585
|
+
value = "",
|
|
586
|
+
onChange,
|
|
587
|
+
label = "Search",
|
|
588
|
+
delay = 400,
|
|
589
|
+
className
|
|
590
|
+
}) {
|
|
591
|
+
const [localValue, setLocalValue] = React.useState(value);
|
|
592
|
+
const inputId = React.useId();
|
|
593
|
+
const onChangeRef = React.useRef(onChange);
|
|
594
|
+
onChangeRef.current = onChange;
|
|
595
|
+
const lastReportedRef = React.useRef(value);
|
|
596
|
+
const isFirstRender = React.useRef(true);
|
|
597
|
+
React.useEffect(() => {
|
|
598
|
+
setLocalValue(value);
|
|
599
|
+
lastReportedRef.current = value;
|
|
600
|
+
}, [value]);
|
|
601
|
+
React.useEffect(() => {
|
|
602
|
+
if (isFirstRender.current) {
|
|
603
|
+
isFirstRender.current = false;
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
if (localValue === lastReportedRef.current) return;
|
|
607
|
+
const timer = setTimeout(() => {
|
|
608
|
+
lastReportedRef.current = localValue;
|
|
609
|
+
onChangeRef.current(localValue);
|
|
610
|
+
}, delay);
|
|
611
|
+
return () => clearTimeout(timer);
|
|
612
|
+
}, [localValue, delay]);
|
|
613
|
+
const handleClear = React.useCallback(() => {
|
|
614
|
+
setLocalValue("");
|
|
615
|
+
lastReportedRef.current = "";
|
|
616
|
+
onChangeRef.current("");
|
|
617
|
+
}, []);
|
|
618
|
+
const classes = (...parts) => parts.filter(Boolean).join(" ");
|
|
619
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(material.FormControl, { variant: "filled", size: "medium", className: classes("surface mb-0 w-full", className), children: [
|
|
620
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.InputLabel, { htmlFor: inputId, children: label }),
|
|
621
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
622
|
+
material.FilledInput,
|
|
623
|
+
{
|
|
624
|
+
id: inputId,
|
|
625
|
+
value: localValue,
|
|
626
|
+
onChange: (e) => setLocalValue(e.target.value),
|
|
627
|
+
endAdornment: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
628
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.InputAdornment, { position: "end", className: classes(localValue === "" && "hidden"), children: /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { edge: "end", onClick: handleClear, "aria-label": "Clear search", children: /* @__PURE__ */ jsxRuntime.jsx(NiCross, { size: "medium", className: "text-text-disabled" }) }) }),
|
|
629
|
+
/* @__PURE__ */ jsxRuntime.jsx(material.InputAdornment, { position: "end", className: classes(localValue !== "" && "hidden"), "aria-hidden": true, children: /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { edge: "end", disabled: true, tabIndex: -1, children: /* @__PURE__ */ jsxRuntime.jsx(NiSearch, { size: "medium", className: "text-text-disabled" }) }) })
|
|
630
|
+
] })
|
|
631
|
+
}
|
|
632
|
+
)
|
|
633
|
+
] });
|
|
634
|
+
});
|
|
635
|
+
var DATE_INPUT_MIN = "1900-01-01";
|
|
636
|
+
var DATE_INPUT_MAX = "2100-12-31";
|
|
637
|
+
function toIsoString(value, type) {
|
|
638
|
+
if (!value?.isValid()) {
|
|
639
|
+
return "";
|
|
640
|
+
}
|
|
641
|
+
return type === "datetime-local" ? value.format("YYYY-MM-DDTHH:mm") : value.format("YYYY-MM-DD");
|
|
642
|
+
}
|
|
643
|
+
function parseIsoValue(value) {
|
|
644
|
+
if (!value) {
|
|
645
|
+
return null;
|
|
646
|
+
}
|
|
647
|
+
const parsed = dayjs2__default.default(value);
|
|
648
|
+
return parsed.isValid() ? parsed : null;
|
|
649
|
+
}
|
|
650
|
+
var popperModifiers = [
|
|
651
|
+
{ name: "preventOverflow", options: { altBoundary: true } },
|
|
652
|
+
{ name: "flip", options: { altBoundary: true } }
|
|
653
|
+
];
|
|
654
|
+
var withSecondaryText = (className) => [typeof className === "string" ? className : void 0, "text-text-secondary"].filter(Boolean).join(" ");
|
|
655
|
+
var pickerSlots = {
|
|
656
|
+
openPickerIcon: (props) => /* @__PURE__ */ jsxRuntime.jsx(NiCalendar, { ...props, className: withSecondaryText(props.className) }),
|
|
657
|
+
switchViewIcon: (props) => /* @__PURE__ */ jsxRuntime.jsx(NiChevronDownSmall, { ...props, className: withSecondaryText(props.className) }),
|
|
658
|
+
leftArrowIcon: (props) => /* @__PURE__ */ jsxRuntime.jsx(NiChevronLeftSmall, { ...props, className: withSecondaryText(props.className) }),
|
|
659
|
+
rightArrowIcon: (props) => /* @__PURE__ */ jsxRuntime.jsx(NiChevronRightSmall, { ...props, className: withSecondaryText(props.className) })
|
|
660
|
+
};
|
|
661
|
+
var DateInput = React__namespace.forwardRef(
|
|
662
|
+
({
|
|
663
|
+
type = "date",
|
|
664
|
+
min,
|
|
665
|
+
max,
|
|
666
|
+
rejectInvalidValue: _rejectInvalidValue,
|
|
667
|
+
value,
|
|
668
|
+
onChange,
|
|
669
|
+
onBlur,
|
|
670
|
+
label,
|
|
671
|
+
helperText,
|
|
672
|
+
error,
|
|
673
|
+
disabled,
|
|
674
|
+
slotProps: callerSlotProps,
|
|
675
|
+
...rest
|
|
676
|
+
}, ref) => {
|
|
677
|
+
const handleChange = React__namespace.useCallback(
|
|
678
|
+
(newValue) => {
|
|
679
|
+
if (!onChange) return;
|
|
680
|
+
const strValue = toIsoString(newValue, type);
|
|
681
|
+
const input = document.createElement("input");
|
|
682
|
+
input.value = strValue;
|
|
683
|
+
onChange({
|
|
684
|
+
target: input,
|
|
685
|
+
currentTarget: input,
|
|
686
|
+
type: "change"
|
|
687
|
+
});
|
|
688
|
+
},
|
|
689
|
+
[onChange, type]
|
|
690
|
+
);
|
|
691
|
+
const parsedValue = parseIsoValue(value);
|
|
692
|
+
const minDate = min ? dayjs2__default.default(min) : dayjs2__default.default(DATE_INPUT_MIN);
|
|
693
|
+
const maxDate = max ? dayjs2__default.default(max) : dayjs2__default.default(DATE_INPUT_MAX).endOf("day");
|
|
694
|
+
const textFieldProps = {
|
|
695
|
+
...rest,
|
|
696
|
+
disabled,
|
|
697
|
+
error: Boolean(error),
|
|
698
|
+
helperText,
|
|
699
|
+
onBlur,
|
|
700
|
+
inputRef: ref,
|
|
701
|
+
slotProps: callerSlotProps
|
|
702
|
+
};
|
|
703
|
+
return /* @__PURE__ */ jsxRuntime.jsx(LocalizationProvider.LocalizationProvider, { dateAdapter: AdapterDayjs.AdapterDayjs, children: type === "datetime-local" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
704
|
+
DateTimePicker.DateTimePicker,
|
|
705
|
+
{
|
|
706
|
+
label,
|
|
707
|
+
value: parsedValue,
|
|
708
|
+
onChange: handleChange,
|
|
709
|
+
minDateTime: minDate,
|
|
710
|
+
maxDateTime: maxDate,
|
|
711
|
+
disabled,
|
|
712
|
+
slots: pickerSlots,
|
|
713
|
+
slotProps: {
|
|
714
|
+
textField: textFieldProps,
|
|
715
|
+
desktopPaper: { className: "outlined" },
|
|
716
|
+
popper: { sx: { zIndex: 1600 }, popperOptions: { modifiers: popperModifiers } }
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
720
|
+
DatePicker.DatePicker,
|
|
721
|
+
{
|
|
722
|
+
label,
|
|
723
|
+
value: parsedValue,
|
|
724
|
+
onChange: handleChange,
|
|
725
|
+
minDate,
|
|
726
|
+
maxDate,
|
|
727
|
+
disabled,
|
|
728
|
+
slots: pickerSlots,
|
|
729
|
+
slotProps: {
|
|
730
|
+
textField: textFieldProps,
|
|
731
|
+
desktopPaper: { className: "outlined" },
|
|
732
|
+
popper: { sx: { zIndex: 1600 }, popperOptions: { modifiers: popperModifiers } }
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
) });
|
|
736
|
+
}
|
|
737
|
+
);
|
|
738
|
+
DateInput.displayName = "DateInput";
|
|
127
739
|
function PageHeader({
|
|
128
740
|
title,
|
|
129
741
|
subtitle,
|
|
@@ -204,8 +816,8 @@ function PrimaryButton({ action }) {
|
|
|
204
816
|
);
|
|
205
817
|
}
|
|
206
818
|
function useMenuState() {
|
|
207
|
-
const [open, setOpen] =
|
|
208
|
-
const anchorRef =
|
|
819
|
+
const [open, setOpen] = React.useState(false);
|
|
820
|
+
const anchorRef = React.useRef(null);
|
|
209
821
|
return {
|
|
210
822
|
open,
|
|
211
823
|
anchorRef,
|
|
@@ -288,11 +900,11 @@ function OverflowMenu({ actions }) {
|
|
|
288
900
|
)) })
|
|
289
901
|
] });
|
|
290
902
|
}
|
|
291
|
-
var PageHeaderContext =
|
|
903
|
+
var PageHeaderContext = React.createContext(null);
|
|
292
904
|
function usePageHeaderContext() {
|
|
293
|
-
return
|
|
905
|
+
return React.useContext(PageHeaderContext);
|
|
294
906
|
}
|
|
295
|
-
var SidebarActionContext =
|
|
907
|
+
var SidebarActionContext = React.createContext({
|
|
296
908
|
triggerAction: () => {
|
|
297
909
|
},
|
|
298
910
|
registerHandler: () => () => {
|
|
@@ -302,20 +914,20 @@ var SidebarActionContext = react.createContext({
|
|
|
302
914
|
}
|
|
303
915
|
});
|
|
304
916
|
function SidebarActionProvider({ children }) {
|
|
305
|
-
const handlersRef =
|
|
306
|
-
const [activeActions, setActiveActions] =
|
|
307
|
-
const triggerAction =
|
|
917
|
+
const handlersRef = React.useRef(/* @__PURE__ */ new Set());
|
|
918
|
+
const [activeActions, setActiveActions] = React.useState(() => /* @__PURE__ */ new Set());
|
|
919
|
+
const triggerAction = React.useCallback((actionId) => {
|
|
308
920
|
for (const handler of handlersRef.current) {
|
|
309
921
|
handler(actionId);
|
|
310
922
|
}
|
|
311
923
|
}, []);
|
|
312
|
-
const registerHandler =
|
|
924
|
+
const registerHandler = React.useCallback((handler) => {
|
|
313
925
|
handlersRef.current.add(handler);
|
|
314
926
|
return () => {
|
|
315
927
|
handlersRef.current.delete(handler);
|
|
316
928
|
};
|
|
317
929
|
}, []);
|
|
318
|
-
const setActionActive =
|
|
930
|
+
const setActionActive = React.useCallback((actionId, isActive) => {
|
|
319
931
|
setActiveActions((prev) => {
|
|
320
932
|
const has = prev.has(actionId);
|
|
321
933
|
if (isActive === has) return prev;
|
|
@@ -325,34 +937,34 @@ function SidebarActionProvider({ children }) {
|
|
|
325
937
|
return next;
|
|
326
938
|
});
|
|
327
939
|
}, []);
|
|
328
|
-
const value =
|
|
940
|
+
const value = React.useMemo(
|
|
329
941
|
() => ({ triggerAction, registerHandler, activeActions, setActionActive }),
|
|
330
942
|
[triggerAction, registerHandler, activeActions, setActionActive]
|
|
331
943
|
);
|
|
332
944
|
return /* @__PURE__ */ jsxRuntime.jsx(SidebarActionContext.Provider, { value, children });
|
|
333
945
|
}
|
|
334
946
|
function useTriggerSidebarAction() {
|
|
335
|
-
return
|
|
947
|
+
return React.useContext(SidebarActionContext).triggerAction;
|
|
336
948
|
}
|
|
337
949
|
function useSidebarAction(handler) {
|
|
338
|
-
const { registerHandler } =
|
|
339
|
-
|
|
950
|
+
const { registerHandler } = React.useContext(SidebarActionContext);
|
|
951
|
+
React.useEffect(() => registerHandler(handler), [registerHandler, handler]);
|
|
340
952
|
}
|
|
341
953
|
function useSidebarActions(handlers) {
|
|
342
|
-
const handlersRef =
|
|
954
|
+
const handlersRef = React.useRef(handlers);
|
|
343
955
|
handlersRef.current = handlers;
|
|
344
956
|
useSidebarAction(
|
|
345
|
-
|
|
957
|
+
React.useCallback((actionId) => {
|
|
346
958
|
handlersRef.current[actionId]?.();
|
|
347
959
|
}, [])
|
|
348
960
|
);
|
|
349
961
|
}
|
|
350
962
|
function useActiveSidebarActions() {
|
|
351
|
-
return
|
|
963
|
+
return React.useContext(SidebarActionContext).activeActions;
|
|
352
964
|
}
|
|
353
965
|
function useReportSidebarActionActive(actionId, isActive) {
|
|
354
|
-
const { setActionActive } =
|
|
355
|
-
|
|
966
|
+
const { setActionActive } = React.useContext(SidebarActionContext);
|
|
967
|
+
React.useEffect(() => {
|
|
356
968
|
setActionActive(actionId, isActive);
|
|
357
969
|
return () => {
|
|
358
970
|
setActionActive(actionId, false);
|
|
@@ -365,7 +977,7 @@ function usePageHeader() {
|
|
|
365
977
|
const state = usePageHeaderContext();
|
|
366
978
|
const { activeMenuItem, detailContext, title, subtitle, breadcrumbs } = state ?? {};
|
|
367
979
|
const triggerAction = useTriggerSidebarAction();
|
|
368
|
-
return
|
|
980
|
+
return React.useMemo(() => {
|
|
369
981
|
const sourceActions = detailContext?.actions ?? activeMenuItem?.actions ?? [];
|
|
370
982
|
let primary;
|
|
371
983
|
let secondary;
|
|
@@ -433,7 +1045,7 @@ function toDescriptor(raw, triggerAction) {
|
|
|
433
1045
|
}
|
|
434
1046
|
function useDetailHeaderActions(base, actions) {
|
|
435
1047
|
const triggerAction = useTriggerSidebarAction();
|
|
436
|
-
return
|
|
1048
|
+
return React.useMemo(() => {
|
|
437
1049
|
if (actions.length === 0) {
|
|
438
1050
|
return base;
|
|
439
1051
|
}
|
|
@@ -564,7 +1176,7 @@ function PageHeaderProvider({
|
|
|
564
1176
|
const { pathname } = reactRouterDom.useLocation();
|
|
565
1177
|
const resolvedFromResolver = useDetailContext();
|
|
566
1178
|
const resolvedDetailContext = useDetailContext === useNoDetailContext ? detailContext ?? null : resolvedFromResolver;
|
|
567
|
-
const state =
|
|
1179
|
+
const state = React.useMemo(() => {
|
|
568
1180
|
const activeMenuItem = findByHref(config, normalise(pathname));
|
|
569
1181
|
const breadcrumbs = routeMeta != null ? buildBreadcrumbs(pathname, routeMeta) : void 0;
|
|
570
1182
|
const title = breadcrumbs != null && breadcrumbs.length >= 2 ? breadcrumbs[breadcrumbs.length - 1].label : void 0;
|