@ethisyscore/plugin-ui 1.70.0 → 1.71.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/components/data-grid/index.cjs +26 -1
- package/dist/components/data-grid/index.cjs.map +1 -1
- package/dist/components/data-grid/index.d.cts +36 -22
- package/dist/components/data-grid/index.d.ts +36 -22
- package/dist/components/data-grid/index.js +27 -2
- package/dist/components/data-grid/index.js.map +1 -1
- package/dist/components/date/index.cjs +466 -0
- package/dist/components/date/index.cjs.map +1 -0
- package/dist/components/date/index.d.cts +41 -0
- package/dist/components/date/index.d.ts +41 -0
- package/dist/components/date/index.js +437 -0
- package/dist/components/date/index.js.map +1 -0
- package/dist/components/layout/index.cjs +34 -466
- package/dist/components/layout/index.cjs.map +1 -1
- package/dist/components/layout/index.js +0 -410
- package/dist/components/layout/index.js.map +1 -1
- package/dist/components/shared/index.cjs +20 -452
- package/dist/components/shared/index.cjs.map +1 -1
- package/dist/components/shared/index.js +0 -410
- package/dist/components/shared/index.js.map +1 -1
- package/dist/components/ui/index.cjs +10 -447
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.d.cts +1 -39
- package/dist/components/ui/index.d.ts +1 -39
- package/dist/components/ui/index.js +1 -411
- package/dist/components/ui/index.js.map +1 -1
- package/dist/platform-react/index.cjs +23 -0
- package/dist/platform-react/index.cjs.map +1 -1
- package/dist/platform-react/index.d.cts +98 -1
- package/dist/platform-react/index.d.ts +98 -1
- package/dist/platform-react/index.js +21 -1
- package/dist/platform-react/index.js.map +1 -1
- package/package.json +9 -3
|
@@ -1,37 +1,9 @@
|
|
|
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);
|
|
35
7
|
|
|
36
8
|
// src/components/layout/FillGrid.tsx
|
|
37
9
|
|
|
@@ -143,315 +115,15 @@ function fillItemClass(span, gap) {
|
|
|
143
115
|
}
|
|
144
116
|
return parts.join(" ");
|
|
145
117
|
}
|
|
146
|
-
var FillGapContext =
|
|
118
|
+
var FillGapContext = react.createContext(5);
|
|
147
119
|
function FillGrid({ gap = 5, className, children }) {
|
|
148
120
|
const gapClass = gap === 2.5 ? "gap-2.5" : "gap-5";
|
|
149
121
|
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 }) });
|
|
150
122
|
}
|
|
151
123
|
function FillGridItem({ span = { xs: 12 }, className, children }) {
|
|
152
|
-
const gap =
|
|
124
|
+
const gap = react.useContext(FillGapContext);
|
|
153
125
|
return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { className: [fillItemClass(span, gap), className].filter(Boolean).join(" "), children });
|
|
154
126
|
}
|
|
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
127
|
function NiCross({ className, variant = "outlined", size = "medium" }) {
|
|
456
128
|
const iconSize = sizeHelper(size);
|
|
457
129
|
const iconStrokeWidth = strokeSizeHelper(iconSize);
|
|
@@ -581,24 +253,24 @@ var strokeSizeHelper = (size) => {
|
|
|
581
253
|
return 1.75;
|
|
582
254
|
}
|
|
583
255
|
};
|
|
584
|
-
|
|
256
|
+
react.memo(function DebouncedSearchInput2({
|
|
585
257
|
value = "",
|
|
586
258
|
onChange,
|
|
587
259
|
label = "Search",
|
|
588
260
|
delay = 400,
|
|
589
261
|
className
|
|
590
262
|
}) {
|
|
591
|
-
const [localValue, setLocalValue] =
|
|
592
|
-
const inputId =
|
|
593
|
-
const onChangeRef =
|
|
263
|
+
const [localValue, setLocalValue] = react.useState(value);
|
|
264
|
+
const inputId = react.useId();
|
|
265
|
+
const onChangeRef = react.useRef(onChange);
|
|
594
266
|
onChangeRef.current = onChange;
|
|
595
|
-
const lastReportedRef =
|
|
596
|
-
const isFirstRender =
|
|
597
|
-
|
|
267
|
+
const lastReportedRef = react.useRef(value);
|
|
268
|
+
const isFirstRender = react.useRef(true);
|
|
269
|
+
react.useEffect(() => {
|
|
598
270
|
setLocalValue(value);
|
|
599
271
|
lastReportedRef.current = value;
|
|
600
272
|
}, [value]);
|
|
601
|
-
|
|
273
|
+
react.useEffect(() => {
|
|
602
274
|
if (isFirstRender.current) {
|
|
603
275
|
isFirstRender.current = false;
|
|
604
276
|
return;
|
|
@@ -610,7 +282,7 @@ React.memo(function DebouncedSearchInput2({
|
|
|
610
282
|
}, delay);
|
|
611
283
|
return () => clearTimeout(timer);
|
|
612
284
|
}, [localValue, delay]);
|
|
613
|
-
const handleClear =
|
|
285
|
+
const handleClear = react.useCallback(() => {
|
|
614
286
|
setLocalValue("");
|
|
615
287
|
lastReportedRef.current = "";
|
|
616
288
|
onChangeRef.current("");
|
|
@@ -632,110 +304,6 @@ React.memo(function DebouncedSearchInput2({
|
|
|
632
304
|
)
|
|
633
305
|
] });
|
|
634
306
|
});
|
|
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";
|
|
739
307
|
function PageHeader({
|
|
740
308
|
title,
|
|
741
309
|
subtitle,
|
|
@@ -816,8 +384,8 @@ function PrimaryButton({ action }) {
|
|
|
816
384
|
);
|
|
817
385
|
}
|
|
818
386
|
function useMenuState() {
|
|
819
|
-
const [open, setOpen] =
|
|
820
|
-
const anchorRef =
|
|
387
|
+
const [open, setOpen] = react.useState(false);
|
|
388
|
+
const anchorRef = react.useRef(null);
|
|
821
389
|
return {
|
|
822
390
|
open,
|
|
823
391
|
anchorRef,
|
|
@@ -900,11 +468,11 @@ function OverflowMenu({ actions }) {
|
|
|
900
468
|
)) })
|
|
901
469
|
] });
|
|
902
470
|
}
|
|
903
|
-
var PageHeaderContext =
|
|
471
|
+
var PageHeaderContext = react.createContext(null);
|
|
904
472
|
function usePageHeaderContext() {
|
|
905
|
-
return
|
|
473
|
+
return react.useContext(PageHeaderContext);
|
|
906
474
|
}
|
|
907
|
-
var SidebarActionContext =
|
|
475
|
+
var SidebarActionContext = react.createContext({
|
|
908
476
|
triggerAction: () => {
|
|
909
477
|
},
|
|
910
478
|
registerHandler: () => () => {
|
|
@@ -914,20 +482,20 @@ var SidebarActionContext = React.createContext({
|
|
|
914
482
|
}
|
|
915
483
|
});
|
|
916
484
|
function SidebarActionProvider({ children }) {
|
|
917
|
-
const handlersRef =
|
|
918
|
-
const [activeActions, setActiveActions] =
|
|
919
|
-
const triggerAction =
|
|
485
|
+
const handlersRef = react.useRef(/* @__PURE__ */ new Set());
|
|
486
|
+
const [activeActions, setActiveActions] = react.useState(() => /* @__PURE__ */ new Set());
|
|
487
|
+
const triggerAction = react.useCallback((actionId) => {
|
|
920
488
|
for (const handler of handlersRef.current) {
|
|
921
489
|
handler(actionId);
|
|
922
490
|
}
|
|
923
491
|
}, []);
|
|
924
|
-
const registerHandler =
|
|
492
|
+
const registerHandler = react.useCallback((handler) => {
|
|
925
493
|
handlersRef.current.add(handler);
|
|
926
494
|
return () => {
|
|
927
495
|
handlersRef.current.delete(handler);
|
|
928
496
|
};
|
|
929
497
|
}, []);
|
|
930
|
-
const setActionActive =
|
|
498
|
+
const setActionActive = react.useCallback((actionId, isActive) => {
|
|
931
499
|
setActiveActions((prev) => {
|
|
932
500
|
const has = prev.has(actionId);
|
|
933
501
|
if (isActive === has) return prev;
|
|
@@ -937,34 +505,34 @@ function SidebarActionProvider({ children }) {
|
|
|
937
505
|
return next;
|
|
938
506
|
});
|
|
939
507
|
}, []);
|
|
940
|
-
const value =
|
|
508
|
+
const value = react.useMemo(
|
|
941
509
|
() => ({ triggerAction, registerHandler, activeActions, setActionActive }),
|
|
942
510
|
[triggerAction, registerHandler, activeActions, setActionActive]
|
|
943
511
|
);
|
|
944
512
|
return /* @__PURE__ */ jsxRuntime.jsx(SidebarActionContext.Provider, { value, children });
|
|
945
513
|
}
|
|
946
514
|
function useTriggerSidebarAction() {
|
|
947
|
-
return
|
|
515
|
+
return react.useContext(SidebarActionContext).triggerAction;
|
|
948
516
|
}
|
|
949
517
|
function useSidebarAction(handler) {
|
|
950
|
-
const { registerHandler } =
|
|
951
|
-
|
|
518
|
+
const { registerHandler } = react.useContext(SidebarActionContext);
|
|
519
|
+
react.useEffect(() => registerHandler(handler), [registerHandler, handler]);
|
|
952
520
|
}
|
|
953
521
|
function useSidebarActions(handlers) {
|
|
954
|
-
const handlersRef =
|
|
522
|
+
const handlersRef = react.useRef(handlers);
|
|
955
523
|
handlersRef.current = handlers;
|
|
956
524
|
useSidebarAction(
|
|
957
|
-
|
|
525
|
+
react.useCallback((actionId) => {
|
|
958
526
|
handlersRef.current[actionId]?.();
|
|
959
527
|
}, [])
|
|
960
528
|
);
|
|
961
529
|
}
|
|
962
530
|
function useActiveSidebarActions() {
|
|
963
|
-
return
|
|
531
|
+
return react.useContext(SidebarActionContext).activeActions;
|
|
964
532
|
}
|
|
965
533
|
function useReportSidebarActionActive(actionId, isActive) {
|
|
966
|
-
const { setActionActive } =
|
|
967
|
-
|
|
534
|
+
const { setActionActive } = react.useContext(SidebarActionContext);
|
|
535
|
+
react.useEffect(() => {
|
|
968
536
|
setActionActive(actionId, isActive);
|
|
969
537
|
return () => {
|
|
970
538
|
setActionActive(actionId, false);
|
|
@@ -977,7 +545,7 @@ function usePageHeader() {
|
|
|
977
545
|
const state = usePageHeaderContext();
|
|
978
546
|
const { activeMenuItem, detailContext, title, subtitle, breadcrumbs } = state ?? {};
|
|
979
547
|
const triggerAction = useTriggerSidebarAction();
|
|
980
|
-
return
|
|
548
|
+
return react.useMemo(() => {
|
|
981
549
|
const sourceActions = detailContext?.actions ?? activeMenuItem?.actions ?? [];
|
|
982
550
|
let primary;
|
|
983
551
|
let secondary;
|
|
@@ -1045,7 +613,7 @@ function toDescriptor(raw, triggerAction) {
|
|
|
1045
613
|
}
|
|
1046
614
|
function useDetailHeaderActions(base, actions) {
|
|
1047
615
|
const triggerAction = useTriggerSidebarAction();
|
|
1048
|
-
return
|
|
616
|
+
return react.useMemo(() => {
|
|
1049
617
|
if (actions.length === 0) {
|
|
1050
618
|
return base;
|
|
1051
619
|
}
|
|
@@ -1176,7 +744,7 @@ function PageHeaderProvider({
|
|
|
1176
744
|
const { pathname } = reactRouterDom.useLocation();
|
|
1177
745
|
const resolvedFromResolver = useDetailContext();
|
|
1178
746
|
const resolvedDetailContext = useDetailContext === useNoDetailContext ? detailContext ?? null : resolvedFromResolver;
|
|
1179
|
-
const state =
|
|
747
|
+
const state = react.useMemo(() => {
|
|
1180
748
|
const activeMenuItem = findByHref(config, normalise(pathname));
|
|
1181
749
|
const breadcrumbs = routeMeta != null ? buildBreadcrumbs(pathname, routeMeta) : void 0;
|
|
1182
750
|
const title = breadcrumbs != null && breadcrumbs.length >= 2 ? breadcrumbs[breadcrumbs.length - 1].label : void 0;
|