@connectif/ui-components 4.0.0 → 4.0.2
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 +19 -0
- package/dist/components/button/IconButton.d.ts +8 -0
- package/dist/components/button/MenuIconButton.d.ts +1 -0
- package/dist/components/chip/Chip.d.ts +8 -0
- package/dist/components/chip/ChipViewer.d.ts +3 -5
- package/dist/components/input/autocomplete/AutocompleteInput.d.ts +3 -3
- package/dist/components/input/autocomplete/AutocompleteInputSelection.d.ts +5 -8
- package/dist/index.js +280 -223
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -8466,6 +8466,7 @@ var IconButton = React11.forwardRef(function IconButton2({
|
|
|
8466
8466
|
sx,
|
|
8467
8467
|
className = "",
|
|
8468
8468
|
"data-test": dataTest,
|
|
8469
|
+
disableInteractionEffects = false,
|
|
8469
8470
|
...props
|
|
8470
8471
|
}, ref) {
|
|
8471
8472
|
const colorStyle = colorStyles[variant];
|
|
@@ -8481,8 +8482,32 @@ var IconButton = React11.forwardRef(function IconButton2({
|
|
|
8481
8482
|
{
|
|
8482
8483
|
className: `Cn-IconButton ${className}`,
|
|
8483
8484
|
ref,
|
|
8485
|
+
...disableInteractionEffects && {
|
|
8486
|
+
disableRipple: true,
|
|
8487
|
+
disableFocusRipple: true,
|
|
8488
|
+
disableTouchRipple: true
|
|
8489
|
+
},
|
|
8484
8490
|
...props,
|
|
8485
|
-
sx: {
|
|
8491
|
+
sx: {
|
|
8492
|
+
...colorStyle,
|
|
8493
|
+
...sizeStyle,
|
|
8494
|
+
...shapeStyle,
|
|
8495
|
+
...disableInteractionEffects && {
|
|
8496
|
+
"&:hover": {
|
|
8497
|
+
backgroundColor: "transparent"
|
|
8498
|
+
},
|
|
8499
|
+
"&:active": {
|
|
8500
|
+
backgroundColor: "transparent"
|
|
8501
|
+
},
|
|
8502
|
+
"&.Mui-focusVisible": {
|
|
8503
|
+
backgroundColor: "transparent"
|
|
8504
|
+
},
|
|
8505
|
+
"& .MuiTouchRipple-root": {
|
|
8506
|
+
display: "none"
|
|
8507
|
+
}
|
|
8508
|
+
},
|
|
8509
|
+
...sx
|
|
8510
|
+
},
|
|
8486
8511
|
...dataTest && {
|
|
8487
8512
|
"data-test": dataTest
|
|
8488
8513
|
},
|
|
@@ -11181,6 +11206,7 @@ var Chip = React28.forwardRef(function Chip2({
|
|
|
11181
11206
|
avatarProps,
|
|
11182
11207
|
href,
|
|
11183
11208
|
tooltip,
|
|
11209
|
+
disableDeleteRipple = false,
|
|
11184
11210
|
onMouseDownDelete,
|
|
11185
11211
|
...rest
|
|
11186
11212
|
}, ref) {
|
|
@@ -11215,7 +11241,8 @@ var Chip = React28.forwardRef(function Chip2({
|
|
|
11215
11241
|
},
|
|
11216
11242
|
size,
|
|
11217
11243
|
onClick: onDelete,
|
|
11218
|
-
onMouseDown: onMouseDownDelete
|
|
11244
|
+
onMouseDown: onMouseDownDelete,
|
|
11245
|
+
disableInteractionEffects: disableDeleteRipple
|
|
11219
11246
|
}
|
|
11220
11247
|
)
|
|
11221
11248
|
] });
|
|
@@ -11402,7 +11429,7 @@ var CardTable = ({ rows }) => /* @__PURE__ */ jsx60(Box_default2, { sx: { p: "0
|
|
|
11402
11429
|
var CardTable_default = CardTable;
|
|
11403
11430
|
|
|
11404
11431
|
// src/components/card/EnhancedCard.tsx
|
|
11405
|
-
import { Stack as
|
|
11432
|
+
import { Stack as Stack5 } from "@mui/material";
|
|
11406
11433
|
import * as React31 from "react";
|
|
11407
11434
|
|
|
11408
11435
|
// src/components/chip/MenuChip.tsx
|
|
@@ -11591,8 +11618,10 @@ var ChipContainer = ({
|
|
|
11591
11618
|
var ChipContainer_default = ChipContainer;
|
|
11592
11619
|
|
|
11593
11620
|
// src/components/chip/ChipViewer.tsx
|
|
11621
|
+
import { Stack as Stack4 } from "@mui/material";
|
|
11594
11622
|
import { jsx as jsx63 } from "react/jsx-runtime";
|
|
11595
11623
|
var CHIP_DATA_TEST_ID = "chip-viewer-chip";
|
|
11624
|
+
var CHIP_VIEWER_ROOT_ID = "chip-viewer-root";
|
|
11596
11625
|
var CHIPS_GAP = 4;
|
|
11597
11626
|
var ROW_HEIGHT = 24;
|
|
11598
11627
|
var chipViewerStyle = {
|
|
@@ -11618,43 +11647,87 @@ var ChipViewer = ({
|
|
|
11618
11647
|
variant = "circle",
|
|
11619
11648
|
preventHiddenChipsTooltip,
|
|
11620
11649
|
typographyVariant = "body2",
|
|
11621
|
-
|
|
11650
|
+
forceRecalculate = false,
|
|
11622
11651
|
renderChipLabel,
|
|
11623
11652
|
onRemoveChip,
|
|
11624
11653
|
onClickChip,
|
|
11625
11654
|
onHasHiddenChipsChange
|
|
11626
11655
|
}) => {
|
|
11656
|
+
const rootNodeRef = React30.useRef(null);
|
|
11627
11657
|
const containerRef = React30.useRef(null);
|
|
11628
11658
|
const lastDataCalculated = React30.useRef(null);
|
|
11629
11659
|
const [visibleChips, setVisibleChips] = React30.useState(values2);
|
|
11630
11660
|
const [hiddenChips, setHiddenChips] = React30.useState([]);
|
|
11661
|
+
const getContainerAndChipCloned = React30.useCallback(() => {
|
|
11662
|
+
if (!containerRef.current) {
|
|
11663
|
+
return;
|
|
11664
|
+
}
|
|
11665
|
+
const clonedContainer = containerRef.current.cloneNode(
|
|
11666
|
+
true
|
|
11667
|
+
);
|
|
11668
|
+
const clonedChip = clonedContainer.children[0];
|
|
11669
|
+
return { clonedContainer, clonedChip };
|
|
11670
|
+
}, []);
|
|
11671
|
+
const getChipLabel = React30.useCallback(
|
|
11672
|
+
(chipName, skipRenderLabel = false) => renderChipLabel && !skipRenderLabel ? renderChipLabel(chipName) : chipName,
|
|
11673
|
+
[renderChipLabel]
|
|
11674
|
+
);
|
|
11631
11675
|
const getChipWidthByContent = React30.useCallback(
|
|
11632
11676
|
(chipName, skipRenderLabel = false) => {
|
|
11633
|
-
const
|
|
11634
|
-
if (!
|
|
11677
|
+
const clonedData = getContainerAndChipCloned();
|
|
11678
|
+
if (!clonedData) {
|
|
11635
11679
|
return 0;
|
|
11636
11680
|
}
|
|
11637
|
-
const
|
|
11638
|
-
|
|
11639
|
-
);
|
|
11640
|
-
const chip = referenceContainer.children[0];
|
|
11641
|
-
const chipLabel = chip.querySelector(
|
|
11681
|
+
const { clonedContainer, clonedChip } = clonedData;
|
|
11682
|
+
const chipLabel = clonedChip.querySelector(
|
|
11642
11683
|
".MuiChip-label"
|
|
11643
11684
|
);
|
|
11644
|
-
chipLabel.textContent =
|
|
11645
|
-
|
|
11646
|
-
document.body.appendChild(
|
|
11647
|
-
if (
|
|
11648
|
-
|
|
11685
|
+
chipLabel.textContent = getChipLabel(chipName, skipRenderLabel);
|
|
11686
|
+
clonedContainer.style.width = containerRef.current?.offsetWidth + "px";
|
|
11687
|
+
document.body.appendChild(clonedContainer);
|
|
11688
|
+
if (clonedChip.parentElement) {
|
|
11689
|
+
clonedChip.parentElement.style.width = "auto";
|
|
11649
11690
|
}
|
|
11650
|
-
const { width: width2 } =
|
|
11651
|
-
document.body.removeChild(
|
|
11691
|
+
const { width: width2 } = clonedChip.getBoundingClientRect();
|
|
11692
|
+
document.body.removeChild(clonedContainer);
|
|
11652
11693
|
return width2;
|
|
11653
11694
|
},
|
|
11654
|
-
[
|
|
11695
|
+
[getChipLabel, getContainerAndChipCloned]
|
|
11655
11696
|
);
|
|
11697
|
+
const getRenderGhostChipsContainer = React30.useCallback(() => {
|
|
11698
|
+
const clonedData = getContainerAndChipCloned();
|
|
11699
|
+
if (!clonedData?.clonedChip) {
|
|
11700
|
+
return;
|
|
11701
|
+
}
|
|
11702
|
+
const { clonedContainer, clonedChip } = clonedData;
|
|
11703
|
+
clonedContainer.replaceChildren();
|
|
11704
|
+
values2.forEach((value) => {
|
|
11705
|
+
const newChip = clonedChip.cloneNode(true);
|
|
11706
|
+
const label = newChip.querySelector(
|
|
11707
|
+
".MuiChip-label"
|
|
11708
|
+
);
|
|
11709
|
+
if (label) {
|
|
11710
|
+
label.textContent = getChipLabel(value);
|
|
11711
|
+
}
|
|
11712
|
+
clonedContainer.appendChild(newChip);
|
|
11713
|
+
});
|
|
11714
|
+
return clonedContainer;
|
|
11715
|
+
}, [getChipLabel, getContainerAndChipCloned, values2]);
|
|
11716
|
+
const getMaxParentWidth = React30.useCallback(() => {
|
|
11717
|
+
if (!rootNodeRef.current) {
|
|
11718
|
+
return 0;
|
|
11719
|
+
}
|
|
11720
|
+
const clonedContainer = getRenderGhostChipsContainer();
|
|
11721
|
+
if (!clonedContainer) {
|
|
11722
|
+
return 0;
|
|
11723
|
+
}
|
|
11724
|
+
rootNodeRef.current.appendChild(clonedContainer);
|
|
11725
|
+
const parentWidth = rootNodeRef.current.parentElement ? rootNodeRef.current.parentElement.getBoundingClientRect().width : 0;
|
|
11726
|
+
rootNodeRef.current.removeChild(clonedContainer);
|
|
11727
|
+
return parentWidth;
|
|
11728
|
+
}, [getRenderGhostChipsContainer]);
|
|
11656
11729
|
const getVisibleChipsCounter = React30.useCallback(
|
|
11657
|
-
(chips,
|
|
11730
|
+
(chips, maxWidth2) => {
|
|
11658
11731
|
if (chips.length === 1) {
|
|
11659
11732
|
return 1;
|
|
11660
11733
|
}
|
|
@@ -11665,14 +11738,14 @@ var ChipViewer = ({
|
|
|
11665
11738
|
const widthChip = getChipWidthByContent(chip);
|
|
11666
11739
|
const widthGap = count > 0 ? widthChip + CHIPS_GAP : widthChip;
|
|
11667
11740
|
rowWidth += widthGap;
|
|
11668
|
-
if (rowWidth >
|
|
11741
|
+
if (rowWidth > maxWidth2) {
|
|
11669
11742
|
rows++;
|
|
11670
11743
|
if (rows > numberLines) {
|
|
11671
11744
|
const plusNumberWidth = getChipWidthByContent(
|
|
11672
11745
|
`+${chips.length - count}`,
|
|
11673
11746
|
true
|
|
11674
11747
|
);
|
|
11675
|
-
if (Math.ceil(rowWidth - widthChip + plusNumberWidth) >=
|
|
11748
|
+
if (Math.ceil(rowWidth - widthChip + plusNumberWidth) >= maxWidth2) {
|
|
11676
11749
|
count--;
|
|
11677
11750
|
}
|
|
11678
11751
|
break;
|
|
@@ -11710,8 +11783,8 @@ var ChipViewer = ({
|
|
|
11710
11783
|
return true;
|
|
11711
11784
|
};
|
|
11712
11785
|
const calculateVisibleChips = React30.useCallback(() => {
|
|
11713
|
-
const container =
|
|
11714
|
-
if (!container || areArraysEqual(lastDataCalculated.current?.chips ?? [], values2) && lastDataCalculated.current?.numberLines === numberLines && lastDataCalculated.current?.
|
|
11786
|
+
const container = rootNodeRef.current;
|
|
11787
|
+
if (!container || areArraysEqual(lastDataCalculated.current?.chips ?? [], values2) && lastDataCalculated.current?.numberLines === numberLines && lastDataCalculated.current?.forceRecalculate === forceRecalculate) {
|
|
11715
11788
|
return;
|
|
11716
11789
|
}
|
|
11717
11790
|
if (numberLines === 0) {
|
|
@@ -11720,7 +11793,7 @@ var ChipViewer = ({
|
|
|
11720
11793
|
lastDataCalculated.current = {
|
|
11721
11794
|
chips: values2,
|
|
11722
11795
|
numberLines,
|
|
11723
|
-
|
|
11796
|
+
forceRecalculate
|
|
11724
11797
|
};
|
|
11725
11798
|
return;
|
|
11726
11799
|
}
|
|
@@ -11730,18 +11803,16 @@ var ChipViewer = ({
|
|
|
11730
11803
|
lastDataCalculated.current = {
|
|
11731
11804
|
chips: values2,
|
|
11732
11805
|
numberLines,
|
|
11733
|
-
|
|
11806
|
+
forceRecalculate
|
|
11734
11807
|
};
|
|
11735
11808
|
return;
|
|
11736
11809
|
}
|
|
11737
|
-
const
|
|
11738
|
-
|
|
11739
|
-
maxWidth2 && maxWidth2 > 0 ? maxWidth2 : containerRef.current?.offsetWidth ?? 0
|
|
11740
|
-
);
|
|
11810
|
+
const maxParentWidth = getMaxParentWidth();
|
|
11811
|
+
const visibleChipsCount = maxParentWidth && maxParentWidth > 0 ? getVisibleChipsCounter(values2, maxParentWidth) : values2.length;
|
|
11741
11812
|
lastDataCalculated.current = {
|
|
11742
11813
|
chips: values2,
|
|
11743
11814
|
numberLines,
|
|
11744
|
-
|
|
11815
|
+
forceRecalculate
|
|
11745
11816
|
};
|
|
11746
11817
|
if (visibleChipsCount < values2.length) {
|
|
11747
11818
|
setVisibleChips(values2.slice(0, visibleChipsCount));
|
|
@@ -11753,8 +11824,9 @@ var ChipViewer = ({
|
|
|
11753
11824
|
}, [
|
|
11754
11825
|
values2,
|
|
11755
11826
|
numberLines,
|
|
11827
|
+
forceRecalculate,
|
|
11828
|
+
getMaxParentWidth,
|
|
11756
11829
|
getVisibleChipsCounter,
|
|
11757
|
-
maxWidth2,
|
|
11758
11830
|
updateHiddenChips
|
|
11759
11831
|
]);
|
|
11760
11832
|
React30.useLayoutEffect(() => {
|
|
@@ -11779,7 +11851,7 @@ var ChipViewer = ({
|
|
|
11779
11851
|
const getRenderChip = ({
|
|
11780
11852
|
chipName,
|
|
11781
11853
|
index,
|
|
11782
|
-
maxWidth:
|
|
11854
|
+
maxWidth: maxWidth2,
|
|
11783
11855
|
isCounterLabel
|
|
11784
11856
|
}) => /* @__PURE__ */ jsx63(
|
|
11785
11857
|
Chip_default,
|
|
@@ -11809,7 +11881,7 @@ var ChipViewer = ({
|
|
|
11809
11881
|
lines: 1,
|
|
11810
11882
|
typographyVariant,
|
|
11811
11883
|
text: renderChipLabel && !isCounterLabel ? renderChipLabel(chipName) : chipName,
|
|
11812
|
-
...
|
|
11884
|
+
...maxWidth2 && { maxWidth: maxWidth2 }
|
|
11813
11885
|
}
|
|
11814
11886
|
),
|
|
11815
11887
|
onClick: onClickChip ? () => onClickChip(chipName) : void 0,
|
|
@@ -11817,11 +11889,12 @@ var ChipViewer = ({
|
|
|
11817
11889
|
...onRemoveChip && {
|
|
11818
11890
|
onDelete: (event) => onRemoveChip(event, chipName)
|
|
11819
11891
|
},
|
|
11820
|
-
"data-testid": CHIP_DATA_TEST_ID
|
|
11892
|
+
"data-testid": CHIP_DATA_TEST_ID,
|
|
11893
|
+
disableDeleteRipple: true
|
|
11821
11894
|
},
|
|
11822
11895
|
`chip-${index}`
|
|
11823
11896
|
);
|
|
11824
|
-
return /* @__PURE__ */ jsx63(
|
|
11897
|
+
return /* @__PURE__ */ jsx63(Stack4, { ref: rootNodeRef, "data-testid": CHIP_VIEWER_ROOT_ID, children: /* @__PURE__ */ jsx63(
|
|
11825
11898
|
ChipContainer_default,
|
|
11826
11899
|
{
|
|
11827
11900
|
containerRef,
|
|
@@ -11837,7 +11910,7 @@ var ChipViewer = ({
|
|
|
11837
11910
|
isDeletable: !!onRemoveChip,
|
|
11838
11911
|
preventHiddenChipsTooltip
|
|
11839
11912
|
}
|
|
11840
|
-
);
|
|
11913
|
+
) });
|
|
11841
11914
|
};
|
|
11842
11915
|
var ChipViewer_default = ChipViewer;
|
|
11843
11916
|
|
|
@@ -12046,7 +12119,7 @@ var EnhancedCard = React31.forwardRef(
|
|
|
12046
12119
|
}
|
|
12047
12120
|
},
|
|
12048
12121
|
children: [
|
|
12049
|
-
!borderless && !isCenterColumnAlone && /* @__PURE__ */ jsx64(
|
|
12122
|
+
!borderless && !isCenterColumnAlone && /* @__PURE__ */ jsx64(Stack5, { sx: sideColumnStyle, children: leftIconId && /* @__PURE__ */ jsx64(
|
|
12050
12123
|
Icon_default,
|
|
12051
12124
|
{
|
|
12052
12125
|
id: leftIconId,
|
|
@@ -12057,7 +12130,7 @@ var EnhancedCard = React31.forwardRef(
|
|
|
12057
12130
|
}
|
|
12058
12131
|
) }),
|
|
12059
12132
|
/* @__PURE__ */ jsx64(
|
|
12060
|
-
|
|
12133
|
+
Stack5,
|
|
12061
12134
|
{
|
|
12062
12135
|
direction: "column",
|
|
12063
12136
|
alignItems: "center",
|
|
@@ -12065,7 +12138,7 @@ var EnhancedCard = React31.forwardRef(
|
|
|
12065
12138
|
children: childrenWithProps
|
|
12066
12139
|
}
|
|
12067
12140
|
),
|
|
12068
|
-
!borderless && !isCenterColumnAlone && /* @__PURE__ */ jsx64(
|
|
12141
|
+
!borderless && !isCenterColumnAlone && /* @__PURE__ */ jsx64(Stack5, { sx: sideColumnStyle, children: rightIconId && /* @__PURE__ */ jsx64(
|
|
12069
12142
|
Icon_default,
|
|
12070
12143
|
{
|
|
12071
12144
|
id: rightIconId,
|
|
@@ -14404,7 +14477,7 @@ var ChatMessage = React36.forwardRef(function ChatMessage2({
|
|
|
14404
14477
|
var ChatMessage_default = ChatMessage;
|
|
14405
14478
|
|
|
14406
14479
|
// src/components/chat/Chat.tsx
|
|
14407
|
-
import
|
|
14480
|
+
import Stack6 from "@mui/material/Stack";
|
|
14408
14481
|
import * as React37 from "react";
|
|
14409
14482
|
import { jsx as jsx81, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
14410
14483
|
var PADDING_BOTTOM = 8;
|
|
@@ -14421,21 +14494,6 @@ var Chat = ({
|
|
|
14421
14494
|
const innerRef = React37.useRef(null);
|
|
14422
14495
|
const [isInitialize, setIsInitialize] = React37.useState(false);
|
|
14423
14496
|
const [hasVerticalScroll, setHasVerticalScroll] = React37.useState(false);
|
|
14424
|
-
React37.useEffect(() => {
|
|
14425
|
-
const container = ref.current;
|
|
14426
|
-
if (!container) {
|
|
14427
|
-
return;
|
|
14428
|
-
}
|
|
14429
|
-
const observer = new ResizeObserver(() => {
|
|
14430
|
-
requestAnimationFrame(() => {
|
|
14431
|
-
const needsScroll = container.scrollHeight > container.clientHeight;
|
|
14432
|
-
setHasVerticalScroll(needsScroll);
|
|
14433
|
-
});
|
|
14434
|
-
});
|
|
14435
|
-
observer.observe(container);
|
|
14436
|
-
setIsInitialize(true);
|
|
14437
|
-
return () => observer.disconnect();
|
|
14438
|
-
}, []);
|
|
14439
14497
|
const getPaddingBottom = React37.useCallback(
|
|
14440
14498
|
(lastElementClass, clientHeight) => {
|
|
14441
14499
|
if (lastElementClass && innerRef.current) {
|
|
@@ -14452,24 +14510,44 @@ var Chat = ({
|
|
|
14452
14510
|
},
|
|
14453
14511
|
[gapBetweenElements]
|
|
14454
14512
|
);
|
|
14455
|
-
React37.
|
|
14513
|
+
const updatePaddingBottom = React37.useCallback(() => {
|
|
14456
14514
|
const container = ref.current;
|
|
14457
|
-
if (!container) {
|
|
14515
|
+
if (!container || !innerRef.current) {
|
|
14458
14516
|
return;
|
|
14459
14517
|
}
|
|
14460
14518
|
const elements = container.querySelectorAll(
|
|
14461
14519
|
`.${scrollToLastClassName}`
|
|
14462
14520
|
);
|
|
14463
14521
|
const lastElementClass = elements[elements.length - 1];
|
|
14464
|
-
if (lastElementClass
|
|
14522
|
+
if (lastElementClass) {
|
|
14465
14523
|
const clientHeight = container.clientHeight - PADDING_BOTTOM;
|
|
14466
14524
|
const paddingBottom = getPaddingBottom(
|
|
14467
14525
|
lastElementClass,
|
|
14468
14526
|
clientHeight
|
|
14469
14527
|
);
|
|
14470
|
-
|
|
14528
|
+
const paddingToSet = paddingBottom >= clientHeight ? `${PADDING_BOTTOM}px` : `${paddingBottom}px`;
|
|
14529
|
+
innerRef.current.style.paddingBottom = paddingToSet;
|
|
14530
|
+
const needsScroll = container.scrollHeight > container.clientHeight;
|
|
14531
|
+
setHasVerticalScroll(needsScroll);
|
|
14471
14532
|
}
|
|
14472
|
-
}, [
|
|
14533
|
+
}, [getPaddingBottom, scrollToLastClassName]);
|
|
14534
|
+
React37.useEffect(() => {
|
|
14535
|
+
const container = ref.current;
|
|
14536
|
+
if (!container) {
|
|
14537
|
+
return;
|
|
14538
|
+
}
|
|
14539
|
+
const observer = new ResizeObserver(() => {
|
|
14540
|
+
requestAnimationFrame(() => {
|
|
14541
|
+
updatePaddingBottom();
|
|
14542
|
+
});
|
|
14543
|
+
});
|
|
14544
|
+
observer.observe(container);
|
|
14545
|
+
setIsInitialize(true);
|
|
14546
|
+
return () => observer.disconnect();
|
|
14547
|
+
}, [updatePaddingBottom]);
|
|
14548
|
+
React37.useEffect(() => {
|
|
14549
|
+
updatePaddingBottom();
|
|
14550
|
+
}, [children, updatePaddingBottom]);
|
|
14473
14551
|
React37.useEffect(() => {
|
|
14474
14552
|
const container = ref.current;
|
|
14475
14553
|
if (!container || !scrollToLastClassName || !triggerScroll) {
|
|
@@ -14497,19 +14575,19 @@ var Chat = ({
|
|
|
14497
14575
|
triggerScroll
|
|
14498
14576
|
]);
|
|
14499
14577
|
return /* @__PURE__ */ jsxs37(
|
|
14500
|
-
|
|
14578
|
+
Stack6,
|
|
14501
14579
|
{
|
|
14502
14580
|
className: "Slim-Vertical-Scroll",
|
|
14503
14581
|
ref,
|
|
14504
14582
|
sx: {
|
|
14505
14583
|
overflow: "hidden",
|
|
14506
|
-
overflowY: "
|
|
14584
|
+
overflowY: "scroll",
|
|
14507
14585
|
height: "calc(100% - 8px)",
|
|
14508
14586
|
visibility: !isInitialize ? "hidden" : "visible",
|
|
14509
|
-
width: `calc(100% -
|
|
14587
|
+
width: `calc(100% - 4px)`,
|
|
14510
14588
|
paddingBottom: `${PADDING_BOTTOM}px`,
|
|
14511
14589
|
...backgroundColor2 && { backgroundColor: backgroundColor2 },
|
|
14512
|
-
paddingRight:
|
|
14590
|
+
paddingRight: "4px",
|
|
14513
14591
|
"::-webkit-scrollbar": {
|
|
14514
14592
|
width: "4px !important"
|
|
14515
14593
|
},
|
|
@@ -14521,14 +14599,14 @@ var Chat = ({
|
|
|
14521
14599
|
visibility: "hidden"
|
|
14522
14600
|
},
|
|
14523
14601
|
":hover::-webkit-scrollbar-thumb": {
|
|
14524
|
-
visibility: "visible"
|
|
14602
|
+
visibility: hasVerticalScroll ? "visible" : "hidden"
|
|
14525
14603
|
}
|
|
14526
14604
|
},
|
|
14527
14605
|
spacing: "12px",
|
|
14528
14606
|
children: [
|
|
14529
14607
|
header,
|
|
14530
14608
|
/* @__PURE__ */ jsx81(
|
|
14531
|
-
|
|
14609
|
+
Stack6,
|
|
14532
14610
|
{
|
|
14533
14611
|
ref: innerRef,
|
|
14534
14612
|
justifyContent: "start",
|
|
@@ -19455,14 +19533,14 @@ var Popover = ({
|
|
|
19455
19533
|
var Popover_default = Popover;
|
|
19456
19534
|
|
|
19457
19535
|
// src/components/popover/PopoverActions.tsx
|
|
19458
|
-
import { Stack as
|
|
19536
|
+
import { Stack as Stack7 } from "@mui/material";
|
|
19459
19537
|
import { jsx as jsx103, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
19460
19538
|
var PopoverActions = ({
|
|
19461
19539
|
leftContent,
|
|
19462
19540
|
rightContent,
|
|
19463
19541
|
sx
|
|
19464
19542
|
}) => /* @__PURE__ */ jsxs45(
|
|
19465
|
-
|
|
19543
|
+
Stack7,
|
|
19466
19544
|
{
|
|
19467
19545
|
className: "PopoverActions",
|
|
19468
19546
|
direction: "row",
|
|
@@ -19999,7 +20077,7 @@ var DateIntervalPickerList = ({
|
|
|
19999
20077
|
var DateIntervalPickerList_default = DateIntervalPickerList;
|
|
20000
20078
|
|
|
20001
20079
|
// src/components/input/DateIntervalPickerInputs.tsx
|
|
20002
|
-
import { Collapse as Collapse6, Stack as
|
|
20080
|
+
import { Collapse as Collapse6, Stack as Stack8 } from "@mui/material";
|
|
20003
20081
|
|
|
20004
20082
|
// src/components/input/TimeField.tsx
|
|
20005
20083
|
import * as React56 from "react";
|
|
@@ -20092,7 +20170,7 @@ var DateIntervalPickerInputs = ({
|
|
|
20092
20170
|
focusableInput,
|
|
20093
20171
|
hourLabel,
|
|
20094
20172
|
color: color3
|
|
20095
|
-
}) => /* @__PURE__ */ jsxs49(
|
|
20173
|
+
}) => /* @__PURE__ */ jsxs49(Stack8, { children: [
|
|
20096
20174
|
/* @__PURE__ */ jsx110(
|
|
20097
20175
|
TextField_default,
|
|
20098
20176
|
{
|
|
@@ -20907,7 +20985,7 @@ var DateIntervalPicker = ({
|
|
|
20907
20985
|
var DateIntervalPicker_default = DateIntervalPicker;
|
|
20908
20986
|
|
|
20909
20987
|
// src/components/input/SelectPopoverItem.tsx
|
|
20910
|
-
import { Grid as Grid2, Stack as
|
|
20988
|
+
import { Grid as Grid2, Stack as Stack9 } from "@mui/material";
|
|
20911
20989
|
import { lighten as lighten3 } from "@mui/material";
|
|
20912
20990
|
import { Fragment as Fragment22, jsx as jsx113, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
20913
20991
|
var bgColorLightCoefficient2 = 0.9;
|
|
@@ -20930,7 +21008,7 @@ var SelectPopoverItem = ({
|
|
|
20930
21008
|
xs: 6
|
|
20931
21009
|
},
|
|
20932
21010
|
children: /* @__PURE__ */ jsxs52(
|
|
20933
|
-
|
|
21011
|
+
Stack9,
|
|
20934
21012
|
{
|
|
20935
21013
|
direction: "row",
|
|
20936
21014
|
sx: {
|
|
@@ -21746,7 +21824,7 @@ var UploadClickableArea_default = UploadClickableArea;
|
|
|
21746
21824
|
|
|
21747
21825
|
// src/components/input/CategorizedPicker.tsx
|
|
21748
21826
|
import React63 from "react";
|
|
21749
|
-
import { Grid as Grid3, Popover as Popover2, Select as Select3, Stack as
|
|
21827
|
+
import { Grid as Grid3, Popover as Popover2, Select as Select3, Stack as Stack10 } from "@mui/material";
|
|
21750
21828
|
import { Fragment as Fragment24, jsx as jsx119, jsxs as jsxs55 } from "react/jsx-runtime";
|
|
21751
21829
|
var ChevronIcon2 = ({ disabled }) => /* @__PURE__ */ jsx119(
|
|
21752
21830
|
Icon_default,
|
|
@@ -21931,7 +22009,7 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21931
22009
|
sx: { borderRight: `1px solid ${grey200}` },
|
|
21932
22010
|
height: "316px",
|
|
21933
22011
|
className: "Slim-Vertical-Scroll",
|
|
21934
|
-
children: /* @__PURE__ */ jsx119(
|
|
22012
|
+
children: /* @__PURE__ */ jsx119(Stack10, { children: filteredCategories.map((category, idx) => /* @__PURE__ */ jsx119(
|
|
21935
22013
|
ListItemButton_default,
|
|
21936
22014
|
{
|
|
21937
22015
|
selected: selectedCategory === category,
|
|
@@ -21975,7 +22053,7 @@ var CategorizedPicker = function CategorizedPicker2({
|
|
|
21975
22053
|
},
|
|
21976
22054
|
height: "316px",
|
|
21977
22055
|
className: "Slim-Vertical-Scroll",
|
|
21978
|
-
children: /* @__PURE__ */ jsx119(
|
|
22056
|
+
children: /* @__PURE__ */ jsx119(Stack10, { children: /* @__PURE__ */ jsx119(Stack10, { children: !selectedCategory ? /* @__PURE__ */ jsx119(Stack10, { padding: "12px", alignItems: "center", children: /* @__PURE__ */ jsx119(
|
|
21979
22057
|
Typography_default,
|
|
21980
22058
|
{
|
|
21981
22059
|
variant: "body2",
|
|
@@ -22029,7 +22107,7 @@ import * as React65 from "react";
|
|
|
22029
22107
|
|
|
22030
22108
|
// src/components/input/SelectPopover.tsx
|
|
22031
22109
|
import * as React64 from "react";
|
|
22032
|
-
import { Grid as Grid4, Stack as
|
|
22110
|
+
import { Grid as Grid4, Stack as Stack11 } from "@mui/material";
|
|
22033
22111
|
import { useState as useState23 } from "react";
|
|
22034
22112
|
import InfiniteScroll from "react-infinite-scroll-component";
|
|
22035
22113
|
import { jsx as jsx120, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
@@ -22275,7 +22353,7 @@ var SelectPopover = function SelectPopover2({
|
|
|
22275
22353
|
}
|
|
22276
22354
|
),
|
|
22277
22355
|
!isLoading && currentItems.length === 0 ? typeof emptyListPlaceholder === "string" ? /* @__PURE__ */ jsx120(
|
|
22278
|
-
|
|
22356
|
+
Stack11,
|
|
22279
22357
|
{
|
|
22280
22358
|
alignItems: "center",
|
|
22281
22359
|
justifyContent: "center",
|
|
@@ -22661,108 +22739,66 @@ import * as React67 from "react";
|
|
|
22661
22739
|
import * as React66 from "react";
|
|
22662
22740
|
import { jsx as jsx122, jsxs as jsxs58 } from "react/jsx-runtime";
|
|
22663
22741
|
var AUTOCOMPLETE_PADDING_RIGHT = 6;
|
|
22664
|
-
var AUTOCOMPLETE_CLEAR_BUTTON_WIDTH = 36;
|
|
22665
|
-
var AUTOCOMPLETE_INPUT_MIN_WIDTH = 88;
|
|
22666
22742
|
var AutocompleteInputSelection = function AutocompleteInputSelection2({
|
|
22667
22743
|
value,
|
|
22744
|
+
canAddValues,
|
|
22668
22745
|
disabled = false,
|
|
22669
22746
|
renderLabel,
|
|
22670
|
-
disableClear,
|
|
22671
22747
|
onOpenPopover,
|
|
22672
|
-
isOpenPopover,
|
|
22673
|
-
inputValue,
|
|
22674
|
-
isHover,
|
|
22675
22748
|
onRemoveValue
|
|
22676
22749
|
}) {
|
|
22677
22750
|
const stackRef = React66.useRef(null);
|
|
22678
|
-
const [maxWidth2, setMaxWidth] = React66.useState(0);
|
|
22679
|
-
const dirty = !!inputValue || Array.isArray(value) && value.length > 0 || !Array.isArray(value) && !!value;
|
|
22680
|
-
const showClearButton = !disabled && dirty && !disableClear && (isOpenPopover || isHover);
|
|
22681
|
-
React66.useLayoutEffect(() => {
|
|
22682
|
-
if (!stackRef.current) {
|
|
22683
|
-
return;
|
|
22684
|
-
}
|
|
22685
|
-
const el = stackRef.current.parentElement || stackRef.current;
|
|
22686
|
-
const compute = () => {
|
|
22687
|
-
const width2 = el.getBoundingClientRect().width;
|
|
22688
|
-
const maxWidth3 = disabled ? width2 - AUTOCOMPLETE_PADDING_RIGHT : !showClearButton ? width2 - (AUTOCOMPLETE_INPUT_MIN_WIDTH + AUTOCOMPLETE_CLEAR_BUTTON_WIDTH) : width2 - AUTOCOMPLETE_INPUT_MIN_WIDTH;
|
|
22689
|
-
setMaxWidth(maxWidth3);
|
|
22690
|
-
};
|
|
22691
|
-
compute();
|
|
22692
|
-
const ro = new ResizeObserver(compute);
|
|
22693
|
-
ro.observe(el);
|
|
22694
|
-
window.addEventListener("resize", compute);
|
|
22695
|
-
return () => {
|
|
22696
|
-
ro.disconnect();
|
|
22697
|
-
window.removeEventListener("resize", compute);
|
|
22698
|
-
};
|
|
22699
|
-
}, [disabled, showClearButton]);
|
|
22700
22751
|
return /* @__PURE__ */ jsxs58(
|
|
22701
22752
|
Stack_default,
|
|
22702
22753
|
{
|
|
22703
22754
|
ref: stackRef,
|
|
22704
22755
|
direction: "row",
|
|
22705
22756
|
gap: "4px",
|
|
22706
|
-
flex: "0 0 auto",
|
|
22707
22757
|
whiteSpace: "nowrap",
|
|
22708
|
-
|
|
22758
|
+
flex: "0 1 auto",
|
|
22759
|
+
minWidth: 0,
|
|
22760
|
+
...disabled && {
|
|
22761
|
+
maxWidth: `calc(100% - ${AUTOCOMPLETE_PADDING_RIGHT}px)`
|
|
22762
|
+
},
|
|
22709
22763
|
children: [
|
|
22710
22764
|
/* @__PURE__ */ jsx122(
|
|
22711
22765
|
IconButton_default,
|
|
22712
22766
|
{
|
|
22713
22767
|
iconId: "plus",
|
|
22714
22768
|
size: "S",
|
|
22715
|
-
disabled,
|
|
22769
|
+
disabled: disabled || !canAddValues,
|
|
22716
22770
|
sx: {
|
|
22717
22771
|
padding: 0,
|
|
22718
|
-
...disabled && {
|
|
22772
|
+
...(disabled || !canAddValues) && {
|
|
22719
22773
|
color: `${Colors_exports.grey500} !important`,
|
|
22720
|
-
opacity: "1 !important"
|
|
22774
|
+
opacity: "1 !important",
|
|
22775
|
+
flex: "0 0 auto"
|
|
22721
22776
|
}
|
|
22722
22777
|
},
|
|
22723
22778
|
onClick: () => {
|
|
22724
|
-
onOpenPopover();
|
|
22779
|
+
canAddValues && onOpenPopover();
|
|
22725
22780
|
}
|
|
22726
22781
|
}
|
|
22727
22782
|
),
|
|
22728
|
-
/* @__PURE__ */ jsx122(
|
|
22729
|
-
|
|
22783
|
+
/* @__PURE__ */ jsx122(Stack_default, { whiteSpace: "nowrap", flex: "1 1 auto", minWidth: 0, children: /* @__PURE__ */ jsx122(
|
|
22784
|
+
ChipViewer_default,
|
|
22730
22785
|
{
|
|
22731
|
-
|
|
22732
|
-
|
|
22733
|
-
|
|
22734
|
-
|
|
22735
|
-
|
|
22736
|
-
|
|
22737
|
-
|
|
22738
|
-
|
|
22739
|
-
|
|
22740
|
-
overflow: "hidden",
|
|
22741
|
-
alignItems: "center"
|
|
22742
|
-
},
|
|
22743
|
-
children: /* @__PURE__ */ jsx122(
|
|
22744
|
-
ChipViewer_default,
|
|
22745
|
-
{
|
|
22746
|
-
values: Array.isArray(value) ? value : !value ? [] : [value],
|
|
22747
|
-
...!disabled && {
|
|
22748
|
-
onRemoveChip: (event, id) => {
|
|
22749
|
-
onRemoveValue(
|
|
22750
|
-
event,
|
|
22751
|
-
Array.isArray(value) ? value.filter(
|
|
22752
|
-
(v) => v !== id
|
|
22753
|
-
) : ""
|
|
22754
|
-
);
|
|
22755
|
-
}
|
|
22756
|
-
},
|
|
22757
|
-
numberLines: 1,
|
|
22758
|
-
renderChipLabel: (id) => renderLabel(id),
|
|
22759
|
-
maxWidth: maxWidth2
|
|
22760
|
-
}
|
|
22761
|
-
)
|
|
22786
|
+
values: Array.isArray(value) ? value : !value ? [] : [value],
|
|
22787
|
+
...!disabled && {
|
|
22788
|
+
onRemoveChip: (event, id) => {
|
|
22789
|
+
onRemoveValue(
|
|
22790
|
+
event,
|
|
22791
|
+
Array.isArray(value) ? value.filter(
|
|
22792
|
+
(v) => v !== id
|
|
22793
|
+
) : ""
|
|
22794
|
+
);
|
|
22762
22795
|
}
|
|
22763
|
-
|
|
22796
|
+
},
|
|
22797
|
+
numberLines: 1,
|
|
22798
|
+
renderChipLabel: (id) => renderLabel(id),
|
|
22799
|
+
forceRecalculate: disabled
|
|
22764
22800
|
}
|
|
22765
|
-
)
|
|
22801
|
+
) })
|
|
22766
22802
|
]
|
|
22767
22803
|
}
|
|
22768
22804
|
);
|
|
@@ -22771,6 +22807,8 @@ var AutocompleteInputSelection_default = AutocompleteInputSelection;
|
|
|
22771
22807
|
|
|
22772
22808
|
// src/components/input/autocomplete/AutocompleteInput.tsx
|
|
22773
22809
|
import { Fragment as Fragment26, jsx as jsx123, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
22810
|
+
var INPUT_MIN_WIDTH = 80;
|
|
22811
|
+
var CLEAR_BUTTON_WIDTH = 36;
|
|
22774
22812
|
var AutocompleteInput = function AutocompleteInput2({
|
|
22775
22813
|
variant = "default",
|
|
22776
22814
|
value,
|
|
@@ -22780,7 +22818,7 @@ var AutocompleteInput = function AutocompleteInput2({
|
|
|
22780
22818
|
disabled = false,
|
|
22781
22819
|
renderLabel,
|
|
22782
22820
|
maxValueLength,
|
|
22783
|
-
|
|
22821
|
+
canAddValues,
|
|
22784
22822
|
maxValuesText,
|
|
22785
22823
|
disableClear,
|
|
22786
22824
|
containerRef,
|
|
@@ -22803,6 +22841,7 @@ var AutocompleteInput = function AutocompleteInput2({
|
|
|
22803
22841
|
DebouncedTextField_default,
|
|
22804
22842
|
{
|
|
22805
22843
|
ref: inputRef,
|
|
22844
|
+
...textFieldProps,
|
|
22806
22845
|
sx: {
|
|
22807
22846
|
...textFieldProps?.sx,
|
|
22808
22847
|
minWidth: "328px",
|
|
@@ -22821,10 +22860,10 @@ var AutocompleteInput = function AutocompleteInput2({
|
|
|
22821
22860
|
minWidth: 0
|
|
22822
22861
|
}
|
|
22823
22862
|
},
|
|
22824
|
-
...textFieldProps,
|
|
22825
22863
|
inputSx: {
|
|
22826
22864
|
...textFieldProps?.inputSx,
|
|
22827
22865
|
flex: "1 1 auto",
|
|
22866
|
+
minWidth: showClearButton ? `${INPUT_MIN_WIDTH}px` : `${INPUT_MIN_WIDTH + CLEAR_BUTTON_WIDTH}px`,
|
|
22828
22867
|
...disabled && {
|
|
22829
22868
|
color: Colors_exports.grey500
|
|
22830
22869
|
},
|
|
@@ -22836,10 +22875,10 @@ var AutocompleteInput = function AutocompleteInput2({
|
|
|
22836
22875
|
}
|
|
22837
22876
|
},
|
|
22838
22877
|
maxLength: maxValueLength,
|
|
22839
|
-
placeholder:
|
|
22878
|
+
placeholder: !canAddValues ? maxValuesText || t("AUTOCOMPLETE.MAX_VALUES") : Array.isArray(value) && value.length > 0 || !Array.isArray(value) && !!value ? "" : placeholder,
|
|
22840
22879
|
value: inputValue,
|
|
22841
22880
|
multiline: false,
|
|
22842
|
-
disabled: disabled ||
|
|
22881
|
+
disabled: disabled || !canAddValues,
|
|
22843
22882
|
onChange: (event) => {
|
|
22844
22883
|
onSearchValueChange(event, event.target.value);
|
|
22845
22884
|
},
|
|
@@ -22880,15 +22919,12 @@ var AutocompleteInput = function AutocompleteInput2({
|
|
|
22880
22919
|
startAdornment: /* @__PURE__ */ jsx123(
|
|
22881
22920
|
AutocompleteInputSelection_default,
|
|
22882
22921
|
{
|
|
22883
|
-
inputValue,
|
|
22884
22922
|
value,
|
|
22923
|
+
canAddValues,
|
|
22885
22924
|
renderLabel,
|
|
22886
|
-
isOpenPopover,
|
|
22887
|
-
isHover,
|
|
22888
22925
|
onOpenPopover,
|
|
22889
22926
|
onRemoveValue,
|
|
22890
|
-
disabled
|
|
22891
|
-
disableClear
|
|
22927
|
+
disabled
|
|
22892
22928
|
}
|
|
22893
22929
|
),
|
|
22894
22930
|
endAdornment: /* @__PURE__ */ jsxs59(
|
|
@@ -22938,9 +22974,14 @@ var AutocompleteInput = function AutocompleteInput2({
|
|
|
22938
22974
|
IconButton_default,
|
|
22939
22975
|
{
|
|
22940
22976
|
iconId: isOpenPopover ? "chevron-up" : "chevron-down",
|
|
22977
|
+
disabled: !canAddValues,
|
|
22941
22978
|
sx: {
|
|
22942
22979
|
padding: 0,
|
|
22943
|
-
marginLeft: 0
|
|
22980
|
+
marginLeft: 0,
|
|
22981
|
+
...!canAddValues && {
|
|
22982
|
+
color: `${Colors_exports.grey500} !important`,
|
|
22983
|
+
opacity: "1 !important"
|
|
22984
|
+
}
|
|
22944
22985
|
},
|
|
22945
22986
|
onClick: () => {
|
|
22946
22987
|
if (isOpenPopover) {
|
|
@@ -23107,6 +23148,7 @@ var AutocompleteList_default = AutocompleteList;
|
|
|
23107
23148
|
|
|
23108
23149
|
// src/components/input/autocomplete/Autocomplete.tsx
|
|
23109
23150
|
import { Fragment as Fragment28, jsx as jsx125, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
23151
|
+
var MIN_AUTOCOMPLETE_WIDTH = "328px";
|
|
23110
23152
|
var Autocomplete = function Autocomplete2({
|
|
23111
23153
|
variant = "default",
|
|
23112
23154
|
value,
|
|
@@ -23200,6 +23242,70 @@ var Autocomplete = function Autocomplete2({
|
|
|
23200
23242
|
React68.useEffect(() => {
|
|
23201
23243
|
setFilteredOptions(getOptionsLabeled([...options]));
|
|
23202
23244
|
}, [options]);
|
|
23245
|
+
const canAddValues = maxValues === void 0 || maxValues === 0 || !!multiple && Array.isArray(value) && value.length < maxValues;
|
|
23246
|
+
React68.useEffect(() => {
|
|
23247
|
+
if (disabled) {
|
|
23248
|
+
setOpenPopover(false);
|
|
23249
|
+
}
|
|
23250
|
+
}, [disabled]);
|
|
23251
|
+
React68.useEffect(() => {
|
|
23252
|
+
if (!canAddValues && isOpenPopover) {
|
|
23253
|
+
closePopover();
|
|
23254
|
+
}
|
|
23255
|
+
}, [canAddValues, isOpenPopover]);
|
|
23256
|
+
const getLastSelectedIndex = React68.useCallback(() => {
|
|
23257
|
+
if (Array.isArray(selectedIndex) && selectedIndex.length > 0) {
|
|
23258
|
+
return selectedIndex[selectedIndex.length - 1];
|
|
23259
|
+
} else if (typeof selectedIndex === "number") {
|
|
23260
|
+
return selectedIndex;
|
|
23261
|
+
}
|
|
23262
|
+
return void 0;
|
|
23263
|
+
}, [selectedIndex]);
|
|
23264
|
+
React68.useEffect(() => {
|
|
23265
|
+
if (isOpenPopover) {
|
|
23266
|
+
if (highlightedIndex > -1) {
|
|
23267
|
+
virtualListRef.current?.scrollToItem(highlightedIndex);
|
|
23268
|
+
} else {
|
|
23269
|
+
const lastSelectedIndex = getLastSelectedIndex();
|
|
23270
|
+
if (lastSelectedIndex !== void 0 && lastSelectedIndex > -1) {
|
|
23271
|
+
virtualListRef.current?.scrollToItem(lastSelectedIndex);
|
|
23272
|
+
}
|
|
23273
|
+
}
|
|
23274
|
+
const keyDownEventListener = (event) => {
|
|
23275
|
+
switch (event.key) {
|
|
23276
|
+
case "ArrowDown": {
|
|
23277
|
+
const isHighlightedIndex = highlightedIndex !== -1;
|
|
23278
|
+
const lastSelectedIndex = getLastSelectedIndex() ?? -1;
|
|
23279
|
+
const index = isHighlightedIndex ? highlightedIndex + 1 : lastSelectedIndex + 1;
|
|
23280
|
+
setHighlightedIndex(index % filteredOptions.length);
|
|
23281
|
+
break;
|
|
23282
|
+
}
|
|
23283
|
+
case "ArrowUp": {
|
|
23284
|
+
const isHighlightedIndex = highlightedIndex !== -1;
|
|
23285
|
+
const lastSelectedIndex = getLastSelectedIndex() ?? filteredOptions.length;
|
|
23286
|
+
const index = isHighlightedIndex ? highlightedIndex - 1 : lastSelectedIndex - 1;
|
|
23287
|
+
setHighlightedIndex(
|
|
23288
|
+
(filteredOptions.length + index) % filteredOptions.length
|
|
23289
|
+
);
|
|
23290
|
+
break;
|
|
23291
|
+
}
|
|
23292
|
+
case "Escape":
|
|
23293
|
+
closePopover();
|
|
23294
|
+
break;
|
|
23295
|
+
}
|
|
23296
|
+
};
|
|
23297
|
+
document.addEventListener("keydown", keyDownEventListener);
|
|
23298
|
+
return () => {
|
|
23299
|
+
document.removeEventListener("keydown", keyDownEventListener);
|
|
23300
|
+
};
|
|
23301
|
+
}
|
|
23302
|
+
}, [
|
|
23303
|
+
isOpenPopover,
|
|
23304
|
+
getLastSelectedIndex,
|
|
23305
|
+
highlightedIndex,
|
|
23306
|
+
filteredOptions.length,
|
|
23307
|
+
virtualListRef
|
|
23308
|
+
]);
|
|
23203
23309
|
const setNextIndex = (filteredOptions2) => {
|
|
23204
23310
|
setNextIndexByValue(value, filteredOptions2);
|
|
23205
23311
|
};
|
|
@@ -23236,6 +23342,9 @@ var Autocomplete = function Autocomplete2({
|
|
|
23236
23342
|
inputRef.current?.blur();
|
|
23237
23343
|
};
|
|
23238
23344
|
const openPopover = (options2) => {
|
|
23345
|
+
if (!canAddValues) {
|
|
23346
|
+
return;
|
|
23347
|
+
}
|
|
23239
23348
|
setDirty(false);
|
|
23240
23349
|
setPlaceholder("");
|
|
23241
23350
|
setOpenPopover(true);
|
|
@@ -23263,64 +23372,6 @@ var Autocomplete = function Autocomplete2({
|
|
|
23263
23372
|
setFilteredOptions(currentFilteredOptions);
|
|
23264
23373
|
setNextIndex(currentFilteredOptions);
|
|
23265
23374
|
};
|
|
23266
|
-
const getLastSelectedIndex = React68.useCallback(() => {
|
|
23267
|
-
if (Array.isArray(selectedIndex) && selectedIndex.length > 0) {
|
|
23268
|
-
return selectedIndex[selectedIndex.length - 1];
|
|
23269
|
-
} else if (typeof selectedIndex === "number") {
|
|
23270
|
-
return selectedIndex;
|
|
23271
|
-
}
|
|
23272
|
-
return void 0;
|
|
23273
|
-
}, [selectedIndex]);
|
|
23274
|
-
React68.useEffect(() => {
|
|
23275
|
-
if (isOpenPopover) {
|
|
23276
|
-
if (highlightedIndex > -1) {
|
|
23277
|
-
virtualListRef.current?.scrollToItem(highlightedIndex);
|
|
23278
|
-
} else {
|
|
23279
|
-
const lastSelectedIndex = getLastSelectedIndex();
|
|
23280
|
-
if (lastSelectedIndex !== void 0 && lastSelectedIndex > -1) {
|
|
23281
|
-
virtualListRef.current?.scrollToItem(lastSelectedIndex);
|
|
23282
|
-
}
|
|
23283
|
-
}
|
|
23284
|
-
const keyDownEventListener = (event) => {
|
|
23285
|
-
switch (event.key) {
|
|
23286
|
-
case "ArrowDown": {
|
|
23287
|
-
const isHighlightedIndex = highlightedIndex !== -1;
|
|
23288
|
-
const lastSelectedIndex = getLastSelectedIndex() ?? -1;
|
|
23289
|
-
const index = isHighlightedIndex ? highlightedIndex + 1 : lastSelectedIndex + 1;
|
|
23290
|
-
setHighlightedIndex(index % filteredOptions.length);
|
|
23291
|
-
break;
|
|
23292
|
-
}
|
|
23293
|
-
case "ArrowUp": {
|
|
23294
|
-
const isHighlightedIndex = highlightedIndex !== -1;
|
|
23295
|
-
const lastSelectedIndex = getLastSelectedIndex() ?? filteredOptions.length;
|
|
23296
|
-
const index = isHighlightedIndex ? highlightedIndex - 1 : lastSelectedIndex - 1;
|
|
23297
|
-
setHighlightedIndex(
|
|
23298
|
-
(filteredOptions.length + index) % filteredOptions.length
|
|
23299
|
-
);
|
|
23300
|
-
break;
|
|
23301
|
-
}
|
|
23302
|
-
case "Escape":
|
|
23303
|
-
closePopover();
|
|
23304
|
-
break;
|
|
23305
|
-
}
|
|
23306
|
-
};
|
|
23307
|
-
document.addEventListener("keydown", keyDownEventListener);
|
|
23308
|
-
return () => {
|
|
23309
|
-
document.removeEventListener("keydown", keyDownEventListener);
|
|
23310
|
-
};
|
|
23311
|
-
}
|
|
23312
|
-
}, [
|
|
23313
|
-
isOpenPopover,
|
|
23314
|
-
getLastSelectedIndex,
|
|
23315
|
-
highlightedIndex,
|
|
23316
|
-
filteredOptions.length,
|
|
23317
|
-
virtualListRef
|
|
23318
|
-
]);
|
|
23319
|
-
React68.useEffect(() => {
|
|
23320
|
-
if (multiple && Array.isArray(value) && value.length === maxValues) {
|
|
23321
|
-
closePopover();
|
|
23322
|
-
}
|
|
23323
|
-
}, [multiple, maxValues, value]);
|
|
23324
23375
|
const onSetSelectedIndex = (index) => {
|
|
23325
23376
|
setSelectedIndex(index);
|
|
23326
23377
|
setHighlightedIndex(-1);
|
|
@@ -23424,13 +23475,19 @@ var Autocomplete = function Autocomplete2({
|
|
|
23424
23475
|
containerRef: anchorRef,
|
|
23425
23476
|
variant,
|
|
23426
23477
|
isOpenPopover,
|
|
23427
|
-
textFieldProps
|
|
23478
|
+
textFieldProps: {
|
|
23479
|
+
...textFieldProps,
|
|
23480
|
+
sx: {
|
|
23481
|
+
...textFieldProps?.sx ?? {},
|
|
23482
|
+
minWidth: MIN_AUTOCOMPLETE_WIDTH
|
|
23483
|
+
}
|
|
23484
|
+
},
|
|
23428
23485
|
disableClear,
|
|
23429
23486
|
disabled,
|
|
23430
23487
|
hasFilteredOptions: options.length > 0,
|
|
23431
23488
|
value,
|
|
23432
23489
|
maxValueLength,
|
|
23433
|
-
|
|
23490
|
+
canAddValues,
|
|
23434
23491
|
maxValuesText,
|
|
23435
23492
|
multiple,
|
|
23436
23493
|
renderLabel: renderLabel ?? _renderLabel,
|
|
@@ -25141,7 +25198,7 @@ var CircularProgress_default = CircularProgress;
|
|
|
25141
25198
|
|
|
25142
25199
|
// src/components/progress/DonutProgress.tsx
|
|
25143
25200
|
import Box5 from "@mui/material/Box";
|
|
25144
|
-
import { Stack as
|
|
25201
|
+
import { Stack as Stack12 } from "@mui/material";
|
|
25145
25202
|
import { jsx as jsx139, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
25146
25203
|
var CIRCULAR_PROGRESS_PERCENTAGE = 85;
|
|
25147
25204
|
var variants2 = {
|
|
@@ -25178,7 +25235,7 @@ var DonutProgress = ({
|
|
|
25178
25235
|
labelChip,
|
|
25179
25236
|
showPercentageSymbol
|
|
25180
25237
|
}) => {
|
|
25181
|
-
const getPercentageWithSymbol = () => /* @__PURE__ */ jsxs72(
|
|
25238
|
+
const getPercentageWithSymbol = () => /* @__PURE__ */ jsxs72(Stack12, { direction: "row", alignItems: "center", position: "relative", children: [
|
|
25182
25239
|
/* @__PURE__ */ jsx139(Typography_default, { variant: "h6", component: "div", color: grey800, children: label }),
|
|
25183
25240
|
/* @__PURE__ */ jsx139(
|
|
25184
25241
|
Typography_default,
|
|
@@ -26580,7 +26637,7 @@ import MuiTabs from "@mui/material/Tabs";
|
|
|
26580
26637
|
|
|
26581
26638
|
// src/components/layout/SwipeableViews.tsx
|
|
26582
26639
|
import * as React86 from "react";
|
|
26583
|
-
import { useEffect as useEffect23, useRef as useRef25, useState as
|
|
26640
|
+
import { useEffect as useEffect23, useRef as useRef25, useState as useState34 } from "react";
|
|
26584
26641
|
import { jsx as jsx155 } from "react/jsx-runtime";
|
|
26585
26642
|
var styles = {
|
|
26586
26643
|
container: {
|
|
@@ -26617,7 +26674,7 @@ function SwipeableViews({
|
|
|
26617
26674
|
const containerRef = useRef25(null);
|
|
26618
26675
|
const scrollTimeout = useRef25();
|
|
26619
26676
|
const scrollingMethod = useRef25("none");
|
|
26620
|
-
const [previousIndex, setPreviousIndex] =
|
|
26677
|
+
const [previousIndex, setPreviousIndex] = useState34(index);
|
|
26621
26678
|
const hideScrollAnimation = useRef25(true);
|
|
26622
26679
|
useEffect23(() => {
|
|
26623
26680
|
if (containerRef.current) {
|
|
@@ -27244,7 +27301,7 @@ var Toolbar_default = Toolbar;
|
|
|
27244
27301
|
|
|
27245
27302
|
// src/components/toolbar/ToolbarTitle.tsx
|
|
27246
27303
|
import * as React90 from "react";
|
|
27247
|
-
import { useState as
|
|
27304
|
+
import { useState as useState37 } from "react";
|
|
27248
27305
|
import { jsx as jsx170, jsxs as jsxs83 } from "react/jsx-runtime";
|
|
27249
27306
|
var ToolbarTitle = React90.forwardRef(function ToolbarTitle2({
|
|
27250
27307
|
title,
|
|
@@ -27254,7 +27311,7 @@ var ToolbarTitle = React90.forwardRef(function ToolbarTitle2({
|
|
|
27254
27311
|
color: color2 = grey900
|
|
27255
27312
|
}, ref) {
|
|
27256
27313
|
const textElementRef = React90.useRef(null);
|
|
27257
|
-
const [showHoverActions, setShowHoverActions] =
|
|
27314
|
+
const [showHoverActions, setShowHoverActions] = useState37(false);
|
|
27258
27315
|
return /* @__PURE__ */ jsx170(Box_default2, { sx: { maxWidth: "100%" }, children: /* @__PURE__ */ jsx170(
|
|
27259
27316
|
TextEllipsisTooltip_default,
|
|
27260
27317
|
{
|