@connectif/ui-components 4.0.3 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -0
- package/dist/components/input/Select.d.ts +2 -2
- package/dist/components/input/autocomplete/AutocompleteList.d.ts +2 -2
- package/dist/components/list/BaseListItem.d.ts +9 -2
- package/dist/components/list/ListItemButton.d.ts +17 -4
- package/dist/components/list/ListItemText.d.ts +9 -2
- package/dist/components/navbar/NavbarButton.d.ts +1 -1
- package/dist/index.js +286 -258
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utils/AutocompleteUtils.d.ts +7 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8078,7 +8078,8 @@ var ListItemText = ({
|
|
|
8078
8078
|
typographyVariant,
|
|
8079
8079
|
color: color2 = "inherit",
|
|
8080
8080
|
tooltipClass,
|
|
8081
|
-
|
|
8081
|
+
slotProps,
|
|
8082
|
+
"data-testid": dataTestId
|
|
8082
8083
|
}) => {
|
|
8083
8084
|
const textElementRef = React8.useRef(null);
|
|
8084
8085
|
return /* @__PURE__ */ jsx6(
|
|
@@ -8095,9 +8096,10 @@ var ListItemText = ({
|
|
|
8095
8096
|
component: "div",
|
|
8096
8097
|
variant: typographyVariant,
|
|
8097
8098
|
noWrap: true,
|
|
8098
|
-
...
|
|
8099
|
-
"data-
|
|
8099
|
+
...dataTestId && {
|
|
8100
|
+
"data-testid": dataTestId
|
|
8100
8101
|
},
|
|
8102
|
+
...slotProps?.typography,
|
|
8101
8103
|
children: text || "\xA0"
|
|
8102
8104
|
}
|
|
8103
8105
|
)
|
|
@@ -8122,7 +8124,8 @@ var BaseListItem = ({
|
|
|
8122
8124
|
text,
|
|
8123
8125
|
subText,
|
|
8124
8126
|
tooltipClass,
|
|
8125
|
-
|
|
8127
|
+
slotProps,
|
|
8128
|
+
"data-testid": dataTestId
|
|
8126
8129
|
}) => /* @__PURE__ */ jsxs2(
|
|
8127
8130
|
Stack_default,
|
|
8128
8131
|
{
|
|
@@ -8173,8 +8176,9 @@ var BaseListItem = ({
|
|
|
8173
8176
|
text,
|
|
8174
8177
|
typographyVariant,
|
|
8175
8178
|
tooltipClass,
|
|
8176
|
-
|
|
8177
|
-
|
|
8179
|
+
slotProps,
|
|
8180
|
+
...dataTestId && {
|
|
8181
|
+
"data-testid": dataTestId
|
|
8178
8182
|
}
|
|
8179
8183
|
}
|
|
8180
8184
|
),
|
|
@@ -8184,6 +8188,7 @@ var BaseListItem = ({
|
|
|
8184
8188
|
text: subText,
|
|
8185
8189
|
typographyVariant: "caption",
|
|
8186
8190
|
tooltipClass,
|
|
8191
|
+
slotProps,
|
|
8187
8192
|
color: grey500
|
|
8188
8193
|
}
|
|
8189
8194
|
)
|
|
@@ -8225,11 +8230,12 @@ var ListItemButton = React9.forwardRef(function ListItemButton2({
|
|
|
8225
8230
|
sx,
|
|
8226
8231
|
variant,
|
|
8227
8232
|
className = "",
|
|
8228
|
-
"data-
|
|
8229
|
-
|
|
8233
|
+
"data-testid": dataTestId,
|
|
8234
|
+
buttonDataTestId,
|
|
8230
8235
|
tooltipClass,
|
|
8231
8236
|
enableAuxClick = false,
|
|
8232
8237
|
onClick,
|
|
8238
|
+
slotProps,
|
|
8233
8239
|
...rest
|
|
8234
8240
|
}, ref) {
|
|
8235
8241
|
return /* @__PURE__ */ jsx8(
|
|
@@ -8253,8 +8259,7 @@ var ListItemButton = React9.forwardRef(function ListItemButton2({
|
|
|
8253
8259
|
...sx
|
|
8254
8260
|
},
|
|
8255
8261
|
disabled,
|
|
8256
|
-
"data-
|
|
8257
|
-
"data-testid": buttonDataTest,
|
|
8262
|
+
...buttonDataTestId && { "data-testid": buttonDataTestId },
|
|
8258
8263
|
children: /* @__PURE__ */ jsx8(
|
|
8259
8264
|
BaseListItem_default,
|
|
8260
8265
|
{
|
|
@@ -8272,7 +8277,8 @@ var ListItemButton = React9.forwardRef(function ListItemButton2({
|
|
|
8272
8277
|
subText,
|
|
8273
8278
|
selected,
|
|
8274
8279
|
tooltipClass,
|
|
8275
|
-
|
|
8280
|
+
slotProps,
|
|
8281
|
+
...dataTestId && { "data-testid": dataTestId }
|
|
8276
8282
|
}
|
|
8277
8283
|
}
|
|
8278
8284
|
)
|
|
@@ -10280,6 +10286,7 @@ var ListItem = React22.forwardRef(function ListItem2({
|
|
|
10280
10286
|
variant,
|
|
10281
10287
|
className = "",
|
|
10282
10288
|
tooltipClass,
|
|
10289
|
+
slotProps,
|
|
10283
10290
|
...rest
|
|
10284
10291
|
}, ref) {
|
|
10285
10292
|
return /* @__PURE__ */ jsx40(
|
|
@@ -10305,7 +10312,8 @@ var ListItem = React22.forwardRef(function ListItem2({
|
|
|
10305
10312
|
text,
|
|
10306
10313
|
subText,
|
|
10307
10314
|
selected,
|
|
10308
|
-
tooltipClass
|
|
10315
|
+
tooltipClass,
|
|
10316
|
+
slotProps
|
|
10309
10317
|
}
|
|
10310
10318
|
}
|
|
10311
10319
|
)
|
|
@@ -21173,20 +21181,23 @@ var ChevronIcon = ({ disabled = false }) => /* @__PURE__ */ jsx114(
|
|
|
21173
21181
|
}
|
|
21174
21182
|
);
|
|
21175
21183
|
var SelectOption = ({
|
|
21176
|
-
|
|
21184
|
+
id,
|
|
21177
21185
|
label,
|
|
21178
21186
|
selected,
|
|
21179
21187
|
colors,
|
|
21188
|
+
slotProps,
|
|
21180
21189
|
...rest
|
|
21181
21190
|
}) => /* @__PURE__ */ jsx114(
|
|
21182
21191
|
ListItemButton_default,
|
|
21183
21192
|
{
|
|
21184
21193
|
role: "option",
|
|
21185
21194
|
selected,
|
|
21186
|
-
"data-value":
|
|
21195
|
+
"data-value": id,
|
|
21187
21196
|
text: label,
|
|
21188
|
-
|
|
21189
|
-
|
|
21197
|
+
...id && {
|
|
21198
|
+
"data-testid": `select-option-${id}`,
|
|
21199
|
+
buttonDataTestId: `select-option-button-${id}`
|
|
21200
|
+
},
|
|
21190
21201
|
sx: {
|
|
21191
21202
|
"&:hover": {
|
|
21192
21203
|
backgroundColor: colors?.hoverColor
|
|
@@ -21201,6 +21212,9 @@ var SelectOption = ({
|
|
|
21201
21212
|
backgroundColor: selected ? colors?.selectedColor : "transparent",
|
|
21202
21213
|
color: colors?.color
|
|
21203
21214
|
},
|
|
21215
|
+
slotProps: {
|
|
21216
|
+
typography: slotProps?.optionText
|
|
21217
|
+
},
|
|
21204
21218
|
...rest
|
|
21205
21219
|
}
|
|
21206
21220
|
);
|
|
@@ -21223,7 +21237,7 @@ var Select = function Select2({
|
|
|
21223
21237
|
menuZIndex,
|
|
21224
21238
|
menuColors,
|
|
21225
21239
|
menuMaxHeight,
|
|
21226
|
-
|
|
21240
|
+
"data-testid": dataTestId,
|
|
21227
21241
|
open,
|
|
21228
21242
|
onOpen,
|
|
21229
21243
|
...rest
|
|
@@ -21337,7 +21351,7 @@ var Select = function Select2({
|
|
|
21337
21351
|
}
|
|
21338
21352
|
return options.find((o) => o.value === value2)?.label ?? value2;
|
|
21339
21353
|
},
|
|
21340
|
-
...
|
|
21354
|
+
...dataTestId && { "data-testid": dataTestId },
|
|
21341
21355
|
inputProps: "data-testid" in rest ? {
|
|
21342
21356
|
"data-testid": rest["data-testid"] + "-input"
|
|
21343
21357
|
} : void 0,
|
|
@@ -21453,7 +21467,7 @@ var Select = function Select2({
|
|
|
21453
21467
|
return options.find((o) => o.value === value2)?.label ?? value2;
|
|
21454
21468
|
}
|
|
21455
21469
|
},
|
|
21456
|
-
...
|
|
21470
|
+
...dataTestId && { "data-testid": dataTestId },
|
|
21457
21471
|
inputProps: "data-testid" in rest ? {
|
|
21458
21472
|
"data-testid": rest["data-testid"] + "-input"
|
|
21459
21473
|
} : void 0,
|
|
@@ -21477,17 +21491,18 @@ var Select = function Select2({
|
|
|
21477
21491
|
},
|
|
21478
21492
|
...rest,
|
|
21479
21493
|
children: children ?? options.map((option) => {
|
|
21480
|
-
const { label, value: optionValue, ...rest2 } = option;
|
|
21494
|
+
const { label, value: optionValue, sx: sx2, ...rest2 } = option;
|
|
21481
21495
|
return /* @__PURE__ */ jsx114(
|
|
21482
21496
|
SelectOption,
|
|
21483
21497
|
{
|
|
21484
21498
|
label: label ?? value?.toString() ?? "",
|
|
21485
|
-
|
|
21499
|
+
id: optionValue,
|
|
21486
21500
|
colors: !menuColors?.selectedColor ? {
|
|
21487
21501
|
...menuColors ?? {},
|
|
21488
21502
|
selectedColor: primary50
|
|
21489
21503
|
} : menuColors,
|
|
21490
21504
|
selected: Array.isArray(currentValue) ? currentValue.some((v) => v === optionValue) : currentValue === optionValue,
|
|
21505
|
+
slotProps: { optionText: { sx: sx2 } },
|
|
21491
21506
|
...rest2
|
|
21492
21507
|
},
|
|
21493
21508
|
optionValue ?? ""
|
|
@@ -21587,9 +21602,7 @@ var DaysOfWeekPicker_default = DaysOfWeekPicker;
|
|
|
21587
21602
|
|
|
21588
21603
|
// src/components/input/ColorPicker.tsx
|
|
21589
21604
|
import * as React62 from "react";
|
|
21590
|
-
import GradientColorPicker
|
|
21591
|
-
useColorPicker
|
|
21592
|
-
} from "react-best-gradient-color-picker";
|
|
21605
|
+
import GradientColorPicker from "react-best-gradient-color-picker";
|
|
21593
21606
|
import { Fragment as Fragment23, jsx as jsx117, jsxs as jsxs53 } from "react/jsx-runtime";
|
|
21594
21607
|
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+))?\)$/;
|
|
21595
21608
|
var isValidColor = (color2) => colorRegex.test(color2);
|
|
@@ -21633,18 +21646,10 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21633
21646
|
const [internalPickerValue, setInternalPickerValue] = React62.useState(
|
|
21634
21647
|
value || white
|
|
21635
21648
|
);
|
|
21636
|
-
const
|
|
21637
|
-
internalPickerValue ?? "",
|
|
21638
|
-
setInternalPickerValue
|
|
21639
|
-
);
|
|
21640
|
-
const [textFieldValue, setTextFieldValue] = React62.useState(
|
|
21641
|
-
value ? valueToHex() : ""
|
|
21642
|
-
);
|
|
21643
|
-
const [isValidPickerChange, setValidPickerChange] = React62.useState(false);
|
|
21649
|
+
const [textFieldValue, setTextFieldValue] = React62.useState(value ?? "");
|
|
21644
21650
|
const [anchorEl, setAnchorEl] = React62.useState();
|
|
21645
21651
|
const handleTextFieldChange = (event) => {
|
|
21646
21652
|
const newValue = event.target.value;
|
|
21647
|
-
setValidPickerChange(false);
|
|
21648
21653
|
setTextFieldValue(newValue);
|
|
21649
21654
|
if (isValidColor(newValue) || allowEmpty && newValue === "") {
|
|
21650
21655
|
setInternalPickerValue(newValue);
|
|
@@ -21661,6 +21666,24 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21661
21666
|
return hex.length === 1 ? "0" + hex : hex;
|
|
21662
21667
|
}).join("");
|
|
21663
21668
|
};
|
|
21669
|
+
const normalizeBlack = (color2) => {
|
|
21670
|
+
const rgb = color2.match(/\d+/g);
|
|
21671
|
+
if (!rgb) {
|
|
21672
|
+
return color2;
|
|
21673
|
+
}
|
|
21674
|
+
const [r2, g, b] = rgb.map(Number);
|
|
21675
|
+
if (r2 <= 1 && g <= 1 && b <= 1) {
|
|
21676
|
+
return "rgb(0,0,0)";
|
|
21677
|
+
}
|
|
21678
|
+
return color2;
|
|
21679
|
+
};
|
|
21680
|
+
const commitColor = React62.useCallback(() => {
|
|
21681
|
+
const finalValue = allowAlpha ? internalPickerValue : rgbToHex(internalPickerValue);
|
|
21682
|
+
setInternalPickerValue(finalValue);
|
|
21683
|
+
setTextFieldValue(finalValue);
|
|
21684
|
+
setPreviousColors((prev) => [finalValue, ...prev.slice(0, 17)]);
|
|
21685
|
+
onChange(finalValue);
|
|
21686
|
+
}, [internalPickerValue, allowAlpha, onChange]);
|
|
21664
21687
|
const iconColor = /* @__PURE__ */ jsx117(
|
|
21665
21688
|
IconButton_default,
|
|
21666
21689
|
{
|
|
@@ -21672,17 +21695,6 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21672
21695
|
sx: { color: value || grey600 }
|
|
21673
21696
|
}
|
|
21674
21697
|
);
|
|
21675
|
-
React62.useEffect(() => {
|
|
21676
|
-
const handleColorChange = (color2) => {
|
|
21677
|
-
setPreviousColors((prev) => [color2, ...prev.slice(0, 17)]);
|
|
21678
|
-
setTextFieldValue(valueToHex());
|
|
21679
|
-
onChange(color2);
|
|
21680
|
-
setValidPickerChange(false);
|
|
21681
|
-
};
|
|
21682
|
-
if (isValidPickerChange && internalPickerValue && internalPickerValue !== value) {
|
|
21683
|
-
handleColorChange(internalPickerValue);
|
|
21684
|
-
}
|
|
21685
|
-
}, [value, internalPickerValue, onChange, isValidPickerChange, valueToHex]);
|
|
21686
21698
|
return /* @__PURE__ */ jsxs53(Fragment23, { children: [
|
|
21687
21699
|
/* @__PURE__ */ jsx117(
|
|
21688
21700
|
TextField_default,
|
|
@@ -21696,13 +21708,13 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21696
21708
|
inputSx: {
|
|
21697
21709
|
fontFamily: "Source Sans Pro, sans-serif",
|
|
21698
21710
|
fontWeight: "400",
|
|
21699
|
-
color:
|
|
21711
|
+
color: grey900
|
|
21700
21712
|
},
|
|
21701
21713
|
placeholder: t("COLOR_PICKER.VALUE_NOT_DEFINED"),
|
|
21702
21714
|
onChange: handleTextFieldChange,
|
|
21703
21715
|
onBlur: () => {
|
|
21704
|
-
if (
|
|
21705
|
-
setTextFieldValue(
|
|
21716
|
+
if (!textFieldValue && !allowEmpty) {
|
|
21717
|
+
setTextFieldValue(internalPickerValue);
|
|
21706
21718
|
}
|
|
21707
21719
|
},
|
|
21708
21720
|
startAdornment: iconColor,
|
|
@@ -21715,16 +21727,11 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21715
21727
|
anchorEl,
|
|
21716
21728
|
onClose: () => setAnchorEl(void 0),
|
|
21717
21729
|
sx: { zIndex: popoverZIndex },
|
|
21718
|
-
onMouseUp:
|
|
21719
|
-
setValidPickerChange(true);
|
|
21720
|
-
},
|
|
21730
|
+
onMouseUp: commitColor,
|
|
21721
21731
|
children: /* @__PURE__ */ jsx117(
|
|
21722
21732
|
Box_default2,
|
|
21723
21733
|
{
|
|
21724
21734
|
className: "Cn-Color-Gradient-Box",
|
|
21725
|
-
onMouseUp: () => {
|
|
21726
|
-
setValidPickerChange(true);
|
|
21727
|
-
},
|
|
21728
21735
|
sx: {
|
|
21729
21736
|
"&.Cn-Color-Gradient-Box": {
|
|
21730
21737
|
backgroundColor: "white !important",
|
|
@@ -21771,9 +21778,10 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21771
21778
|
height: height2,
|
|
21772
21779
|
presets: currentColorPreset,
|
|
21773
21780
|
onChange: (newColor) => {
|
|
21774
|
-
|
|
21775
|
-
|
|
21776
|
-
);
|
|
21781
|
+
const normalized = normalizeBlack(newColor);
|
|
21782
|
+
const preview = allowAlpha ? normalized : rgbToHex(normalized);
|
|
21783
|
+
setInternalPickerValue(preview);
|
|
21784
|
+
setTextFieldValue(preview);
|
|
21777
21785
|
},
|
|
21778
21786
|
hideAdvancedSliders: true,
|
|
21779
21787
|
hideColorGuide: true,
|
|
@@ -22023,7 +22031,7 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
22023
22031
|
sx: { color: primaryMain }
|
|
22024
22032
|
}
|
|
22025
22033
|
) : void 0,
|
|
22026
|
-
|
|
22034
|
+
buttonDataTestId: dataTestId ? dataTestId + "-category-" + idx : void 0,
|
|
22027
22035
|
children: /* @__PURE__ */ jsx119(
|
|
22028
22036
|
TextEllipsis_default,
|
|
22029
22037
|
{
|
|
@@ -22073,7 +22081,7 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
22073
22081
|
onChange(option);
|
|
22074
22082
|
closePopover();
|
|
22075
22083
|
},
|
|
22076
|
-
|
|
22084
|
+
buttonDataTestId: dataTestId ? dataTestId + "-option-" + idx : void 0,
|
|
22077
22085
|
children: /* @__PURE__ */ jsx119(
|
|
22078
22086
|
TextEllipsis_default,
|
|
22079
22087
|
{
|
|
@@ -22719,7 +22727,7 @@ var ItemSelector = function ItemSelector2({
|
|
|
22719
22727
|
var ItemSelector_default = ItemSelector;
|
|
22720
22728
|
|
|
22721
22729
|
// src/components/input/autocomplete/Autocomplete.tsx
|
|
22722
|
-
import * as
|
|
22730
|
+
import * as React69 from "react";
|
|
22723
22731
|
|
|
22724
22732
|
// src/utils/RegExpUtils.ts
|
|
22725
22733
|
var map = {
|
|
@@ -22999,16 +23007,40 @@ var AutocompleteInput = function AutocompleteInput2({
|
|
|
22999
23007
|
),
|
|
23000
23008
|
autoComplete: "off",
|
|
23001
23009
|
onMouseEnter: () => setIsHover(true),
|
|
23002
|
-
onMouseLeave: () => setIsHover(false)
|
|
23010
|
+
onMouseLeave: () => setIsHover(false),
|
|
23011
|
+
"data-testid": "autocomplete-input"
|
|
23003
23012
|
}
|
|
23004
23013
|
) });
|
|
23005
23014
|
};
|
|
23006
23015
|
var AutocompleteInput_default = AutocompleteInput;
|
|
23007
23016
|
|
|
23008
23017
|
// src/components/input/autocomplete/AutocompleteList.tsx
|
|
23018
|
+
import * as React68 from "react";
|
|
23009
23019
|
import { Popper, ClickAwayListener } from "@mui/material";
|
|
23010
23020
|
import { FixedSizeList as FixedSizeList3 } from "react-window";
|
|
23011
23021
|
import AutoSizer5 from "react-virtualized-auto-sizer";
|
|
23022
|
+
|
|
23023
|
+
// src/utils/AutocompleteUtils.ts
|
|
23024
|
+
function getInitialListScroll({
|
|
23025
|
+
highlightedIndex,
|
|
23026
|
+
itemHeight,
|
|
23027
|
+
selectedIndex,
|
|
23028
|
+
totalItems,
|
|
23029
|
+
containerHeight
|
|
23030
|
+
}) {
|
|
23031
|
+
const totalHeight = totalItems * itemHeight;
|
|
23032
|
+
let scrollTo = 0;
|
|
23033
|
+
if (highlightedIndex > -1) {
|
|
23034
|
+
scrollTo = highlightedIndex * itemHeight;
|
|
23035
|
+
} else if (Array.isArray(selectedIndex) && selectedIndex.length > 0) {
|
|
23036
|
+
scrollTo = selectedIndex[selectedIndex.length - 1] * itemHeight;
|
|
23037
|
+
} else if (typeof selectedIndex === "number") {
|
|
23038
|
+
scrollTo = selectedIndex * itemHeight;
|
|
23039
|
+
}
|
|
23040
|
+
return Math.min(scrollTo, Math.max(totalHeight - containerHeight, 0));
|
|
23041
|
+
}
|
|
23042
|
+
|
|
23043
|
+
// src/components/input/autocomplete/AutocompleteList.tsx
|
|
23012
23044
|
import { Fragment as Fragment27, jsx as jsx124, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
23013
23045
|
var AUTOCOMPLETE_ITEM_HEIGHT = 44;
|
|
23014
23046
|
var AutocompleteList = function AutocompleteList2({
|
|
@@ -23022,16 +23054,17 @@ var AutocompleteList = function AutocompleteList2({
|
|
|
23022
23054
|
selectedIndex,
|
|
23023
23055
|
highlightedIndex,
|
|
23024
23056
|
virtualListRef,
|
|
23025
|
-
listRef,
|
|
23026
23057
|
filteredOptions,
|
|
23027
23058
|
onAddSelectedValue,
|
|
23028
23059
|
onClickAwayPopover
|
|
23029
23060
|
}) {
|
|
23030
23061
|
const { t } = useTranslation();
|
|
23062
|
+
const listRef = React68.useRef(null);
|
|
23031
23063
|
const getText = (option) => {
|
|
23032
23064
|
const isInOptions = options.some((elem) => elem.id === option.id);
|
|
23033
23065
|
if (!isInOptions) {
|
|
23034
|
-
|
|
23066
|
+
const addedValueText = addNewValueText === void 0 ? `${t("AUTOCOMPLETE.ADD_NEW_VALUE")}` : addNewValueText;
|
|
23067
|
+
return `${addedValueText ? `${addedValueText}: ` : ""}${option.label}`;
|
|
23035
23068
|
}
|
|
23036
23069
|
return option.label;
|
|
23037
23070
|
};
|
|
@@ -23065,23 +23098,11 @@ var AutocompleteList = function AutocompleteList2({
|
|
|
23065
23098
|
},
|
|
23066
23099
|
text: getText(option),
|
|
23067
23100
|
onClick: (event) => onAddSelectedValue(event, option),
|
|
23068
|
-
"data-
|
|
23101
|
+
"data-testid": `autocomplete-option-${option.id}`
|
|
23069
23102
|
},
|
|
23070
23103
|
option.id
|
|
23071
23104
|
);
|
|
23072
23105
|
};
|
|
23073
|
-
const getInitialListScroll = () => {
|
|
23074
|
-
if (highlightedIndex > -1) {
|
|
23075
|
-
return highlightedIndex * AUTOCOMPLETE_ITEM_HEIGHT;
|
|
23076
|
-
}
|
|
23077
|
-
if (typeof selectedIndex === "number") {
|
|
23078
|
-
return selectedIndex * AUTOCOMPLETE_ITEM_HEIGHT;
|
|
23079
|
-
}
|
|
23080
|
-
if (Array.isArray(selectedIndex) && selectedIndex.length > 0) {
|
|
23081
|
-
return selectedIndex[selectedIndex.length - 1] * AUTOCOMPLETE_ITEM_HEIGHT;
|
|
23082
|
-
}
|
|
23083
|
-
return 0;
|
|
23084
|
-
};
|
|
23085
23106
|
return /* @__PURE__ */ jsx124(Fragment27, { children: /* @__PURE__ */ jsx124(
|
|
23086
23107
|
ClickAwayListener,
|
|
23087
23108
|
{
|
|
@@ -23132,7 +23153,15 @@ var AutocompleteList = function AutocompleteList2({
|
|
|
23132
23153
|
width: width2,
|
|
23133
23154
|
className: "Slim-Vertical-Scroll",
|
|
23134
23155
|
ref: virtualListRef,
|
|
23135
|
-
initialScrollOffset: getInitialListScroll(
|
|
23156
|
+
initialScrollOffset: getInitialListScroll(
|
|
23157
|
+
{
|
|
23158
|
+
itemHeight: AUTOCOMPLETE_ITEM_HEIGHT,
|
|
23159
|
+
containerHeight: listRef.current?.clientHeight ?? 0,
|
|
23160
|
+
highlightedIndex,
|
|
23161
|
+
selectedIndex,
|
|
23162
|
+
totalItems: filteredOptions.length
|
|
23163
|
+
}
|
|
23164
|
+
),
|
|
23136
23165
|
children: ListItemButtonWrapper
|
|
23137
23166
|
}
|
|
23138
23167
|
) })
|
|
@@ -23175,15 +23204,15 @@ var Autocomplete = function Autocomplete2({
|
|
|
23175
23204
|
onOpen = () => ({}),
|
|
23176
23205
|
disableClear
|
|
23177
23206
|
}) {
|
|
23178
|
-
const anchorRef =
|
|
23179
|
-
const inputRef =
|
|
23180
|
-
const [placeholder, setPlaceholder] =
|
|
23207
|
+
const anchorRef = React69.useRef(null);
|
|
23208
|
+
const inputRef = React69.useRef(null);
|
|
23209
|
+
const [placeholder, setPlaceholder] = React69.useState(
|
|
23181
23210
|
textFieldProps?.placeholder || ""
|
|
23182
23211
|
);
|
|
23183
|
-
const _renderLabel =
|
|
23184
|
-
const [inputValue, setInputValue] =
|
|
23185
|
-
const [isDirty, setDirty] =
|
|
23186
|
-
const getOptionsLabeled =
|
|
23212
|
+
const _renderLabel = React69.useCallback((id) => id, []);
|
|
23213
|
+
const [inputValue, setInputValue] = React69.useState("");
|
|
23214
|
+
const [isDirty, setDirty] = React69.useState(false);
|
|
23215
|
+
const getOptionsLabeled = React69.useCallback(
|
|
23187
23216
|
(options2, inputValue2 = "") => {
|
|
23188
23217
|
const searchValue = escapeRegExp2(inputValue2.trim());
|
|
23189
23218
|
const regExp = new RegExp(
|
|
@@ -23214,7 +23243,7 @@ var Autocomplete = function Autocomplete2({
|
|
|
23214
23243
|
renderLabel
|
|
23215
23244
|
]
|
|
23216
23245
|
);
|
|
23217
|
-
const getAllowFreeTextOption =
|
|
23246
|
+
const getAllowFreeTextOption = React69.useCallback(
|
|
23218
23247
|
(inputValue2) => {
|
|
23219
23248
|
if (allowFreeText) {
|
|
23220
23249
|
const freeOption = {
|
|
@@ -23232,28 +23261,27 @@ var Autocomplete = function Autocomplete2({
|
|
|
23232
23261
|
},
|
|
23233
23262
|
[_renderLabel, allowFreeText, options, renderLabel]
|
|
23234
23263
|
);
|
|
23235
|
-
const [filteredOptions, setFilteredOptions] =
|
|
23236
|
-
const
|
|
23237
|
-
const
|
|
23238
|
-
const [isOpenPopover, setOpenPopover] = React68.useState(false);
|
|
23264
|
+
const [filteredOptions, setFilteredOptions] = React69.useState(getOptionsLabeled([...options]));
|
|
23265
|
+
const virtualListRef = React69.createRef();
|
|
23266
|
+
const [isOpenPopover, setOpenPopover] = React69.useState(false);
|
|
23239
23267
|
const getSelectedIndexEmpty = () => multiple ? [] : void 0;
|
|
23240
|
-
const [selectedIndex, setSelectedIndex] =
|
|
23241
|
-
const [highlightedIndex, setHighlightedIndex] =
|
|
23242
|
-
|
|
23268
|
+
const [selectedIndex, setSelectedIndex] = React69.useState(getSelectedIndexEmpty());
|
|
23269
|
+
const [highlightedIndex, setHighlightedIndex] = React69.useState(-1);
|
|
23270
|
+
React69.useEffect(() => {
|
|
23243
23271
|
setFilteredOptions(getOptionsLabeled([...options]));
|
|
23244
23272
|
}, [options]);
|
|
23245
23273
|
const canAddValues = maxValues === void 0 || maxValues === 0 || !!multiple && Array.isArray(value) && value.length < maxValues;
|
|
23246
|
-
|
|
23274
|
+
React69.useEffect(() => {
|
|
23247
23275
|
if (disabled) {
|
|
23248
23276
|
setOpenPopover(false);
|
|
23249
23277
|
}
|
|
23250
23278
|
}, [disabled]);
|
|
23251
|
-
|
|
23279
|
+
React69.useEffect(() => {
|
|
23252
23280
|
if (!canAddValues && isOpenPopover) {
|
|
23253
23281
|
closePopover();
|
|
23254
23282
|
}
|
|
23255
23283
|
}, [canAddValues, isOpenPopover]);
|
|
23256
|
-
const getLastSelectedIndex =
|
|
23284
|
+
const getLastSelectedIndex = React69.useCallback(() => {
|
|
23257
23285
|
if (Array.isArray(selectedIndex) && selectedIndex.length > 0) {
|
|
23258
23286
|
return selectedIndex[selectedIndex.length - 1];
|
|
23259
23287
|
} else if (typeof selectedIndex === "number") {
|
|
@@ -23261,7 +23289,7 @@ var Autocomplete = function Autocomplete2({
|
|
|
23261
23289
|
}
|
|
23262
23290
|
return void 0;
|
|
23263
23291
|
}, [selectedIndex]);
|
|
23264
|
-
|
|
23292
|
+
React69.useEffect(() => {
|
|
23265
23293
|
if (isOpenPopover) {
|
|
23266
23294
|
if (highlightedIndex > -1) {
|
|
23267
23295
|
virtualListRef.current?.scrollToItem(highlightedIndex);
|
|
@@ -23508,7 +23536,6 @@ var Autocomplete = function Autocomplete2({
|
|
|
23508
23536
|
filteredOptions,
|
|
23509
23537
|
isOpen: isOpenPopover,
|
|
23510
23538
|
virtualListRef,
|
|
23511
|
-
listRef,
|
|
23512
23539
|
addNewValueText,
|
|
23513
23540
|
isLoading,
|
|
23514
23541
|
loadingText,
|
|
@@ -23537,7 +23564,7 @@ function elementIsDescendantOrEqual(parent2, descendant) {
|
|
|
23537
23564
|
}
|
|
23538
23565
|
|
|
23539
23566
|
// src/components/input/TextEditor.tsx
|
|
23540
|
-
import
|
|
23567
|
+
import React72 from "react";
|
|
23541
23568
|
import { Editor } from "@tinymce/tinymce-react";
|
|
23542
23569
|
import "tinymce/tinymce";
|
|
23543
23570
|
import "tinymce/models/dom/model";
|
|
@@ -23558,10 +23585,10 @@ import "tinymce/plugins/wordcount";
|
|
|
23558
23585
|
import "tinymce/plugins/emoticons/js/emojis";
|
|
23559
23586
|
|
|
23560
23587
|
// src/components/input/CodeEditorPopup.tsx
|
|
23561
|
-
import
|
|
23588
|
+
import React71 from "react";
|
|
23562
23589
|
|
|
23563
23590
|
// src/components/input/CodeEditor.tsx
|
|
23564
|
-
import
|
|
23591
|
+
import React70 from "react";
|
|
23565
23592
|
import CodeMirror, {
|
|
23566
23593
|
EditorView
|
|
23567
23594
|
} from "@uiw/react-codemirror";
|
|
@@ -23604,7 +23631,7 @@ var CodeEditor = function CodeEditor2({
|
|
|
23604
23631
|
}
|
|
23605
23632
|
);
|
|
23606
23633
|
};
|
|
23607
|
-
var CodeEditor_default =
|
|
23634
|
+
var CodeEditor_default = React70.forwardRef(CodeEditor);
|
|
23608
23635
|
|
|
23609
23636
|
// src/components/input/CodeEditorPopup.tsx
|
|
23610
23637
|
import format from "html-format";
|
|
@@ -23624,9 +23651,9 @@ var CodeEditorPopup = ({
|
|
|
23624
23651
|
onCancel
|
|
23625
23652
|
}) => {
|
|
23626
23653
|
const { t } = useTranslation();
|
|
23627
|
-
const [valueModified, setValueModified] =
|
|
23628
|
-
const [hasErrors, setHasErrors] =
|
|
23629
|
-
|
|
23654
|
+
const [valueModified, setValueModified] = React71.useState(value);
|
|
23655
|
+
const [hasErrors, setHasErrors] = React71.useState(false);
|
|
23656
|
+
React71.useEffect(() => {
|
|
23630
23657
|
if (open) {
|
|
23631
23658
|
setValueModified(value);
|
|
23632
23659
|
}
|
|
@@ -23856,15 +23883,15 @@ var TextEditor = function TextEditor2({
|
|
|
23856
23883
|
...rest
|
|
23857
23884
|
}) {
|
|
23858
23885
|
const { t } = useTranslation();
|
|
23859
|
-
const editorRef =
|
|
23860
|
-
const [internalValue] =
|
|
23886
|
+
const editorRef = React72.useRef(null);
|
|
23887
|
+
const [internalValue] = React72.useState(
|
|
23861
23888
|
initialValue ?? t("TEXT_EDITOR.INITIAL_VALUE")
|
|
23862
23889
|
);
|
|
23863
|
-
const [contentValue, setContentValue] =
|
|
23864
|
-
const [codeEditorChanges, setCodeEditorChanges] =
|
|
23865
|
-
const [isCodeEditorDirty, setIsCodeEditorDirty] =
|
|
23866
|
-
const [isCodeEditorOpened, setIsCodeEditorOpened] =
|
|
23867
|
-
const [isDirty, setIsDirty] =
|
|
23890
|
+
const [contentValue, setContentValue] = React72.useState("");
|
|
23891
|
+
const [codeEditorChanges, setCodeEditorChanges] = React72.useState("");
|
|
23892
|
+
const [isCodeEditorDirty, setIsCodeEditorDirty] = React72.useState(false);
|
|
23893
|
+
const [isCodeEditorOpened, setIsCodeEditorOpened] = React72.useState(false);
|
|
23894
|
+
const [isDirty, setIsDirty] = React72.useState(false);
|
|
23868
23895
|
const codeEditorButtonIndexToUse = codeEditorButtonIndex ?? customToolbarGroups.insert?.items?.length ?? DEFAULT_TOOLBAR_INSERT_MENU_ITEMS.length;
|
|
23869
23896
|
const defaultToolbarInsertMenuItemsWithCodeEditor = DEFAULT_TOOLBAR_INSERT_MENU_ITEMS.slice();
|
|
23870
23897
|
defaultToolbarInsertMenuItemsWithCodeEditor.splice(
|
|
@@ -23878,12 +23905,12 @@ var TextEditor = function TextEditor2({
|
|
|
23878
23905
|
0,
|
|
23879
23906
|
"cnCodeEditor"
|
|
23880
23907
|
);
|
|
23881
|
-
const onTextChange =
|
|
23908
|
+
const onTextChange = React72.useCallback(() => {
|
|
23882
23909
|
if (editorRef.current) {
|
|
23883
23910
|
onChange(editorRef.current?.getContent());
|
|
23884
23911
|
}
|
|
23885
23912
|
}, [onChange]);
|
|
23886
|
-
const onTextEditorDirty =
|
|
23913
|
+
const onTextEditorDirty = React72.useCallback(
|
|
23887
23914
|
(textEditorDirty) => {
|
|
23888
23915
|
editorRef.current?.setDirty(textEditorDirty);
|
|
23889
23916
|
setIsDirty(textEditorDirty);
|
|
@@ -23896,7 +23923,7 @@ var TextEditor = function TextEditor2({
|
|
|
23896
23923
|
},
|
|
23897
23924
|
[onDirty, onTextChange]
|
|
23898
23925
|
);
|
|
23899
|
-
|
|
23926
|
+
React72.useEffect(() => {
|
|
23900
23927
|
if (resetDirty && editorRef.current?.isDirty()) {
|
|
23901
23928
|
onTextEditorDirty(false);
|
|
23902
23929
|
}
|
|
@@ -23904,7 +23931,7 @@ var TextEditor = function TextEditor2({
|
|
|
23904
23931
|
onResetDirty();
|
|
23905
23932
|
}
|
|
23906
23933
|
}, [onResetDirty, onTextEditorDirty, resetDirty]);
|
|
23907
|
-
|
|
23934
|
+
React72.useEffect(() => {
|
|
23908
23935
|
if (newValue && editorRef.current) {
|
|
23909
23936
|
editorRef.current.setContent(newValue);
|
|
23910
23937
|
if (onNewValueSetter) {
|
|
@@ -23912,7 +23939,7 @@ var TextEditor = function TextEditor2({
|
|
|
23912
23939
|
}
|
|
23913
23940
|
}
|
|
23914
23941
|
}, [newValue, onNewValueSetter]);
|
|
23915
|
-
|
|
23942
|
+
React72.useEffect(() => {
|
|
23916
23943
|
if (forceCloseCodeEditor) {
|
|
23917
23944
|
setIsCodeEditorOpened(false);
|
|
23918
23945
|
if (onForceCloseCodeEditor) {
|
|
@@ -24159,10 +24186,10 @@ var TextEditor = function TextEditor2({
|
|
|
24159
24186
|
var TextEditor_default = TextEditor;
|
|
24160
24187
|
|
|
24161
24188
|
// src/components/input/PhoneField.tsx
|
|
24162
|
-
import * as
|
|
24189
|
+
import * as React73 from "react";
|
|
24163
24190
|
import { Fragment as Fragment31, jsx as jsx129, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
24164
24191
|
var maxPhoneLengthWithPrefix = 16;
|
|
24165
|
-
var PhoneField =
|
|
24192
|
+
var PhoneField = React73.forwardRef(function PhoneField2({
|
|
24166
24193
|
value,
|
|
24167
24194
|
onChange,
|
|
24168
24195
|
defaultCountryCode = "34",
|
|
@@ -24170,20 +24197,20 @@ var PhoneField = React72.forwardRef(function PhoneField2({
|
|
|
24170
24197
|
codeSelectProps,
|
|
24171
24198
|
...rest
|
|
24172
24199
|
}, ref) {
|
|
24173
|
-
const [countryCode, setCountryCode] =
|
|
24174
|
-
const [textValue, setTextValue] =
|
|
24175
|
-
const countryCodeOptions =
|
|
24200
|
+
const [countryCode, setCountryCode] = React73.useState(defaultCountryCode);
|
|
24201
|
+
const [textValue, setTextValue] = React73.useState("");
|
|
24202
|
+
const countryCodeOptions = React73.useMemo(
|
|
24176
24203
|
() => allCountries.map((c) => ({
|
|
24177
24204
|
value: c.countryCode,
|
|
24178
24205
|
label: `+${c.countryCode} ${c.name}`
|
|
24179
24206
|
})),
|
|
24180
24207
|
[]
|
|
24181
24208
|
);
|
|
24182
|
-
const sanitizeTextValue =
|
|
24209
|
+
const sanitizeTextValue = React73.useCallback(
|
|
24183
24210
|
(value2) => value2.replace(/[^\d]/g, ""),
|
|
24184
24211
|
[]
|
|
24185
24212
|
);
|
|
24186
|
-
const onChangeText =
|
|
24213
|
+
const onChangeText = React73.useCallback(
|
|
24187
24214
|
(event) => {
|
|
24188
24215
|
const sanitizedTextValue = sanitizeTextValue(
|
|
24189
24216
|
event.target.value
|
|
@@ -24197,7 +24224,7 @@ var PhoneField = React72.forwardRef(function PhoneField2({
|
|
|
24197
24224
|
},
|
|
24198
24225
|
[countryCode, onChange, sanitizeTextValue, textValue]
|
|
24199
24226
|
);
|
|
24200
|
-
const onChangeCountryCode =
|
|
24227
|
+
const onChangeCountryCode = React73.useCallback(
|
|
24201
24228
|
(countryCode2) => {
|
|
24202
24229
|
const sanitizedTextValue = sanitizeTextValue(textValue).substring(
|
|
24203
24230
|
0,
|
|
@@ -24213,7 +24240,7 @@ var PhoneField = React72.forwardRef(function PhoneField2({
|
|
|
24213
24240
|
},
|
|
24214
24241
|
[onChange, sanitizeTextValue, textValue]
|
|
24215
24242
|
);
|
|
24216
|
-
|
|
24243
|
+
React73.useEffect(() => {
|
|
24217
24244
|
const countryCode2 = getCountryCode(value);
|
|
24218
24245
|
if (!countryCode2) {
|
|
24219
24246
|
setTextValue("");
|
|
@@ -24258,7 +24285,7 @@ var PhoneField = React72.forwardRef(function PhoneField2({
|
|
|
24258
24285
|
var PhoneField_default = PhoneField;
|
|
24259
24286
|
|
|
24260
24287
|
// src/components/input/NumberField.tsx
|
|
24261
|
-
import * as
|
|
24288
|
+
import * as React74 from "react";
|
|
24262
24289
|
import { jsx as jsx130, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
24263
24290
|
var setValueAndTriggerChangeEvent = (r2, value) => {
|
|
24264
24291
|
const propDescriptor = Object.getOwnPropertyDescriptor(
|
|
@@ -24275,7 +24302,7 @@ var setValueAndTriggerChangeEvent = (r2, value) => {
|
|
|
24275
24302
|
r2.current.dispatchEvent(e);
|
|
24276
24303
|
}
|
|
24277
24304
|
};
|
|
24278
|
-
var NumberField =
|
|
24305
|
+
var NumberField = React74.forwardRef(function NumberField2({
|
|
24279
24306
|
value,
|
|
24280
24307
|
type = "integer",
|
|
24281
24308
|
onChange,
|
|
@@ -24291,16 +24318,16 @@ var NumberField = React73.forwardRef(function NumberField2({
|
|
|
24291
24318
|
endAdornment,
|
|
24292
24319
|
...rest
|
|
24293
24320
|
}, ref) {
|
|
24294
|
-
const inputRef =
|
|
24295
|
-
const numberToString =
|
|
24321
|
+
const inputRef = React74.useRef(null);
|
|
24322
|
+
const numberToString = React74.useCallback(
|
|
24296
24323
|
(value2) => typeof value2 === "number" && !isNaN(value2) ? fractionDigits !== 0 ? value2.toFixed(fractionDigits) : value2.toString() : "",
|
|
24297
24324
|
[fractionDigits]
|
|
24298
24325
|
);
|
|
24299
|
-
const stringToNumber =
|
|
24326
|
+
const stringToNumber = React74.useCallback(
|
|
24300
24327
|
(value2) => !value2 || isNaN(+value2) ? null : +value2,
|
|
24301
24328
|
[]
|
|
24302
24329
|
);
|
|
24303
|
-
const sanitizeDecimalTextValue =
|
|
24330
|
+
const sanitizeDecimalTextValue = React74.useCallback(
|
|
24304
24331
|
(value2) => {
|
|
24305
24332
|
const negativeSign = value2.charAt(0) === "-" ? "-" : "";
|
|
24306
24333
|
const numbersAndDots = value2.replace(/[^\d.]/g, "");
|
|
@@ -24312,7 +24339,7 @@ var NumberField = React73.forwardRef(function NumberField2({
|
|
|
24312
24339
|
},
|
|
24313
24340
|
[fractionDigits]
|
|
24314
24341
|
);
|
|
24315
|
-
const sanitizeIntegerTextValue =
|
|
24342
|
+
const sanitizeIntegerTextValue = React74.useCallback(
|
|
24316
24343
|
(value2) => {
|
|
24317
24344
|
const negativeSign = value2.charAt(0) === "-" ? "-" : "";
|
|
24318
24345
|
const numbers = value2.replace(/[^\d]/g, "");
|
|
@@ -24320,7 +24347,7 @@ var NumberField = React73.forwardRef(function NumberField2({
|
|
|
24320
24347
|
},
|
|
24321
24348
|
[]
|
|
24322
24349
|
);
|
|
24323
|
-
const _onChange =
|
|
24350
|
+
const _onChange = React74.useCallback(
|
|
24324
24351
|
(event) => {
|
|
24325
24352
|
const sanitizedTextValue = type === "integer" ? sanitizeIntegerTextValue(event.target.value) : sanitizeDecimalTextValue(event.target.value);
|
|
24326
24353
|
let numericValue = stringToNumber(sanitizedTextValue);
|
|
@@ -24350,7 +24377,7 @@ var NumberField = React73.forwardRef(function NumberField2({
|
|
|
24350
24377
|
numberToString
|
|
24351
24378
|
]
|
|
24352
24379
|
);
|
|
24353
|
-
const stepUp =
|
|
24380
|
+
const stepUp = React74.useCallback(() => {
|
|
24354
24381
|
if (typeof value === "number" && !isNaN(value)) {
|
|
24355
24382
|
setValueAndTriggerChangeEvent(
|
|
24356
24383
|
ref ?? inputRef,
|
|
@@ -24363,7 +24390,7 @@ var NumberField = React73.forwardRef(function NumberField2({
|
|
|
24363
24390
|
);
|
|
24364
24391
|
}
|
|
24365
24392
|
}, [numberToString, ref, step, value]);
|
|
24366
|
-
const stepDown =
|
|
24393
|
+
const stepDown = React74.useCallback(() => {
|
|
24367
24394
|
if (typeof value === "number" && !isNaN(value)) {
|
|
24368
24395
|
setValueAndTriggerChangeEvent(
|
|
24369
24396
|
ref ?? inputRef,
|
|
@@ -24376,7 +24403,7 @@ var NumberField = React73.forwardRef(function NumberField2({
|
|
|
24376
24403
|
);
|
|
24377
24404
|
}
|
|
24378
24405
|
}, [numberToString, ref, step, value]);
|
|
24379
|
-
const _onKeyDown =
|
|
24406
|
+
const _onKeyDown = React74.useCallback(
|
|
24380
24407
|
(event) => {
|
|
24381
24408
|
onKeyDown && onKeyDown(event);
|
|
24382
24409
|
if (step <= 0) {
|
|
@@ -24395,8 +24422,8 @@ var NumberField = React73.forwardRef(function NumberField2({
|
|
|
24395
24422
|
},
|
|
24396
24423
|
[onKeyDown, step, stepDown, stepUp]
|
|
24397
24424
|
);
|
|
24398
|
-
const [textValue, setTextValue] =
|
|
24399
|
-
const _onBlur =
|
|
24425
|
+
const [textValue, setTextValue] = React74.useState(numberToString(value));
|
|
24426
|
+
const _onBlur = React74.useCallback(
|
|
24400
24427
|
(event) => {
|
|
24401
24428
|
onBlur && onBlur(event);
|
|
24402
24429
|
const text = numberToString(value);
|
|
@@ -24458,7 +24485,7 @@ var NumberField = React73.forwardRef(function NumberField2({
|
|
|
24458
24485
|
}
|
|
24459
24486
|
)
|
|
24460
24487
|
] }) : endAdornment;
|
|
24461
|
-
|
|
24488
|
+
React74.useEffect(() => {
|
|
24462
24489
|
if (stringToNumber(textValue) !== value) {
|
|
24463
24490
|
setTextValue(numberToString(value));
|
|
24464
24491
|
}
|
|
@@ -24479,11 +24506,11 @@ var NumberField = React73.forwardRef(function NumberField2({
|
|
|
24479
24506
|
var NumberField_default = NumberField;
|
|
24480
24507
|
|
|
24481
24508
|
// src/components/input/DatePicker.tsx
|
|
24482
|
-
import * as
|
|
24509
|
+
import * as React76 from "react";
|
|
24483
24510
|
import { tz as tz8 } from "moment-timezone";
|
|
24484
24511
|
|
|
24485
24512
|
// src/components/input/DatePickerStatic.tsx
|
|
24486
|
-
import * as
|
|
24513
|
+
import * as React75 from "react";
|
|
24487
24514
|
import { tz as tz7 } from "moment-timezone";
|
|
24488
24515
|
import { jsx as jsx131, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
24489
24516
|
var minYear = 1900;
|
|
@@ -24494,13 +24521,13 @@ var DatePickerStatic = ({
|
|
|
24494
24521
|
minDate,
|
|
24495
24522
|
maxDate
|
|
24496
24523
|
}) => {
|
|
24497
|
-
const { timezone } =
|
|
24498
|
-
const [selectedDateParts, setSelectedDateParts] =
|
|
24499
|
-
const [visibleMonth, setVisibleMonth] =
|
|
24524
|
+
const { timezone } = React75.useContext(IntlContext);
|
|
24525
|
+
const [selectedDateParts, setSelectedDateParts] = React75.useState(void 0);
|
|
24526
|
+
const [visibleMonth, setVisibleMonth] = React75.useState({
|
|
24500
24527
|
year: minYear,
|
|
24501
24528
|
month: 0
|
|
24502
24529
|
});
|
|
24503
|
-
|
|
24530
|
+
React75.useEffect(() => {
|
|
24504
24531
|
if (selectedDateParts) {
|
|
24505
24532
|
setVisibleMonth({
|
|
24506
24533
|
year: selectedDateParts.year,
|
|
@@ -24514,7 +24541,7 @@ var DatePickerStatic = ({
|
|
|
24514
24541
|
});
|
|
24515
24542
|
}
|
|
24516
24543
|
}, [selectedDateParts, timezone]);
|
|
24517
|
-
|
|
24544
|
+
React75.useEffect(() => {
|
|
24518
24545
|
if (!value || isNaN(value.getTime())) {
|
|
24519
24546
|
setSelectedDateParts(void 0);
|
|
24520
24547
|
return;
|
|
@@ -24536,25 +24563,25 @@ var DatePickerStatic = ({
|
|
|
24536
24563
|
const endYear = maxDate && !isNaN(maxDate.getTime()) ? maxDate.getFullYear() : maxYear;
|
|
24537
24564
|
const startMonth = minDate && !isNaN(minDate.getTime()) ? minDate.getMonth() : 0;
|
|
24538
24565
|
const endMonth = maxDate && !isNaN(maxDate.getTime()) ? maxDate.getMonth() : 11;
|
|
24539
|
-
const options =
|
|
24566
|
+
const options = React75.useMemo(
|
|
24540
24567
|
() => Array.from(Array(endYear - startYear + 1)).map((_, i) => ({
|
|
24541
24568
|
value: startYear + i
|
|
24542
24569
|
})),
|
|
24543
24570
|
[endYear, startYear]
|
|
24544
24571
|
);
|
|
24545
|
-
const navigatePreviousMonth =
|
|
24572
|
+
const navigatePreviousMonth = React75.useCallback(() => {
|
|
24546
24573
|
setVisibleMonth({
|
|
24547
24574
|
month: visibleMonth.month === 0 ? 11 : visibleMonth.month - 1,
|
|
24548
24575
|
year: visibleMonth.month === 0 ? visibleMonth.year - 1 : visibleMonth.year
|
|
24549
24576
|
});
|
|
24550
24577
|
}, [visibleMonth]);
|
|
24551
|
-
const navigateNextMonth =
|
|
24578
|
+
const navigateNextMonth = React75.useCallback(() => {
|
|
24552
24579
|
setVisibleMonth({
|
|
24553
24580
|
month: visibleMonth.month === 11 ? 0 : visibleMonth.month + 1,
|
|
24554
24581
|
year: visibleMonth.month === 11 ? visibleMonth.year + 1 : visibleMonth.year
|
|
24555
24582
|
});
|
|
24556
24583
|
}, [visibleMonth]);
|
|
24557
|
-
const onChangeYear =
|
|
24584
|
+
const onChangeYear = React75.useCallback(
|
|
24558
24585
|
(value2) => {
|
|
24559
24586
|
const month = value2 === startYear ? Math.max(startMonth, visibleMonth.month) : value2 === endYear ? Math.min(endMonth, visibleMonth.month) : visibleMonth.month;
|
|
24560
24587
|
setVisibleMonth({
|
|
@@ -24564,11 +24591,11 @@ var DatePickerStatic = ({
|
|
|
24564
24591
|
},
|
|
24565
24592
|
[endMonth, endYear, startMonth, startYear, visibleMonth.month]
|
|
24566
24593
|
);
|
|
24567
|
-
const minSimpleDate =
|
|
24594
|
+
const minSimpleDate = React75.useMemo(
|
|
24568
24595
|
() => dateToSimpleDate(minDate, timezone),
|
|
24569
24596
|
[minDate, timezone]
|
|
24570
24597
|
);
|
|
24571
|
-
const maxSimpleDate =
|
|
24598
|
+
const maxSimpleDate = React75.useMemo(
|
|
24572
24599
|
() => dateToSimpleDate(maxDate, timezone),
|
|
24573
24600
|
[maxDate, timezone]
|
|
24574
24601
|
);
|
|
@@ -24680,18 +24707,18 @@ var DatePickerPopover_default = DatePickerPopover;
|
|
|
24680
24707
|
|
|
24681
24708
|
// src/components/input/DatePicker.tsx
|
|
24682
24709
|
import { Fragment as Fragment32, jsx as jsx133, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
24683
|
-
var DatePicker =
|
|
24710
|
+
var DatePicker = React76.forwardRef(
|
|
24684
24711
|
function DatePicker2({ value, onChange, onBlur, onKeyDown, minDate, maxDate, ...rest }, ref) {
|
|
24685
|
-
const { locale, timezone } =
|
|
24712
|
+
const { locale, timezone } = React76.useContext(IntlContext);
|
|
24686
24713
|
const dateInputFormat = getDateInputFormatForLocale(locale);
|
|
24687
24714
|
const { t } = useTranslation();
|
|
24688
|
-
const dateInputFormatPlaceholder =
|
|
24715
|
+
const dateInputFormatPlaceholder = React76.useMemo(
|
|
24689
24716
|
() => 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")),
|
|
24690
24717
|
[dateInputFormat, t]
|
|
24691
24718
|
);
|
|
24692
|
-
const _containerRef =
|
|
24693
|
-
const [isPopoverOpen, setPopoverOpen] =
|
|
24694
|
-
const [textValue, setTextValue] =
|
|
24719
|
+
const _containerRef = React76.useRef(null);
|
|
24720
|
+
const [isPopoverOpen, setPopoverOpen] = React76.useState(false);
|
|
24721
|
+
const [textValue, setTextValue] = React76.useState("");
|
|
24695
24722
|
let anchorEl = null;
|
|
24696
24723
|
if (isPopoverOpen) {
|
|
24697
24724
|
if (rest.containerRef && typeof rest.containerRef === "object" && rest.containerRef.current) {
|
|
@@ -24700,21 +24727,21 @@ var DatePicker = React75.forwardRef(
|
|
|
24700
24727
|
anchorEl = _containerRef.current;
|
|
24701
24728
|
}
|
|
24702
24729
|
}
|
|
24703
|
-
const isValidDate =
|
|
24730
|
+
const isValidDate = React76.useCallback(
|
|
24704
24731
|
(dateString) => {
|
|
24705
24732
|
const date = parseDateForLocale(dateString, locale, timezone);
|
|
24706
24733
|
return !isNaN(date.getTime()) && (!minDate || date >= minDate) && (!maxDate || date <= maxDate);
|
|
24707
24734
|
},
|
|
24708
24735
|
[locale, maxDate, minDate, timezone]
|
|
24709
24736
|
);
|
|
24710
|
-
const onSelect =
|
|
24737
|
+
const onSelect = React76.useCallback(
|
|
24711
24738
|
(date) => {
|
|
24712
24739
|
setPopoverOpen(false);
|
|
24713
24740
|
onChange && onChange(date);
|
|
24714
24741
|
},
|
|
24715
24742
|
[onChange]
|
|
24716
24743
|
);
|
|
24717
|
-
const onChangeTextField =
|
|
24744
|
+
const onChangeTextField = React76.useCallback(
|
|
24718
24745
|
(event) => {
|
|
24719
24746
|
setTextValue(event.target.value);
|
|
24720
24747
|
if (!event.target.value && value) {
|
|
@@ -24733,7 +24760,7 @@ var DatePicker = React75.forwardRef(
|
|
|
24733
24760
|
},
|
|
24734
24761
|
[isValidDate, locale, onChange, timezone, value]
|
|
24735
24762
|
);
|
|
24736
|
-
const onBlurTextField =
|
|
24763
|
+
const onBlurTextField = React76.useCallback(
|
|
24737
24764
|
(event) => {
|
|
24738
24765
|
if (!isValidDate(event.target.value)) {
|
|
24739
24766
|
value ? onChange && onChange(null) : setTextValue("");
|
|
@@ -24742,7 +24769,7 @@ var DatePicker = React75.forwardRef(
|
|
|
24742
24769
|
},
|
|
24743
24770
|
[isValidDate, onChange, onBlur, value]
|
|
24744
24771
|
);
|
|
24745
|
-
const onKeyDownTextField =
|
|
24772
|
+
const onKeyDownTextField = React76.useCallback(
|
|
24746
24773
|
(event) => {
|
|
24747
24774
|
if (event.key === "ArrowDown") {
|
|
24748
24775
|
setPopoverOpen(true);
|
|
@@ -24751,7 +24778,7 @@ var DatePicker = React75.forwardRef(
|
|
|
24751
24778
|
},
|
|
24752
24779
|
[onKeyDown]
|
|
24753
24780
|
);
|
|
24754
|
-
|
|
24781
|
+
React76.useEffect(() => {
|
|
24755
24782
|
const text = value && !isNaN(value.getTime()) ? tz8(value, timezone).format(dateInputFormat) : "";
|
|
24756
24783
|
setTextValue(text);
|
|
24757
24784
|
}, [dateInputFormat, timezone, value]);
|
|
@@ -24870,11 +24897,11 @@ var Checkbox = ({
|
|
|
24870
24897
|
var Checkbox_default = Checkbox;
|
|
24871
24898
|
|
|
24872
24899
|
// src/components/input/Radio.tsx
|
|
24873
|
-
import * as
|
|
24900
|
+
import * as React77 from "react";
|
|
24874
24901
|
import MuiRadio from "@mui/material/Radio";
|
|
24875
24902
|
import { FormControlLabel as FormControlLabel2 } from "@mui/material";
|
|
24876
24903
|
import { Fragment as Fragment34, jsx as jsx135, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
24877
|
-
var Radio =
|
|
24904
|
+
var Radio = React77.forwardRef(function Radio2({
|
|
24878
24905
|
label,
|
|
24879
24906
|
labelPlacement = "end",
|
|
24880
24907
|
onChange,
|
|
@@ -24885,7 +24912,7 @@ var Radio = React76.forwardRef(function Radio2({
|
|
|
24885
24912
|
size = "M",
|
|
24886
24913
|
...rest
|
|
24887
24914
|
}, ref) {
|
|
24888
|
-
const _onChange =
|
|
24915
|
+
const _onChange = React77.useCallback(
|
|
24889
24916
|
(event) => {
|
|
24890
24917
|
onChange && onChange(event, event.target.value);
|
|
24891
24918
|
},
|
|
@@ -24929,7 +24956,7 @@ var Radio = React76.forwardRef(function Radio2({
|
|
|
24929
24956
|
var Radio_default = Radio;
|
|
24930
24957
|
|
|
24931
24958
|
// src/components/input/PageSelector.tsx
|
|
24932
|
-
import * as
|
|
24959
|
+
import * as React78 from "react";
|
|
24933
24960
|
import { jsx as jsx136, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
24934
24961
|
var PageSelector = ({
|
|
24935
24962
|
currentPage,
|
|
@@ -24938,12 +24965,12 @@ var PageSelector = ({
|
|
|
24938
24965
|
text,
|
|
24939
24966
|
onPageChange
|
|
24940
24967
|
}) => {
|
|
24941
|
-
const handlePrevious =
|
|
24968
|
+
const handlePrevious = React78.useCallback(() => {
|
|
24942
24969
|
if (currentPage > 1) {
|
|
24943
24970
|
onPageChange(Math.max(1, currentPage - 1));
|
|
24944
24971
|
}
|
|
24945
24972
|
}, [currentPage, onPageChange]);
|
|
24946
|
-
const handleNext =
|
|
24973
|
+
const handleNext = React78.useCallback(() => {
|
|
24947
24974
|
onPageChange(
|
|
24948
24975
|
Math.min(Math.ceil(totalItems / pageSize), currentPage + 1)
|
|
24949
24976
|
);
|
|
@@ -25041,7 +25068,7 @@ var LinearProgress = ({
|
|
|
25041
25068
|
var LinearProgress_default = LinearProgress;
|
|
25042
25069
|
|
|
25043
25070
|
// src/components/progress/CircularProgress.tsx
|
|
25044
|
-
import * as
|
|
25071
|
+
import * as React79 from "react";
|
|
25045
25072
|
import MuiCircularProgress from "@mui/material/CircularProgress";
|
|
25046
25073
|
import Typography3 from "@mui/material/Typography";
|
|
25047
25074
|
import Box4 from "@mui/material/Box";
|
|
@@ -25067,7 +25094,7 @@ var CircularProgress = ({
|
|
|
25067
25094
|
typographyColor = black,
|
|
25068
25095
|
gradientColors
|
|
25069
25096
|
}) => {
|
|
25070
|
-
const gradientName =
|
|
25097
|
+
const gradientName = React79.useRef(
|
|
25071
25098
|
gradientColors ? crypto.randomUUID() : void 0
|
|
25072
25099
|
);
|
|
25073
25100
|
return /* @__PURE__ */ jsxs71(
|
|
@@ -25358,7 +25385,7 @@ var Loader = ({
|
|
|
25358
25385
|
var Loader_default = Loader;
|
|
25359
25386
|
|
|
25360
25387
|
// src/components/markdown/MarkdownRenderer.tsx
|
|
25361
|
-
import
|
|
25388
|
+
import React80 from "react";
|
|
25362
25389
|
import Markdown from "markdown-to-jsx";
|
|
25363
25390
|
import { styled as styled8 } from "@mui/material/styles";
|
|
25364
25391
|
import "katex/dist/katex.min.css";
|
|
@@ -25501,12 +25528,12 @@ var renderWithMath = (text) => {
|
|
|
25501
25528
|
}
|
|
25502
25529
|
return parts;
|
|
25503
25530
|
};
|
|
25504
|
-
var renderChildrenWithMath = (children) =>
|
|
25531
|
+
var renderChildrenWithMath = (children) => React80.Children.map(children, (child) => {
|
|
25505
25532
|
if (typeof child === "string") {
|
|
25506
25533
|
return renderWithMath(child);
|
|
25507
25534
|
}
|
|
25508
|
-
if (
|
|
25509
|
-
return
|
|
25535
|
+
if (React80.isValidElement(child)) {
|
|
25536
|
+
return React80.cloneElement(child, {
|
|
25510
25537
|
...child.props,
|
|
25511
25538
|
children: renderChildrenWithMath(child.props.children)
|
|
25512
25539
|
});
|
|
@@ -25623,10 +25650,10 @@ var Navbar = ({
|
|
|
25623
25650
|
var Navbar_default = Navbar;
|
|
25624
25651
|
|
|
25625
25652
|
// src/components/navbar/NavbarButton.tsx
|
|
25626
|
-
import * as
|
|
25653
|
+
import * as React81 from "react";
|
|
25627
25654
|
import { Box as Box6, ButtonBase as ButtonBase2 } from "@mui/material";
|
|
25628
25655
|
import { jsx as jsx144, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
25629
|
-
var NavbarButton =
|
|
25656
|
+
var NavbarButton = React81.forwardRef(
|
|
25630
25657
|
function NavbarButton2({
|
|
25631
25658
|
iconId,
|
|
25632
25659
|
srcUrl,
|
|
@@ -25636,6 +25663,7 @@ var NavbarButton = React80.forwardRef(
|
|
|
25636
25663
|
highlighted = false,
|
|
25637
25664
|
...rest
|
|
25638
25665
|
}, ref) {
|
|
25666
|
+
const { palette: palette2 } = useCustomTheme();
|
|
25639
25667
|
const getButtonContent = (element) => {
|
|
25640
25668
|
if (!highlighted) {
|
|
25641
25669
|
return element;
|
|
@@ -25644,7 +25672,7 @@ var NavbarButton = React80.forwardRef(
|
|
|
25644
25672
|
Box6,
|
|
25645
25673
|
{
|
|
25646
25674
|
sx: {
|
|
25647
|
-
backgroundImage: `linear-gradient(to left, ${cornflowerBlue}, ${electricLavender})`,
|
|
25675
|
+
backgroundImage: `linear-gradient(to left, ${palette2.cornflowerBlue}, ${palette2.electricLavender})`,
|
|
25648
25676
|
padding: "2px",
|
|
25649
25677
|
borderRadius: "100%",
|
|
25650
25678
|
position: "relative"
|
|
@@ -25657,9 +25685,9 @@ var NavbarButton = React80.forwardRef(
|
|
|
25657
25685
|
position: "absolute",
|
|
25658
25686
|
width: "8px",
|
|
25659
25687
|
height: "8px",
|
|
25660
|
-
background:
|
|
25688
|
+
background: palette2.primary.main,
|
|
25661
25689
|
borderRadius: "100%",
|
|
25662
|
-
border: `4px solid ${white}`,
|
|
25690
|
+
border: `4px solid ${palette2.common.white}`,
|
|
25663
25691
|
right: "-2px",
|
|
25664
25692
|
top: "1px",
|
|
25665
25693
|
boxSizing: "content-box"
|
|
@@ -25670,7 +25698,7 @@ var NavbarButton = React80.forwardRef(
|
|
|
25670
25698
|
Box6,
|
|
25671
25699
|
{
|
|
25672
25700
|
sx: {
|
|
25673
|
-
backgroundColor: white,
|
|
25701
|
+
backgroundColor: palette2.common.white,
|
|
25674
25702
|
borderRadius: "100%",
|
|
25675
25703
|
padding: "2px"
|
|
25676
25704
|
},
|
|
@@ -25692,8 +25720,8 @@ var NavbarButton = React80.forwardRef(
|
|
|
25692
25720
|
width: "100%",
|
|
25693
25721
|
height: "44px",
|
|
25694
25722
|
"&:hover > .NavbarButton-icon": {
|
|
25695
|
-
backgroundColor:
|
|
25696
|
-
color:
|
|
25723
|
+
backgroundColor: palette2.grey[100],
|
|
25724
|
+
color: palette2.primary.main
|
|
25697
25725
|
},
|
|
25698
25726
|
...sx
|
|
25699
25727
|
},
|
|
@@ -25717,10 +25745,10 @@ var NavbarButton = React80.forwardRef(
|
|
|
25717
25745
|
sx: {
|
|
25718
25746
|
boxSizing: "initial",
|
|
25719
25747
|
padding: "8px",
|
|
25720
|
-
color: isActive ?
|
|
25748
|
+
color: isActive ? palette2.primary.main : palette2.grey[700],
|
|
25721
25749
|
borderRadius: "50%",
|
|
25722
25750
|
overflow: "visible",
|
|
25723
|
-
backgroundColor: isActive ?
|
|
25751
|
+
backgroundColor: isActive ? palette2.primary.opacity32 : "transparent"
|
|
25724
25752
|
}
|
|
25725
25753
|
}
|
|
25726
25754
|
)
|
|
@@ -25731,7 +25759,7 @@ var NavbarButton = React80.forwardRef(
|
|
|
25731
25759
|
...badgeIconProps,
|
|
25732
25760
|
className: `NavbarButton-badge ${badgeIconProps.className}`,
|
|
25733
25761
|
sx: {
|
|
25734
|
-
color:
|
|
25762
|
+
color: palette2.primary.main,
|
|
25735
25763
|
position: "absolute",
|
|
25736
25764
|
bottom: 0,
|
|
25737
25765
|
right: "8px",
|
|
@@ -25768,10 +25796,10 @@ var NavbarHeader = ({ text }) => /* @__PURE__ */ jsx145(
|
|
|
25768
25796
|
var NavbarHeader_default = NavbarHeader;
|
|
25769
25797
|
|
|
25770
25798
|
// src/components/navbar/NavbarLogo.tsx
|
|
25771
|
-
import * as
|
|
25799
|
+
import * as React82 from "react";
|
|
25772
25800
|
import { ButtonBase as ButtonBase3 } from "@mui/material";
|
|
25773
25801
|
import { jsx as jsx146 } from "react/jsx-runtime";
|
|
25774
|
-
var NavbarLogo =
|
|
25802
|
+
var NavbarLogo = React82.forwardRef(
|
|
25775
25803
|
function NavbarButton3({ src, ...rest }, ref) {
|
|
25776
25804
|
return /* @__PURE__ */ jsx146(
|
|
25777
25805
|
ButtonBase3,
|
|
@@ -25792,7 +25820,7 @@ var NavbarLogo = React81.forwardRef(
|
|
|
25792
25820
|
var NavbarLogo_default = NavbarLogo;
|
|
25793
25821
|
|
|
25794
25822
|
// src/components/overlay/DonutFocusOverlay.tsx
|
|
25795
|
-
import * as
|
|
25823
|
+
import * as React83 from "react";
|
|
25796
25824
|
import { Fragment as Fragment36, jsx as jsx147, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
25797
25825
|
var DonutFocusOverlay = ({
|
|
25798
25826
|
isVisible,
|
|
@@ -25802,8 +25830,8 @@ var DonutFocusOverlay = ({
|
|
|
25802
25830
|
chipLabel,
|
|
25803
25831
|
chipPosition = "right"
|
|
25804
25832
|
}) => {
|
|
25805
|
-
const [clientRect, setClientRect] =
|
|
25806
|
-
|
|
25833
|
+
const [clientRect, setClientRect] = React83.useState();
|
|
25834
|
+
React83.useEffect(() => {
|
|
25807
25835
|
if (!elementRef?.current) {
|
|
25808
25836
|
setClientRect(void 0);
|
|
25809
25837
|
return;
|
|
@@ -25952,17 +25980,17 @@ var Pager_default = Pager;
|
|
|
25952
25980
|
|
|
25953
25981
|
// src/components/scrollable/HorizontalScrollable.tsx
|
|
25954
25982
|
import { ButtonBase as ButtonBase4 } from "@mui/material";
|
|
25955
|
-
import * as
|
|
25983
|
+
import * as React84 from "react";
|
|
25956
25984
|
import { jsx as jsx149, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
25957
25985
|
var HorizontalScrollable = ({
|
|
25958
25986
|
style: style3,
|
|
25959
25987
|
children,
|
|
25960
25988
|
stepDistance = 200
|
|
25961
25989
|
}) => {
|
|
25962
|
-
const horizontalContainerRef =
|
|
25963
|
-
const [isLeftArrowHidden, setLeftArrowHidden] =
|
|
25964
|
-
const [isRightArrowHidden, setRightArrowHidden] =
|
|
25965
|
-
|
|
25990
|
+
const horizontalContainerRef = React84.useRef(null);
|
|
25991
|
+
const [isLeftArrowHidden, setLeftArrowHidden] = React84.useState(true);
|
|
25992
|
+
const [isRightArrowHidden, setRightArrowHidden] = React84.useState(true);
|
|
25993
|
+
React84.useEffect(() => {
|
|
25966
25994
|
if (!horizontalContainerRef.current) {
|
|
25967
25995
|
return;
|
|
25968
25996
|
}
|
|
@@ -26067,7 +26095,7 @@ var HorizontalScrollable = ({
|
|
|
26067
26095
|
var HorizontalScrollable_default = HorizontalScrollable;
|
|
26068
26096
|
|
|
26069
26097
|
// src/components/scrollable/Carousel.tsx
|
|
26070
|
-
import * as
|
|
26098
|
+
import * as React85 from "react";
|
|
26071
26099
|
import { jsx as jsx150, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
26072
26100
|
var buttonStyles = {
|
|
26073
26101
|
color: grey800,
|
|
@@ -26086,24 +26114,24 @@ function Carousel({
|
|
|
26086
26114
|
gap: gap2 = 8,
|
|
26087
26115
|
padding: padding2 = 8
|
|
26088
26116
|
}) {
|
|
26089
|
-
const rootRef =
|
|
26090
|
-
const containerRef =
|
|
26091
|
-
const previousClientWidth =
|
|
26092
|
-
const isScrolling =
|
|
26093
|
-
const [isLeftArrowHidden, setLeftArrowHidden] =
|
|
26094
|
-
const [isRightArrowHidden, setRightArrowHidden] =
|
|
26095
|
-
const [paddingElement, setPaddingElement] =
|
|
26096
|
-
const [visibleCount, setVisibleCount] =
|
|
26097
|
-
const showedElementsRef =
|
|
26098
|
-
const [showedElements, setShowedElements] =
|
|
26099
|
-
const updateArrows =
|
|
26117
|
+
const rootRef = React85.useRef(null);
|
|
26118
|
+
const containerRef = React85.useRef(null);
|
|
26119
|
+
const previousClientWidth = React85.useRef(null);
|
|
26120
|
+
const isScrolling = React85.useRef(false);
|
|
26121
|
+
const [isLeftArrowHidden, setLeftArrowHidden] = React85.useState(true);
|
|
26122
|
+
const [isRightArrowHidden, setRightArrowHidden] = React85.useState(true);
|
|
26123
|
+
const [paddingElement, setPaddingElement] = React85.useState();
|
|
26124
|
+
const [visibleCount, setVisibleCount] = React85.useState();
|
|
26125
|
+
const showedElementsRef = React85.useRef();
|
|
26126
|
+
const [showedElements, setShowedElements] = React85.useState();
|
|
26127
|
+
const updateArrows = React85.useCallback(() => {
|
|
26100
26128
|
if (!showedElementsRef.current) {
|
|
26101
26129
|
return;
|
|
26102
26130
|
}
|
|
26103
26131
|
setLeftArrowHidden(showedElementsRef.current.start === 0);
|
|
26104
26132
|
setRightArrowHidden(showedElementsRef.current.end === items.length - 1);
|
|
26105
26133
|
}, [items.length]);
|
|
26106
|
-
const getUsableWidth =
|
|
26134
|
+
const getUsableWidth = React85.useCallback(
|
|
26107
26135
|
(el) => {
|
|
26108
26136
|
let current = el;
|
|
26109
26137
|
while (current) {
|
|
@@ -26117,7 +26145,7 @@ function Carousel({
|
|
|
26117
26145
|
},
|
|
26118
26146
|
[]
|
|
26119
26147
|
);
|
|
26120
|
-
const resetCarousel =
|
|
26148
|
+
const resetCarousel = React85.useCallback(
|
|
26121
26149
|
(root, container) => {
|
|
26122
26150
|
root.style.width = "";
|
|
26123
26151
|
showedElementsRef.current = void 0;
|
|
@@ -26126,7 +26154,7 @@ function Carousel({
|
|
|
26126
26154
|
},
|
|
26127
26155
|
[]
|
|
26128
26156
|
);
|
|
26129
|
-
const setMeasures =
|
|
26157
|
+
const setMeasures = React85.useCallback(
|
|
26130
26158
|
(root, container, nextElementsIndex) => {
|
|
26131
26159
|
const children = Array.from(container.children);
|
|
26132
26160
|
if (children.length === 0) {
|
|
@@ -26155,7 +26183,7 @@ function Carousel({
|
|
|
26155
26183
|
},
|
|
26156
26184
|
[gap2, getUsableWidth, items.length, padding2]
|
|
26157
26185
|
);
|
|
26158
|
-
const updateVisibleCount =
|
|
26186
|
+
const updateVisibleCount = React85.useCallback(() => {
|
|
26159
26187
|
const root = rootRef.current;
|
|
26160
26188
|
const container = containerRef.current;
|
|
26161
26189
|
if (!container || !parent) {
|
|
@@ -26201,7 +26229,7 @@ function Carousel({
|
|
|
26201
26229
|
updateArrows,
|
|
26202
26230
|
resetCarousel
|
|
26203
26231
|
]);
|
|
26204
|
-
const getInitialWidth =
|
|
26232
|
+
const getInitialWidth = React85.useCallback(
|
|
26205
26233
|
(el) => {
|
|
26206
26234
|
let current = el;
|
|
26207
26235
|
let width2 = 0;
|
|
@@ -26219,7 +26247,7 @@ function Carousel({
|
|
|
26219
26247
|
},
|
|
26220
26248
|
[]
|
|
26221
26249
|
);
|
|
26222
|
-
const resizeObserverCallback =
|
|
26250
|
+
const resizeObserverCallback = React85.useCallback(() => {
|
|
26223
26251
|
if (!rootRef.current || !containerRef.current) {
|
|
26224
26252
|
return;
|
|
26225
26253
|
}
|
|
@@ -26230,7 +26258,7 @@ function Carousel({
|
|
|
26230
26258
|
previousClientWidth.current = newClientWidth;
|
|
26231
26259
|
updateVisibleCount();
|
|
26232
26260
|
}, [getInitialWidth, updateVisibleCount]);
|
|
26233
|
-
|
|
26261
|
+
React85.useEffect(() => {
|
|
26234
26262
|
const container = containerRef.current;
|
|
26235
26263
|
if (!container) {
|
|
26236
26264
|
return;
|
|
@@ -26423,7 +26451,7 @@ import {
|
|
|
26423
26451
|
} from "notistack";
|
|
26424
26452
|
|
|
26425
26453
|
// src/components/snackbar/Snackbar.tsx
|
|
26426
|
-
import * as
|
|
26454
|
+
import * as React86 from "react";
|
|
26427
26455
|
import { SnackbarContent } from "notistack";
|
|
26428
26456
|
import { Typography as Typography4 } from "@mui/material";
|
|
26429
26457
|
import { jsx as jsx152, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
@@ -26451,7 +26479,7 @@ var iconColors = {
|
|
|
26451
26479
|
error: error300,
|
|
26452
26480
|
warning: complementary300
|
|
26453
26481
|
};
|
|
26454
|
-
var Snackbar =
|
|
26482
|
+
var Snackbar = React86.forwardRef(
|
|
26455
26483
|
function Snackbar2({
|
|
26456
26484
|
severity = "info",
|
|
26457
26485
|
message,
|
|
@@ -26463,10 +26491,10 @@ var Snackbar = React85.forwardRef(
|
|
|
26463
26491
|
identifierKey: key,
|
|
26464
26492
|
dataTestKey
|
|
26465
26493
|
}, ref) {
|
|
26466
|
-
const actionClickHandler =
|
|
26494
|
+
const actionClickHandler = React86.useCallback(() => {
|
|
26467
26495
|
onActionClick && onActionClick(key);
|
|
26468
26496
|
}, [onActionClick, key]);
|
|
26469
|
-
const closeClickHandler =
|
|
26497
|
+
const closeClickHandler = React86.useCallback(() => {
|
|
26470
26498
|
onCloseClick && onCloseClick(key);
|
|
26471
26499
|
}, [onCloseClick, key]);
|
|
26472
26500
|
return /* @__PURE__ */ jsx152(
|
|
@@ -26632,12 +26660,12 @@ var TabButton = ({
|
|
|
26632
26660
|
var TabButton_default = TabButton;
|
|
26633
26661
|
|
|
26634
26662
|
// src/components/tab/Tabs.tsx
|
|
26635
|
-
import * as
|
|
26663
|
+
import * as React88 from "react";
|
|
26636
26664
|
import MuiTabs from "@mui/material/Tabs";
|
|
26637
26665
|
|
|
26638
26666
|
// src/components/layout/SwipeableViews.tsx
|
|
26639
|
-
import * as
|
|
26640
|
-
import { useEffect as
|
|
26667
|
+
import * as React87 from "react";
|
|
26668
|
+
import { useEffect as useEffect22, useRef as useRef26, useState as useState34 } from "react";
|
|
26641
26669
|
import { jsx as jsx155 } from "react/jsx-runtime";
|
|
26642
26670
|
var styles = {
|
|
26643
26671
|
container: {
|
|
@@ -26671,12 +26699,12 @@ function SwipeableViews({
|
|
|
26671
26699
|
disableScroll = false,
|
|
26672
26700
|
...rootProps
|
|
26673
26701
|
}) {
|
|
26674
|
-
const containerRef =
|
|
26675
|
-
const scrollTimeout =
|
|
26676
|
-
const scrollingMethod =
|
|
26702
|
+
const containerRef = useRef26(null);
|
|
26703
|
+
const scrollTimeout = useRef26();
|
|
26704
|
+
const scrollingMethod = useRef26("none");
|
|
26677
26705
|
const [previousIndex, setPreviousIndex] = useState34(index);
|
|
26678
|
-
const hideScrollAnimation =
|
|
26679
|
-
|
|
26706
|
+
const hideScrollAnimation = useRef26(true);
|
|
26707
|
+
useEffect22(() => {
|
|
26680
26708
|
if (containerRef.current) {
|
|
26681
26709
|
if (scrollingMethod.current === "manual") {
|
|
26682
26710
|
scrollingMethod.current = "none";
|
|
@@ -26736,9 +26764,9 @@ function SwipeableViews({
|
|
|
26736
26764
|
);
|
|
26737
26765
|
}, 100);
|
|
26738
26766
|
},
|
|
26739
|
-
children:
|
|
26767
|
+
children: React87.Children.map(children, (child, childIndex) => {
|
|
26740
26768
|
let mountedChild = false;
|
|
26741
|
-
if (
|
|
26769
|
+
if (React87.isValidElement(child)) {
|
|
26742
26770
|
mountedChild = !!child.props.keepMounted;
|
|
26743
26771
|
}
|
|
26744
26772
|
return /* @__PURE__ */ jsx155(
|
|
@@ -26781,8 +26809,8 @@ var Tabs = ({
|
|
|
26781
26809
|
hideLineTabs = false,
|
|
26782
26810
|
backgroundScrollButtons = Colors_exports.white
|
|
26783
26811
|
}) => {
|
|
26784
|
-
const tabsRef =
|
|
26785
|
-
const [value, setValue] =
|
|
26812
|
+
const tabsRef = React88.useRef(null);
|
|
26813
|
+
const [value, setValue] = React88.useState(0);
|
|
26786
26814
|
const measureTextWidthRange = (child) => {
|
|
26787
26815
|
const walker = document.createTreeWalker(child, NodeFilter.SHOW_TEXT, {
|
|
26788
26816
|
acceptNode: (node) => node.textContent?.trim() ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_REJECT
|
|
@@ -26796,7 +26824,7 @@ var Tabs = ({
|
|
|
26796
26824
|
const rect = range.getBoundingClientRect();
|
|
26797
26825
|
return Math.round(rect.width);
|
|
26798
26826
|
};
|
|
26799
|
-
const waitForSmoothScrollEnd =
|
|
26827
|
+
const waitForSmoothScrollEnd = React88.useCallback(
|
|
26800
26828
|
(container, onEnd) => {
|
|
26801
26829
|
let prev = container.scrollLeft;
|
|
26802
26830
|
let idleFrames = 0;
|
|
@@ -26820,7 +26848,7 @@ var Tabs = ({
|
|
|
26820
26848
|
},
|
|
26821
26849
|
[]
|
|
26822
26850
|
);
|
|
26823
|
-
const calculateIndicatorTabWidth =
|
|
26851
|
+
const calculateIndicatorTabWidth = React88.useCallback((index) => {
|
|
26824
26852
|
if (!tabsRef.current) {
|
|
26825
26853
|
return null;
|
|
26826
26854
|
}
|
|
@@ -26839,7 +26867,7 @@ var Tabs = ({
|
|
|
26839
26867
|
indicator.style.width = `${textWidth}px`;
|
|
26840
26868
|
indicator.style.left = `${left}px`;
|
|
26841
26869
|
}, []);
|
|
26842
|
-
|
|
26870
|
+
React88.useEffect(() => {
|
|
26843
26871
|
if (!tabsRef.current) {
|
|
26844
26872
|
return;
|
|
26845
26873
|
}
|
|
@@ -27046,12 +27074,12 @@ var TableCell = ({
|
|
|
27046
27074
|
var TableCell_default = TableCell;
|
|
27047
27075
|
|
|
27048
27076
|
// src/components/table/TableCellCopy.tsx
|
|
27049
|
-
import * as
|
|
27077
|
+
import * as React89 from "react";
|
|
27050
27078
|
import { jsx as jsx163 } from "react/jsx-runtime";
|
|
27051
27079
|
var TableCellCopy = ({ text, textToCopy, ...rest }) => {
|
|
27052
27080
|
const { t } = useTranslation();
|
|
27053
|
-
const [isCopied, setIsCopied] =
|
|
27054
|
-
const [showIcon, setShowIcon] =
|
|
27081
|
+
const [isCopied, setIsCopied] = React89.useState(false);
|
|
27082
|
+
const [showIcon, setShowIcon] = React89.useState(false);
|
|
27055
27083
|
const manageButtonClicked = () => {
|
|
27056
27084
|
void navigator.clipboard.writeText(textToCopy ?? text);
|
|
27057
27085
|
if (isCopied) {
|
|
@@ -27186,9 +27214,9 @@ var ToolbarBreadcrumb_default = ToolbarBreadcrumb;
|
|
|
27186
27214
|
|
|
27187
27215
|
// src/components/toolbar/ToolbarBreadcrumbButton.tsx
|
|
27188
27216
|
import { ButtonBase as ButtonBase5 } from "@mui/material";
|
|
27189
|
-
import * as
|
|
27217
|
+
import * as React90 from "react";
|
|
27190
27218
|
import { jsx as jsx168 } from "react/jsx-runtime";
|
|
27191
|
-
var ToolbarBreadcrumbButton =
|
|
27219
|
+
var ToolbarBreadcrumbButton = React90.forwardRef(function ToolbarBreadcrumbButton2({ text, className, ...rest }, ref) {
|
|
27192
27220
|
return /* @__PURE__ */ jsx168(
|
|
27193
27221
|
ButtonBase5,
|
|
27194
27222
|
{
|
|
@@ -27300,17 +27328,17 @@ var Toolbar = ({
|
|
|
27300
27328
|
var Toolbar_default = Toolbar;
|
|
27301
27329
|
|
|
27302
27330
|
// src/components/toolbar/ToolbarTitle.tsx
|
|
27303
|
-
import * as
|
|
27331
|
+
import * as React91 from "react";
|
|
27304
27332
|
import { useState as useState37 } from "react";
|
|
27305
27333
|
import { jsx as jsx170, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
27306
|
-
var ToolbarTitle =
|
|
27334
|
+
var ToolbarTitle = React91.forwardRef(function ToolbarTitle2({
|
|
27307
27335
|
title,
|
|
27308
27336
|
align = "left",
|
|
27309
27337
|
className,
|
|
27310
27338
|
hoverActions,
|
|
27311
27339
|
color: color2 = grey900
|
|
27312
27340
|
}, ref) {
|
|
27313
|
-
const textElementRef =
|
|
27341
|
+
const textElementRef = React91.useRef(null);
|
|
27314
27342
|
const [showHoverActions, setShowHoverActions] = useState37(false);
|
|
27315
27343
|
return /* @__PURE__ */ jsx170(Box_default2, { sx: { maxWidth: "100%" }, children: /* @__PURE__ */ jsx170(
|
|
27316
27344
|
TextEllipsisTooltip_default,
|
|
@@ -27552,7 +27580,7 @@ var WidgetTitle = ({ children, sx, multiline = false }) => children ? /* @__PURE
|
|
|
27552
27580
|
var WidgetTitle_default = WidgetTitle;
|
|
27553
27581
|
|
|
27554
27582
|
// src/components/window/MinimizableWindow.tsx
|
|
27555
|
-
import * as
|
|
27583
|
+
import * as React92 from "react";
|
|
27556
27584
|
import { Fragment as Fragment38, jsx as jsx175, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
27557
27585
|
var sizes6 = {
|
|
27558
27586
|
M: 400,
|
|
@@ -27578,7 +27606,7 @@ var iconButtonsStyles = {
|
|
|
27578
27606
|
backgroundColor: "rgba(255, 255, 255, 0.2)"
|
|
27579
27607
|
}
|
|
27580
27608
|
};
|
|
27581
|
-
var MinimizableWindow =
|
|
27609
|
+
var MinimizableWindow = React92.forwardRef(function MinimizableWindow2({
|
|
27582
27610
|
children,
|
|
27583
27611
|
title,
|
|
27584
27612
|
size = "M",
|
|
@@ -27598,17 +27626,17 @@ var MinimizableWindow = React91.forwardRef(function MinimizableWindow2({
|
|
|
27598
27626
|
onBack
|
|
27599
27627
|
}, ref) {
|
|
27600
27628
|
const { t } = useTranslation();
|
|
27601
|
-
const overlayRef =
|
|
27602
|
-
const windowRef =
|
|
27603
|
-
const headerRef =
|
|
27604
|
-
const [isDraggingState, setIsDraggingState] =
|
|
27605
|
-
const diffRef =
|
|
27606
|
-
|
|
27629
|
+
const overlayRef = React92.useRef(null);
|
|
27630
|
+
const windowRef = React92.useRef(null);
|
|
27631
|
+
const headerRef = React92.useRef(null);
|
|
27632
|
+
const [isDraggingState, setIsDraggingState] = React92.useState(false);
|
|
27633
|
+
const diffRef = React92.useRef({ x: 0, y: 0 });
|
|
27634
|
+
React92.useImperativeHandle(ref, () => ({
|
|
27607
27635
|
window: windowRef.current,
|
|
27608
27636
|
header: headerRef.current,
|
|
27609
27637
|
overlay: overlayRef.current
|
|
27610
27638
|
}));
|
|
27611
|
-
|
|
27639
|
+
React92.useEffect(() => {
|
|
27612
27640
|
if (open) {
|
|
27613
27641
|
overlayRef.current?.style.removeProperty("transform");
|
|
27614
27642
|
overlayRef.current?.style.removeProperty("opacity");
|
|
@@ -27836,31 +27864,31 @@ var MinimizableWindow = React91.forwardRef(function MinimizableWindow2({
|
|
|
27836
27864
|
var MinimizableWindow_default = MinimizableWindow;
|
|
27837
27865
|
|
|
27838
27866
|
// src/hooks/useFormatters.ts
|
|
27839
|
-
import { useCallback as
|
|
27867
|
+
import { useCallback as useCallback23, useContext as useContext16 } from "react";
|
|
27840
27868
|
var useFormatters = () => {
|
|
27841
27869
|
const { locale, currency, timezone } = useContext16(IntlContext);
|
|
27842
27870
|
return {
|
|
27843
|
-
formatCompactNumber:
|
|
27871
|
+
formatCompactNumber: useCallback23(
|
|
27844
27872
|
(value) => formatCompactNumber(value, locale),
|
|
27845
27873
|
[locale]
|
|
27846
27874
|
),
|
|
27847
|
-
formatNumber:
|
|
27875
|
+
formatNumber: useCallback23(
|
|
27848
27876
|
(value, fractionSize) => formatNumber(value, locale, fractionSize),
|
|
27849
27877
|
[locale]
|
|
27850
27878
|
),
|
|
27851
|
-
formatPercentage:
|
|
27879
|
+
formatPercentage: useCallback23(
|
|
27852
27880
|
(value, fractionSize) => formatPercentage(value, locale, fractionSize),
|
|
27853
27881
|
[locale]
|
|
27854
27882
|
),
|
|
27855
|
-
formatCurrency:
|
|
27883
|
+
formatCurrency: useCallback23(
|
|
27856
27884
|
(value, notation) => formatCurrency(value, locale, currency, notation),
|
|
27857
27885
|
[currency, locale]
|
|
27858
27886
|
),
|
|
27859
|
-
formatDate:
|
|
27887
|
+
formatDate: useCallback23(
|
|
27860
27888
|
(date, format2) => formatDate(date, locale, timezone, format2),
|
|
27861
27889
|
[locale, timezone]
|
|
27862
27890
|
),
|
|
27863
|
-
formatPhone:
|
|
27891
|
+
formatPhone: useCallback23(
|
|
27864
27892
|
(phone, format2) => formatPhone(phone, format2),
|
|
27865
27893
|
[]
|
|
27866
27894
|
)
|