@connectif/ui-components 5.0.2 → 5.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/components/button/ToggleButton.d.ts +1 -1
- package/dist/components/card/EnhancedCardRow.d.ts +2 -2
- package/dist/components/chip/Chip.d.ts +87 -55
- package/dist/components/drawer/InputDrawer.d.ts +1 -1
- package/dist/components/input/CodeEditor.d.ts +2 -7
- package/dist/components/input/ColorPicker.d.ts +6 -0
- package/dist/components/input/Select.d.ts +2 -7
- package/dist/components/input/autocomplete/AutocompleteInput.d.ts +2 -2
- package/dist/components/input/autocomplete/AutocompleteList.d.ts +2 -2
- package/dist/hooks/useResizeObserver.d.ts +1 -1
- package/dist/index.js +90 -54
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +14 -10
package/dist/index.js
CHANGED
|
@@ -841,9 +841,7 @@ var require_react_is_development2 = __commonJS({
|
|
|
841
841
|
}
|
|
842
842
|
}
|
|
843
843
|
}
|
|
844
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
845
|
-
Symbol.for("react.provider");
|
|
846
|
-
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
844
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
847
845
|
exports.ContextConsumer = REACT_CONSUMER_TYPE;
|
|
848
846
|
exports.ContextProvider = REACT_CONTEXT_TYPE;
|
|
849
847
|
exports.Element = REACT_ELEMENT_TYPE;
|
|
@@ -8081,7 +8079,9 @@ var ListItemText = ({
|
|
|
8081
8079
|
slotProps,
|
|
8082
8080
|
"data-testid": dataTestId
|
|
8083
8081
|
}) => {
|
|
8084
|
-
const textElementRef = React8.useRef(
|
|
8082
|
+
const textElementRef = React8.useRef(
|
|
8083
|
+
null
|
|
8084
|
+
);
|
|
8085
8085
|
return /* @__PURE__ */ jsx6(
|
|
8086
8086
|
TextEllipsisTooltip_default,
|
|
8087
8087
|
{
|
|
@@ -9595,7 +9595,9 @@ var TextEllipsis = ({
|
|
|
9595
9595
|
sx,
|
|
9596
9596
|
zIndex
|
|
9597
9597
|
}) => {
|
|
9598
|
-
const textElementRef = React17.useRef(
|
|
9598
|
+
const textElementRef = React17.useRef(
|
|
9599
|
+
null
|
|
9600
|
+
);
|
|
9599
9601
|
return /* @__PURE__ */ jsx32(
|
|
9600
9602
|
TextEllipsisTooltip_default,
|
|
9601
9603
|
{
|
|
@@ -9742,7 +9744,7 @@ var MenuIconButton = React19.forwardRef(function MenuIconButton2({
|
|
|
9742
9744
|
const setButtonRef = (element) => {
|
|
9743
9745
|
if (typeof ref === "function") {
|
|
9744
9746
|
ref(element);
|
|
9745
|
-
} else if (ref) {
|
|
9747
|
+
} else if (ref && "current" in ref) {
|
|
9746
9748
|
ref.current = element;
|
|
9747
9749
|
}
|
|
9748
9750
|
setAnchorEl(element);
|
|
@@ -10522,7 +10524,7 @@ var MenuButton = React24.forwardRef(function MenuButton2({
|
|
|
10522
10524
|
const setButtonRef = (element) => {
|
|
10523
10525
|
if (typeof ref === "function") {
|
|
10524
10526
|
ref(element);
|
|
10525
|
-
} else if (ref) {
|
|
10527
|
+
} else if (ref && "current" in ref) {
|
|
10526
10528
|
ref.current = element;
|
|
10527
10529
|
}
|
|
10528
10530
|
setAnchorEl(element);
|
|
@@ -11479,7 +11481,7 @@ var MenuChip = React29.forwardRef(function MenuChip2({
|
|
|
11479
11481
|
const setChipRef = (element) => {
|
|
11480
11482
|
if (typeof ref === "function") {
|
|
11481
11483
|
ref(element);
|
|
11482
|
-
} else if (ref) {
|
|
11484
|
+
} else if (ref && "current" in ref) {
|
|
11483
11485
|
ref.current = element;
|
|
11484
11486
|
}
|
|
11485
11487
|
setAnchorEl(element);
|
|
@@ -12055,11 +12057,19 @@ var EnhancedCard = React31.forwardRef(
|
|
|
12055
12057
|
const getChildProps = () => typeof child.props === "object" ? child.props : {};
|
|
12056
12058
|
switch (child.type) {
|
|
12057
12059
|
case EnhancedCardTitle_default:
|
|
12060
|
+
return React31.cloneElement(
|
|
12061
|
+
child,
|
|
12062
|
+
{
|
|
12063
|
+
size: size === "S" ? "S" : "M",
|
|
12064
|
+
dataTest,
|
|
12065
|
+
cursor: cursor2,
|
|
12066
|
+
...getChildProps()
|
|
12067
|
+
}
|
|
12068
|
+
);
|
|
12058
12069
|
case EnhancedCardSubtitle_default:
|
|
12059
12070
|
return React31.cloneElement(
|
|
12060
12071
|
child,
|
|
12061
12072
|
{
|
|
12062
|
-
size,
|
|
12063
12073
|
dataTest,
|
|
12064
12074
|
cursor: cursor2,
|
|
12065
12075
|
...getChildProps()
|
|
@@ -12080,12 +12090,11 @@ var EnhancedCard = React31.forwardRef(
|
|
|
12080
12090
|
child,
|
|
12081
12091
|
{
|
|
12082
12092
|
titleProps: {
|
|
12083
|
-
size,
|
|
12093
|
+
size: size === "S" ? "S" : "M",
|
|
12084
12094
|
dataTest,
|
|
12085
12095
|
cursor: cursor2
|
|
12086
12096
|
},
|
|
12087
12097
|
subtitleProps: {
|
|
12088
|
-
size,
|
|
12089
12098
|
dataTest,
|
|
12090
12099
|
cursor: cursor2
|
|
12091
12100
|
},
|
|
@@ -18305,7 +18314,9 @@ var PhoneFormatter_default = PhoneFormatter;
|
|
|
18305
18314
|
import * as React44 from "react";
|
|
18306
18315
|
import { jsx as jsx92 } from "react/jsx-runtime";
|
|
18307
18316
|
var HeaderTitle = ({ text }) => {
|
|
18308
|
-
const textElementRef = React44.useRef(
|
|
18317
|
+
const textElementRef = React44.useRef(
|
|
18318
|
+
null
|
|
18319
|
+
);
|
|
18309
18320
|
return /* @__PURE__ */ jsx92(
|
|
18310
18321
|
TextEllipsisTooltip_default,
|
|
18311
18322
|
{
|
|
@@ -18331,7 +18342,9 @@ var HeaderTitle_default = HeaderTitle;
|
|
|
18331
18342
|
import * as React45 from "react";
|
|
18332
18343
|
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
18333
18344
|
var HeaderSubtitle = ({ text }) => {
|
|
18334
|
-
const textElementRef = React45.useRef(
|
|
18345
|
+
const textElementRef = React45.useRef(
|
|
18346
|
+
null
|
|
18347
|
+
);
|
|
18335
18348
|
return typeof text === "string" ? /* @__PURE__ */ jsx93(
|
|
18336
18349
|
TextEllipsisTooltip_default,
|
|
18337
18350
|
{
|
|
@@ -18585,8 +18598,8 @@ var ImageEditor = ({
|
|
|
18585
18598
|
TABS.FINETUNE,
|
|
18586
18599
|
TABS.ANNOTATE
|
|
18587
18600
|
];
|
|
18588
|
-
const updateStateRef = React46.useRef();
|
|
18589
|
-
const getCurrentImgDataFnRef = React46.useRef();
|
|
18601
|
+
const updateStateRef = React46.useRef(null);
|
|
18602
|
+
const getCurrentImgDataFnRef = React46.useRef(null);
|
|
18590
18603
|
const handleOnSave = React46.useCallback(
|
|
18591
18604
|
(editedImageObject) => {
|
|
18592
18605
|
const imageBase64 = editedImageObject.imageBase64;
|
|
@@ -19034,8 +19047,8 @@ import * as React52 from "react";
|
|
|
19034
19047
|
// src/hooks/useDebouncedCallback.ts
|
|
19035
19048
|
import { useEffect as useEffect10, useRef as useRef14 } from "react";
|
|
19036
19049
|
function useDebouncedCallback(callback, wait) {
|
|
19037
|
-
const argsRef = useRef14();
|
|
19038
|
-
const timeout = useRef14();
|
|
19050
|
+
const argsRef = useRef14(null);
|
|
19051
|
+
const timeout = useRef14(null);
|
|
19039
19052
|
function cleanup() {
|
|
19040
19053
|
if (timeout.current) {
|
|
19041
19054
|
clearTimeout(timeout.current);
|
|
@@ -21638,6 +21651,7 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21638
21651
|
allowAlpha = false,
|
|
21639
21652
|
popoverZIndex,
|
|
21640
21653
|
inputWidthStyle = "150px",
|
|
21654
|
+
mode = "auto",
|
|
21641
21655
|
onChange
|
|
21642
21656
|
}, ref) {
|
|
21643
21657
|
const { t } = useTranslation();
|
|
@@ -21662,20 +21676,9 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21662
21676
|
setTextFieldValue(newValue);
|
|
21663
21677
|
if (isValidColor(newValue) || allowEmpty && newValue === "") {
|
|
21664
21678
|
setInternalPickerValue(newValue);
|
|
21665
|
-
onChange(newValue);
|
|
21679
|
+
onChange(mode === "hex" ? rgbToHex(newValue) : newValue);
|
|
21666
21680
|
}
|
|
21667
21681
|
};
|
|
21668
|
-
const normalizeBlack = (color2) => {
|
|
21669
|
-
const rgb = color2.match(/\d+/g);
|
|
21670
|
-
if (!rgb) {
|
|
21671
|
-
return color2;
|
|
21672
|
-
}
|
|
21673
|
-
const [r2, g, b] = rgb.map(Number);
|
|
21674
|
-
if (r2 <= 1 && g <= 1 && b <= 1) {
|
|
21675
|
-
return "rgb(0,0,0)";
|
|
21676
|
-
}
|
|
21677
|
-
return color2;
|
|
21678
|
-
};
|
|
21679
21682
|
const iconColor = /* @__PURE__ */ jsx117(
|
|
21680
21683
|
IconButton_default,
|
|
21681
21684
|
{
|
|
@@ -21688,15 +21691,15 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21688
21691
|
}
|
|
21689
21692
|
);
|
|
21690
21693
|
React62.useEffect(() => {
|
|
21691
|
-
const
|
|
21694
|
+
const handleInternalColorChange = (color2) => {
|
|
21692
21695
|
setPreviousColors((prev) => [color2, ...prev.slice(0, 17)]);
|
|
21693
|
-
setTextFieldValue(rgbToHex(color2));
|
|
21694
|
-
onChange(color2);
|
|
21696
|
+
setTextFieldValue(mode === "hex" ? rgbToHex(color2) : color2);
|
|
21697
|
+
onChange(mode === "hex" ? rgbToHex(color2) : color2);
|
|
21695
21698
|
setValidPickerChange(false);
|
|
21696
21699
|
setColorChangeOccurred(false);
|
|
21697
21700
|
};
|
|
21698
21701
|
if (colorChangeOccurred && (isValidPickerChange || isPopoverInputFocused) && internalPickerValue && internalPickerValue !== value) {
|
|
21699
|
-
|
|
21702
|
+
handleInternalColorChange(internalPickerValue);
|
|
21700
21703
|
}
|
|
21701
21704
|
}, [
|
|
21702
21705
|
value,
|
|
@@ -21704,8 +21707,19 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21704
21707
|
onChange,
|
|
21705
21708
|
isValidPickerChange,
|
|
21706
21709
|
colorChangeOccurred,
|
|
21707
|
-
isPopoverInputFocused
|
|
21710
|
+
isPopoverInputFocused,
|
|
21711
|
+
mode
|
|
21708
21712
|
]);
|
|
21713
|
+
React62.useEffect(() => {
|
|
21714
|
+
const handleExternalColorChange = (color2) => {
|
|
21715
|
+
setPreviousColors((prev) => [color2, ...prev.slice(0, 17)]);
|
|
21716
|
+
setTextFieldValue(rgbToHex(color2));
|
|
21717
|
+
setInternalPickerValue(color2);
|
|
21718
|
+
};
|
|
21719
|
+
if (!colorChangeOccurred && internalPickerValue && value && internalPickerValue !== value) {
|
|
21720
|
+
handleExternalColorChange(value || (allowEmpty ? "" : white));
|
|
21721
|
+
}
|
|
21722
|
+
}, [value, internalPickerValue, colorChangeOccurred, allowEmpty]);
|
|
21709
21723
|
React62.useEffect(() => {
|
|
21710
21724
|
if (anchorEl) {
|
|
21711
21725
|
const handleFocus = () => {
|
|
@@ -21718,7 +21732,7 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21718
21732
|
const timeoutId = setTimeout(() => {
|
|
21719
21733
|
if (containerRef.current) {
|
|
21720
21734
|
inputs = containerRef.current.querySelectorAll(
|
|
21721
|
-
"input#rbgcp-input, input#rbgcp-hex-input"
|
|
21735
|
+
"input#rbgcp-R-input, input#rbgcp-G-input, input#rbgcp-B-input, input#rbgcp-hex-input"
|
|
21722
21736
|
);
|
|
21723
21737
|
inputs.forEach((input) => {
|
|
21724
21738
|
input.addEventListener("focus", handleFocus);
|
|
@@ -21800,17 +21814,12 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21800
21814
|
color: "black !important",
|
|
21801
21815
|
fontFamily: "Source Sans Pro, sans-serif"
|
|
21802
21816
|
},
|
|
21803
|
-
"#rbgcp-input": {
|
|
21817
|
+
"#rbgcp-hex-input, #rbgcp-R-input, #rbgcp-G-input, #rbgcp-B-input": {
|
|
21804
21818
|
color: "black !important",
|
|
21805
21819
|
backgroundColor: "white !important",
|
|
21806
|
-
border: "1px solid #bebebe",
|
|
21807
|
-
fontFamily: "Source Sans Pro, sans-serif"
|
|
21808
|
-
|
|
21809
|
-
"#rbgcp-hex-input": {
|
|
21810
|
-
color: "black !important",
|
|
21811
|
-
backgroundColor: "white !important",
|
|
21812
|
-
border: "1px solid #bebebe",
|
|
21813
|
-
fontFamily: "Source Sans Pro, sans-serif"
|
|
21820
|
+
border: "1px solid #bebebe !important",
|
|
21821
|
+
fontFamily: "Source Sans Pro, sans-serif",
|
|
21822
|
+
boxSizing: "border-box !important"
|
|
21814
21823
|
}
|
|
21815
21824
|
},
|
|
21816
21825
|
children: /* @__PURE__ */ jsx117(
|
|
@@ -21832,7 +21841,8 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21832
21841
|
hideOpacity: !allowAlpha,
|
|
21833
21842
|
hideInputType: true,
|
|
21834
21843
|
hideColorTypeBtns: true,
|
|
21835
|
-
hideGradientControls: true
|
|
21844
|
+
hideGradientControls: true,
|
|
21845
|
+
disableDarkMode: true
|
|
21836
21846
|
}
|
|
21837
21847
|
)
|
|
21838
21848
|
}
|
|
@@ -21843,7 +21853,19 @@ var ColorPicker = React62.forwardRef(function ColorPickerWrapper({
|
|
|
21843
21853
|
});
|
|
21844
21854
|
var ColorPicker_default = ColorPicker;
|
|
21845
21855
|
var rgbToHex = (rgb) => {
|
|
21846
|
-
|
|
21856
|
+
if (/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(rgb) || !rgb.startsWith("rgb")) {
|
|
21857
|
+
return rgb;
|
|
21858
|
+
}
|
|
21859
|
+
if (rgb.includes("rgba")) {
|
|
21860
|
+
const alphaMatch = rgb.match(
|
|
21861
|
+
/rgba\(\d{1,3}, {0,1}\d{1,3}, {0,1}\d{1,3}, {0,1}([01]|0?\.\d+)\)/
|
|
21862
|
+
);
|
|
21863
|
+
if (alphaMatch && alphaMatch[1] === "0") {
|
|
21864
|
+
return "transparent";
|
|
21865
|
+
}
|
|
21866
|
+
}
|
|
21867
|
+
const normalized = normalizeBlack(rgb);
|
|
21868
|
+
const rgbValues = normalized.match(/\d+/g);
|
|
21847
21869
|
if (!rgbValues || rgbValues.length !== 3 && rgbValues.length !== 4) {
|
|
21848
21870
|
return rgb;
|
|
21849
21871
|
}
|
|
@@ -21852,6 +21874,17 @@ var rgbToHex = (rgb) => {
|
|
|
21852
21874
|
return hex.length === 1 ? "0" + hex : hex;
|
|
21853
21875
|
}).join("");
|
|
21854
21876
|
};
|
|
21877
|
+
var normalizeBlack = (color2) => {
|
|
21878
|
+
const rgb = color2.match(/\d+/g);
|
|
21879
|
+
if (!rgb) {
|
|
21880
|
+
return color2;
|
|
21881
|
+
}
|
|
21882
|
+
const [r2, g, b] = rgb.map(Number);
|
|
21883
|
+
if (r2 <= 1 && g <= 1 && b <= 1) {
|
|
21884
|
+
return "rgb(0,0,0)";
|
|
21885
|
+
}
|
|
21886
|
+
return color2;
|
|
21887
|
+
};
|
|
21855
21888
|
|
|
21856
21889
|
// src/components/input/UploadClickableArea.tsx
|
|
21857
21890
|
import { Box as Box3 } from "@mui/material";
|
|
@@ -25586,9 +25619,10 @@ var renderChildrenWithMath = (children) => React80.Children.map(children, (child
|
|
|
25586
25619
|
return renderWithMath(child);
|
|
25587
25620
|
}
|
|
25588
25621
|
if (React80.isValidElement(child)) {
|
|
25589
|
-
|
|
25590
|
-
|
|
25591
|
-
|
|
25622
|
+
const element = child;
|
|
25623
|
+
return React80.cloneElement(element, {
|
|
25624
|
+
...element.props,
|
|
25625
|
+
children: renderChildrenWithMath(element.props.children)
|
|
25592
25626
|
});
|
|
25593
25627
|
}
|
|
25594
25628
|
return child;
|
|
@@ -26175,7 +26209,7 @@ function Carousel({
|
|
|
26175
26209
|
const [isRightArrowHidden, setRightArrowHidden] = React85.useState(true);
|
|
26176
26210
|
const [paddingElement, setPaddingElement] = React85.useState();
|
|
26177
26211
|
const [visibleCount, setVisibleCount] = React85.useState();
|
|
26178
|
-
const showedElementsRef = React85.useRef();
|
|
26212
|
+
const showedElementsRef = React85.useRef(void 0);
|
|
26179
26213
|
const [showedElements, setShowedElements] = React85.useState();
|
|
26180
26214
|
const updateArrows = React85.useCallback(() => {
|
|
26181
26215
|
if (!showedElementsRef.current) {
|
|
@@ -26753,7 +26787,7 @@ function SwipeableViews({
|
|
|
26753
26787
|
...rootProps
|
|
26754
26788
|
}) {
|
|
26755
26789
|
const containerRef = useRef27(null);
|
|
26756
|
-
const scrollTimeout = useRef27();
|
|
26790
|
+
const scrollTimeout = useRef27(null);
|
|
26757
26791
|
const scrollingMethod = useRef27("none");
|
|
26758
26792
|
const [previousIndex, setPreviousIndex] = useState34(index);
|
|
26759
26793
|
const hideScrollAnimation = useRef27(true);
|
|
@@ -27391,7 +27425,9 @@ var ToolbarTitle = React91.forwardRef(function ToolbarTitle2({
|
|
|
27391
27425
|
hoverActions,
|
|
27392
27426
|
color: color2 = grey900
|
|
27393
27427
|
}, ref) {
|
|
27394
|
-
const textElementRef = React91.useRef(
|
|
27428
|
+
const textElementRef = React91.useRef(
|
|
27429
|
+
null
|
|
27430
|
+
);
|
|
27395
27431
|
const [showHoverActions, setShowHoverActions] = useState37(false);
|
|
27396
27432
|
return /* @__PURE__ */ jsx170(Box_default2, { sx: { maxWidth: "100%" }, children: /* @__PURE__ */ jsx170(
|
|
27397
27433
|
TextEllipsisTooltip_default,
|
|
@@ -28179,7 +28215,7 @@ react-is/cjs/react-is.development.js:
|
|
|
28179
28215
|
|
|
28180
28216
|
@mui/styled-engine/esm/index.js:
|
|
28181
28217
|
(**
|
|
28182
|
-
* @mui/styled-engine v7.3.
|
|
28218
|
+
* @mui/styled-engine v7.3.7
|
|
28183
28219
|
*
|
|
28184
28220
|
* @license MIT
|
|
28185
28221
|
* This source code is licensed under the MIT license found in the
|
|
@@ -28188,7 +28224,7 @@ react-is/cjs/react-is.development.js:
|
|
|
28188
28224
|
|
|
28189
28225
|
@mui/system/esm/index.js:
|
|
28190
28226
|
(**
|
|
28191
|
-
* @mui/system v7.3.
|
|
28227
|
+
* @mui/system v7.3.7
|
|
28192
28228
|
*
|
|
28193
28229
|
* @license MIT
|
|
28194
28230
|
* This source code is licensed under the MIT license found in the
|