@connectif/ui-components 2.3.4 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/card/EnhancedCard.d.ts +4 -2
- package/dist/components/icon/icons.d.ts +3 -0
- package/dist/components/input/DateIntervalPicker.d.ts +5 -1
- package/dist/components/input/DateIntervalPickerInputs.d.ts +7 -1
- package/dist/components/input/DateIntervalPickerPopover.d.ts +2 -1
- package/dist/components/input/SelectPopover.d.ts +6 -2
- package/dist/components/layout/SwipeableViews.d.ts +2 -1
- package/dist/components/popover/Popover.d.ts +3 -1
- package/dist/components/scrollable/Carousel.d.ts +9 -0
- package/dist/components/scrollable/index.d.ts +2 -0
- package/dist/components/tab/TabContent.d.ts +6 -1
- package/dist/components/tab/Tabs.d.ts +5 -1
- package/dist/i18n/en.d.ts +2 -1
- package/dist/i18n/es.d.ts +2 -1
- package/dist/i18n/fr.d.ts +2 -1
- package/dist/i18n/it.d.ts +2 -1
- package/dist/i18n/pt.d.ts +2 -1
- package/dist/index.js +1022 -532
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/DateUtils.d.ts +4 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -373,7 +373,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
373
373
|
function emptyFunctionThatReturnsNull() {
|
|
374
374
|
return null;
|
|
375
375
|
}
|
|
376
|
-
module.exports = function(
|
|
376
|
+
module.exports = function(isValidElement5, throwOnDirectAccess) {
|
|
377
377
|
var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator;
|
|
378
378
|
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
379
379
|
function getIteratorFn(maybeIterable) {
|
|
@@ -501,7 +501,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
501
501
|
function createElementTypeChecker() {
|
|
502
502
|
function validate(props, propName, componentName, location, propFullName) {
|
|
503
503
|
var propValue = props[propName];
|
|
504
|
-
if (!
|
|
504
|
+
if (!isValidElement5(propValue)) {
|
|
505
505
|
var propType = getPropType(propValue);
|
|
506
506
|
return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement."));
|
|
507
507
|
}
|
|
@@ -689,7 +689,7 @@ var require_factoryWithTypeCheckers = __commonJS({
|
|
|
689
689
|
if (Array.isArray(propValue)) {
|
|
690
690
|
return propValue.every(isNode);
|
|
691
691
|
}
|
|
692
|
-
if (propValue === null ||
|
|
692
|
+
if (propValue === null || isValidElement5(propValue)) {
|
|
693
693
|
return true;
|
|
694
694
|
}
|
|
695
695
|
var iteratorFn = getIteratorFn(propValue);
|
|
@@ -1255,6 +1255,7 @@ import {
|
|
|
1255
1255
|
mdiCellphoneLink,
|
|
1256
1256
|
mdiCellphoneLinkOff,
|
|
1257
1257
|
mdiCellphoneMessage,
|
|
1258
|
+
mdiCellphoneOff,
|
|
1258
1259
|
mdiCellphoneSettings,
|
|
1259
1260
|
mdiCertificate,
|
|
1260
1261
|
mdiChairSchool,
|
|
@@ -1585,6 +1586,7 @@ import {
|
|
|
1585
1586
|
mdiFilmstrip,
|
|
1586
1587
|
mdiFilmstripOff,
|
|
1587
1588
|
mdiFilter,
|
|
1589
|
+
mdiFilterOff,
|
|
1588
1590
|
mdiFilterOutline,
|
|
1589
1591
|
mdiFilterRemove,
|
|
1590
1592
|
mdiFilterRemoveOutline,
|
|
@@ -2423,6 +2425,7 @@ import {
|
|
|
2423
2425
|
mdiTag,
|
|
2424
2426
|
mdiTagFaces,
|
|
2425
2427
|
mdiTagHeart,
|
|
2428
|
+
mdiTagHidden,
|
|
2426
2429
|
mdiTagMultiple,
|
|
2427
2430
|
mdiTagOutline,
|
|
2428
2431
|
mdiTagPlus,
|
|
@@ -3001,6 +3004,7 @@ var icons = {
|
|
|
3001
3004
|
"cellphone-link": mdiCellphoneLink,
|
|
3002
3005
|
"cellphone-link-off": mdiCellphoneLinkOff,
|
|
3003
3006
|
"cellphone-message": mdiCellphoneMessage,
|
|
3007
|
+
"cellphone-off": mdiCellphoneOff,
|
|
3004
3008
|
"cellphone-settings": mdiCellphoneSettings,
|
|
3005
3009
|
certificate: mdiCertificate,
|
|
3006
3010
|
"chair-school": mdiChairSchool,
|
|
@@ -3388,6 +3392,7 @@ var icons = {
|
|
|
3388
3392
|
filmstrip: mdiFilmstrip,
|
|
3389
3393
|
"filmstrip-off": mdiFilmstripOff,
|
|
3390
3394
|
filter: mdiFilter,
|
|
3395
|
+
"filter-off": mdiFilterOff,
|
|
3391
3396
|
"filter-outline": mdiFilterOutline,
|
|
3392
3397
|
"filter-remove": mdiFilterRemove,
|
|
3393
3398
|
"filter-remove-outline": mdiFilterRemoveOutline,
|
|
@@ -4360,6 +4365,7 @@ var icons = {
|
|
|
4360
4365
|
tag: mdiTag,
|
|
4361
4366
|
"tag-faces": mdiTagFaces,
|
|
4362
4367
|
"tag-heart": mdiTagHeart,
|
|
4368
|
+
"tag-hidden": mdiTagHidden,
|
|
4363
4369
|
"tag-multiple": mdiTagMultiple,
|
|
4364
4370
|
"tag-outline": mdiTagOutline,
|
|
4365
4371
|
"tag-plus": mdiTagPlus,
|
|
@@ -11554,8 +11560,11 @@ var EnhancedCard = React30.forwardRef(
|
|
|
11554
11560
|
disableGap = false,
|
|
11555
11561
|
enableAuxClick = false,
|
|
11556
11562
|
hoverComponent,
|
|
11563
|
+
sx,
|
|
11557
11564
|
onClick,
|
|
11558
|
-
onMouseDown
|
|
11565
|
+
onMouseDown,
|
|
11566
|
+
onMouseEnter,
|
|
11567
|
+
onMouseLeave
|
|
11559
11568
|
}, ref) {
|
|
11560
11569
|
const [isHovered, setIsHovered] = React30.useState(false);
|
|
11561
11570
|
const [isMenuOpen, setIsMenuOpen] = React30.useState(false);
|
|
@@ -11575,7 +11584,8 @@ var EnhancedCard = React30.forwardRef(
|
|
|
11575
11584
|
...selected && {
|
|
11576
11585
|
boxShadow: "0 0 0 3px",
|
|
11577
11586
|
color: primary600
|
|
11578
|
-
}
|
|
11587
|
+
},
|
|
11588
|
+
...sx
|
|
11579
11589
|
};
|
|
11580
11590
|
const centerColumnStyle = getCenterColumnStyle(
|
|
11581
11591
|
size,
|
|
@@ -11642,11 +11652,15 @@ var EnhancedCard = React30.forwardRef(
|
|
|
11642
11652
|
onClick,
|
|
11643
11653
|
onAuxClick: enableAuxClick && !isMenuOpen ? onClick : void 0,
|
|
11644
11654
|
onMouseDown,
|
|
11645
|
-
onMouseEnter: () =>
|
|
11646
|
-
|
|
11655
|
+
onMouseEnter: (e) => {
|
|
11656
|
+
setIsHovered(true);
|
|
11657
|
+
onMouseEnter && onMouseEnter(e);
|
|
11658
|
+
},
|
|
11659
|
+
onMouseLeave: (e) => {
|
|
11647
11660
|
if (!isMenuOpen) {
|
|
11648
11661
|
setIsHovered(false);
|
|
11649
11662
|
}
|
|
11663
|
+
onMouseLeave && onMouseLeave(e);
|
|
11650
11664
|
},
|
|
11651
11665
|
onMouseMove: (ev) => {
|
|
11652
11666
|
const element = ev.currentTarget;
|
|
@@ -14238,8 +14252,9 @@ var DATE_INTERVAL_PICKER = {
|
|
|
14238
14252
|
YESTERDAY: "Yesterday"
|
|
14239
14253
|
},
|
|
14240
14254
|
END_DATE: "End date",
|
|
14255
|
+
END_HOUR: "End hour",
|
|
14241
14256
|
START_DATE: "Start date",
|
|
14242
|
-
|
|
14257
|
+
START_HOUR: "Start hour"
|
|
14243
14258
|
};
|
|
14244
14259
|
var SELECT_POPOVER = {
|
|
14245
14260
|
APPLY: "Apply",
|
|
@@ -14524,8 +14539,9 @@ var DATE_INTERVAL_PICKER2 = {
|
|
|
14524
14539
|
YESTERDAY: "Ayer"
|
|
14525
14540
|
},
|
|
14526
14541
|
END_DATE: "Fecha de fin",
|
|
14542
|
+
END_HOUR: "Hora de fin",
|
|
14527
14543
|
START_DATE: "Fecha de inicio",
|
|
14528
|
-
|
|
14544
|
+
START_HOUR: "Hora de inicio"
|
|
14529
14545
|
};
|
|
14530
14546
|
var SELECT_POPOVER2 = {
|
|
14531
14547
|
APPLY: "Aplicar",
|
|
@@ -14825,8 +14841,9 @@ var DATE_INTERVAL_PICKER3 = {
|
|
|
14825
14841
|
YESTERDAY: "Hier"
|
|
14826
14842
|
},
|
|
14827
14843
|
END_DATE: "Date de fin",
|
|
14844
|
+
END_HOUR: "Heure de fin",
|
|
14828
14845
|
START_DATE: "Date de d\xE9but",
|
|
14829
|
-
|
|
14846
|
+
START_HOUR: "Heure de d\xE9but"
|
|
14830
14847
|
};
|
|
14831
14848
|
var SELECT_POPOVER3 = {
|
|
14832
14849
|
APPLY: "Appliquer",
|
|
@@ -15111,8 +15128,9 @@ var DATE_INTERVAL_PICKER4 = {
|
|
|
15111
15128
|
YESTERDAY: "Ieri"
|
|
15112
15129
|
},
|
|
15113
15130
|
END_DATE: "Data di fine",
|
|
15131
|
+
END_HOUR: "Ora di fine",
|
|
15114
15132
|
START_DATE: "Data di inizio",
|
|
15115
|
-
|
|
15133
|
+
START_HOUR: "Ora di inizio"
|
|
15116
15134
|
};
|
|
15117
15135
|
var SELECT_POPOVER4 = {
|
|
15118
15136
|
APPLY: "Applica",
|
|
@@ -15382,8 +15400,9 @@ var DATE_INTERVAL_PICKER5 = {
|
|
|
15382
15400
|
YESTERDAY: "Ontem"
|
|
15383
15401
|
},
|
|
15384
15402
|
END_DATE: "Data final",
|
|
15403
|
+
END_HOUR: "Hora de encerramento",
|
|
15385
15404
|
START_DATE: "Data de in\xEDcio",
|
|
15386
|
-
|
|
15405
|
+
START_HOUR: "Hora de in\xEDcio"
|
|
15387
15406
|
};
|
|
15388
15407
|
var SELECT_POPOVER5 = {
|
|
15389
15408
|
APPLY: "Aplicar",
|
|
@@ -16186,6 +16205,19 @@ function dateToSimpleDate(date, timezone) {
|
|
|
16186
16205
|
function getDisplayEndDate(date, timezone) {
|
|
16187
16206
|
return tz(date, timezone).subtract(1, "day").toDate();
|
|
16188
16207
|
}
|
|
16208
|
+
function applyTimeToDate(date, time) {
|
|
16209
|
+
if (isNaN(date.getTime()) || isNaN(time.getTime())) {
|
|
16210
|
+
return /* @__PURE__ */ new Date(NaN);
|
|
16211
|
+
}
|
|
16212
|
+
const result = new Date(date);
|
|
16213
|
+
result.setHours(
|
|
16214
|
+
time.getHours(),
|
|
16215
|
+
time.getMinutes(),
|
|
16216
|
+
time.getSeconds(),
|
|
16217
|
+
time.getMilliseconds()
|
|
16218
|
+
);
|
|
16219
|
+
return result;
|
|
16220
|
+
}
|
|
16189
16221
|
|
|
16190
16222
|
// src/utils/NumberFormatter.ts
|
|
16191
16223
|
function formatNumber(value, locale, fractionSize) {
|
|
@@ -18878,11 +18910,11 @@ var DebouncedTextField_default = DebouncedTextField;
|
|
|
18878
18910
|
|
|
18879
18911
|
// src/components/input/DateIntervalPicker.tsx
|
|
18880
18912
|
import { ButtonBase } from "@mui/material";
|
|
18881
|
-
import * as
|
|
18913
|
+
import * as React57 from "react";
|
|
18882
18914
|
|
|
18883
18915
|
// src/components/input/DateIntervalPickerPopover.tsx
|
|
18884
|
-
import * as
|
|
18885
|
-
import { tz as
|
|
18916
|
+
import * as React56 from "react";
|
|
18917
|
+
import { tz as tz4 } from "moment-timezone";
|
|
18886
18918
|
|
|
18887
18919
|
// src/components/popover/Popover.tsx
|
|
18888
18920
|
import MuiPopover from "@mui/material/Popover";
|
|
@@ -18892,12 +18924,14 @@ var Popover = ({
|
|
|
18892
18924
|
anchorHorizontalOrigin = "center",
|
|
18893
18925
|
verticalAlign = "top",
|
|
18894
18926
|
anchorVerticalAlign = "bottom",
|
|
18927
|
+
centeredInScreen = false,
|
|
18895
18928
|
...props
|
|
18896
18929
|
}) => /* @__PURE__ */ jsx99(
|
|
18897
18930
|
MuiPopover,
|
|
18898
18931
|
{
|
|
18899
18932
|
disableRestoreFocus: props.disableRestoreFocus,
|
|
18900
18933
|
open: !!props.anchorEl,
|
|
18934
|
+
...centeredInScreen && { anchorReference: "none" },
|
|
18901
18935
|
anchorOrigin: {
|
|
18902
18936
|
vertical: anchorVerticalAlign,
|
|
18903
18937
|
horizontal: anchorHorizontalOrigin
|
|
@@ -18906,6 +18940,18 @@ var Popover = ({
|
|
|
18906
18940
|
vertical: verticalAlign,
|
|
18907
18941
|
horizontal: horizontalAlign
|
|
18908
18942
|
},
|
|
18943
|
+
...centeredInScreen && {
|
|
18944
|
+
slotProps: {
|
|
18945
|
+
paper: {
|
|
18946
|
+
sx: {
|
|
18947
|
+
position: "fixed",
|
|
18948
|
+
top: "50% !important",
|
|
18949
|
+
left: "50% !important",
|
|
18950
|
+
transform: "translate(-50%, -50%) !important"
|
|
18951
|
+
}
|
|
18952
|
+
}
|
|
18953
|
+
}
|
|
18954
|
+
},
|
|
18909
18955
|
...props
|
|
18910
18956
|
}
|
|
18911
18957
|
);
|
|
@@ -19456,23 +19502,127 @@ var DateIntervalPickerList = ({
|
|
|
19456
19502
|
var DateIntervalPickerList_default = DateIntervalPickerList;
|
|
19457
19503
|
|
|
19458
19504
|
// src/components/input/DateIntervalPickerInputs.tsx
|
|
19459
|
-
import { Collapse as Collapse6 } from "@mui/material";
|
|
19460
|
-
|
|
19505
|
+
import { Collapse as Collapse6, Stack as Stack7 } from "@mui/material";
|
|
19506
|
+
|
|
19507
|
+
// src/components/input/TimeField.tsx
|
|
19508
|
+
import * as React55 from "react";
|
|
19509
|
+
import { TimeField as MuiTimeField } from "@mui/x-date-pickers";
|
|
19510
|
+
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
|
|
19511
|
+
import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment";
|
|
19512
|
+
import { tz as tz3 } from "moment-timezone";
|
|
19513
|
+
import { jsx as jsx106 } from "react/jsx-runtime";
|
|
19514
|
+
var ExtendedTextField = ({
|
|
19515
|
+
inputProps,
|
|
19516
|
+
ownerState,
|
|
19517
|
+
InputProps,
|
|
19518
|
+
error,
|
|
19519
|
+
...rest
|
|
19520
|
+
}) => /* @__PURE__ */ jsx106(TextField_default, { ...inputProps, ...rest });
|
|
19521
|
+
var TimeField = function TimeField2({
|
|
19522
|
+
onChange,
|
|
19523
|
+
value,
|
|
19524
|
+
showMinutes = true,
|
|
19525
|
+
showSeconds = false,
|
|
19526
|
+
...rest
|
|
19527
|
+
}) {
|
|
19528
|
+
const { locale, timezone } = React55.useContext(IntlContext);
|
|
19529
|
+
const hour12 = React55.useMemo(() => {
|
|
19530
|
+
const resolvedOptions = Intl.DateTimeFormat(locale, {
|
|
19531
|
+
hour: "numeric"
|
|
19532
|
+
}).resolvedOptions();
|
|
19533
|
+
return resolvedOptions.hour12;
|
|
19534
|
+
}, [locale]);
|
|
19535
|
+
const format2 = `${hour12 ? "hh" : "HH"}${showSeconds || showMinutes ? ":mm" : ""}${showSeconds ? ":ss" : ""}${hour12 ? " a" : ""}`;
|
|
19536
|
+
const momentValue = React55.useMemo(() => {
|
|
19537
|
+
if (value && !isNaN(value.getTime())) {
|
|
19538
|
+
return tz3(value, timezone);
|
|
19539
|
+
}
|
|
19540
|
+
return null;
|
|
19541
|
+
}, [timezone, value]);
|
|
19542
|
+
const _onChange = React55.useCallback(
|
|
19543
|
+
(momentValue2, context) => {
|
|
19544
|
+
const value2 = momentValue2 && momentValue2.isValid() ? momentValue2.toDate() : null;
|
|
19545
|
+
onChange && onChange(value2, context);
|
|
19546
|
+
},
|
|
19547
|
+
[onChange]
|
|
19548
|
+
);
|
|
19549
|
+
return /* @__PURE__ */ jsx106(LocalizationProvider, { dateAdapter: AdapterMoment, children: /* @__PURE__ */ jsx106(
|
|
19550
|
+
MuiTimeField,
|
|
19551
|
+
{
|
|
19552
|
+
onChange: _onChange,
|
|
19553
|
+
value: momentValue,
|
|
19554
|
+
format: format2,
|
|
19555
|
+
slots: {
|
|
19556
|
+
textField: ExtendedTextField
|
|
19557
|
+
},
|
|
19558
|
+
slotProps: {
|
|
19559
|
+
textField: rest
|
|
19560
|
+
},
|
|
19561
|
+
enableAccessibleFieldDOMStructure: false
|
|
19562
|
+
}
|
|
19563
|
+
) });
|
|
19564
|
+
};
|
|
19565
|
+
var TimeField_default = TimeField;
|
|
19566
|
+
|
|
19567
|
+
// src/components/input/DateIntervalPickerInputs.tsx
|
|
19568
|
+
import { jsx as jsx107, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
19461
19569
|
var DateIntervalPickerInputs = ({
|
|
19462
19570
|
startDate,
|
|
19571
|
+
startTime,
|
|
19463
19572
|
endDate,
|
|
19573
|
+
endTime,
|
|
19464
19574
|
comparisonStartDate,
|
|
19575
|
+
comparisonStartTime,
|
|
19465
19576
|
comparisonEndDate,
|
|
19577
|
+
comparisonEndTime,
|
|
19466
19578
|
placeholder,
|
|
19467
19579
|
highlightedInput,
|
|
19468
19580
|
color: color2,
|
|
19469
19581
|
comparisonColor,
|
|
19470
19582
|
isComparing,
|
|
19583
|
+
showTime,
|
|
19471
19584
|
onChange,
|
|
19585
|
+
onChangeTime,
|
|
19472
19586
|
onFocus,
|
|
19473
19587
|
onBlur
|
|
19474
19588
|
}) => {
|
|
19475
19589
|
const { t } = useTranslation();
|
|
19590
|
+
const getDateField = ({
|
|
19591
|
+
dataTestId,
|
|
19592
|
+
dateLabel,
|
|
19593
|
+
date,
|
|
19594
|
+
dateTime,
|
|
19595
|
+
focusableInput,
|
|
19596
|
+
hourLabel,
|
|
19597
|
+
color: color3
|
|
19598
|
+
}) => /* @__PURE__ */ jsxs48(Stack7, { children: [
|
|
19599
|
+
/* @__PURE__ */ jsx107(
|
|
19600
|
+
TextField_default,
|
|
19601
|
+
{
|
|
19602
|
+
"data-testid": dataTestId,
|
|
19603
|
+
label: dateLabel,
|
|
19604
|
+
placeholder,
|
|
19605
|
+
value: date,
|
|
19606
|
+
onChange: (event) => onChange(event.target.value),
|
|
19607
|
+
onFocus: () => onFocus(focusableInput),
|
|
19608
|
+
onBlur: (event) => onBlur(focusableInput, event.target.value),
|
|
19609
|
+
highlighted: highlightedInput === focusableInput,
|
|
19610
|
+
activeColor: color3
|
|
19611
|
+
}
|
|
19612
|
+
),
|
|
19613
|
+
showTime && /* @__PURE__ */ jsx107(
|
|
19614
|
+
TimeField_default,
|
|
19615
|
+
{
|
|
19616
|
+
activeColor: color3,
|
|
19617
|
+
label: hourLabel,
|
|
19618
|
+
value: dateTime,
|
|
19619
|
+
onFocus: () => onFocus(focusableInput),
|
|
19620
|
+
onBlur: (event) => onBlur(focusableInput, event.target.value),
|
|
19621
|
+
onChange: onChangeTime,
|
|
19622
|
+
highlighted: highlightedInput === focusableInput
|
|
19623
|
+
}
|
|
19624
|
+
)
|
|
19625
|
+
] });
|
|
19476
19626
|
return /* @__PURE__ */ jsxs48(Box_default2, { sx: { padding: "8px" }, children: [
|
|
19477
19627
|
/* @__PURE__ */ jsxs48(
|
|
19478
19628
|
Box_default2,
|
|
@@ -19483,40 +19633,28 @@ var DateIntervalPickerInputs = ({
|
|
|
19483
19633
|
gap: "8px"
|
|
19484
19634
|
},
|
|
19485
19635
|
children: [
|
|
19486
|
-
|
|
19487
|
-
|
|
19488
|
-
|
|
19489
|
-
|
|
19490
|
-
|
|
19491
|
-
|
|
19492
|
-
|
|
19493
|
-
|
|
19494
|
-
|
|
19495
|
-
|
|
19496
|
-
|
|
19497
|
-
|
|
19498
|
-
|
|
19499
|
-
|
|
19500
|
-
|
|
19501
|
-
|
|
19502
|
-
|
|
19503
|
-
|
|
19504
|
-
{
|
|
19505
|
-
"data-testid": "endDateInput",
|
|
19506
|
-
label: t("DATE_INTERVAL_PICKER.END_DATE"),
|
|
19507
|
-
placeholder,
|
|
19508
|
-
value: endDate,
|
|
19509
|
-
onChange: (event) => onChange(event.target.value),
|
|
19510
|
-
onFocus: () => onFocus("endDate"),
|
|
19511
|
-
onBlur: (event) => onBlur("endDate", event.target.value),
|
|
19512
|
-
highlighted: highlightedInput === "endDate",
|
|
19513
|
-
activeColor: color2
|
|
19514
|
-
}
|
|
19515
|
-
) })
|
|
19636
|
+
getDateField({
|
|
19637
|
+
dataTestId: "startDateInput",
|
|
19638
|
+
date: startDate,
|
|
19639
|
+
dateTime: startTime,
|
|
19640
|
+
dateLabel: t("DATE_INTERVAL_PICKER.START_DATE"),
|
|
19641
|
+
focusableInput: "startDate",
|
|
19642
|
+
hourLabel: t("DATE_INTERVAL_PICKER.START_HOUR"),
|
|
19643
|
+
color: color2
|
|
19644
|
+
}),
|
|
19645
|
+
getDateField({
|
|
19646
|
+
dataTestId: "endDateInput",
|
|
19647
|
+
date: endDate,
|
|
19648
|
+
dateTime: endTime,
|
|
19649
|
+
dateLabel: t("DATE_INTERVAL_PICKER.END_DATE"),
|
|
19650
|
+
focusableInput: "endDate",
|
|
19651
|
+
hourLabel: t("DATE_INTERVAL_PICKER.END_HOUR"),
|
|
19652
|
+
color: color2
|
|
19653
|
+
})
|
|
19516
19654
|
]
|
|
19517
19655
|
}
|
|
19518
19656
|
),
|
|
19519
|
-
/* @__PURE__ */
|
|
19657
|
+
/* @__PURE__ */ jsx107(Collapse6, { in: isComparing, children: /* @__PURE__ */ jsxs48(
|
|
19520
19658
|
Box_default2,
|
|
19521
19659
|
{
|
|
19522
19660
|
sx: {
|
|
@@ -19525,40 +19663,21 @@ var DateIntervalPickerInputs = ({
|
|
|
19525
19663
|
gap: "8px"
|
|
19526
19664
|
},
|
|
19527
19665
|
children: [
|
|
19528
|
-
|
|
19529
|
-
|
|
19530
|
-
|
|
19531
|
-
|
|
19532
|
-
|
|
19533
|
-
|
|
19534
|
-
|
|
19535
|
-
|
|
19536
|
-
|
|
19537
|
-
|
|
19538
|
-
|
|
19539
|
-
|
|
19540
|
-
|
|
19541
|
-
|
|
19542
|
-
|
|
19543
|
-
}
|
|
19544
|
-
) }),
|
|
19545
|
-
/* @__PURE__ */ jsx106(InputLabel_default, { children: t("DATE_INTERVAL_PICKER.TO") }),
|
|
19546
|
-
/* @__PURE__ */ jsxs48("div", { children: [
|
|
19547
|
-
/* @__PURE__ */ jsx106("label", { children: "\xA0" }),
|
|
19548
|
-
/* @__PURE__ */ jsx106(
|
|
19549
|
-
TextField_default,
|
|
19550
|
-
{
|
|
19551
|
-
"data-testid": "comparisonEndDateInput",
|
|
19552
|
-
placeholder,
|
|
19553
|
-
value: comparisonEndDate,
|
|
19554
|
-
onChange: (event) => onChange(event.target.value),
|
|
19555
|
-
onFocus: () => onFocus("comparisonEndDate"),
|
|
19556
|
-
onBlur: (event) => onBlur("comparisonEndDate", event.target.value),
|
|
19557
|
-
highlighted: highlightedInput === "comparisonEndDate",
|
|
19558
|
-
activeColor: comparisonColor
|
|
19559
|
-
}
|
|
19560
|
-
)
|
|
19561
|
-
] })
|
|
19666
|
+
getDateField({
|
|
19667
|
+
dataTestId: "comparisonStartDateInput",
|
|
19668
|
+
date: comparisonStartDate,
|
|
19669
|
+
dateTime: comparisonStartTime,
|
|
19670
|
+
dateLabel: t("DATE_INTERVAL_PICKER.COMPARE_WITH"),
|
|
19671
|
+
focusableInput: "comparisonStartDate",
|
|
19672
|
+
color: comparisonColor
|
|
19673
|
+
}),
|
|
19674
|
+
getDateField({
|
|
19675
|
+
dataTestId: "comparisonEndDateInput",
|
|
19676
|
+
date: comparisonEndDate,
|
|
19677
|
+
dateTime: comparisonEndTime,
|
|
19678
|
+
focusableInput: "comparisonEndDate",
|
|
19679
|
+
color: comparisonColor
|
|
19680
|
+
})
|
|
19562
19681
|
]
|
|
19563
19682
|
}
|
|
19564
19683
|
) })
|
|
@@ -19567,7 +19686,7 @@ var DateIntervalPickerInputs = ({
|
|
|
19567
19686
|
var DateIntervalPickerInputs_default = DateIntervalPickerInputs;
|
|
19568
19687
|
|
|
19569
19688
|
// src/components/input/DateIntervalPickerPopover.tsx
|
|
19570
|
-
import { jsx as
|
|
19689
|
+
import { jsx as jsx108, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
19571
19690
|
var DateIntervalPickerPopover = ({
|
|
19572
19691
|
interval,
|
|
19573
19692
|
startDate,
|
|
@@ -19584,17 +19703,18 @@ var DateIntervalPickerPopover = ({
|
|
|
19584
19703
|
minDate,
|
|
19585
19704
|
maxDate,
|
|
19586
19705
|
allowedIntervals,
|
|
19706
|
+
showTime,
|
|
19587
19707
|
onApply,
|
|
19588
19708
|
onCancel
|
|
19589
19709
|
}) => {
|
|
19590
|
-
const { locale, timezone } =
|
|
19710
|
+
const { locale, timezone } = React56.useContext(IntlContext);
|
|
19591
19711
|
const dateInputFormat = getDateInputFormatForLocale(locale);
|
|
19592
19712
|
const { t } = useTranslation();
|
|
19593
19713
|
const dateInputFormatPlaceholder = dateInputFormat.replace(/Y/g, t("DATE_COMPONENTS.YEAR_LETTER")).replace(/M/g, t("DATE_COMPONENTS.MONTH_LETTER")).replace(/D/g, t("DATE_COMPONENTS.DAY_LETTER"));
|
|
19594
|
-
const minDateTz =
|
|
19595
|
-
const maxDateTz =
|
|
19596
|
-
const dateInputFormatter = (date) =>
|
|
19597
|
-
const formatSimpleDate = (date) =>
|
|
19714
|
+
const minDateTz = tz4(minDate, timezone);
|
|
19715
|
+
const maxDateTz = tz4(maxDate, timezone);
|
|
19716
|
+
const dateInputFormatter = (date) => tz4(date, timezone).format(dateInputFormat);
|
|
19717
|
+
const formatSimpleDate = (date) => tz4(
|
|
19598
19718
|
{ year: date.year, month: date.month, date: date.day },
|
|
19599
19719
|
timezone
|
|
19600
19720
|
).format(dateInputFormat);
|
|
@@ -19646,11 +19766,11 @@ var DateIntervalPickerPopover = ({
|
|
|
19646
19766
|
minDate
|
|
19647
19767
|
);
|
|
19648
19768
|
return {
|
|
19649
|
-
comparisonStartDate:
|
|
19769
|
+
comparisonStartDate: tz4(
|
|
19650
19770
|
interval2.comparisonStartDate,
|
|
19651
19771
|
timezone
|
|
19652
19772
|
).format(dateInputFormat),
|
|
19653
|
-
comparisonEndDate:
|
|
19773
|
+
comparisonEndDate: tz4(interval2.comparisonEndDate, timezone).format(
|
|
19654
19774
|
dateInputFormat
|
|
19655
19775
|
),
|
|
19656
19776
|
comparisonStartSimpleDate: dateToSimpleDate(
|
|
@@ -19670,17 +19790,21 @@ var DateIntervalPickerPopover = ({
|
|
|
19670
19790
|
highlightedInput: "startDate",
|
|
19671
19791
|
focusedDateInCalendar: dateToSimpleDate(startDate, timezone),
|
|
19672
19792
|
startDate: dateInputFormatter(startDate),
|
|
19793
|
+
startTime: startDate,
|
|
19673
19794
|
startSimpleDate: dateToSimpleDate(startDate, timezone),
|
|
19674
19795
|
endDate: dateInputFormatter(displayEndDate),
|
|
19796
|
+
endTime: displayEndDate,
|
|
19675
19797
|
endSimpleDate: dateToSimpleDate(displayEndDate, timezone),
|
|
19676
19798
|
comparisonInterval: comparisonInterval ?? "previousPeriod",
|
|
19677
19799
|
comparisonStartDate: comparisonStartDate ? dateInputFormatter(comparisonStartDate) : "",
|
|
19800
|
+
comparisonStartTime: comparisonStartDate ? comparisonStartDate : /* @__PURE__ */ new Date(),
|
|
19678
19801
|
comparisonStartSimpleDate: comparisonStartDate ? dateToSimpleDate(comparisonStartDate, timezone) : null,
|
|
19679
19802
|
comparisonEndDate: displayComparisonEndDate ? dateInputFormatter(displayComparisonEndDate) : "",
|
|
19803
|
+
comparisonEndTime: displayComparisonEndDate ? displayComparisonEndDate : /* @__PURE__ */ new Date(),
|
|
19680
19804
|
comparisonEndSimpleDate: displayComparisonEndDate ? dateToSimpleDate(displayComparisonEndDate, timezone) : null,
|
|
19681
19805
|
isComparing: allowCompare && !!(comparisonStartDate && comparisonEndDate)
|
|
19682
19806
|
};
|
|
19683
|
-
const [state, setState] =
|
|
19807
|
+
const [state, setState] = React56.useState(initialState);
|
|
19684
19808
|
const handleChangeIsComparing = (checked) => {
|
|
19685
19809
|
setState({
|
|
19686
19810
|
...state,
|
|
@@ -19696,14 +19820,26 @@ var DateIntervalPickerPopover = ({
|
|
|
19696
19820
|
});
|
|
19697
19821
|
};
|
|
19698
19822
|
const handleApply = () => {
|
|
19699
|
-
const parseEndDate = (dateString) =>
|
|
19823
|
+
const parseEndDate = (dateString) => tz4(parseDate(dateString), timezone).add(1, "day").toDate();
|
|
19700
19824
|
onApply({
|
|
19701
19825
|
interval: state.interval,
|
|
19702
|
-
startDate:
|
|
19703
|
-
|
|
19826
|
+
startDate: applyTimeToDate(
|
|
19827
|
+
parseDate(state.startDate),
|
|
19828
|
+
state.startTime
|
|
19829
|
+
),
|
|
19830
|
+
endDate: applyTimeToDate(
|
|
19831
|
+
parseEndDate(state.endDate),
|
|
19832
|
+
state.endTime
|
|
19833
|
+
),
|
|
19704
19834
|
comparisonInterval: state.isComparing ? state.comparisonInterval : null,
|
|
19705
|
-
comparisonStartDate: state.isComparing ?
|
|
19706
|
-
|
|
19835
|
+
comparisonStartDate: state.isComparing ? applyTimeToDate(
|
|
19836
|
+
parseDate(state.comparisonStartDate),
|
|
19837
|
+
state.comparisonStartTime
|
|
19838
|
+
) : null,
|
|
19839
|
+
comparisonEndDate: state.isComparing ? applyTimeToDate(
|
|
19840
|
+
parseEndDate(state.comparisonEndDate),
|
|
19841
|
+
state.comparisonEndTime
|
|
19842
|
+
) : null
|
|
19707
19843
|
});
|
|
19708
19844
|
};
|
|
19709
19845
|
const handleCancel = () => {
|
|
@@ -19749,6 +19885,24 @@ var DateIntervalPickerPopover = ({
|
|
|
19749
19885
|
[state.highlightedInput]: value
|
|
19750
19886
|
});
|
|
19751
19887
|
};
|
|
19888
|
+
const getTimePropertyName = (focusableInputDate) => {
|
|
19889
|
+
switch (focusableInputDate) {
|
|
19890
|
+
case "startDate":
|
|
19891
|
+
return "startTime";
|
|
19892
|
+
case "endDate":
|
|
19893
|
+
return "endTime";
|
|
19894
|
+
case "comparisonStartDate":
|
|
19895
|
+
return "comparisonStartTime";
|
|
19896
|
+
case "comparisonEndDate":
|
|
19897
|
+
return "comparisonEndTime";
|
|
19898
|
+
}
|
|
19899
|
+
};
|
|
19900
|
+
const handleChangeTime = (value) => {
|
|
19901
|
+
setState({
|
|
19902
|
+
...state,
|
|
19903
|
+
[getTimePropertyName(state.highlightedInput)]: value
|
|
19904
|
+
});
|
|
19905
|
+
};
|
|
19752
19906
|
const handleFocusInputDate = (inputDate) => {
|
|
19753
19907
|
setState((state2) => {
|
|
19754
19908
|
const newState = {
|
|
@@ -19938,7 +20092,7 @@ var DateIntervalPickerPopover = ({
|
|
|
19938
20092
|
maxWidth: `${250 + 8 * 2 + 32 * 7}px`
|
|
19939
20093
|
},
|
|
19940
20094
|
children: [
|
|
19941
|
-
/* @__PURE__ */
|
|
20095
|
+
/* @__PURE__ */ jsx108(
|
|
19942
20096
|
Box_default2,
|
|
19943
20097
|
{
|
|
19944
20098
|
sx: {
|
|
@@ -19950,7 +20104,7 @@ var DateIntervalPickerPopover = ({
|
|
|
19950
20104
|
overflowY: "auto"
|
|
19951
20105
|
},
|
|
19952
20106
|
className: "Slim-Vertical-Scroll",
|
|
19953
|
-
children: /* @__PURE__ */
|
|
20107
|
+
children: /* @__PURE__ */ jsx108(
|
|
19954
20108
|
DateIntervalPickerList_default,
|
|
19955
20109
|
{
|
|
19956
20110
|
allowCompare,
|
|
@@ -19966,38 +20120,44 @@ var DateIntervalPickerPopover = ({
|
|
|
19966
20120
|
)
|
|
19967
20121
|
}
|
|
19968
20122
|
),
|
|
19969
|
-
/* @__PURE__ */
|
|
20123
|
+
/* @__PURE__ */ jsx108(
|
|
19970
20124
|
Box_default2,
|
|
19971
20125
|
{
|
|
19972
20126
|
sx: {
|
|
19973
20127
|
gridArea: "inputs"
|
|
19974
20128
|
},
|
|
19975
|
-
children: /* @__PURE__ */
|
|
20129
|
+
children: /* @__PURE__ */ jsx108(
|
|
19976
20130
|
DateIntervalPickerInputs_default,
|
|
19977
20131
|
{
|
|
19978
20132
|
color: color2,
|
|
19979
20133
|
comparisonColor,
|
|
19980
20134
|
comparisonEndDate: state.comparisonEndDate,
|
|
20135
|
+
comparisonEndTime: state.comparisonEndTime,
|
|
19981
20136
|
comparisonStartDate: state.comparisonStartDate,
|
|
20137
|
+
comparisonStartTime: state.comparisonStartTime,
|
|
19982
20138
|
endDate: state.endDate,
|
|
20139
|
+
endTime: state.endTime,
|
|
19983
20140
|
highlightedInput: state.highlightedInput,
|
|
19984
20141
|
onBlur: handleBlurInputDate,
|
|
19985
20142
|
onChange: handleChangeInputDate,
|
|
20143
|
+
onChangeTime: handleChangeTime,
|
|
19986
20144
|
onFocus: handleFocusInputDate,
|
|
19987
20145
|
placeholder: dateInputFormatPlaceholder,
|
|
19988
20146
|
startDate: state.startDate,
|
|
19989
|
-
|
|
20147
|
+
startTime: state.startTime,
|
|
20148
|
+
isComparing: state.isComparing,
|
|
20149
|
+
showTime
|
|
19990
20150
|
}
|
|
19991
20151
|
)
|
|
19992
20152
|
}
|
|
19993
20153
|
),
|
|
19994
|
-
/* @__PURE__ */
|
|
20154
|
+
/* @__PURE__ */ jsx108(
|
|
19995
20155
|
Box_default2,
|
|
19996
20156
|
{
|
|
19997
20157
|
sx: {
|
|
19998
20158
|
gridArea: "calendar"
|
|
19999
20159
|
},
|
|
20000
|
-
children: /* @__PURE__ */
|
|
20160
|
+
children: /* @__PURE__ */ jsx108(
|
|
20001
20161
|
CalendarScrollPicker_default,
|
|
20002
20162
|
{
|
|
20003
20163
|
minDate: {
|
|
@@ -20036,10 +20196,10 @@ var DateIntervalPickerPopover = ({
|
|
|
20036
20196
|
]
|
|
20037
20197
|
}
|
|
20038
20198
|
),
|
|
20039
|
-
/* @__PURE__ */
|
|
20199
|
+
/* @__PURE__ */ jsx108(
|
|
20040
20200
|
PopoverActions_default,
|
|
20041
20201
|
{
|
|
20042
|
-
leftContent: /* @__PURE__ */
|
|
20202
|
+
leftContent: /* @__PURE__ */ jsx108(
|
|
20043
20203
|
Button_default,
|
|
20044
20204
|
{
|
|
20045
20205
|
variant: "text",
|
|
@@ -20048,7 +20208,7 @@ var DateIntervalPickerPopover = ({
|
|
|
20048
20208
|
disabled: isApplyButtonDisabled()
|
|
20049
20209
|
}
|
|
20050
20210
|
),
|
|
20051
|
-
rightContent: /* @__PURE__ */
|
|
20211
|
+
rightContent: /* @__PURE__ */ jsx108(
|
|
20052
20212
|
Button_default,
|
|
20053
20213
|
{
|
|
20054
20214
|
variant: "text",
|
|
@@ -20063,8 +20223,8 @@ var DateIntervalPickerPopover = ({
|
|
|
20063
20223
|
var DateIntervalPickerPopover_default = DateIntervalPickerPopover;
|
|
20064
20224
|
|
|
20065
20225
|
// src/components/input/DateIntervalPicker.tsx
|
|
20066
|
-
import { tz as
|
|
20067
|
-
import { jsx as
|
|
20226
|
+
import { tz as tz5 } from "moment-timezone";
|
|
20227
|
+
import { jsx as jsx109, jsxs as jsxs50 } from "react/jsx-runtime";
|
|
20068
20228
|
var DateIntervalPicker = ({
|
|
20069
20229
|
interval,
|
|
20070
20230
|
startDate,
|
|
@@ -20081,11 +20241,12 @@ var DateIntervalPicker = ({
|
|
|
20081
20241
|
minDate,
|
|
20082
20242
|
maxDate,
|
|
20083
20243
|
allowedIntervals,
|
|
20244
|
+
showTime,
|
|
20084
20245
|
onChange
|
|
20085
20246
|
}) => {
|
|
20086
20247
|
const { t } = useTranslation();
|
|
20087
|
-
const { timezone } =
|
|
20088
|
-
const [anchorEl, setAnchorEl] =
|
|
20248
|
+
const { timezone } = React57.useContext(IntlContext);
|
|
20249
|
+
const [anchorEl, setAnchorEl] = React57.useState(
|
|
20089
20250
|
null
|
|
20090
20251
|
);
|
|
20091
20252
|
const isSameDate = (date1, date2) => date1?.getTime() === date2?.getTime();
|
|
@@ -20103,8 +20264,8 @@ var DateIntervalPicker = ({
|
|
|
20103
20264
|
};
|
|
20104
20265
|
const displayEndDate = getDisplayEndDate(endDate, timezone);
|
|
20105
20266
|
const isEndDateVisible = !isSameDate(startDate, displayEndDate);
|
|
20106
|
-
const internalMaxDate = maxDate ??
|
|
20107
|
-
const internalMinDate = minDate ??
|
|
20267
|
+
const internalMaxDate = maxDate ?? tz5(timezone).toDate();
|
|
20268
|
+
const internalMinDate = minDate ?? tz5(internalMaxDate, timezone).subtract(maxSelectableDays - 1, "days").toDate();
|
|
20108
20269
|
return /* @__PURE__ */ jsxs50("div", { style: { display: "inline-flex" }, children: [
|
|
20109
20270
|
/* @__PURE__ */ jsxs50(
|
|
20110
20271
|
ButtonBase,
|
|
@@ -20121,7 +20282,7 @@ var DateIntervalPicker = ({
|
|
|
20121
20282
|
disabled,
|
|
20122
20283
|
onClick: handleButtonClick,
|
|
20123
20284
|
children: [
|
|
20124
|
-
/* @__PURE__ */
|
|
20285
|
+
/* @__PURE__ */ jsx109(
|
|
20125
20286
|
"span",
|
|
20126
20287
|
{
|
|
20127
20288
|
style: {
|
|
@@ -20131,7 +20292,7 @@ var DateIntervalPicker = ({
|
|
|
20131
20292
|
borderRadius: "2px",
|
|
20132
20293
|
alignSelf: "center"
|
|
20133
20294
|
},
|
|
20134
|
-
children: /* @__PURE__ */
|
|
20295
|
+
children: /* @__PURE__ */ jsx109(Typography_default, { variant: "body2", children: t(
|
|
20135
20296
|
`DATE_INTERVAL_PICKER.DATE_INTERVALS.${dateIntervals[interval]}`
|
|
20136
20297
|
) })
|
|
20137
20298
|
}
|
|
@@ -20146,9 +20307,25 @@ var DateIntervalPicker = ({
|
|
|
20146
20307
|
},
|
|
20147
20308
|
children: [
|
|
20148
20309
|
/* @__PURE__ */ jsxs50("div", { children: [
|
|
20149
|
-
/* @__PURE__ */
|
|
20310
|
+
/* @__PURE__ */ jsx109(
|
|
20311
|
+
DateFormatter_default,
|
|
20312
|
+
{
|
|
20313
|
+
date: startDate,
|
|
20314
|
+
...showTime && {
|
|
20315
|
+
format: "dateTimeLongFormat"
|
|
20316
|
+
}
|
|
20317
|
+
}
|
|
20318
|
+
),
|
|
20150
20319
|
isEndDateVisible && " - ",
|
|
20151
|
-
isEndDateVisible && /* @__PURE__ */
|
|
20320
|
+
isEndDateVisible && /* @__PURE__ */ jsx109(
|
|
20321
|
+
DateFormatter_default,
|
|
20322
|
+
{
|
|
20323
|
+
date: displayEndDate,
|
|
20324
|
+
...showTime && {
|
|
20325
|
+
format: "dateTimeLongFormat"
|
|
20326
|
+
}
|
|
20327
|
+
}
|
|
20328
|
+
)
|
|
20152
20329
|
] }),
|
|
20153
20330
|
comparisonStartDate && comparisonEndDate ? /* @__PURE__ */ jsxs50(
|
|
20154
20331
|
"div",
|
|
@@ -20161,20 +20338,36 @@ var DateIntervalPicker = ({
|
|
|
20161
20338
|
children: [
|
|
20162
20339
|
t("DATE_INTERVAL_PICKER.COMPARE"),
|
|
20163
20340
|
": ",
|
|
20164
|
-
/* @__PURE__ */
|
|
20341
|
+
/* @__PURE__ */ jsx109(
|
|
20342
|
+
DateFormatter_default,
|
|
20343
|
+
{
|
|
20344
|
+
date: comparisonStartDate,
|
|
20345
|
+
...showTime && {
|
|
20346
|
+
format: "dateTimeLongFormat"
|
|
20347
|
+
}
|
|
20348
|
+
}
|
|
20349
|
+
),
|
|
20165
20350
|
" - ",
|
|
20166
|
-
/* @__PURE__ */
|
|
20351
|
+
/* @__PURE__ */ jsx109(
|
|
20352
|
+
DateFormatter_default,
|
|
20353
|
+
{
|
|
20354
|
+
date: comparisonEndDate,
|
|
20355
|
+
...showTime && {
|
|
20356
|
+
format: "dateTimeLongFormat"
|
|
20357
|
+
}
|
|
20358
|
+
}
|
|
20359
|
+
)
|
|
20167
20360
|
]
|
|
20168
20361
|
}
|
|
20169
20362
|
) : []
|
|
20170
20363
|
]
|
|
20171
20364
|
}
|
|
20172
20365
|
),
|
|
20173
|
-
/* @__PURE__ */
|
|
20366
|
+
/* @__PURE__ */ jsx109(Icon_default, { id: "menu-down", sx: { color: grey400 } })
|
|
20174
20367
|
]
|
|
20175
20368
|
}
|
|
20176
20369
|
),
|
|
20177
|
-
anchorEl !== null && /* @__PURE__ */
|
|
20370
|
+
anchorEl !== null && /* @__PURE__ */ jsx109(
|
|
20178
20371
|
DateIntervalPickerPopover_default,
|
|
20179
20372
|
{
|
|
20180
20373
|
...{
|
|
@@ -20194,6 +20387,7 @@ var DateIntervalPicker = ({
|
|
|
20194
20387
|
maxDate: internalMaxDate,
|
|
20195
20388
|
anchorEl,
|
|
20196
20389
|
allowedIntervals,
|
|
20390
|
+
showTime,
|
|
20197
20391
|
onCancel: handlePopoverCancel,
|
|
20198
20392
|
onApply: handleApply
|
|
20199
20393
|
}
|
|
@@ -20204,9 +20398,9 @@ var DateIntervalPicker = ({
|
|
|
20204
20398
|
var DateIntervalPicker_default = DateIntervalPicker;
|
|
20205
20399
|
|
|
20206
20400
|
// src/components/input/SelectPopoverItem.tsx
|
|
20207
|
-
import { Grid as Grid2, Stack as
|
|
20401
|
+
import { Grid as Grid2, Stack as Stack8 } from "@mui/material";
|
|
20208
20402
|
import { lighten as lighten3 } from "@mui/material";
|
|
20209
|
-
import { Fragment as Fragment21, jsx as
|
|
20403
|
+
import { Fragment as Fragment21, jsx as jsx110, jsxs as jsxs51 } from "react/jsx-runtime";
|
|
20210
20404
|
var bgColorLightCoefficient2 = 0.9;
|
|
20211
20405
|
var SelectPopoverItem = ({
|
|
20212
20406
|
id,
|
|
@@ -20220,14 +20414,14 @@ var SelectPopoverItem = ({
|
|
|
20220
20414
|
tooltip,
|
|
20221
20415
|
isLoadingSubtitle2,
|
|
20222
20416
|
onClick
|
|
20223
|
-
}) => /* @__PURE__ */
|
|
20417
|
+
}) => /* @__PURE__ */ jsx110(Tooltip_default, { title: tooltip || "", children: /* @__PURE__ */ jsx110(
|
|
20224
20418
|
Grid2,
|
|
20225
20419
|
{
|
|
20226
20420
|
size: {
|
|
20227
20421
|
xs: 6
|
|
20228
20422
|
},
|
|
20229
20423
|
children: /* @__PURE__ */ jsxs51(
|
|
20230
|
-
|
|
20424
|
+
Stack8,
|
|
20231
20425
|
{
|
|
20232
20426
|
direction: "row",
|
|
20233
20427
|
sx: {
|
|
@@ -20254,7 +20448,7 @@ var SelectPopoverItem = ({
|
|
|
20254
20448
|
boxSizing: "border-box"
|
|
20255
20449
|
},
|
|
20256
20450
|
children: [
|
|
20257
|
-
/* @__PURE__ */
|
|
20451
|
+
/* @__PURE__ */ jsx110(
|
|
20258
20452
|
TextEllipsis_default,
|
|
20259
20453
|
{
|
|
20260
20454
|
color: Colors_exports.grey800,
|
|
@@ -20264,7 +20458,7 @@ var SelectPopoverItem = ({
|
|
|
20264
20458
|
},
|
|
20265
20459
|
typographyVariant: "body1",
|
|
20266
20460
|
text: /* @__PURE__ */ jsxs51(Fragment21, { children: [
|
|
20267
|
-
iconId && /* @__PURE__ */
|
|
20461
|
+
iconId && /* @__PURE__ */ jsx110(
|
|
20268
20462
|
Icon_default,
|
|
20269
20463
|
{
|
|
20270
20464
|
id: iconId,
|
|
@@ -20282,7 +20476,7 @@ var SelectPopoverItem = ({
|
|
|
20282
20476
|
] })
|
|
20283
20477
|
}
|
|
20284
20478
|
),
|
|
20285
|
-
subtitle1 && /* @__PURE__ */
|
|
20479
|
+
subtitle1 && /* @__PURE__ */ jsx110(
|
|
20286
20480
|
Typography_default,
|
|
20287
20481
|
{
|
|
20288
20482
|
variant: "body2",
|
|
@@ -20292,7 +20486,7 @@ var SelectPopoverItem = ({
|
|
|
20292
20486
|
children: subtitle1
|
|
20293
20487
|
}
|
|
20294
20488
|
),
|
|
20295
|
-
isLoadingSubtitle2 && /* @__PURE__ */
|
|
20489
|
+
isLoadingSubtitle2 && /* @__PURE__ */ jsx110(
|
|
20296
20490
|
Skeleton_default,
|
|
20297
20491
|
{
|
|
20298
20492
|
variant: "text",
|
|
@@ -20304,7 +20498,7 @@ var SelectPopoverItem = ({
|
|
|
20304
20498
|
}
|
|
20305
20499
|
}
|
|
20306
20500
|
),
|
|
20307
|
-
subtitle2 && !isLoadingSubtitle2 && /* @__PURE__ */
|
|
20501
|
+
subtitle2 && !isLoadingSubtitle2 && /* @__PURE__ */ jsx110(
|
|
20308
20502
|
Typography_default,
|
|
20309
20503
|
{
|
|
20310
20504
|
variant: "body2",
|
|
@@ -20317,7 +20511,7 @@ var SelectPopoverItem = ({
|
|
|
20317
20511
|
]
|
|
20318
20512
|
}
|
|
20319
20513
|
),
|
|
20320
|
-
chipText && /* @__PURE__ */
|
|
20514
|
+
chipText && /* @__PURE__ */ jsx110(Box_default2, { sx: { minWidth: "72px", flexShrink: 0 }, children: /* @__PURE__ */ jsx110(
|
|
20321
20515
|
Chip_default,
|
|
20322
20516
|
{
|
|
20323
20517
|
label: chipText,
|
|
@@ -20338,17 +20532,17 @@ var SelectPopoverItem = ({
|
|
|
20338
20532
|
var SelectPopoverItem_default = SelectPopoverItem;
|
|
20339
20533
|
|
|
20340
20534
|
// src/components/input/TimezoneSelector.tsx
|
|
20341
|
-
import * as
|
|
20535
|
+
import * as React59 from "react";
|
|
20342
20536
|
import * as moment2 from "moment-timezone";
|
|
20343
20537
|
|
|
20344
20538
|
// src/components/input/Select.tsx
|
|
20345
|
-
import * as
|
|
20539
|
+
import * as React58 from "react";
|
|
20346
20540
|
import { styled as styled7 } from "@mui/material/styles";
|
|
20347
20541
|
import MuiSelect from "@mui/material/Select";
|
|
20348
20542
|
import InputBase from "@mui/material/InputBase";
|
|
20349
20543
|
import { FixedSizeList as FixedSizeList2 } from "react-window";
|
|
20350
20544
|
import AutoSizer4 from "react-virtualized-auto-sizer";
|
|
20351
|
-
import { jsx as
|
|
20545
|
+
import { jsx as jsx111 } from "react/jsx-runtime";
|
|
20352
20546
|
var BootstrapInput = styled7(InputBase)(() => ({
|
|
20353
20547
|
boxShadow: shadows[0],
|
|
20354
20548
|
borderRadius: "16px",
|
|
@@ -20379,7 +20573,7 @@ var BootstrapInput = styled7(InputBase)(() => ({
|
|
|
20379
20573
|
borderColor: grey800
|
|
20380
20574
|
}
|
|
20381
20575
|
}));
|
|
20382
|
-
var ChevronIcon = ({ disabled = false }) => /* @__PURE__ */
|
|
20576
|
+
var ChevronIcon = ({ disabled = false }) => /* @__PURE__ */ jsx111(
|
|
20383
20577
|
Icon_default,
|
|
20384
20578
|
{
|
|
20385
20579
|
id: "chevron-down",
|
|
@@ -20397,7 +20591,7 @@ var SelectOption = ({
|
|
|
20397
20591
|
selected,
|
|
20398
20592
|
colors,
|
|
20399
20593
|
...rest
|
|
20400
|
-
}) => /* @__PURE__ */
|
|
20594
|
+
}) => /* @__PURE__ */ jsx111(
|
|
20401
20595
|
ListItemButton_default,
|
|
20402
20596
|
{
|
|
20403
20597
|
role: "option",
|
|
@@ -20447,7 +20641,7 @@ var Select = function Select2({
|
|
|
20447
20641
|
onOpen,
|
|
20448
20642
|
...rest
|
|
20449
20643
|
}, ref) {
|
|
20450
|
-
const [_isOpen, setOpen] =
|
|
20644
|
+
const [_isOpen, setOpen] = React58.useState(false);
|
|
20451
20645
|
const isOpen = open ?? _isOpen;
|
|
20452
20646
|
const valueIndex = options.findIndex(
|
|
20453
20647
|
(op) => op.value === value
|
|
@@ -20464,7 +20658,7 @@ var Select = function Select2({
|
|
|
20464
20658
|
}) => {
|
|
20465
20659
|
const { value: currentValue, label, ...rest2 } = options[index];
|
|
20466
20660
|
const isSelected = value === currentValue;
|
|
20467
|
-
return /* @__PURE__ */
|
|
20661
|
+
return /* @__PURE__ */ jsx111(
|
|
20468
20662
|
ListItemButton_default,
|
|
20469
20663
|
{
|
|
20470
20664
|
text: label ?? currentValue?.toString() ?? "",
|
|
@@ -20495,7 +20689,7 @@ var Select = function Select2({
|
|
|
20495
20689
|
currentValue ?? ""
|
|
20496
20690
|
);
|
|
20497
20691
|
};
|
|
20498
|
-
const getVirtualizedSelect = () => /* @__PURE__ */
|
|
20692
|
+
const getVirtualizedSelect = () => /* @__PURE__ */ jsx111(
|
|
20499
20693
|
MuiSelect,
|
|
20500
20694
|
{
|
|
20501
20695
|
className: `Cn-Select ${className}`,
|
|
@@ -20531,8 +20725,8 @@ var Select = function Select2({
|
|
|
20531
20725
|
displayEmpty: true,
|
|
20532
20726
|
variant: "standard",
|
|
20533
20727
|
value,
|
|
20534
|
-
IconComponent: () => /* @__PURE__ */
|
|
20535
|
-
input: /* @__PURE__ */
|
|
20728
|
+
IconComponent: () => /* @__PURE__ */ jsx111(ChevronIcon, { disabled: rest.disabled }),
|
|
20729
|
+
input: /* @__PURE__ */ jsx111(BootstrapInput, { placeholder }),
|
|
20536
20730
|
onOpen: () => {
|
|
20537
20731
|
setOpen(true);
|
|
20538
20732
|
onOpen && onOpen();
|
|
@@ -20548,7 +20742,7 @@ var Select = function Select2({
|
|
|
20548
20742
|
return renderValue(value2, options);
|
|
20549
20743
|
}
|
|
20550
20744
|
if (!value2) {
|
|
20551
|
-
return /* @__PURE__ */
|
|
20745
|
+
return /* @__PURE__ */ jsx111("span", { style: { color: grey900 }, children: placeholder });
|
|
20552
20746
|
}
|
|
20553
20747
|
return options.find((o) => o.value === value2)?.label ?? value2;
|
|
20554
20748
|
},
|
|
@@ -20581,7 +20775,7 @@ var Select = function Select2({
|
|
|
20581
20775
|
}
|
|
20582
20776
|
}
|
|
20583
20777
|
},
|
|
20584
|
-
children: /* @__PURE__ */
|
|
20778
|
+
children: /* @__PURE__ */ jsx111(AutoSizer4, { disableWidth: true, children: ({ height: height2 }) => /* @__PURE__ */ jsx111(
|
|
20585
20779
|
FixedSizeList2,
|
|
20586
20780
|
{
|
|
20587
20781
|
height: height2,
|
|
@@ -20595,7 +20789,7 @@ var Select = function Select2({
|
|
|
20595
20789
|
) })
|
|
20596
20790
|
}
|
|
20597
20791
|
);
|
|
20598
|
-
const getNotVirtualizedSelect = () => /* @__PURE__ */
|
|
20792
|
+
const getNotVirtualizedSelect = () => /* @__PURE__ */ jsx111(
|
|
20599
20793
|
MuiSelect,
|
|
20600
20794
|
{
|
|
20601
20795
|
className: `Cn-Select ${className}`,
|
|
@@ -20635,9 +20829,9 @@ var Select = function Select2({
|
|
|
20635
20829
|
},
|
|
20636
20830
|
multiple,
|
|
20637
20831
|
value,
|
|
20638
|
-
IconComponent: () => /* @__PURE__ */
|
|
20832
|
+
IconComponent: () => /* @__PURE__ */ jsx111(ChevronIcon, { disabled: rest.disabled }),
|
|
20639
20833
|
open,
|
|
20640
|
-
input: /* @__PURE__ */
|
|
20834
|
+
input: /* @__PURE__ */ jsx111(BootstrapInput, { placeholder }),
|
|
20641
20835
|
onOpen: () => {
|
|
20642
20836
|
setOpen(true);
|
|
20643
20837
|
onOpen && onOpen();
|
|
@@ -20653,7 +20847,7 @@ var Select = function Select2({
|
|
|
20653
20847
|
}
|
|
20654
20848
|
if (Array.isArray(value2)) {
|
|
20655
20849
|
if (value2.length === 0) {
|
|
20656
|
-
return /* @__PURE__ */
|
|
20850
|
+
return /* @__PURE__ */ jsx111("span", { style: { color: grey900 }, children: placeholder });
|
|
20657
20851
|
} else {
|
|
20658
20852
|
return value2.map((v) => {
|
|
20659
20853
|
const option = options.find((o) => o.value === v);
|
|
@@ -20662,7 +20856,7 @@ var Select = function Select2({
|
|
|
20662
20856
|
}
|
|
20663
20857
|
} else {
|
|
20664
20858
|
if (!value2) {
|
|
20665
|
-
return /* @__PURE__ */
|
|
20859
|
+
return /* @__PURE__ */ jsx111("span", { style: { color: grey900 }, children: placeholder });
|
|
20666
20860
|
}
|
|
20667
20861
|
return options.find((o) => o.value === value2)?.label ?? value2;
|
|
20668
20862
|
}
|
|
@@ -20687,7 +20881,7 @@ var Select = function Select2({
|
|
|
20687
20881
|
}
|
|
20688
20882
|
},
|
|
20689
20883
|
...rest,
|
|
20690
|
-
children: children ?? options.map(({ label, value: value2, ...rest2 }) => /* @__PURE__ */
|
|
20884
|
+
children: children ?? options.map(({ label, value: value2, ...rest2 }) => /* @__PURE__ */ jsx111(
|
|
20691
20885
|
SelectOption,
|
|
20692
20886
|
{
|
|
20693
20887
|
label: label ?? value2?.toString() ?? "",
|
|
@@ -20701,21 +20895,21 @@ var Select = function Select2({
|
|
|
20701
20895
|
);
|
|
20702
20896
|
return virtualized ? getVirtualizedSelect() : getNotVirtualizedSelect();
|
|
20703
20897
|
};
|
|
20704
|
-
var Select_default =
|
|
20898
|
+
var Select_default = React58.forwardRef(Select);
|
|
20705
20899
|
|
|
20706
20900
|
// src/components/input/TimezoneSelector.tsx
|
|
20707
|
-
import { jsx as
|
|
20901
|
+
import { jsx as jsx112 } from "react/jsx-runtime";
|
|
20708
20902
|
var TimezoneSelector = ({
|
|
20709
20903
|
initialTimezone,
|
|
20710
20904
|
onTimezoneChange
|
|
20711
20905
|
}) => {
|
|
20712
|
-
const [selectedTimezone, setSelectedTimezone] =
|
|
20906
|
+
const [selectedTimezone, setSelectedTimezone] = React59.useState(initialTimezone);
|
|
20713
20907
|
const handleChange = (timezone) => {
|
|
20714
20908
|
setSelectedTimezone(timezone);
|
|
20715
20909
|
onTimezoneChange(timezone);
|
|
20716
20910
|
};
|
|
20717
20911
|
const timeZones = moment2.tz.names();
|
|
20718
|
-
return /* @__PURE__ */
|
|
20912
|
+
return /* @__PURE__ */ jsx112(
|
|
20719
20913
|
Select_default,
|
|
20720
20914
|
{
|
|
20721
20915
|
value: selectedTimezone,
|
|
@@ -20728,15 +20922,15 @@ var TimezoneSelector = ({
|
|
|
20728
20922
|
var TimezoneSelector_default = TimezoneSelector;
|
|
20729
20923
|
|
|
20730
20924
|
// src/components/input/DaysOfWeekPicker.tsx
|
|
20731
|
-
import * as
|
|
20732
|
-
import { jsx as
|
|
20925
|
+
import * as React60 from "react";
|
|
20926
|
+
import { jsx as jsx113 } from "react/jsx-runtime";
|
|
20733
20927
|
var DaysOfWeekPicker = ({ value, onChange }) => {
|
|
20734
|
-
const { locale, timezone } =
|
|
20735
|
-
const daysOfWeekLong =
|
|
20928
|
+
const { locale, timezone } = React60.useContext(IntlContext);
|
|
20929
|
+
const daysOfWeekLong = React60.useMemo(
|
|
20736
20930
|
() => getWeekDayNamesForLocale(locale, "long", timezone),
|
|
20737
20931
|
[locale, timezone]
|
|
20738
20932
|
);
|
|
20739
|
-
const daysOfWeek =
|
|
20933
|
+
const daysOfWeek = React60.useMemo(
|
|
20740
20934
|
() => getWeekDayNamesForLocale(locale, "narrow", timezone),
|
|
20741
20935
|
[locale, timezone]
|
|
20742
20936
|
);
|
|
@@ -20749,7 +20943,7 @@ var DaysOfWeekPicker = ({ value, onChange }) => {
|
|
|
20749
20943
|
"saturday",
|
|
20750
20944
|
"sunday"
|
|
20751
20945
|
];
|
|
20752
|
-
return /* @__PURE__ */
|
|
20946
|
+
return /* @__PURE__ */ jsx113(
|
|
20753
20947
|
Stack_default,
|
|
20754
20948
|
{
|
|
20755
20949
|
direction: "row",
|
|
@@ -20758,7 +20952,7 @@ var DaysOfWeekPicker = ({ value, onChange }) => {
|
|
|
20758
20952
|
height: "34px",
|
|
20759
20953
|
alignItems: "center"
|
|
20760
20954
|
},
|
|
20761
|
-
children: daysOfWeek.map((day, index) => /* @__PURE__ */
|
|
20955
|
+
children: daysOfWeek.map((day, index) => /* @__PURE__ */ jsx113("div", { style: { margin: "0 2px" }, children: /* @__PURE__ */ jsx113(
|
|
20762
20956
|
ToggleButton_default,
|
|
20763
20957
|
{
|
|
20764
20958
|
sx: {
|
|
@@ -20781,7 +20975,7 @@ var DaysOfWeekPicker = ({ value, onChange }) => {
|
|
|
20781
20975
|
onChange(value.concat([currentValue]));
|
|
20782
20976
|
}
|
|
20783
20977
|
},
|
|
20784
|
-
children: /* @__PURE__ */
|
|
20978
|
+
children: /* @__PURE__ */ jsx113(Tooltip_default, { title: daysOfWeekLong[index], children: /* @__PURE__ */ jsx113("span", { children: day }) }, index)
|
|
20785
20979
|
}
|
|
20786
20980
|
) }, index))
|
|
20787
20981
|
}
|
|
@@ -20790,11 +20984,11 @@ var DaysOfWeekPicker = ({ value, onChange }) => {
|
|
|
20790
20984
|
var DaysOfWeekPicker_default = DaysOfWeekPicker;
|
|
20791
20985
|
|
|
20792
20986
|
// src/components/input/ColorPicker.tsx
|
|
20793
|
-
import * as
|
|
20987
|
+
import * as React61 from "react";
|
|
20794
20988
|
import GradientColorPicker, {
|
|
20795
20989
|
useColorPicker
|
|
20796
20990
|
} from "react-best-gradient-color-picker";
|
|
20797
|
-
import { Fragment as Fragment22, jsx as
|
|
20991
|
+
import { Fragment as Fragment22, jsx as jsx114, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
20798
20992
|
var colorRegex = /^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$|^rgba?\((\d{1,3}), {0,1}(\d{1,3}), {0,1}(\d{1,3})(, {0,1}([01]|0?\.\d+))?\)$/;
|
|
20799
20993
|
var isValidColor = (color2) => colorRegex.test(color2);
|
|
20800
20994
|
var colorPickerDefaultColors = [
|
|
@@ -20817,7 +21011,7 @@ var colorPickerDefaultColors = [
|
|
|
20817
21011
|
"rgb(64,64,64)",
|
|
20818
21012
|
"rgb(255,165,0)"
|
|
20819
21013
|
];
|
|
20820
|
-
var ColorPicker =
|
|
21014
|
+
var ColorPicker = React61.forwardRef(function ColorPickerWrapper({
|
|
20821
21015
|
value,
|
|
20822
21016
|
label,
|
|
20823
21017
|
width: width2,
|
|
@@ -20830,22 +21024,22 @@ var ColorPicker = React60.forwardRef(function ColorPickerWrapper({
|
|
|
20830
21024
|
onChange
|
|
20831
21025
|
}, ref) {
|
|
20832
21026
|
const { t } = useTranslation();
|
|
20833
|
-
const [previousColors, setPreviousColors] =
|
|
21027
|
+
const [previousColors, setPreviousColors] = React61.useState(
|
|
20834
21028
|
colorPickerDefaultColors
|
|
20835
21029
|
);
|
|
20836
21030
|
const currentColorPreset = presets || previousColors;
|
|
20837
|
-
const [internalPickerValue, setInternalPickerValue] =
|
|
21031
|
+
const [internalPickerValue, setInternalPickerValue] = React61.useState(
|
|
20838
21032
|
value || white
|
|
20839
21033
|
);
|
|
20840
21034
|
const { valueToHex } = useColorPicker(
|
|
20841
21035
|
internalPickerValue ?? "",
|
|
20842
21036
|
setInternalPickerValue
|
|
20843
21037
|
);
|
|
20844
|
-
const [textFieldValue, setTextFieldValue] =
|
|
21038
|
+
const [textFieldValue, setTextFieldValue] = React61.useState(
|
|
20845
21039
|
value ? valueToHex() : ""
|
|
20846
21040
|
);
|
|
20847
|
-
const [isValidPickerChange, setValidPickerChange] =
|
|
20848
|
-
const [anchorEl, setAnchorEl] =
|
|
21041
|
+
const [isValidPickerChange, setValidPickerChange] = React61.useState(false);
|
|
21042
|
+
const [anchorEl, setAnchorEl] = React61.useState();
|
|
20849
21043
|
const handleTextFieldChange = (event) => {
|
|
20850
21044
|
const newValue = event.target.value;
|
|
20851
21045
|
setValidPickerChange(false);
|
|
@@ -20865,7 +21059,7 @@ var ColorPicker = React60.forwardRef(function ColorPickerWrapper({
|
|
|
20865
21059
|
return hex.length === 1 ? "0" + hex : hex;
|
|
20866
21060
|
}).join("");
|
|
20867
21061
|
};
|
|
20868
|
-
const iconColor = /* @__PURE__ */
|
|
21062
|
+
const iconColor = /* @__PURE__ */ jsx114(
|
|
20869
21063
|
IconButton_default,
|
|
20870
21064
|
{
|
|
20871
21065
|
iconId: value ? "color-square" : "transparent",
|
|
@@ -20876,7 +21070,7 @@ var ColorPicker = React60.forwardRef(function ColorPickerWrapper({
|
|
|
20876
21070
|
sx: { color: value || grey600 }
|
|
20877
21071
|
}
|
|
20878
21072
|
);
|
|
20879
|
-
|
|
21073
|
+
React61.useEffect(() => {
|
|
20880
21074
|
const handleColorChange = (color2) => {
|
|
20881
21075
|
setPreviousColors((prev) => [color2, ...prev.slice(0, 17)]);
|
|
20882
21076
|
setTextFieldValue(valueToHex());
|
|
@@ -20888,7 +21082,7 @@ var ColorPicker = React60.forwardRef(function ColorPickerWrapper({
|
|
|
20888
21082
|
}
|
|
20889
21083
|
}, [value, internalPickerValue, onChange, isValidPickerChange, valueToHex]);
|
|
20890
21084
|
return /* @__PURE__ */ jsxs52(Fragment22, { children: [
|
|
20891
|
-
/* @__PURE__ */
|
|
21085
|
+
/* @__PURE__ */ jsx114(
|
|
20892
21086
|
TextField_default,
|
|
20893
21087
|
{
|
|
20894
21088
|
value: textFieldValue,
|
|
@@ -20913,7 +21107,7 @@ var ColorPicker = React60.forwardRef(function ColorPickerWrapper({
|
|
|
20913
21107
|
ref
|
|
20914
21108
|
}
|
|
20915
21109
|
),
|
|
20916
|
-
/* @__PURE__ */
|
|
21110
|
+
/* @__PURE__ */ jsx114(
|
|
20917
21111
|
Popover_default,
|
|
20918
21112
|
{
|
|
20919
21113
|
anchorEl,
|
|
@@ -20922,7 +21116,7 @@ var ColorPicker = React60.forwardRef(function ColorPickerWrapper({
|
|
|
20922
21116
|
onMouseUp: () => {
|
|
20923
21117
|
setValidPickerChange(true);
|
|
20924
21118
|
},
|
|
20925
|
-
children: /* @__PURE__ */
|
|
21119
|
+
children: /* @__PURE__ */ jsx114(
|
|
20926
21120
|
Box_default2,
|
|
20927
21121
|
{
|
|
20928
21122
|
className: "Cn-Color-Gradient-Box",
|
|
@@ -20966,7 +21160,7 @@ var ColorPicker = React60.forwardRef(function ColorPickerWrapper({
|
|
|
20966
21160
|
fontFamily: "Source Sans Pro, sans-serif"
|
|
20967
21161
|
}
|
|
20968
21162
|
},
|
|
20969
|
-
children: /* @__PURE__ */
|
|
21163
|
+
children: /* @__PURE__ */ jsx114(
|
|
20970
21164
|
GradientColorPicker,
|
|
20971
21165
|
{
|
|
20972
21166
|
className: "Cn-Color-Gradient-Picker",
|
|
@@ -20997,7 +21191,7 @@ var ColorPicker_default = ColorPicker;
|
|
|
20997
21191
|
|
|
20998
21192
|
// src/components/input/UploadClickableArea.tsx
|
|
20999
21193
|
import { Box as Box3 } from "@mui/material";
|
|
21000
|
-
import { jsx as
|
|
21194
|
+
import { jsx as jsx115, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
21001
21195
|
var UploadClickableArea = ({
|
|
21002
21196
|
accept,
|
|
21003
21197
|
onFilesChanged,
|
|
@@ -21011,7 +21205,7 @@ var UploadClickableArea = ({
|
|
|
21011
21205
|
display: "inline-block"
|
|
21012
21206
|
},
|
|
21013
21207
|
children: [
|
|
21014
|
-
/* @__PURE__ */
|
|
21208
|
+
/* @__PURE__ */ jsx115(
|
|
21015
21209
|
"input",
|
|
21016
21210
|
{
|
|
21017
21211
|
type: "file",
|
|
@@ -21027,10 +21221,10 @@ var UploadClickableArea = ({
|
|
|
21027
21221
|
var UploadClickableArea_default = UploadClickableArea;
|
|
21028
21222
|
|
|
21029
21223
|
// src/components/input/CategorizedPicker.tsx
|
|
21030
|
-
import
|
|
21031
|
-
import { Grid as Grid3, Popover as Popover2, Select as Select3, Stack as
|
|
21032
|
-
import { Fragment as Fragment23, jsx as
|
|
21033
|
-
var ChevronIcon2 = ({ disabled }) => /* @__PURE__ */
|
|
21224
|
+
import React62 from "react";
|
|
21225
|
+
import { Grid as Grid3, Popover as Popover2, Select as Select3, Stack as Stack9 } from "@mui/material";
|
|
21226
|
+
import { Fragment as Fragment23, jsx as jsx116, jsxs as jsxs54 } from "react/jsx-runtime";
|
|
21227
|
+
var ChevronIcon2 = ({ disabled }) => /* @__PURE__ */ jsx116(
|
|
21034
21228
|
Icon_default,
|
|
21035
21229
|
{
|
|
21036
21230
|
id: "chevron-down",
|
|
@@ -21052,38 +21246,38 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21052
21246
|
onChange
|
|
21053
21247
|
}) {
|
|
21054
21248
|
const { t } = useTranslation();
|
|
21055
|
-
const anchorRef =
|
|
21056
|
-
const [open, setOpen] =
|
|
21057
|
-
const [search, setSearch] =
|
|
21058
|
-
const [unfilteredCategories] =
|
|
21249
|
+
const anchorRef = React62.useRef(null);
|
|
21250
|
+
const [open, setOpen] = React62.useState(false);
|
|
21251
|
+
const [search, setSearch] = React62.useState("");
|
|
21252
|
+
const [unfilteredCategories] = React62.useState(
|
|
21059
21253
|
categories.map((category) => ({
|
|
21060
21254
|
...category,
|
|
21061
21255
|
categoryOptions: options.filter(category.filter)
|
|
21062
21256
|
})).filter((category) => category.categoryOptions.length > 0)
|
|
21063
21257
|
);
|
|
21064
|
-
const [filteredCategories, setFilteredCategories] =
|
|
21065
|
-
const getDefaultSelectedCategory =
|
|
21258
|
+
const [filteredCategories, setFilteredCategories] = React62.useState(unfilteredCategories);
|
|
21259
|
+
const getDefaultSelectedCategory = React62.useCallback(
|
|
21066
21260
|
() => filteredCategories.find(
|
|
21067
21261
|
(category) => category.categoryOptions.some((option) => option.id === value?.id)
|
|
21068
21262
|
),
|
|
21069
21263
|
[filteredCategories, value?.id]
|
|
21070
21264
|
);
|
|
21071
|
-
const [selectedCategory, setSelectedCategory] =
|
|
21072
|
-
const onTypeSearch =
|
|
21265
|
+
const [selectedCategory, setSelectedCategory] = React62.useState(getDefaultSelectedCategory());
|
|
21266
|
+
const onTypeSearch = React62.useCallback(
|
|
21073
21267
|
(event) => {
|
|
21074
21268
|
setSearch(event.target.value);
|
|
21075
21269
|
},
|
|
21076
21270
|
[]
|
|
21077
21271
|
);
|
|
21078
|
-
const openPopover =
|
|
21272
|
+
const openPopover = React62.useCallback(() => {
|
|
21079
21273
|
setOpen(true);
|
|
21080
21274
|
setSearch("");
|
|
21081
21275
|
setSelectedCategory(getDefaultSelectedCategory());
|
|
21082
21276
|
}, [getDefaultSelectedCategory]);
|
|
21083
|
-
const closePopover =
|
|
21277
|
+
const closePopover = React62.useCallback(() => {
|
|
21084
21278
|
setOpen(false);
|
|
21085
21279
|
}, []);
|
|
21086
|
-
|
|
21280
|
+
React62.useEffect(() => {
|
|
21087
21281
|
const tokens = search.split(",").map((s) => s.trim()).filter((s) => !!s);
|
|
21088
21282
|
if (tokens.length === 0) {
|
|
21089
21283
|
setFilteredCategories(unfilteredCategories);
|
|
@@ -21113,7 +21307,7 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21113
21307
|
}).filter((category) => !!category);
|
|
21114
21308
|
setFilteredCategories(nextCategories);
|
|
21115
21309
|
}, [categories, options, search, unfilteredCategories]);
|
|
21116
|
-
|
|
21310
|
+
React62.useEffect(() => {
|
|
21117
21311
|
const filteredSelectedCategory = selectedCategory && filteredCategories.find(
|
|
21118
21312
|
(category) => category.name === selectedCategory.name
|
|
21119
21313
|
);
|
|
@@ -21126,7 +21320,7 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21126
21320
|
}
|
|
21127
21321
|
}, [filteredCategories, selectedCategory]);
|
|
21128
21322
|
return /* @__PURE__ */ jsxs54(Fragment23, { children: [
|
|
21129
|
-
/* @__PURE__ */
|
|
21323
|
+
/* @__PURE__ */ jsx116(
|
|
21130
21324
|
Select3,
|
|
21131
21325
|
{
|
|
21132
21326
|
ref: anchorRef,
|
|
@@ -21141,7 +21335,7 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21141
21335
|
value: value?.name || "",
|
|
21142
21336
|
displayEmpty: true,
|
|
21143
21337
|
disabled,
|
|
21144
|
-
input: /* @__PURE__ */
|
|
21338
|
+
input: /* @__PURE__ */ jsx116(
|
|
21145
21339
|
BootstrapInput,
|
|
21146
21340
|
{
|
|
21147
21341
|
sx: {
|
|
@@ -21150,7 +21344,7 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21150
21344
|
}
|
|
21151
21345
|
),
|
|
21152
21346
|
renderValue: (value2) => value2 || placeholder,
|
|
21153
|
-
IconComponent: () => /* @__PURE__ */
|
|
21347
|
+
IconComponent: () => /* @__PURE__ */ jsx116(ChevronIcon2, { disabled }),
|
|
21154
21348
|
onClick: !disabled ? (e) => {
|
|
21155
21349
|
e.preventDefault();
|
|
21156
21350
|
e.stopPropagation();
|
|
@@ -21158,10 +21352,10 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21158
21352
|
} : void 0,
|
|
21159
21353
|
open: false,
|
|
21160
21354
|
"data-testid": dataTestId,
|
|
21161
|
-
children: options.map((option) => /* @__PURE__ */
|
|
21355
|
+
children: options.map((option) => /* @__PURE__ */ jsx116("option", { value: option.name }, option.id))
|
|
21162
21356
|
}
|
|
21163
21357
|
),
|
|
21164
|
-
/* @__PURE__ */
|
|
21358
|
+
/* @__PURE__ */ jsx116(
|
|
21165
21359
|
Popover2,
|
|
21166
21360
|
{
|
|
21167
21361
|
anchorEl: anchorRef.current,
|
|
@@ -21183,7 +21377,7 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21183
21377
|
}
|
|
21184
21378
|
},
|
|
21185
21379
|
children: /* @__PURE__ */ jsxs54(Grid3, { container: true, children: [
|
|
21186
|
-
/* @__PURE__ */
|
|
21380
|
+
/* @__PURE__ */ jsx116(
|
|
21187
21381
|
Grid3,
|
|
21188
21382
|
{
|
|
21189
21383
|
size: {
|
|
@@ -21191,7 +21385,7 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21191
21385
|
},
|
|
21192
21386
|
padding: "8px",
|
|
21193
21387
|
borderBottom: `1px solid ${grey200}`,
|
|
21194
|
-
children: /* @__PURE__ */
|
|
21388
|
+
children: /* @__PURE__ */ jsx116(
|
|
21195
21389
|
DebouncedTextField_default,
|
|
21196
21390
|
{
|
|
21197
21391
|
placeholder: t(
|
|
@@ -21199,12 +21393,12 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21199
21393
|
),
|
|
21200
21394
|
value: search,
|
|
21201
21395
|
onChange: onTypeSearch,
|
|
21202
|
-
startAdornment: /* @__PURE__ */
|
|
21396
|
+
startAdornment: /* @__PURE__ */ jsx116(Icon_default, { id: "magnify" })
|
|
21203
21397
|
}
|
|
21204
21398
|
)
|
|
21205
21399
|
}
|
|
21206
21400
|
),
|
|
21207
|
-
/* @__PURE__ */
|
|
21401
|
+
/* @__PURE__ */ jsx116(
|
|
21208
21402
|
Grid3,
|
|
21209
21403
|
{
|
|
21210
21404
|
size: {
|
|
@@ -21213,14 +21407,14 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21213
21407
|
sx: { borderRight: `1px solid ${grey200}` },
|
|
21214
21408
|
height: "316px",
|
|
21215
21409
|
className: "Slim-Vertical-Scroll",
|
|
21216
|
-
children: /* @__PURE__ */
|
|
21410
|
+
children: /* @__PURE__ */ jsx116(Stack9, { children: filteredCategories.map((category, idx) => /* @__PURE__ */ jsx116(
|
|
21217
21411
|
ListItemButton_default,
|
|
21218
21412
|
{
|
|
21219
21413
|
selected: selectedCategory === category,
|
|
21220
21414
|
onClick: () => {
|
|
21221
21415
|
setSelectedCategory(category);
|
|
21222
21416
|
},
|
|
21223
|
-
endAdornment: selectedCategory === category ? /* @__PURE__ */
|
|
21417
|
+
endAdornment: selectedCategory === category ? /* @__PURE__ */ jsx116(
|
|
21224
21418
|
Icon_default,
|
|
21225
21419
|
{
|
|
21226
21420
|
id: "menu-right",
|
|
@@ -21228,10 +21422,10 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21228
21422
|
}
|
|
21229
21423
|
) : void 0,
|
|
21230
21424
|
buttonDataTest: dataTestId ? dataTestId + "-category-" + idx : void 0,
|
|
21231
|
-
children: /* @__PURE__ */
|
|
21425
|
+
children: /* @__PURE__ */ jsx116(
|
|
21232
21426
|
TextEllipsis_default,
|
|
21233
21427
|
{
|
|
21234
|
-
text: /* @__PURE__ */
|
|
21428
|
+
text: /* @__PURE__ */ jsx116(
|
|
21235
21429
|
TextMarker_default,
|
|
21236
21430
|
{
|
|
21237
21431
|
searchText: search,
|
|
@@ -21249,7 +21443,7 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21249
21443
|
)) })
|
|
21250
21444
|
}
|
|
21251
21445
|
),
|
|
21252
|
-
/* @__PURE__ */
|
|
21446
|
+
/* @__PURE__ */ jsx116(
|
|
21253
21447
|
Grid3,
|
|
21254
21448
|
{
|
|
21255
21449
|
size: {
|
|
@@ -21257,7 +21451,7 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21257
21451
|
},
|
|
21258
21452
|
height: "316px",
|
|
21259
21453
|
className: "Slim-Vertical-Scroll",
|
|
21260
|
-
children: /* @__PURE__ */
|
|
21454
|
+
children: /* @__PURE__ */ jsx116(Stack9, { children: /* @__PURE__ */ jsx116(Stack9, { children: !selectedCategory ? /* @__PURE__ */ jsx116(Stack9, { padding: "12px", alignItems: "center", children: /* @__PURE__ */ jsx116(
|
|
21261
21455
|
Typography_default,
|
|
21262
21456
|
{
|
|
21263
21457
|
variant: "body2",
|
|
@@ -21269,7 +21463,7 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21269
21463
|
)
|
|
21270
21464
|
}
|
|
21271
21465
|
) }) : selectedCategory.categoryOptions.map(
|
|
21272
|
-
(option, idx) => /* @__PURE__ */
|
|
21466
|
+
(option, idx) => /* @__PURE__ */ jsx116(
|
|
21273
21467
|
ListItemButton_default,
|
|
21274
21468
|
{
|
|
21275
21469
|
selected: value?.id === option.id,
|
|
@@ -21278,10 +21472,10 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21278
21472
|
closePopover();
|
|
21279
21473
|
},
|
|
21280
21474
|
buttonDataTest: dataTestId ? dataTestId + "-option-" + idx : void 0,
|
|
21281
|
-
children: /* @__PURE__ */
|
|
21475
|
+
children: /* @__PURE__ */ jsx116(
|
|
21282
21476
|
TextEllipsis_default,
|
|
21283
21477
|
{
|
|
21284
|
-
text: /* @__PURE__ */
|
|
21478
|
+
text: /* @__PURE__ */ jsx116(
|
|
21285
21479
|
TextMarker_default,
|
|
21286
21480
|
{
|
|
21287
21481
|
searchText: search,
|
|
@@ -21307,14 +21501,14 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21307
21501
|
var CategorizedPicker_default = CategorizedPicker;
|
|
21308
21502
|
|
|
21309
21503
|
// src/components/input/ItemSelector.tsx
|
|
21310
|
-
import * as
|
|
21504
|
+
import * as React64 from "react";
|
|
21311
21505
|
|
|
21312
21506
|
// src/components/input/SelectPopover.tsx
|
|
21313
|
-
import * as
|
|
21314
|
-
import { Grid as Grid4, Stack as
|
|
21507
|
+
import * as React63 from "react";
|
|
21508
|
+
import { Grid as Grid4, Stack as Stack10 } from "@mui/material";
|
|
21315
21509
|
import { useState as useState22 } from "react";
|
|
21316
21510
|
import InfiniteScroll from "react-infinite-scroll-component";
|
|
21317
|
-
import { jsx as
|
|
21511
|
+
import { jsx as jsx117, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
21318
21512
|
var defaultItemsColorStyles = {
|
|
21319
21513
|
selectedColor: Colors_exports.primaryMain,
|
|
21320
21514
|
disabledColor: ""
|
|
@@ -21341,14 +21535,16 @@ var SelectPopover = function SelectPopover2({
|
|
|
21341
21535
|
maxSelectedItems,
|
|
21342
21536
|
keepCurrentSelectionOnSearch = true,
|
|
21343
21537
|
emptyListPlaceholder,
|
|
21344
|
-
disableApplyWithoutChanges = false
|
|
21538
|
+
disableApplyWithoutChanges = false,
|
|
21539
|
+
centeredInScreen = false,
|
|
21540
|
+
paddingContent
|
|
21345
21541
|
}) {
|
|
21346
21542
|
const { t } = useTranslation();
|
|
21347
21543
|
const [searchText, setSearchText] = useState22("");
|
|
21348
21544
|
const [isScrollBottom, setIsScrollBottom] = useState22(false);
|
|
21349
21545
|
const [currentItems, setCurrentItems] = useState22([]);
|
|
21350
|
-
const [currentSelectedItems, setCurrentSelectedItems] =
|
|
21351
|
-
const prevSelectedItemsIdsRef =
|
|
21546
|
+
const [currentSelectedItems, setCurrentSelectedItems] = React63.useState([]);
|
|
21547
|
+
const prevSelectedItemsIdsRef = React63.useRef([]);
|
|
21352
21548
|
const onSearchTextChanged = (text) => {
|
|
21353
21549
|
onSearch(text);
|
|
21354
21550
|
setSearchText(text);
|
|
@@ -21360,7 +21556,7 @@ var SelectPopover = function SelectPopover2({
|
|
|
21360
21556
|
}
|
|
21361
21557
|
setCurrentSelectedItems(selectedItemsIds);
|
|
21362
21558
|
};
|
|
21363
|
-
|
|
21559
|
+
React63.useEffect(() => {
|
|
21364
21560
|
const prevSelectedItemsIds = prevSelectedItemsIdsRef.current;
|
|
21365
21561
|
if (keepCurrentSelectionOnSearch && anchorEl) {
|
|
21366
21562
|
let nextSelectedItems = currentSelectedItems;
|
|
@@ -21452,18 +21648,19 @@ var SelectPopover = function SelectPopover2({
|
|
|
21452
21648
|
return /* @__PURE__ */ jsxs55(
|
|
21453
21649
|
Popover_default,
|
|
21454
21650
|
{
|
|
21651
|
+
centeredInScreen,
|
|
21455
21652
|
onClose: closePopover,
|
|
21456
21653
|
anchorEl,
|
|
21457
21654
|
disableRestoreFocus,
|
|
21458
21655
|
children: [
|
|
21459
|
-
/* @__PURE__ */
|
|
21656
|
+
/* @__PURE__ */ jsx117(
|
|
21460
21657
|
Box_default2,
|
|
21461
21658
|
{
|
|
21462
21659
|
sx: {
|
|
21463
21660
|
borderBottom: `1px solid ${Colors_exports.grey200}`,
|
|
21464
21661
|
padding: "8px"
|
|
21465
21662
|
},
|
|
21466
|
-
children: /* @__PURE__ */
|
|
21663
|
+
children: /* @__PURE__ */ jsx117(
|
|
21467
21664
|
DebouncedTextField_default,
|
|
21468
21665
|
{
|
|
21469
21666
|
iconId: "magnify",
|
|
@@ -21478,7 +21675,7 @@ var SelectPopover = function SelectPopover2({
|
|
|
21478
21675
|
)
|
|
21479
21676
|
}
|
|
21480
21677
|
),
|
|
21481
|
-
/* @__PURE__ */
|
|
21678
|
+
/* @__PURE__ */ jsx117(
|
|
21482
21679
|
InfiniteScroll,
|
|
21483
21680
|
{
|
|
21484
21681
|
height: 300,
|
|
@@ -21503,8 +21700,11 @@ var SelectPopover = function SelectPopover2({
|
|
|
21503
21700
|
container: true,
|
|
21504
21701
|
spacing: 1,
|
|
21505
21702
|
sx: {
|
|
21506
|
-
padding: "12px 0px 12px 12px",
|
|
21703
|
+
padding: paddingContent || "12px 0px 12px 12px",
|
|
21507
21704
|
width: "100%",
|
|
21705
|
+
...!isLoading && currentItems.length === 0 && {
|
|
21706
|
+
height: "100%"
|
|
21707
|
+
},
|
|
21508
21708
|
"&::before": {
|
|
21509
21709
|
content: `''`,
|
|
21510
21710
|
position: "absolute",
|
|
@@ -21537,7 +21737,7 @@ var SelectPopover = function SelectPopover2({
|
|
|
21537
21737
|
onItemSelected
|
|
21538
21738
|
) : getItemElement(item, onItemSelected)
|
|
21539
21739
|
),
|
|
21540
|
-
isLoading && /* @__PURE__ */
|
|
21740
|
+
isLoading && /* @__PURE__ */ jsx117(
|
|
21541
21741
|
Skeleton_default,
|
|
21542
21742
|
{
|
|
21543
21743
|
variant: "text",
|
|
@@ -21550,25 +21750,25 @@ var SelectPopover = function SelectPopover2({
|
|
|
21550
21750
|
}
|
|
21551
21751
|
}
|
|
21552
21752
|
),
|
|
21553
|
-
!isLoading && currentItems.length === 0 ? /* @__PURE__ */
|
|
21554
|
-
|
|
21753
|
+
!isLoading && currentItems.length === 0 ? typeof emptyListPlaceholder === "string" ? /* @__PURE__ */ jsx117(
|
|
21754
|
+
Stack10,
|
|
21555
21755
|
{
|
|
21556
21756
|
alignItems: "center",
|
|
21557
21757
|
justifyContent: "center",
|
|
21558
21758
|
width: "100%",
|
|
21559
|
-
children: /* @__PURE__ */
|
|
21759
|
+
children: /* @__PURE__ */ jsx117(Typography_default, { variant: "body2", color: grey600, children: emptyListPlaceholder })
|
|
21560
21760
|
}
|
|
21561
|
-
) : ""
|
|
21761
|
+
) : emptyListPlaceholder : ""
|
|
21562
21762
|
]
|
|
21563
21763
|
}
|
|
21564
21764
|
)
|
|
21565
21765
|
}
|
|
21566
21766
|
),
|
|
21567
|
-
/* @__PURE__ */
|
|
21767
|
+
/* @__PURE__ */ jsx117(
|
|
21568
21768
|
PopoverActions_default,
|
|
21569
21769
|
{
|
|
21570
21770
|
sx: { padding: "16px 24px" },
|
|
21571
|
-
leftContent: /* @__PURE__ */
|
|
21771
|
+
leftContent: /* @__PURE__ */ jsx117(
|
|
21572
21772
|
Button_default,
|
|
21573
21773
|
{
|
|
21574
21774
|
variant: "contained",
|
|
@@ -21578,7 +21778,7 @@ var SelectPopover = function SelectPopover2({
|
|
|
21578
21778
|
onClick: closePopover
|
|
21579
21779
|
}
|
|
21580
21780
|
),
|
|
21581
|
-
rightContent: /* @__PURE__ */
|
|
21781
|
+
rightContent: /* @__PURE__ */ jsx117(
|
|
21582
21782
|
Button_default,
|
|
21583
21783
|
{
|
|
21584
21784
|
variant: "contained",
|
|
@@ -21602,7 +21802,7 @@ var SelectPopover = function SelectPopover2({
|
|
|
21602
21802
|
);
|
|
21603
21803
|
};
|
|
21604
21804
|
function getItemElement(item, onItemClick) {
|
|
21605
|
-
return /* @__PURE__ */
|
|
21805
|
+
return /* @__PURE__ */ jsx117(
|
|
21606
21806
|
SelectPopoverItem_default,
|
|
21607
21807
|
{
|
|
21608
21808
|
id: item.id,
|
|
@@ -21631,7 +21831,7 @@ var arraysEqual = (a, b) => {
|
|
|
21631
21831
|
var SelectPopover_default = SelectPopover;
|
|
21632
21832
|
|
|
21633
21833
|
// src/components/input/ItemSelector.tsx
|
|
21634
|
-
import { Fragment as Fragment24, jsx as
|
|
21834
|
+
import { Fragment as Fragment24, jsx as jsx118, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
21635
21835
|
var ItemSelector = function ItemSelector2({
|
|
21636
21836
|
items,
|
|
21637
21837
|
selectedItems,
|
|
@@ -21662,16 +21862,16 @@ var ItemSelector = function ItemSelector2({
|
|
|
21662
21862
|
onSearch,
|
|
21663
21863
|
onClose
|
|
21664
21864
|
}) {
|
|
21665
|
-
const [anchorEl, setAnchorEl] =
|
|
21666
|
-
const [searchText, setSearchText] =
|
|
21667
|
-
const allShownItemsRef =
|
|
21668
|
-
const selectRef =
|
|
21669
|
-
|
|
21865
|
+
const [anchorEl, setAnchorEl] = React64.useState();
|
|
21866
|
+
const [searchText, setSearchText] = React64.useState("");
|
|
21867
|
+
const allShownItemsRef = React64.useRef(items);
|
|
21868
|
+
const selectRef = React64.useRef(null);
|
|
21869
|
+
React64.useEffect(() => {
|
|
21670
21870
|
if (anchorEl) {
|
|
21671
21871
|
onSearch(searchText);
|
|
21672
21872
|
}
|
|
21673
21873
|
}, [anchorEl, onSearch, searchText]);
|
|
21674
|
-
|
|
21874
|
+
React64.useEffect(() => {
|
|
21675
21875
|
const allShownItems = allShownItemsRef.current;
|
|
21676
21876
|
allShownItemsRef.current = allShownItems.concat(
|
|
21677
21877
|
items.filter(
|
|
@@ -21685,7 +21885,7 @@ var ItemSelector = function ItemSelector2({
|
|
|
21685
21885
|
item
|
|
21686
21886
|
}) => {
|
|
21687
21887
|
const [ref, { contentWidth: width2 }] = useResizeObserver();
|
|
21688
|
-
return /* @__PURE__ */
|
|
21888
|
+
return /* @__PURE__ */ jsx118(
|
|
21689
21889
|
Chip_default,
|
|
21690
21890
|
{
|
|
21691
21891
|
ref,
|
|
@@ -21716,7 +21916,7 @@ var ItemSelector = function ItemSelector2({
|
|
|
21716
21916
|
return selectedItem ? [selectedItem] : "";
|
|
21717
21917
|
};
|
|
21718
21918
|
return /* @__PURE__ */ jsxs56(Fragment24, { children: [
|
|
21719
|
-
/* @__PURE__ */
|
|
21919
|
+
/* @__PURE__ */ jsx118(
|
|
21720
21920
|
Select_default,
|
|
21721
21921
|
{
|
|
21722
21922
|
ref: selectRef,
|
|
@@ -21733,16 +21933,16 @@ var ItemSelector = function ItemSelector2({
|
|
|
21733
21933
|
let component;
|
|
21734
21934
|
if (!value || !Array.isArray(value) || value.length === 0) {
|
|
21735
21935
|
component = /* @__PURE__ */ jsxs56(Fragment24, { children: [
|
|
21736
|
-
/* @__PURE__ */
|
|
21936
|
+
/* @__PURE__ */ jsx118(
|
|
21737
21937
|
Stack_default,
|
|
21738
21938
|
{
|
|
21739
21939
|
direction: "row",
|
|
21740
21940
|
flexWrap: "wrap",
|
|
21741
21941
|
padding: "6px 0",
|
|
21742
|
-
children: /* @__PURE__ */
|
|
21942
|
+
children: /* @__PURE__ */ jsx118(Typography_default, { variant: "body2", color: grey600, children: placeholder })
|
|
21743
21943
|
}
|
|
21744
21944
|
),
|
|
21745
|
-
/* @__PURE__ */
|
|
21945
|
+
/* @__PURE__ */ jsx118(
|
|
21746
21946
|
Divider_default,
|
|
21747
21947
|
{
|
|
21748
21948
|
variant: "middle",
|
|
@@ -21767,7 +21967,7 @@ var ItemSelector = function ItemSelector2({
|
|
|
21767
21967
|
const item = selectedItems.find(
|
|
21768
21968
|
(i) => i.id === id
|
|
21769
21969
|
);
|
|
21770
|
-
return item ? /* @__PURE__ */
|
|
21970
|
+
return item ? /* @__PURE__ */ jsx118(
|
|
21771
21971
|
ItemChip,
|
|
21772
21972
|
{
|
|
21773
21973
|
item: {
|
|
@@ -21776,14 +21976,14 @@ var ItemSelector = function ItemSelector2({
|
|
|
21776
21976
|
}
|
|
21777
21977
|
},
|
|
21778
21978
|
id
|
|
21779
|
-
) : /* @__PURE__ */
|
|
21979
|
+
) : /* @__PURE__ */ jsx118(Fragment24, {});
|
|
21780
21980
|
}),
|
|
21781
|
-
value.length - limitItemChips > 0 ? /* @__PURE__ */
|
|
21981
|
+
value.length - limitItemChips > 0 ? /* @__PURE__ */ jsx118(
|
|
21782
21982
|
Tooltip_default,
|
|
21783
21983
|
{
|
|
21784
21984
|
interactive: true,
|
|
21785
21985
|
variant: "white",
|
|
21786
|
-
title: /* @__PURE__ */
|
|
21986
|
+
title: /* @__PURE__ */ jsx118(
|
|
21787
21987
|
Stack_default,
|
|
21788
21988
|
{
|
|
21789
21989
|
direction: "row",
|
|
@@ -21800,24 +22000,24 @@ var ItemSelector = function ItemSelector2({
|
|
|
21800
22000
|
const item = selectedItems.find(
|
|
21801
22001
|
(i) => i.id === id
|
|
21802
22002
|
);
|
|
21803
|
-
return item ? /* @__PURE__ */
|
|
22003
|
+
return item ? /* @__PURE__ */ jsx118(
|
|
21804
22004
|
ItemChip,
|
|
21805
22005
|
{
|
|
21806
22006
|
item
|
|
21807
22007
|
},
|
|
21808
22008
|
id
|
|
21809
|
-
) : /* @__PURE__ */
|
|
22009
|
+
) : /* @__PURE__ */ jsx118(Fragment24, {});
|
|
21810
22010
|
})
|
|
21811
22011
|
}
|
|
21812
22012
|
),
|
|
21813
|
-
children: /* @__PURE__ */
|
|
22013
|
+
children: /* @__PURE__ */ jsx118(Typography_default, { variant: "body2", children: `+${value.length - limitItemChips}` })
|
|
21814
22014
|
}
|
|
21815
22015
|
) : void 0
|
|
21816
22016
|
]
|
|
21817
22017
|
}
|
|
21818
22018
|
),
|
|
21819
22019
|
!disabled && /* @__PURE__ */ jsxs56(Stack_default, { direction: "row", children: [
|
|
21820
|
-
/* @__PURE__ */
|
|
22020
|
+
/* @__PURE__ */ jsx118(
|
|
21821
22021
|
IconButton_default,
|
|
21822
22022
|
{
|
|
21823
22023
|
iconId: "close",
|
|
@@ -21835,7 +22035,7 @@ var ItemSelector = function ItemSelector2({
|
|
|
21835
22035
|
}
|
|
21836
22036
|
}
|
|
21837
22037
|
),
|
|
21838
|
-
/* @__PURE__ */
|
|
22038
|
+
/* @__PURE__ */ jsx118(
|
|
21839
22039
|
Divider_default,
|
|
21840
22040
|
{
|
|
21841
22041
|
variant: "middle",
|
|
@@ -21846,7 +22046,7 @@ var ItemSelector = function ItemSelector2({
|
|
|
21846
22046
|
] })
|
|
21847
22047
|
] });
|
|
21848
22048
|
}
|
|
21849
|
-
return /* @__PURE__ */
|
|
22049
|
+
return /* @__PURE__ */ jsx118(
|
|
21850
22050
|
Stack_default,
|
|
21851
22051
|
{
|
|
21852
22052
|
direction: "row",
|
|
@@ -21868,8 +22068,8 @@ var ItemSelector = function ItemSelector2({
|
|
|
21868
22068
|
}
|
|
21869
22069
|
}
|
|
21870
22070
|
),
|
|
21871
|
-
helperText && /* @__PURE__ */
|
|
21872
|
-
/* @__PURE__ */
|
|
22071
|
+
helperText && /* @__PURE__ */ jsx118(InputHelperText_default, { severity: isError ? "error" : "info", children: helperText }),
|
|
22072
|
+
/* @__PURE__ */ jsx118(
|
|
21873
22073
|
SelectPopover_default,
|
|
21874
22074
|
{
|
|
21875
22075
|
items: items.map((item) => {
|
|
@@ -21917,7 +22117,7 @@ var ItemSelector = function ItemSelector2({
|
|
|
21917
22117
|
var ItemSelector_default = ItemSelector;
|
|
21918
22118
|
|
|
21919
22119
|
// src/components/input/Autocomplete.tsx
|
|
21920
|
-
import * as
|
|
22120
|
+
import * as React65 from "react";
|
|
21921
22121
|
import { Popper, ClickAwayListener } from "@mui/material";
|
|
21922
22122
|
import { FixedSizeList as FixedSizeList3 } from "react-window";
|
|
21923
22123
|
import AutoSizer5 from "react-virtualized-auto-sizer";
|
|
@@ -21934,7 +22134,7 @@ var map = {
|
|
|
21934
22134
|
var toDiacriticInsensitiveString = (input) => Array.from(input).map((char) => map[char] ? `[${map[char]}]` : char).join("");
|
|
21935
22135
|
|
|
21936
22136
|
// src/components/input/Autocomplete.tsx
|
|
21937
|
-
import { Fragment as Fragment25, jsx as
|
|
22137
|
+
import { Fragment as Fragment25, jsx as jsx119, jsxs as jsxs57 } from "react/jsx-runtime";
|
|
21938
22138
|
var AUTOCOMPLETE_ITEM_HEIGHT = 44;
|
|
21939
22139
|
var Autocomplete = function Autocomplete2({
|
|
21940
22140
|
variant = "default",
|
|
@@ -21964,19 +22164,19 @@ var Autocomplete = function Autocomplete2({
|
|
|
21964
22164
|
disableClear
|
|
21965
22165
|
}, ref) {
|
|
21966
22166
|
const { t } = useTranslation();
|
|
21967
|
-
const anchorRef =
|
|
21968
|
-
const inputRef =
|
|
21969
|
-
const expandSelectButtonRef =
|
|
21970
|
-
const listRef =
|
|
21971
|
-
const virtualListRef =
|
|
21972
|
-
const [isOpen, setOpen] =
|
|
21973
|
-
const [isDirty, setDirty] =
|
|
21974
|
-
const [selectedIndex, setSelectedIndex] =
|
|
21975
|
-
const [placeholder, setPlaceholder] =
|
|
22167
|
+
const anchorRef = React65.useRef(null);
|
|
22168
|
+
const inputRef = React65.useRef(null);
|
|
22169
|
+
const expandSelectButtonRef = React65.useRef(null);
|
|
22170
|
+
const listRef = React65.useRef(null);
|
|
22171
|
+
const virtualListRef = React65.createRef();
|
|
22172
|
+
const [isOpen, setOpen] = React65.useState(false);
|
|
22173
|
+
const [isDirty, setDirty] = React65.useState(false);
|
|
22174
|
+
const [selectedIndex, setSelectedIndex] = React65.useState(void 0);
|
|
22175
|
+
const [placeholder, setPlaceholder] = React65.useState(
|
|
21976
22176
|
textFieldProps?.placeholder || ""
|
|
21977
22177
|
);
|
|
21978
|
-
const _renderLabel =
|
|
21979
|
-
const [inputValue, setInputValue] =
|
|
22178
|
+
const _renderLabel = React65.useCallback((id) => id, []);
|
|
22179
|
+
const [inputValue, setInputValue] = React65.useState(
|
|
21980
22180
|
multiple ? "" : (renderLabel ?? _renderLabel)(value)
|
|
21981
22181
|
);
|
|
21982
22182
|
const dirty = !!inputValue || Array.isArray(value) && value.length > 0;
|
|
@@ -22039,7 +22239,7 @@ var Autocomplete = function Autocomplete2({
|
|
|
22039
22239
|
if (allowFreeText && freeOption.id !== "" && !filteredOptions.includes(freeOption) && !options.some((option) => option.id === freeOption.id)) {
|
|
22040
22240
|
filteredOptions.unshift(freeOption);
|
|
22041
22241
|
}
|
|
22042
|
-
|
|
22242
|
+
React65.useEffect(() => {
|
|
22043
22243
|
if (isOpen) {
|
|
22044
22244
|
if (typeof selectedIndex === "number") {
|
|
22045
22245
|
virtualListRef.current?.scrollToItem(selectedIndex);
|
|
@@ -22073,12 +22273,12 @@ var Autocomplete = function Autocomplete2({
|
|
|
22073
22273
|
filteredOptions.length,
|
|
22074
22274
|
virtualListRef
|
|
22075
22275
|
]);
|
|
22076
|
-
|
|
22276
|
+
React65.useEffect(() => {
|
|
22077
22277
|
if (!multiple) {
|
|
22078
22278
|
setInputValue((renderLabel ?? _renderLabel)(value));
|
|
22079
22279
|
}
|
|
22080
22280
|
}, [value]);
|
|
22081
|
-
|
|
22281
|
+
React65.useEffect(() => {
|
|
22082
22282
|
if (!isOpen && !allowFreeText) {
|
|
22083
22283
|
if (multiple) {
|
|
22084
22284
|
setInputValue("");
|
|
@@ -22130,7 +22330,7 @@ var Autocomplete = function Autocomplete2({
|
|
|
22130
22330
|
style: style3
|
|
22131
22331
|
}) => {
|
|
22132
22332
|
const option = filteredOptions[index];
|
|
22133
|
-
return /* @__PURE__ */
|
|
22333
|
+
return /* @__PURE__ */ jsx119(
|
|
22134
22334
|
ListItemButton_default,
|
|
22135
22335
|
{
|
|
22136
22336
|
selected: index === selectedIndex,
|
|
@@ -22139,7 +22339,7 @@ var Autocomplete = function Autocomplete2({
|
|
|
22139
22339
|
sx: style3,
|
|
22140
22340
|
color: Array.isArray(value) && value.includes(option.id) ? "primary" : void 0,
|
|
22141
22341
|
text: getText(option),
|
|
22142
|
-
endAdornment: multiple && (options.some((elem) => elem.id === option.id) ? Array.isArray(value) && value.includes(option.id) && /* @__PURE__ */
|
|
22342
|
+
endAdornment: multiple && (options.some((elem) => elem.id === option.id) ? Array.isArray(value) && value.includes(option.id) && /* @__PURE__ */ jsx119(Icon_default, { sx: { color: primaryMain }, id: "check" }) : /* @__PURE__ */ jsx119(
|
|
22143
22343
|
Icon_default,
|
|
22144
22344
|
{
|
|
22145
22345
|
id: Array.isArray(value) && value.includes(option.id) ? "close" : "plus"
|
|
@@ -22152,7 +22352,7 @@ var Autocomplete = function Autocomplete2({
|
|
|
22152
22352
|
);
|
|
22153
22353
|
};
|
|
22154
22354
|
return /* @__PURE__ */ jsxs57(Fragment25, { children: [
|
|
22155
|
-
/* @__PURE__ */
|
|
22355
|
+
/* @__PURE__ */ jsx119(
|
|
22156
22356
|
DebouncedTextField_default,
|
|
22157
22357
|
{
|
|
22158
22358
|
ref: ref ?? inputRef,
|
|
@@ -22242,7 +22442,7 @@ var Autocomplete = function Autocomplete2({
|
|
|
22242
22442
|
alignItems: "center"
|
|
22243
22443
|
},
|
|
22244
22444
|
children: [
|
|
22245
|
-
value.slice(0, limitValueTags || value.length).map((id) => /* @__PURE__ */
|
|
22445
|
+
value.slice(0, limitValueTags || value.length).map((id) => /* @__PURE__ */ jsx119(
|
|
22246
22446
|
Chip_default,
|
|
22247
22447
|
{
|
|
22248
22448
|
label: (renderLabel ?? _renderLabel)(
|
|
@@ -22262,12 +22462,12 @@ var Autocomplete = function Autocomplete2({
|
|
|
22262
22462
|
},
|
|
22263
22463
|
id
|
|
22264
22464
|
)),
|
|
22265
|
-
limitValueTags && value.length - limitValueTags > 0 ? /* @__PURE__ */
|
|
22465
|
+
limitValueTags && value.length - limitValueTags > 0 ? /* @__PURE__ */ jsx119(
|
|
22266
22466
|
Tooltip_default,
|
|
22267
22467
|
{
|
|
22268
22468
|
interactive: true,
|
|
22269
22469
|
variant: "white",
|
|
22270
|
-
title: /* @__PURE__ */
|
|
22470
|
+
title: /* @__PURE__ */ jsx119(
|
|
22271
22471
|
Stack_default,
|
|
22272
22472
|
{
|
|
22273
22473
|
direction: "row",
|
|
@@ -22280,7 +22480,7 @@ var Autocomplete = function Autocomplete2({
|
|
|
22280
22480
|
children: value.slice(
|
|
22281
22481
|
limitValueTags,
|
|
22282
22482
|
value.length
|
|
22283
|
-
).map((id) => /* @__PURE__ */
|
|
22483
|
+
).map((id) => /* @__PURE__ */ jsx119(
|
|
22284
22484
|
Chip_default,
|
|
22285
22485
|
{
|
|
22286
22486
|
label: (renderLabel ?? _renderLabel)(id),
|
|
@@ -22300,7 +22500,7 @@ var Autocomplete = function Autocomplete2({
|
|
|
22300
22500
|
))
|
|
22301
22501
|
}
|
|
22302
22502
|
),
|
|
22303
|
-
children: /* @__PURE__ */
|
|
22503
|
+
children: /* @__PURE__ */ jsx119(Typography_default, { variant: "body2", children: `+${value.length - limitValueTags}` })
|
|
22304
22504
|
}
|
|
22305
22505
|
) : ""
|
|
22306
22506
|
]
|
|
@@ -22317,7 +22517,7 @@ var Autocomplete = function Autocomplete2({
|
|
|
22317
22517
|
spacing: 1,
|
|
22318
22518
|
children: [
|
|
22319
22519
|
textFieldProps?.endAdornment,
|
|
22320
|
-
!disabled && dirty && showClearButton && /* @__PURE__ */
|
|
22520
|
+
!disabled && dirty && showClearButton && /* @__PURE__ */ jsx119(Tooltip_default, { title: t("AUTOCOMPLETE.CLEAR"), children: /* @__PURE__ */ jsx119(
|
|
22321
22521
|
IconButton_default,
|
|
22322
22522
|
{
|
|
22323
22523
|
iconId: "close",
|
|
@@ -22340,7 +22540,7 @@ var Autocomplete = function Autocomplete2({
|
|
|
22340
22540
|
"data-test": "clear-autocomplete"
|
|
22341
22541
|
}
|
|
22342
22542
|
) }),
|
|
22343
|
-
!disabled && dirty && showClearButton && /* @__PURE__ */
|
|
22543
|
+
!disabled && dirty && showClearButton && /* @__PURE__ */ jsx119(
|
|
22344
22544
|
Divider_default,
|
|
22345
22545
|
{
|
|
22346
22546
|
variant: "middle",
|
|
@@ -22348,11 +22548,11 @@ var Autocomplete = function Autocomplete2({
|
|
|
22348
22548
|
flexItem: true
|
|
22349
22549
|
}
|
|
22350
22550
|
),
|
|
22351
|
-
!disabled && variant !== "text" && /* @__PURE__ */
|
|
22551
|
+
!disabled && variant !== "text" && /* @__PURE__ */ jsx119(
|
|
22352
22552
|
Tooltip_default,
|
|
22353
22553
|
{
|
|
22354
22554
|
title: isOpen ? t("AUTOCOMPLETE.COLLAPSE") : t("AUTOCOMPLETE.EXPAND"),
|
|
22355
|
-
children: /* @__PURE__ */
|
|
22555
|
+
children: /* @__PURE__ */ jsx119(
|
|
22356
22556
|
IconButton_default,
|
|
22357
22557
|
{
|
|
22358
22558
|
ref: expandSelectButtonRef,
|
|
@@ -22374,7 +22574,7 @@ var Autocomplete = function Autocomplete2({
|
|
|
22374
22574
|
autoComplete: "off"
|
|
22375
22575
|
}
|
|
22376
22576
|
),
|
|
22377
|
-
/* @__PURE__ */
|
|
22577
|
+
/* @__PURE__ */ jsx119(
|
|
22378
22578
|
ClickAwayListener,
|
|
22379
22579
|
{
|
|
22380
22580
|
onClickAway: (event) => {
|
|
@@ -22399,13 +22599,13 @@ var Autocomplete = function Autocomplete2({
|
|
|
22399
22599
|
}
|
|
22400
22600
|
},
|
|
22401
22601
|
mouseEvent: "onMouseDown",
|
|
22402
|
-
children: /* @__PURE__ */
|
|
22602
|
+
children: /* @__PURE__ */ jsx119(
|
|
22403
22603
|
Popper,
|
|
22404
22604
|
{
|
|
22405
22605
|
anchorEl: anchorRef.current,
|
|
22406
22606
|
open: isOpen,
|
|
22407
22607
|
sx: { zIndex: 3e3 },
|
|
22408
|
-
children: /* @__PURE__ */
|
|
22608
|
+
children: /* @__PURE__ */ jsx119(Paper_default, { sx: { boxShadow: shadows[1], borderRadius: "8px" }, children: /* @__PURE__ */ jsxs57(
|
|
22409
22609
|
Box_default2,
|
|
22410
22610
|
{
|
|
22411
22611
|
sx: {
|
|
@@ -22417,22 +22617,22 @@ var Autocomplete = function Autocomplete2({
|
|
|
22417
22617
|
className: "Slim-Vertical-Scroll",
|
|
22418
22618
|
ref: listRef,
|
|
22419
22619
|
children: [
|
|
22420
|
-
isLoading && /* @__PURE__ */
|
|
22620
|
+
isLoading && /* @__PURE__ */ jsx119(
|
|
22421
22621
|
ListItem_default,
|
|
22422
22622
|
{
|
|
22423
22623
|
text: loadingText ?? t("AUTOCOMPLETE.LOADING")
|
|
22424
22624
|
}
|
|
22425
22625
|
),
|
|
22426
|
-
!isLoading && filteredOptions.length === 0 && /* @__PURE__ */
|
|
22626
|
+
!isLoading && filteredOptions.length === 0 && /* @__PURE__ */ jsx119(
|
|
22427
22627
|
ListItem_default,
|
|
22428
22628
|
{
|
|
22429
22629
|
text: noOptionsText ?? t("AUTOCOMPLETE.NO_OPTIONS")
|
|
22430
22630
|
}
|
|
22431
22631
|
),
|
|
22432
|
-
!isLoading && filteredOptions.length > 0 && /* @__PURE__ */
|
|
22632
|
+
!isLoading && filteredOptions.length > 0 && /* @__PURE__ */ jsx119(AutoSizer5, { children: ({
|
|
22433
22633
|
height: height2,
|
|
22434
22634
|
width: width2
|
|
22435
|
-
}) => /* @__PURE__ */
|
|
22635
|
+
}) => /* @__PURE__ */ jsx119(
|
|
22436
22636
|
FixedSizeList3,
|
|
22437
22637
|
{
|
|
22438
22638
|
overscanCount: 3,
|
|
@@ -22455,22 +22655,22 @@ var Autocomplete = function Autocomplete2({
|
|
|
22455
22655
|
)
|
|
22456
22656
|
] });
|
|
22457
22657
|
};
|
|
22458
|
-
var Autocomplete_default =
|
|
22658
|
+
var Autocomplete_default = React65.forwardRef(Autocomplete);
|
|
22459
22659
|
function escapeRegExp2(source) {
|
|
22460
22660
|
return source.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
22461
22661
|
}
|
|
22462
|
-
function elementIsDescendantOrEqual(
|
|
22463
|
-
if (!
|
|
22662
|
+
function elementIsDescendantOrEqual(parent2, descendant) {
|
|
22663
|
+
if (!parent2 || !descendant || parent2 === document.body || descendant.parentElement === null) {
|
|
22464
22664
|
return false;
|
|
22465
22665
|
}
|
|
22466
|
-
if (
|
|
22666
|
+
if (parent2 === descendant) {
|
|
22467
22667
|
return true;
|
|
22468
22668
|
}
|
|
22469
|
-
return elementIsDescendantOrEqual(
|
|
22669
|
+
return elementIsDescendantOrEqual(parent2, descendant.parentElement);
|
|
22470
22670
|
}
|
|
22471
22671
|
|
|
22472
22672
|
// src/components/input/TextEditor.tsx
|
|
22473
|
-
import
|
|
22673
|
+
import React68 from "react";
|
|
22474
22674
|
import { Editor } from "@tinymce/tinymce-react";
|
|
22475
22675
|
import "tinymce/tinymce";
|
|
22476
22676
|
import "tinymce/models/dom/model";
|
|
@@ -22491,16 +22691,16 @@ import "tinymce/plugins/wordcount";
|
|
|
22491
22691
|
import "tinymce/plugins/emoticons/js/emojis";
|
|
22492
22692
|
|
|
22493
22693
|
// src/components/input/CodeEditorPopup.tsx
|
|
22494
|
-
import
|
|
22694
|
+
import React67 from "react";
|
|
22495
22695
|
|
|
22496
22696
|
// src/components/input/CodeEditor.tsx
|
|
22497
|
-
import
|
|
22697
|
+
import React66 from "react";
|
|
22498
22698
|
import CodeMirror, {
|
|
22499
22699
|
EditorView
|
|
22500
22700
|
} from "@uiw/react-codemirror";
|
|
22501
22701
|
import { html } from "@codemirror/lang-html";
|
|
22502
22702
|
import { linter, lintGutter } from "@codemirror/lint";
|
|
22503
|
-
import { jsx as
|
|
22703
|
+
import { jsx as jsx120 } from "react/jsx-runtime";
|
|
22504
22704
|
var removeFocusOutline = EditorView.baseTheme({
|
|
22505
22705
|
"&.cm-focused": {
|
|
22506
22706
|
outline: "none"
|
|
@@ -22522,7 +22722,7 @@ var CodeEditor = function CodeEditor2({
|
|
|
22522
22722
|
linter(linterOptions?.source || null, linterOptions?.config),
|
|
22523
22723
|
...extensions
|
|
22524
22724
|
] : extensions;
|
|
22525
|
-
return /* @__PURE__ */
|
|
22725
|
+
return /* @__PURE__ */ jsx120(
|
|
22526
22726
|
CodeMirror,
|
|
22527
22727
|
{
|
|
22528
22728
|
...rest,
|
|
@@ -22537,11 +22737,11 @@ var CodeEditor = function CodeEditor2({
|
|
|
22537
22737
|
}
|
|
22538
22738
|
);
|
|
22539
22739
|
};
|
|
22540
|
-
var CodeEditor_default =
|
|
22740
|
+
var CodeEditor_default = React66.forwardRef(CodeEditor);
|
|
22541
22741
|
|
|
22542
22742
|
// src/components/input/CodeEditorPopup.tsx
|
|
22543
22743
|
import format from "html-format";
|
|
22544
|
-
import { Fragment as Fragment26, jsx as
|
|
22744
|
+
import { Fragment as Fragment26, jsx as jsx121, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
22545
22745
|
var FORMAT_CHARACTERS_LINE = 120;
|
|
22546
22746
|
var FORMAT_NUMBER_SPACES_INDENTATION = 2;
|
|
22547
22747
|
var CodeEditorPopup = ({
|
|
@@ -22557,9 +22757,9 @@ var CodeEditorPopup = ({
|
|
|
22557
22757
|
onCancel
|
|
22558
22758
|
}) => {
|
|
22559
22759
|
const { t } = useTranslation();
|
|
22560
|
-
const [valueModified, setValueModified] =
|
|
22561
|
-
const [hasErrors, setHasErrors] =
|
|
22562
|
-
|
|
22760
|
+
const [valueModified, setValueModified] = React67.useState(value);
|
|
22761
|
+
const [hasErrors, setHasErrors] = React67.useState(false);
|
|
22762
|
+
React67.useEffect(() => {
|
|
22563
22763
|
if (open) {
|
|
22564
22764
|
setValueModified(value);
|
|
22565
22765
|
}
|
|
@@ -22585,7 +22785,7 @@ var CodeEditorPopup = ({
|
|
|
22585
22785
|
FORMAT_CHARACTERS_LINE
|
|
22586
22786
|
);
|
|
22587
22787
|
return /* @__PURE__ */ jsxs58(Fragment26, { children: [
|
|
22588
|
-
readonly && /* @__PURE__ */
|
|
22788
|
+
readonly && /* @__PURE__ */ jsx121(
|
|
22589
22789
|
Dialog_default,
|
|
22590
22790
|
{
|
|
22591
22791
|
open,
|
|
@@ -22604,7 +22804,7 @@ var CodeEditorPopup = ({
|
|
|
22604
22804
|
justifyContent: "space-between",
|
|
22605
22805
|
paddingTop: "20px",
|
|
22606
22806
|
children: [
|
|
22607
|
-
/* @__PURE__ */
|
|
22807
|
+
/* @__PURE__ */ jsx121(
|
|
22608
22808
|
Box_default2,
|
|
22609
22809
|
{
|
|
22610
22810
|
flexGrow: 1,
|
|
@@ -22621,7 +22821,7 @@ var CodeEditorPopup = ({
|
|
|
22621
22821
|
}
|
|
22622
22822
|
},
|
|
22623
22823
|
children: [
|
|
22624
|
-
/* @__PURE__ */
|
|
22824
|
+
/* @__PURE__ */ jsx121(Box_default2, { flexGrow: 1, minHeight: 0, children: /* @__PURE__ */ jsx121(
|
|
22625
22825
|
CodeEditor_default,
|
|
22626
22826
|
{
|
|
22627
22827
|
autoFocus: true,
|
|
@@ -22650,7 +22850,7 @@ var CodeEditorPopup = ({
|
|
|
22650
22850
|
}
|
|
22651
22851
|
) }),
|
|
22652
22852
|
messageNode,
|
|
22653
|
-
hasErrors && /* @__PURE__ */
|
|
22853
|
+
hasErrors && /* @__PURE__ */ jsx121(Alert_default, { severity: "info", children: t(
|
|
22654
22854
|
"TEXT_EDITOR.SOURCE_CODE.VALIDATION_ERRORS_FOUND"
|
|
22655
22855
|
) })
|
|
22656
22856
|
]
|
|
@@ -22658,13 +22858,13 @@ var CodeEditorPopup = ({
|
|
|
22658
22858
|
)
|
|
22659
22859
|
}
|
|
22660
22860
|
),
|
|
22661
|
-
/* @__PURE__ */
|
|
22861
|
+
/* @__PURE__ */ jsx121(
|
|
22662
22862
|
Box_default2,
|
|
22663
22863
|
{
|
|
22664
22864
|
sx: {
|
|
22665
22865
|
padding: "16px 24px 16px 24px"
|
|
22666
22866
|
},
|
|
22667
|
-
children: /* @__PURE__ */
|
|
22867
|
+
children: /* @__PURE__ */ jsx121(
|
|
22668
22868
|
Button_default,
|
|
22669
22869
|
{
|
|
22670
22870
|
text: t(
|
|
@@ -22681,7 +22881,7 @@ var CodeEditorPopup = ({
|
|
|
22681
22881
|
)
|
|
22682
22882
|
}
|
|
22683
22883
|
),
|
|
22684
|
-
!readonly && /* @__PURE__ */
|
|
22884
|
+
!readonly && /* @__PURE__ */ jsx121(
|
|
22685
22885
|
ConfirmationDialog_default,
|
|
22686
22886
|
{
|
|
22687
22887
|
fullScreen: true,
|
|
@@ -22700,7 +22900,7 @@ var CodeEditorPopup = ({
|
|
|
22700
22900
|
}
|
|
22701
22901
|
},
|
|
22702
22902
|
children: [
|
|
22703
|
-
codeEditorSubtitle && /* @__PURE__ */
|
|
22903
|
+
codeEditorSubtitle && /* @__PURE__ */ jsx121(Box_default2, { sx: { marginTop: "4px", marginBottom: "8px" }, children: /* @__PURE__ */ jsx121(
|
|
22704
22904
|
Typography_default,
|
|
22705
22905
|
{
|
|
22706
22906
|
variant: "body2",
|
|
@@ -22708,7 +22908,7 @@ var CodeEditorPopup = ({
|
|
|
22708
22908
|
children: codeEditorSubtitle
|
|
22709
22909
|
}
|
|
22710
22910
|
) }),
|
|
22711
|
-
/* @__PURE__ */
|
|
22911
|
+
/* @__PURE__ */ jsx121(Box_default2, { flexGrow: 1, minHeight: 0, children: /* @__PURE__ */ jsx121(
|
|
22712
22912
|
CodeEditor_default,
|
|
22713
22913
|
{
|
|
22714
22914
|
autoFocus: true,
|
|
@@ -22737,7 +22937,7 @@ var CodeEditorPopup = ({
|
|
|
22737
22937
|
}
|
|
22738
22938
|
) }),
|
|
22739
22939
|
messageNode,
|
|
22740
|
-
hasErrors && /* @__PURE__ */
|
|
22940
|
+
hasErrors && /* @__PURE__ */ jsx121(Alert_default, { severity: "info", children: t(
|
|
22741
22941
|
"TEXT_EDITOR.SOURCE_CODE.VALIDATION_ERRORS_FOUND"
|
|
22742
22942
|
) })
|
|
22743
22943
|
]
|
|
@@ -22750,7 +22950,7 @@ var CodeEditorPopup = ({
|
|
|
22750
22950
|
var CodeEditorPopup_default = CodeEditorPopup;
|
|
22751
22951
|
|
|
22752
22952
|
// src/components/input/TextEditor.tsx
|
|
22753
|
-
import { Fragment as Fragment27, jsx as
|
|
22953
|
+
import { Fragment as Fragment27, jsx as jsx122, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
22754
22954
|
var DEFAULT_TOOLBAR_INSERT_MENU_ITEMS = [
|
|
22755
22955
|
"link",
|
|
22756
22956
|
"image",
|
|
@@ -22789,15 +22989,15 @@ var TextEditor = function TextEditor2({
|
|
|
22789
22989
|
...rest
|
|
22790
22990
|
}) {
|
|
22791
22991
|
const { t } = useTranslation();
|
|
22792
|
-
const editorRef =
|
|
22793
|
-
const [internalValue] =
|
|
22992
|
+
const editorRef = React68.useRef(null);
|
|
22993
|
+
const [internalValue] = React68.useState(
|
|
22794
22994
|
initialValue ?? t("TEXT_EDITOR.INITIAL_VALUE")
|
|
22795
22995
|
);
|
|
22796
|
-
const [contentValue, setContentValue] =
|
|
22797
|
-
const [codeEditorChanges, setCodeEditorChanges] =
|
|
22798
|
-
const [isCodeEditorDirty, setIsCodeEditorDirty] =
|
|
22799
|
-
const [isCodeEditorOpened, setIsCodeEditorOpened] =
|
|
22800
|
-
const [isDirty, setIsDirty] =
|
|
22996
|
+
const [contentValue, setContentValue] = React68.useState("");
|
|
22997
|
+
const [codeEditorChanges, setCodeEditorChanges] = React68.useState("");
|
|
22998
|
+
const [isCodeEditorDirty, setIsCodeEditorDirty] = React68.useState(false);
|
|
22999
|
+
const [isCodeEditorOpened, setIsCodeEditorOpened] = React68.useState(false);
|
|
23000
|
+
const [isDirty, setIsDirty] = React68.useState(false);
|
|
22801
23001
|
const codeEditorButtonIndexToUse = codeEditorButtonIndex ?? customToolbarGroups.insert?.items?.length ?? DEFAULT_TOOLBAR_INSERT_MENU_ITEMS.length;
|
|
22802
23002
|
const defaultToolbarInsertMenuItemsWithCodeEditor = DEFAULT_TOOLBAR_INSERT_MENU_ITEMS.slice();
|
|
22803
23003
|
defaultToolbarInsertMenuItemsWithCodeEditor.splice(
|
|
@@ -22811,12 +23011,12 @@ var TextEditor = function TextEditor2({
|
|
|
22811
23011
|
0,
|
|
22812
23012
|
"cnCodeEditor"
|
|
22813
23013
|
);
|
|
22814
|
-
const onTextChange =
|
|
23014
|
+
const onTextChange = React68.useCallback(() => {
|
|
22815
23015
|
if (editorRef.current) {
|
|
22816
23016
|
onChange(editorRef.current?.getContent());
|
|
22817
23017
|
}
|
|
22818
23018
|
}, [onChange]);
|
|
22819
|
-
const onTextEditorDirty =
|
|
23019
|
+
const onTextEditorDirty = React68.useCallback(
|
|
22820
23020
|
(textEditorDirty) => {
|
|
22821
23021
|
editorRef.current?.setDirty(textEditorDirty);
|
|
22822
23022
|
setIsDirty(textEditorDirty);
|
|
@@ -22829,7 +23029,7 @@ var TextEditor = function TextEditor2({
|
|
|
22829
23029
|
},
|
|
22830
23030
|
[onDirty, onTextChange]
|
|
22831
23031
|
);
|
|
22832
|
-
|
|
23032
|
+
React68.useEffect(() => {
|
|
22833
23033
|
if (resetDirty && editorRef.current?.isDirty()) {
|
|
22834
23034
|
onTextEditorDirty(false);
|
|
22835
23035
|
}
|
|
@@ -22837,7 +23037,7 @@ var TextEditor = function TextEditor2({
|
|
|
22837
23037
|
onResetDirty();
|
|
22838
23038
|
}
|
|
22839
23039
|
}, [onResetDirty, onTextEditorDirty, resetDirty]);
|
|
22840
|
-
|
|
23040
|
+
React68.useEffect(() => {
|
|
22841
23041
|
if (newValue && editorRef.current) {
|
|
22842
23042
|
editorRef.current.setContent(newValue);
|
|
22843
23043
|
if (onNewValueSetter) {
|
|
@@ -22845,7 +23045,7 @@ var TextEditor = function TextEditor2({
|
|
|
22845
23045
|
}
|
|
22846
23046
|
}
|
|
22847
23047
|
}, [newValue, onNewValueSetter]);
|
|
22848
|
-
|
|
23048
|
+
React68.useEffect(() => {
|
|
22849
23049
|
if (forceCloseCodeEditor) {
|
|
22850
23050
|
setIsCodeEditorOpened(false);
|
|
22851
23051
|
if (onForceCloseCodeEditor) {
|
|
@@ -23037,7 +23237,7 @@ var TextEditor = function TextEditor2({
|
|
|
23037
23237
|
}
|
|
23038
23238
|
};
|
|
23039
23239
|
return /* @__PURE__ */ jsxs59(Fragment27, { children: [
|
|
23040
|
-
/* @__PURE__ */
|
|
23240
|
+
/* @__PURE__ */ jsx122(
|
|
23041
23241
|
Editor,
|
|
23042
23242
|
{
|
|
23043
23243
|
id,
|
|
@@ -23057,7 +23257,7 @@ var TextEditor = function TextEditor2({
|
|
|
23057
23257
|
...rest
|
|
23058
23258
|
}
|
|
23059
23259
|
),
|
|
23060
|
-
/* @__PURE__ */
|
|
23260
|
+
/* @__PURE__ */ jsx122(
|
|
23061
23261
|
CodeEditorPopup_default,
|
|
23062
23262
|
{
|
|
23063
23263
|
value: contentValue,
|
|
@@ -23091,66 +23291,6 @@ var TextEditor = function TextEditor2({
|
|
|
23091
23291
|
};
|
|
23092
23292
|
var TextEditor_default = TextEditor;
|
|
23093
23293
|
|
|
23094
|
-
// src/components/input/TimeField.tsx
|
|
23095
|
-
import * as React68 from "react";
|
|
23096
|
-
import { TimeField as MuiTimeField } from "@mui/x-date-pickers";
|
|
23097
|
-
import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
|
|
23098
|
-
import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment";
|
|
23099
|
-
import { tz as tz6 } from "moment-timezone";
|
|
23100
|
-
import { jsx as jsx122 } from "react/jsx-runtime";
|
|
23101
|
-
var ExtendedTextField = ({
|
|
23102
|
-
inputProps,
|
|
23103
|
-
ownerState,
|
|
23104
|
-
InputProps,
|
|
23105
|
-
error,
|
|
23106
|
-
...rest
|
|
23107
|
-
}) => /* @__PURE__ */ jsx122(TextField_default, { ...inputProps, ...rest });
|
|
23108
|
-
var TimeField = function TimeField2({
|
|
23109
|
-
onChange,
|
|
23110
|
-
value,
|
|
23111
|
-
showMinutes = true,
|
|
23112
|
-
showSeconds = false,
|
|
23113
|
-
...rest
|
|
23114
|
-
}) {
|
|
23115
|
-
const { locale, timezone } = React68.useContext(IntlContext);
|
|
23116
|
-
const hour12 = React68.useMemo(() => {
|
|
23117
|
-
const resolvedOptions = Intl.DateTimeFormat(locale, {
|
|
23118
|
-
hour: "numeric"
|
|
23119
|
-
}).resolvedOptions();
|
|
23120
|
-
return resolvedOptions.hour12;
|
|
23121
|
-
}, [locale]);
|
|
23122
|
-
const format2 = `${hour12 ? "hh" : "HH"}${showSeconds || showMinutes ? ":mm" : ""}${showSeconds ? ":ss" : ""}${hour12 ? " a" : ""}`;
|
|
23123
|
-
const momentValue = React68.useMemo(() => {
|
|
23124
|
-
if (value && !isNaN(value.getTime())) {
|
|
23125
|
-
return tz6(value, timezone);
|
|
23126
|
-
}
|
|
23127
|
-
return null;
|
|
23128
|
-
}, [timezone, value]);
|
|
23129
|
-
const _onChange = React68.useCallback(
|
|
23130
|
-
(momentValue2, context) => {
|
|
23131
|
-
const value2 = momentValue2 && momentValue2.isValid() ? momentValue2.toDate() : null;
|
|
23132
|
-
onChange && onChange(value2, context);
|
|
23133
|
-
},
|
|
23134
|
-
[onChange]
|
|
23135
|
-
);
|
|
23136
|
-
return /* @__PURE__ */ jsx122(LocalizationProvider, { dateAdapter: AdapterMoment, children: /* @__PURE__ */ jsx122(
|
|
23137
|
-
MuiTimeField,
|
|
23138
|
-
{
|
|
23139
|
-
onChange: _onChange,
|
|
23140
|
-
value: momentValue,
|
|
23141
|
-
format: format2,
|
|
23142
|
-
slots: {
|
|
23143
|
-
textField: ExtendedTextField
|
|
23144
|
-
},
|
|
23145
|
-
slotProps: {
|
|
23146
|
-
textField: rest
|
|
23147
|
-
},
|
|
23148
|
-
enableAccessibleFieldDOMStructure: false
|
|
23149
|
-
}
|
|
23150
|
-
) });
|
|
23151
|
-
};
|
|
23152
|
-
var TimeField_default = TimeField;
|
|
23153
|
-
|
|
23154
23294
|
// src/components/input/PhoneField.tsx
|
|
23155
23295
|
import * as React69 from "react";
|
|
23156
23296
|
import { Fragment as Fragment28, jsx as jsx123, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
@@ -24191,7 +24331,7 @@ var CircularProgress_default = CircularProgress;
|
|
|
24191
24331
|
|
|
24192
24332
|
// src/components/progress/DonutProgress.tsx
|
|
24193
24333
|
import Box5 from "@mui/material/Box";
|
|
24194
|
-
import { Stack as
|
|
24334
|
+
import { Stack as Stack11 } from "@mui/material";
|
|
24195
24335
|
import { jsx as jsx133, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
24196
24336
|
var CIRCULAR_PROGRESS_PERCENTAGE = 85;
|
|
24197
24337
|
var variants2 = {
|
|
@@ -24228,7 +24368,7 @@ var DonutProgress = ({
|
|
|
24228
24368
|
labelChip,
|
|
24229
24369
|
showPercentageSymbol
|
|
24230
24370
|
}) => {
|
|
24231
|
-
const getPercentageWithSymbol = () => /* @__PURE__ */ jsxs68(
|
|
24371
|
+
const getPercentageWithSymbol = () => /* @__PURE__ */ jsxs68(Stack11, { direction: "row", alignItems: "center", position: "relative", children: [
|
|
24232
24372
|
/* @__PURE__ */ jsx133(Typography_default, { variant: "h6", component: "div", color: grey800, children: label }),
|
|
24233
24373
|
/* @__PURE__ */ jsx133(
|
|
24234
24374
|
Typography_default,
|
|
@@ -25059,16 +25199,346 @@ var HorizontalScrollable = ({
|
|
|
25059
25199
|
};
|
|
25060
25200
|
var HorizontalScrollable_default = HorizontalScrollable;
|
|
25061
25201
|
|
|
25202
|
+
// src/components/scrollable/Carousel.tsx
|
|
25203
|
+
import * as React81 from "react";
|
|
25204
|
+
import { jsx as jsx144, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
25205
|
+
var buttonStyles = {
|
|
25206
|
+
color: grey800,
|
|
25207
|
+
position: "absolute",
|
|
25208
|
+
top: "50%",
|
|
25209
|
+
transform: "translateY(-50%)",
|
|
25210
|
+
zIndex: 1,
|
|
25211
|
+
backgroundColor: white,
|
|
25212
|
+
border: `1px solid ${grey200}`,
|
|
25213
|
+
cursor: "pointer",
|
|
25214
|
+
transition: "opacity 0.3s ease"
|
|
25215
|
+
};
|
|
25216
|
+
function Carousel({
|
|
25217
|
+
items,
|
|
25218
|
+
renderItem,
|
|
25219
|
+
gap: gap2 = 8,
|
|
25220
|
+
padding: padding2 = 8
|
|
25221
|
+
}) {
|
|
25222
|
+
const rootRef = React81.useRef(null);
|
|
25223
|
+
const containerRef = React81.useRef(null);
|
|
25224
|
+
const previousClientWidth = React81.useRef(null);
|
|
25225
|
+
const isScrolling = React81.useRef(false);
|
|
25226
|
+
const [isLeftArrowHidden, setLeftArrowHidden] = React81.useState(true);
|
|
25227
|
+
const [isRightArrowHidden, setRightArrowHidden] = React81.useState(true);
|
|
25228
|
+
const [paddingElement, setPaddingElement] = React81.useState();
|
|
25229
|
+
const [visibleCount, setVisibleCount] = React81.useState();
|
|
25230
|
+
const showedElementsRef = React81.useRef();
|
|
25231
|
+
const [showedElements, setShowedElements] = React81.useState();
|
|
25232
|
+
const updateArrows = React81.useCallback(() => {
|
|
25233
|
+
if (!showedElementsRef.current) {
|
|
25234
|
+
return;
|
|
25235
|
+
}
|
|
25236
|
+
setLeftArrowHidden(showedElementsRef.current.start === 0);
|
|
25237
|
+
setRightArrowHidden(showedElementsRef.current.end === items.length - 1);
|
|
25238
|
+
}, [items.length]);
|
|
25239
|
+
const getUsableWidth = React81.useCallback(
|
|
25240
|
+
(el) => {
|
|
25241
|
+
let current = el;
|
|
25242
|
+
while (current) {
|
|
25243
|
+
const w = current.clientWidth;
|
|
25244
|
+
if (w > 0 && w < window.innerWidth) {
|
|
25245
|
+
return w;
|
|
25246
|
+
}
|
|
25247
|
+
current = current.parentElement;
|
|
25248
|
+
}
|
|
25249
|
+
return el?.clientWidth ?? 0;
|
|
25250
|
+
},
|
|
25251
|
+
[]
|
|
25252
|
+
);
|
|
25253
|
+
const resetCarousel = React81.useCallback(
|
|
25254
|
+
(root, container) => {
|
|
25255
|
+
root.style.width = "";
|
|
25256
|
+
showedElementsRef.current = void 0;
|
|
25257
|
+
setShowedElements(void 0);
|
|
25258
|
+
container.scrollTo({ left: 0, behavior: "instant" });
|
|
25259
|
+
},
|
|
25260
|
+
[]
|
|
25261
|
+
);
|
|
25262
|
+
const setMeasures = React81.useCallback(
|
|
25263
|
+
(root, container, nextElementsIndex) => {
|
|
25264
|
+
const children = Array.from(container.children);
|
|
25265
|
+
if (children.length === 0) {
|
|
25266
|
+
setVisibleCount(0);
|
|
25267
|
+
return;
|
|
25268
|
+
}
|
|
25269
|
+
const containerWidth = getUsableWidth(root);
|
|
25270
|
+
const initialHorizontalPadding = padding2 * 2;
|
|
25271
|
+
let count = 0;
|
|
25272
|
+
let accumulatedWidth = initialHorizontalPadding;
|
|
25273
|
+
let nextChild = children[nextElementsIndex.start];
|
|
25274
|
+
while (nextChild && accumulatedWidth + nextChild.offsetWidth <= containerWidth) {
|
|
25275
|
+
accumulatedWidth += nextChild.offsetWidth + (count > 0 ? gap2 : 0);
|
|
25276
|
+
count++;
|
|
25277
|
+
nextChild = children[nextElementsIndex.start + count];
|
|
25278
|
+
}
|
|
25279
|
+
const addGap = nextElementsIndex.start + count < items.length;
|
|
25280
|
+
const diffWidth = containerWidth - accumulatedWidth + initialHorizontalPadding + (addGap ? gap2 : 0);
|
|
25281
|
+
setPaddingElement(`${diffWidth / 2}px`);
|
|
25282
|
+
setVisibleCount(count);
|
|
25283
|
+
showedElementsRef.current = nextElementsIndex;
|
|
25284
|
+
setShowedElements(nextElementsIndex);
|
|
25285
|
+
return {
|
|
25286
|
+
childrenWidth: accumulatedWidth
|
|
25287
|
+
};
|
|
25288
|
+
},
|
|
25289
|
+
[gap2, getUsableWidth, items.length, padding2]
|
|
25290
|
+
);
|
|
25291
|
+
const updateVisibleCount = React81.useCallback(() => {
|
|
25292
|
+
const root = rootRef.current;
|
|
25293
|
+
const container = containerRef.current;
|
|
25294
|
+
if (!container || !parent) {
|
|
25295
|
+
return;
|
|
25296
|
+
}
|
|
25297
|
+
if (root) {
|
|
25298
|
+
resetCarousel(root, container);
|
|
25299
|
+
}
|
|
25300
|
+
const children = Array.from(container.children);
|
|
25301
|
+
if (children.length === 0) {
|
|
25302
|
+
setVisibleCount(0);
|
|
25303
|
+
return;
|
|
25304
|
+
}
|
|
25305
|
+
const containerWidth = getUsableWidth(root);
|
|
25306
|
+
const initialHorizontalPadding = padding2 * 2;
|
|
25307
|
+
let count = 0;
|
|
25308
|
+
let accumulatedWidth = initialHorizontalPadding;
|
|
25309
|
+
for (const child of children) {
|
|
25310
|
+
if (accumulatedWidth + child.offsetWidth <= containerWidth) {
|
|
25311
|
+
accumulatedWidth += child.offsetWidth + (count > 0 ? gap2 : 0);
|
|
25312
|
+
count++;
|
|
25313
|
+
} else {
|
|
25314
|
+
break;
|
|
25315
|
+
}
|
|
25316
|
+
}
|
|
25317
|
+
const addGap = count < items.length;
|
|
25318
|
+
const diffWidth = containerWidth - accumulatedWidth + initialHorizontalPadding + (addGap ? gap2 : 0);
|
|
25319
|
+
const newPaddingSize = `${diffWidth / 2}px`;
|
|
25320
|
+
setPaddingElement(newPaddingSize);
|
|
25321
|
+
setVisibleCount(count);
|
|
25322
|
+
const newVisible = { start: 0, end: count - 1 };
|
|
25323
|
+
showedElementsRef.current = newVisible;
|
|
25324
|
+
setShowedElements(newVisible);
|
|
25325
|
+
if (root) {
|
|
25326
|
+
root.style.width = `${containerWidth}px`;
|
|
25327
|
+
}
|
|
25328
|
+
updateArrows();
|
|
25329
|
+
}, [
|
|
25330
|
+
getUsableWidth,
|
|
25331
|
+
padding2,
|
|
25332
|
+
items.length,
|
|
25333
|
+
gap2,
|
|
25334
|
+
updateArrows,
|
|
25335
|
+
resetCarousel
|
|
25336
|
+
]);
|
|
25337
|
+
const getInitialWidth = React81.useCallback(
|
|
25338
|
+
(el) => {
|
|
25339
|
+
let current = el;
|
|
25340
|
+
let width2 = 0;
|
|
25341
|
+
while (current) {
|
|
25342
|
+
const w = current.clientWidth;
|
|
25343
|
+
if (w && w > window.innerWidth) {
|
|
25344
|
+
return width2;
|
|
25345
|
+
}
|
|
25346
|
+
if (w > 0 && w <= window.innerWidth) {
|
|
25347
|
+
width2 = w;
|
|
25348
|
+
}
|
|
25349
|
+
current = current.parentElement;
|
|
25350
|
+
}
|
|
25351
|
+
return width2 > 0 ? width2 : el?.clientWidth ?? 0;
|
|
25352
|
+
},
|
|
25353
|
+
[]
|
|
25354
|
+
);
|
|
25355
|
+
const resizeObserverCallback = React81.useCallback(() => {
|
|
25356
|
+
if (!rootRef.current || !containerRef.current) {
|
|
25357
|
+
return;
|
|
25358
|
+
}
|
|
25359
|
+
const newClientWidth = getInitialWidth(rootRef.current);
|
|
25360
|
+
if (previousClientWidth.current && previousClientWidth.current === newClientWidth) {
|
|
25361
|
+
return;
|
|
25362
|
+
}
|
|
25363
|
+
previousClientWidth.current = newClientWidth;
|
|
25364
|
+
updateVisibleCount();
|
|
25365
|
+
}, [getInitialWidth, updateVisibleCount]);
|
|
25366
|
+
React81.useEffect(() => {
|
|
25367
|
+
const container = containerRef.current;
|
|
25368
|
+
if (!container) {
|
|
25369
|
+
return;
|
|
25370
|
+
}
|
|
25371
|
+
window.addEventListener("resize", resizeObserverCallback);
|
|
25372
|
+
const resizeObserver = new ResizeObserver(resizeObserverCallback);
|
|
25373
|
+
resizeObserver.observe(container);
|
|
25374
|
+
const mutationObserver = new MutationObserver(resizeObserverCallback);
|
|
25375
|
+
mutationObserver.observe(container, { childList: true, subtree: true });
|
|
25376
|
+
return () => {
|
|
25377
|
+
window.removeEventListener("resize", resizeObserverCallback);
|
|
25378
|
+
resizeObserver.disconnect();
|
|
25379
|
+
mutationObserver.disconnect();
|
|
25380
|
+
};
|
|
25381
|
+
}, [resizeObserverCallback]);
|
|
25382
|
+
const waitForSmoothScrollEnd = (container, onEnd) => {
|
|
25383
|
+
let prev = container.scrollLeft;
|
|
25384
|
+
let idleFrames = 0;
|
|
25385
|
+
const check = () => {
|
|
25386
|
+
const current = container.scrollLeft;
|
|
25387
|
+
const isMoving = current !== prev;
|
|
25388
|
+
prev = current;
|
|
25389
|
+
if (isMoving) {
|
|
25390
|
+
idleFrames = 0;
|
|
25391
|
+
requestAnimationFrame(check);
|
|
25392
|
+
return;
|
|
25393
|
+
}
|
|
25394
|
+
if (idleFrames < 5) {
|
|
25395
|
+
idleFrames++;
|
|
25396
|
+
requestAnimationFrame(check);
|
|
25397
|
+
return;
|
|
25398
|
+
}
|
|
25399
|
+
onEnd();
|
|
25400
|
+
};
|
|
25401
|
+
requestAnimationFrame(check);
|
|
25402
|
+
};
|
|
25403
|
+
const scrollHorizontal = ({
|
|
25404
|
+
elementsIndex
|
|
25405
|
+
}, direction) => {
|
|
25406
|
+
const container = containerRef.current;
|
|
25407
|
+
const root = rootRef.current;
|
|
25408
|
+
if (!container || !root) {
|
|
25409
|
+
return;
|
|
25410
|
+
}
|
|
25411
|
+
const newMeasures = setMeasures(root, container, elementsIndex);
|
|
25412
|
+
if (newMeasures) {
|
|
25413
|
+
const scrollLeft = (elementsIndex.end < items.length - 1 ? container.scrollLeft + container.clientWidth : container.scrollWidth - newMeasures.childrenWidth) + padding2 * 2;
|
|
25414
|
+
const targetLeft = direction === "right" ? scrollLeft : Math.max(
|
|
25415
|
+
container.scrollLeft - newMeasures.childrenWidth,
|
|
25416
|
+
0
|
|
25417
|
+
);
|
|
25418
|
+
waitForSmoothScrollEnd(container, () => {
|
|
25419
|
+
isScrolling.current = false;
|
|
25420
|
+
updateArrows();
|
|
25421
|
+
});
|
|
25422
|
+
showedElementsRef.current = elementsIndex;
|
|
25423
|
+
setShowedElements(elementsIndex);
|
|
25424
|
+
container.scrollTo({ left: targetLeft, behavior: "smooth" });
|
|
25425
|
+
}
|
|
25426
|
+
};
|
|
25427
|
+
const scrollToNext = (direction) => {
|
|
25428
|
+
if (!containerRef.current || !showedElementsRef.current || isScrolling.current) {
|
|
25429
|
+
return;
|
|
25430
|
+
}
|
|
25431
|
+
isScrolling.current = true;
|
|
25432
|
+
const children = Array.from(
|
|
25433
|
+
containerRef.current.children
|
|
25434
|
+
);
|
|
25435
|
+
const visibleCountDefined = visibleCount ?? 0;
|
|
25436
|
+
let scrollData;
|
|
25437
|
+
if (direction === "right") {
|
|
25438
|
+
const firstHidden = showedElementsRef.current.end + 1;
|
|
25439
|
+
const rightChildren = children.slice(
|
|
25440
|
+
firstHidden,
|
|
25441
|
+
firstHidden + visibleCountDefined
|
|
25442
|
+
);
|
|
25443
|
+
scrollData = {
|
|
25444
|
+
elementsIndex: {
|
|
25445
|
+
start: showedElementsRef.current.start + rightChildren.length,
|
|
25446
|
+
end: showedElementsRef.current.end + rightChildren.length
|
|
25447
|
+
}
|
|
25448
|
+
};
|
|
25449
|
+
} else {
|
|
25450
|
+
const rest = showedElementsRef.current.start - visibleCountDefined;
|
|
25451
|
+
const toMove = rest > 0 ? visibleCountDefined : visibleCountDefined + rest;
|
|
25452
|
+
const start = showedElementsRef.current.start - toMove;
|
|
25453
|
+
const end = showedElementsRef.current.end - toMove;
|
|
25454
|
+
scrollData = {
|
|
25455
|
+
elementsIndex: { start, end }
|
|
25456
|
+
};
|
|
25457
|
+
}
|
|
25458
|
+
scrollHorizontal(scrollData, direction);
|
|
25459
|
+
};
|
|
25460
|
+
return /* @__PURE__ */ jsx144(Box_default2, { ref: rootRef, width: "100%", children: /* @__PURE__ */ jsxs75(
|
|
25461
|
+
Box_default2,
|
|
25462
|
+
{
|
|
25463
|
+
sx: {
|
|
25464
|
+
position: "relative",
|
|
25465
|
+
alignSelf: "center",
|
|
25466
|
+
padding: `${padding2}px`,
|
|
25467
|
+
...paddingElement && {
|
|
25468
|
+
padding: `${padding2}px ${paddingElement}`
|
|
25469
|
+
}
|
|
25470
|
+
},
|
|
25471
|
+
children: [
|
|
25472
|
+
/* @__PURE__ */ jsx144(
|
|
25473
|
+
IconButton_default,
|
|
25474
|
+
{
|
|
25475
|
+
iconId: "chevron-left",
|
|
25476
|
+
size: "M",
|
|
25477
|
+
sx: {
|
|
25478
|
+
...buttonStyles,
|
|
25479
|
+
left: `${-16 + (paddingElement ? parseInt(paddingElement, 10) : 0)}px`,
|
|
25480
|
+
opacity: isLeftArrowHidden ? 0 : 1
|
|
25481
|
+
},
|
|
25482
|
+
onClick: () => scrollToNext("left")
|
|
25483
|
+
}
|
|
25484
|
+
),
|
|
25485
|
+
/* @__PURE__ */ jsx144(
|
|
25486
|
+
Box_default2,
|
|
25487
|
+
{
|
|
25488
|
+
ref: containerRef,
|
|
25489
|
+
sx: {
|
|
25490
|
+
width: "100%",
|
|
25491
|
+
overflowX: "hidden",
|
|
25492
|
+
display: "flex",
|
|
25493
|
+
scrollBehavior: "smooth",
|
|
25494
|
+
scrollbarWidth: "none",
|
|
25495
|
+
"::-webkit-scrollbar": { display: "none" },
|
|
25496
|
+
gap: `${gap2}px`
|
|
25497
|
+
},
|
|
25498
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx144(
|
|
25499
|
+
Box_default2,
|
|
25500
|
+
{
|
|
25501
|
+
sx: {
|
|
25502
|
+
...showedElements && (index < showedElements.start || index > showedElements.end) && {
|
|
25503
|
+
opacity: 0
|
|
25504
|
+
},
|
|
25505
|
+
transition: "opacity 0.5s ease"
|
|
25506
|
+
},
|
|
25507
|
+
children: renderItem(item, index)
|
|
25508
|
+
},
|
|
25509
|
+
index
|
|
25510
|
+
))
|
|
25511
|
+
}
|
|
25512
|
+
),
|
|
25513
|
+
/* @__PURE__ */ jsx144(
|
|
25514
|
+
IconButton_default,
|
|
25515
|
+
{
|
|
25516
|
+
iconId: "chevron-right",
|
|
25517
|
+
size: "M",
|
|
25518
|
+
sx: {
|
|
25519
|
+
...buttonStyles,
|
|
25520
|
+
right: `${-16 + (paddingElement ? parseInt(paddingElement, 10) : 0)}px`,
|
|
25521
|
+
opacity: isRightArrowHidden ? 0 : 1
|
|
25522
|
+
},
|
|
25523
|
+
onClick: () => scrollToNext("right")
|
|
25524
|
+
}
|
|
25525
|
+
)
|
|
25526
|
+
]
|
|
25527
|
+
}
|
|
25528
|
+
) });
|
|
25529
|
+
}
|
|
25530
|
+
var Carousel_default = Carousel;
|
|
25531
|
+
|
|
25062
25532
|
// src/components/snackbar/SnackbarProvider.tsx
|
|
25063
25533
|
import {
|
|
25064
25534
|
SnackbarProvider as NotistackSnackbarProvider
|
|
25065
25535
|
} from "notistack";
|
|
25066
|
-
import { jsx as
|
|
25536
|
+
import { jsx as jsx145 } from "react/jsx-runtime";
|
|
25067
25537
|
var SnackbarProvider = ({
|
|
25068
25538
|
children,
|
|
25069
25539
|
maxSnack = 3,
|
|
25070
25540
|
domRoot
|
|
25071
|
-
}) => /* @__PURE__ */
|
|
25541
|
+
}) => /* @__PURE__ */ jsx145(
|
|
25072
25542
|
NotistackSnackbarProvider,
|
|
25073
25543
|
{
|
|
25074
25544
|
maxSnack,
|
|
@@ -25086,10 +25556,10 @@ import {
|
|
|
25086
25556
|
} from "notistack";
|
|
25087
25557
|
|
|
25088
25558
|
// src/components/snackbar/Snackbar.tsx
|
|
25089
|
-
import * as
|
|
25559
|
+
import * as React82 from "react";
|
|
25090
25560
|
import { SnackbarContent } from "notistack";
|
|
25091
25561
|
import { Typography as Typography4 } from "@mui/material";
|
|
25092
|
-
import { jsx as
|
|
25562
|
+
import { jsx as jsx146, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
25093
25563
|
var sizeStyles5 = {
|
|
25094
25564
|
M: {
|
|
25095
25565
|
width: "344px",
|
|
@@ -25114,7 +25584,7 @@ var iconColors = {
|
|
|
25114
25584
|
error: error300,
|
|
25115
25585
|
warning: complementary300
|
|
25116
25586
|
};
|
|
25117
|
-
var Snackbar =
|
|
25587
|
+
var Snackbar = React82.forwardRef(
|
|
25118
25588
|
function Snackbar2({
|
|
25119
25589
|
severity = "info",
|
|
25120
25590
|
message,
|
|
@@ -25126,13 +25596,13 @@ var Snackbar = React81.forwardRef(
|
|
|
25126
25596
|
identifierKey: key,
|
|
25127
25597
|
dataTestKey
|
|
25128
25598
|
}, ref) {
|
|
25129
|
-
const actionClickHandler =
|
|
25599
|
+
const actionClickHandler = React82.useCallback(() => {
|
|
25130
25600
|
onActionClick && onActionClick(key);
|
|
25131
25601
|
}, [onActionClick, key]);
|
|
25132
|
-
const closeClickHandler =
|
|
25602
|
+
const closeClickHandler = React82.useCallback(() => {
|
|
25133
25603
|
onCloseClick && onCloseClick(key);
|
|
25134
25604
|
}, [onCloseClick, key]);
|
|
25135
|
-
return /* @__PURE__ */
|
|
25605
|
+
return /* @__PURE__ */ jsx146(
|
|
25136
25606
|
SnackbarContent,
|
|
25137
25607
|
{
|
|
25138
25608
|
ref,
|
|
@@ -25150,14 +25620,14 @@ var Snackbar = React81.forwardRef(
|
|
|
25150
25620
|
...dataTestKey && {
|
|
25151
25621
|
"data-test": dataTestKey
|
|
25152
25622
|
},
|
|
25153
|
-
children: /* @__PURE__ */
|
|
25623
|
+
children: /* @__PURE__ */ jsxs76(
|
|
25154
25624
|
Stack_default,
|
|
25155
25625
|
{
|
|
25156
25626
|
direction: "row",
|
|
25157
25627
|
spacing: 2,
|
|
25158
25628
|
sx: { width: "100%", alignItems: "center" },
|
|
25159
25629
|
children: [
|
|
25160
|
-
withIcon && /* @__PURE__ */
|
|
25630
|
+
withIcon && /* @__PURE__ */ jsx146(
|
|
25161
25631
|
Box_default2,
|
|
25162
25632
|
{
|
|
25163
25633
|
sx: {
|
|
@@ -25165,10 +25635,10 @@ var Snackbar = React81.forwardRef(
|
|
|
25165
25635
|
flexShrink: 0,
|
|
25166
25636
|
color: iconColors[severity]
|
|
25167
25637
|
},
|
|
25168
|
-
children: /* @__PURE__ */
|
|
25638
|
+
children: /* @__PURE__ */ jsx146(Icon_default, { id: severityIcons[severity] })
|
|
25169
25639
|
}
|
|
25170
25640
|
),
|
|
25171
|
-
/* @__PURE__ */
|
|
25641
|
+
/* @__PURE__ */ jsx146(
|
|
25172
25642
|
Typography4,
|
|
25173
25643
|
{
|
|
25174
25644
|
variant: "body2",
|
|
@@ -25176,7 +25646,7 @@ var Snackbar = React81.forwardRef(
|
|
|
25176
25646
|
children: message
|
|
25177
25647
|
}
|
|
25178
25648
|
),
|
|
25179
|
-
actionText && /* @__PURE__ */
|
|
25649
|
+
actionText && /* @__PURE__ */ jsx146(Box_default2, { sx: { flexGrow: 0, flexShrink: 0 }, children: /* @__PURE__ */ jsx146(
|
|
25180
25650
|
Button_default,
|
|
25181
25651
|
{
|
|
25182
25652
|
sx: {
|
|
@@ -25191,7 +25661,7 @@ var Snackbar = React81.forwardRef(
|
|
|
25191
25661
|
onClick: actionClickHandler
|
|
25192
25662
|
}
|
|
25193
25663
|
) }),
|
|
25194
|
-
/* @__PURE__ */
|
|
25664
|
+
/* @__PURE__ */ jsx146(Box_default2, { sx: { flexGrow: 0, flexShrink: 0 }, children: /* @__PURE__ */ jsx146(
|
|
25195
25665
|
IconButton_default,
|
|
25196
25666
|
{
|
|
25197
25667
|
iconId: "close",
|
|
@@ -25216,7 +25686,7 @@ var Snackbar_default = Snackbar;
|
|
|
25216
25686
|
|
|
25217
25687
|
// src/components/snackbar/enqueueSnackbar.tsx
|
|
25218
25688
|
import { closeSnackbar as closeSnackbar2 } from "notistack";
|
|
25219
|
-
import { jsx as
|
|
25689
|
+
import { jsx as jsx147 } from "react/jsx-runtime";
|
|
25220
25690
|
var enqueueSnackbar = (message, options = {}) => {
|
|
25221
25691
|
const {
|
|
25222
25692
|
persist,
|
|
@@ -25232,7 +25702,7 @@ var enqueueSnackbar = (message, options = {}) => {
|
|
|
25232
25702
|
autoHideDuration: autoHideDurationMs ?? 1e4,
|
|
25233
25703
|
persist: persist ?? false,
|
|
25234
25704
|
content(key, message2) {
|
|
25235
|
-
return /* @__PURE__ */
|
|
25705
|
+
return /* @__PURE__ */ jsx147(
|
|
25236
25706
|
Snackbar_default,
|
|
25237
25707
|
{
|
|
25238
25708
|
identifierKey: key,
|
|
@@ -25249,7 +25719,7 @@ var enqueueSnackbar = (message, options = {}) => {
|
|
|
25249
25719
|
|
|
25250
25720
|
// src/components/tab/TabButton.tsx
|
|
25251
25721
|
import MuiTab from "@mui/material/Tab";
|
|
25252
|
-
import { jsx as
|
|
25722
|
+
import { jsx as jsx148 } from "react/jsx-runtime";
|
|
25253
25723
|
var TabButton = ({
|
|
25254
25724
|
children,
|
|
25255
25725
|
disabled = false,
|
|
@@ -25258,10 +25728,10 @@ var TabButton = ({
|
|
|
25258
25728
|
dataTestId,
|
|
25259
25729
|
disableUppercase = false,
|
|
25260
25730
|
...rest
|
|
25261
|
-
}) => /* @__PURE__ */
|
|
25731
|
+
}) => /* @__PURE__ */ jsx148(
|
|
25262
25732
|
MuiTab,
|
|
25263
25733
|
{
|
|
25264
|
-
label: /* @__PURE__ */
|
|
25734
|
+
label: /* @__PURE__ */ jsx148(
|
|
25265
25735
|
"div",
|
|
25266
25736
|
{
|
|
25267
25737
|
style: {
|
|
@@ -25293,13 +25763,13 @@ var TabButton = ({
|
|
|
25293
25763
|
var TabButton_default = TabButton;
|
|
25294
25764
|
|
|
25295
25765
|
// src/components/tab/Tabs.tsx
|
|
25296
|
-
import * as
|
|
25766
|
+
import * as React84 from "react";
|
|
25297
25767
|
import MuiTabs from "@mui/material/Tabs";
|
|
25298
25768
|
|
|
25299
25769
|
// src/components/layout/SwipeableViews.tsx
|
|
25300
|
-
import * as
|
|
25301
|
-
import { useEffect as
|
|
25302
|
-
import { jsx as
|
|
25770
|
+
import * as React83 from "react";
|
|
25771
|
+
import { useEffect as useEffect22, useRef as useRef23, useState as useState32 } from "react";
|
|
25772
|
+
import { jsx as jsx149 } from "react/jsx-runtime";
|
|
25303
25773
|
var styles = {
|
|
25304
25774
|
container: {
|
|
25305
25775
|
maxHeight: "100%",
|
|
@@ -25329,13 +25799,14 @@ function SwipeableViews({
|
|
|
25329
25799
|
slideStyle,
|
|
25330
25800
|
onChangeIndex,
|
|
25331
25801
|
children,
|
|
25802
|
+
disableScroll = false,
|
|
25332
25803
|
...rootProps
|
|
25333
25804
|
}) {
|
|
25334
|
-
const containerRef =
|
|
25335
|
-
const scrollTimeout =
|
|
25336
|
-
const scrollingMethod =
|
|
25337
|
-
const [previousIndex, setPreviousIndex] =
|
|
25338
|
-
|
|
25805
|
+
const containerRef = useRef23(null);
|
|
25806
|
+
const scrollTimeout = useRef23();
|
|
25807
|
+
const scrollingMethod = useRef23("none");
|
|
25808
|
+
const [previousIndex, setPreviousIndex] = useState32(index);
|
|
25809
|
+
useEffect22(() => {
|
|
25339
25810
|
if (containerRef.current) {
|
|
25340
25811
|
if (scrollingMethod.current === "manual") {
|
|
25341
25812
|
scrollingMethod.current = "none";
|
|
@@ -25370,7 +25841,8 @@ function SwipeableViews({
|
|
|
25370
25841
|
return () => cancelAnimationFrame(animationFrame);
|
|
25371
25842
|
}
|
|
25372
25843
|
}, [index]);
|
|
25373
|
-
|
|
25844
|
+
const hasShowTab = (childIndex) => childIndex === index || childIndex === previousIndex;
|
|
25845
|
+
return /* @__PURE__ */ jsx149(
|
|
25374
25846
|
"div",
|
|
25375
25847
|
{
|
|
25376
25848
|
...rootProps,
|
|
@@ -25393,20 +25865,34 @@ function SwipeableViews({
|
|
|
25393
25865
|
);
|
|
25394
25866
|
}, 100);
|
|
25395
25867
|
},
|
|
25396
|
-
children:
|
|
25397
|
-
|
|
25398
|
-
{
|
|
25399
|
-
|
|
25400
|
-
style: Object.assign({}, styles.slide, slideStyle),
|
|
25401
|
-
children: childIndex === index || childIndex === previousIndex ? child : null
|
|
25868
|
+
children: React83.Children.map(children, (child, childIndex) => {
|
|
25869
|
+
let mountedChild = false;
|
|
25870
|
+
if (React83.isValidElement(child)) {
|
|
25871
|
+
mountedChild = !!child.props.keepMounted;
|
|
25402
25872
|
}
|
|
25403
|
-
|
|
25873
|
+
return /* @__PURE__ */ jsx149(
|
|
25874
|
+
"div",
|
|
25875
|
+
{
|
|
25876
|
+
style: Object.assign(
|
|
25877
|
+
{
|
|
25878
|
+
...!hasShowTab(childIndex) && mountedChild && { display: "none" }
|
|
25879
|
+
},
|
|
25880
|
+
styles.slide,
|
|
25881
|
+
slideStyle
|
|
25882
|
+
),
|
|
25883
|
+
...!disableScroll && {
|
|
25884
|
+
className: "Slim-Vertical-Scroll"
|
|
25885
|
+
},
|
|
25886
|
+
children: hasShowTab(childIndex) || mountedChild ? child : null
|
|
25887
|
+
}
|
|
25888
|
+
);
|
|
25889
|
+
})
|
|
25404
25890
|
}
|
|
25405
25891
|
);
|
|
25406
25892
|
}
|
|
25407
25893
|
|
|
25408
25894
|
// src/components/tab/Tabs.tsx
|
|
25409
|
-
import { jsx as
|
|
25895
|
+
import { jsx as jsx150, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
25410
25896
|
var Tabs = ({
|
|
25411
25897
|
tabButtons,
|
|
25412
25898
|
children,
|
|
@@ -25415,9 +25901,10 @@ var Tabs = ({
|
|
|
25415
25901
|
variant = "scrollable",
|
|
25416
25902
|
fullHeight = false,
|
|
25417
25903
|
contained = false,
|
|
25418
|
-
scrollbarGutter
|
|
25904
|
+
scrollbarGutter,
|
|
25905
|
+
disableContentScroll = false
|
|
25419
25906
|
}) => {
|
|
25420
|
-
const [value, setValue] =
|
|
25907
|
+
const [value, setValue] = React84.useState(0);
|
|
25421
25908
|
const handleChangeIndex = (index) => {
|
|
25422
25909
|
onChangeTab?.(index);
|
|
25423
25910
|
setValue(index);
|
|
@@ -25428,7 +25915,7 @@ var Tabs = ({
|
|
|
25428
25915
|
bottom: 0,
|
|
25429
25916
|
borderRadius: "8px 8px 0 0"
|
|
25430
25917
|
};
|
|
25431
|
-
return /* @__PURE__ */
|
|
25918
|
+
return /* @__PURE__ */ jsxs77(
|
|
25432
25919
|
Box_default2,
|
|
25433
25920
|
{
|
|
25434
25921
|
sx: {
|
|
@@ -25442,7 +25929,7 @@ var Tabs = ({
|
|
|
25442
25929
|
}
|
|
25443
25930
|
},
|
|
25444
25931
|
children: [
|
|
25445
|
-
/* @__PURE__ */
|
|
25932
|
+
/* @__PURE__ */ jsx150(
|
|
25446
25933
|
MuiTabs,
|
|
25447
25934
|
{
|
|
25448
25935
|
value: currentTabIndex ?? value,
|
|
@@ -25468,7 +25955,7 @@ var Tabs = ({
|
|
|
25468
25955
|
children: tabButtons
|
|
25469
25956
|
}
|
|
25470
25957
|
),
|
|
25471
|
-
/* @__PURE__ */
|
|
25958
|
+
/* @__PURE__ */ jsx150(
|
|
25472
25959
|
Box_default2,
|
|
25473
25960
|
{
|
|
25474
25961
|
sx: {
|
|
@@ -25477,10 +25964,11 @@ var Tabs = ({
|
|
|
25477
25964
|
height: "100%"
|
|
25478
25965
|
}
|
|
25479
25966
|
},
|
|
25480
|
-
children: /* @__PURE__ */
|
|
25967
|
+
children: /* @__PURE__ */ jsx150(
|
|
25481
25968
|
SwipeableViews,
|
|
25482
25969
|
{
|
|
25483
25970
|
index: currentTabIndex ?? value,
|
|
25971
|
+
disableScroll: disableContentScroll,
|
|
25484
25972
|
onChangeIndex: handleChangeIndex,
|
|
25485
25973
|
style: {
|
|
25486
25974
|
...fullHeight && {
|
|
@@ -25505,8 +25993,8 @@ var Tabs = ({
|
|
|
25505
25993
|
var Tabs_default = Tabs;
|
|
25506
25994
|
|
|
25507
25995
|
// src/components/tab/TabContent.tsx
|
|
25508
|
-
import { jsx as
|
|
25509
|
-
var TabContent = ({ children }) => /* @__PURE__ */
|
|
25996
|
+
import { jsx as jsx151 } from "react/jsx-runtime";
|
|
25997
|
+
var TabContent = ({ children }) => /* @__PURE__ */ jsx151(
|
|
25510
25998
|
Box_default2,
|
|
25511
25999
|
{
|
|
25512
26000
|
sx: {
|
|
@@ -25523,8 +26011,8 @@ import {
|
|
|
25523
26011
|
TableRow as MuiTableRow,
|
|
25524
26012
|
TableCell as MuiTableCell
|
|
25525
26013
|
} from "@mui/material";
|
|
25526
|
-
import { jsx as
|
|
25527
|
-
var TableDivider = () => /* @__PURE__ */
|
|
26014
|
+
import { jsx as jsx152 } from "react/jsx-runtime";
|
|
26015
|
+
var TableDivider = () => /* @__PURE__ */ jsx152(MuiTableRow, { children: /* @__PURE__ */ jsx152(
|
|
25528
26016
|
MuiTableCell,
|
|
25529
26017
|
{
|
|
25530
26018
|
colSpan: 1e3,
|
|
@@ -25537,8 +26025,8 @@ var TableDivider_default = TableDivider;
|
|
|
25537
26025
|
import {
|
|
25538
26026
|
TableSortLabel as MuiTableSortLabel
|
|
25539
26027
|
} from "@mui/material";
|
|
25540
|
-
import { jsx as
|
|
25541
|
-
var TableSortLabel = ({ children, ...rest }) => /* @__PURE__ */
|
|
26028
|
+
import { jsx as jsx153 } from "react/jsx-runtime";
|
|
26029
|
+
var TableSortLabel = ({ children, ...rest }) => /* @__PURE__ */ jsx153(MuiTableSortLabel, { ...rest, children });
|
|
25542
26030
|
var TableSortLabel_default = TableSortLabel;
|
|
25543
26031
|
|
|
25544
26032
|
// src/components/table/Table.tsx
|
|
@@ -25546,21 +26034,21 @@ import {
|
|
|
25546
26034
|
TableContainer,
|
|
25547
26035
|
Table as MuiTable
|
|
25548
26036
|
} from "@mui/material";
|
|
25549
|
-
import { jsx as
|
|
25550
|
-
var Table = ({ children, sx, className }) => /* @__PURE__ */
|
|
26037
|
+
import { jsx as jsx154 } from "react/jsx-runtime";
|
|
26038
|
+
var Table = ({ children, sx, className }) => /* @__PURE__ */ jsx154(TableContainer, { className: "Slim-Horizontal-Scroll", children: /* @__PURE__ */ jsx154(MuiTable, { sx: { backgroundColor: white, ...sx }, className, children }) });
|
|
25551
26039
|
var Table_default = Table;
|
|
25552
26040
|
|
|
25553
26041
|
// src/components/table/TableBody.tsx
|
|
25554
26042
|
import { TableBody as MuiTableBody } from "@mui/material";
|
|
25555
|
-
import { jsx as
|
|
25556
|
-
var TableBody = ({ children }) => /* @__PURE__ */
|
|
26043
|
+
import { jsx as jsx155 } from "react/jsx-runtime";
|
|
26044
|
+
var TableBody = ({ children }) => /* @__PURE__ */ jsx155(MuiTableBody, { children });
|
|
25557
26045
|
var TableBody_default = TableBody;
|
|
25558
26046
|
|
|
25559
26047
|
// src/components/table/TableCell.tsx
|
|
25560
26048
|
import {
|
|
25561
26049
|
TableCell as MuiTableCell2
|
|
25562
26050
|
} from "@mui/material";
|
|
25563
|
-
import { jsx as
|
|
26051
|
+
import { jsx as jsx156 } from "react/jsx-runtime";
|
|
25564
26052
|
var TableCell = ({
|
|
25565
26053
|
children,
|
|
25566
26054
|
size = "M",
|
|
@@ -25571,7 +26059,7 @@ var TableCell = ({
|
|
|
25571
26059
|
onClick,
|
|
25572
26060
|
noBorder = false,
|
|
25573
26061
|
...rest
|
|
25574
|
-
}) => /* @__PURE__ */
|
|
26062
|
+
}) => /* @__PURE__ */ jsx156(
|
|
25575
26063
|
MuiTableCell2,
|
|
25576
26064
|
{
|
|
25577
26065
|
...rest,
|
|
@@ -25595,12 +26083,12 @@ var TableCell = ({
|
|
|
25595
26083
|
var TableCell_default = TableCell;
|
|
25596
26084
|
|
|
25597
26085
|
// src/components/table/TableCellCopy.tsx
|
|
25598
|
-
import * as
|
|
25599
|
-
import { jsx as
|
|
26086
|
+
import * as React85 from "react";
|
|
26087
|
+
import { jsx as jsx157 } from "react/jsx-runtime";
|
|
25600
26088
|
var TableCellCopy = ({ text, textToCopy, ...rest }) => {
|
|
25601
26089
|
const { t } = useTranslation();
|
|
25602
|
-
const [isCopied, setIsCopied] =
|
|
25603
|
-
const [showIcon, setShowIcon] =
|
|
26090
|
+
const [isCopied, setIsCopied] = React85.useState(false);
|
|
26091
|
+
const [showIcon, setShowIcon] = React85.useState(false);
|
|
25604
26092
|
const manageButtonClicked = () => {
|
|
25605
26093
|
void navigator.clipboard.writeText(textToCopy ?? text);
|
|
25606
26094
|
if (isCopied) {
|
|
@@ -25614,7 +26102,7 @@ var TableCellCopy = ({ text, textToCopy, ...rest }) => {
|
|
|
25614
26102
|
const getIconId = () => !isCopied ? "content-copy" : "check";
|
|
25615
26103
|
const iconHiddenClass = "icon-hidden";
|
|
25616
26104
|
const iconCopiedClass = "icon-copied";
|
|
25617
|
-
return /* @__PURE__ */
|
|
26105
|
+
return /* @__PURE__ */ jsx157(TableCell_default, { ...rest, sx: { padding: 0 }, children: /* @__PURE__ */ jsx157(
|
|
25618
26106
|
Stack_default,
|
|
25619
26107
|
{
|
|
25620
26108
|
direction: "row",
|
|
@@ -25623,7 +26111,7 @@ var TableCellCopy = ({ text, textToCopy, ...rest }) => {
|
|
|
25623
26111
|
onMouseEnter: () => setShowIcon(true),
|
|
25624
26112
|
onMouseLeave: () => setShowIcon(false),
|
|
25625
26113
|
onClick: manageButtonClicked,
|
|
25626
|
-
children: /* @__PURE__ */
|
|
26114
|
+
children: /* @__PURE__ */ jsx157(Tooltip_default, { title: t(!isCopied ? "COPY" : "COPIED"), children: /* @__PURE__ */ jsx157(
|
|
25627
26115
|
Button_default,
|
|
25628
26116
|
{
|
|
25629
26117
|
className: isCopied ? iconCopiedClass : !showIcon ? iconHiddenClass : "",
|
|
@@ -25653,21 +26141,21 @@ var TableCellCopy_default = TableCellCopy;
|
|
|
25653
26141
|
|
|
25654
26142
|
// src/components/table/TableHead.tsx
|
|
25655
26143
|
import { TableHead as MuiTableHead } from "@mui/material";
|
|
25656
|
-
import { jsx as
|
|
25657
|
-
var TableHead = ({ children }) => /* @__PURE__ */
|
|
26144
|
+
import { jsx as jsx158 } from "react/jsx-runtime";
|
|
26145
|
+
var TableHead = ({ children }) => /* @__PURE__ */ jsx158(MuiTableHead, { children });
|
|
25658
26146
|
var TableHead_default = TableHead;
|
|
25659
26147
|
|
|
25660
26148
|
// src/components/table/TableRow.tsx
|
|
25661
26149
|
import {
|
|
25662
26150
|
TableRow as MuiTableRow2
|
|
25663
26151
|
} from "@mui/material";
|
|
25664
|
-
import { jsx as
|
|
26152
|
+
import { jsx as jsx159 } from "react/jsx-runtime";
|
|
25665
26153
|
var TableRow = ({
|
|
25666
26154
|
children,
|
|
25667
26155
|
isFollowedByNestedTable = false,
|
|
25668
26156
|
fadeInLeftAnimation = false,
|
|
25669
26157
|
sx
|
|
25670
|
-
}) => /* @__PURE__ */
|
|
26158
|
+
}) => /* @__PURE__ */ jsx159(
|
|
25671
26159
|
MuiTableRow2,
|
|
25672
26160
|
{
|
|
25673
26161
|
className: `${isFollowedByNestedTable ? "Followed-By-Nested-Table" : ""} ${fadeInLeftAnimation ? "animated fadeInLeft" : ""}`,
|
|
@@ -25679,14 +26167,14 @@ var TableRow_default = TableRow;
|
|
|
25679
26167
|
|
|
25680
26168
|
// src/components/table/NestedTable.tsx
|
|
25681
26169
|
import { Collapse as Collapse7 } from "@mui/material";
|
|
25682
|
-
import { jsx as
|
|
26170
|
+
import { jsx as jsx160 } from "react/jsx-runtime";
|
|
25683
26171
|
var NestedTable = ({
|
|
25684
26172
|
colSpan,
|
|
25685
26173
|
children,
|
|
25686
26174
|
className = "",
|
|
25687
26175
|
sx,
|
|
25688
26176
|
isVisible = true
|
|
25689
|
-
}) => /* @__PURE__ */
|
|
26177
|
+
}) => /* @__PURE__ */ jsx160(TableRow_default, { children: /* @__PURE__ */ jsx160(
|
|
25690
26178
|
TableCell_default,
|
|
25691
26179
|
{
|
|
25692
26180
|
colSpan,
|
|
@@ -25695,14 +26183,14 @@ var NestedTable = ({
|
|
|
25695
26183
|
height: "auto",
|
|
25696
26184
|
...!isVisible && { borderBottom: "none" }
|
|
25697
26185
|
},
|
|
25698
|
-
children: /* @__PURE__ */
|
|
26186
|
+
children: /* @__PURE__ */ jsx160(Collapse7, { in: isVisible, children: /* @__PURE__ */ jsx160(Box_default2, { sx: { padding: "16px", backgroundColor: grey100 }, children: /* @__PURE__ */ jsx160(Paper_default, { children: /* @__PURE__ */ jsx160(Table_default, { sx, className: `Nested-Table ${className}`, children }) }) }) })
|
|
25699
26187
|
}
|
|
25700
26188
|
) });
|
|
25701
26189
|
var NestedTable_default = NestedTable;
|
|
25702
26190
|
|
|
25703
26191
|
// src/components/toolbar/ToolbarBreadcrumb.tsx
|
|
25704
|
-
import { jsx as
|
|
25705
|
-
var ToolbarBreadcrumb = ({ parts = [] }) => /* @__PURE__ */
|
|
26192
|
+
import { jsx as jsx161 } from "react/jsx-runtime";
|
|
26193
|
+
var ToolbarBreadcrumb = ({ parts = [] }) => /* @__PURE__ */ jsx161(
|
|
25706
26194
|
Stack_default,
|
|
25707
26195
|
{
|
|
25708
26196
|
direction: "row",
|
|
@@ -25712,7 +26200,7 @@ var ToolbarBreadcrumb = ({ parts = [] }) => /* @__PURE__ */ jsx160(
|
|
|
25712
26200
|
(previous, current, index) => [
|
|
25713
26201
|
...previous,
|
|
25714
26202
|
...index > 0 ? [
|
|
25715
|
-
/* @__PURE__ */
|
|
26203
|
+
/* @__PURE__ */ jsx161(
|
|
25716
26204
|
Typography_default,
|
|
25717
26205
|
{
|
|
25718
26206
|
color: grey500,
|
|
@@ -25735,10 +26223,10 @@ var ToolbarBreadcrumb_default = ToolbarBreadcrumb;
|
|
|
25735
26223
|
|
|
25736
26224
|
// src/components/toolbar/ToolbarBreadcrumbButton.tsx
|
|
25737
26225
|
import { ButtonBase as ButtonBase5 } from "@mui/material";
|
|
25738
|
-
import * as
|
|
25739
|
-
import { jsx as
|
|
25740
|
-
var ToolbarBreadcrumbButton =
|
|
25741
|
-
return /* @__PURE__ */
|
|
26226
|
+
import * as React86 from "react";
|
|
26227
|
+
import { jsx as jsx162 } from "react/jsx-runtime";
|
|
26228
|
+
var ToolbarBreadcrumbButton = React86.forwardRef(function ToolbarBreadcrumbButton2({ text, className, ...rest }, ref) {
|
|
26229
|
+
return /* @__PURE__ */ jsx162(
|
|
25742
26230
|
ButtonBase5,
|
|
25743
26231
|
{
|
|
25744
26232
|
className: `Cn-ToolbarBreadcrumbButton ${className}`,
|
|
@@ -25757,14 +26245,14 @@ var ToolbarBreadcrumbButton = React85.forwardRef(function ToolbarBreadcrumbButto
|
|
|
25757
26245
|
}
|
|
25758
26246
|
},
|
|
25759
26247
|
...rest,
|
|
25760
|
-
children: /* @__PURE__ */
|
|
26248
|
+
children: /* @__PURE__ */ jsx162(Typography_default, { color: "inherit", component: "div", variant: "h6", noWrap: true, children: text })
|
|
25761
26249
|
}
|
|
25762
26250
|
);
|
|
25763
26251
|
});
|
|
25764
26252
|
var ToolbarBreadcrumbButton_default = ToolbarBreadcrumbButton;
|
|
25765
26253
|
|
|
25766
26254
|
// src/components/toolbar/Toolbar.tsx
|
|
25767
|
-
import { jsx as
|
|
26255
|
+
import { jsx as jsx163, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
25768
26256
|
var Toolbar = ({
|
|
25769
26257
|
children,
|
|
25770
26258
|
rightActions,
|
|
@@ -25773,7 +26261,7 @@ var Toolbar = ({
|
|
|
25773
26261
|
sx,
|
|
25774
26262
|
dataTestId,
|
|
25775
26263
|
onClickToolbar
|
|
25776
|
-
}) => /* @__PURE__ */
|
|
26264
|
+
}) => /* @__PURE__ */ jsxs78(
|
|
25777
26265
|
Box_default2,
|
|
25778
26266
|
{
|
|
25779
26267
|
className: `Cn-Toolbar ${className}`,
|
|
@@ -25793,7 +26281,7 @@ var Toolbar = ({
|
|
|
25793
26281
|
onClick: onClickToolbar,
|
|
25794
26282
|
"data-testid": dataTestId,
|
|
25795
26283
|
children: [
|
|
25796
|
-
/* @__PURE__ */
|
|
26284
|
+
/* @__PURE__ */ jsxs78(
|
|
25797
26285
|
Box_default2,
|
|
25798
26286
|
{
|
|
25799
26287
|
sx: {
|
|
@@ -25805,7 +26293,7 @@ var Toolbar = ({
|
|
|
25805
26293
|
width: "100%"
|
|
25806
26294
|
},
|
|
25807
26295
|
children: [
|
|
25808
|
-
leftActions && /* @__PURE__ */
|
|
26296
|
+
leftActions && /* @__PURE__ */ jsx163(
|
|
25809
26297
|
Box_default2,
|
|
25810
26298
|
{
|
|
25811
26299
|
className: `Cn-Toolbar-left`,
|
|
@@ -25815,7 +26303,7 @@ var Toolbar = ({
|
|
|
25815
26303
|
children: leftActions
|
|
25816
26304
|
}
|
|
25817
26305
|
),
|
|
25818
|
-
/* @__PURE__ */
|
|
26306
|
+
/* @__PURE__ */ jsx163(
|
|
25819
26307
|
Box_default2,
|
|
25820
26308
|
{
|
|
25821
26309
|
className: `Cn-Toolbar-children`,
|
|
@@ -25830,7 +26318,7 @@ var Toolbar = ({
|
|
|
25830
26318
|
]
|
|
25831
26319
|
}
|
|
25832
26320
|
),
|
|
25833
|
-
rightActions && /* @__PURE__ */
|
|
26321
|
+
rightActions && /* @__PURE__ */ jsx163(
|
|
25834
26322
|
Box_default2,
|
|
25835
26323
|
{
|
|
25836
26324
|
className: `Cn-Toolbar-right`,
|
|
@@ -25849,24 +26337,24 @@ var Toolbar = ({
|
|
|
25849
26337
|
var Toolbar_default = Toolbar;
|
|
25850
26338
|
|
|
25851
26339
|
// src/components/toolbar/ToolbarTitle.tsx
|
|
25852
|
-
import * as
|
|
25853
|
-
import { useState as
|
|
25854
|
-
import { jsx as
|
|
25855
|
-
var ToolbarTitle =
|
|
26340
|
+
import * as React87 from "react";
|
|
26341
|
+
import { useState as useState35 } from "react";
|
|
26342
|
+
import { jsx as jsx164, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
26343
|
+
var ToolbarTitle = React87.forwardRef(function ToolbarTitle2({
|
|
25856
26344
|
title,
|
|
25857
26345
|
align = "left",
|
|
25858
26346
|
className,
|
|
25859
26347
|
hoverActions,
|
|
25860
26348
|
color: color2 = grey900
|
|
25861
26349
|
}, ref) {
|
|
25862
|
-
const textElementRef =
|
|
25863
|
-
const [showHoverActions, setShowHoverActions] =
|
|
25864
|
-
return /* @__PURE__ */
|
|
26350
|
+
const textElementRef = React87.useRef(null);
|
|
26351
|
+
const [showHoverActions, setShowHoverActions] = useState35(false);
|
|
26352
|
+
return /* @__PURE__ */ jsx164(Box_default2, { sx: { maxWidth: "100%" }, children: /* @__PURE__ */ jsx164(
|
|
25865
26353
|
TextEllipsisTooltip_default,
|
|
25866
26354
|
{
|
|
25867
26355
|
title: title ?? "\xA0",
|
|
25868
26356
|
textEllipsableElement: textElementRef,
|
|
25869
|
-
children: /* @__PURE__ */
|
|
26357
|
+
children: /* @__PURE__ */ jsxs79(
|
|
25870
26358
|
Typography_default,
|
|
25871
26359
|
{
|
|
25872
26360
|
color: color2,
|
|
@@ -25884,7 +26372,7 @@ var ToolbarTitle = React86.forwardRef(function ToolbarTitle2({
|
|
|
25884
26372
|
},
|
|
25885
26373
|
children: [
|
|
25886
26374
|
title || "\xA0",
|
|
25887
|
-
hoverActions && showHoverActions && /* @__PURE__ */
|
|
26375
|
+
hoverActions && showHoverActions && /* @__PURE__ */ jsx164(
|
|
25888
26376
|
Box_default2,
|
|
25889
26377
|
{
|
|
25890
26378
|
sx: {
|
|
@@ -25913,13 +26401,13 @@ var Slide_default = Slide;
|
|
|
25913
26401
|
|
|
25914
26402
|
// src/components/widget/WidgetLegendItem.tsx
|
|
25915
26403
|
import { ButtonBase as ButtonBase6 } from "@mui/material";
|
|
25916
|
-
import { jsx as
|
|
26404
|
+
import { jsx as jsx165, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
25917
26405
|
var WidgetLegendItem = ({
|
|
25918
26406
|
groupLabel,
|
|
25919
26407
|
legendDirection = "column",
|
|
25920
26408
|
items = [],
|
|
25921
26409
|
onClick
|
|
25922
|
-
}) => /* @__PURE__ */
|
|
26410
|
+
}) => /* @__PURE__ */ jsx165(
|
|
25923
26411
|
ButtonBase6,
|
|
25924
26412
|
{
|
|
25925
26413
|
tabIndex: onClick ? 0 : -1,
|
|
@@ -25933,7 +26421,7 @@ var WidgetLegendItem = ({
|
|
|
25933
26421
|
p: "2px 12px",
|
|
25934
26422
|
cursor: onClick ? "pointer" : "default"
|
|
25935
26423
|
},
|
|
25936
|
-
children: /* @__PURE__ */
|
|
26424
|
+
children: /* @__PURE__ */ jsxs80(
|
|
25937
26425
|
Box_default2,
|
|
25938
26426
|
{
|
|
25939
26427
|
sx: {
|
|
@@ -25945,7 +26433,7 @@ var WidgetLegendItem = ({
|
|
|
25945
26433
|
color: grey800
|
|
25946
26434
|
},
|
|
25947
26435
|
children: [
|
|
25948
|
-
groupLabel && /* @__PURE__ */
|
|
26436
|
+
groupLabel && /* @__PURE__ */ jsx165(
|
|
25949
26437
|
Typography_default,
|
|
25950
26438
|
{
|
|
25951
26439
|
variant: "overline",
|
|
@@ -25967,7 +26455,7 @@ var WidgetLegendItem = ({
|
|
|
25967
26455
|
style: style3
|
|
25968
26456
|
}, i) => {
|
|
25969
26457
|
const incrementLabelIconId = incrementLabelType && incrementLabelStyles[incrementLabelType].icon;
|
|
25970
|
-
return /* @__PURE__ */
|
|
26458
|
+
return /* @__PURE__ */ jsxs80(
|
|
25971
26459
|
Box_default2,
|
|
25972
26460
|
{
|
|
25973
26461
|
sx: {
|
|
@@ -25977,7 +26465,7 @@ var WidgetLegendItem = ({
|
|
|
25977
26465
|
paddingRight: legendDirection === "row" ? "12px" : "inherit"
|
|
25978
26466
|
},
|
|
25979
26467
|
children: [
|
|
25980
|
-
iconColor && /* @__PURE__ */
|
|
26468
|
+
iconColor && /* @__PURE__ */ jsx165(
|
|
25981
26469
|
Icon_default,
|
|
25982
26470
|
{
|
|
25983
26471
|
id: iconId,
|
|
@@ -25988,7 +26476,7 @@ var WidgetLegendItem = ({
|
|
|
25988
26476
|
size: iconSize
|
|
25989
26477
|
}
|
|
25990
26478
|
),
|
|
25991
|
-
label && /* @__PURE__ */
|
|
26479
|
+
label && /* @__PURE__ */ jsx165(
|
|
25992
26480
|
Typography_default,
|
|
25993
26481
|
{
|
|
25994
26482
|
variant: "caption",
|
|
@@ -25997,7 +26485,7 @@ var WidgetLegendItem = ({
|
|
|
25997
26485
|
children: label
|
|
25998
26486
|
}
|
|
25999
26487
|
),
|
|
26000
|
-
value && /* @__PURE__ */
|
|
26488
|
+
value && /* @__PURE__ */ jsx165(
|
|
26001
26489
|
Typography_default,
|
|
26002
26490
|
{
|
|
26003
26491
|
sx: style3,
|
|
@@ -26006,7 +26494,7 @@ var WidgetLegendItem = ({
|
|
|
26006
26494
|
children: value
|
|
26007
26495
|
}
|
|
26008
26496
|
),
|
|
26009
|
-
incrementLabelValue && /* @__PURE__ */
|
|
26497
|
+
incrementLabelValue && /* @__PURE__ */ jsx165(
|
|
26010
26498
|
IncrementLabel_default,
|
|
26011
26499
|
{
|
|
26012
26500
|
label: incrementLabelValue,
|
|
@@ -26032,8 +26520,8 @@ var WidgetLegendItem_default = WidgetLegendItem;
|
|
|
26032
26520
|
|
|
26033
26521
|
// src/components/widget/Widget.tsx
|
|
26034
26522
|
import MuiCard2 from "@mui/material/Card";
|
|
26035
|
-
import { jsx as
|
|
26036
|
-
var Widget = ({ children }) => /* @__PURE__ */
|
|
26523
|
+
import { jsx as jsx166 } from "react/jsx-runtime";
|
|
26524
|
+
var Widget = ({ children }) => /* @__PURE__ */ jsx166(
|
|
26037
26525
|
MuiCard2,
|
|
26038
26526
|
{
|
|
26039
26527
|
variant: "elevation",
|
|
@@ -26057,8 +26545,8 @@ var Widget = ({ children }) => /* @__PURE__ */ jsx165(
|
|
|
26057
26545
|
var Widget_default = Widget;
|
|
26058
26546
|
|
|
26059
26547
|
// src/components/widget/WidgetActions.tsx
|
|
26060
|
-
import { jsx as
|
|
26061
|
-
var WidgetActions = ({ children }) => /* @__PURE__ */
|
|
26548
|
+
import { jsx as jsx167 } from "react/jsx-runtime";
|
|
26549
|
+
var WidgetActions = ({ children }) => /* @__PURE__ */ jsx167(
|
|
26062
26550
|
Box_default2,
|
|
26063
26551
|
{
|
|
26064
26552
|
sx: {
|
|
@@ -26072,8 +26560,8 @@ var WidgetActions = ({ children }) => /* @__PURE__ */ jsx166(
|
|
|
26072
26560
|
var WidgetActions_default = WidgetActions;
|
|
26073
26561
|
|
|
26074
26562
|
// src/components/widget/WidgetTitle.tsx
|
|
26075
|
-
import { jsx as
|
|
26076
|
-
var WidgetTitle = ({ children, sx, multiline = false }) => children ? /* @__PURE__ */
|
|
26563
|
+
import { jsx as jsx168 } from "react/jsx-runtime";
|
|
26564
|
+
var WidgetTitle = ({ children, sx, multiline = false }) => children ? /* @__PURE__ */ jsx168(
|
|
26077
26565
|
Box_default2,
|
|
26078
26566
|
{
|
|
26079
26567
|
sx: {
|
|
@@ -26083,7 +26571,7 @@ var WidgetTitle = ({ children, sx, multiline = false }) => children ? /* @__PURE
|
|
|
26083
26571
|
maxWidth: "100%",
|
|
26084
26572
|
...sx
|
|
26085
26573
|
},
|
|
26086
|
-
children: /* @__PURE__ */
|
|
26574
|
+
children: /* @__PURE__ */ jsx168(
|
|
26087
26575
|
Typography_default,
|
|
26088
26576
|
{
|
|
26089
26577
|
variant: "subtitle2",
|
|
@@ -26097,12 +26585,12 @@ var WidgetTitle = ({ children, sx, multiline = false }) => children ? /* @__PURE
|
|
|
26097
26585
|
}
|
|
26098
26586
|
)
|
|
26099
26587
|
}
|
|
26100
|
-
) : /* @__PURE__ */
|
|
26588
|
+
) : /* @__PURE__ */ jsx168("span", {});
|
|
26101
26589
|
var WidgetTitle_default = WidgetTitle;
|
|
26102
26590
|
|
|
26103
26591
|
// src/components/window/MinimizableWindow.tsx
|
|
26104
|
-
import * as
|
|
26105
|
-
import { Fragment as Fragment35, jsx as
|
|
26592
|
+
import * as React88 from "react";
|
|
26593
|
+
import { Fragment as Fragment35, jsx as jsx169, jsxs as jsxs81 } from "react/jsx-runtime";
|
|
26106
26594
|
var sizes6 = {
|
|
26107
26595
|
M: 400,
|
|
26108
26596
|
L: 500,
|
|
@@ -26127,7 +26615,7 @@ var iconButtonsStyles = {
|
|
|
26127
26615
|
backgroundColor: "rgba(255, 255, 255, 0.2)"
|
|
26128
26616
|
}
|
|
26129
26617
|
};
|
|
26130
|
-
var MinimizableWindow =
|
|
26618
|
+
var MinimizableWindow = React88.forwardRef(function MinimizableWindow2({
|
|
26131
26619
|
children,
|
|
26132
26620
|
title,
|
|
26133
26621
|
size = "M",
|
|
@@ -26144,17 +26632,17 @@ var MinimizableWindow = React87.forwardRef(function MinimizableWindow2({
|
|
|
26144
26632
|
onBack
|
|
26145
26633
|
}, ref) {
|
|
26146
26634
|
const { t } = useTranslation();
|
|
26147
|
-
const overlayRef =
|
|
26148
|
-
const windowRef =
|
|
26149
|
-
const headerRef =
|
|
26150
|
-
const [isDraggingState, setIsDraggingState] =
|
|
26151
|
-
const diffRef =
|
|
26152
|
-
|
|
26635
|
+
const overlayRef = React88.useRef(null);
|
|
26636
|
+
const windowRef = React88.useRef(null);
|
|
26637
|
+
const headerRef = React88.useRef(null);
|
|
26638
|
+
const [isDraggingState, setIsDraggingState] = React88.useState(false);
|
|
26639
|
+
const diffRef = React88.useRef({ x: 0, y: 0 });
|
|
26640
|
+
React88.useImperativeHandle(ref, () => ({
|
|
26153
26641
|
window: windowRef.current,
|
|
26154
26642
|
header: headerRef.current,
|
|
26155
26643
|
overlay: overlayRef.current
|
|
26156
26644
|
}));
|
|
26157
|
-
|
|
26645
|
+
React88.useEffect(() => {
|
|
26158
26646
|
if (open) {
|
|
26159
26647
|
overlayRef.current?.style.removeProperty("transform");
|
|
26160
26648
|
overlayRef.current?.style.removeProperty("opacity");
|
|
@@ -26216,8 +26704,8 @@ var MinimizableWindow = React87.forwardRef(function MinimizableWindow2({
|
|
|
26216
26704
|
}
|
|
26217
26705
|
}, 750);
|
|
26218
26706
|
};
|
|
26219
|
-
return /* @__PURE__ */
|
|
26220
|
-
isDraggingState && /* @__PURE__ */
|
|
26707
|
+
return /* @__PURE__ */ jsxs81(Fragment35, { children: [
|
|
26708
|
+
isDraggingState && /* @__PURE__ */ jsx169(
|
|
26221
26709
|
Box_default2,
|
|
26222
26710
|
{
|
|
26223
26711
|
sx: {
|
|
@@ -26233,7 +26721,7 @@ var MinimizableWindow = React87.forwardRef(function MinimizableWindow2({
|
|
|
26233
26721
|
onMouseMove: (ev) => handleMouseMove(ev)
|
|
26234
26722
|
}
|
|
26235
26723
|
),
|
|
26236
|
-
/* @__PURE__ */
|
|
26724
|
+
/* @__PURE__ */ jsx169(
|
|
26237
26725
|
Box_default2,
|
|
26238
26726
|
{
|
|
26239
26727
|
ref: overlayRef,
|
|
@@ -26250,7 +26738,7 @@ var MinimizableWindow = React87.forwardRef(function MinimizableWindow2({
|
|
|
26250
26738
|
...!open && { pointerEvents: "none" },
|
|
26251
26739
|
transition: "transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), left 0.4s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
26252
26740
|
},
|
|
26253
|
-
children: /* @__PURE__ */
|
|
26741
|
+
children: /* @__PURE__ */ jsxs81(
|
|
26254
26742
|
Stack_default,
|
|
26255
26743
|
{
|
|
26256
26744
|
sx: {
|
|
@@ -26261,7 +26749,7 @@ var MinimizableWindow = React87.forwardRef(function MinimizableWindow2({
|
|
|
26261
26749
|
width: `${sizes6[size]}px`,
|
|
26262
26750
|
height: contentHeight !== void 0 && headerRef.current ? `${contentHeight + contentPadding + headerRef.current.scrollHeight}px` : void 0,
|
|
26263
26751
|
children: [
|
|
26264
|
-
/* @__PURE__ */
|
|
26752
|
+
/* @__PURE__ */ jsxs81(
|
|
26265
26753
|
Stack_default,
|
|
26266
26754
|
{
|
|
26267
26755
|
ref: headerRef,
|
|
@@ -26275,19 +26763,19 @@ var MinimizableWindow = React87.forwardRef(function MinimizableWindow2({
|
|
|
26275
26763
|
onMouseDown: handleMouseDown,
|
|
26276
26764
|
minHeight: "44px",
|
|
26277
26765
|
children: [
|
|
26278
|
-
/* @__PURE__ */
|
|
26766
|
+
/* @__PURE__ */ jsx169(
|
|
26279
26767
|
Stack_default,
|
|
26280
26768
|
{
|
|
26281
26769
|
direction: "row",
|
|
26282
26770
|
alignItems: "center",
|
|
26283
26771
|
onMouseDown: (ev) => ev.stopPropagation(),
|
|
26284
|
-
children: showBackButton && (!backButton ? /* @__PURE__ */
|
|
26772
|
+
children: showBackButton && (!backButton ? /* @__PURE__ */ jsx169(
|
|
26285
26773
|
Tooltip_default,
|
|
26286
26774
|
{
|
|
26287
26775
|
title: t("MINIMIZABLE_WINDOW.GO_BACK"),
|
|
26288
26776
|
zIndex: 999999,
|
|
26289
26777
|
placement: "top",
|
|
26290
|
-
children: /* @__PURE__ */
|
|
26778
|
+
children: /* @__PURE__ */ jsx169(
|
|
26291
26779
|
IconButton_default,
|
|
26292
26780
|
{
|
|
26293
26781
|
size: iconSizes4,
|
|
@@ -26300,7 +26788,7 @@ var MinimizableWindow = React87.forwardRef(function MinimizableWindow2({
|
|
|
26300
26788
|
) : backButton)
|
|
26301
26789
|
}
|
|
26302
26790
|
),
|
|
26303
|
-
/* @__PURE__ */
|
|
26791
|
+
/* @__PURE__ */ jsx169(
|
|
26304
26792
|
Box_default2,
|
|
26305
26793
|
{
|
|
26306
26794
|
sx: {
|
|
@@ -26308,23 +26796,23 @@ var MinimizableWindow = React87.forwardRef(function MinimizableWindow2({
|
|
|
26308
26796
|
left: "50%",
|
|
26309
26797
|
transform: "translateX(-50%)"
|
|
26310
26798
|
},
|
|
26311
|
-
children: typeof title === "string" ? /* @__PURE__ */
|
|
26799
|
+
children: typeof title === "string" ? /* @__PURE__ */ jsx169(Typography_default, { children: title }) : title
|
|
26312
26800
|
}
|
|
26313
26801
|
),
|
|
26314
|
-
/* @__PURE__ */
|
|
26802
|
+
/* @__PURE__ */ jsxs81(
|
|
26315
26803
|
Stack_default,
|
|
26316
26804
|
{
|
|
26317
26805
|
direction: "row",
|
|
26318
26806
|
alignItems: "center",
|
|
26319
26807
|
onMouseDown: (ev) => ev.stopPropagation(),
|
|
26320
26808
|
children: [
|
|
26321
|
-
/* @__PURE__ */
|
|
26809
|
+
/* @__PURE__ */ jsx169(Box_default2, { children: /* @__PURE__ */ jsx169(
|
|
26322
26810
|
Tooltip_default,
|
|
26323
26811
|
{
|
|
26324
26812
|
title: t("MINIMIZABLE_WINDOW.MINIMIZE"),
|
|
26325
26813
|
zIndex: 999999,
|
|
26326
26814
|
placement: "top",
|
|
26327
|
-
children: /* @__PURE__ */
|
|
26815
|
+
children: /* @__PURE__ */ jsx169(
|
|
26328
26816
|
IconButton_default,
|
|
26329
26817
|
{
|
|
26330
26818
|
size: iconSizes4,
|
|
@@ -26340,13 +26828,13 @@ var MinimizableWindow = React87.forwardRef(function MinimizableWindow2({
|
|
|
26340
26828
|
)
|
|
26341
26829
|
}
|
|
26342
26830
|
) }),
|
|
26343
|
-
closeable && /* @__PURE__ */
|
|
26831
|
+
closeable && /* @__PURE__ */ jsx169(Box_default2, { sx: { padding: "0 8px" }, children: /* @__PURE__ */ jsx169(
|
|
26344
26832
|
Tooltip_default,
|
|
26345
26833
|
{
|
|
26346
26834
|
title: t("MINIMIZABLE_WINDOW.CLOSE"),
|
|
26347
26835
|
zIndex: 999999,
|
|
26348
26836
|
placement: "top",
|
|
26349
|
-
children: /* @__PURE__ */
|
|
26837
|
+
children: /* @__PURE__ */ jsx169(
|
|
26350
26838
|
IconButton_default,
|
|
26351
26839
|
{
|
|
26352
26840
|
size: iconSizes4,
|
|
@@ -26363,7 +26851,7 @@ var MinimizableWindow = React87.forwardRef(function MinimizableWindow2({
|
|
|
26363
26851
|
]
|
|
26364
26852
|
}
|
|
26365
26853
|
),
|
|
26366
|
-
/* @__PURE__ */
|
|
26854
|
+
/* @__PURE__ */ jsx169(
|
|
26367
26855
|
Stack_default,
|
|
26368
26856
|
{
|
|
26369
26857
|
sx: {
|
|
@@ -26382,27 +26870,27 @@ var MinimizableWindow = React87.forwardRef(function MinimizableWindow2({
|
|
|
26382
26870
|
var MinimizableWindow_default = MinimizableWindow;
|
|
26383
26871
|
|
|
26384
26872
|
// src/hooks/useFormatters.ts
|
|
26385
|
-
import { useCallback as
|
|
26873
|
+
import { useCallback as useCallback20, useContext as useContext16 } from "react";
|
|
26386
26874
|
var useFormatters = () => {
|
|
26387
26875
|
const { locale, currency, timezone } = useContext16(IntlContext);
|
|
26388
26876
|
return {
|
|
26389
|
-
formatCompactNumber:
|
|
26877
|
+
formatCompactNumber: useCallback20(
|
|
26390
26878
|
(value) => formatCompactNumber(value, locale),
|
|
26391
26879
|
[locale]
|
|
26392
26880
|
),
|
|
26393
|
-
formatNumber:
|
|
26881
|
+
formatNumber: useCallback20(
|
|
26394
26882
|
(value, fractionSize) => formatNumber(value, locale, fractionSize),
|
|
26395
26883
|
[locale]
|
|
26396
26884
|
),
|
|
26397
|
-
formatPercentage:
|
|
26885
|
+
formatPercentage: useCallback20(
|
|
26398
26886
|
(value, fractionSize) => formatPercentage(value, locale, fractionSize),
|
|
26399
26887
|
[locale]
|
|
26400
26888
|
),
|
|
26401
|
-
formatCurrency:
|
|
26889
|
+
formatCurrency: useCallback20(
|
|
26402
26890
|
(value, notation) => formatCurrency(value, locale, currency, notation),
|
|
26403
26891
|
[currency, locale]
|
|
26404
26892
|
),
|
|
26405
|
-
formatDate:
|
|
26893
|
+
formatDate: useCallback20(
|
|
26406
26894
|
(date, format2) => formatDate(date, locale, timezone, format2),
|
|
26407
26895
|
[locale, timezone]
|
|
26408
26896
|
)
|
|
@@ -26430,6 +26918,7 @@ export {
|
|
|
26430
26918
|
CardTable_default as CardTable,
|
|
26431
26919
|
CardTitle_default as CardTitle,
|
|
26432
26920
|
CardTitleWithIcon_default as CardTitleWithIcon,
|
|
26921
|
+
Carousel_default as Carousel,
|
|
26433
26922
|
CategorizedPicker_default as CategorizedPicker,
|
|
26434
26923
|
Chat_default as Chat,
|
|
26435
26924
|
ChatMessage_default as ChatMessage,
|
|
@@ -26568,6 +27057,7 @@ export {
|
|
|
26568
27057
|
WidgetLegendItem_default as WidgetLegendItem,
|
|
26569
27058
|
WidgetTitle_default as WidgetTitle,
|
|
26570
27059
|
allCountries,
|
|
27060
|
+
applyTimeToDate,
|
|
26571
27061
|
areSameSimpleDate,
|
|
26572
27062
|
closeSnackbar2 as closeSnackbar,
|
|
26573
27063
|
colorPickerDefaultColors,
|