@apia/components 0.3.2 → 0.3.4
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/index.d.ts +184 -173
- package/dist/index.js +1355 -1255
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import React__default, { createContext, useContext, useMemo, useEffect, useState, useRef, forwardRef, useCallback, useTransition, useDeferredValue, Children, memo, isValidElement, cloneElement, lazy } from 'react';
|
|
4
4
|
import { shallowEqual } from '@apia/store';
|
|
5
5
|
import { Box, getVariant, Button, Flex, spacing, Spinner, IconButton as IconButton$1, Image, Input, useBreakpointIndex, Close, responsive, Heading, useThemeUI, injectStyles, Select, focusOutline, makeStyledComponent, Label, Progress, Grid } from '@apia/theme';
|
|
6
|
-
import { findScrollContainer, getSpecificParent, getLabel, useUpdateEffect, debugDispatcher, useCombinedRefs, focus, focusSelector, getFocusSelector, screenLocker, customEvents, isChild, getDateFormat, persistentStorage, disableChildrenFocus, enableChildrenFocus, EventEmitter, useDebouncedCallback, getIndex, addBoundary, noNaN,
|
|
6
|
+
import { findScrollContainer, getSpecificParent, getLabel, useUpdateEffect, debugDispatcher, useCombinedRefs, focus, focusSelector, getFocusSelector, screenLocker, customEvents, isChild, getDateFormat, persistentStorage, disableChildrenFocus, enableChildrenFocus, EventEmitter, useDebouncedCallback, getIndex, addBoundary, noNaN, useLatest, usePrevious, useMount, makeSingleImperativeComponent, useImperativeComponentEvents } from '@apia/util';
|
|
7
7
|
import { icons, Icon as Icon$1 } from '@apia/icons';
|
|
8
8
|
import { uniqueId as uniqueId$1, isFunction as isFunction$1 } from 'lodash-es';
|
|
9
9
|
import dayjs from 'dayjs';
|
|
@@ -16,6 +16,7 @@ import { BarLoader } from 'react-spinners';
|
|
|
16
16
|
import AnimateHeight from 'react-animate-height';
|
|
17
17
|
import { useUpdateEffect as useUpdateEffect$1 } from 'ahooks';
|
|
18
18
|
import { createFAsomeStore } from '@apia/dom-store';
|
|
19
|
+
import { ApiaUtil } from '@apia/objects';
|
|
19
20
|
import { IconButton as IconButton$2 } from '@apia/components';
|
|
20
21
|
|
|
21
22
|
const AccordionContext = createContext(null);
|
|
@@ -132,32 +133,32 @@ class AccordionHandler {
|
|
|
132
133
|
}
|
|
133
134
|
}
|
|
134
135
|
|
|
135
|
-
var __defProp$
|
|
136
|
-
var __defProps$
|
|
137
|
-
var __getOwnPropDescs$
|
|
138
|
-
var __getOwnPropSymbols$
|
|
139
|
-
var __hasOwnProp$
|
|
140
|
-
var __propIsEnum$
|
|
141
|
-
var __defNormalProp$
|
|
142
|
-
var __spreadValues$
|
|
136
|
+
var __defProp$G = Object.defineProperty;
|
|
137
|
+
var __defProps$x = Object.defineProperties;
|
|
138
|
+
var __getOwnPropDescs$x = Object.getOwnPropertyDescriptors;
|
|
139
|
+
var __getOwnPropSymbols$H = Object.getOwnPropertySymbols;
|
|
140
|
+
var __hasOwnProp$H = Object.prototype.hasOwnProperty;
|
|
141
|
+
var __propIsEnum$H = Object.prototype.propertyIsEnumerable;
|
|
142
|
+
var __defNormalProp$G = (obj, key, value) => key in obj ? __defProp$G(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
143
|
+
var __spreadValues$G = (a, b) => {
|
|
143
144
|
for (var prop in b || (b = {}))
|
|
144
|
-
if (__hasOwnProp$
|
|
145
|
-
__defNormalProp$
|
|
146
|
-
if (__getOwnPropSymbols$
|
|
147
|
-
for (var prop of __getOwnPropSymbols$
|
|
148
|
-
if (__propIsEnum$
|
|
149
|
-
__defNormalProp$
|
|
145
|
+
if (__hasOwnProp$H.call(b, prop))
|
|
146
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
147
|
+
if (__getOwnPropSymbols$H)
|
|
148
|
+
for (var prop of __getOwnPropSymbols$H(b)) {
|
|
149
|
+
if (__propIsEnum$H.call(b, prop))
|
|
150
|
+
__defNormalProp$G(a, prop, b[prop]);
|
|
150
151
|
}
|
|
151
152
|
return a;
|
|
152
153
|
};
|
|
153
|
-
var __spreadProps$
|
|
154
|
+
var __spreadProps$x = (a, b) => __defProps$x(a, __getOwnPropDescs$x(b));
|
|
154
155
|
const KeyHandler$1 = (props) => {
|
|
155
156
|
const [ref, setRef] = useState(null);
|
|
156
157
|
const handler = useAccordionContext();
|
|
157
158
|
useEffect(() => {
|
|
158
159
|
if (ref) {
|
|
159
160
|
ref.addEventListener("keydown", (ev) => {
|
|
160
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
161
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
161
162
|
const accordionItem = (_a = ev.target) == null ? void 0 : _a.closest(
|
|
162
163
|
".accordion__item"
|
|
163
164
|
);
|
|
@@ -182,6 +183,24 @@ const KeyHandler$1 = (props) => {
|
|
|
182
183
|
".accordion__item__button"
|
|
183
184
|
)) == null ? void 0 : _g.focus();
|
|
184
185
|
}
|
|
186
|
+
} else if (ev.code === "ArrowLeft") {
|
|
187
|
+
if ((_h = allItems[currentIndex]) == null ? void 0 : _h.querySelector(
|
|
188
|
+
'[aria-expanded="true"]'
|
|
189
|
+
)) {
|
|
190
|
+
ev.preventDefault();
|
|
191
|
+
(_j = (_i = allItems[currentIndex]) == null ? void 0 : _i.querySelector(
|
|
192
|
+
".accordion__item__button"
|
|
193
|
+
)) == null ? void 0 : _j.click();
|
|
194
|
+
}
|
|
195
|
+
} else if (ev.code === "ArrowRight") {
|
|
196
|
+
if ((_k = allItems[currentIndex]) == null ? void 0 : _k.querySelector(
|
|
197
|
+
'[aria-expanded="false"]'
|
|
198
|
+
)) {
|
|
199
|
+
ev.preventDefault();
|
|
200
|
+
(_m = (_l = allItems[currentIndex]) == null ? void 0 : _l.querySelector(
|
|
201
|
+
".accordion__item__button"
|
|
202
|
+
)) == null ? void 0 : _m.click();
|
|
203
|
+
}
|
|
185
204
|
} else if (ev.code === "Space") {
|
|
186
205
|
ev.preventDefault();
|
|
187
206
|
ev.stopPropagation();
|
|
@@ -196,31 +215,31 @@ const KeyHandler$1 = (props) => {
|
|
|
196
215
|
const variant = handler.hooks.usePropsSelector((current) => current.variant);
|
|
197
216
|
return /* @__PURE__ */ jsx(
|
|
198
217
|
Box,
|
|
199
|
-
__spreadValues$
|
|
218
|
+
__spreadValues$G(__spreadProps$x(__spreadValues$G({}, props), {
|
|
200
219
|
ref: setRef
|
|
201
220
|
}), variant ? getVariant(variant) : void 0)
|
|
202
221
|
);
|
|
203
222
|
};
|
|
204
223
|
|
|
205
|
-
var __defProp$
|
|
206
|
-
var __defProps$
|
|
207
|
-
var __getOwnPropDescs$
|
|
208
|
-
var __getOwnPropSymbols$
|
|
209
|
-
var __hasOwnProp$
|
|
210
|
-
var __propIsEnum$
|
|
211
|
-
var __defNormalProp$
|
|
212
|
-
var __spreadValues$
|
|
224
|
+
var __defProp$F = Object.defineProperty;
|
|
225
|
+
var __defProps$w = Object.defineProperties;
|
|
226
|
+
var __getOwnPropDescs$w = Object.getOwnPropertyDescriptors;
|
|
227
|
+
var __getOwnPropSymbols$G = Object.getOwnPropertySymbols;
|
|
228
|
+
var __hasOwnProp$G = Object.prototype.hasOwnProperty;
|
|
229
|
+
var __propIsEnum$G = Object.prototype.propertyIsEnumerable;
|
|
230
|
+
var __defNormalProp$F = (obj, key, value) => key in obj ? __defProp$F(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
231
|
+
var __spreadValues$F = (a, b) => {
|
|
213
232
|
for (var prop in b || (b = {}))
|
|
214
|
-
if (__hasOwnProp$
|
|
215
|
-
__defNormalProp$
|
|
216
|
-
if (__getOwnPropSymbols$
|
|
217
|
-
for (var prop of __getOwnPropSymbols$
|
|
218
|
-
if (__propIsEnum$
|
|
219
|
-
__defNormalProp$
|
|
233
|
+
if (__hasOwnProp$G.call(b, prop))
|
|
234
|
+
__defNormalProp$F(a, prop, b[prop]);
|
|
235
|
+
if (__getOwnPropSymbols$G)
|
|
236
|
+
for (var prop of __getOwnPropSymbols$G(b)) {
|
|
237
|
+
if (__propIsEnum$G.call(b, prop))
|
|
238
|
+
__defNormalProp$F(a, prop, b[prop]);
|
|
220
239
|
}
|
|
221
240
|
return a;
|
|
222
241
|
};
|
|
223
|
-
var __spreadProps$
|
|
242
|
+
var __spreadProps$w = (a, b) => __defProps$w(a, __getOwnPropDescs$w(b));
|
|
224
243
|
function makeRowKey(rowIndex) {
|
|
225
244
|
return `row_${typeof rowIndex === "number" ? rowIndex : rowIndex.rowIndex}`;
|
|
226
245
|
}
|
|
@@ -258,7 +277,7 @@ function getDistinctors(storeId) {
|
|
|
258
277
|
focused: state.focusedRow === distinctions.rowIndex
|
|
259
278
|
}
|
|
260
279
|
},
|
|
261
|
-
etc: __spreadProps$
|
|
280
|
+
etc: __spreadProps$w(__spreadValues$F({}, state.allowSelection ? {
|
|
262
281
|
"aria-selected": state.selectedRows.includes(
|
|
263
282
|
distinctions.rowIndex
|
|
264
283
|
)
|
|
@@ -324,7 +343,7 @@ const keysMakers$1 = {
|
|
|
324
343
|
};
|
|
325
344
|
function getInitialState$1(initialState) {
|
|
326
345
|
var _a, _b, _c;
|
|
327
|
-
return __spreadProps$
|
|
346
|
+
return __spreadProps$w(__spreadValues$F(__spreadValues$F({}, defaultState), initialState), {
|
|
328
347
|
searchFunction: (_a = initialState.searchFunction) != null ? _a : (label, searchString) => !!label.match(new RegExp(searchString)),
|
|
329
348
|
startsWithFunction: (_b = initialState.startsWithFunction) != null ? _b : (label, searchString) => {
|
|
330
349
|
return label.startsWith(searchString);
|
|
@@ -388,33 +407,33 @@ const AccordionItemButton = ({ children }) => {
|
|
|
388
407
|
return /* @__PURE__ */ jsx(Fragment, { children });
|
|
389
408
|
};
|
|
390
409
|
|
|
391
|
-
var __defProp$
|
|
392
|
-
var __defProps$
|
|
393
|
-
var __getOwnPropDescs$
|
|
394
|
-
var __getOwnPropSymbols$
|
|
395
|
-
var __hasOwnProp$
|
|
396
|
-
var __propIsEnum$
|
|
397
|
-
var __defNormalProp$
|
|
398
|
-
var __spreadValues$
|
|
410
|
+
var __defProp$E = Object.defineProperty;
|
|
411
|
+
var __defProps$v = Object.defineProperties;
|
|
412
|
+
var __getOwnPropDescs$v = Object.getOwnPropertyDescriptors;
|
|
413
|
+
var __getOwnPropSymbols$F = Object.getOwnPropertySymbols;
|
|
414
|
+
var __hasOwnProp$F = Object.prototype.hasOwnProperty;
|
|
415
|
+
var __propIsEnum$F = Object.prototype.propertyIsEnumerable;
|
|
416
|
+
var __defNormalProp$E = (obj, key, value) => key in obj ? __defProp$E(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
417
|
+
var __spreadValues$E = (a, b) => {
|
|
399
418
|
for (var prop in b || (b = {}))
|
|
400
|
-
if (__hasOwnProp$
|
|
401
|
-
__defNormalProp$
|
|
402
|
-
if (__getOwnPropSymbols$
|
|
403
|
-
for (var prop of __getOwnPropSymbols$
|
|
404
|
-
if (__propIsEnum$
|
|
405
|
-
__defNormalProp$
|
|
419
|
+
if (__hasOwnProp$F.call(b, prop))
|
|
420
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
421
|
+
if (__getOwnPropSymbols$F)
|
|
422
|
+
for (var prop of __getOwnPropSymbols$F(b)) {
|
|
423
|
+
if (__propIsEnum$F.call(b, prop))
|
|
424
|
+
__defNormalProp$E(a, prop, b[prop]);
|
|
406
425
|
}
|
|
407
426
|
return a;
|
|
408
427
|
};
|
|
409
|
-
var __spreadProps$
|
|
428
|
+
var __spreadProps$v = (a, b) => __defProps$v(a, __getOwnPropDescs$v(b));
|
|
410
429
|
var __objRest$f = (source, exclude) => {
|
|
411
430
|
var target = {};
|
|
412
431
|
for (var prop in source)
|
|
413
|
-
if (__hasOwnProp$
|
|
432
|
+
if (__hasOwnProp$F.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
414
433
|
target[prop] = source[prop];
|
|
415
|
-
if (source != null && __getOwnPropSymbols$
|
|
416
|
-
for (var prop of __getOwnPropSymbols$
|
|
417
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
434
|
+
if (source != null && __getOwnPropSymbols$F)
|
|
435
|
+
for (var prop of __getOwnPropSymbols$F(source)) {
|
|
436
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$F.call(source, prop))
|
|
418
437
|
target[prop] = source[prop];
|
|
419
438
|
}
|
|
420
439
|
return target;
|
|
@@ -448,7 +467,7 @@ const BaseButton = (_a) => {
|
|
|
448
467
|
]);
|
|
449
468
|
return /* @__PURE__ */ jsx(
|
|
450
469
|
Button,
|
|
451
|
-
__spreadProps$
|
|
470
|
+
__spreadProps$v(__spreadValues$E(__spreadProps$v(__spreadValues$E({
|
|
452
471
|
id,
|
|
453
472
|
name,
|
|
454
473
|
onClick
|
|
@@ -461,7 +480,7 @@ const BaseButton = (_a) => {
|
|
|
461
480
|
Flex,
|
|
462
481
|
{
|
|
463
482
|
as: "span",
|
|
464
|
-
sx: __spreadValues$
|
|
483
|
+
sx: __spreadValues$E({
|
|
465
484
|
color: "inherit",
|
|
466
485
|
width: "100%",
|
|
467
486
|
flexDirection: "row",
|
|
@@ -483,33 +502,33 @@ const BaseButton = (_a) => {
|
|
|
483
502
|
);
|
|
484
503
|
};
|
|
485
504
|
|
|
486
|
-
var __defProp$
|
|
487
|
-
var __defProps$
|
|
488
|
-
var __getOwnPropDescs$
|
|
489
|
-
var __getOwnPropSymbols$
|
|
490
|
-
var __hasOwnProp$
|
|
491
|
-
var __propIsEnum$
|
|
492
|
-
var __defNormalProp$
|
|
493
|
-
var __spreadValues$
|
|
505
|
+
var __defProp$D = Object.defineProperty;
|
|
506
|
+
var __defProps$u = Object.defineProperties;
|
|
507
|
+
var __getOwnPropDescs$u = Object.getOwnPropertyDescriptors;
|
|
508
|
+
var __getOwnPropSymbols$E = Object.getOwnPropertySymbols;
|
|
509
|
+
var __hasOwnProp$E = Object.prototype.hasOwnProperty;
|
|
510
|
+
var __propIsEnum$E = Object.prototype.propertyIsEnumerable;
|
|
511
|
+
var __defNormalProp$D = (obj, key, value) => key in obj ? __defProp$D(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
512
|
+
var __spreadValues$D = (a, b) => {
|
|
494
513
|
for (var prop in b || (b = {}))
|
|
495
|
-
if (__hasOwnProp$
|
|
496
|
-
__defNormalProp$
|
|
497
|
-
if (__getOwnPropSymbols$
|
|
498
|
-
for (var prop of __getOwnPropSymbols$
|
|
499
|
-
if (__propIsEnum$
|
|
500
|
-
__defNormalProp$
|
|
514
|
+
if (__hasOwnProp$E.call(b, prop))
|
|
515
|
+
__defNormalProp$D(a, prop, b[prop]);
|
|
516
|
+
if (__getOwnPropSymbols$E)
|
|
517
|
+
for (var prop of __getOwnPropSymbols$E(b)) {
|
|
518
|
+
if (__propIsEnum$E.call(b, prop))
|
|
519
|
+
__defNormalProp$D(a, prop, b[prop]);
|
|
501
520
|
}
|
|
502
521
|
return a;
|
|
503
522
|
};
|
|
504
|
-
var __spreadProps$
|
|
523
|
+
var __spreadProps$u = (a, b) => __defProps$u(a, __getOwnPropDescs$u(b));
|
|
505
524
|
var __objRest$e = (source, exclude) => {
|
|
506
525
|
var target = {};
|
|
507
526
|
for (var prop in source)
|
|
508
|
-
if (__hasOwnProp$
|
|
527
|
+
if (__hasOwnProp$E.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
509
528
|
target[prop] = source[prop];
|
|
510
|
-
if (source != null && __getOwnPropSymbols$
|
|
511
|
-
for (var prop of __getOwnPropSymbols$
|
|
512
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
529
|
+
if (source != null && __getOwnPropSymbols$E)
|
|
530
|
+
for (var prop of __getOwnPropSymbols$E(source)) {
|
|
531
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$E.call(source, prop))
|
|
513
532
|
target[prop] = source[prop];
|
|
514
533
|
}
|
|
515
534
|
return target;
|
|
@@ -574,7 +593,7 @@ const IconButton = React.forwardRef(
|
|
|
574
593
|
}, [icon]);
|
|
575
594
|
return /* @__PURE__ */ jsx(
|
|
576
595
|
IconButton$1,
|
|
577
|
-
__spreadProps$
|
|
596
|
+
__spreadProps$u(__spreadValues$D(__spreadProps$u(__spreadValues$D({
|
|
578
597
|
id,
|
|
579
598
|
ref,
|
|
580
599
|
onClick: React.useCallback(
|
|
@@ -603,33 +622,33 @@ const IconButton = React.forwardRef(
|
|
|
603
622
|
);
|
|
604
623
|
IconButton.displayName = "IconButton";
|
|
605
624
|
|
|
606
|
-
var __defProp$
|
|
607
|
-
var __defProps$
|
|
608
|
-
var __getOwnPropDescs$
|
|
609
|
-
var __getOwnPropSymbols$
|
|
610
|
-
var __hasOwnProp$
|
|
611
|
-
var __propIsEnum$
|
|
612
|
-
var __defNormalProp$
|
|
613
|
-
var __spreadValues$
|
|
625
|
+
var __defProp$C = Object.defineProperty;
|
|
626
|
+
var __defProps$t = Object.defineProperties;
|
|
627
|
+
var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
|
|
628
|
+
var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
|
|
629
|
+
var __hasOwnProp$D = Object.prototype.hasOwnProperty;
|
|
630
|
+
var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
|
|
631
|
+
var __defNormalProp$C = (obj, key, value) => key in obj ? __defProp$C(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
632
|
+
var __spreadValues$C = (a, b) => {
|
|
614
633
|
for (var prop in b || (b = {}))
|
|
615
|
-
if (__hasOwnProp$
|
|
616
|
-
__defNormalProp$
|
|
617
|
-
if (__getOwnPropSymbols$
|
|
618
|
-
for (var prop of __getOwnPropSymbols$
|
|
619
|
-
if (__propIsEnum$
|
|
620
|
-
__defNormalProp$
|
|
634
|
+
if (__hasOwnProp$D.call(b, prop))
|
|
635
|
+
__defNormalProp$C(a, prop, b[prop]);
|
|
636
|
+
if (__getOwnPropSymbols$D)
|
|
637
|
+
for (var prop of __getOwnPropSymbols$D(b)) {
|
|
638
|
+
if (__propIsEnum$D.call(b, prop))
|
|
639
|
+
__defNormalProp$C(a, prop, b[prop]);
|
|
621
640
|
}
|
|
622
641
|
return a;
|
|
623
642
|
};
|
|
624
|
-
var __spreadProps$
|
|
643
|
+
var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
|
|
625
644
|
var __objRest$d = (source, exclude) => {
|
|
626
645
|
var target = {};
|
|
627
646
|
for (var prop in source)
|
|
628
|
-
if (__hasOwnProp$
|
|
647
|
+
if (__hasOwnProp$D.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
629
648
|
target[prop] = source[prop];
|
|
630
|
-
if (source != null && __getOwnPropSymbols$
|
|
631
|
-
for (var prop of __getOwnPropSymbols$
|
|
632
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
649
|
+
if (source != null && __getOwnPropSymbols$D)
|
|
650
|
+
for (var prop of __getOwnPropSymbols$D(source)) {
|
|
651
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$D.call(source, prop))
|
|
633
652
|
target[prop] = source[prop];
|
|
634
653
|
}
|
|
635
654
|
return target;
|
|
@@ -657,6 +676,7 @@ const simpleButton = {
|
|
|
657
676
|
const SimpleButton = React.forwardRef(
|
|
658
677
|
(_a, ref) => {
|
|
659
678
|
var _b = _a, {
|
|
679
|
+
buttonSx,
|
|
660
680
|
children = null,
|
|
661
681
|
className,
|
|
662
682
|
disabled = false,
|
|
@@ -674,6 +694,7 @@ const SimpleButton = React.forwardRef(
|
|
|
674
694
|
type = "button",
|
|
675
695
|
variant = "primary"
|
|
676
696
|
} = _b, buttonProps = __objRest$d(_b, [
|
|
697
|
+
"buttonSx",
|
|
677
698
|
"children",
|
|
678
699
|
"className",
|
|
679
700
|
"disabled",
|
|
@@ -713,7 +734,7 @@ const SimpleButton = React.forwardRef(
|
|
|
713
734
|
const Icon = React.useMemo(() => icon, [icon]);
|
|
714
735
|
return /* @__PURE__ */ jsxs(
|
|
715
736
|
Button,
|
|
716
|
-
__spreadProps$
|
|
737
|
+
__spreadProps$t(__spreadValues$C(__spreadValues$C({
|
|
717
738
|
ref,
|
|
718
739
|
id,
|
|
719
740
|
name,
|
|
@@ -724,7 +745,7 @@ const SimpleButton = React.forwardRef(
|
|
|
724
745
|
disabled: isLoading != null ? isLoading : disabled,
|
|
725
746
|
className
|
|
726
747
|
}, getVariant(`${variant}${size !== "md" && size ? `-${size}` : ""}`)), buttonProps), {
|
|
727
|
-
sx: simpleButton,
|
|
748
|
+
sx: __spreadValues$C(__spreadValues$C({}, simpleButton), buttonSx),
|
|
728
749
|
children: [
|
|
729
750
|
Icon && iconPosition === "left" && /* @__PURE__ */ jsx(Icon, { title: "", size: iconSize, color: iconColor }),
|
|
730
751
|
/* @__PURE__ */ jsx(Box, { as: "span", className: "button__content", sx: spanSx, children: children != null ? children : title }),
|
|
@@ -772,25 +793,25 @@ function useOtherTagButton(props) {
|
|
|
772
793
|
};
|
|
773
794
|
}
|
|
774
795
|
|
|
775
|
-
var __defProp$
|
|
776
|
-
var __defProps$
|
|
777
|
-
var __getOwnPropDescs$
|
|
778
|
-
var __getOwnPropSymbols$
|
|
779
|
-
var __hasOwnProp$
|
|
780
|
-
var __propIsEnum$
|
|
781
|
-
var __defNormalProp$
|
|
782
|
-
var __spreadValues$
|
|
796
|
+
var __defProp$B = Object.defineProperty;
|
|
797
|
+
var __defProps$s = Object.defineProperties;
|
|
798
|
+
var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
|
|
799
|
+
var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
|
|
800
|
+
var __hasOwnProp$C = Object.prototype.hasOwnProperty;
|
|
801
|
+
var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
|
|
802
|
+
var __defNormalProp$B = (obj, key, value) => key in obj ? __defProp$B(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
803
|
+
var __spreadValues$B = (a, b) => {
|
|
783
804
|
for (var prop in b || (b = {}))
|
|
784
|
-
if (__hasOwnProp$
|
|
785
|
-
__defNormalProp$
|
|
786
|
-
if (__getOwnPropSymbols$
|
|
787
|
-
for (var prop of __getOwnPropSymbols$
|
|
788
|
-
if (__propIsEnum$
|
|
789
|
-
__defNormalProp$
|
|
805
|
+
if (__hasOwnProp$C.call(b, prop))
|
|
806
|
+
__defNormalProp$B(a, prop, b[prop]);
|
|
807
|
+
if (__getOwnPropSymbols$C)
|
|
808
|
+
for (var prop of __getOwnPropSymbols$C(b)) {
|
|
809
|
+
if (__propIsEnum$C.call(b, prop))
|
|
810
|
+
__defNormalProp$B(a, prop, b[prop]);
|
|
790
811
|
}
|
|
791
812
|
return a;
|
|
792
813
|
};
|
|
793
|
-
var __spreadProps$
|
|
814
|
+
var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
|
|
794
815
|
const Captcha = ({
|
|
795
816
|
name,
|
|
796
817
|
imageUrl,
|
|
@@ -804,7 +825,7 @@ const Captcha = ({
|
|
|
804
825
|
};
|
|
805
826
|
return /* @__PURE__ */ jsxs(
|
|
806
827
|
Flex,
|
|
807
|
-
__spreadProps$
|
|
828
|
+
__spreadProps$s(__spreadValues$B({
|
|
808
829
|
sx: {
|
|
809
830
|
flexDirection: "column"
|
|
810
831
|
},
|
|
@@ -849,33 +870,33 @@ const Captcha = ({
|
|
|
849
870
|
);
|
|
850
871
|
};
|
|
851
872
|
|
|
852
|
-
var __defProp$
|
|
853
|
-
var __defProps$
|
|
854
|
-
var __getOwnPropDescs$
|
|
855
|
-
var __getOwnPropSymbols$
|
|
856
|
-
var __hasOwnProp$
|
|
857
|
-
var __propIsEnum$
|
|
858
|
-
var __defNormalProp$
|
|
859
|
-
var __spreadValues$
|
|
873
|
+
var __defProp$A = Object.defineProperty;
|
|
874
|
+
var __defProps$r = Object.defineProperties;
|
|
875
|
+
var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
|
|
876
|
+
var __getOwnPropSymbols$B = Object.getOwnPropertySymbols;
|
|
877
|
+
var __hasOwnProp$B = Object.prototype.hasOwnProperty;
|
|
878
|
+
var __propIsEnum$B = Object.prototype.propertyIsEnumerable;
|
|
879
|
+
var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
880
|
+
var __spreadValues$A = (a, b) => {
|
|
860
881
|
for (var prop in b || (b = {}))
|
|
861
|
-
if (__hasOwnProp$
|
|
862
|
-
__defNormalProp$
|
|
863
|
-
if (__getOwnPropSymbols$
|
|
864
|
-
for (var prop of __getOwnPropSymbols$
|
|
865
|
-
if (__propIsEnum$
|
|
866
|
-
__defNormalProp$
|
|
882
|
+
if (__hasOwnProp$B.call(b, prop))
|
|
883
|
+
__defNormalProp$A(a, prop, b[prop]);
|
|
884
|
+
if (__getOwnPropSymbols$B)
|
|
885
|
+
for (var prop of __getOwnPropSymbols$B(b)) {
|
|
886
|
+
if (__propIsEnum$B.call(b, prop))
|
|
887
|
+
__defNormalProp$A(a, prop, b[prop]);
|
|
867
888
|
}
|
|
868
889
|
return a;
|
|
869
890
|
};
|
|
870
|
-
var __spreadProps$
|
|
891
|
+
var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
|
|
871
892
|
var __objRest$c = (source, exclude) => {
|
|
872
893
|
var target = {};
|
|
873
894
|
for (var prop in source)
|
|
874
|
-
if (__hasOwnProp$
|
|
895
|
+
if (__hasOwnProp$B.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
875
896
|
target[prop] = source[prop];
|
|
876
|
-
if (source != null && __getOwnPropSymbols$
|
|
877
|
-
for (var prop of __getOwnPropSymbols$
|
|
878
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
897
|
+
if (source != null && __getOwnPropSymbols$B)
|
|
898
|
+
for (var prop of __getOwnPropSymbols$B(source)) {
|
|
899
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$B.call(source, prop))
|
|
879
900
|
target[prop] = source[prop];
|
|
880
901
|
}
|
|
881
902
|
return target;
|
|
@@ -937,7 +958,7 @@ const Checkbox$1 = forwardRef(
|
|
|
937
958
|
// eslint-disable-next-line react/forbid-elements
|
|
938
959
|
/* @__PURE__ */ jsx(
|
|
939
960
|
"input",
|
|
940
|
-
__spreadValues$
|
|
961
|
+
__spreadValues$A({
|
|
941
962
|
type: "checkbox",
|
|
942
963
|
onClick: props.onClick,
|
|
943
964
|
"aria-checked": isChecked,
|
|
@@ -959,7 +980,7 @@ const Checkbox$1 = forwardRef(
|
|
|
959
980
|
) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
960
981
|
/* @__PURE__ */ jsx(
|
|
961
982
|
Button,
|
|
962
|
-
__spreadProps$
|
|
983
|
+
__spreadProps$r(__spreadValues$A(__spreadProps$r(__spreadValues$A({}, props), {
|
|
963
984
|
onClick: (ev) => {
|
|
964
985
|
var _a3;
|
|
965
986
|
if (readOnly) {
|
|
@@ -1094,6 +1115,14 @@ const globalFocus = new (_a$1 = class {
|
|
|
1094
1115
|
}
|
|
1095
1116
|
}, _onFocusCallbacks = new WeakMap(), _a$1)();
|
|
1096
1117
|
|
|
1118
|
+
const ModalContext = createContext(null);
|
|
1119
|
+
function useModalContext() {
|
|
1120
|
+
const context = useContext(ModalContext);
|
|
1121
|
+
if (!context)
|
|
1122
|
+
throw new Error("There is no ModalContext");
|
|
1123
|
+
return context;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1097
1126
|
var __accessCheck$1 = (obj, member, msg) => {
|
|
1098
1127
|
if (!member.has(obj))
|
|
1099
1128
|
throw TypeError("Cannot " + msg);
|
|
@@ -1190,33 +1219,33 @@ function useBodyScrollLock(isLocked) {
|
|
|
1190
1219
|
}, [isLocked]);
|
|
1191
1220
|
}
|
|
1192
1221
|
|
|
1193
|
-
var __defProp$
|
|
1194
|
-
var __defProps$
|
|
1195
|
-
var __getOwnPropDescs$
|
|
1196
|
-
var __getOwnPropSymbols$
|
|
1197
|
-
var __hasOwnProp$
|
|
1198
|
-
var __propIsEnum$
|
|
1199
|
-
var __defNormalProp$
|
|
1200
|
-
var __spreadValues$
|
|
1222
|
+
var __defProp$z = Object.defineProperty;
|
|
1223
|
+
var __defProps$q = Object.defineProperties;
|
|
1224
|
+
var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
|
|
1225
|
+
var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
|
|
1226
|
+
var __hasOwnProp$A = Object.prototype.hasOwnProperty;
|
|
1227
|
+
var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
|
|
1228
|
+
var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1229
|
+
var __spreadValues$z = (a, b) => {
|
|
1201
1230
|
for (var prop in b || (b = {}))
|
|
1202
|
-
if (__hasOwnProp$
|
|
1203
|
-
__defNormalProp$
|
|
1204
|
-
if (__getOwnPropSymbols$
|
|
1205
|
-
for (var prop of __getOwnPropSymbols$
|
|
1206
|
-
if (__propIsEnum$
|
|
1207
|
-
__defNormalProp$
|
|
1231
|
+
if (__hasOwnProp$A.call(b, prop))
|
|
1232
|
+
__defNormalProp$z(a, prop, b[prop]);
|
|
1233
|
+
if (__getOwnPropSymbols$A)
|
|
1234
|
+
for (var prop of __getOwnPropSymbols$A(b)) {
|
|
1235
|
+
if (__propIsEnum$A.call(b, prop))
|
|
1236
|
+
__defNormalProp$z(a, prop, b[prop]);
|
|
1208
1237
|
}
|
|
1209
1238
|
return a;
|
|
1210
1239
|
};
|
|
1211
|
-
var __spreadProps$
|
|
1240
|
+
var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
|
|
1212
1241
|
var __objRest$b = (source, exclude) => {
|
|
1213
1242
|
var target = {};
|
|
1214
1243
|
for (var prop in source)
|
|
1215
|
-
if (__hasOwnProp$
|
|
1244
|
+
if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1216
1245
|
target[prop] = source[prop];
|
|
1217
|
-
if (source != null && __getOwnPropSymbols$
|
|
1218
|
-
for (var prop of __getOwnPropSymbols$
|
|
1219
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1246
|
+
if (source != null && __getOwnPropSymbols$A)
|
|
1247
|
+
for (var prop of __getOwnPropSymbols$A(source)) {
|
|
1248
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
|
|
1220
1249
|
target[prop] = source[prop];
|
|
1221
1250
|
}
|
|
1222
1251
|
return target;
|
|
@@ -1258,7 +1287,7 @@ const Overlay = React.forwardRef(
|
|
|
1258
1287
|
unmountOnExit: true,
|
|
1259
1288
|
children: /* @__PURE__ */ jsx(
|
|
1260
1289
|
Box,
|
|
1261
|
-
__spreadProps$
|
|
1290
|
+
__spreadProps$q(__spreadValues$z(__spreadProps$q(__spreadValues$z({
|
|
1262
1291
|
className: `${className} overlay`,
|
|
1263
1292
|
ref: assignRefs
|
|
1264
1293
|
}, props), {
|
|
@@ -1402,28 +1431,25 @@ const DialogHeader = ({
|
|
|
1402
1431
|
);
|
|
1403
1432
|
};
|
|
1404
1433
|
|
|
1405
|
-
var __defProp$
|
|
1406
|
-
var __defProps$
|
|
1407
|
-
var __getOwnPropDescs$
|
|
1408
|
-
var __getOwnPropSymbols$
|
|
1409
|
-
var __hasOwnProp$
|
|
1410
|
-
var __propIsEnum$
|
|
1411
|
-
var __defNormalProp$
|
|
1412
|
-
var __spreadValues$
|
|
1434
|
+
var __defProp$y = Object.defineProperty;
|
|
1435
|
+
var __defProps$p = Object.defineProperties;
|
|
1436
|
+
var __getOwnPropDescs$p = Object.getOwnPropertyDescriptors;
|
|
1437
|
+
var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
|
|
1438
|
+
var __hasOwnProp$z = Object.prototype.hasOwnProperty;
|
|
1439
|
+
var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
|
|
1440
|
+
var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1441
|
+
var __spreadValues$y = (a, b) => {
|
|
1413
1442
|
for (var prop in b || (b = {}))
|
|
1414
|
-
if (__hasOwnProp$
|
|
1415
|
-
__defNormalProp$
|
|
1416
|
-
if (__getOwnPropSymbols$
|
|
1417
|
-
for (var prop of __getOwnPropSymbols$
|
|
1418
|
-
if (__propIsEnum$
|
|
1419
|
-
__defNormalProp$
|
|
1443
|
+
if (__hasOwnProp$z.call(b, prop))
|
|
1444
|
+
__defNormalProp$y(a, prop, b[prop]);
|
|
1445
|
+
if (__getOwnPropSymbols$z)
|
|
1446
|
+
for (var prop of __getOwnPropSymbols$z(b)) {
|
|
1447
|
+
if (__propIsEnum$z.call(b, prop))
|
|
1448
|
+
__defNormalProp$y(a, prop, b[prop]);
|
|
1420
1449
|
}
|
|
1421
1450
|
return a;
|
|
1422
1451
|
};
|
|
1423
|
-
var __spreadProps$
|
|
1424
|
-
const ModalContext = React__default.createContext(
|
|
1425
|
-
{}
|
|
1426
|
-
);
|
|
1452
|
+
var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
|
|
1427
1453
|
const Modal = forwardRef(
|
|
1428
1454
|
({
|
|
1429
1455
|
animationDuration = 150,
|
|
@@ -1451,6 +1477,11 @@ const Modal = forwardRef(
|
|
|
1451
1477
|
title = "",
|
|
1452
1478
|
variant
|
|
1453
1479
|
}, ref) => {
|
|
1480
|
+
const lastTitle = useRef(title);
|
|
1481
|
+
const [innerTitle, setInnerTitle] = useState(title);
|
|
1482
|
+
if (lastTitle.current !== title && innerTitle !== title) {
|
|
1483
|
+
setInnerTitle(title);
|
|
1484
|
+
}
|
|
1454
1485
|
const [isOpenInner, setIsOpen] = useState(isOpen);
|
|
1455
1486
|
const innerId = React__default.useMemo(() => {
|
|
1456
1487
|
return `Modal${uniqueId$2()}`;
|
|
@@ -1506,7 +1537,7 @@ const Modal = forwardRef(
|
|
|
1506
1537
|
getFocusSelector(":not(.modal__closeButton)")
|
|
1507
1538
|
);
|
|
1508
1539
|
},
|
|
1509
|
-
__spreadProps$
|
|
1540
|
+
__spreadProps$p(__spreadValues$y({}, initialFocusConfiguration), { focusEvenWhenScreenLocked: true })
|
|
1510
1541
|
);
|
|
1511
1542
|
}
|
|
1512
1543
|
}
|
|
@@ -1522,8 +1553,16 @@ const Modal = forwardRef(
|
|
|
1522
1553
|
ModalContext.Provider,
|
|
1523
1554
|
{
|
|
1524
1555
|
value: React__default.useMemo(() => {
|
|
1525
|
-
return {
|
|
1526
|
-
|
|
1556
|
+
return {
|
|
1557
|
+
changeTitle: (newTitle) => {
|
|
1558
|
+
setInnerTitle(newTitle);
|
|
1559
|
+
},
|
|
1560
|
+
close: () => {
|
|
1561
|
+
closeHandler();
|
|
1562
|
+
},
|
|
1563
|
+
descriptionId: `${innerId}_Description`
|
|
1564
|
+
};
|
|
1565
|
+
}, [closeHandler, innerId]),
|
|
1527
1566
|
children: /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsx(
|
|
1528
1567
|
Overlay,
|
|
1529
1568
|
{
|
|
@@ -1546,7 +1585,7 @@ const Modal = forwardRef(
|
|
|
1546
1585
|
nodeRef,
|
|
1547
1586
|
children: /* @__PURE__ */ jsx(
|
|
1548
1587
|
Box,
|
|
1549
|
-
__spreadProps$
|
|
1588
|
+
__spreadProps$p(__spreadValues$y({
|
|
1550
1589
|
ref: nodeRef,
|
|
1551
1590
|
className: "modal__variantWrapper"
|
|
1552
1591
|
}, variant ? getVariant(variant) : {}), {
|
|
@@ -1562,7 +1601,7 @@ const Modal = forwardRef(
|
|
|
1562
1601
|
className: "modal__main",
|
|
1563
1602
|
"data-scroll-lock-scrollable": true,
|
|
1564
1603
|
sx: React__default.useMemo(() => {
|
|
1565
|
-
return __spreadValues$
|
|
1604
|
+
return __spreadValues$y({
|
|
1566
1605
|
variant: `layout.common.modals.${size}`
|
|
1567
1606
|
}, maxWidth !== void 0 ? { maxWidth } : {});
|
|
1568
1607
|
}, [maxWidth, size]),
|
|
@@ -1573,7 +1612,7 @@ const Modal = forwardRef(
|
|
|
1573
1612
|
{
|
|
1574
1613
|
className: "modal__header",
|
|
1575
1614
|
NavBar,
|
|
1576
|
-
title,
|
|
1615
|
+
title: innerTitle,
|
|
1577
1616
|
close: closeHandler,
|
|
1578
1617
|
hideCloseButton,
|
|
1579
1618
|
id: `${innerId}_Header`
|
|
@@ -1602,33 +1641,33 @@ const Modal = forwardRef(
|
|
|
1602
1641
|
);
|
|
1603
1642
|
Modal.displayName = "Modal";
|
|
1604
1643
|
|
|
1605
|
-
var __defProp$
|
|
1606
|
-
var __defProps$
|
|
1607
|
-
var __getOwnPropDescs$
|
|
1608
|
-
var __getOwnPropSymbols$
|
|
1609
|
-
var __hasOwnProp$
|
|
1610
|
-
var __propIsEnum$
|
|
1611
|
-
var __defNormalProp$
|
|
1612
|
-
var __spreadValues$
|
|
1644
|
+
var __defProp$x = Object.defineProperty;
|
|
1645
|
+
var __defProps$o = Object.defineProperties;
|
|
1646
|
+
var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
|
|
1647
|
+
var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
|
|
1648
|
+
var __hasOwnProp$y = Object.prototype.hasOwnProperty;
|
|
1649
|
+
var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
|
|
1650
|
+
var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1651
|
+
var __spreadValues$x = (a, b) => {
|
|
1613
1652
|
for (var prop in b || (b = {}))
|
|
1614
|
-
if (__hasOwnProp$
|
|
1615
|
-
__defNormalProp$
|
|
1616
|
-
if (__getOwnPropSymbols$
|
|
1617
|
-
for (var prop of __getOwnPropSymbols$
|
|
1618
|
-
if (__propIsEnum$
|
|
1619
|
-
__defNormalProp$
|
|
1653
|
+
if (__hasOwnProp$y.call(b, prop))
|
|
1654
|
+
__defNormalProp$x(a, prop, b[prop]);
|
|
1655
|
+
if (__getOwnPropSymbols$y)
|
|
1656
|
+
for (var prop of __getOwnPropSymbols$y(b)) {
|
|
1657
|
+
if (__propIsEnum$y.call(b, prop))
|
|
1658
|
+
__defNormalProp$x(a, prop, b[prop]);
|
|
1620
1659
|
}
|
|
1621
1660
|
return a;
|
|
1622
1661
|
};
|
|
1623
|
-
var __spreadProps$
|
|
1662
|
+
var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
|
|
1624
1663
|
var __objRest$a = (source, exclude) => {
|
|
1625
1664
|
var target = {};
|
|
1626
1665
|
for (var prop in source)
|
|
1627
|
-
if (__hasOwnProp$
|
|
1666
|
+
if (__hasOwnProp$y.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
1628
1667
|
target[prop] = source[prop];
|
|
1629
|
-
if (source != null && __getOwnPropSymbols$
|
|
1630
|
-
for (var prop of __getOwnPropSymbols$
|
|
1631
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
1668
|
+
if (source != null && __getOwnPropSymbols$y)
|
|
1669
|
+
for (var prop of __getOwnPropSymbols$y(source)) {
|
|
1670
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$y.call(source, prop))
|
|
1632
1671
|
target[prop] = source[prop];
|
|
1633
1672
|
}
|
|
1634
1673
|
return target;
|
|
@@ -1638,7 +1677,7 @@ const CalendarModal = React__default.forwardRef(
|
|
|
1638
1677
|
var _b = _a, { handleClickDay, onCancel, calValue, locale, size } = _b, props = __objRest$a(_b, ["handleClickDay", "onCancel", "calValue", "locale", "size"]);
|
|
1639
1678
|
return /* @__PURE__ */ jsx(
|
|
1640
1679
|
Modal,
|
|
1641
|
-
__spreadProps$
|
|
1680
|
+
__spreadProps$o(__spreadValues$x({
|
|
1642
1681
|
noHeader: true,
|
|
1643
1682
|
size: size != null ? size : "cal",
|
|
1644
1683
|
shouldCloseOnEsc: true,
|
|
@@ -1668,25 +1707,25 @@ const CalendarModal = React__default.forwardRef(
|
|
|
1668
1707
|
);
|
|
1669
1708
|
CalendarModal.displayName = "CalendarModal";
|
|
1670
1709
|
|
|
1671
|
-
var __defProp$
|
|
1672
|
-
var __defProps$
|
|
1673
|
-
var __getOwnPropDescs$
|
|
1674
|
-
var __getOwnPropSymbols$
|
|
1675
|
-
var __hasOwnProp$
|
|
1676
|
-
var __propIsEnum$
|
|
1677
|
-
var __defNormalProp$
|
|
1678
|
-
var __spreadValues$
|
|
1710
|
+
var __defProp$w = Object.defineProperty;
|
|
1711
|
+
var __defProps$n = Object.defineProperties;
|
|
1712
|
+
var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
|
|
1713
|
+
var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
|
|
1714
|
+
var __hasOwnProp$x = Object.prototype.hasOwnProperty;
|
|
1715
|
+
var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
|
|
1716
|
+
var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1717
|
+
var __spreadValues$w = (a, b) => {
|
|
1679
1718
|
for (var prop in b || (b = {}))
|
|
1680
|
-
if (__hasOwnProp$
|
|
1681
|
-
__defNormalProp$
|
|
1682
|
-
if (__getOwnPropSymbols$
|
|
1683
|
-
for (var prop of __getOwnPropSymbols$
|
|
1684
|
-
if (__propIsEnum$
|
|
1685
|
-
__defNormalProp$
|
|
1719
|
+
if (__hasOwnProp$x.call(b, prop))
|
|
1720
|
+
__defNormalProp$w(a, prop, b[prop]);
|
|
1721
|
+
if (__getOwnPropSymbols$x)
|
|
1722
|
+
for (var prop of __getOwnPropSymbols$x(b)) {
|
|
1723
|
+
if (__propIsEnum$x.call(b, prop))
|
|
1724
|
+
__defNormalProp$w(a, prop, b[prop]);
|
|
1686
1725
|
}
|
|
1687
1726
|
return a;
|
|
1688
1727
|
};
|
|
1689
|
-
var __spreadProps$
|
|
1728
|
+
var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
|
|
1690
1729
|
function useModal(configuration) {
|
|
1691
1730
|
var _a, _b, _c;
|
|
1692
1731
|
const [isLoading, setIsLoading] = React__default.useState(false);
|
|
@@ -1697,7 +1736,7 @@ function useModal(configuration) {
|
|
|
1697
1736
|
Portal,
|
|
1698
1737
|
hide: hidePortal,
|
|
1699
1738
|
show: showPortal
|
|
1700
|
-
} = usePortal(__spreadProps$
|
|
1739
|
+
} = usePortal(__spreadProps$n(__spreadValues$w({}, configuration == null ? void 0 : configuration.portalArgs), {
|
|
1701
1740
|
containerId: "AppModals",
|
|
1702
1741
|
autoRemoveContainer: false,
|
|
1703
1742
|
escToHide: false,
|
|
@@ -1754,32 +1793,32 @@ function useModal(configuration) {
|
|
|
1754
1793
|
};
|
|
1755
1794
|
}
|
|
1756
1795
|
|
|
1757
|
-
var __defProp$
|
|
1758
|
-
var __defProps$
|
|
1759
|
-
var __getOwnPropDescs$
|
|
1760
|
-
var __getOwnPropSymbols$
|
|
1761
|
-
var __hasOwnProp$
|
|
1762
|
-
var __propIsEnum$
|
|
1763
|
-
var __defNormalProp$
|
|
1764
|
-
var __spreadValues$
|
|
1796
|
+
var __defProp$v = Object.defineProperty;
|
|
1797
|
+
var __defProps$m = Object.defineProperties;
|
|
1798
|
+
var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
|
|
1799
|
+
var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
|
|
1800
|
+
var __hasOwnProp$w = Object.prototype.hasOwnProperty;
|
|
1801
|
+
var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
|
|
1802
|
+
var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1803
|
+
var __spreadValues$v = (a, b) => {
|
|
1765
1804
|
for (var prop in b || (b = {}))
|
|
1766
|
-
if (__hasOwnProp$
|
|
1767
|
-
__defNormalProp$
|
|
1768
|
-
if (__getOwnPropSymbols$
|
|
1769
|
-
for (var prop of __getOwnPropSymbols$
|
|
1770
|
-
if (__propIsEnum$
|
|
1771
|
-
__defNormalProp$
|
|
1805
|
+
if (__hasOwnProp$w.call(b, prop))
|
|
1806
|
+
__defNormalProp$v(a, prop, b[prop]);
|
|
1807
|
+
if (__getOwnPropSymbols$w)
|
|
1808
|
+
for (var prop of __getOwnPropSymbols$w(b)) {
|
|
1809
|
+
if (__propIsEnum$w.call(b, prop))
|
|
1810
|
+
__defNormalProp$v(a, prop, b[prop]);
|
|
1772
1811
|
}
|
|
1773
1812
|
return a;
|
|
1774
1813
|
};
|
|
1775
|
-
var __spreadProps$
|
|
1814
|
+
var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
|
|
1776
1815
|
const DialogButtonBar = ({
|
|
1777
1816
|
children,
|
|
1778
1817
|
className
|
|
1779
1818
|
}) => {
|
|
1780
1819
|
return /* @__PURE__ */ jsx(
|
|
1781
1820
|
Box,
|
|
1782
|
-
__spreadProps$
|
|
1821
|
+
__spreadProps$m(__spreadValues$v({
|
|
1783
1822
|
className: `${className != null ? className : ""} buttonsBar`
|
|
1784
1823
|
}, getVariant("layout.common.modals.buttonsBar")), {
|
|
1785
1824
|
children
|
|
@@ -1787,25 +1826,25 @@ const DialogButtonBar = ({
|
|
|
1787
1826
|
);
|
|
1788
1827
|
};
|
|
1789
1828
|
|
|
1790
|
-
var __defProp$
|
|
1791
|
-
var __defProps$
|
|
1792
|
-
var __getOwnPropDescs$
|
|
1793
|
-
var __getOwnPropSymbols$
|
|
1794
|
-
var __hasOwnProp$
|
|
1795
|
-
var __propIsEnum$
|
|
1796
|
-
var __defNormalProp$
|
|
1797
|
-
var __spreadValues$
|
|
1829
|
+
var __defProp$u = Object.defineProperty;
|
|
1830
|
+
var __defProps$l = Object.defineProperties;
|
|
1831
|
+
var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
|
|
1832
|
+
var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
|
|
1833
|
+
var __hasOwnProp$v = Object.prototype.hasOwnProperty;
|
|
1834
|
+
var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
|
|
1835
|
+
var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1836
|
+
var __spreadValues$u = (a, b) => {
|
|
1798
1837
|
for (var prop in b || (b = {}))
|
|
1799
|
-
if (__hasOwnProp$
|
|
1800
|
-
__defNormalProp$
|
|
1801
|
-
if (__getOwnPropSymbols$
|
|
1802
|
-
for (var prop of __getOwnPropSymbols$
|
|
1803
|
-
if (__propIsEnum$
|
|
1804
|
-
__defNormalProp$
|
|
1838
|
+
if (__hasOwnProp$v.call(b, prop))
|
|
1839
|
+
__defNormalProp$u(a, prop, b[prop]);
|
|
1840
|
+
if (__getOwnPropSymbols$v)
|
|
1841
|
+
for (var prop of __getOwnPropSymbols$v(b)) {
|
|
1842
|
+
if (__propIsEnum$v.call(b, prop))
|
|
1843
|
+
__defNormalProp$u(a, prop, b[prop]);
|
|
1805
1844
|
}
|
|
1806
1845
|
return a;
|
|
1807
1846
|
};
|
|
1808
|
-
var __spreadProps$
|
|
1847
|
+
var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
|
|
1809
1848
|
const Confirm = ({
|
|
1810
1849
|
children,
|
|
1811
1850
|
additionalButtons,
|
|
@@ -1823,10 +1862,10 @@ const Confirm = ({
|
|
|
1823
1862
|
onConfirm,
|
|
1824
1863
|
variant
|
|
1825
1864
|
}) => {
|
|
1826
|
-
const { descriptionId } =
|
|
1865
|
+
const { descriptionId } = useModalContext();
|
|
1827
1866
|
return /* @__PURE__ */ jsxs(
|
|
1828
1867
|
Box,
|
|
1829
|
-
__spreadProps$
|
|
1868
|
+
__spreadProps$l(__spreadValues$u({}, getVariant(variant != null ? variant : "layout.common.modals.confirm")), {
|
|
1830
1869
|
className: `${className != null ? className : ""} confirm`,
|
|
1831
1870
|
children: [
|
|
1832
1871
|
/* @__PURE__ */ jsx(Box, { ref: contentRef, className: "confirm__content", id: descriptionId, children }),
|
|
@@ -1875,7 +1914,7 @@ const Confirm = ({
|
|
|
1875
1914
|
),
|
|
1876
1915
|
onCancel && !hideCancelButton && /* @__PURE__ */ jsx(
|
|
1877
1916
|
SimpleButton,
|
|
1878
|
-
__spreadProps$
|
|
1917
|
+
__spreadProps$l(__spreadValues$u({
|
|
1879
1918
|
onClick: onCancel,
|
|
1880
1919
|
title: cancelText
|
|
1881
1920
|
}, getVariant("secondary")), {
|
|
@@ -1917,25 +1956,25 @@ const LinearLoader = () => {
|
|
|
1917
1956
|
);
|
|
1918
1957
|
};
|
|
1919
1958
|
|
|
1920
|
-
var __defProp$
|
|
1921
|
-
var __defProps$
|
|
1922
|
-
var __getOwnPropDescs$
|
|
1923
|
-
var __getOwnPropSymbols$
|
|
1924
|
-
var __hasOwnProp$
|
|
1925
|
-
var __propIsEnum$
|
|
1926
|
-
var __defNormalProp$
|
|
1927
|
-
var __spreadValues$
|
|
1959
|
+
var __defProp$t = Object.defineProperty;
|
|
1960
|
+
var __defProps$k = Object.defineProperties;
|
|
1961
|
+
var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
|
|
1962
|
+
var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
|
|
1963
|
+
var __hasOwnProp$u = Object.prototype.hasOwnProperty;
|
|
1964
|
+
var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
|
|
1965
|
+
var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1966
|
+
var __spreadValues$t = (a, b) => {
|
|
1928
1967
|
for (var prop in b || (b = {}))
|
|
1929
|
-
if (__hasOwnProp$
|
|
1930
|
-
__defNormalProp$
|
|
1931
|
-
if (__getOwnPropSymbols$
|
|
1932
|
-
for (var prop of __getOwnPropSymbols$
|
|
1933
|
-
if (__propIsEnum$
|
|
1934
|
-
__defNormalProp$
|
|
1968
|
+
if (__hasOwnProp$u.call(b, prop))
|
|
1969
|
+
__defNormalProp$t(a, prop, b[prop]);
|
|
1970
|
+
if (__getOwnPropSymbols$u)
|
|
1971
|
+
for (var prop of __getOwnPropSymbols$u(b)) {
|
|
1972
|
+
if (__propIsEnum$u.call(b, prop))
|
|
1973
|
+
__defNormalProp$t(a, prop, b[prop]);
|
|
1935
1974
|
}
|
|
1936
1975
|
return a;
|
|
1937
1976
|
};
|
|
1938
|
-
var __spreadProps$
|
|
1977
|
+
var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
|
|
1939
1978
|
const ScreenLock = () => {
|
|
1940
1979
|
const ref = React__default.useRef(null);
|
|
1941
1980
|
const [hasReleasedFirstTime, setHasReleasedFirstTime] = useState(false);
|
|
@@ -1948,11 +1987,11 @@ const ScreenLock = () => {
|
|
|
1948
1987
|
React__default.useEffect(() => {
|
|
1949
1988
|
const suscriptions = [
|
|
1950
1989
|
screenLocker.on("lockStateChange", (ev) => {
|
|
1951
|
-
setLocks((current) => __spreadProps$
|
|
1990
|
+
setLocks((current) => __spreadProps$k(__spreadValues$t({}, current), { [ev.lockName]: ev.isLocked }));
|
|
1952
1991
|
setHasReleasedFirstTime(ev.hasReleasedFirstTime);
|
|
1953
1992
|
}),
|
|
1954
1993
|
screenLocker.on("forcedStateChange", (ev) => {
|
|
1955
|
-
setLocks((current) => __spreadProps$
|
|
1994
|
+
setLocks((current) => __spreadProps$k(__spreadValues$t({}, current), { forced: ev.isForced }));
|
|
1956
1995
|
setHasReleasedFirstTime(ev.hasReleasedFirstTime);
|
|
1957
1996
|
})
|
|
1958
1997
|
];
|
|
@@ -2015,33 +2054,33 @@ const FieldErrorMessage = ({ children, name }) => {
|
|
|
2015
2054
|
return null;
|
|
2016
2055
|
};
|
|
2017
2056
|
|
|
2018
|
-
var __defProp$
|
|
2019
|
-
var __defProps$
|
|
2020
|
-
var __getOwnPropDescs$
|
|
2021
|
-
var __getOwnPropSymbols$
|
|
2022
|
-
var __hasOwnProp$
|
|
2023
|
-
var __propIsEnum$
|
|
2024
|
-
var __defNormalProp$
|
|
2025
|
-
var __spreadValues$
|
|
2057
|
+
var __defProp$s = Object.defineProperty;
|
|
2058
|
+
var __defProps$j = Object.defineProperties;
|
|
2059
|
+
var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
|
|
2060
|
+
var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
|
|
2061
|
+
var __hasOwnProp$t = Object.prototype.hasOwnProperty;
|
|
2062
|
+
var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
|
|
2063
|
+
var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2064
|
+
var __spreadValues$s = (a, b) => {
|
|
2026
2065
|
for (var prop in b || (b = {}))
|
|
2027
|
-
if (__hasOwnProp$
|
|
2028
|
-
__defNormalProp$
|
|
2029
|
-
if (__getOwnPropSymbols$
|
|
2030
|
-
for (var prop of __getOwnPropSymbols$
|
|
2031
|
-
if (__propIsEnum$
|
|
2032
|
-
__defNormalProp$
|
|
2066
|
+
if (__hasOwnProp$t.call(b, prop))
|
|
2067
|
+
__defNormalProp$s(a, prop, b[prop]);
|
|
2068
|
+
if (__getOwnPropSymbols$t)
|
|
2069
|
+
for (var prop of __getOwnPropSymbols$t(b)) {
|
|
2070
|
+
if (__propIsEnum$t.call(b, prop))
|
|
2071
|
+
__defNormalProp$s(a, prop, b[prop]);
|
|
2033
2072
|
}
|
|
2034
2073
|
return a;
|
|
2035
2074
|
};
|
|
2036
|
-
var __spreadProps$
|
|
2075
|
+
var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
|
|
2037
2076
|
var __objRest$9 = (source, exclude) => {
|
|
2038
2077
|
var target = {};
|
|
2039
2078
|
for (var prop in source)
|
|
2040
|
-
if (__hasOwnProp$
|
|
2079
|
+
if (__hasOwnProp$t.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2041
2080
|
target[prop] = source[prop];
|
|
2042
|
-
if (source != null && __getOwnPropSymbols$
|
|
2043
|
-
for (var prop of __getOwnPropSymbols$
|
|
2044
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
2081
|
+
if (source != null && __getOwnPropSymbols$t)
|
|
2082
|
+
for (var prop of __getOwnPropSymbols$t(source)) {
|
|
2083
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$t.call(source, prop))
|
|
2045
2084
|
target[prop] = source[prop];
|
|
2046
2085
|
}
|
|
2047
2086
|
return target;
|
|
@@ -2098,25 +2137,25 @@ const IconInput = (_a) => {
|
|
|
2098
2137
|
);
|
|
2099
2138
|
return /* @__PURE__ */ jsxs(
|
|
2100
2139
|
Box,
|
|
2101
|
-
__spreadProps$
|
|
2140
|
+
__spreadProps$j(__spreadValues$s({}, getVariant("forms.iconInput")), {
|
|
2102
2141
|
className: `${className != null ? className : ""} iconInput`,
|
|
2103
2142
|
ref: parentRef,
|
|
2104
2143
|
onBlur: handleBlur,
|
|
2105
2144
|
children: [
|
|
2106
2145
|
/* @__PURE__ */ jsx(
|
|
2107
2146
|
Input,
|
|
2108
|
-
__spreadValues$
|
|
2147
|
+
__spreadValues$s(__spreadValues$s({
|
|
2109
2148
|
disabled: isLoading != null ? isLoading : disabled,
|
|
2110
2149
|
ref: assignInputRef,
|
|
2111
2150
|
readOnly,
|
|
2112
|
-
sx: __spreadValues$
|
|
2151
|
+
sx: __spreadValues$s({ variant: "forms.input" }, inputSx),
|
|
2113
2152
|
"data-variant": "forms.input"
|
|
2114
2153
|
}, rest), actualInputProps)
|
|
2115
2154
|
),
|
|
2116
2155
|
additionalButtonsPosition === "before" && additionalButtons,
|
|
2117
2156
|
!hideButton && /* @__PURE__ */ jsx(
|
|
2118
2157
|
IconButton,
|
|
2119
|
-
__spreadValues$
|
|
2158
|
+
__spreadValues$s({
|
|
2120
2159
|
onClick,
|
|
2121
2160
|
icon,
|
|
2122
2161
|
disabled: readOnly != null ? readOnly : disabled,
|
|
@@ -2145,33 +2184,33 @@ const getFieldTouchedStyles = (isTouched) => {
|
|
|
2145
2184
|
};
|
|
2146
2185
|
};
|
|
2147
2186
|
|
|
2148
|
-
var __defProp$
|
|
2149
|
-
var __defProps$
|
|
2150
|
-
var __getOwnPropDescs$
|
|
2151
|
-
var __getOwnPropSymbols$
|
|
2152
|
-
var __hasOwnProp$
|
|
2153
|
-
var __propIsEnum$
|
|
2154
|
-
var __defNormalProp$
|
|
2155
|
-
var __spreadValues$
|
|
2187
|
+
var __defProp$r = Object.defineProperty;
|
|
2188
|
+
var __defProps$i = Object.defineProperties;
|
|
2189
|
+
var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
|
|
2190
|
+
var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
|
|
2191
|
+
var __hasOwnProp$s = Object.prototype.hasOwnProperty;
|
|
2192
|
+
var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
|
|
2193
|
+
var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2194
|
+
var __spreadValues$r = (a, b) => {
|
|
2156
2195
|
for (var prop in b || (b = {}))
|
|
2157
|
-
if (__hasOwnProp$
|
|
2158
|
-
__defNormalProp$
|
|
2159
|
-
if (__getOwnPropSymbols$
|
|
2160
|
-
for (var prop of __getOwnPropSymbols$
|
|
2161
|
-
if (__propIsEnum$
|
|
2162
|
-
__defNormalProp$
|
|
2196
|
+
if (__hasOwnProp$s.call(b, prop))
|
|
2197
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
2198
|
+
if (__getOwnPropSymbols$s)
|
|
2199
|
+
for (var prop of __getOwnPropSymbols$s(b)) {
|
|
2200
|
+
if (__propIsEnum$s.call(b, prop))
|
|
2201
|
+
__defNormalProp$r(a, prop, b[prop]);
|
|
2163
2202
|
}
|
|
2164
2203
|
return a;
|
|
2165
2204
|
};
|
|
2166
|
-
var __spreadProps$
|
|
2205
|
+
var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
|
|
2167
2206
|
var __objRest$8 = (source, exclude) => {
|
|
2168
2207
|
var target = {};
|
|
2169
2208
|
for (var prop in source)
|
|
2170
|
-
if (__hasOwnProp$
|
|
2209
|
+
if (__hasOwnProp$s.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2171
2210
|
target[prop] = source[prop];
|
|
2172
|
-
if (source != null && __getOwnPropSymbols$
|
|
2173
|
-
for (var prop of __getOwnPropSymbols$
|
|
2174
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
2211
|
+
if (source != null && __getOwnPropSymbols$s)
|
|
2212
|
+
for (var prop of __getOwnPropSymbols$s(source)) {
|
|
2213
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$s.call(source, prop))
|
|
2175
2214
|
target[prop] = source[prop];
|
|
2176
2215
|
}
|
|
2177
2216
|
return target;
|
|
@@ -2319,7 +2358,7 @@ const DateInput = React__default.forwardRef(
|
|
|
2319
2358
|
[id, onBlur]
|
|
2320
2359
|
);
|
|
2321
2360
|
const inputProps = React__default.useMemo(
|
|
2322
|
-
() => __spreadProps$
|
|
2361
|
+
() => __spreadProps$i(__spreadValues$r({}, props), {
|
|
2323
2362
|
className: "dateInput",
|
|
2324
2363
|
value: renderLabel ? renderLabel(inputValue) : inputValue,
|
|
2325
2364
|
ref,
|
|
@@ -2351,7 +2390,7 @@ const DateInput = React__default.forwardRef(
|
|
|
2351
2390
|
const buttonProps = React__default.useMemo(
|
|
2352
2391
|
() => {
|
|
2353
2392
|
var _a3;
|
|
2354
|
-
return __spreadValues$
|
|
2393
|
+
return __spreadValues$r({
|
|
2355
2394
|
disabled: (_a3 = props.disabled) != null ? _a3 : props.readOnly,
|
|
2356
2395
|
"aria-label": window.LBL_PICK_DATE
|
|
2357
2396
|
}, outerButtonProps);
|
|
@@ -2379,7 +2418,7 @@ const DateInput = React__default.forwardRef(
|
|
|
2379
2418
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2380
2419
|
/* @__PURE__ */ jsx(
|
|
2381
2420
|
CalendarModal,
|
|
2382
|
-
__spreadProps$
|
|
2421
|
+
__spreadProps$i(__spreadValues$r({}, modalProps), {
|
|
2383
2422
|
calValue,
|
|
2384
2423
|
locale: DEFAULT_LOCALE,
|
|
2385
2424
|
handleClickDay: selectDate,
|
|
@@ -2389,7 +2428,7 @@ const DateInput = React__default.forwardRef(
|
|
|
2389
2428
|
),
|
|
2390
2429
|
/* @__PURE__ */ jsxs(
|
|
2391
2430
|
Box,
|
|
2392
|
-
__spreadProps$
|
|
2431
|
+
__spreadProps$i(__spreadValues$r({}, getVariant("forms.dateInput")), {
|
|
2393
2432
|
className: `${className != null ? className : ""} dateInput`,
|
|
2394
2433
|
id: `DateInput${id}`,
|
|
2395
2434
|
ref: boxRef,
|
|
@@ -2422,33 +2461,33 @@ const DateInput = React__default.forwardRef(
|
|
|
2422
2461
|
);
|
|
2423
2462
|
DateInput.displayName = "DateInput";
|
|
2424
2463
|
|
|
2425
|
-
var __defProp$
|
|
2426
|
-
var __defProps$
|
|
2427
|
-
var __getOwnPropDescs$
|
|
2428
|
-
var __getOwnPropSymbols$
|
|
2429
|
-
var __hasOwnProp$
|
|
2430
|
-
var __propIsEnum$
|
|
2431
|
-
var __defNormalProp$
|
|
2432
|
-
var __spreadValues$
|
|
2464
|
+
var __defProp$q = Object.defineProperty;
|
|
2465
|
+
var __defProps$h = Object.defineProperties;
|
|
2466
|
+
var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
|
|
2467
|
+
var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
|
|
2468
|
+
var __hasOwnProp$r = Object.prototype.hasOwnProperty;
|
|
2469
|
+
var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
|
|
2470
|
+
var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2471
|
+
var __spreadValues$q = (a, b) => {
|
|
2433
2472
|
for (var prop in b || (b = {}))
|
|
2434
|
-
if (__hasOwnProp$
|
|
2435
|
-
__defNormalProp$
|
|
2436
|
-
if (__getOwnPropSymbols$
|
|
2437
|
-
for (var prop of __getOwnPropSymbols$
|
|
2438
|
-
if (__propIsEnum$
|
|
2439
|
-
__defNormalProp$
|
|
2473
|
+
if (__hasOwnProp$r.call(b, prop))
|
|
2474
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
2475
|
+
if (__getOwnPropSymbols$r)
|
|
2476
|
+
for (var prop of __getOwnPropSymbols$r(b)) {
|
|
2477
|
+
if (__propIsEnum$r.call(b, prop))
|
|
2478
|
+
__defNormalProp$q(a, prop, b[prop]);
|
|
2440
2479
|
}
|
|
2441
2480
|
return a;
|
|
2442
2481
|
};
|
|
2443
|
-
var __spreadProps$
|
|
2482
|
+
var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
|
|
2444
2483
|
var __objRest$7 = (source, exclude) => {
|
|
2445
2484
|
var target = {};
|
|
2446
2485
|
for (var prop in source)
|
|
2447
|
-
if (__hasOwnProp$
|
|
2486
|
+
if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2448
2487
|
target[prop] = source[prop];
|
|
2449
|
-
if (source != null && __getOwnPropSymbols$
|
|
2450
|
-
for (var prop of __getOwnPropSymbols$
|
|
2451
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
2488
|
+
if (source != null && __getOwnPropSymbols$r)
|
|
2489
|
+
for (var prop of __getOwnPropSymbols$r(source)) {
|
|
2490
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
|
|
2452
2491
|
target[prop] = source[prop];
|
|
2453
2492
|
}
|
|
2454
2493
|
return target;
|
|
@@ -2568,7 +2607,7 @@ const NumberInput = React__default.forwardRef(
|
|
|
2568
2607
|
}, [value]);
|
|
2569
2608
|
return /* @__PURE__ */ jsx(
|
|
2570
2609
|
Input,
|
|
2571
|
-
__spreadProps$
|
|
2610
|
+
__spreadProps$h(__spreadValues$q({}, props), {
|
|
2572
2611
|
onFocus: React__default.useCallback(
|
|
2573
2612
|
(ev) => {
|
|
2574
2613
|
var _a2;
|
|
@@ -2608,33 +2647,33 @@ const RequiredMark = ({
|
|
|
2608
2647
|
return isRequired && !isReadonly && !isFormReadonly ? /* @__PURE__ */ jsx("abbr", { className: "requiredMark", title: getLabel("msgReqField").text, children: "*" }) : null;
|
|
2609
2648
|
};
|
|
2610
2649
|
|
|
2611
|
-
var __defProp$
|
|
2612
|
-
var __defProps$
|
|
2613
|
-
var __getOwnPropDescs$
|
|
2614
|
-
var __getOwnPropSymbols$
|
|
2615
|
-
var __hasOwnProp$
|
|
2616
|
-
var __propIsEnum$
|
|
2617
|
-
var __defNormalProp$
|
|
2618
|
-
var __spreadValues$
|
|
2650
|
+
var __defProp$p = Object.defineProperty;
|
|
2651
|
+
var __defProps$g = Object.defineProperties;
|
|
2652
|
+
var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
|
|
2653
|
+
var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
|
|
2654
|
+
var __hasOwnProp$q = Object.prototype.hasOwnProperty;
|
|
2655
|
+
var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
|
|
2656
|
+
var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2657
|
+
var __spreadValues$p = (a, b) => {
|
|
2619
2658
|
for (var prop in b || (b = {}))
|
|
2620
|
-
if (__hasOwnProp$
|
|
2621
|
-
__defNormalProp$
|
|
2622
|
-
if (__getOwnPropSymbols$
|
|
2623
|
-
for (var prop of __getOwnPropSymbols$
|
|
2624
|
-
if (__propIsEnum$
|
|
2625
|
-
__defNormalProp$
|
|
2659
|
+
if (__hasOwnProp$q.call(b, prop))
|
|
2660
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
2661
|
+
if (__getOwnPropSymbols$q)
|
|
2662
|
+
for (var prop of __getOwnPropSymbols$q(b)) {
|
|
2663
|
+
if (__propIsEnum$q.call(b, prop))
|
|
2664
|
+
__defNormalProp$p(a, prop, b[prop]);
|
|
2626
2665
|
}
|
|
2627
2666
|
return a;
|
|
2628
2667
|
};
|
|
2629
|
-
var __spreadProps$
|
|
2668
|
+
var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
|
|
2630
2669
|
var __objRest$6 = (source, exclude) => {
|
|
2631
2670
|
var target = {};
|
|
2632
2671
|
for (var prop in source)
|
|
2633
|
-
if (__hasOwnProp$
|
|
2672
|
+
if (__hasOwnProp$q.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
2634
2673
|
target[prop] = source[prop];
|
|
2635
|
-
if (source != null && __getOwnPropSymbols$
|
|
2636
|
-
for (var prop of __getOwnPropSymbols$
|
|
2637
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum$
|
|
2674
|
+
if (source != null && __getOwnPropSymbols$q)
|
|
2675
|
+
for (var prop of __getOwnPropSymbols$q(source)) {
|
|
2676
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$q.call(source, prop))
|
|
2638
2677
|
target[prop] = source[prop];
|
|
2639
2678
|
}
|
|
2640
2679
|
return target;
|
|
@@ -2671,7 +2710,7 @@ const FieldLabel = forwardRef(
|
|
|
2671
2710
|
var _a2, _b2;
|
|
2672
2711
|
return /* @__PURE__ */ jsxs(
|
|
2673
2712
|
Box,
|
|
2674
|
-
__spreadProps$
|
|
2713
|
+
__spreadProps$g(__spreadValues$p(__spreadProps$g(__spreadValues$p({
|
|
2675
2714
|
as: as != null ? as : "label"
|
|
2676
2715
|
}, props), {
|
|
2677
2716
|
className: `fieldLabel ${(_a2 = props.className) != null ? _a2 : ""}`
|
|
@@ -2818,7 +2857,7 @@ const AutoEllipsis = ({
|
|
|
2818
2857
|
const cloneBounding = clone.current.getBoundingClientRect();
|
|
2819
2858
|
const difX = Math.abs(cloneBounding.width - bound.width);
|
|
2820
2859
|
const difY = Math.abs(cloneBounding.height - bound.height);
|
|
2821
|
-
if (difX <
|
|
2860
|
+
if (difX < 50 && difY < 30) {
|
|
2822
2861
|
clone.current.remove();
|
|
2823
2862
|
}
|
|
2824
2863
|
}
|
|
@@ -2861,25 +2900,25 @@ const AutoEllipsis = ({
|
|
|
2861
2900
|
);
|
|
2862
2901
|
};
|
|
2863
2902
|
|
|
2864
|
-
var __defProp$
|
|
2865
|
-
var __defProps$
|
|
2866
|
-
var __getOwnPropDescs$
|
|
2867
|
-
var __getOwnPropSymbols$
|
|
2868
|
-
var __hasOwnProp$
|
|
2869
|
-
var __propIsEnum$
|
|
2870
|
-
var __defNormalProp$
|
|
2871
|
-
var __spreadValues$
|
|
2903
|
+
var __defProp$o = Object.defineProperty;
|
|
2904
|
+
var __defProps$f = Object.defineProperties;
|
|
2905
|
+
var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
|
|
2906
|
+
var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
|
|
2907
|
+
var __hasOwnProp$p = Object.prototype.hasOwnProperty;
|
|
2908
|
+
var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
|
|
2909
|
+
var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2910
|
+
var __spreadValues$o = (a, b) => {
|
|
2872
2911
|
for (var prop in b || (b = {}))
|
|
2873
|
-
if (__hasOwnProp$
|
|
2874
|
-
__defNormalProp$
|
|
2875
|
-
if (__getOwnPropSymbols$
|
|
2876
|
-
for (var prop of __getOwnPropSymbols$
|
|
2877
|
-
if (__propIsEnum$
|
|
2878
|
-
__defNormalProp$
|
|
2912
|
+
if (__hasOwnProp$p.call(b, prop))
|
|
2913
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
2914
|
+
if (__getOwnPropSymbols$p)
|
|
2915
|
+
for (var prop of __getOwnPropSymbols$p(b)) {
|
|
2916
|
+
if (__propIsEnum$p.call(b, prop))
|
|
2917
|
+
__defNormalProp$o(a, prop, b[prop]);
|
|
2879
2918
|
}
|
|
2880
2919
|
return a;
|
|
2881
2920
|
};
|
|
2882
|
-
var __spreadProps$
|
|
2921
|
+
var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
|
|
2883
2922
|
function calcBreakPoint(currentWidth, breakPoints) {
|
|
2884
2923
|
let currentIndex = 0;
|
|
2885
2924
|
while (currentIndex < breakPoints.length && currentWidth > breakPoints[currentIndex])
|
|
@@ -2953,7 +2992,7 @@ const makeResponsiveComponent = ({
|
|
|
2953
2992
|
const deferContainerWidth = useDeferredValue(containerWidth);
|
|
2954
2993
|
return /* @__PURE__ */ jsx(Box, { ref, children: hasRendered ? /* @__PURE__ */ jsx(
|
|
2955
2994
|
Component,
|
|
2956
|
-
__spreadProps$
|
|
2995
|
+
__spreadProps$f(__spreadValues$o({}, props), {
|
|
2957
2996
|
breakPoint: deferBreakPoint,
|
|
2958
2997
|
breakPointWidth: breakPoints[deferBreakPoint],
|
|
2959
2998
|
containerWidth: deferContainerWidth
|
|
@@ -2964,22 +3003,61 @@ const makeResponsiveComponent = ({
|
|
|
2964
3003
|
);
|
|
2965
3004
|
};
|
|
2966
3005
|
|
|
3006
|
+
var __defProp$n = Object.defineProperty;
|
|
3007
|
+
var __defProps$e = Object.defineProperties;
|
|
3008
|
+
var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
|
|
3009
|
+
var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
|
|
3010
|
+
var __hasOwnProp$o = Object.prototype.hasOwnProperty;
|
|
3011
|
+
var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
|
|
3012
|
+
var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3013
|
+
var __spreadValues$n = (a, b) => {
|
|
3014
|
+
for (var prop in b || (b = {}))
|
|
3015
|
+
if (__hasOwnProp$o.call(b, prop))
|
|
3016
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
3017
|
+
if (__getOwnPropSymbols$o)
|
|
3018
|
+
for (var prop of __getOwnPropSymbols$o(b)) {
|
|
3019
|
+
if (__propIsEnum$o.call(b, prop))
|
|
3020
|
+
__defNormalProp$n(a, prop, b[prop]);
|
|
3021
|
+
}
|
|
3022
|
+
return a;
|
|
3023
|
+
};
|
|
3024
|
+
var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
|
|
2967
3025
|
const DefaultAccordionItemButton = (props) => {
|
|
2968
|
-
var _a, _b, _c;
|
|
3026
|
+
var _a, _b, _c, _d, _e, _f;
|
|
2969
3027
|
const handler = useAccordionContext();
|
|
2970
3028
|
const { isExpanded } = handler.hooks.useItemStateSelector((props2) => props2);
|
|
2971
3029
|
const id = handler.hooks.useItemId();
|
|
2972
3030
|
const [isChecked, setIsChecked] = useIsChecked(props);
|
|
2973
|
-
const handleClick = useCallback(
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
3031
|
+
const handleClick = useCallback(
|
|
3032
|
+
(ev) => {
|
|
3033
|
+
var _a2;
|
|
3034
|
+
(_a2 = props.onClick) == null ? void 0 : _a2.call(props, ev);
|
|
3035
|
+
if (!ev.isDefaultPrevented())
|
|
3036
|
+
handler.udpateItem(id, (current) => ({
|
|
3037
|
+
isExpanded: !current.isExpanded
|
|
3038
|
+
}));
|
|
3039
|
+
},
|
|
3040
|
+
[handler, id, props]
|
|
3041
|
+
);
|
|
3042
|
+
const handleKeyDown = useCallback(
|
|
3043
|
+
(ev) => {
|
|
3044
|
+
var _a2;
|
|
3045
|
+
if (ev.code === "Enter") {
|
|
3046
|
+
(_a2 = props.onUserPressEnter) == null ? void 0 : _a2.call(props, ev);
|
|
3047
|
+
if (!ev.isDefaultPrevented() && props.rightButtons)
|
|
3048
|
+
handler.udpateItem(id, (current) => ({
|
|
3049
|
+
isExpanded: !current.isExpanded
|
|
3050
|
+
}));
|
|
3051
|
+
}
|
|
3052
|
+
},
|
|
3053
|
+
[handler, id, props]
|
|
3054
|
+
);
|
|
2978
3055
|
return /* @__PURE__ */ jsxs(
|
|
2979
3056
|
SimpleButton,
|
|
2980
|
-
{
|
|
2981
|
-
className:
|
|
3057
|
+
__spreadProps$e(__spreadValues$n({}, props.domButtonProps), {
|
|
3058
|
+
className: `accordion__item__button ${(_a = props.className) != null ? _a : ""} ${(_c = (_b = props.domButtonProps) == null ? void 0 : _b.className) != null ? _c : ""}`,
|
|
2982
3059
|
onClick: handleClick,
|
|
3060
|
+
onKeyDown: handleKeyDown,
|
|
2983
3061
|
"aria-expanded": isExpanded,
|
|
2984
3062
|
"aria-controls": `accordion__${handler.id}__${id}`,
|
|
2985
3063
|
"aria-checked": isChecked,
|
|
@@ -2996,18 +3074,21 @@ const DefaultAccordionItemButton = (props) => {
|
|
|
2996
3074
|
onChange: setIsChecked
|
|
2997
3075
|
}
|
|
2998
3076
|
),
|
|
2999
|
-
/* @__PURE__ */ jsx(Box, { as: "h3", className: "accordion__item__button__label", children: /* @__PURE__ */ jsx(AutoEllipsis, { overrideStyles: () => ({ textAlign: "left" }), children: (
|
|
3077
|
+
/* @__PURE__ */ jsx(Box, { as: "h3", className: "accordion__item__button__label", children: /* @__PURE__ */ jsx(AutoEllipsis, { overrideStyles: () => ({ textAlign: "left" }), children: (_e = (_d = props.label) != null ? _d : props.title) != null ? _e : props.ariaLabel }) })
|
|
3000
3078
|
] }),
|
|
3001
|
-
/* @__PURE__ */
|
|
3002
|
-
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3007
|
-
|
|
3008
|
-
|
|
3079
|
+
/* @__PURE__ */ jsxs(Box, { className: "accordion__item__button__rightGroup", children: [
|
|
3080
|
+
props.rightButtons,
|
|
3081
|
+
/* @__PURE__ */ jsx(
|
|
3082
|
+
Icon$1,
|
|
3083
|
+
{
|
|
3084
|
+
name: isExpanded ? "ArrowUpThin" : "ArrowDownThin",
|
|
3085
|
+
title: (_f = props.title) != null ? _f : props.ariaLabel,
|
|
3086
|
+
size: 23
|
|
3087
|
+
}
|
|
3088
|
+
)
|
|
3089
|
+
] })
|
|
3009
3090
|
]
|
|
3010
|
-
}
|
|
3091
|
+
})
|
|
3011
3092
|
);
|
|
3012
3093
|
};
|
|
3013
3094
|
|
|
@@ -3567,7 +3648,17 @@ const ConfirmModal = (_a) => {
|
|
|
3567
3648
|
hasConfirmed.current = true;
|
|
3568
3649
|
hide();
|
|
3569
3650
|
}, [hide]);
|
|
3570
|
-
return /* @__PURE__ */ jsx(
|
|
3651
|
+
return /* @__PURE__ */ jsx(
|
|
3652
|
+
Modal,
|
|
3653
|
+
__spreadProps$9(__spreadValues$h({}, modalProps), {
|
|
3654
|
+
initialFocusGetter: useCallback(
|
|
3655
|
+
(current) => current.querySelector(".confirm__confirmButton"),
|
|
3656
|
+
[]
|
|
3657
|
+
),
|
|
3658
|
+
title,
|
|
3659
|
+
children: /* @__PURE__ */ jsx(Confirm, __spreadProps$9(__spreadValues$h({}, props), { onCancel: handleCancel, onConfirm: handleConfirm }))
|
|
3660
|
+
})
|
|
3661
|
+
);
|
|
3571
3662
|
};
|
|
3572
3663
|
|
|
3573
3664
|
const ListboxContext = createContext({});
|
|
@@ -4191,6 +4282,11 @@ const moveFocusAndToggleSelection = makeOperation((state, { isShiftKey, which },
|
|
|
4191
4282
|
}
|
|
4192
4283
|
state.isEverythingSelected = false;
|
|
4193
4284
|
});
|
|
4285
|
+
const resetFocus = makeOperation((state, _, keys) => {
|
|
4286
|
+
keys.push(makeRowKey(state.focusedRow));
|
|
4287
|
+
state.focusedRow = 0;
|
|
4288
|
+
keys.push(makeRowKey(0));
|
|
4289
|
+
});
|
|
4194
4290
|
const searchElementsByStartingCharacters = makeOperation((state, payload, keys) => {
|
|
4195
4291
|
const currentIndex = state.shownRows.findIndex(
|
|
4196
4292
|
(current) => current === state.focusedRow
|
|
@@ -4337,6 +4433,7 @@ const operations$1 = {
|
|
|
4337
4433
|
* acuerdo a las especificaciones de wai-aria.
|
|
4338
4434
|
*/
|
|
4339
4435
|
moveFocusAndToggleSelection,
|
|
4436
|
+
resetFocus,
|
|
4340
4437
|
/**
|
|
4341
4438
|
* Este método debe utilizarse para la búsqueda por caracter simple o
|
|
4342
4439
|
* múltiple en cuanto a la implementación de las funcionalidades
|
|
@@ -4419,9 +4516,10 @@ function useShoutSelectionChange(onSelectionChange, registerCallback) {
|
|
|
4419
4516
|
);
|
|
4420
4517
|
}
|
|
4421
4518
|
|
|
4422
|
-
function useIndexedChildren(children) {
|
|
4519
|
+
function useIndexedChildren(children, listboxActions) {
|
|
4423
4520
|
return useMemo(
|
|
4424
4521
|
function makeChildrenIndices() {
|
|
4522
|
+
listboxActions.resetFocus(null);
|
|
4425
4523
|
return Children.map(children, (child, rowIndex) => {
|
|
4426
4524
|
if (isValidElement(child) && child.type === ListboxItem) {
|
|
4427
4525
|
return cloneElement(
|
|
@@ -4434,7 +4532,7 @@ function useIndexedChildren(children) {
|
|
|
4434
4532
|
return child;
|
|
4435
4533
|
});
|
|
4436
4534
|
},
|
|
4437
|
-
[children]
|
|
4535
|
+
[children, listboxActions]
|
|
4438
4536
|
);
|
|
4439
4537
|
}
|
|
4440
4538
|
|
|
@@ -4531,7 +4629,7 @@ const NoMemoListbox = makeStyledComponent(
|
|
|
4531
4629
|
);
|
|
4532
4630
|
useShoutSelectionChange(props.onSelectionChange, registerCallback);
|
|
4533
4631
|
useUpdateRowCount(props.children, listboxActions);
|
|
4534
|
-
const indexedChildren = useIndexedChildren(props.children);
|
|
4632
|
+
const indexedChildren = useIndexedChildren(props.children, listboxActions);
|
|
4535
4633
|
const { onClick, onFocus } = useListboxAutofocus(storeId, getState);
|
|
4536
4634
|
const ref = useListbox("listbox", null);
|
|
4537
4635
|
const variant = props.unstyled ? "" : "layout.components.listbox";
|
|
@@ -4907,413 +5005,12 @@ const useStore = ({
|
|
|
4907
5005
|
];
|
|
4908
5006
|
};
|
|
4909
5007
|
|
|
4910
|
-
function
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
const
|
|
4915
|
-
|
|
4916
|
-
function getParamNames(func) {
|
|
4917
|
-
const fnStr = func.toString().replace(STRIP_COMMENTS, "");
|
|
4918
|
-
let result = fnStr.slice(fnStr.indexOf("(") + 1, fnStr.indexOf(")")).match(ARGUMENT_NAMES);
|
|
4919
|
-
if (result === null)
|
|
4920
|
-
result = [];
|
|
4921
|
-
return result;
|
|
4922
|
-
}
|
|
4923
|
-
function determineAnchorPoint({
|
|
4924
|
-
attachToElement,
|
|
4925
|
-
attachToElementAnchorPoint
|
|
4926
|
-
}) {
|
|
4927
|
-
let actualAnchorPoint = { left: 0, top: 0 };
|
|
4928
|
-
const element = isAttachToElementAFunction(attachToElement) ? attachToElement() : attachToElement.current;
|
|
4929
|
-
if (element) {
|
|
4930
|
-
const rect = element.getBoundingClientRect();
|
|
4931
|
-
const point = attachToElementAnchorPoint != null ? attachToElementAnchorPoint : "topRight";
|
|
4932
|
-
switch (point) {
|
|
4933
|
-
case "bottomLeft":
|
|
4934
|
-
actualAnchorPoint = {
|
|
4935
|
-
left: rect.left,
|
|
4936
|
-
top: rect.bottom
|
|
4937
|
-
};
|
|
4938
|
-
break;
|
|
4939
|
-
case "bottomRight":
|
|
4940
|
-
actualAnchorPoint = {
|
|
4941
|
-
left: rect.right,
|
|
4942
|
-
top: rect.bottom
|
|
4943
|
-
};
|
|
4944
|
-
break;
|
|
4945
|
-
case "center":
|
|
4946
|
-
actualAnchorPoint = {
|
|
4947
|
-
left: (rect.left + rect.right) / 2,
|
|
4948
|
-
top: (rect.bottom + rect.top) / 2
|
|
4949
|
-
};
|
|
4950
|
-
break;
|
|
4951
|
-
case "topLeft":
|
|
4952
|
-
actualAnchorPoint = {
|
|
4953
|
-
left: rect.left,
|
|
4954
|
-
top: rect.top
|
|
4955
|
-
};
|
|
4956
|
-
break;
|
|
4957
|
-
case "topRight":
|
|
4958
|
-
actualAnchorPoint = {
|
|
4959
|
-
left: rect.right,
|
|
4960
|
-
top: rect.top
|
|
4961
|
-
};
|
|
4962
|
-
break;
|
|
4963
|
-
}
|
|
4964
|
-
} else {
|
|
4965
|
-
console.warn(
|
|
4966
|
-
"Cannot resolve element, will use default positioning ",
|
|
4967
|
-
attachToElement
|
|
4968
|
-
);
|
|
4969
|
-
}
|
|
4970
|
-
return actualAnchorPoint;
|
|
4971
|
-
}
|
|
4972
|
-
function calculateTooltipPosition({
|
|
4973
|
-
anchorPoint,
|
|
4974
|
-
attachToElement,
|
|
4975
|
-
attachToElementAnchorPoint,
|
|
4976
|
-
minSize,
|
|
4977
|
-
preferredOrientationX,
|
|
4978
|
-
preferredOrientationY,
|
|
4979
|
-
preferredSize = { height: "auto", width: "auto" }
|
|
4980
|
-
}) {
|
|
4981
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4982
|
-
let actualAnchorPoint = anchorPoint;
|
|
4983
|
-
if (attachToElement) {
|
|
4984
|
-
actualAnchorPoint = determineAnchorPoint({
|
|
4985
|
-
attachToElement,
|
|
4986
|
-
attachToElementAnchorPoint
|
|
4987
|
-
});
|
|
4988
|
-
}
|
|
4989
|
-
if (actualAnchorPoint) {
|
|
4990
|
-
const availableBottomSpace = window.innerHeight - actualAnchorPoint.top;
|
|
4991
|
-
const availableTopSpace = actualAnchorPoint.top;
|
|
4992
|
-
const availableLeftSpace = actualAnchorPoint.left;
|
|
4993
|
-
const availableRightSpace = window.innerWidth - actualAnchorPoint.left;
|
|
4994
|
-
const isEnoughToRight = ((_a = minSize == null ? void 0 : minSize.width) != null ? _a : 0) <= availableRightSpace;
|
|
4995
|
-
const isEnoughToLeft = ((_b = minSize == null ? void 0 : minSize.width) != null ? _b : 0) <= availableLeftSpace;
|
|
4996
|
-
const isEnoughToBottom = ((_c = minSize == null ? void 0 : minSize.height) != null ? _c : 0) <= availableBottomSpace;
|
|
4997
|
-
const isEnoughToTop = ((_d = minSize == null ? void 0 : minSize.height) != null ? _d : 0) <= availableTopSpace;
|
|
4998
|
-
const preferredWidth = preferredSize.width === "auto" ? Infinity : preferredSize.width;
|
|
4999
|
-
const preferredHeight = preferredSize.height === "auto" ? Infinity : preferredSize.height;
|
|
5000
|
-
const position = {
|
|
5001
|
-
"& > *": {
|
|
5002
|
-
width: "100%",
|
|
5003
|
-
height: "100%"
|
|
5004
|
-
},
|
|
5005
|
-
width: preferredSize.width === "auto" ? "auto" : "100%",
|
|
5006
|
-
height: preferredSize.height === "auto" ? "auto" : "100%"
|
|
5007
|
-
};
|
|
5008
|
-
if (preferredOrientationX === "left") {
|
|
5009
|
-
if (isEnoughToLeft) {
|
|
5010
|
-
position.maxWidth = Math.min(preferredWidth, availableLeftSpace);
|
|
5011
|
-
position.right = window.innerWidth - actualAnchorPoint.left;
|
|
5012
|
-
} else if (isEnoughToRight) {
|
|
5013
|
-
position.maxWidth = Math.min(preferredWidth, availableRightSpace);
|
|
5014
|
-
position.left = actualAnchorPoint.left;
|
|
5015
|
-
} else {
|
|
5016
|
-
position.left = 0;
|
|
5017
|
-
position.maxWidth = "100vw";
|
|
5018
|
-
}
|
|
5019
|
-
} else {
|
|
5020
|
-
if (isEnoughToRight) {
|
|
5021
|
-
position.maxWidth = Math.min(preferredWidth, availableRightSpace);
|
|
5022
|
-
position.left = actualAnchorPoint.left;
|
|
5023
|
-
} else if (isEnoughToLeft) {
|
|
5024
|
-
position.maxWidth = Math.min(preferredWidth, availableLeftSpace);
|
|
5025
|
-
position.right = window.innerWidth - actualAnchorPoint.left;
|
|
5026
|
-
} else {
|
|
5027
|
-
position.left = 0;
|
|
5028
|
-
position.maxWidth = "100vw";
|
|
5029
|
-
}
|
|
5030
|
-
}
|
|
5031
|
-
if (preferredOrientationY === "top") {
|
|
5032
|
-
if (isEnoughToTop) {
|
|
5033
|
-
position.maxHeight = Math.min(preferredHeight, availableTopSpace);
|
|
5034
|
-
position.bottom = window.innerHeight - actualAnchorPoint.top;
|
|
5035
|
-
} else if (isEnoughToBottom) {
|
|
5036
|
-
position.maxHeight = Math.min(preferredHeight, availableBottomSpace);
|
|
5037
|
-
position.top = actualAnchorPoint.top;
|
|
5038
|
-
} else {
|
|
5039
|
-
position.maxHeight = "100vh";
|
|
5040
|
-
position.top = 0;
|
|
5041
|
-
}
|
|
5042
|
-
} else {
|
|
5043
|
-
if (isEnoughToBottom) {
|
|
5044
|
-
position.maxHeight = Math.min(preferredHeight, availableBottomSpace);
|
|
5045
|
-
position.top = actualAnchorPoint.top;
|
|
5046
|
-
} else if (isEnoughToTop) {
|
|
5047
|
-
position.maxHeight = Math.min(preferredHeight, availableTopSpace);
|
|
5048
|
-
position.bottom = window.innerHeight - actualAnchorPoint.top;
|
|
5049
|
-
} else {
|
|
5050
|
-
position.maxHeight = "100vh";
|
|
5051
|
-
position.top = 0;
|
|
5052
|
-
}
|
|
5053
|
-
}
|
|
5054
|
-
position.minHeight = typeof position.maxHeight === "number" ? Math.min(position.maxHeight, (_e = minSize == null ? void 0 : minSize.height) != null ? _e : 0) : (_f = minSize == null ? void 0 : minSize.height) != null ? _f : 0;
|
|
5055
|
-
position.minWidth = typeof position.minWidth === "number" ? Math.min(position.minWidth, (_g = minSize == null ? void 0 : minSize.width) != null ? _g : 0) : (_h = minSize == null ? void 0 : minSize.width) != null ? _h : 0;
|
|
5056
|
-
return position;
|
|
5057
|
-
}
|
|
5058
|
-
return { left: 0, top: 0, width: "auto", height: "auto" };
|
|
5059
|
-
}
|
|
5060
|
-
function useHandlers({
|
|
5061
|
-
attachToElement,
|
|
5062
|
-
closeOnClick,
|
|
5063
|
-
closeOnClickOut,
|
|
5064
|
-
closeOnEscape,
|
|
5065
|
-
closeOnMouseLeaveTooltip,
|
|
5066
|
-
closeOnMouseLeaveAttachedElement,
|
|
5067
|
-
closeOnScrollOut
|
|
5068
|
-
}) {
|
|
5069
|
-
const hasInited = useRef(false);
|
|
5070
|
-
const close = useCallback(() => {
|
|
5071
|
-
tooltipsHandler("close", void 0);
|
|
5072
|
-
}, []);
|
|
5073
|
-
useMount(() => {
|
|
5074
|
-
function handleEscape(ev) {
|
|
5075
|
-
if (ev.code === "Escape" && closeOnEscape) {
|
|
5076
|
-
close();
|
|
5077
|
-
}
|
|
5078
|
-
}
|
|
5079
|
-
function handleMouseDownOut(ev) {
|
|
5080
|
-
if (!hasInited.current)
|
|
5081
|
-
return;
|
|
5082
|
-
if (closeOnClickOut && !isChild(
|
|
5083
|
-
ev.target,
|
|
5084
|
-
(current) => {
|
|
5085
|
-
var _a;
|
|
5086
|
-
return (_a = current.classList) == null ? void 0 : _a.contains("tooltip__wrapper");
|
|
5087
|
-
}
|
|
5088
|
-
)) {
|
|
5089
|
-
close();
|
|
5090
|
-
}
|
|
5091
|
-
}
|
|
5092
|
-
function handleScroll(ev) {
|
|
5093
|
-
if (!hasInited.current)
|
|
5094
|
-
return;
|
|
5095
|
-
if (closeOnScrollOut && !isChild(
|
|
5096
|
-
ev.target,
|
|
5097
|
-
(current) => {
|
|
5098
|
-
var _a;
|
|
5099
|
-
return (_a = current.classList) == null ? void 0 : _a.contains("tooltip__wrapper");
|
|
5100
|
-
}
|
|
5101
|
-
)) {
|
|
5102
|
-
close();
|
|
5103
|
-
}
|
|
5104
|
-
}
|
|
5105
|
-
function handleMouseLeave(event) {
|
|
5106
|
-
if (!hasInited.current || !closeOnMouseLeaveAttachedElement && !closeOnMouseLeaveTooltip)
|
|
5107
|
-
return;
|
|
5108
|
-
const resolvedAttachToElement = attachToElement ? isAttachToElementAFunction(attachToElement) ? attachToElement() : attachToElement.current : null;
|
|
5109
|
-
const isTooltipTheTarget = isChild(
|
|
5110
|
-
event.target,
|
|
5111
|
-
(current) => current.classList.contains("tooltip__wrapper")
|
|
5112
|
-
);
|
|
5113
|
-
const isAttachedTheTarget = isChild(
|
|
5114
|
-
event.target,
|
|
5115
|
-
(current) => current === resolvedAttachToElement
|
|
5116
|
-
);
|
|
5117
|
-
const isTooltipRelated = isChild(
|
|
5118
|
-
event.relatedTarget,
|
|
5119
|
-
(current) => current.classList.contains("tooltip__wrapper")
|
|
5120
|
-
);
|
|
5121
|
-
const isAttachedRelated = isChild(
|
|
5122
|
-
event.relatedTarget,
|
|
5123
|
-
(current) => current === resolvedAttachToElement
|
|
5124
|
-
);
|
|
5125
|
-
if (!isTooltipTheTarget && !isAttachedTheTarget && !closeOnMouseLeaveAttachedElement && !closeOnMouseLeaveTooltip)
|
|
5126
|
-
return;
|
|
5127
|
-
if (isTooltipRelated || isAttachedRelated)
|
|
5128
|
-
return;
|
|
5129
|
-
if (isAttachedTheTarget && !closeOnMouseLeaveAttachedElement)
|
|
5130
|
-
return;
|
|
5131
|
-
if (isTooltipTheTarget && !closeOnMouseLeaveTooltip)
|
|
5132
|
-
return;
|
|
5133
|
-
close();
|
|
5134
|
-
}
|
|
5135
|
-
document.addEventListener("keydown", handleEscape);
|
|
5136
|
-
document.addEventListener("mousedown", handleMouseDownOut);
|
|
5137
|
-
document.addEventListener("scroll", handleScroll);
|
|
5138
|
-
document.addEventListener("mouseout", handleMouseLeave);
|
|
5139
|
-
setTimeout(() => {
|
|
5140
|
-
hasInited.current = true;
|
|
5141
|
-
}, 0);
|
|
5142
|
-
return () => {
|
|
5143
|
-
document.removeEventListener("keydown", handleEscape);
|
|
5144
|
-
document.removeEventListener("click", handleMouseDownOut);
|
|
5145
|
-
document.removeEventListener("scroll", handleScroll);
|
|
5146
|
-
document.removeEventListener("mouseout", handleMouseLeave);
|
|
5147
|
-
};
|
|
5148
|
-
});
|
|
5149
|
-
return {
|
|
5150
|
-
handleOnClick: useCallback(
|
|
5151
|
-
(ev) => {
|
|
5152
|
-
ev.stopPropagation();
|
|
5153
|
-
if (closeOnClick) {
|
|
5154
|
-
close();
|
|
5155
|
-
}
|
|
5156
|
-
},
|
|
5157
|
-
[close, closeOnClick]
|
|
5158
|
-
)
|
|
5159
|
-
};
|
|
5160
|
-
}
|
|
5161
|
-
|
|
5162
|
-
var __defProp$8 = Object.defineProperty;
|
|
5163
|
-
var __defProps$1 = Object.defineProperties;
|
|
5164
|
-
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
5165
|
-
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
5166
|
-
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
5167
|
-
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
5168
|
-
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5169
|
-
var __spreadValues$8 = (a, b) => {
|
|
5170
|
-
for (var prop in b || (b = {}))
|
|
5171
|
-
if (__hasOwnProp$8.call(b, prop))
|
|
5172
|
-
__defNormalProp$8(a, prop, b[prop]);
|
|
5173
|
-
if (__getOwnPropSymbols$8)
|
|
5174
|
-
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
5175
|
-
if (__propIsEnum$8.call(b, prop))
|
|
5176
|
-
__defNormalProp$8(a, prop, b[prop]);
|
|
5177
|
-
}
|
|
5178
|
-
return a;
|
|
5179
|
-
};
|
|
5180
|
-
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
5181
|
-
const Tooltip = ({
|
|
5182
|
-
anchorPoint,
|
|
5183
|
-
attachToElement,
|
|
5184
|
-
attachToElementAnchorPoint,
|
|
5185
|
-
children,
|
|
5186
|
-
className,
|
|
5187
|
-
closeOnClick = false,
|
|
5188
|
-
closeOnClickOut = true,
|
|
5189
|
-
closeOnEscape = true,
|
|
5190
|
-
closeOnMouseLeaveTooltip = true,
|
|
5191
|
-
closeOnMouseLeaveAttachedElement = true,
|
|
5192
|
-
closeOnScrollOut = true,
|
|
5193
|
-
minSize,
|
|
5194
|
-
preferredOrientationX = "right",
|
|
5195
|
-
preferredOrientationY = "bottom",
|
|
5196
|
-
preferredSize = { height: "auto", width: "auto" },
|
|
5197
|
-
variant = "layout.common.tooltips.primary"
|
|
5198
|
-
}) => {
|
|
5199
|
-
const calculatedPosition = calculateTooltipPosition({
|
|
5200
|
-
anchorPoint,
|
|
5201
|
-
attachToElement,
|
|
5202
|
-
attachToElementAnchorPoint,
|
|
5203
|
-
minSize,
|
|
5204
|
-
preferredOrientationX,
|
|
5205
|
-
preferredOrientationY,
|
|
5206
|
-
preferredSize
|
|
5207
|
-
});
|
|
5208
|
-
const sx = __spreadValues$8({
|
|
5209
|
-
position: "fixed"
|
|
5210
|
-
}, calculatedPosition);
|
|
5211
|
-
const { handleOnClick } = useHandlers({
|
|
5212
|
-
attachToElement,
|
|
5213
|
-
closeOnEscape,
|
|
5214
|
-
closeOnClickOut,
|
|
5215
|
-
closeOnClick,
|
|
5216
|
-
closeOnMouseLeaveTooltip,
|
|
5217
|
-
closeOnMouseLeaveAttachedElement,
|
|
5218
|
-
closeOnScrollOut
|
|
5219
|
-
});
|
|
5220
|
-
return /* @__PURE__ */ jsx(
|
|
5221
|
-
Box,
|
|
5222
|
-
__spreadProps$1(__spreadValues$8({
|
|
5223
|
-
className: `tooltip__wrapper ${className != null ? className : ""}`
|
|
5224
|
-
}, getVariant(variant)), {
|
|
5225
|
-
sx,
|
|
5226
|
-
onClick: handleOnClick,
|
|
5227
|
-
children
|
|
5228
|
-
})
|
|
5229
|
-
);
|
|
5230
|
-
};
|
|
5231
|
-
|
|
5232
|
-
var __defProp$7 = Object.defineProperty;
|
|
5233
|
-
var __defProps = Object.defineProperties;
|
|
5234
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5235
|
-
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
5236
|
-
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
5237
|
-
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
5238
|
-
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5239
|
-
var __spreadValues$7 = (a, b) => {
|
|
5240
|
-
for (var prop in b || (b = {}))
|
|
5241
|
-
if (__hasOwnProp$7.call(b, prop))
|
|
5242
|
-
__defNormalProp$7(a, prop, b[prop]);
|
|
5243
|
-
if (__getOwnPropSymbols$7)
|
|
5244
|
-
for (var prop of __getOwnPropSymbols$7(b)) {
|
|
5245
|
-
if (__propIsEnum$7.call(b, prop))
|
|
5246
|
-
__defNormalProp$7(a, prop, b[prop]);
|
|
5247
|
-
}
|
|
5248
|
-
return a;
|
|
5249
|
-
};
|
|
5250
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
5251
|
-
injectStyles("layout.common.tooltips.primary", {
|
|
5252
|
-
background: "white",
|
|
5253
|
-
border: "1px solid #ccc",
|
|
5254
|
-
p: 3,
|
|
5255
|
-
zIndex: "tooltip"
|
|
5256
|
-
});
|
|
5257
|
-
const [, tooltipsHandler, TooltipsProvider] = makeSingleImperativeComponent()({
|
|
5258
|
-
Component: () => {
|
|
5259
|
-
const [tooltip, setTooltip] = useState(null);
|
|
5260
|
-
const tooltipRef = useLatest(tooltip);
|
|
5261
|
-
useImperativeComponentEvents({
|
|
5262
|
-
open: setTooltip,
|
|
5263
|
-
close() {
|
|
5264
|
-
var _a, _b;
|
|
5265
|
-
(_b = (_a = tooltipRef.current) == null ? void 0 : _a.onClose) == null ? void 0 : _b.call(_a);
|
|
5266
|
-
setTooltip(null);
|
|
5267
|
-
}
|
|
5268
|
-
});
|
|
5269
|
-
if (!tooltip)
|
|
5270
|
-
return null;
|
|
5271
|
-
return /* @__PURE__ */ jsx(Tooltip, __spreadValues$7({}, tooltip));
|
|
5272
|
-
}
|
|
5273
|
-
});
|
|
5274
|
-
function useTooltip(tooltip) {
|
|
5275
|
-
const isOpen = useRef(false);
|
|
5276
|
-
const open = useCallback(
|
|
5277
|
-
(otherProps) => {
|
|
5278
|
-
setTimeout(() => {
|
|
5279
|
-
isOpen.current = true;
|
|
5280
|
-
if (!tooltip && !(otherProps == null ? void 0 : otherProps.children))
|
|
5281
|
-
throw new Error("There is no children set for the current tooltip");
|
|
5282
|
-
tooltipsHandler("open", __spreadProps(__spreadValues$7(__spreadValues$7({}, tooltip), otherProps), {
|
|
5283
|
-
onClose() {
|
|
5284
|
-
var _a, _b;
|
|
5285
|
-
(_a = tooltip == null ? void 0 : tooltip.onClose) == null ? void 0 : _a.call(tooltip);
|
|
5286
|
-
(_b = otherProps == null ? void 0 : otherProps.onClose) == null ? void 0 : _b.call(otherProps);
|
|
5287
|
-
isOpen.current = false;
|
|
5288
|
-
}
|
|
5289
|
-
}));
|
|
5290
|
-
}, 0);
|
|
5291
|
-
},
|
|
5292
|
-
[tooltip]
|
|
5293
|
-
);
|
|
5294
|
-
return {
|
|
5295
|
-
close: useCallback(() => {
|
|
5296
|
-
tooltipsHandler("close", void 0);
|
|
5297
|
-
}, []),
|
|
5298
|
-
open,
|
|
5299
|
-
toggle: useCallback(
|
|
5300
|
-
(otherProps) => {
|
|
5301
|
-
if (isOpen.current) {
|
|
5302
|
-
tooltipsHandler("close", void 0);
|
|
5303
|
-
} else
|
|
5304
|
-
open(otherProps);
|
|
5305
|
-
},
|
|
5306
|
-
[open]
|
|
5307
|
-
)
|
|
5308
|
-
};
|
|
5309
|
-
}
|
|
5310
|
-
|
|
5311
|
-
function findIcon(icons, arg) {
|
|
5312
|
-
var _a, _b;
|
|
5313
|
-
const iconId = arg instanceof HTMLElement ? (_b = (_a = arg.closest(".iconsList__iconWrapper[data-id]")) == null ? void 0 : _a.dataset) == null ? void 0 : _b.id : arg;
|
|
5314
|
-
if (iconId !== void 0) {
|
|
5315
|
-
const icon = icons.find((current) => String(current.id) === iconId);
|
|
5316
|
-
return icon != null ? icon : null;
|
|
5008
|
+
function findIcon(icons, arg) {
|
|
5009
|
+
var _a, _b;
|
|
5010
|
+
const iconId = arg instanceof HTMLElement ? (_b = (_a = arg.closest(".iconsList__iconWrapper[data-id]")) == null ? void 0 : _a.dataset) == null ? void 0 : _b.id : arg;
|
|
5011
|
+
if (iconId !== void 0) {
|
|
5012
|
+
const icon = icons.find((current) => String(current.id) === iconId);
|
|
5013
|
+
return icon != null ? icon : null;
|
|
5317
5014
|
}
|
|
5318
5015
|
}
|
|
5319
5016
|
const KeyHandler = ({
|
|
@@ -5327,22 +5024,20 @@ const KeyHandler = ({
|
|
|
5327
5024
|
}) => {
|
|
5328
5025
|
const { actions, getState, useProps } = useIconsListStoreContext();
|
|
5329
5026
|
const ref = useProps("grid", null);
|
|
5330
|
-
const { open } = useTooltip({
|
|
5331
|
-
minSize: { width: 200, height: 0 }
|
|
5332
|
-
});
|
|
5333
5027
|
const showIconDetails = useCallback(
|
|
5334
5028
|
(icon) => {
|
|
5335
5029
|
if (onIconGetDetails) {
|
|
5336
|
-
open({
|
|
5337
|
-
children: onIconGetDetails(icon),
|
|
5030
|
+
new ApiaUtil().tooltips.open({
|
|
5338
5031
|
attachToElement: () => document.querySelector(
|
|
5339
5032
|
`#${storeId} .iconsList__iconWrapper[data-id="${icon.id}"]`
|
|
5340
5033
|
),
|
|
5341
|
-
|
|
5034
|
+
children: onIconGetDetails(icon),
|
|
5035
|
+
closeOnClick: false,
|
|
5036
|
+
minSize: { width: 200, height: 0 }
|
|
5342
5037
|
});
|
|
5343
5038
|
}
|
|
5344
5039
|
},
|
|
5345
|
-
[onIconGetDetails,
|
|
5040
|
+
[onIconGetDetails, storeId]
|
|
5346
5041
|
);
|
|
5347
5042
|
return /* @__PURE__ */ jsx(
|
|
5348
5043
|
Box,
|
|
@@ -5446,19 +5141,19 @@ const KeyHandler = ({
|
|
|
5446
5141
|
);
|
|
5447
5142
|
};
|
|
5448
5143
|
|
|
5449
|
-
var __defProp$
|
|
5450
|
-
var __getOwnPropSymbols$
|
|
5451
|
-
var __hasOwnProp$
|
|
5452
|
-
var __propIsEnum$
|
|
5453
|
-
var __defNormalProp$
|
|
5454
|
-
var __spreadValues$
|
|
5144
|
+
var __defProp$8 = Object.defineProperty;
|
|
5145
|
+
var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
|
|
5146
|
+
var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
|
|
5147
|
+
var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
|
|
5148
|
+
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5149
|
+
var __spreadValues$8 = (a, b) => {
|
|
5455
5150
|
for (var prop in b || (b = {}))
|
|
5456
|
-
if (__hasOwnProp$
|
|
5457
|
-
__defNormalProp$
|
|
5458
|
-
if (__getOwnPropSymbols$
|
|
5459
|
-
for (var prop of __getOwnPropSymbols$
|
|
5460
|
-
if (__propIsEnum$
|
|
5461
|
-
__defNormalProp$
|
|
5151
|
+
if (__hasOwnProp$8.call(b, prop))
|
|
5152
|
+
__defNormalProp$8(a, prop, b[prop]);
|
|
5153
|
+
if (__getOwnPropSymbols$8)
|
|
5154
|
+
for (var prop of __getOwnPropSymbols$8(b)) {
|
|
5155
|
+
if (__propIsEnum$8.call(b, prop))
|
|
5156
|
+
__defNormalProp$8(a, prop, b[prop]);
|
|
5462
5157
|
}
|
|
5463
5158
|
return a;
|
|
5464
5159
|
};
|
|
@@ -5481,7 +5176,7 @@ const styles$1 = {
|
|
|
5481
5176
|
flexDirection: "column",
|
|
5482
5177
|
gap: 3,
|
|
5483
5178
|
"&:hover": (theme) => {
|
|
5484
|
-
return __spreadValues$
|
|
5179
|
+
return __spreadValues$8({}, theme.palette.getOneState(
|
|
5485
5180
|
{ backgroundColor: "palette.background.paper" },
|
|
5486
5181
|
"hover"
|
|
5487
5182
|
));
|
|
@@ -5498,7 +5193,7 @@ const styles$1 = {
|
|
|
5498
5193
|
},
|
|
5499
5194
|
".iconsList__keyHandler:focus": {
|
|
5500
5195
|
outline: "none",
|
|
5501
|
-
".focused .iconsList__icon__wrapper": __spreadValues$
|
|
5196
|
+
".focused .iconsList__icon__wrapper": __spreadValues$8({}, focusOutline)
|
|
5502
5197
|
}
|
|
5503
5198
|
};
|
|
5504
5199
|
|
|
@@ -5541,15 +5236,254 @@ function getRowIcons({
|
|
|
5541
5236
|
justToFillTheRow
|
|
5542
5237
|
)
|
|
5543
5238
|
);
|
|
5544
|
-
return actualIcons;
|
|
5545
|
-
}
|
|
5239
|
+
return actualIcons;
|
|
5240
|
+
}
|
|
5241
|
+
|
|
5242
|
+
const IconRendererContext = createContext(
|
|
5243
|
+
null
|
|
5244
|
+
);
|
|
5245
|
+
function useIconRendererContext() {
|
|
5246
|
+
const context = useContext(IconRendererContext);
|
|
5247
|
+
if (!context)
|
|
5248
|
+
throw new Error("There is no IconRendererContext");
|
|
5249
|
+
return context;
|
|
5250
|
+
}
|
|
5251
|
+
|
|
5252
|
+
var __defProp$7 = Object.defineProperty;
|
|
5253
|
+
var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
|
|
5254
|
+
var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
|
|
5255
|
+
var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
|
|
5256
|
+
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5257
|
+
var __spreadValues$7 = (a, b) => {
|
|
5258
|
+
for (var prop in b || (b = {}))
|
|
5259
|
+
if (__hasOwnProp$7.call(b, prop))
|
|
5260
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
5261
|
+
if (__getOwnPropSymbols$7)
|
|
5262
|
+
for (var prop of __getOwnPropSymbols$7(b)) {
|
|
5263
|
+
if (__propIsEnum$7.call(b, prop))
|
|
5264
|
+
__defNormalProp$7(a, prop, b[prop]);
|
|
5265
|
+
}
|
|
5266
|
+
return a;
|
|
5267
|
+
};
|
|
5268
|
+
const Icon = (props) => {
|
|
5269
|
+
var _a;
|
|
5270
|
+
const { useProps } = useIconsListStoreContext();
|
|
5271
|
+
const ref = useProps("cell", {
|
|
5272
|
+
columnIndex: props.colIndex,
|
|
5273
|
+
rowIndex: props.rowIndex
|
|
5274
|
+
});
|
|
5275
|
+
const Renderer = useIconRendererContext();
|
|
5276
|
+
return /* @__PURE__ */ jsx(
|
|
5277
|
+
Box,
|
|
5278
|
+
{
|
|
5279
|
+
ref,
|
|
5280
|
+
role: "gridcell",
|
|
5281
|
+
"data-id": props.id,
|
|
5282
|
+
className: `iconsList__iconWrapper ${(_a = props.className) != null ? _a : ""}`,
|
|
5283
|
+
"aria-label": props.ariaLabel,
|
|
5284
|
+
sx: useMemo(
|
|
5285
|
+
() => ({
|
|
5286
|
+
width: `${props.width}px`,
|
|
5287
|
+
".iconsList__icon__image__wrapper": {
|
|
5288
|
+
height: `${props.width - 4}px`
|
|
5289
|
+
},
|
|
5290
|
+
".iconsList__icon__image": {
|
|
5291
|
+
maxHeight: `${props.width - 32}px`,
|
|
5292
|
+
maxWidth: `${props.width - 32}px`
|
|
5293
|
+
}
|
|
5294
|
+
}),
|
|
5295
|
+
[props.width]
|
|
5296
|
+
),
|
|
5297
|
+
"aria-colindex": props.colIndex,
|
|
5298
|
+
children: /* @__PURE__ */ jsx(Renderer, __spreadValues$7({}, props))
|
|
5299
|
+
}
|
|
5300
|
+
);
|
|
5301
|
+
};
|
|
5302
|
+
|
|
5303
|
+
var __defProp$6 = Object.defineProperty;
|
|
5304
|
+
var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
|
|
5305
|
+
var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
|
|
5306
|
+
var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
|
|
5307
|
+
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5308
|
+
var __spreadValues$6 = (a, b) => {
|
|
5309
|
+
for (var prop in b || (b = {}))
|
|
5310
|
+
if (__hasOwnProp$6.call(b, prop))
|
|
5311
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
5312
|
+
if (__getOwnPropSymbols$6)
|
|
5313
|
+
for (var prop of __getOwnPropSymbols$6(b)) {
|
|
5314
|
+
if (__propIsEnum$6.call(b, prop))
|
|
5315
|
+
__defNormalProp$6(a, prop, b[prop]);
|
|
5316
|
+
}
|
|
5317
|
+
return a;
|
|
5318
|
+
};
|
|
5319
|
+
const IconWrapper = ({
|
|
5320
|
+
icon,
|
|
5321
|
+
iconWidth,
|
|
5322
|
+
rowIndex,
|
|
5323
|
+
colIndex
|
|
5324
|
+
}) => {
|
|
5325
|
+
return icon === justToFillTheRow ? /* @__PURE__ */ jsx(Box, { sx: { width: `${iconWidth}px` }, className: "fill__the__row" }) : /* @__PURE__ */ jsx(
|
|
5326
|
+
Icon,
|
|
5327
|
+
__spreadValues$6({
|
|
5328
|
+
rowIndex,
|
|
5329
|
+
colIndex,
|
|
5330
|
+
width: iconWidth
|
|
5331
|
+
}, icon)
|
|
5332
|
+
);
|
|
5333
|
+
};
|
|
5334
|
+
|
|
5335
|
+
const DefaultIconRendererNoMemo = (props) => {
|
|
5336
|
+
if (!props.icon && !props.imageUrl) {
|
|
5337
|
+
console.error({ props });
|
|
5338
|
+
throw new Error("The icon has no imageUrl nor icon defined");
|
|
5339
|
+
}
|
|
5340
|
+
return /* @__PURE__ */ jsxs(Box, { title: props.label, className: "iconsList__icon__wrapper", children: [
|
|
5341
|
+
/* @__PURE__ */ jsxs(Box, { className: "iconsList__icon__image__wrapper", children: [
|
|
5342
|
+
props.imageUrl && /* @__PURE__ */ jsx(
|
|
5343
|
+
Image,
|
|
5344
|
+
{
|
|
5345
|
+
className: "iconsList__icon__image",
|
|
5346
|
+
src: props.imageUrl,
|
|
5347
|
+
role: "decoration"
|
|
5348
|
+
}
|
|
5349
|
+
),
|
|
5350
|
+
props.icon && /* @__PURE__ */ jsx(Icon$1, { icon: props.icon, title: props.ariaLabel })
|
|
5351
|
+
] }),
|
|
5352
|
+
/* @__PURE__ */ jsx(Box, { className: "iconsList__icon__label", children: props.label })
|
|
5353
|
+
] });
|
|
5354
|
+
};
|
|
5355
|
+
const DefaultIconRenderer = memo(DefaultIconRendererNoMemo);
|
|
5356
|
+
|
|
5357
|
+
const IconsListNonForwarded = (props, ref) => {
|
|
5358
|
+
var _a, _b, _c;
|
|
5359
|
+
const propsRef = useLatest(props);
|
|
5360
|
+
let render = () => {
|
|
5361
|
+
};
|
|
5362
|
+
const previousProps = usePrevious(props);
|
|
5363
|
+
if (!shallowEqual(props, previousProps.current)) {
|
|
5364
|
+
setTimeout(() => render(), 0);
|
|
5365
|
+
}
|
|
5366
|
+
const ResponsiveContainer = useMemo(() => {
|
|
5367
|
+
var _a2, _b2;
|
|
5368
|
+
const iconWidth = (_a2 = propsRef.current.iconWidth) != null ? _a2 : 100;
|
|
5369
|
+
const minGap = (_b2 = propsRef.current.minHorizontalGap) != null ? _b2 : 30;
|
|
5370
|
+
const blockWidth = iconWidth + minGap;
|
|
5371
|
+
const styledComponent = (styledComponentProps) => {
|
|
5372
|
+
var _a3, _b3;
|
|
5373
|
+
const { breakPoint, containerWidth } = styledComponentProps;
|
|
5374
|
+
const [, doRender] = useState(true);
|
|
5375
|
+
render = useCallback(() => doRender((current) => !current), []);
|
|
5376
|
+
const storeId = useMemo(() => uniqueId("IconsList"), []);
|
|
5377
|
+
const [actions, , , , Context] = useStore({ storeId });
|
|
5378
|
+
const rows = Math.ceil(propsRef.current.icons.length / breakPoint);
|
|
5379
|
+
const sx = useStyles({
|
|
5380
|
+
breakPoint,
|
|
5381
|
+
containerWidth,
|
|
5382
|
+
iconWidth: (_a3 = propsRef.current.iconWidth) != null ? _a3 : 100,
|
|
5383
|
+
verticalGap: propsRef.current.verticalGap,
|
|
5384
|
+
removeHorizontalPadding: propsRef.current.removeHorizontalPadding
|
|
5385
|
+
});
|
|
5386
|
+
useEffect(() => {
|
|
5387
|
+
actions.recalculateIndexByResize();
|
|
5388
|
+
}, [breakPoint]);
|
|
5389
|
+
const IconRenderer = (_b3 = propsRef.current.iconRenderer) != null ? _b3 : DefaultIconRenderer;
|
|
5390
|
+
return /* @__PURE__ */ jsx(IconRendererContext.Provider, { value: IconRenderer, children: /* @__PURE__ */ jsx(Context, { children: /* @__PURE__ */ jsx(
|
|
5391
|
+
KeyHandler,
|
|
5392
|
+
{
|
|
5393
|
+
icons: propsRef.current.icons,
|
|
5394
|
+
onIconClick: propsRef.current.onIconClick,
|
|
5395
|
+
onIconDoubleClick: propsRef.current.onIconDoubleClick,
|
|
5396
|
+
onIconGetDetails: propsRef.current.onIconGetDetails,
|
|
5397
|
+
onIconKeyDown: propsRef.current.onIconKeyDown,
|
|
5398
|
+
storeId,
|
|
5399
|
+
children: /* @__PURE__ */ jsx(
|
|
5400
|
+
Box,
|
|
5401
|
+
{
|
|
5402
|
+
id: storeId,
|
|
5403
|
+
role: "grid",
|
|
5404
|
+
"aria-rowcount": rows,
|
|
5405
|
+
"aria-colcount": breakPoint,
|
|
5406
|
+
children: Array(rows).fill(1).map((_, i) => {
|
|
5407
|
+
const icons = getRowIcons({
|
|
5408
|
+
breakPoint,
|
|
5409
|
+
i,
|
|
5410
|
+
icons: propsRef.current.icons
|
|
5411
|
+
});
|
|
5412
|
+
return /* @__PURE__ */ jsx(
|
|
5413
|
+
Grid,
|
|
5414
|
+
{
|
|
5415
|
+
"aria-rowindex": i + 1,
|
|
5416
|
+
role: "row",
|
|
5417
|
+
ref,
|
|
5418
|
+
sx,
|
|
5419
|
+
children: icons.map((current, j) => {
|
|
5420
|
+
var _a4;
|
|
5421
|
+
return /* @__PURE__ */ jsx(
|
|
5422
|
+
IconWrapper,
|
|
5423
|
+
{
|
|
5424
|
+
colIndex: j + 1,
|
|
5425
|
+
icon: current,
|
|
5426
|
+
iconWidth: (_a4 = propsRef.current.iconWidth) != null ? _a4 : 100,
|
|
5427
|
+
rowIndex: i + 1
|
|
5428
|
+
},
|
|
5429
|
+
uniqueId(String(j + i))
|
|
5430
|
+
);
|
|
5431
|
+
})
|
|
5432
|
+
},
|
|
5433
|
+
i
|
|
5434
|
+
);
|
|
5435
|
+
})
|
|
5436
|
+
}
|
|
5437
|
+
)
|
|
5438
|
+
}
|
|
5439
|
+
) }) });
|
|
5440
|
+
};
|
|
5441
|
+
const Component = makeResponsiveComponent({
|
|
5442
|
+
breakPoints: getBreakpoints(blockWidth),
|
|
5443
|
+
Component: makeStyledComponent(
|
|
5444
|
+
"IconsList",
|
|
5445
|
+
"layout.common.components.iconsList",
|
|
5446
|
+
styles$1,
|
|
5447
|
+
styledComponent
|
|
5448
|
+
),
|
|
5449
|
+
debounce: 50
|
|
5450
|
+
});
|
|
5451
|
+
return Component;
|
|
5452
|
+
}, []);
|
|
5453
|
+
if (((_a = previousProps.current) == null ? void 0 : _a.iconWidth) !== props.iconWidth) {
|
|
5454
|
+
const iconWidth = (_b = props.iconWidth) != null ? _b : 100;
|
|
5455
|
+
const minGap = (_c = props.minHorizontalGap) != null ? _c : 30;
|
|
5456
|
+
const blockWidth = iconWidth + minGap;
|
|
5457
|
+
setTimeout(
|
|
5458
|
+
() => ResponsiveContainer.setBreakpoints.current(getBreakpoints(blockWidth)),
|
|
5459
|
+
0
|
|
5460
|
+
);
|
|
5461
|
+
}
|
|
5462
|
+
return /* @__PURE__ */ jsx(ResponsiveContainer, {});
|
|
5463
|
+
};
|
|
5464
|
+
IconsListNonForwarded.displayName = "IconsList";
|
|
5465
|
+
const IconsList = forwardRef(
|
|
5466
|
+
IconsListNonForwarded
|
|
5467
|
+
);
|
|
5546
5468
|
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5469
|
+
function importComponent(path) {
|
|
5470
|
+
return lazy(() => {
|
|
5471
|
+
return new Promise((resolve) => {
|
|
5472
|
+
import(
|
|
5473
|
+
/* webpackInclude: /\.tsx?$/ */
|
|
5474
|
+
`/customComponents/${path}`
|
|
5475
|
+
).then((result) => {
|
|
5476
|
+
resolve(result);
|
|
5477
|
+
}).catch((error) => {
|
|
5478
|
+
resolve({
|
|
5479
|
+
default: () => {
|
|
5480
|
+
console.error(error);
|
|
5481
|
+
return /* @__PURE__ */ jsx(Fragment, { children: "Error" });
|
|
5482
|
+
}
|
|
5483
|
+
});
|
|
5484
|
+
});
|
|
5485
|
+
});
|
|
5486
|
+
});
|
|
5553
5487
|
}
|
|
5554
5488
|
|
|
5555
5489
|
var __defProp$5 = Object.defineProperty;
|
|
@@ -5568,39 +5502,55 @@ var __spreadValues$5 = (a, b) => {
|
|
|
5568
5502
|
}
|
|
5569
5503
|
return a;
|
|
5570
5504
|
};
|
|
5571
|
-
const
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
"
|
|
5585
|
-
|
|
5586
|
-
"
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5505
|
+
const styles = {
|
|
5506
|
+
backgroundColor: "palette.background.default",
|
|
5507
|
+
"ul.listbox__list": {
|
|
5508
|
+
display: "flex",
|
|
5509
|
+
padding: "4px",
|
|
5510
|
+
gap: "2px",
|
|
5511
|
+
"[data-separator]": {
|
|
5512
|
+
"&:focus, &.focused": {
|
|
5513
|
+
outline: "none"
|
|
5514
|
+
}
|
|
5515
|
+
},
|
|
5516
|
+
".listbox__row": {
|
|
5517
|
+
p: 0,
|
|
5518
|
+
display: "flex",
|
|
5519
|
+
alignItems: "center",
|
|
5520
|
+
justifyContent: "center"
|
|
5521
|
+
},
|
|
5522
|
+
".iconButton": {
|
|
5523
|
+
borderRadius: "4px",
|
|
5524
|
+
height: "32px",
|
|
5525
|
+
width: "32px",
|
|
5526
|
+
background: "transparent",
|
|
5527
|
+
svg: {
|
|
5528
|
+
path: {
|
|
5529
|
+
fill: "palette.text.primary"
|
|
5530
|
+
}
|
|
5531
|
+
},
|
|
5532
|
+
"&:disabled": {
|
|
5533
|
+
svg: {
|
|
5534
|
+
path: {
|
|
5535
|
+
fill: "palette.border.section"
|
|
5596
5536
|
}
|
|
5597
|
-
}
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5537
|
+
}
|
|
5538
|
+
}
|
|
5539
|
+
},
|
|
5540
|
+
".separator": {
|
|
5541
|
+
borderLeft: "1px solid",
|
|
5542
|
+
borderRight: "1px solid",
|
|
5543
|
+
borderColor: "palette.gray.750",
|
|
5544
|
+
height: "60%",
|
|
5545
|
+
width: "3px"
|
|
5546
|
+
},
|
|
5547
|
+
".toggled": (theme) => {
|
|
5548
|
+
return __spreadValues$5({}, theme.palette.getOneState(
|
|
5549
|
+
{ backgroundColor: theme.palette.background.default },
|
|
5550
|
+
"selected"
|
|
5551
|
+
));
|
|
5602
5552
|
}
|
|
5603
|
-
|
|
5553
|
+
}
|
|
5604
5554
|
};
|
|
5605
5555
|
|
|
5606
5556
|
var __defProp$4 = Object.defineProperty;
|
|
@@ -5619,291 +5569,470 @@ var __spreadValues$4 = (a, b) => {
|
|
|
5619
5569
|
}
|
|
5620
5570
|
return a;
|
|
5621
5571
|
};
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
|
|
5633
|
-
|
|
5634
|
-
|
|
5635
|
-
|
|
5572
|
+
class ToolbarController extends EventEmitter {
|
|
5573
|
+
constructor() {
|
|
5574
|
+
super(...arguments);
|
|
5575
|
+
this.eventListeners = {};
|
|
5576
|
+
this.itemsState = {};
|
|
5577
|
+
this.hooks = {
|
|
5578
|
+
useItemState: (id, initialState) => {
|
|
5579
|
+
const [state, setState] = useState(initialState);
|
|
5580
|
+
useEffect(() => {
|
|
5581
|
+
this.itemsState[id] = initialState;
|
|
5582
|
+
this.on("updateItemState", (evId) => {
|
|
5583
|
+
if (evId === id) {
|
|
5584
|
+
setState(__spreadValues$4({}, this.itemsState[id]));
|
|
5585
|
+
}
|
|
5586
|
+
});
|
|
5587
|
+
}, []);
|
|
5588
|
+
return state;
|
|
5589
|
+
}
|
|
5590
|
+
};
|
|
5591
|
+
this.setItemState = (id, newState) => {
|
|
5592
|
+
this.itemsState[id] = __spreadValues$4(__spreadValues$4({}, this.itemsState[id]), newState);
|
|
5593
|
+
this.emit("updateItemState", id);
|
|
5594
|
+
};
|
|
5595
|
+
this.Context = ({ children }) => {
|
|
5596
|
+
return /* @__PURE__ */ jsx(ToolbarControllerContext.Provider, { value: this, children });
|
|
5597
|
+
};
|
|
5598
|
+
}
|
|
5599
|
+
}
|
|
5600
|
+
const ToolbarControllerContext = createContext(
|
|
5601
|
+
null
|
|
5602
|
+
);
|
|
5603
|
+
const useToolbarControllerContext = () => {
|
|
5604
|
+
const context = useContext(ToolbarControllerContext);
|
|
5605
|
+
if (!context)
|
|
5606
|
+
throw new Error("There is no Toolbar controller context");
|
|
5607
|
+
return context;
|
|
5608
|
+
};
|
|
5609
|
+
|
|
5610
|
+
var __defProp$3 = Object.defineProperty;
|
|
5611
|
+
var __getOwnPropSymbols$3 = Object.getOwnPropertySymbols;
|
|
5612
|
+
var __hasOwnProp$3 = Object.prototype.hasOwnProperty;
|
|
5613
|
+
var __propIsEnum$3 = Object.prototype.propertyIsEnumerable;
|
|
5614
|
+
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5615
|
+
var __spreadValues$3 = (a, b) => {
|
|
5616
|
+
for (var prop in b || (b = {}))
|
|
5617
|
+
if (__hasOwnProp$3.call(b, prop))
|
|
5618
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
5619
|
+
if (__getOwnPropSymbols$3)
|
|
5620
|
+
for (var prop of __getOwnPropSymbols$3(b)) {
|
|
5621
|
+
if (__propIsEnum$3.call(b, prop))
|
|
5622
|
+
__defNormalProp$3(a, prop, b[prop]);
|
|
5623
|
+
}
|
|
5624
|
+
return a;
|
|
5625
|
+
};
|
|
5626
|
+
const ToolbarItemButton = ({
|
|
5627
|
+
id,
|
|
5628
|
+
action,
|
|
5629
|
+
allowToggle,
|
|
5630
|
+
defaultToggled,
|
|
5631
|
+
disabled,
|
|
5632
|
+
icon,
|
|
5633
|
+
iconSize,
|
|
5634
|
+
title,
|
|
5635
|
+
toggled: toggledProp
|
|
5636
|
+
}) => {
|
|
5637
|
+
const [innerIsToggled, setInnerIsToggled] = useState(
|
|
5638
|
+
toggledProp != null ? toggledProp : allowToggle ? defaultToggled != null ? defaultToggled : false : false
|
|
5639
|
+
);
|
|
5640
|
+
const [isDisabled, setIsDisabled] = useState(!!disabled);
|
|
5641
|
+
const lastToggledProp = useRef(toggledProp);
|
|
5642
|
+
if (toggledProp !== void 0 && innerIsToggled !== toggledProp && lastToggledProp.current !== toggledProp) {
|
|
5643
|
+
lastToggledProp.current = toggledProp;
|
|
5644
|
+
setInnerIsToggled(toggledProp);
|
|
5645
|
+
}
|
|
5646
|
+
const handleClick = useCallback(() => {
|
|
5647
|
+
if (lastToggledProp.current !== void 0) {
|
|
5648
|
+
action({ isToggled: !lastToggledProp.current });
|
|
5649
|
+
} else if (allowToggle) {
|
|
5650
|
+
let isToggled = false;
|
|
5651
|
+
setInnerIsToggled((current) => {
|
|
5652
|
+
isToggled = !current;
|
|
5653
|
+
return isToggled;
|
|
5654
|
+
});
|
|
5655
|
+
action({ isToggled });
|
|
5656
|
+
} else {
|
|
5657
|
+
action({ isToggled: false });
|
|
5658
|
+
}
|
|
5659
|
+
}, [action, allowToggle]);
|
|
5660
|
+
const context = useToolbarControllerContext();
|
|
5661
|
+
useEffect(() => {
|
|
5662
|
+
const unsuscribe1 = context.on("updateItemState", (evId) => {
|
|
5663
|
+
if (evId === id) {
|
|
5664
|
+
setInnerIsToggled(!!context.itemsState[evId].toggled);
|
|
5665
|
+
setIsDisabled(!!context.itemsState[evId].disabled);
|
|
5666
|
+
}
|
|
5667
|
+
});
|
|
5668
|
+
const unsuscribe2 = context.on("pressEnter", (evId) => {
|
|
5669
|
+
if (evId === id)
|
|
5670
|
+
handleClick();
|
|
5671
|
+
});
|
|
5672
|
+
return () => {
|
|
5673
|
+
unsuscribe1();
|
|
5674
|
+
unsuscribe2();
|
|
5675
|
+
};
|
|
5676
|
+
}, [context, id, handleClick]);
|
|
5677
|
+
useMount(() => {
|
|
5678
|
+
if (context.itemsState[id]) {
|
|
5679
|
+
if (context.itemsState[id].disabled !== void 0) {
|
|
5680
|
+
setIsDisabled(!!context.itemsState[id].disabled);
|
|
5681
|
+
}
|
|
5682
|
+
if (context.itemsState[id].toggled !== void 0) {
|
|
5683
|
+
setInnerIsToggled(!!context.itemsState[id].toggled);
|
|
5684
|
+
}
|
|
5685
|
+
} else
|
|
5686
|
+
context.itemsState[id] = __spreadValues$3({
|
|
5687
|
+
disabled: isDisabled,
|
|
5688
|
+
toggled: innerIsToggled
|
|
5689
|
+
}, context.itemsState[id]);
|
|
5690
|
+
});
|
|
5691
|
+
return /* @__PURE__ */ jsx(
|
|
5692
|
+
IconButton$2,
|
|
5693
|
+
{
|
|
5694
|
+
className: `toolbarItem ${innerIsToggled ? "toggled" : ""}`,
|
|
5695
|
+
size: iconSize != null ? iconSize : "Md",
|
|
5696
|
+
icon,
|
|
5697
|
+
onClick: handleClick,
|
|
5698
|
+
"data-id": id,
|
|
5699
|
+
title,
|
|
5700
|
+
disabled: isDisabled
|
|
5701
|
+
}
|
|
5702
|
+
);
|
|
5703
|
+
};
|
|
5704
|
+
|
|
5705
|
+
function isSeparator(params) {
|
|
5706
|
+
return !!params.separator;
|
|
5707
|
+
}
|
|
5708
|
+
|
|
5709
|
+
var __defProp$2 = Object.defineProperty;
|
|
5710
|
+
var __getOwnPropSymbols$2 = Object.getOwnPropertySymbols;
|
|
5711
|
+
var __hasOwnProp$2 = Object.prototype.hasOwnProperty;
|
|
5712
|
+
var __propIsEnum$2 = Object.prototype.propertyIsEnumerable;
|
|
5713
|
+
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5714
|
+
var __spreadValues$2 = (a, b) => {
|
|
5715
|
+
for (var prop in b || (b = {}))
|
|
5716
|
+
if (__hasOwnProp$2.call(b, prop))
|
|
5717
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
5718
|
+
if (__getOwnPropSymbols$2)
|
|
5719
|
+
for (var prop of __getOwnPropSymbols$2(b)) {
|
|
5720
|
+
if (__propIsEnum$2.call(b, prop))
|
|
5721
|
+
__defNormalProp$2(a, prop, b[prop]);
|
|
5722
|
+
}
|
|
5723
|
+
return a;
|
|
5724
|
+
};
|
|
5725
|
+
const ToolbarItem = (props) => {
|
|
5726
|
+
if (isSeparator(props)) {
|
|
5727
|
+
return /* @__PURE__ */ jsx(Box, { className: "separator", children: "\xA0" });
|
|
5728
|
+
}
|
|
5729
|
+
return /* @__PURE__ */ jsx(ToolbarItemButton, __spreadValues$2({}, props));
|
|
5636
5730
|
};
|
|
5637
5731
|
|
|
5638
|
-
const
|
|
5639
|
-
|
|
5640
|
-
|
|
5641
|
-
|
|
5732
|
+
const Toolbar = makeStyledComponent(
|
|
5733
|
+
"toolbar",
|
|
5734
|
+
"layout.components.toolbar",
|
|
5735
|
+
styles,
|
|
5736
|
+
({ children, getController }) => {
|
|
5737
|
+
const controller = useMemo(() => new ToolbarController(), []);
|
|
5738
|
+
let separator = 0;
|
|
5739
|
+
useMount(() => {
|
|
5740
|
+
getController == null ? void 0 : getController(controller);
|
|
5741
|
+
});
|
|
5742
|
+
return /* @__PURE__ */ jsx(controller.Context, { children: /* @__PURE__ */ jsx(
|
|
5743
|
+
Listbox,
|
|
5642
5744
|
{
|
|
5643
|
-
className: "
|
|
5644
|
-
|
|
5645
|
-
|
|
5646
|
-
|
|
5647
|
-
|
|
5648
|
-
|
|
5649
|
-
|
|
5650
|
-
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
|
|
5654
|
-
var _a, _b, _c;
|
|
5655
|
-
const propsRef = useLatest(props);
|
|
5656
|
-
let render = () => {
|
|
5657
|
-
};
|
|
5658
|
-
const previousProps = usePrevious(props);
|
|
5659
|
-
if (!shallowEqual(props, previousProps.current)) {
|
|
5660
|
-
setTimeout(() => render(), 0);
|
|
5661
|
-
}
|
|
5662
|
-
const ResponsiveContainer = useMemo(() => {
|
|
5663
|
-
var _a2, _b2;
|
|
5664
|
-
const iconWidth = (_a2 = propsRef.current.iconWidth) != null ? _a2 : 100;
|
|
5665
|
-
const minGap = (_b2 = propsRef.current.minHorizontalGap) != null ? _b2 : 30;
|
|
5666
|
-
const blockWidth = iconWidth + minGap;
|
|
5667
|
-
const styledComponent = (styledComponentProps) => {
|
|
5668
|
-
var _a3, _b3;
|
|
5669
|
-
const { breakPoint, containerWidth } = styledComponentProps;
|
|
5670
|
-
const [, doRender] = useState(true);
|
|
5671
|
-
render = useCallback(() => doRender((current) => !current), []);
|
|
5672
|
-
const storeId = useMemo(() => uniqueId("IconsList"), []);
|
|
5673
|
-
const [actions, , , , Context] = useStore({ storeId });
|
|
5674
|
-
const rows = Math.ceil(propsRef.current.icons.length / breakPoint);
|
|
5675
|
-
const sx = useStyles({
|
|
5676
|
-
breakPoint,
|
|
5677
|
-
containerWidth,
|
|
5678
|
-
iconWidth: (_a3 = propsRef.current.iconWidth) != null ? _a3 : 100,
|
|
5679
|
-
verticalGap: propsRef.current.verticalGap,
|
|
5680
|
-
removeHorizontalPadding: propsRef.current.removeHorizontalPadding
|
|
5681
|
-
});
|
|
5682
|
-
useEffect(() => {
|
|
5683
|
-
actions.recalculateIndexByResize();
|
|
5684
|
-
}, [breakPoint]);
|
|
5685
|
-
const IconRenderer = (_b3 = propsRef.current.iconRenderer) != null ? _b3 : DefaultIconRenderer;
|
|
5686
|
-
return /* @__PURE__ */ jsx(IconRendererContext.Provider, { value: IconRenderer, children: /* @__PURE__ */ jsx(Context, { children: /* @__PURE__ */ jsx(
|
|
5687
|
-
KeyHandler,
|
|
5688
|
-
{
|
|
5689
|
-
icons: propsRef.current.icons,
|
|
5690
|
-
onIconClick: propsRef.current.onIconClick,
|
|
5691
|
-
onIconDoubleClick: propsRef.current.onIconDoubleClick,
|
|
5692
|
-
onIconGetDetails: propsRef.current.onIconGetDetails,
|
|
5693
|
-
onIconKeyDown: propsRef.current.onIconKeyDown,
|
|
5694
|
-
storeId,
|
|
5695
|
-
children: /* @__PURE__ */ jsx(
|
|
5696
|
-
Box,
|
|
5697
|
-
{
|
|
5698
|
-
id: storeId,
|
|
5699
|
-
role: "grid",
|
|
5700
|
-
"aria-rowcount": rows,
|
|
5701
|
-
"aria-colcount": breakPoint,
|
|
5702
|
-
children: arrayOrArray(rows).fill(1).map((_, i) => {
|
|
5703
|
-
const icons = getRowIcons({
|
|
5704
|
-
breakPoint,
|
|
5705
|
-
i,
|
|
5706
|
-
icons: propsRef.current.icons
|
|
5707
|
-
});
|
|
5708
|
-
return /* @__PURE__ */ jsx(
|
|
5709
|
-
Grid,
|
|
5710
|
-
{
|
|
5711
|
-
"aria-rowindex": i + 1,
|
|
5712
|
-
role: "row",
|
|
5713
|
-
ref,
|
|
5714
|
-
sx,
|
|
5715
|
-
children: icons.map((current, j) => {
|
|
5716
|
-
var _a4;
|
|
5717
|
-
return /* @__PURE__ */ jsx(
|
|
5718
|
-
IconWrapper,
|
|
5719
|
-
{
|
|
5720
|
-
colIndex: j + 1,
|
|
5721
|
-
icon: current,
|
|
5722
|
-
iconWidth: (_a4 = propsRef.current.iconWidth) != null ? _a4 : 100,
|
|
5723
|
-
rowIndex: i + 1
|
|
5724
|
-
},
|
|
5725
|
-
uniqueId(String(j + i))
|
|
5726
|
-
);
|
|
5727
|
-
})
|
|
5728
|
-
},
|
|
5729
|
-
i
|
|
5730
|
-
);
|
|
5731
|
-
})
|
|
5745
|
+
className: "toolbar",
|
|
5746
|
+
onPressKeyOnNode: (ev) => {
|
|
5747
|
+
if (ev.code === "Enter" || ev.code === "Space") {
|
|
5748
|
+
const target = ev.target;
|
|
5749
|
+
const item = target.querySelector(".toolbarItem");
|
|
5750
|
+
const id = item.dataset.id;
|
|
5751
|
+
if (!id) {
|
|
5752
|
+
console.error("Error event", ev);
|
|
5753
|
+
throw new Error(
|
|
5754
|
+
"Cannot find target in toolbar press enter event."
|
|
5755
|
+
);
|
|
5732
5756
|
}
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
setTimeout(
|
|
5754
|
-
() => ResponsiveContainer.setBreakpoints.current(getBreakpoints(blockWidth)),
|
|
5755
|
-
0
|
|
5756
|
-
);
|
|
5757
|
+
controller.emit("pressEnter", id);
|
|
5758
|
+
}
|
|
5759
|
+
},
|
|
5760
|
+
children: Children.toArray(children).map((current) => {
|
|
5761
|
+
const props = current == null ? void 0 : current.props;
|
|
5762
|
+
if (!props)
|
|
5763
|
+
throw new Error("Toolbar items must be of ToolbarItem type.");
|
|
5764
|
+
const { id, title } = props;
|
|
5765
|
+
return /* @__PURE__ */ jsx(
|
|
5766
|
+
ListboxItem,
|
|
5767
|
+
{
|
|
5768
|
+
label: title,
|
|
5769
|
+
"data-separator": id ? void 0 : "true",
|
|
5770
|
+
children: current
|
|
5771
|
+
},
|
|
5772
|
+
id != null ? id : `separator${separator++}`
|
|
5773
|
+
);
|
|
5774
|
+
})
|
|
5775
|
+
}
|
|
5776
|
+
) });
|
|
5757
5777
|
}
|
|
5758
|
-
return /* @__PURE__ */ jsx(ResponsiveContainer, {});
|
|
5759
|
-
};
|
|
5760
|
-
IconsListNonForwarded.displayName = "IconsList";
|
|
5761
|
-
const IconsList = forwardRef(
|
|
5762
|
-
IconsListNonForwarded
|
|
5763
5778
|
);
|
|
5764
5779
|
|
|
5765
|
-
function
|
|
5766
|
-
return
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
|
|
5777
|
-
|
|
5778
|
-
|
|
5779
|
-
|
|
5780
|
-
|
|
5781
|
-
|
|
5782
|
-
}
|
|
5780
|
+
function isAttachToElementAFunction(attachToElement) {
|
|
5781
|
+
return attachToElement instanceof Function && getParamNames(attachToElement).length === 0;
|
|
5782
|
+
}
|
|
5783
|
+
|
|
5784
|
+
const STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm;
|
|
5785
|
+
const ARGUMENT_NAMES = /([^\s,]+)/g;
|
|
5786
|
+
function getParamNames(func) {
|
|
5787
|
+
const fnStr = func.toString().replace(STRIP_COMMENTS, "");
|
|
5788
|
+
let result = fnStr.slice(fnStr.indexOf("(") + 1, fnStr.indexOf(")")).match(ARGUMENT_NAMES);
|
|
5789
|
+
if (result === null)
|
|
5790
|
+
result = [];
|
|
5791
|
+
return result;
|
|
5792
|
+
}
|
|
5793
|
+
function determineAnchorPoint({
|
|
5794
|
+
attachToElement,
|
|
5795
|
+
attachToElementAnchorPoint
|
|
5796
|
+
}) {
|
|
5797
|
+
let actualAnchorPoint = { left: 0, top: 0 };
|
|
5798
|
+
const element = isAttachToElementAFunction(attachToElement) ? attachToElement() : attachToElement.current;
|
|
5799
|
+
if (element) {
|
|
5800
|
+
const rect = element.getBoundingClientRect();
|
|
5801
|
+
const point = attachToElementAnchorPoint != null ? attachToElementAnchorPoint : "topRight";
|
|
5802
|
+
switch (point) {
|
|
5803
|
+
case "bottomLeft":
|
|
5804
|
+
actualAnchorPoint = {
|
|
5805
|
+
left: rect.left,
|
|
5806
|
+
top: rect.bottom
|
|
5807
|
+
};
|
|
5808
|
+
break;
|
|
5809
|
+
case "bottomRight":
|
|
5810
|
+
actualAnchorPoint = {
|
|
5811
|
+
left: rect.right,
|
|
5812
|
+
top: rect.bottom
|
|
5813
|
+
};
|
|
5814
|
+
break;
|
|
5815
|
+
case "center":
|
|
5816
|
+
actualAnchorPoint = {
|
|
5817
|
+
left: (rect.left + rect.right) / 2,
|
|
5818
|
+
top: (rect.bottom + rect.top) / 2
|
|
5819
|
+
};
|
|
5820
|
+
break;
|
|
5821
|
+
case "topLeft":
|
|
5822
|
+
actualAnchorPoint = {
|
|
5823
|
+
left: rect.left,
|
|
5824
|
+
top: rect.top
|
|
5825
|
+
};
|
|
5826
|
+
break;
|
|
5827
|
+
case "topRight":
|
|
5828
|
+
actualAnchorPoint = {
|
|
5829
|
+
left: rect.right,
|
|
5830
|
+
top: rect.top
|
|
5831
|
+
};
|
|
5832
|
+
break;
|
|
5833
|
+
}
|
|
5834
|
+
} else {
|
|
5835
|
+
console.warn(
|
|
5836
|
+
"Cannot resolve element, will use default positioning ",
|
|
5837
|
+
attachToElement
|
|
5838
|
+
);
|
|
5839
|
+
}
|
|
5840
|
+
return actualAnchorPoint;
|
|
5783
5841
|
}
|
|
5784
|
-
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
5789
|
-
|
|
5790
|
-
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5842
|
+
function calculateTooltipPosition({
|
|
5843
|
+
anchorPoint,
|
|
5844
|
+
attachToElement,
|
|
5845
|
+
attachToElementAnchorPoint,
|
|
5846
|
+
minSize,
|
|
5847
|
+
preferredOrientationX,
|
|
5848
|
+
preferredOrientationY,
|
|
5849
|
+
preferredSize = { height: "auto", width: "auto" }
|
|
5850
|
+
}) {
|
|
5851
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
5852
|
+
let actualAnchorPoint = anchorPoint;
|
|
5853
|
+
if (attachToElement) {
|
|
5854
|
+
actualAnchorPoint = determineAnchorPoint({
|
|
5855
|
+
attachToElement,
|
|
5856
|
+
attachToElementAnchorPoint
|
|
5857
|
+
});
|
|
5858
|
+
}
|
|
5859
|
+
if (actualAnchorPoint) {
|
|
5860
|
+
const availableBottomSpace = window.innerHeight - actualAnchorPoint.top;
|
|
5861
|
+
const availableTopSpace = actualAnchorPoint.top;
|
|
5862
|
+
const availableLeftSpace = actualAnchorPoint.left;
|
|
5863
|
+
const availableRightSpace = window.innerWidth - actualAnchorPoint.left;
|
|
5864
|
+
const isEnoughToRight = ((_a = minSize == null ? void 0 : minSize.width) != null ? _a : 0) <= availableRightSpace;
|
|
5865
|
+
const isEnoughToLeft = ((_b = minSize == null ? void 0 : minSize.width) != null ? _b : 0) <= availableLeftSpace;
|
|
5866
|
+
const isEnoughToBottom = ((_c = minSize == null ? void 0 : minSize.height) != null ? _c : 0) <= availableBottomSpace;
|
|
5867
|
+
const isEnoughToTop = ((_d = minSize == null ? void 0 : minSize.height) != null ? _d : 0) <= availableTopSpace;
|
|
5868
|
+
const preferredWidth = preferredSize.width === "auto" ? Infinity : preferredSize.width;
|
|
5869
|
+
const preferredHeight = preferredSize.height === "auto" ? Infinity : preferredSize.height;
|
|
5870
|
+
const position = {
|
|
5871
|
+
"& > *": {
|
|
5872
|
+
width: "100%",
|
|
5873
|
+
height: "100%"
|
|
5874
|
+
},
|
|
5875
|
+
width: preferredSize.width === "auto" ? "auto" : "100%",
|
|
5876
|
+
height: preferredSize.height === "auto" ? "auto" : "100%"
|
|
5877
|
+
};
|
|
5878
|
+
if (preferredOrientationX === "left") {
|
|
5879
|
+
if (isEnoughToLeft) {
|
|
5880
|
+
position.maxWidth = Math.min(preferredWidth, availableLeftSpace);
|
|
5881
|
+
position.right = window.innerWidth - actualAnchorPoint.left;
|
|
5882
|
+
} else if (isEnoughToRight) {
|
|
5883
|
+
position.maxWidth = Math.min(preferredWidth, availableRightSpace);
|
|
5884
|
+
position.left = actualAnchorPoint.left;
|
|
5885
|
+
} else {
|
|
5886
|
+
position.left = 0;
|
|
5887
|
+
position.maxWidth = "100vw";
|
|
5888
|
+
}
|
|
5889
|
+
} else {
|
|
5890
|
+
if (isEnoughToRight) {
|
|
5891
|
+
position.maxWidth = Math.min(preferredWidth, availableRightSpace);
|
|
5892
|
+
position.left = actualAnchorPoint.left;
|
|
5893
|
+
} else if (isEnoughToLeft) {
|
|
5894
|
+
position.maxWidth = Math.min(preferredWidth, availableLeftSpace);
|
|
5895
|
+
position.right = window.innerWidth - actualAnchorPoint.left;
|
|
5896
|
+
} else {
|
|
5897
|
+
position.left = 0;
|
|
5898
|
+
position.maxWidth = "100vw";
|
|
5899
|
+
}
|
|
5798
5900
|
}
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
outline: "none"
|
|
5901
|
+
if (preferredOrientationY === "top") {
|
|
5902
|
+
if (isEnoughToTop) {
|
|
5903
|
+
position.maxHeight = Math.min(preferredHeight, availableTopSpace);
|
|
5904
|
+
position.bottom = window.innerHeight - actualAnchorPoint.top;
|
|
5905
|
+
} else if (isEnoughToBottom) {
|
|
5906
|
+
position.maxHeight = Math.min(preferredHeight, availableBottomSpace);
|
|
5907
|
+
position.top = actualAnchorPoint.top;
|
|
5908
|
+
} else {
|
|
5909
|
+
position.maxHeight = "100vh";
|
|
5910
|
+
position.top = 0;
|
|
5810
5911
|
}
|
|
5811
|
-
}
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
width: "32px",
|
|
5822
|
-
background: "transparent",
|
|
5823
|
-
svg: {
|
|
5824
|
-
path: {
|
|
5825
|
-
fill: "palette.text.primary"
|
|
5826
|
-
}
|
|
5827
|
-
},
|
|
5828
|
-
"&:disabled": {
|
|
5829
|
-
svg: {
|
|
5830
|
-
path: {
|
|
5831
|
-
fill: "palette.border.section"
|
|
5832
|
-
}
|
|
5833
|
-
}
|
|
5912
|
+
} else {
|
|
5913
|
+
if (isEnoughToBottom) {
|
|
5914
|
+
position.maxHeight = Math.min(preferredHeight, availableBottomSpace);
|
|
5915
|
+
position.top = actualAnchorPoint.top;
|
|
5916
|
+
} else if (isEnoughToTop) {
|
|
5917
|
+
position.maxHeight = Math.min(preferredHeight, availableTopSpace);
|
|
5918
|
+
position.bottom = window.innerHeight - actualAnchorPoint.top;
|
|
5919
|
+
} else {
|
|
5920
|
+
position.maxHeight = "100vh";
|
|
5921
|
+
position.top = 0;
|
|
5834
5922
|
}
|
|
5835
|
-
},
|
|
5836
|
-
".separator": {
|
|
5837
|
-
borderLeft: "1px solid",
|
|
5838
|
-
borderRight: "1px solid",
|
|
5839
|
-
borderColor: "palette.gray.750",
|
|
5840
|
-
height: "60%",
|
|
5841
|
-
width: "3px"
|
|
5842
|
-
},
|
|
5843
|
-
".toggled": (theme) => {
|
|
5844
|
-
return __spreadValues$3({}, theme.palette.getOneState(
|
|
5845
|
-
{ backgroundColor: theme.palette.background.default },
|
|
5846
|
-
"selected"
|
|
5847
|
-
));
|
|
5848
5923
|
}
|
|
5924
|
+
position.minHeight = typeof position.maxHeight === "number" ? Math.min(position.maxHeight, (_e = minSize == null ? void 0 : minSize.height) != null ? _e : 0) : (_f = minSize == null ? void 0 : minSize.height) != null ? _f : 0;
|
|
5925
|
+
position.minWidth = typeof position.minWidth === "number" ? Math.min(position.minWidth, (_g = minSize == null ? void 0 : minSize.width) != null ? _g : 0) : (_h = minSize == null ? void 0 : minSize.width) != null ? _h : 0;
|
|
5926
|
+
return position;
|
|
5849
5927
|
}
|
|
5850
|
-
};
|
|
5851
|
-
|
|
5852
|
-
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
|
|
5860
|
-
|
|
5861
|
-
|
|
5862
|
-
|
|
5863
|
-
|
|
5864
|
-
|
|
5928
|
+
return { left: 0, top: 0, width: "auto", height: "auto" };
|
|
5929
|
+
}
|
|
5930
|
+
function useHandlers({
|
|
5931
|
+
attachToElement,
|
|
5932
|
+
closeOnClick,
|
|
5933
|
+
closeOnClickOut,
|
|
5934
|
+
closeOnEscape,
|
|
5935
|
+
closeOnMouseLeaveTooltip,
|
|
5936
|
+
closeOnMouseLeaveAttachedElement,
|
|
5937
|
+
closeOnScrollOut,
|
|
5938
|
+
onClose
|
|
5939
|
+
}) {
|
|
5940
|
+
const hasInited = useRef(false);
|
|
5941
|
+
const close = useCallback(() => {
|
|
5942
|
+
onClose == null ? void 0 : onClose();
|
|
5943
|
+
}, [onClose]);
|
|
5944
|
+
useMount(() => {
|
|
5945
|
+
function handleEscape(ev) {
|
|
5946
|
+
if (ev.code === "Escape" && closeOnEscape) {
|
|
5947
|
+
close();
|
|
5948
|
+
}
|
|
5865
5949
|
}
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5872
|
-
|
|
5873
|
-
|
|
5874
|
-
|
|
5875
|
-
|
|
5876
|
-
|
|
5877
|
-
this.itemsState[id] = initialState;
|
|
5878
|
-
this.on("updateItemState", (evId) => {
|
|
5879
|
-
if (evId === id) {
|
|
5880
|
-
setState(__spreadValues$2({}, this.itemsState[id]));
|
|
5881
|
-
}
|
|
5882
|
-
});
|
|
5883
|
-
}, []);
|
|
5884
|
-
return state;
|
|
5950
|
+
function handleMouseDownOut(ev) {
|
|
5951
|
+
if (!hasInited.current)
|
|
5952
|
+
return;
|
|
5953
|
+
if (closeOnClickOut && !isChild(
|
|
5954
|
+
ev.target,
|
|
5955
|
+
(current) => {
|
|
5956
|
+
var _a;
|
|
5957
|
+
return (_a = current.classList) == null ? void 0 : _a.contains("tooltip__wrapper");
|
|
5958
|
+
}
|
|
5959
|
+
)) {
|
|
5960
|
+
close();
|
|
5885
5961
|
}
|
|
5962
|
+
}
|
|
5963
|
+
function handleScroll(ev) {
|
|
5964
|
+
if (!hasInited.current)
|
|
5965
|
+
return;
|
|
5966
|
+
if (closeOnScrollOut && !isChild(
|
|
5967
|
+
ev.target,
|
|
5968
|
+
(current) => {
|
|
5969
|
+
var _a;
|
|
5970
|
+
return (_a = current.classList) == null ? void 0 : _a.contains("tooltip__wrapper");
|
|
5971
|
+
}
|
|
5972
|
+
)) {
|
|
5973
|
+
close();
|
|
5974
|
+
}
|
|
5975
|
+
}
|
|
5976
|
+
function handleMouseLeave(event) {
|
|
5977
|
+
if (!hasInited.current || !closeOnMouseLeaveAttachedElement && !closeOnMouseLeaveTooltip)
|
|
5978
|
+
return;
|
|
5979
|
+
const resolvedAttachToElement = attachToElement ? isAttachToElementAFunction(attachToElement) ? attachToElement() : attachToElement.current : null;
|
|
5980
|
+
const isTooltipTheTarget = isChild(
|
|
5981
|
+
event.target,
|
|
5982
|
+
(current) => current.classList.contains("tooltip__wrapper")
|
|
5983
|
+
);
|
|
5984
|
+
const isAttachedTheTarget = isChild(
|
|
5985
|
+
event.target,
|
|
5986
|
+
(current) => current === resolvedAttachToElement
|
|
5987
|
+
);
|
|
5988
|
+
const isTooltipRelated = isChild(
|
|
5989
|
+
event.relatedTarget,
|
|
5990
|
+
(current) => current.classList.contains("tooltip__wrapper")
|
|
5991
|
+
);
|
|
5992
|
+
const isAttachedRelated = isChild(
|
|
5993
|
+
event.relatedTarget,
|
|
5994
|
+
(current) => current === resolvedAttachToElement
|
|
5995
|
+
);
|
|
5996
|
+
if (!isTooltipTheTarget && !isAttachedTheTarget && !closeOnMouseLeaveAttachedElement && !closeOnMouseLeaveTooltip)
|
|
5997
|
+
return;
|
|
5998
|
+
if (isTooltipRelated || isAttachedRelated)
|
|
5999
|
+
return;
|
|
6000
|
+
if (isAttachedTheTarget && !closeOnMouseLeaveAttachedElement)
|
|
6001
|
+
return;
|
|
6002
|
+
if (isTooltipTheTarget && !closeOnMouseLeaveTooltip)
|
|
6003
|
+
return;
|
|
6004
|
+
close();
|
|
6005
|
+
}
|
|
6006
|
+
document.addEventListener("keydown", handleEscape);
|
|
6007
|
+
document.addEventListener("mousedown", handleMouseDownOut);
|
|
6008
|
+
document.addEventListener("scroll", handleScroll);
|
|
6009
|
+
document.addEventListener("mouseout", handleMouseLeave);
|
|
6010
|
+
setTimeout(() => {
|
|
6011
|
+
hasInited.current = true;
|
|
6012
|
+
}, 0);
|
|
6013
|
+
return () => {
|
|
6014
|
+
document.removeEventListener("keydown", handleEscape);
|
|
6015
|
+
document.removeEventListener("click", handleMouseDownOut);
|
|
6016
|
+
document.removeEventListener("scroll", handleScroll);
|
|
6017
|
+
document.removeEventListener("mouseout", handleMouseLeave);
|
|
5886
6018
|
};
|
|
5887
|
-
|
|
5888
|
-
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
6019
|
+
});
|
|
6020
|
+
return {
|
|
6021
|
+
handleOnClick: useCallback(
|
|
6022
|
+
(ev) => {
|
|
6023
|
+
ev.stopPropagation();
|
|
6024
|
+
if (closeOnClick) {
|
|
6025
|
+
close();
|
|
6026
|
+
}
|
|
6027
|
+
},
|
|
6028
|
+
[close, closeOnClick]
|
|
6029
|
+
)
|
|
6030
|
+
};
|
|
5895
6031
|
}
|
|
5896
|
-
const ToolbarControllerContext = createContext(
|
|
5897
|
-
null
|
|
5898
|
-
);
|
|
5899
|
-
const useToolbarControllerContext = () => {
|
|
5900
|
-
const context = useContext(ToolbarControllerContext);
|
|
5901
|
-
if (!context)
|
|
5902
|
-
throw new Error("There is no Toolbar controller context");
|
|
5903
|
-
return context;
|
|
5904
|
-
};
|
|
5905
6032
|
|
|
5906
6033
|
var __defProp$1 = Object.defineProperty;
|
|
6034
|
+
var __defProps$1 = Object.defineProperties;
|
|
6035
|
+
var __getOwnPropDescs$1 = Object.getOwnPropertyDescriptors;
|
|
5907
6036
|
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
5908
6037
|
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
5909
6038
|
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
@@ -5919,90 +6048,63 @@ var __spreadValues$1 = (a, b) => {
|
|
|
5919
6048
|
}
|
|
5920
6049
|
return a;
|
|
5921
6050
|
};
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
6051
|
+
var __spreadProps$1 = (a, b) => __defProps$1(a, __getOwnPropDescs$1(b));
|
|
6052
|
+
const Tooltip = ({
|
|
6053
|
+
anchorPoint,
|
|
6054
|
+
attachToElement,
|
|
6055
|
+
attachToElementAnchorPoint,
|
|
6056
|
+
children,
|
|
6057
|
+
className,
|
|
6058
|
+
closeOnClick = false,
|
|
6059
|
+
closeOnClickOut = true,
|
|
6060
|
+
closeOnEscape = true,
|
|
6061
|
+
closeOnMouseLeaveTooltip = true,
|
|
6062
|
+
closeOnMouseLeaveAttachedElement = true,
|
|
6063
|
+
closeOnScrollOut = true,
|
|
6064
|
+
minSize,
|
|
6065
|
+
onClose,
|
|
6066
|
+
preferredOrientationX = "right",
|
|
6067
|
+
preferredOrientationY = "bottom",
|
|
6068
|
+
preferredSize = { height: "auto", width: "auto" },
|
|
6069
|
+
variant = "layout.common.tooltips.primary"
|
|
5932
6070
|
}) => {
|
|
5933
|
-
const
|
|
5934
|
-
|
|
5935
|
-
|
|
5936
|
-
|
|
5937
|
-
|
|
5938
|
-
|
|
5939
|
-
|
|
5940
|
-
|
|
5941
|
-
}
|
|
5942
|
-
const
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
}
|
|
5955
|
-
}, [action, allowToggle]);
|
|
5956
|
-
const context = useToolbarControllerContext();
|
|
5957
|
-
useEffect(() => {
|
|
5958
|
-
const unsuscribe1 = context.on("updateItemState", (evId) => {
|
|
5959
|
-
if (evId === id) {
|
|
5960
|
-
setInnerIsToggled(!!context.itemsState[evId].toggled);
|
|
5961
|
-
setIsDisabled(!!context.itemsState[evId].disabled);
|
|
5962
|
-
}
|
|
5963
|
-
});
|
|
5964
|
-
const unsuscribe2 = context.on("pressEnter", (evId) => {
|
|
5965
|
-
if (evId === id)
|
|
5966
|
-
handleClick();
|
|
5967
|
-
});
|
|
5968
|
-
return () => {
|
|
5969
|
-
unsuscribe1();
|
|
5970
|
-
unsuscribe2();
|
|
5971
|
-
};
|
|
5972
|
-
}, [context, id, handleClick]);
|
|
5973
|
-
useMount(() => {
|
|
5974
|
-
if (context.itemsState[id]) {
|
|
5975
|
-
if (context.itemsState[id].disabled !== void 0) {
|
|
5976
|
-
setIsDisabled(!!context.itemsState[id].disabled);
|
|
5977
|
-
}
|
|
5978
|
-
if (context.itemsState[id].toggled !== void 0) {
|
|
5979
|
-
setInnerIsToggled(!!context.itemsState[id].toggled);
|
|
5980
|
-
}
|
|
5981
|
-
} else
|
|
5982
|
-
context.itemsState[id] = __spreadValues$1({
|
|
5983
|
-
disabled: isDisabled,
|
|
5984
|
-
toggled: innerIsToggled
|
|
5985
|
-
}, context.itemsState[id]);
|
|
6071
|
+
const calculatedPosition = calculateTooltipPosition({
|
|
6072
|
+
anchorPoint,
|
|
6073
|
+
attachToElement,
|
|
6074
|
+
attachToElementAnchorPoint,
|
|
6075
|
+
minSize,
|
|
6076
|
+
preferredOrientationX,
|
|
6077
|
+
preferredOrientationY,
|
|
6078
|
+
preferredSize
|
|
6079
|
+
});
|
|
6080
|
+
const sx = __spreadValues$1({
|
|
6081
|
+
position: "fixed"
|
|
6082
|
+
}, calculatedPosition);
|
|
6083
|
+
const { handleOnClick } = useHandlers({
|
|
6084
|
+
attachToElement,
|
|
6085
|
+
closeOnEscape,
|
|
6086
|
+
closeOnClickOut,
|
|
6087
|
+
closeOnClick,
|
|
6088
|
+
closeOnMouseLeaveTooltip,
|
|
6089
|
+
closeOnMouseLeaveAttachedElement,
|
|
6090
|
+
closeOnScrollOut,
|
|
6091
|
+
onClose
|
|
5986
6092
|
});
|
|
5987
6093
|
return /* @__PURE__ */ jsx(
|
|
5988
|
-
|
|
5989
|
-
{
|
|
5990
|
-
className: `
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
onClick:
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
disabled: isDisabled
|
|
5997
|
-
}
|
|
6094
|
+
Box,
|
|
6095
|
+
__spreadProps$1(__spreadValues$1({
|
|
6096
|
+
className: `tooltip__wrapper ${className != null ? className : ""}`
|
|
6097
|
+
}, getVariant(variant)), {
|
|
6098
|
+
sx,
|
|
6099
|
+
onClick: handleOnClick,
|
|
6100
|
+
children
|
|
6101
|
+
})
|
|
5998
6102
|
);
|
|
5999
6103
|
};
|
|
6000
6104
|
|
|
6001
|
-
function isSeparator(params) {
|
|
6002
|
-
return !!params.separator;
|
|
6003
|
-
}
|
|
6004
|
-
|
|
6005
6105
|
var __defProp = Object.defineProperty;
|
|
6106
|
+
var __defProps = Object.defineProperties;
|
|
6107
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6006
6108
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6007
6109
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6008
6110
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -6018,61 +6120,59 @@ var __spreadValues = (a, b) => {
|
|
|
6018
6120
|
}
|
|
6019
6121
|
return a;
|
|
6020
6122
|
};
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
({ children, getController }) => {
|
|
6033
|
-
const controller = useMemo(() => new ToolbarController(), []);
|
|
6034
|
-
let separator = 0;
|
|
6035
|
-
useMount(() => {
|
|
6036
|
-
getController == null ? void 0 : getController(controller);
|
|
6037
|
-
});
|
|
6038
|
-
return /* @__PURE__ */ jsx(controller.Context, { children: /* @__PURE__ */ jsx(
|
|
6039
|
-
Listbox,
|
|
6040
|
-
{
|
|
6041
|
-
className: "toolbar",
|
|
6042
|
-
onPressKeyOnNode: (ev) => {
|
|
6043
|
-
if (ev.code === "Enter" || ev.code === "Space") {
|
|
6044
|
-
const target = ev.target;
|
|
6045
|
-
const item = target.querySelector(".toolbarItem");
|
|
6046
|
-
const id = item.dataset.id;
|
|
6047
|
-
if (!id) {
|
|
6048
|
-
console.error("Error event", ev);
|
|
6049
|
-
throw new Error(
|
|
6050
|
-
"Cannot find target in toolbar press enter event."
|
|
6051
|
-
);
|
|
6052
|
-
}
|
|
6053
|
-
controller.emit("pressEnter", id);
|
|
6054
|
-
}
|
|
6055
|
-
},
|
|
6056
|
-
children: Children.toArray(children).map((current) => {
|
|
6057
|
-
const props = current == null ? void 0 : current.props;
|
|
6058
|
-
if (!props)
|
|
6059
|
-
throw new Error(
|
|
6060
|
-
"Toolbar items must be of ToolbarItem type and have an id defined."
|
|
6061
|
-
);
|
|
6062
|
-
const { id, title } = props;
|
|
6063
|
-
return /* @__PURE__ */ jsx(
|
|
6064
|
-
ListboxItem,
|
|
6065
|
-
{
|
|
6066
|
-
label: title,
|
|
6067
|
-
"data-separator": id ? void 0 : "true",
|
|
6068
|
-
children: current
|
|
6069
|
-
},
|
|
6070
|
-
id != null ? id : `separator${separator++}`
|
|
6071
|
-
);
|
|
6072
|
-
})
|
|
6123
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
6124
|
+
const [, tooltipsHandler, TooltipsProvider] = makeSingleImperativeComponent()({
|
|
6125
|
+
Component: () => {
|
|
6126
|
+
const [tooltip, setTooltip] = useState(null);
|
|
6127
|
+
const tooltipRef = useLatest(tooltip);
|
|
6128
|
+
useImperativeComponentEvents({
|
|
6129
|
+
open: setTooltip,
|
|
6130
|
+
close() {
|
|
6131
|
+
var _a, _b;
|
|
6132
|
+
(_b = (_a = tooltipRef.current) == null ? void 0 : _a.onClose) == null ? void 0 : _b.call(_a);
|
|
6133
|
+
setTooltip(null);
|
|
6073
6134
|
}
|
|
6074
|
-
|
|
6135
|
+
});
|
|
6136
|
+
if (!tooltip)
|
|
6137
|
+
return null;
|
|
6138
|
+
return /* @__PURE__ */ jsx(Tooltip, __spreadValues({}, tooltip));
|
|
6075
6139
|
}
|
|
6076
|
-
);
|
|
6140
|
+
});
|
|
6141
|
+
function useTooltip(tooltip) {
|
|
6142
|
+
const isOpen = useRef(false);
|
|
6143
|
+
const open = useCallback(
|
|
6144
|
+
(otherProps) => {
|
|
6145
|
+
setTimeout(() => {
|
|
6146
|
+
isOpen.current = true;
|
|
6147
|
+
if (!tooltip && !(otherProps == null ? void 0 : otherProps.children))
|
|
6148
|
+
throw new Error("There is no children set for the current tooltip");
|
|
6149
|
+
tooltipsHandler("open", __spreadProps(__spreadValues(__spreadValues({}, tooltip), otherProps), {
|
|
6150
|
+
onClose() {
|
|
6151
|
+
var _a, _b;
|
|
6152
|
+
(_a = tooltip == null ? void 0 : tooltip.onClose) == null ? void 0 : _a.call(tooltip);
|
|
6153
|
+
(_b = otherProps == null ? void 0 : otherProps.onClose) == null ? void 0 : _b.call(otherProps);
|
|
6154
|
+
isOpen.current = false;
|
|
6155
|
+
}
|
|
6156
|
+
}));
|
|
6157
|
+
}, 0);
|
|
6158
|
+
},
|
|
6159
|
+
[tooltip]
|
|
6160
|
+
);
|
|
6161
|
+
return {
|
|
6162
|
+
close: useCallback(() => {
|
|
6163
|
+
tooltipsHandler("close", void 0);
|
|
6164
|
+
}, []),
|
|
6165
|
+
open,
|
|
6166
|
+
toggle: useCallback(
|
|
6167
|
+
(otherProps) => {
|
|
6168
|
+
if (isOpen.current) {
|
|
6169
|
+
tooltipsHandler("close", void 0);
|
|
6170
|
+
} else
|
|
6171
|
+
open(otherProps);
|
|
6172
|
+
},
|
|
6173
|
+
[open]
|
|
6174
|
+
)
|
|
6175
|
+
};
|
|
6176
|
+
}
|
|
6077
6177
|
|
|
6078
|
-
export { Accordion, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, AutoEllipsis, BaseButton, CalendarModal, Captcha, Checkbox$1 as Checkbox, CollapsiblePanel, Confirm, ConfirmModal, DateInput, DialogButtonBar, FieldErrorMessage, FieldLabel, IconButton, IconInput, IconsList, LinearLoader, Listbox, ListboxItem, LoaderSpinner, Modal,
|
|
6178
|
+
export { Accordion, AccordionContext, AccordionItem, AccordionItemButton, AccordionItemContent, AccordionItemContext, AlertModal, ApiaFilter, AutoEllipsis, BaseButton, CalendarModal, Captcha, Checkbox$1 as Checkbox, CollapsiblePanel, Confirm, ConfirmModal, DateInput, DefaultIconRenderer, DialogButtonBar, FieldErrorMessage, FieldLabel, IconButton, IconInput, IconsList, LinearLoader, Listbox, ListboxItem, LoaderSpinner, Modal, NumberInput, Overlay, ProgressBar, RequiredMark, ScreenLock, SimpleButton, Toolbar, ToolbarController, ToolbarItem, Tooltip, TooltipsProvider, WaiTypeAhead, getFieldErrorStyles, getFieldTouchedStyles, importComponent, makeResponsiveComponent, parseNumberInputValueToNumber, parseNumberValueToNumberInput, tooltipsHandler, useAccordionContext, useModal, useModalContext, useOtherTagButton, useTooltip };
|