@economic/taco 2.67.2 → 2.68.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/dist/taco.cjs +609 -621
- package/dist/taco.cjs.map +1 -1
- package/dist/taco.d.ts +31 -28
- package/dist/taco.js +609 -621
- package/dist/taco.js.map +1 -1
- package/package.json +3 -3
- package/tailwind.config.js +1 -0
package/dist/taco.cjs
CHANGED
@@ -83,8 +83,6 @@ const getOutlineColorShadeClasses = (state) => {
|
|
83
83
|
return "border-pink-700 text-pink-700";
|
84
84
|
case "orange":
|
85
85
|
return "border-orange-700 text-orange-700";
|
86
|
-
case "transparent":
|
87
|
-
case "grey":
|
88
86
|
default:
|
89
87
|
return "border-grey-700 text-grey-700";
|
90
88
|
}
|
@@ -109,7 +107,6 @@ const getSubtleColorShadeClasses = (value) => {
|
|
109
107
|
return "wcag-orange-100";
|
110
108
|
case "transparent":
|
111
109
|
return "wcag-transparent";
|
112
|
-
case "grey":
|
113
110
|
default:
|
114
111
|
return "wcag-grey-200";
|
115
112
|
}
|
@@ -134,7 +131,6 @@ const getColorShadeClasses = (value) => {
|
|
134
131
|
return "wcag-orange-700";
|
135
132
|
case "transparent":
|
136
133
|
return "wcag-transparent";
|
137
|
-
case "grey":
|
138
134
|
default:
|
139
135
|
return "wcag-grey-700";
|
140
136
|
}
|
@@ -5375,7 +5371,7 @@ function mergeRefs(refs) {
|
|
5375
5371
|
refs.forEach((ref) => {
|
5376
5372
|
if (typeof ref === "function") {
|
5377
5373
|
ref(value);
|
5378
|
-
} else if (ref
|
5374
|
+
} else if (ref !== null) {
|
5379
5375
|
ref.current = value;
|
5380
5376
|
}
|
5381
5377
|
});
|
@@ -5434,6 +5430,8 @@ const getDialogSizeClassnames = (size2) => {
|
|
5434
5430
|
return "w-md";
|
5435
5431
|
case "lg":
|
5436
5432
|
return "w-lg";
|
5433
|
+
default:
|
5434
|
+
return void 0;
|
5437
5435
|
}
|
5438
5436
|
};
|
5439
5437
|
const getDialogPositionClassnames = () => "mt-16 mx-auto";
|
@@ -5478,7 +5476,7 @@ const Content$a = React__namespace.forwardRef(function AlertDialogContent(props,
|
|
5478
5476
|
))));
|
5479
5477
|
});
|
5480
5478
|
const AlertDialog = React__namespace.forwardRef(function AlertDialog2(props, ref) {
|
5481
|
-
const { children:
|
5479
|
+
const { children: _initialChildren, defaultOpen, onChange, open, trigger, ...otherProps } = props;
|
5482
5480
|
const context = React__namespace.useMemo(
|
5483
5481
|
() => ({
|
5484
5482
|
props: otherProps,
|
@@ -9897,11 +9895,11 @@ function isElementInteractive(element) {
|
|
9897
9895
|
if (!element) {
|
9898
9896
|
return false;
|
9899
9897
|
}
|
9900
|
-
const interactiveElements = ["A", "BUTTON", "INPUT", "TEXTAREA", "SELECT", "LABEL", "OPTION"];
|
9901
|
-
const isInteractive = interactiveElements.
|
9898
|
+
const interactiveElements = /* @__PURE__ */ new Set(["A", "BUTTON", "INPUT", "TEXTAREA", "SELECT", "LABEL", "OPTION"]);
|
9899
|
+
const isInteractive = interactiveElements.has(element.tagName) && !element.hidden && !element.disabled && !element.readOnly;
|
9902
9900
|
if (!isInteractive) {
|
9903
9901
|
const focusableParent = element.closest(FOCUSABLE_ELEMENTS.join(","));
|
9904
|
-
return focusableParent ? interactiveElements.
|
9902
|
+
return focusableParent ? interactiveElements.has(focusableParent.tagName) : false;
|
9905
9903
|
}
|
9906
9904
|
return isInteractive;
|
9907
9905
|
}
|
@@ -9985,7 +9983,7 @@ const Button$5 = React__namespace.forwardRef(function Button2(props, ref) {
|
|
9985
9983
|
"aria-disabled": disabled ? "true" : void 0,
|
9986
9984
|
disabled,
|
9987
9985
|
target: Tag2 === "a" ? target : void 0,
|
9988
|
-
type: Tag2
|
9986
|
+
type: Tag2 === "a" ? void 0 : type,
|
9989
9987
|
ref: internalRef
|
9990
9988
|
},
|
9991
9989
|
React__namespace.Children.count(props.children) > 1 ? React__namespace.Children.map(props.children, (child) => typeof child === "string" ? /* @__PURE__ */ React__namespace.createElement("span", null, child) : child) : props.children
|
@@ -17661,7 +17659,7 @@ const useBoundingClientRectListener = (ref, dependencies) => {
|
|
17661
17659
|
}, dependencies);
|
17662
17660
|
return dimensions;
|
17663
17661
|
};
|
17664
|
-
const validSetSelectionRangeTypes = ["text", "search", "url", "tel", "password"];
|
17662
|
+
const validSetSelectionRangeTypes = /* @__PURE__ */ new Set(["text", "search", "url", "tel", "password"]);
|
17665
17663
|
const InputWithoutDeprecatedFeatures = React__namespace.forwardRef(function InputWithoutDeprecatedFeatures2(props, ref) {
|
17666
17664
|
const { highlighted, invalid, onKeyDown, postfix, prefix: prefix2, type = "text", ...attributes } = props;
|
17667
17665
|
const internalRef = useMergedRef(ref);
|
@@ -17684,15 +17682,13 @@ const InputWithoutDeprecatedFeatures = React__namespace.forwardRef(function Inpu
|
|
17684
17682
|
if (event.key.length === 1 && !isPressingMetaKey(event)) {
|
17685
17683
|
event.stopPropagation();
|
17686
17684
|
}
|
17687
|
-
if (validSetSelectionRangeTypes.
|
17688
|
-
|
17689
|
-
|
17690
|
-
|
17691
|
-
|
17692
|
-
|
17693
|
-
|
17694
|
-
internalRef.current.scrollLeft = scrollPosition;
|
17695
|
-
}
|
17685
|
+
if (validSetSelectionRangeTypes.has(type) && !event.shiftKey && (event.key === "Home" || event.key === "End")) {
|
17686
|
+
event.preventDefault();
|
17687
|
+
const position = event.key === "End" ? event.currentTarget.value.length : 0;
|
17688
|
+
event.currentTarget.setSelectionRange(position, position);
|
17689
|
+
if (internalRef.current) {
|
17690
|
+
const scrollPosition = event.key === "End" ? internalRef.current.scrollWidth : 0;
|
17691
|
+
internalRef.current.scrollLeft = scrollPosition;
|
17696
17692
|
}
|
17697
17693
|
}
|
17698
17694
|
if (typeof onKeyDown === "function") {
|
@@ -18082,9 +18078,9 @@ const getNextIndexFromKey = (key, length, index2, direction = "vertical") => {
|
|
18082
18078
|
const nextKey = direction === "horizontal" ? "ArrowRight" : "ArrowDown";
|
18083
18079
|
switch (key) {
|
18084
18080
|
case previousKey:
|
18085
|
-
return index2
|
18081
|
+
return index2 === void 0 ? 0 : index2 - 1 < 0 ? 0 : index2 - 1;
|
18086
18082
|
case nextKey:
|
18087
|
-
return index2
|
18083
|
+
return index2 === void 0 ? length - 1 : index2 + 1 >= length ? index2 : index2 + 1;
|
18088
18084
|
case "Home":
|
18089
18085
|
return 0;
|
18090
18086
|
case "End":
|
@@ -18122,13 +18118,13 @@ const scrollToChildElement = (parent, child) => {
|
|
18122
18118
|
const useListScrollTo = (internalRef, itemRefs) => {
|
18123
18119
|
const scrollTo2 = (index2) => {
|
18124
18120
|
if (internalRef && internalRef.current) {
|
18125
|
-
if (index2
|
18121
|
+
if (index2 === void 0) {
|
18122
|
+
internalRef.current.scrollTop = 0;
|
18123
|
+
} else {
|
18126
18124
|
const activeRef = itemRefs[index2];
|
18127
18125
|
if (activeRef && activeRef.current) {
|
18128
18126
|
scrollToChildElement(internalRef.current, activeRef.current);
|
18129
18127
|
}
|
18130
|
-
} else {
|
18131
|
-
internalRef.current.scrollTop = 0;
|
18132
18128
|
}
|
18133
18129
|
}
|
18134
18130
|
};
|
@@ -18140,7 +18136,8 @@ const getNextEnabledItem$1 = (event, data, index2) => {
|
|
18140
18136
|
if (nextIndex) {
|
18141
18137
|
if (nextIndex === index2) {
|
18142
18138
|
return index2;
|
18143
|
-
}
|
18139
|
+
}
|
18140
|
+
if (data[nextIndex] && data[nextIndex].disabled) {
|
18144
18141
|
return getNextEnabledItem$1(event, data, nextIndex);
|
18145
18142
|
}
|
18146
18143
|
}
|
@@ -18150,9 +18147,9 @@ const ScrollableList = React__namespace.forwardRef(function ScrollableList2(prop
|
|
18150
18147
|
const {
|
18151
18148
|
data,
|
18152
18149
|
disabled,
|
18153
|
-
highlighted,
|
18150
|
+
highlighted: _1,
|
18154
18151
|
id: id2,
|
18155
|
-
invalid:
|
18152
|
+
invalid: _2,
|
18156
18153
|
loading,
|
18157
18154
|
onChange: setCurrentIndex,
|
18158
18155
|
onClick,
|
@@ -18190,7 +18187,7 @@ const ScrollableList = React__namespace.forwardRef(function ScrollableList2(prop
|
|
18190
18187
|
}
|
18191
18188
|
if (onKeyDown) {
|
18192
18189
|
event.persist();
|
18193
|
-
const index2 = nextIndex
|
18190
|
+
const index2 = nextIndex === void 0 ? currentIndex : nextIndex;
|
18194
18191
|
onKeyDown(event, index2);
|
18195
18192
|
}
|
18196
18193
|
event.stopPropagation();
|
@@ -18214,11 +18211,11 @@ const ScrollableList = React__namespace.forwardRef(function ScrollableList2(prop
|
|
18214
18211
|
const getOptionCheckedState = (optionValue, index2) => {
|
18215
18212
|
if (optionValue === "#ALL-OPTIONS#") {
|
18216
18213
|
return allOptionsSelected;
|
18217
|
-
}
|
18214
|
+
}
|
18215
|
+
if (!optionValue || !selectedIndexes) {
|
18218
18216
|
return false;
|
18219
|
-
} else {
|
18220
|
-
return selectedIndexes.findIndex((i2) => i2 === index2) !== -1;
|
18221
18217
|
}
|
18218
|
+
return selectedIndexes.some((i2) => i2 === index2);
|
18222
18219
|
};
|
18223
18220
|
const options = data.map((option, index2) => {
|
18224
18221
|
const depth = option.path ? option.path.split(".").length - 1 : 0;
|
@@ -18330,14 +18327,13 @@ const searchForString = (child, value, strategy = "includes") => {
|
|
18330
18327
|
try {
|
18331
18328
|
if (typeof child !== "string" && ((_a = child.props) == null ? void 0 : _a.children)) {
|
18332
18329
|
if (Array.isArray((_b = child.props) == null ? void 0 : _b.children)) {
|
18333
|
-
return !!child.props.children.
|
18330
|
+
return !!child.props.children.some(
|
18334
18331
|
(subChild) => searchForString(subChild, value, strategy)
|
18335
18332
|
);
|
18336
18333
|
}
|
18337
18334
|
return searchForString((_c = child.props) == null ? void 0 : _c.children, value, strategy);
|
18338
|
-
} else {
|
18339
|
-
return child.toString().toLowerCase()[strategy](String(value).toLowerCase());
|
18340
18335
|
}
|
18336
|
+
return child.toString().toLowerCase()[strategy](String(value).toLowerCase());
|
18341
18337
|
} catch {
|
18342
18338
|
return false;
|
18343
18339
|
}
|
@@ -18436,7 +18432,7 @@ const useCombobox = (props, ref) => {
|
|
18436
18432
|
data: unfilteredData = [],
|
18437
18433
|
defaultValue: defaultValue2,
|
18438
18434
|
disabled,
|
18439
|
-
id:
|
18435
|
+
id: _nativeId,
|
18440
18436
|
inline,
|
18441
18437
|
loading: __,
|
18442
18438
|
onChange,
|
@@ -18460,7 +18456,7 @@ const useCombobox = (props, ref) => {
|
|
18460
18456
|
[shouldFilterData, inputValue, flattenedData]
|
18461
18457
|
);
|
18462
18458
|
const [currentIndex, setCurrentIndex] = React__namespace.useState(
|
18463
|
-
inputValue
|
18459
|
+
inputValue === void 0 ? void 0 : getIndexFromValue(data, inputValue)
|
18464
18460
|
);
|
18465
18461
|
const setInputValueByIndex = (index2, event) => {
|
18466
18462
|
if (index2 !== void 0) {
|
@@ -18476,10 +18472,10 @@ const useCombobox = (props, ref) => {
|
|
18476
18472
|
return;
|
18477
18473
|
}
|
18478
18474
|
const option = data[index2];
|
18479
|
-
if (option.value
|
18480
|
-
setInputValueByIndex(index2, event);
|
18481
|
-
} else {
|
18475
|
+
if (option.value === value) {
|
18482
18476
|
setInputValue(convertToInputValue(value));
|
18477
|
+
} else {
|
18478
|
+
setInputValueByIndex(index2, event);
|
18483
18479
|
}
|
18484
18480
|
};
|
18485
18481
|
React__namespace.useEffect(() => {
|
@@ -18587,10 +18583,8 @@ const useCombobox = (props, ref) => {
|
|
18587
18583
|
case "ArrowDown":
|
18588
18584
|
if (open) {
|
18589
18585
|
event.preventDefault();
|
18590
|
-
} else {
|
18591
|
-
|
18592
|
-
buttonRef.current.click();
|
18593
|
-
}
|
18586
|
+
} else if (!inline && buttonRef.current && !isElementInsideTable3OrReport(event.currentTarget)) {
|
18587
|
+
buttonRef.current.click();
|
18594
18588
|
}
|
18595
18589
|
break;
|
18596
18590
|
case "ArrowUp":
|
@@ -18605,13 +18599,11 @@ const useCombobox = (props, ref) => {
|
|
18605
18599
|
if (listRef.current) {
|
18606
18600
|
listRef.current.dispatchEvent(createCustomKeyboardEvent(event));
|
18607
18601
|
}
|
18608
|
-
if (inline && !open) {
|
18609
|
-
|
18610
|
-
|
18611
|
-
|
18612
|
-
|
18613
|
-
setOpen(true);
|
18614
|
-
}
|
18602
|
+
if (inline && !open && (event.key === "ArrowUp" || event.key === "ArrowDown") && !isElementInsideTable3OrReport(event.currentTarget)) {
|
18603
|
+
event.preventDefault();
|
18604
|
+
const initialIndex = event.key === "ArrowUp" ? data.length - 1 : 0;
|
18605
|
+
setCurrentIndex(currentIndex === void 0 ? initialIndex : currentIndex);
|
18606
|
+
setOpen(true);
|
18615
18607
|
}
|
18616
18608
|
}
|
18617
18609
|
if (!event.isDefaultPrevented() && onKeyDown) {
|
@@ -18797,7 +18789,7 @@ const parseFromCustomString = (date2 = "", mask = "dd.mm.yy", defaultMonth = voi
|
|
18797
18789
|
const inputParts = date2.split(/\D/);
|
18798
18790
|
if (inputParts.length === 1) {
|
18799
18791
|
const fullDate = inputParts[0];
|
18800
|
-
const unseparatedMask = mask.
|
18792
|
+
const unseparatedMask = mask.replaceAll(/[^dmy]/g, "");
|
18801
18793
|
day = fullDate.slice(unseparatedMask.indexOf("d"), unseparatedMask.lastIndexOf("d") + 1);
|
18802
18794
|
month = fullDate.slice(unseparatedMask.indexOf("m"), unseparatedMask.lastIndexOf("m") + 1);
|
18803
18795
|
year = getFullYear(fullDate.slice(unseparatedMask.indexOf("y"), unseparatedMask.lastIndexOf("y") + 3));
|
@@ -18812,12 +18804,12 @@ const parseFromCustomString = (date2 = "", mask = "dd.mm.yy", defaultMonth = voi
|
|
18812
18804
|
const currentDate = /* @__PURE__ */ new Date();
|
18813
18805
|
return new Date(
|
18814
18806
|
/* year */
|
18815
|
-
Object.is(year, NaN) ? defaultYear ?? currentDate.getFullYear() : year,
|
18807
|
+
Object.is(year, Number.NaN) ? defaultYear ?? currentDate.getFullYear() : year,
|
18816
18808
|
/* month */
|
18817
|
-
Object.is(month, NaN) ? defaultMonth ?? currentDate.getMonth() : month - 1,
|
18809
|
+
Object.is(month, Number.NaN) ? defaultMonth ?? currentDate.getMonth() : month - 1,
|
18818
18810
|
// months are zero based in javascript, so subtract a day
|
18819
18811
|
/* day */
|
18820
|
-
Object.is(day, NaN) ? currentDate.getDate() : day,
|
18812
|
+
Object.is(day, Number.NaN) ? currentDate.getDate() : day,
|
18821
18813
|
/* hours */
|
18822
18814
|
12,
|
18823
18815
|
/* minutes */
|
@@ -18858,10 +18850,10 @@ const useDatepicker = ({ defaultValue: _, calendar: calendar2, onBlur, onChange,
|
|
18858
18850
|
event.target.value = formattedValue;
|
18859
18851
|
const isEmpty = !event.target.value.trim();
|
18860
18852
|
if (onChange) {
|
18861
|
-
event.detail =
|
18853
|
+
event.detail = isEmpty ? null : valueAsDate;
|
18862
18854
|
onChange(event);
|
18863
18855
|
} else {
|
18864
|
-
setInternalValue(
|
18856
|
+
setInternalValue(isEmpty ? "" : formattedValue);
|
18865
18857
|
}
|
18866
18858
|
if (onBlur) {
|
18867
18859
|
onBlur(event);
|
@@ -18945,7 +18937,7 @@ const RenderPropWrapper$2 = React__namespace.forwardRef(function RenderPropWrapp
|
|
18945
18937
|
return children({ close, ref });
|
18946
18938
|
});
|
18947
18939
|
const Content$7 = React__namespace.forwardRef(function PopoverContent(props, ref) {
|
18948
|
-
const { placement: side, ...popoverContentProps } = props;
|
18940
|
+
const { placement: side, container, ...popoverContentProps } = props;
|
18949
18941
|
const className = clsx(getPopoverStyleClassnames(), props.className);
|
18950
18942
|
let output;
|
18951
18943
|
if (typeof props.children === "function") {
|
@@ -18953,7 +18945,7 @@ const Content$7 = React__namespace.forwardRef(function PopoverContent(props, ref
|
|
18953
18945
|
} else {
|
18954
18946
|
output = props.children;
|
18955
18947
|
}
|
18956
|
-
return /* @__PURE__ */ React__namespace.createElement($cb5cc270b50c6fcd$export$602eac185826482c,
|
18948
|
+
return /* @__PURE__ */ React__namespace.createElement($cb5cc270b50c6fcd$export$602eac185826482c, { container }, /* @__PURE__ */ React__namespace.createElement(
|
18957
18949
|
$cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,
|
18958
18950
|
{
|
18959
18951
|
...popoverContentProps,
|
@@ -25816,7 +25808,6 @@ const getDrawerSizeClassnames = (size2) => {
|
|
25816
25808
|
switch (size2) {
|
25817
25809
|
case "lg":
|
25818
25810
|
return "w-[600px]";
|
25819
|
-
case "md":
|
25820
25811
|
default:
|
25821
25812
|
return "w-[420px]";
|
25822
25813
|
}
|
@@ -26645,7 +26636,7 @@ const Title$3 = React.forwardRef(function DrawerTitle(props, externalRef) {
|
|
26645
26636
|
) : null, /* @__PURE__ */ React.createElement("span", { className: "line-clamp-2 inline-block overflow-y-hidden", style }, children));
|
26646
26637
|
});
|
26647
26638
|
const Footer$1 = React.forwardRef(function DrawerFooter(props, ref) {
|
26648
|
-
const { className, ...otherProps } = props;
|
26639
|
+
const { className: _1, ...otherProps } = props;
|
26649
26640
|
const cName = clsx("mt-auto flex justify-end grow-0 p-4 border-t-[1px] border-grey-300", props.className);
|
26650
26641
|
return /* @__PURE__ */ React.createElement("div", { ...otherProps, className: cName, ref });
|
26651
26642
|
});
|
@@ -26718,13 +26709,15 @@ const DrawerContent = React.forwardRef(function Content2(props, externalRef) {
|
|
26718
26709
|
var _a;
|
26719
26710
|
const isTargetInsideDrawerContent = (_a = ref.current) == null ? void 0 : _a.contains(event.target);
|
26720
26711
|
if (isTargetInsideDrawerContent) {
|
26721
|
-
if (
|
26722
|
-
|
26723
|
-
|
26724
|
-
|
26712
|
+
if (closeOnEscape) {
|
26713
|
+
if (setOpen) {
|
26714
|
+
setOpen(false);
|
26715
|
+
}
|
26725
26716
|
if (onClose) {
|
26726
26717
|
onClose();
|
26727
26718
|
}
|
26719
|
+
} else {
|
26720
|
+
event.preventDefault();
|
26728
26721
|
}
|
26729
26722
|
}
|
26730
26723
|
};
|
@@ -26775,7 +26768,7 @@ const DrawerContent = React.forwardRef(function Content2(props, externalRef) {
|
|
26775
26768
|
)) : null);
|
26776
26769
|
const styleProp = {
|
26777
26770
|
...style,
|
26778
|
-
|
26771
|
+
width: resizedWidth
|
26779
26772
|
};
|
26780
26773
|
return focusTrap ? /* @__PURE__ */ React.createElement(
|
26781
26774
|
$5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,
|
@@ -26832,7 +26825,7 @@ const Drawer = React__namespace.forwardRef(function Drawer2(props, ref) {
|
|
26832
26825
|
onChange = () => {
|
26833
26826
|
},
|
26834
26827
|
variant = "embedded",
|
26835
|
-
className,
|
26828
|
+
className: _1,
|
26836
26829
|
closeOnEscape = true,
|
26837
26830
|
onResize,
|
26838
26831
|
onClose,
|
@@ -26884,7 +26877,9 @@ const Drawer = React__namespace.forwardRef(function Drawer2(props, ref) {
|
|
26884
26877
|
);
|
26885
26878
|
const close = React__namespace.useCallback(() => {
|
26886
26879
|
setOpen(false);
|
26887
|
-
|
26880
|
+
if (onClose) {
|
26881
|
+
onClose();
|
26882
|
+
}
|
26888
26883
|
}, []);
|
26889
26884
|
React__namespace.useEffect(() => {
|
26890
26885
|
const outletSelector = `[data-taco="drawer-outlet"][data-taco-outlet-name="${outletName ?? DEFAULT_OUTLET_NAME}"]`;
|
@@ -26897,13 +26892,11 @@ const Drawer = React__namespace.forwardRef(function Drawer2(props, ref) {
|
|
26897
26892
|
drawerStack();
|
26898
26893
|
}
|
26899
26894
|
drawerStack = close;
|
26900
|
-
} else {
|
26901
|
-
|
26902
|
-
drawerStack = void 0;
|
26903
|
-
}
|
26895
|
+
} else if (drawerStack === close) {
|
26896
|
+
drawerStack = void 0;
|
26904
26897
|
}
|
26905
26898
|
}, [open]);
|
26906
|
-
return /* @__PURE__ */ React__namespace.createElement(DrawerContext.Provider, { value: context }, /* @__PURE__ */ React__namespace.createElement($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9, { modal: variant === "overlay"
|
26899
|
+
return /* @__PURE__ */ React__namespace.createElement(DrawerContext.Provider, { value: context }, /* @__PURE__ */ React__namespace.createElement($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9, { modal: variant === "overlay", open, onOpenChange: setOpen }, trigger && /* @__PURE__ */ React__namespace.createElement(Trigger$3, null, trigger), children));
|
26907
26900
|
});
|
26908
26901
|
Drawer.Trigger = Trigger$3;
|
26909
26902
|
Drawer.Content = Content$5;
|
@@ -26974,7 +26967,7 @@ const Title$2 = React__namespace.forwardRef(function DialogTitle2(props, ref) {
|
|
26974
26967
|
return /* @__PURE__ */ React__namespace.createElement("span", { ...props, className, ref });
|
26975
26968
|
});
|
26976
26969
|
const Content$4 = React__namespace.forwardRef(function HangerContent(props, ref) {
|
26977
|
-
const { placement: side, hideWhenDetached = false } = props;
|
26970
|
+
const { placement: side, hideWhenDetached = false, container } = props;
|
26978
26971
|
const context = React__namespace.useContext(HangerContext);
|
26979
26972
|
const { texts } = useLocalization();
|
26980
26973
|
const className = clsx(
|
@@ -26984,7 +26977,7 @@ const Content$4 = React__namespace.forwardRef(function HangerContent(props, ref)
|
|
26984
26977
|
const handleInteractOutside = (event) => {
|
26985
26978
|
event.preventDefault();
|
26986
26979
|
};
|
26987
|
-
return /* @__PURE__ */ React__namespace.createElement($cb5cc270b50c6fcd$export$602eac185826482c,
|
26980
|
+
return /* @__PURE__ */ React__namespace.createElement($cb5cc270b50c6fcd$export$602eac185826482c, { container }, /* @__PURE__ */ React__namespace.createElement(
|
26988
26981
|
$cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,
|
26989
26982
|
{
|
26990
26983
|
className,
|
@@ -28120,10 +28113,10 @@ const useListbox = ({
|
|
28120
28113
|
value = emptyValue,
|
28121
28114
|
...otherProps
|
28122
28115
|
}, ref) => {
|
28123
|
-
const data = useFlattenedData(emptyValue
|
28116
|
+
const data = useFlattenedData(emptyValue === void 0 ? externalData : [{ text: "", value: emptyValue }, ...externalData]);
|
28124
28117
|
const id2 = React__namespace.useMemo(() => nativeId || nanoid(), [nativeId]);
|
28125
28118
|
const inputRef = useMergedRef(ref);
|
28126
|
-
const currentIndex = value
|
28119
|
+
const currentIndex = value === void 0 ? void 0 : getIndexFromValue(data, value);
|
28127
28120
|
const { getNextIndex: getNextIndex2 } = useTypeahead({ data, currentIndex });
|
28128
28121
|
const setInputValueByIndex = (index2) => {
|
28129
28122
|
if (index2 !== void 0) {
|
@@ -28138,13 +28131,13 @@ const useListbox = ({
|
|
28138
28131
|
};
|
28139
28132
|
React__namespace.useEffect(() => {
|
28140
28133
|
if (data.length && currentIndex === void 0) {
|
28141
|
-
if (defaultValue2
|
28134
|
+
if (defaultValue2 === void 0) {
|
28135
|
+
setInputValueByIndex(0);
|
28136
|
+
} else {
|
28142
28137
|
const defaultValueIndex = getIndexFromValue(data, defaultValue2);
|
28143
28138
|
if (defaultValueIndex !== void 0) {
|
28144
28139
|
setInputValueByIndex(defaultValueIndex);
|
28145
28140
|
}
|
28146
|
-
} else {
|
28147
|
-
setInputValueByIndex(0);
|
28148
28141
|
}
|
28149
28142
|
}
|
28150
28143
|
}, [data]);
|
@@ -28257,19 +28250,17 @@ const useMultiListbox = ({
|
|
28257
28250
|
let newInputValue = "";
|
28258
28251
|
const currentInputValue = (_a = inputRef.current) == null ? void 0 : _a.value;
|
28259
28252
|
const currentValuesArray = (currentInputValue == null ? void 0 : currentInputValue.split(",")) || [];
|
28260
|
-
const optionAlreadySelected = currentValuesArray.
|
28253
|
+
const optionAlreadySelected = currentValuesArray.some((val) => val === String(option.value));
|
28261
28254
|
if (option.value === "#ALL-OPTIONS#") {
|
28262
|
-
if (
|
28263
|
-
newInputValue = data.filter((option2, index22) => index22 !== 0 && !option2.disabled).map((option2) => option2.value).join(",");
|
28264
|
-
} else {
|
28255
|
+
if (allOptionsSelected) {
|
28265
28256
|
newInputValue = "";
|
28266
|
-
}
|
28267
|
-
} else {
|
28268
|
-
if (optionAlreadySelected) {
|
28269
|
-
newInputValue = currentValuesArray.filter((val) => val !== String(option.value)).join(",");
|
28270
28257
|
} else {
|
28271
|
-
newInputValue =
|
28258
|
+
newInputValue = data.filter((option2, index22) => index22 !== 0 && !option2.disabled).map((option2) => option2.value).join(",");
|
28272
28259
|
}
|
28260
|
+
} else if (optionAlreadySelected) {
|
28261
|
+
newInputValue = currentValuesArray.filter((val) => val !== String(option.value)).join(",");
|
28262
|
+
} else {
|
28263
|
+
newInputValue = currentInputValue ? `${currentInputValue},${option.value}` : option.value;
|
28273
28264
|
}
|
28274
28265
|
setInputValueByRef(inputRef.current, newInputValue);
|
28275
28266
|
}
|
@@ -28305,7 +28296,7 @@ const useMultiListbox = ({
|
|
28305
28296
|
break;
|
28306
28297
|
}
|
28307
28298
|
}
|
28308
|
-
setCurrentIndex(index2
|
28299
|
+
setCurrentIndex(index2 === void 0 ? 0 : index2);
|
28309
28300
|
if (onKeyDown) {
|
28310
28301
|
event.persist();
|
28311
28302
|
onKeyDown(event);
|
@@ -29713,7 +29704,7 @@ const $d08ef79370b62062$export$6d4de93b380beddf = $d08ef79370b62062$export$f34ec
|
|
29713
29704
|
const Content$2 = React__namespace.forwardRef(function MenuContent(props, ref) {
|
29714
29705
|
const internalRef = useMergedRef(ref);
|
29715
29706
|
const menu = useCurrentMenu();
|
29716
|
-
const { align = "start", children, placement: side, ...otherProps } = props;
|
29707
|
+
const { align = "start", children: _1, placement: side, ...otherProps } = props;
|
29717
29708
|
const className = clsx("border border-transparent rounded block outline-none p-1 yt-shadow wcag-white", props.className);
|
29718
29709
|
const childrenRefs = React__namespace.useRef([]);
|
29719
29710
|
const childrenWithRefs = React__namespace.Children.toArray(props.children).filter((child) => !!child).map((child, index2) => {
|
@@ -29887,13 +29878,11 @@ const Trigger$1 = React__namespace.forwardRef(function MenuTrigger(props, ref) {
|
|
29887
29878
|
const internalRef = useMergedRef(ref);
|
29888
29879
|
const handleKeyDown = (event) => {
|
29889
29880
|
var _a;
|
29890
|
-
if (event.key === "ArrowDown") {
|
29891
|
-
|
29892
|
-
|
29893
|
-
(
|
29894
|
-
|
29895
|
-
);
|
29896
|
-
}
|
29881
|
+
if (event.key === "ArrowDown" && isElementInsideTable3OrReport(event.currentTarget)) {
|
29882
|
+
event.preventDefault();
|
29883
|
+
(_a = event.currentTarget.parentNode) == null ? void 0 : _a.dispatchEvent(
|
29884
|
+
createCustomKeyboardEvent(event)
|
29885
|
+
);
|
29897
29886
|
}
|
29898
29887
|
};
|
29899
29888
|
React__namespace.useEffect(() => {
|
@@ -30285,7 +30274,7 @@ const OverflowGroup = React.forwardRef(function OverflowGroup2(props, ref) {
|
|
30285
30274
|
const { texts } = useLocalization();
|
30286
30275
|
const intersectedChildIndex = useIntersectionObserver(internalRef, buttonWidth);
|
30287
30276
|
const children = React.Children.toArray(props.children);
|
30288
|
-
const hiddenChildren = intersectedChildIndex
|
30277
|
+
const hiddenChildren = intersectedChildIndex === void 0 ? [] : children.slice(intersectedChildIndex);
|
30289
30278
|
const hiddenChildrenCount = hiddenChildren.length;
|
30290
30279
|
const moreButtonText = hiddenChildrenCount ? `${hiddenChildrenCount} ${texts.header.more}` : "";
|
30291
30280
|
const MoreButton = (moreButton == null ? void 0 : moreButton(moreButtonText)) ?? /* @__PURE__ */ React.createElement(IconButton, { icon: "more" });
|
@@ -30351,7 +30340,7 @@ const useSelect = ({
|
|
30351
30340
|
id: nativeId,
|
30352
30341
|
multiselect,
|
30353
30342
|
onBlur,
|
30354
|
-
onClick,
|
30343
|
+
onClick: _1,
|
30355
30344
|
onChange,
|
30356
30345
|
readOnly,
|
30357
30346
|
tabIndex,
|
@@ -30374,20 +30363,16 @@ const useSelect = ({
|
|
30374
30363
|
if (value === void 0) {
|
30375
30364
|
if (defaultValue2 !== void 0 && findByValue(flattenedData, defaultValue2)) {
|
30376
30365
|
setInputValueByRef(inputRef.current, defaultValue2);
|
30377
|
-
} else {
|
30378
|
-
|
30379
|
-
|
30380
|
-
|
30381
|
-
setInputValueByRef(inputRef.current, data[0].value);
|
30382
|
-
}
|
30366
|
+
} else if (emptyValue !== void 0) {
|
30367
|
+
setInputValueByRef(inputRef.current, emptyValue);
|
30368
|
+
} else if (data.length > 0) {
|
30369
|
+
setInputValueByRef(inputRef.current, data[0].value);
|
30383
30370
|
}
|
30384
|
-
} else {
|
30385
|
-
if (
|
30386
|
-
|
30387
|
-
|
30388
|
-
|
30389
|
-
setInputValueByRef(inputRef.current, data[0].value);
|
30390
|
-
}
|
30371
|
+
} else if (!multiselect && !findByValue(flattenedData, value)) {
|
30372
|
+
if (emptyValue !== void 0) {
|
30373
|
+
setInputValueByRef(inputRef.current, emptyValue);
|
30374
|
+
} else if (data.length > 0) {
|
30375
|
+
setInputValueByRef(inputRef.current, data[0].value);
|
30391
30376
|
}
|
30392
30377
|
}
|
30393
30378
|
}, []);
|
@@ -30533,7 +30518,7 @@ const useSelect = ({
|
|
30533
30518
|
};
|
30534
30519
|
};
|
30535
30520
|
const BaseSelect = React__namespace.forwardRef(function BaseSelect2(props, ref) {
|
30536
|
-
const { autoFocus, className: externalClassName, highlighted, style, ...otherProps } = props;
|
30521
|
+
const { autoFocus, className: externalClassName, highlighted: _1, style, ...otherProps } = props;
|
30537
30522
|
const { button, listbox, popover, input, text: text2, more = 0 } = useSelect(otherProps, ref);
|
30538
30523
|
const internalRef = React__namespace.useRef(null);
|
30539
30524
|
const selectDimensions = useBoundingClientRectListener(internalRef);
|
@@ -30918,7 +30903,7 @@ const RadioGroupItem = React__namespace.forwardRef(function RadioGroupItem2(prop
|
|
30918
30903
|
);
|
30919
30904
|
});
|
30920
30905
|
const RadioGroup2 = React__namespace.forwardRef(function RadioGroup22(props, ref) {
|
30921
|
-
const { disabled, invalid, required, readOnly, orientation = "vertical", ...otherProps } = props;
|
30906
|
+
const { disabled: _1, invalid: _2, required: _3, readOnly: _4, orientation = "vertical", ...otherProps } = props;
|
30922
30907
|
const values = React__namespace.useMemo(() => {
|
30923
30908
|
const radioGroupItemValues = [];
|
30924
30909
|
React__namespace.Children.forEach(props.children, (child) => {
|
@@ -30933,9 +30918,9 @@ const RadioGroup2 = React__namespace.forwardRef(function RadioGroup22(props, ref
|
|
30933
30918
|
let defaultValue2;
|
30934
30919
|
if (props.onChange) {
|
30935
30920
|
handleChange = (value2) => props.onChange(getRadioItemByValue(values, value2));
|
30936
|
-
value = props.value
|
30921
|
+
value = props.value === void 0 ? void 0 : String(props.value ?? "");
|
30937
30922
|
} else {
|
30938
|
-
defaultValue2 = props.defaultValue
|
30923
|
+
defaultValue2 = props.defaultValue === void 0 ? void 0 : String(props.defaultValue ?? "");
|
30939
30924
|
}
|
30940
30925
|
const className = clsx(
|
30941
30926
|
"flex items-start",
|
@@ -34760,11 +34745,11 @@ class DataType {
|
|
34760
34745
|
const localeNumberSeparators = /* @__PURE__ */ new Map();
|
34761
34746
|
class NumericDataType extends DataType {
|
34762
34747
|
static format(value, locale2, options) {
|
34763
|
-
if (value === void 0 || typeof value !== "number" || isNaN(value)) {
|
34748
|
+
if (value === void 0 || typeof value !== "number" || Number.isNaN(value)) {
|
34764
34749
|
return "";
|
34765
34750
|
}
|
34766
34751
|
const localisedValue = new Intl.NumberFormat(locale2, options).format(value);
|
34767
|
-
return localisedValue.
|
34752
|
+
return localisedValue.replaceAll(/[\u00A0\u202F]/g, " ");
|
34768
34753
|
}
|
34769
34754
|
static parse(value, locale2) {
|
34770
34755
|
if (value === void 0 || value === null || typeof value !== "string") {
|
@@ -34773,7 +34758,7 @@ class NumericDataType extends DataType {
|
|
34773
34758
|
if (value === "Infinity" || value === "-Infinity") {
|
34774
34759
|
return Number(value);
|
34775
34760
|
}
|
34776
|
-
let sanitizedValue = value.replaceAll(" ", "").
|
34761
|
+
let sanitizedValue = value.replaceAll(" ", "").replaceAll(/[^0-9.,-]+/g, "");
|
34777
34762
|
if (!sanitizedValue.length) {
|
34778
34763
|
return void 0;
|
34779
34764
|
}
|
@@ -34784,7 +34769,7 @@ class NumericDataType extends DataType {
|
|
34784
34769
|
sanitizedValue = sanitizedValue.replaceAll(",", "");
|
34785
34770
|
}
|
34786
34771
|
const output = Number(sanitizedValue);
|
34787
|
-
if (isNaN(output)) {
|
34772
|
+
if (Number.isNaN(output)) {
|
34788
34773
|
return void 0;
|
34789
34774
|
}
|
34790
34775
|
return output;
|
@@ -34810,10 +34795,10 @@ class DateTimeDataType extends DataType {
|
|
34810
34795
|
} else {
|
34811
34796
|
return "";
|
34812
34797
|
}
|
34813
|
-
if (isNaN(date2.getTime())) {
|
34798
|
+
if (Number.isNaN(date2.getTime())) {
|
34814
34799
|
return "";
|
34815
34800
|
}
|
34816
|
-
return new Intl.DateTimeFormat(locale2, options).format(date2).
|
34801
|
+
return new Intl.DateTimeFormat(locale2, options).format(date2).replaceAll(/[\u00A0\u202F]/g, " ");
|
34817
34802
|
}
|
34818
34803
|
static parse(value, locale2) {
|
34819
34804
|
if (value === void 0 || value === null || typeof value !== "string") {
|
@@ -34866,8 +34851,9 @@ class DateTimeDataType extends DataType {
|
|
34866
34851
|
return mask2 + "MM";
|
34867
34852
|
case "year":
|
34868
34853
|
return mask2 + "yyyy";
|
34854
|
+
default:
|
34855
|
+
return mask2;
|
34869
34856
|
}
|
34870
|
-
return mask2;
|
34871
34857
|
}, "");
|
34872
34858
|
localeDateMasks.set(locale2, mask);
|
34873
34859
|
return mask;
|
@@ -35041,7 +35027,8 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35041
35027
|
case TableFilterComparator.IsEqualTo: {
|
35042
35028
|
if (dataType === "boolean") {
|
35043
35029
|
return cellValue === query;
|
35044
|
-
}
|
35030
|
+
}
|
35031
|
+
if (isDateColumn) {
|
35045
35032
|
return isWeakEqual$1(query, valueAsDate);
|
35046
35033
|
}
|
35047
35034
|
return evaluate(isWeakEqual);
|
@@ -35049,7 +35036,8 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35049
35036
|
case TableFilterComparator.IsNotEqualTo: {
|
35050
35037
|
if (dataType === "boolean") {
|
35051
35038
|
return cellValue !== query;
|
35052
|
-
}
|
35039
|
+
}
|
35040
|
+
if (isDateColumn) {
|
35053
35041
|
return !isWeakEqual$1(query, valueAsDate);
|
35054
35042
|
}
|
35055
35043
|
return !evaluate(isWeakEqual);
|
@@ -35057,7 +35045,8 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35057
35045
|
case TableFilterComparator.IsGreaterThan: {
|
35058
35046
|
if (isDateColumn) {
|
35059
35047
|
return query.getTime() < valueAsDate.getTime();
|
35060
|
-
}
|
35048
|
+
}
|
35049
|
+
if (isNumberColumn) {
|
35061
35050
|
return compareNumbers2((q, v2) => q < v2);
|
35062
35051
|
}
|
35063
35052
|
return false;
|
@@ -35065,7 +35054,8 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35065
35054
|
case TableFilterComparator.IsLessThan: {
|
35066
35055
|
if (isDateColumn) {
|
35067
35056
|
return query.getTime() > valueAsDate.getTime();
|
35068
|
-
}
|
35057
|
+
}
|
35058
|
+
if (isNumberColumn) {
|
35069
35059
|
return compareNumbers2((q, v2) => q > v2);
|
35070
35060
|
}
|
35071
35061
|
return false;
|
@@ -35073,7 +35063,8 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35073
35063
|
case TableFilterComparator.IsLessThanOrEqualTo: {
|
35074
35064
|
if (isDateColumn) {
|
35075
35065
|
return query.getTime() > valueAsDate.getTime() || isWeakEqual$1(valueAsDate, query);
|
35076
|
-
}
|
35066
|
+
}
|
35067
|
+
if (isNumberColumn) {
|
35077
35068
|
return compareNumbers2((q, v2) => q >= v2);
|
35078
35069
|
}
|
35079
35070
|
return false;
|
@@ -35081,7 +35072,8 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35081
35072
|
case TableFilterComparator.IsGreaterThanOrEqualTo: {
|
35082
35073
|
if (isDateColumn) {
|
35083
35074
|
return query.getTime() < valueAsDate.getTime() || isWeakEqual$1(valueAsDate, query);
|
35084
|
-
}
|
35075
|
+
}
|
35076
|
+
if (isNumberColumn) {
|
35085
35077
|
return compareNumbers2((q, v2) => q <= v2);
|
35086
35078
|
}
|
35087
35079
|
return false;
|
@@ -35091,14 +35083,17 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35091
35083
|
if (isDateColumn) {
|
35092
35084
|
if (fromValue !== void 0 && valueAsDate.getTime() < fromValue.getTime()) {
|
35093
35085
|
return false;
|
35094
|
-
}
|
35086
|
+
}
|
35087
|
+
if (toValue2 !== void 0 && valueAsDate.getTime() > toValue2.getTime()) {
|
35095
35088
|
return false;
|
35096
35089
|
}
|
35097
35090
|
return true;
|
35098
|
-
}
|
35091
|
+
}
|
35092
|
+
if (isNumberColumn) {
|
35099
35093
|
if (fromValue !== void 0 && cellValue < fromValue) {
|
35100
35094
|
return false;
|
35101
|
-
}
|
35095
|
+
}
|
35096
|
+
if (toValue2 !== void 0 && cellValue > toValue2) {
|
35102
35097
|
return false;
|
35103
35098
|
}
|
35104
35099
|
return true;
|
@@ -35123,8 +35118,9 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35123
35118
|
}
|
35124
35119
|
return query.every((v2) => !isWeakEqual(String(cellValue), v2));
|
35125
35120
|
}
|
35121
|
+
default:
|
35122
|
+
return false;
|
35126
35123
|
}
|
35127
|
-
return false;
|
35128
35124
|
} catch (e3) {
|
35129
35125
|
console.error(e3);
|
35130
35126
|
return true;
|
@@ -35136,29 +35132,29 @@ const flattenCellValue = (cellValue) => {
|
|
35136
35132
|
function isMatched(query, cellValue, rowValue, dataType, dataTypeOptions, localization, matcher = isWeakContains) {
|
35137
35133
|
if (typeof cellValue === "object") {
|
35138
35134
|
return flattenCellValue(cellValue).flat(Infinity).find((y2) => matcher(y2, query));
|
35135
|
+
}
|
35136
|
+
const dataTypeProperties = getDataTypeProperties(dataType);
|
35137
|
+
if (dataTypeProperties.getDisplayValue) {
|
35138
|
+
const cellDisplayValue = dataTypeProperties.getDisplayValue(cellValue, rowValue, {
|
35139
|
+
dataTypeOptions,
|
35140
|
+
localization
|
35141
|
+
});
|
35142
|
+
if (Array.isArray(cellDisplayValue)) {
|
35143
|
+
return cellDisplayValue.some((cdv) => matcher(cdv, query));
|
35144
|
+
}
|
35145
|
+
if (cellDisplayValue !== void 0 && isWeakContains(cellDisplayValue, query)) {
|
35146
|
+
return true;
|
35147
|
+
}
|
35139
35148
|
} else {
|
35140
|
-
const
|
35141
|
-
if (
|
35142
|
-
|
35143
|
-
dataTypeOptions,
|
35144
|
-
localization
|
35145
|
-
});
|
35146
|
-
if (Array.isArray(cellDisplayValue)) {
|
35147
|
-
return cellDisplayValue.some((cdv) => matcher(cdv, query));
|
35148
|
-
} else if (cellDisplayValue !== void 0 && isWeakContains(cellDisplayValue, query)) {
|
35149
|
-
return true;
|
35150
|
-
}
|
35151
|
-
} else {
|
35152
|
-
const cellValueAsString = String(cellValue ?? "");
|
35153
|
-
if (cellValueAsString !== void 0 && matcher(cellValueAsString, query)) {
|
35154
|
-
return true;
|
35155
|
-
}
|
35149
|
+
const cellValueAsString = String(cellValue ?? "");
|
35150
|
+
if (cellValueAsString !== void 0 && matcher(cellValueAsString, query)) {
|
35151
|
+
return true;
|
35156
35152
|
}
|
35157
|
-
|
35158
|
-
|
35159
|
-
|
35160
|
-
|
35161
|
-
|
35153
|
+
}
|
35154
|
+
if (typeof query !== typeof cellValue && dataTypeProperties.parse) {
|
35155
|
+
const parsedQuery = dataTypeProperties.parse(query, localization.locale);
|
35156
|
+
if (parsedQuery !== void 0 && matcher(cellValue, parsedQuery)) {
|
35157
|
+
return true;
|
35162
35158
|
}
|
35163
35159
|
}
|
35164
35160
|
return false;
|
@@ -35209,7 +35205,7 @@ function resetHighlightedColumnIndexes(searchQuery, table, localization) {
|
|
35209
35205
|
indexes.push([rowIndex, columnIndex]);
|
35210
35206
|
}
|
35211
35207
|
}
|
35212
|
-
} catch
|
35208
|
+
} catch {
|
35213
35209
|
}
|
35214
35210
|
});
|
35215
35211
|
});
|
@@ -35256,12 +35252,10 @@ function orderColumn(column, { orderingDisabled, orderingEnabled }) {
|
|
35256
35252
|
groupedColumn.columns.forEach(
|
35257
35253
|
(subcolumn) => orderColumn(subcolumn, { orderingDisabled, orderingEnabled })
|
35258
35254
|
);
|
35255
|
+
} else if ((_a = column.meta) == null ? void 0 : _a.enableOrdering) {
|
35256
|
+
orderingEnabled.push(column.id);
|
35259
35257
|
} else {
|
35260
|
-
|
35261
|
-
orderingEnabled.push(column.id);
|
35262
|
-
} else {
|
35263
|
-
orderingDisabled.push(column.id);
|
35264
|
-
}
|
35258
|
+
orderingDisabled.push(column.id);
|
35265
35259
|
}
|
35266
35260
|
}
|
35267
35261
|
function ensureOrdering(columns, settingsOrder, pinnedOrder = [], internalColumnsPinnedToTheRight = ["__actions"]) {
|
@@ -35272,6 +35266,7 @@ function ensureOrdering(columns, settingsOrder, pinnedOrder = [], internalColumn
|
|
35272
35266
|
if (Array.isArray(settingsOrder)) {
|
35273
35267
|
orderedColumns = columns.slice().sort(
|
35274
35268
|
// the magic >>> 0 here ensures that columns that aren't found in settings, but are children, are pushed to the end
|
35269
|
+
// oxlint-disable-next-line no-bitwise, prefer-math-trunc
|
35275
35270
|
(a2, b2) => (settingsOrder.indexOf(a2.id) >>> 0) - (settingsOrder.indexOf(b2.id) >>> 0)
|
35276
35271
|
);
|
35277
35272
|
}
|
@@ -35296,12 +35291,13 @@ function ensureOrdering(columns, settingsOrder, pinnedOrder = [], internalColumn
|
|
35296
35291
|
if (Array.isArray(pinnedOrder)) {
|
35297
35292
|
orderingEnabled.sort(
|
35298
35293
|
// the magic >>> 0 here ensures that columns that aren't found in settings, but are children, are pushed to the end
|
35294
|
+
// oxlint-disable-next-line no-bitwise, prefer-math-trunc
|
35299
35295
|
(a2, b2) => (pinnedOrder.indexOf(a2) >>> 0) - (pinnedOrder.indexOf(b2) >>> 0)
|
35300
35296
|
);
|
35301
35297
|
}
|
35302
35298
|
const order2 = [...internalColumns, ...orderingDisabled, ...orderingEnabled];
|
35303
35299
|
internalColumnsPinnedToTheRight.forEach((id2) => {
|
35304
|
-
if (columns.
|
35300
|
+
if (columns.some((column) => column.id === id2)) {
|
35305
35301
|
order2.push(id2);
|
35306
35302
|
}
|
35307
35303
|
});
|
@@ -35469,7 +35465,7 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
|
|
35469
35465
|
column.cell = (info) => formattedValueRenderer(info.getValue(), info.row.original);
|
35470
35466
|
}
|
35471
35467
|
if (typeof footer === "function") {
|
35472
|
-
column.footer = (info) => footer(info.table.getRowModel().rows.flatMap((row) => row.original
|
35468
|
+
column.footer = (info) => footer(info.table.getRowModel().rows.flatMap((row) => row.original === void 0 ? [] : row.original));
|
35473
35469
|
}
|
35474
35470
|
if (enableColumnFilter) {
|
35475
35471
|
column.filterFn = "tacoFilter";
|
@@ -35650,12 +35646,10 @@ function useReactTableInitialState(props, columns, persistedSettings, defaults2)
|
|
35650
35646
|
columnOrder.indexOf(columnPinning.left[columnPinning.left.length - 1]),
|
35651
35647
|
columnOrder
|
35652
35648
|
);
|
35649
|
+
} else if (props.defaultColumnFreezingIndex === void 0) {
|
35650
|
+
columnPinning.left = unfreezeAllExternalColumns(columnOrder);
|
35653
35651
|
} else {
|
35654
|
-
|
35655
|
-
columnPinning.left = freezeUptoExternalColumn(props.defaultColumnFreezingIndex, columnOrder);
|
35656
|
-
} else {
|
35657
|
-
columnPinning.left = unfreezeAllExternalColumns(columnOrder);
|
35658
|
-
}
|
35652
|
+
columnPinning.left = freezeUptoExternalColumn(props.defaultColumnFreezingIndex, columnOrder);
|
35659
35653
|
}
|
35660
35654
|
const columnSizing = {
|
35661
35655
|
...defaults2.defaultSizing,
|
@@ -35868,9 +35862,8 @@ const useLocalStorage = (key, initialValue) => {
|
|
35868
35862
|
if (typeof localStorageValue !== "string") {
|
35869
35863
|
localStorage.setItem(key, JSON.stringify(initialValue));
|
35870
35864
|
return initialValue;
|
35871
|
-
} else {
|
35872
|
-
return JSON.parse(localStorageValue || "null");
|
35873
35865
|
}
|
35866
|
+
return JSON.parse(localStorageValue || "null");
|
35874
35867
|
} catch {
|
35875
35868
|
return initialValue;
|
35876
35869
|
}
|
@@ -35948,7 +35941,7 @@ function useTableRowActive$1(isEnabled = false, initialRowActiveIndex) {
|
|
35948
35941
|
const [rowHoverIndex, setRowHoverIndex] = React.useState(void 0);
|
35949
35942
|
const [isHoverStatePaused, setHoverStatePaused] = useIsHoverStatePaused();
|
35950
35943
|
const move = (direction, length, scrollToIndex) => {
|
35951
|
-
const nextIndex = rowActiveIndex
|
35944
|
+
const nextIndex = rowActiveIndex === void 0 ? 0 : getNextIndex(direction, rowActiveIndex, length);
|
35952
35945
|
scrollToIndex(nextIndex);
|
35953
35946
|
setTimeout(() => setRowActiveIndex(nextIndex), 50);
|
35954
35947
|
};
|
@@ -35970,7 +35963,8 @@ function useTableRowActive$1(isEnabled = false, initialRowActiveIndex) {
|
|
35970
35963
|
move(-1, length, scrollToIndex);
|
35971
35964
|
}
|
35972
35965
|
return;
|
35973
|
-
}
|
35966
|
+
}
|
35967
|
+
if (event.key === "ArrowDown") {
|
35974
35968
|
event.preventDefault();
|
35975
35969
|
if (event.ctrlKey || event.metaKey) {
|
35976
35970
|
const newIndex = length - 1;
|
@@ -36103,7 +36097,8 @@ function useTableRowSelection(isEnabled = false) {
|
|
36103
36097
|
(_b = rows[rowActiveIndex]) == null ? void 0 : _b.toggleSelected();
|
36104
36098
|
}
|
36105
36099
|
return;
|
36106
|
-
}
|
36100
|
+
}
|
36101
|
+
if ((event.ctrlKey || event.metaKey) && event.key === "a" && !["INPUT", "TEXTAREA"].includes((_c = event.target) == null ? void 0 : _c.tagName)) {
|
36107
36102
|
event.preventDefault();
|
36108
36103
|
table.toggleAllRowsSelected();
|
36109
36104
|
return;
|
@@ -36165,9 +36160,8 @@ function useTableDataLoader(fetchPage, fetchAll, options = { pageSize: DEFAULT_P
|
|
36165
36160
|
}
|
36166
36161
|
if (_pendingPageRequests.current[pageIndex]) {
|
36167
36162
|
return;
|
36168
|
-
} else {
|
36169
|
-
_pendingPageRequests.current[pageIndex] = true;
|
36170
36163
|
}
|
36164
|
+
_pendingPageRequests.current[pageIndex] = true;
|
36171
36165
|
_lastUsedPageIndex.current = pageIndex;
|
36172
36166
|
_lastUsedSorting.current = sorting;
|
36173
36167
|
_lastUsedFilters.current = filters;
|
@@ -36178,7 +36172,7 @@ function useTableDataLoader(fetchPage, fetchAll, options = { pageSize: DEFAULT_P
|
|
36178
36172
|
let nextData;
|
36179
36173
|
if (reset || length.current !== response.length) {
|
36180
36174
|
length.current = response.length;
|
36181
|
-
nextData = Array(length.current).fill(void 0);
|
36175
|
+
nextData = Array.from({ length: length.current }).fill(void 0);
|
36182
36176
|
} else {
|
36183
36177
|
nextData = [...currentData];
|
36184
36178
|
}
|
@@ -36200,11 +36194,11 @@ function useTableDataLoader(fetchPage, fetchAll, options = { pageSize: DEFAULT_P
|
|
36200
36194
|
length.current = response.length;
|
36201
36195
|
setData(() => {
|
36202
36196
|
let nextData;
|
36203
|
-
if (response.data.length
|
36204
|
-
nextData = Array(response.length).fill(void 0);
|
36205
|
-
nextData.splice(0, response.data.length, ...response.data);
|
36206
|
-
} else {
|
36197
|
+
if (response.data.length === response.length) {
|
36207
36198
|
nextData = [...response.data];
|
36199
|
+
} else {
|
36200
|
+
nextData = Array.from({ length: response.length }).fill(void 0);
|
36201
|
+
nextData.splice(0, response.data.length, ...response.data);
|
36208
36202
|
}
|
36209
36203
|
return nextData;
|
36210
36204
|
});
|
@@ -36212,7 +36206,6 @@ function useTableDataLoader(fetchPage, fetchAll, options = { pageSize: DEFAULT_P
|
|
36212
36206
|
}
|
36213
36207
|
};
|
36214
36208
|
const reloadCurrentPages = async (pageIndex, sorting, filters, hiddenColumns) => {
|
36215
|
-
_lastUsedPageIndex.current;
|
36216
36209
|
const pageIndexes = pageIndex === 0 ? [0, 1] : [pageIndex - 1, pageIndex];
|
36217
36210
|
if (length.current !== void 0) {
|
36218
36211
|
const pageCount = Math.ceil(length.current / pageSize);
|
@@ -36230,7 +36223,7 @@ function useTableDataLoader(fetchPage, fetchAll, options = { pageSize: DEFAULT_P
|
|
36230
36223
|
pageIndexes.map((pageIndex2) => fetchPage(pageIndex2, pageSize, sorting, filters, hiddenColumns))
|
36231
36224
|
);
|
36232
36225
|
length.current = responses[0].length;
|
36233
|
-
const nextData = Array(length.current).fill(void 0);
|
36226
|
+
const nextData = Array.from({ length: length.current }).fill(void 0);
|
36234
36227
|
responses.forEach((response, index2) => {
|
36235
36228
|
const startIndex = pageIndexes[index2] * pageSize;
|
36236
36229
|
nextData.splice(startIndex, pageSize, ...response.data);
|
@@ -36243,36 +36236,33 @@ function useTableDataLoader(fetchPage, fetchAll, options = { pageSize: DEFAULT_P
|
|
36243
36236
|
};
|
36244
36237
|
const invalidate = async () => {
|
36245
36238
|
if (_lastUsedSearch.current) {
|
36246
|
-
return loadAll(_lastUsedSorting.current, _lastUsedFilters.current, _lastUsedHiddenColumns.current);
|
36247
|
-
} else {
|
36248
|
-
return reloadCurrentPages(
|
36249
|
-
_lastUsedPageIndex.current ?? 0,
|
36250
|
-
_lastUsedSorting.current,
|
36251
|
-
_lastUsedFilters.current,
|
36252
|
-
_lastUsedHiddenColumns.current
|
36253
|
-
);
|
36239
|
+
return await loadAll(_lastUsedSorting.current, _lastUsedFilters.current, _lastUsedHiddenColumns.current);
|
36254
36240
|
}
|
36241
|
+
return await reloadCurrentPages(
|
36242
|
+
_lastUsedPageIndex.current ?? 0,
|
36243
|
+
_lastUsedSorting.current,
|
36244
|
+
_lastUsedFilters.current,
|
36245
|
+
_lastUsedHiddenColumns.current
|
36246
|
+
);
|
36255
36247
|
};
|
36256
36248
|
const handleSort = async (sorting) => {
|
36257
36249
|
if (_lastUsedSearch.current) {
|
36258
|
-
return loadAll(sorting, _lastUsedFilters.current, _lastUsedHiddenColumns.current);
|
36259
|
-
} else {
|
36260
|
-
return reloadCurrentPages(
|
36261
|
-
_lastUsedPageIndex.current ?? 0,
|
36262
|
-
sorting,
|
36263
|
-
_lastUsedFilters.current,
|
36264
|
-
_lastUsedHiddenColumns.current
|
36265
|
-
);
|
36250
|
+
return await loadAll(sorting, _lastUsedFilters.current, _lastUsedHiddenColumns.current);
|
36266
36251
|
}
|
36252
|
+
return await reloadCurrentPages(
|
36253
|
+
_lastUsedPageIndex.current ?? 0,
|
36254
|
+
sorting,
|
36255
|
+
_lastUsedFilters.current,
|
36256
|
+
_lastUsedHiddenColumns.current
|
36257
|
+
);
|
36267
36258
|
};
|
36268
36259
|
const handleFilter = async (filters) => {
|
36269
36260
|
if (_lastUsedSearch.current) {
|
36270
|
-
return loadAll(_lastUsedSorting.current, filters, _lastUsedHiddenColumns.current);
|
36271
|
-
} else {
|
36272
|
-
return loadPage(_lastUsedPageIndex.current ?? 0, _lastUsedSorting.current, filters, _lastUsedHiddenColumns.current);
|
36261
|
+
return await loadAll(_lastUsedSorting.current, filters, _lastUsedHiddenColumns.current);
|
36273
36262
|
}
|
36263
|
+
return await loadPage(_lastUsedPageIndex.current ?? 0, _lastUsedSorting.current, filters, _lastUsedHiddenColumns.current);
|
36274
36264
|
};
|
36275
|
-
const handleSearch =
|
36265
|
+
const handleSearch = (search) => {
|
36276
36266
|
_lastUsedSearch.current = search || void 0;
|
36277
36267
|
};
|
36278
36268
|
return [
|
@@ -36365,7 +36355,8 @@ function useEnabledSettings(isEnabled) {
|
|
36365
36355
|
),
|
36366
36356
|
false
|
36367
36357
|
];
|
36368
|
-
}
|
36358
|
+
}
|
36359
|
+
if (isEnabled === true) {
|
36369
36360
|
return [DEFAULT_ENABLED_OPTIONS, true];
|
36370
36361
|
}
|
36371
36362
|
const options = { ...DEFAULT_ENABLED_OPTIONS, ...isEnabled };
|
@@ -36411,9 +36402,8 @@ function useLazyEffect(effect, deps) {
|
|
36411
36402
|
React.useEffect(() => {
|
36412
36403
|
if (readyRef.current) {
|
36413
36404
|
return effect();
|
36414
|
-
} else {
|
36415
|
-
readyRef.current = true;
|
36416
36405
|
}
|
36406
|
+
readyRef.current = true;
|
36417
36407
|
}, deps);
|
36418
36408
|
React.useEffect(
|
36419
36409
|
() => () => {
|
@@ -36666,7 +36656,7 @@ function useTableRowActiveListener$1(table, onRowActive) {
|
|
36666
36656
|
var _a;
|
36667
36657
|
const meta = table.options.meta;
|
36668
36658
|
const rows = table.getRowModel().flatRows;
|
36669
|
-
const currentRow = meta.rowActive.rowActiveIndex
|
36659
|
+
const currentRow = meta.rowActive.rowActiveIndex === void 0 ? void 0 : (_a = rows[meta.rowActive.rowActiveIndex]) == null ? void 0 : _a.original;
|
36670
36660
|
React.useEffect(() => {
|
36671
36661
|
if (meta.rowActive.isEnabled && onRowActive) {
|
36672
36662
|
onRowActive(currentRow);
|
@@ -37834,7 +37824,7 @@ function RowWithServerLoading(props) {
|
|
37834
37824
|
}
|
37835
37825
|
const Skeleton = React.forwardRef(function Skeleton2(props, ref) {
|
37836
37826
|
const { cellsCount, index: index2 } = props;
|
37837
|
-
return /* @__PURE__ */ React.createElement("tr", { "data-row-index": index2, "data-row-id": index2, ref }, Array(cellsCount).
|
37827
|
+
return /* @__PURE__ */ React.createElement("tr", { "data-row-index": index2, "data-row-id": index2, ref }, Array.from({ length: cellsCount }).map((_, index22) => /* @__PURE__ */ React.createElement("td", { key: index22 }, /* @__PURE__ */ React.createElement("span", { className: "bg-grey-100 text-grey-700 h-4 w-full text-center text-xs" }))));
|
37838
37828
|
});
|
37839
37829
|
function getScrollPaddingEndOffset(table) {
|
37840
37830
|
const tableMeta = table.options.meta;
|
@@ -37917,8 +37907,8 @@ function useTableRenderer(renderers, table, tableRef, length, defaultRowActiveIn
|
|
37917
37907
|
if (count2 || table.getBottomRows().length) {
|
37918
37908
|
style = {
|
37919
37909
|
height: totalSize,
|
37920
|
-
paddingBottom: isNaN(paddingBottom) ? 0 : paddingBottom,
|
37921
|
-
paddingTop: isNaN(paddingTop) ? 0 : paddingTop
|
37910
|
+
paddingBottom: Number.isNaN(paddingBottom) ? 0 : paddingBottom,
|
37911
|
+
paddingTop: Number.isNaN(paddingTop) ? 0 : paddingTop
|
37922
37912
|
};
|
37923
37913
|
}
|
37924
37914
|
if (count2) {
|
@@ -38011,19 +38001,19 @@ function useTableRowActiveListener(table, tableRef) {
|
|
38011
38001
|
}, [tableMeta.rowActive.rowActiveIndex]);
|
38012
38002
|
}
|
38013
38003
|
function Actions(props) {
|
38014
|
-
var _a;
|
38004
|
+
var _a, _b;
|
38015
38005
|
const { actions, actionsLength, data, isActiveRow, rowId, table } = props;
|
38016
38006
|
const { texts } = useLocalization();
|
38017
38007
|
const tableMeta = table.options.meta;
|
38018
38008
|
const visibleActions = actions.map((action) => {
|
38019
|
-
var _a2,
|
38009
|
+
var _a2, _b2;
|
38020
38010
|
const helpers = {
|
38021
38011
|
rowId,
|
38022
38012
|
table
|
38023
38013
|
};
|
38024
38014
|
if ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEnabled) {
|
38025
38015
|
helpers.editing = {
|
38026
|
-
isEditing: ((
|
38016
|
+
isEditing: ((_b2 = tableMeta.editing) == null ? void 0 : _b2.isEditing) ?? false,
|
38027
38017
|
removeRowChanges: () => tableMeta.editing.discardChanges(rowId, table),
|
38028
38018
|
save: () => tableMeta.editing.saveChanges(table, rowId)
|
38029
38019
|
};
|
@@ -38031,16 +38021,16 @@ function Actions(props) {
|
|
38031
38021
|
return action(data, helpers);
|
38032
38022
|
}).filter((action) => !!action);
|
38033
38023
|
let length = actionsLength;
|
38034
|
-
if ((_a = tableMeta.editing) == null ? void 0 : _a.isEditing) {
|
38024
|
+
if (((_a = tableMeta.editing) == null ? void 0 : _a.isEditing) && ((_b = tableMeta.editing) == null ? void 0 : _b.showEditingActions)) {
|
38035
38025
|
const lengthWithoutEditingItems = visibleActions.length - 1;
|
38036
38026
|
if (lengthWithoutEditingItems < actionsLength) {
|
38037
38027
|
length = lengthWithoutEditingItems;
|
38038
38028
|
}
|
38039
38029
|
}
|
38040
38030
|
const handleMenuButtonKeyDown = (event) => {
|
38041
|
-
var _a2,
|
38031
|
+
var _a2, _b2;
|
38042
38032
|
const isLastRowActive = tableMeta.rowActive.rowActiveIndex === tableMeta.length - 1;
|
38043
|
-
if (event.key === "Tab" && isLastRowActive && ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEditing) && ((
|
38033
|
+
if (event.key === "Tab" && isLastRowActive && ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEditing) && ((_b2 = tableMeta.editing) == null ? void 0 : _b2.hasChanges())) {
|
38044
38034
|
tableMeta.editing.saveChanges(table);
|
38045
38035
|
}
|
38046
38036
|
};
|
@@ -38069,9 +38059,9 @@ function Actions(props) {
|
|
38069
38059
|
onKeyDown: handleMenuButtonKeyDown,
|
38070
38060
|
tabIndex: isActiveRow ? 0 : -1,
|
38071
38061
|
menu: (menuProps) => /* @__PURE__ */ React.createElement(Menu$1, { ...menuProps }, /* @__PURE__ */ React.createElement(Menu$1.Content, { onKeyDown: handleMenuContentKeyDown }, actionsInMenu.map((action, i2) => {
|
38072
|
-
var _a2;
|
38062
|
+
var _a2, _b2;
|
38073
38063
|
const item = /* @__PURE__ */ React.createElement(Menu$1.Item, { key: i2, ...action.props, shortcut: action.props.shortcut }, action.props["aria-label"]);
|
38074
|
-
const isFirstEditingMenuItem = ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEditing) && actionsInMenu.length > 2 && i2 === actionsInMenu.length - 2;
|
38064
|
+
const isFirstEditingMenuItem = ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEditing) && ((_b2 = tableMeta.editing) == null ? void 0 : _b2.showEditingActions) && actionsInMenu.length > 2 && i2 === actionsInMenu.length - 2;
|
38075
38065
|
if (isFirstEditingMenuItem) {
|
38076
38066
|
return /* @__PURE__ */ React.createElement(React.Fragment, { key: i2 }, /* @__PURE__ */ React.createElement(Menu$1.Separator, null), item);
|
38077
38067
|
}
|
@@ -38506,114 +38496,115 @@ const useResizeObserver$1 = (ref, enabled = true) => {
|
|
38506
38496
|
}, [enabled]);
|
38507
38497
|
return size2;
|
38508
38498
|
};
|
38509
|
-
const DisplayRow = React.memo(
|
38510
|
-
|
38511
|
-
|
38512
|
-
|
38513
|
-
|
38514
|
-
|
38515
|
-
|
38516
|
-
|
38517
|
-
|
38518
|
-
|
38519
|
-
const handleClick = React.useCallback(
|
38520
|
-
(event) => {
|
38521
|
-
var _a2;
|
38522
|
-
const clickedElement = event.target;
|
38523
|
-
if (!((_a2 = event.currentTarget) == null ? void 0 : _a2.contains(event.target)) || isElementInteractive(clickedElement)) {
|
38524
|
-
return;
|
38525
|
-
}
|
38526
|
-
tableMeta.rowClick.handleClick(event, row.original);
|
38527
|
-
},
|
38528
|
-
[row.original]
|
38529
|
-
);
|
38530
|
-
const handleClickCapture = React.useCallback(() => {
|
38531
|
-
tableMeta.rowActive.setRowActiveIndex(index2);
|
38532
|
-
}, [index2]);
|
38533
|
-
if (tableMeta.rowActive.isEnabled) {
|
38534
|
-
attributes["data-row-active"] = tableMeta.rowActive.rowActiveIndex === index2 ? true : void 0;
|
38535
|
-
attributes.onClickCapture = handleClickCapture;
|
38536
|
-
}
|
38537
|
-
if (tableMeta.rowClick.isEnabled(row.original)) {
|
38538
|
-
attributes.onClick = handleClick;
|
38539
|
-
}
|
38540
|
-
if (tableMeta.rowDrag.isEnabled) {
|
38541
|
-
attributes["aria-grabbed"] = !!tableMeta.rowDrag.dragging[row.id];
|
38542
|
-
attributes.draggable = true;
|
38543
|
-
const GHOST_ELEMENT_ID = "taco_table_dragging";
|
38544
|
-
attributes.onDragStart = (event) => {
|
38545
|
-
var _a2, _b2, _c2, _d;
|
38546
|
-
let rows = [row];
|
38547
|
-
if (row.getCanSelect()) {
|
38548
|
-
rows = row.getIsSelected() ? table.getSelectedRowModel().rows : [row, ...table.getSelectedRowModel().rows];
|
38549
|
-
}
|
38550
|
-
const data = rows.map((row2) => row2.original);
|
38551
|
-
(_b2 = (_a2 = tableMeta.rowDrag).setDragging) == null ? void 0 : _b2.call(
|
38552
|
-
_a2,
|
38553
|
-
rows.reduce((dragging, rowBeingDragged) => ({ ...dragging, [rowBeingDragged.id]: true }), {})
|
38554
|
-
);
|
38555
|
-
event.dataTransfer.setData("text", JSON.stringify(data));
|
38556
|
-
const showPlaceholder = (text2) => {
|
38557
|
-
const ghost = document.createElement("div");
|
38558
|
-
ghost.id = GHOST_ELEMENT_ID;
|
38559
|
-
ghost.className = "wcag-blue rounded flex w-48 p-4 absolute -ml-[100vw]";
|
38560
|
-
ghost.innerText = text2;
|
38561
|
-
document.body.appendChild(ghost);
|
38562
|
-
event.dataTransfer.setDragImage(ghost, 0, 0);
|
38563
|
-
};
|
38564
|
-
const setDataTransfer = (text2) => event.dataTransfer.setData("text", text2);
|
38565
|
-
(_d = (_c2 = tableMeta.rowDrag).handleRowDrag) == null ? void 0 : _d.call(_c2, data, showPlaceholder, setDataTransfer);
|
38566
|
-
};
|
38567
|
-
attributes.onDragEnd = () => {
|
38568
|
-
var _a2, _b2, _c2;
|
38569
|
-
(_a2 = document.getElementById(GHOST_ELEMENT_ID)) == null ? void 0 : _a2.remove();
|
38570
|
-
(_c2 = (_b2 = tableMeta.rowDrag).setDragging) == null ? void 0 : _c2.call(_b2, {});
|
38499
|
+
const DisplayRow = React.memo(
|
38500
|
+
React.forwardRef(function DisplayRow2(props, externalRef) {
|
38501
|
+
var _a, _b, _c;
|
38502
|
+
const { children, cellRenderer: CellRenderer, index: index2, measureRow, row, table, ...otherAttributes } = props;
|
38503
|
+
const tableMeta = table.options.meta;
|
38504
|
+
const attributes = {
|
38505
|
+
...otherAttributes,
|
38506
|
+
"data-row-id": row.id,
|
38507
|
+
"data-row-index": index2,
|
38508
|
+
tabIndex: -1
|
38571
38509
|
};
|
38572
|
-
|
38573
|
-
|
38574
|
-
|
38575
|
-
|
38576
|
-
|
38577
|
-
|
38578
|
-
|
38579
|
-
|
38580
|
-
|
38581
|
-
|
38582
|
-
|
38583
|
-
|
38584
|
-
|
38585
|
-
|
38586
|
-
|
38587
|
-
|
38588
|
-
|
38589
|
-
|
38590
|
-
|
38591
|
-
|
38592
|
-
|
38593
|
-
|
38594
|
-
|
38595
|
-
|
38596
|
-
|
38597
|
-
|
38510
|
+
const handleClick = React.useCallback(
|
38511
|
+
(event) => {
|
38512
|
+
var _a2;
|
38513
|
+
const clickedElement = event.target;
|
38514
|
+
if (!((_a2 = event.currentTarget) == null ? void 0 : _a2.contains(event.target)) || isElementInteractive(clickedElement)) {
|
38515
|
+
return;
|
38516
|
+
}
|
38517
|
+
tableMeta.rowClick.handleClick(event, row.original);
|
38518
|
+
},
|
38519
|
+
[row.original]
|
38520
|
+
);
|
38521
|
+
const handleClickCapture = React.useCallback(() => {
|
38522
|
+
tableMeta.rowActive.setRowActiveIndex(index2);
|
38523
|
+
}, [index2]);
|
38524
|
+
if (tableMeta.rowActive.isEnabled) {
|
38525
|
+
attributes["data-row-active"] = tableMeta.rowActive.rowActiveIndex === index2 ? true : void 0;
|
38526
|
+
attributes.onClickCapture = handleClickCapture;
|
38527
|
+
}
|
38528
|
+
if (tableMeta.rowClick.isEnabled(row.original)) {
|
38529
|
+
attributes.onClick = handleClick;
|
38530
|
+
}
|
38531
|
+
if (tableMeta.rowDrag.isEnabled) {
|
38532
|
+
attributes["aria-grabbed"] = !!tableMeta.rowDrag.dragging[row.id];
|
38533
|
+
attributes.draggable = true;
|
38534
|
+
const GHOST_ELEMENT_ID = "taco_table_dragging";
|
38535
|
+
attributes.onDragStart = (event) => {
|
38536
|
+
var _a2, _b2, _c2, _d;
|
38537
|
+
let rows = [row];
|
38538
|
+
if (row.getCanSelect()) {
|
38539
|
+
rows = row.getIsSelected() ? table.getSelectedRowModel().rows : [row, ...table.getSelectedRowModel().rows];
|
38540
|
+
}
|
38541
|
+
const data = rows.map((row2) => row2.original);
|
38542
|
+
(_b2 = (_a2 = tableMeta.rowDrag).setDragging) == null ? void 0 : _b2.call(
|
38543
|
+
_a2,
|
38544
|
+
rows.reduce((dragging, rowBeingDragged) => ({ ...dragging, [rowBeingDragged.id]: true }), {})
|
38545
|
+
);
|
38546
|
+
event.dataTransfer.setData("text", JSON.stringify(data));
|
38547
|
+
const showPlaceholder = (text2) => {
|
38548
|
+
const ghost = document.createElement("div");
|
38549
|
+
ghost.id = GHOST_ELEMENT_ID;
|
38550
|
+
ghost.className = "wcag-blue rounded flex w-48 p-4 absolute -ml-[100vw]";
|
38551
|
+
ghost.innerText = text2;
|
38552
|
+
document.body.append(ghost);
|
38553
|
+
event.dataTransfer.setDragImage(ghost, 0, 0);
|
38554
|
+
};
|
38555
|
+
const setDataTransfer = (text2) => event.dataTransfer.setData("text", text2);
|
38556
|
+
(_d = (_c2 = tableMeta.rowDrag).handleRowDrag) == null ? void 0 : _d.call(_c2, data, showPlaceholder, setDataTransfer);
|
38557
|
+
};
|
38558
|
+
attributes.onDragEnd = () => {
|
38559
|
+
var _a2, _b2, _c2;
|
38560
|
+
(_a2 = document.getElementById(GHOST_ELEMENT_ID)) == null ? void 0 : _a2.remove();
|
38561
|
+
(_c2 = (_b2 = tableMeta.rowDrag).setDragging) == null ? void 0 : _c2.call(_b2, {});
|
38562
|
+
};
|
38563
|
+
}
|
38564
|
+
const [isDraggedOver, dropTargetProps] = useDropTarget((event) => {
|
38565
|
+
var _a2, _b2;
|
38566
|
+
return (_b2 = (_a2 = tableMeta.rowDrop).handleDrop) == null ? void 0 : _b2.call(_a2, event, row.original);
|
38567
|
+
});
|
38568
|
+
if (tableMeta.rowDrop.isEnabled) {
|
38569
|
+
attributes.onDragEnter = dropTargetProps == null ? void 0 : dropTargetProps.onDragEnter;
|
38570
|
+
attributes.onDragLeave = dropTargetProps == null ? void 0 : dropTargetProps.onDragLeave;
|
38571
|
+
attributes.onDragOver = dropTargetProps == null ? void 0 : dropTargetProps.onDragOver;
|
38572
|
+
attributes.onDrop = dropTargetProps == null ? void 0 : dropTargetProps.onDrop;
|
38573
|
+
attributes["data-row-dragged-over"] = isDraggedOver;
|
38574
|
+
}
|
38575
|
+
if (table.options.enableGrouping) {
|
38576
|
+
attributes["data-row-group"] = row.getIsGrouped() ? true : void 0;
|
38577
|
+
}
|
38578
|
+
if (row.getCanSelect()) {
|
38579
|
+
attributes["data-row-selected"] = row.getIsSelected() || row.getIsAllSubRowsSelected() ? true : void 0;
|
38580
|
+
}
|
38581
|
+
let expandedRow;
|
38582
|
+
if (tableMeta.rowExpansion.isEnabled && row.getIsExpanded()) {
|
38583
|
+
attributes["data-row-expanded"] = true;
|
38584
|
+
expandedRow = (_c = (_b = (_a = tableMeta.rowExpansion).rowExpansionRenderer) == null ? void 0 : _b.call(_a, row.original)) == null ? void 0 : _c();
|
38585
|
+
}
|
38586
|
+
const rowMeta = row.original._meta;
|
38587
|
+
if (rowMeta == null ? void 0 : rowMeta.layout) {
|
38598
38588
|
attributes["data-row-meta-layout"] = rowMeta.layout;
|
38599
38589
|
}
|
38600
|
-
|
38601
|
-
|
38602
|
-
|
38603
|
-
|
38604
|
-
|
38605
|
-
|
38606
|
-
|
38607
|
-
|
38608
|
-
|
38609
|
-
|
38610
|
-
|
38611
|
-
|
38612
|
-
|
38613
|
-
|
38614
|
-
|
38615
|
-
|
38616
|
-
})
|
38590
|
+
const ref = React.useRef(null);
|
38591
|
+
const expansionRef = React.useRef(null);
|
38592
|
+
const expandedRowSize = useResizeObserver$1(expansionRef, !!expandedRow);
|
38593
|
+
React.useEffect(() => {
|
38594
|
+
var _a2, _b2;
|
38595
|
+
const rowHeight = ((_a2 = ref.current) == null ? void 0 : _a2.getBoundingClientRect().height) ?? 0;
|
38596
|
+
const expansionHeight = ((_b2 = expansionRef.current) == null ? void 0 : _b2.getBoundingClientRect().height) ?? 0;
|
38597
|
+
measureRow(rowHeight + expansionHeight);
|
38598
|
+
}, [expansionRef.current, expandedRowSize == null ? void 0 : expandedRowSize.height]);
|
38599
|
+
const className = clsx("group/row", otherAttributes.className, {
|
38600
|
+
"hover:cursor-grab": tableMeta.rowDrag.isEnabled && typeof attributes.onClick !== "function",
|
38601
|
+
"hover:cursor-pointer": typeof attributes.onClick === "function"
|
38602
|
+
});
|
38603
|
+
const isGrouped = row.getIsGrouped();
|
38604
|
+
const mergedRef = mergeRefs([ref, externalRef]);
|
38605
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("tr", { ...attributes, className, ref: mergedRef }, children, row.getVisibleCells().filter((cell) => !(isGrouped && cell.column.id === "__actions")).map((cell, cellIndex) => /* @__PURE__ */ React.createElement(Cell$2, { key: cell.id, cell, index: cellIndex, renderer: CellRenderer }))), expandedRow ? /* @__PURE__ */ React.createElement("tr", { "data-row-parent-id": row.id, ref: expansionRef }, /* @__PURE__ */ React.createElement("td", { className: "col-span-full" }, expandedRow)) : null);
|
38606
|
+
})
|
38607
|
+
);
|
38617
38608
|
function DisplayCell(props) {
|
38618
38609
|
const { cell, cellRef, index: index2, isHighlighted, ...cellAttributes } = props;
|
38619
38610
|
const columnMeta = cell.column.columnDef.meta;
|
@@ -38675,18 +38666,16 @@ function Resizer(props) {
|
|
38675
38666
|
const handleResize = (event) => {
|
38676
38667
|
if (event.detail >= 2) {
|
38677
38668
|
onResetSize();
|
38678
|
-
} else {
|
38679
|
-
|
38680
|
-
|
38681
|
-
|
38682
|
-
|
38683
|
-
|
38684
|
-
setTimeout(() => {
|
38685
|
-
onResize == null ? void 0 : onResize(event);
|
38686
|
-
}, 1);
|
38687
|
-
} else {
|
38669
|
+
} else if (!Number.isInteger(width) && headerRef) {
|
38670
|
+
setColumnSizing((sizes) => ({
|
38671
|
+
...sizes,
|
38672
|
+
[id2]: headerRef.getBoundingClientRect().width
|
38673
|
+
}));
|
38674
|
+
setTimeout(() => {
|
38688
38675
|
onResize == null ? void 0 : onResize(event);
|
38689
|
-
}
|
38676
|
+
}, 1);
|
38677
|
+
} else {
|
38678
|
+
onResize == null ? void 0 : onResize(event);
|
38690
38679
|
}
|
38691
38680
|
};
|
38692
38681
|
const handle = /* @__PURE__ */ React.createElement(
|
@@ -38700,6 +38689,7 @@ function Resizer(props) {
|
|
38700
38689
|
"!visible": isResizing
|
38701
38690
|
}
|
38702
38691
|
),
|
38692
|
+
"data-taco": "resize-handle",
|
38703
38693
|
onClick: handleClick,
|
38704
38694
|
onMouseDown: handleResize,
|
38705
38695
|
onTouchStart: handleResize
|
@@ -38819,25 +38809,21 @@ function HeaderMenu(props) {
|
|
38819
38809
|
const { texts } = useLocalization();
|
38820
38810
|
const [popover, setPopover] = React.useState(void 0);
|
38821
38811
|
let popoverElement;
|
38822
|
-
if (popover) {
|
38812
|
+
if (popover === "goto") {
|
38823
38813
|
const handleClosePopover = () => setPopover(void 0);
|
38824
|
-
|
38825
|
-
|
38826
|
-
|
38827
|
-
const
|
38828
|
-
|
38829
|
-
|
38830
|
-
|
38831
|
-
|
38832
|
-
|
38833
|
-
|
38834
|
-
} finally {
|
38835
|
-
handleClosePopover();
|
38836
|
-
}
|
38837
|
-
};
|
38838
|
-
popoverElement = (props2) => /* @__PURE__ */ React.createElement(GotoPopover, { ...props2, open: true, onChange: handleClosePopover, onGoto: goto });
|
38814
|
+
if (handleGoto) {
|
38815
|
+
const goto = async (query) => {
|
38816
|
+
try {
|
38817
|
+
const index22 = await handleGoto(query);
|
38818
|
+
setRowActiveIndex(index22);
|
38819
|
+
scrollToIndex(index22);
|
38820
|
+
} catch (e3) {
|
38821
|
+
console.error(e3);
|
38822
|
+
} finally {
|
38823
|
+
handleClosePopover();
|
38839
38824
|
}
|
38840
|
-
}
|
38825
|
+
};
|
38826
|
+
popoverElement = (props2) => /* @__PURE__ */ React.createElement(GotoPopover, { ...props2, open: true, onChange: handleClosePopover, onGoto: goto });
|
38841
38827
|
}
|
38842
38828
|
}
|
38843
38829
|
const memoedMenuItems = React.useMemo(() => {
|
@@ -39124,14 +39110,14 @@ const MemoedHeader = React.memo(function MemoedHeader2(props) {
|
|
39124
39110
|
className,
|
39125
39111
|
"data-cell-align": isGroup2 ? "center" : align,
|
39126
39112
|
"data-cell-id": id2,
|
39127
|
-
"data-cell-pinned": isPinned
|
39113
|
+
"data-cell-pinned": isPinned || void 0,
|
39128
39114
|
"data-taco": isGroup2 ? isPlaceholder ? "grouped-column-header-placeholder" : "grouped-column-header" : "column-header",
|
39129
39115
|
"data-parent-group-id": props.parentId ? props.parentId : void 0,
|
39130
|
-
"data-rows-expanded": isExpanded
|
39116
|
+
"data-rows-expanded": isExpanded || void 0,
|
39131
39117
|
style,
|
39132
39118
|
ref: setRef
|
39133
39119
|
},
|
39134
|
-
|
39120
|
+
isPlaceholder ? null : /* @__PURE__ */ React.createElement(HeaderContent, { children, tooltip, isInternalColumnHeader: !!isInternalColumn(id2) }),
|
39135
39121
|
sortDirection ? /* @__PURE__ */ React.createElement(SortIndicator, { direction: sortDirection }) : null,
|
39136
39122
|
hasMenu ? /* @__PURE__ */ React.createElement(
|
39137
39123
|
HeaderMenu,
|
@@ -39259,16 +39245,14 @@ function Body(props) {
|
|
39259
39245
|
scrollToIndex(prevIndex);
|
39260
39246
|
});
|
39261
39247
|
}
|
39262
|
-
} else {
|
39263
|
-
|
39264
|
-
|
39265
|
-
|
39266
|
-
|
39267
|
-
|
39268
|
-
|
39269
|
-
|
39270
|
-
});
|
39271
|
-
}
|
39248
|
+
} else if (!isLastRow) {
|
39249
|
+
event.preventDefault();
|
39250
|
+
const nextIndex = tableMeta.rowActive.rowActiveIndex + 1;
|
39251
|
+
tableMeta.rowActive.setRowActiveIndex(nextIndex);
|
39252
|
+
requestAnimationFrame(() => {
|
39253
|
+
focusManager.focusFirst();
|
39254
|
+
scrollToIndex(nextIndex);
|
39255
|
+
});
|
39272
39256
|
}
|
39273
39257
|
}
|
39274
39258
|
}
|
@@ -39380,7 +39364,7 @@ const MemoedFooter = React.memo(function MemoedFooter2(props) {
|
|
39380
39364
|
key: footer.id,
|
39381
39365
|
"data-cell-align": align,
|
39382
39366
|
"data-cell-id": footer.id,
|
39383
|
-
"data-cell-pinned": isPinned
|
39367
|
+
"data-cell-pinned": isPinned || void 0,
|
39384
39368
|
style
|
39385
39369
|
},
|
39386
39370
|
content
|
@@ -39598,11 +39582,9 @@ function Search$1(props) {
|
|
39598
39582
|
}
|
39599
39583
|
}, [tableMeta.search.highlightedColumnIndexes.length]);
|
39600
39584
|
React.useEffect(() => {
|
39601
|
-
if (tableMeta.server._experimentalDataLoader2 && tableMeta.search.highlightedColumnIndexes.length) {
|
39602
|
-
|
39603
|
-
|
39604
|
-
scrollTo2(tableMeta.search.highlightedColumnIndexes[0][0]);
|
39605
|
-
}
|
39585
|
+
if (tableMeta.server._experimentalDataLoader2 && tableMeta.search.highlightedColumnIndexes.length && query !== lastResultQuery.current) {
|
39586
|
+
lastResultQuery.current = query;
|
39587
|
+
scrollTo2(tableMeta.search.highlightedColumnIndexes[0][0]);
|
39606
39588
|
}
|
39607
39589
|
}, [tableMeta.search.highlightedColumnIndexes.length, query]);
|
39608
39590
|
const handleFocus = async () => {
|
@@ -39631,7 +39613,7 @@ function Search$1(props) {
|
|
39631
39613
|
}, 150);
|
39632
39614
|
}
|
39633
39615
|
};
|
39634
|
-
const handleToggleExcludeUnmatchedResults = (enabled) => {
|
39616
|
+
const handleToggleExcludeUnmatchedResults = async (enabled) => {
|
39635
39617
|
tableMeta.search.setEnableGlobalFilter(enabled, table);
|
39636
39618
|
requestAnimationFrame(() => {
|
39637
39619
|
var _a2;
|
@@ -39639,9 +39621,8 @@ function Search$1(props) {
|
|
39639
39621
|
});
|
39640
39622
|
if (tableMeta.search.handleSearch) {
|
39641
39623
|
setLoading(true);
|
39642
|
-
tableMeta.search.handleSearch(enabled ? query : void 0, hiddenColumns)
|
39643
|
-
|
39644
|
-
});
|
39624
|
+
await tableMeta.search.handleSearch(enabled ? query : void 0, hiddenColumns);
|
39625
|
+
setLoading(false);
|
39645
39626
|
}
|
39646
39627
|
};
|
39647
39628
|
const handleNextResult = () => {
|
@@ -39688,7 +39669,7 @@ function Search$1(props) {
|
|
39688
39669
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
|
39689
39670
|
SearchInput22,
|
39690
39671
|
{
|
39691
|
-
findCurrent: tableMeta.search.currentHighlightColumnIndex
|
39672
|
+
findCurrent: tableMeta.search.currentHighlightColumnIndex === void 0 ? null : tableMeta.search.currentHighlightColumnIndex + 1,
|
39692
39673
|
findTotal: ((_a = tableMeta.search.highlightedColumnIndexes) == null ? void 0 : _a.length) ?? null,
|
39693
39674
|
loading: tableMeta.server._experimentalDataLoader2 ? loading : tableMeta.server.loading,
|
39694
39675
|
name: "table-search",
|
@@ -43516,7 +43497,7 @@ function getContainerById(children, id2) {
|
|
43516
43497
|
if (list) {
|
43517
43498
|
return list == null ? void 0 : list.props;
|
43518
43499
|
}
|
43519
|
-
return (_a = lists.find((l2) => React.Children.toArray(l2.props.children).
|
43500
|
+
return (_a = lists.find((l2) => React.Children.toArray(l2.props.children).some((child) => child.props.id === id2))) == null ? void 0 : _a.props;
|
43520
43501
|
}
|
43521
43502
|
function Container$1(externalProps) {
|
43522
43503
|
const { children, reorder, move } = externalProps;
|
@@ -43619,7 +43600,7 @@ function HideOrOrderPopover(props) {
|
|
43619
43600
|
const listClassName = "flex max-h-64 flex-col gap-y-px overflow-auto";
|
43620
43601
|
const handleReorder = (activeId, overId) => {
|
43621
43602
|
var _a;
|
43622
|
-
if (columns.
|
43603
|
+
if (columns.some((column) => {
|
43623
43604
|
var _a2;
|
43624
43605
|
return column.id === overId && ((_a2 = column.columnDef.meta) == null ? void 0 : _a2.enableOrdering) === false;
|
43625
43606
|
})) {
|
@@ -43675,23 +43656,19 @@ function Settings(props) {
|
|
43675
43656
|
const canChangeRowHeight = tableMeta.rowHeight.isEnabled;
|
43676
43657
|
const [popover, setPopover] = React.useState(void 0);
|
43677
43658
|
let popoverElement;
|
43678
|
-
if (popover) {
|
43659
|
+
if (popover === "columnSettings") {
|
43679
43660
|
const handleClosePopover = () => setPopover(void 0);
|
43680
|
-
|
43681
|
-
|
43682
|
-
|
43683
|
-
|
43684
|
-
|
43685
|
-
|
43686
|
-
|
43687
|
-
|
43688
|
-
|
43689
|
-
onChange: handleClosePopover,
|
43690
|
-
table
|
43691
|
-
}
|
43692
|
-
);
|
43661
|
+
if (canHideOrOrder) {
|
43662
|
+
popoverElement = (popoverProps) => /* @__PURE__ */ React.createElement(
|
43663
|
+
HideOrOrderPopover,
|
43664
|
+
{
|
43665
|
+
...popoverProps,
|
43666
|
+
id: `${id2}-columnSettings`,
|
43667
|
+
open: true,
|
43668
|
+
onChange: handleClosePopover,
|
43669
|
+
table
|
43693
43670
|
}
|
43694
|
-
|
43671
|
+
);
|
43695
43672
|
}
|
43696
43673
|
}
|
43697
43674
|
return /* @__PURE__ */ React.createElement(
|
@@ -43757,13 +43734,11 @@ const Root$1 = React.forwardRef(function CollectionRoot(props, ref) {
|
|
43757
43734
|
};
|
43758
43735
|
const setActiveIndexByElement = React.useCallback(
|
43759
43736
|
(option) => {
|
43760
|
-
if (internalRef.current) {
|
43761
|
-
|
43762
|
-
|
43763
|
-
|
43764
|
-
|
43765
|
-
setActiveOption(nextActiveIndex, internalRef.current, option);
|
43766
|
-
}
|
43737
|
+
if (internalRef.current && option.matches(querySelector2)) {
|
43738
|
+
const options = getOptionsFromCollection(internalRef.current, querySelector2);
|
43739
|
+
const nextActiveIndex = Array.from(options).indexOf(option);
|
43740
|
+
if (nextActiveIndex > -1) {
|
43741
|
+
setActiveOption(nextActiveIndex, internalRef.current, option);
|
43767
43742
|
}
|
43768
43743
|
}
|
43769
43744
|
},
|
@@ -43867,23 +43842,23 @@ const getNextEnabledItem = (event, options, activeIndex, recurse = true) => {
|
|
43867
43842
|
if (nextIndex !== void 0) {
|
43868
43843
|
if (nextIndex === activeIndex) {
|
43869
43844
|
return activeIndex;
|
43870
|
-
}
|
43871
|
-
|
43872
|
-
|
43873
|
-
|
43874
|
-
|
43875
|
-
|
43876
|
-
|
43877
|
-
|
43878
|
-
|
43879
|
-
|
43880
|
-
|
43881
|
-
|
43882
|
-
|
43883
|
-
|
43884
|
-
|
43885
|
-
|
43886
|
-
|
43845
|
+
}
|
43846
|
+
if (options.item(nextIndex) && isSkippableItem(options.item(nextIndex))) {
|
43847
|
+
if (recurse && nextIndex === 0) {
|
43848
|
+
return getNextEnabledItem(
|
43849
|
+
new KeyboardEvent(event.type, { ...event, key: "ArrowDown" }),
|
43850
|
+
options,
|
43851
|
+
nextIndex,
|
43852
|
+
false
|
43853
|
+
);
|
43854
|
+
}
|
43855
|
+
if (recurse && nextIndex === options.length - 1) {
|
43856
|
+
return getNextEnabledItem(
|
43857
|
+
new KeyboardEvent(event.type, { ...event, key: "ArrowUp" }),
|
43858
|
+
options,
|
43859
|
+
nextIndex,
|
43860
|
+
false
|
43861
|
+
);
|
43887
43862
|
}
|
43888
43863
|
return getNextEnabledItem(event, options, nextIndex, recurse);
|
43889
43864
|
}
|
@@ -43909,7 +43884,7 @@ const Root = React.forwardRef(function Listbox22(props, ref) {
|
|
43909
43884
|
multiple,
|
43910
43885
|
readOnly = false,
|
43911
43886
|
setValue,
|
43912
|
-
title,
|
43887
|
+
title: _1,
|
43913
43888
|
value,
|
43914
43889
|
...otherProps
|
43915
43890
|
} = props;
|
@@ -43945,12 +43920,14 @@ const createListboxValueSetter = (multiple, setValue) => (nextValue) => {
|
|
43945
43920
|
if (multiple) {
|
43946
43921
|
if (value === void 0) {
|
43947
43922
|
return [nextValue];
|
43948
|
-
}
|
43923
|
+
}
|
43924
|
+
if (Array.isArray(value)) {
|
43949
43925
|
if (value.includes(nextValue)) {
|
43950
43926
|
return value.filter((v2) => v2 !== nextValue);
|
43951
43927
|
}
|
43952
43928
|
return [...value, nextValue];
|
43953
|
-
}
|
43929
|
+
}
|
43930
|
+
if (value === nextValue) {
|
43954
43931
|
return [];
|
43955
43932
|
}
|
43956
43933
|
return [value, nextValue];
|
@@ -43959,7 +43936,7 @@ const createListboxValueSetter = (multiple, setValue) => (nextValue) => {
|
|
43959
43936
|
});
|
43960
43937
|
};
|
43961
43938
|
const Option$1 = React.forwardRef(function Listbox2Option(props, ref) {
|
43962
|
-
const { disabled, id: nativeId, title, value, ...otherProps } = props;
|
43939
|
+
const { disabled, id: nativeId, title: _1, value, ...otherProps } = props;
|
43963
43940
|
const { disabled: listboxDisabled, readOnly: listboxReadOnly, setValue, value: currentValue } = useListbox2Context();
|
43964
43941
|
const id2 = "option-" + useId$1(nativeId);
|
43965
43942
|
const selected = Array.isArray(currentValue) ? currentValue.includes(value) : currentValue === value;
|
@@ -43967,9 +43944,8 @@ const Option$1 = React.forwardRef(function Listbox2Option(props, ref) {
|
|
43967
43944
|
if (disabled || listboxDisabled || listboxReadOnly) {
|
43968
43945
|
event.stopPropagation();
|
43969
43946
|
return;
|
43970
|
-
} else {
|
43971
|
-
setValue(value);
|
43972
43947
|
}
|
43948
|
+
setValue(value);
|
43973
43949
|
if (typeof props.onClick === "function") {
|
43974
43950
|
props.onClick(event);
|
43975
43951
|
}
|
@@ -43978,7 +43954,8 @@ const Option$1 = React.forwardRef(function Listbox2Option(props, ref) {
|
|
43978
43954
|
if (disabled || listboxDisabled || listboxReadOnly) {
|
43979
43955
|
event.stopPropagation();
|
43980
43956
|
return;
|
43981
|
-
}
|
43957
|
+
}
|
43958
|
+
if (isAriaSelectionKey(event)) {
|
43982
43959
|
setValue(value);
|
43983
43960
|
}
|
43984
43961
|
if (typeof props.onKeyDown === "function") {
|
@@ -44028,7 +44005,7 @@ const Tag = React.forwardRef((props, ref) => {
|
|
44028
44005
|
getSubtleColorShadeClasses(color2),
|
44029
44006
|
props.className
|
44030
44007
|
);
|
44031
|
-
return /* @__PURE__ */ React.createElement("span", { ...otherProps, className, ref, "data-taco": "tag" }, /* @__PURE__ */ React.createElement("span", { className: "flex items-center truncate px-2", ref: textRef }, icon ? typeof icon === "string" ? /* @__PURE__ */ React.createElement(Icon$1, { name: icon, className: "-ml-1 mr-1 !h-5 !w-5" }) : React.cloneElement(icon, {
|
44008
|
+
return /* @__PURE__ */ React.createElement("span", { ...otherProps, className, ref, "data-taco": "tag", "data-taco-color": color2 }, /* @__PURE__ */ React.createElement("span", { className: "flex items-center truncate px-2", ref: textRef }, icon ? typeof icon === "string" ? /* @__PURE__ */ React.createElement(Icon$1, { name: icon, className: "-ml-1 mr-1 !h-5 !w-5" }) : React.cloneElement(icon, {
|
44032
44009
|
className: clsx(icon.props.className, "mr-1 -ml-1")
|
44033
44010
|
}) : null, /* @__PURE__ */ React.createElement("span", { className: "truncate" }, children)), onDelete ? /* @__PURE__ */ React.createElement(
|
44034
44011
|
Icon$1,
|
@@ -44052,7 +44029,6 @@ const getFontSize = (fontSize) => {
|
|
44052
44029
|
return "text-xs";
|
44053
44030
|
case FontSizes.large:
|
44054
44031
|
return "text-base";
|
44055
|
-
case FontSizes.medium:
|
44056
44032
|
default:
|
44057
44033
|
return "text-sm";
|
44058
44034
|
}
|
@@ -44086,7 +44062,8 @@ const EditPopover = (props) => {
|
|
44086
44062
|
if (event.key === "Escape") {
|
44087
44063
|
close();
|
44088
44064
|
} else if (event.key === "Enter") {
|
44089
|
-
handleSave(close)
|
44065
|
+
const fn = handleSave(close);
|
44066
|
+
await fn(event);
|
44090
44067
|
}
|
44091
44068
|
};
|
44092
44069
|
const handleDelete = (close) => async (event) => {
|
@@ -44131,9 +44108,8 @@ const EditPopover = (props) => {
|
|
44131
44108
|
const preventKeyDownPropagation = (event) => {
|
44132
44109
|
if (event.key === "Escape" || event.key === "Tab" || event.key === "Tab" && event.shiftKey) {
|
44133
44110
|
return;
|
44134
|
-
} else {
|
44135
|
-
event.stopPropagation();
|
44136
44111
|
}
|
44112
|
+
event.stopPropagation();
|
44137
44113
|
};
|
44138
44114
|
const popoverContentKeyDown = (event) => {
|
44139
44115
|
if (event.key === "Tab" || event.key === "Tab" && event.shiftKey) {
|
@@ -44199,17 +44175,27 @@ const Colours = (props) => {
|
|
44199
44175
|
onChange: (value) => onChangeColor(value),
|
44200
44176
|
value: color2
|
44201
44177
|
},
|
44202
|
-
AVAILABLE_COLORS.map((availableColor) => /* @__PURE__ */ React.createElement(
|
44203
|
-
|
44178
|
+
AVAILABLE_COLORS.map((availableColor) => /* @__PURE__ */ React.createElement(
|
44179
|
+
$b6c3ddc6086f204d$export$d7b12c4107be0d61,
|
44204
44180
|
{
|
44205
|
-
|
44206
|
-
|
44207
|
-
|
44208
|
-
|
44209
|
-
|
44181
|
+
key: availableColor,
|
44182
|
+
"aria-label": color2,
|
44183
|
+
onKeyDown,
|
44184
|
+
value: availableColor,
|
44185
|
+
"data-taco": `${availableColor}-radio`
|
44210
44186
|
},
|
44211
|
-
state
|
44212
|
-
|
44187
|
+
(state) => /* @__PURE__ */ React.createElement(
|
44188
|
+
"div",
|
44189
|
+
{
|
44190
|
+
className: clsx(
|
44191
|
+
"flex h-6 w-6 cursor-pointer items-center justify-center rounded",
|
44192
|
+
getSubtleColorShadeClasses(availableColor),
|
44193
|
+
state.isFocusVisible && "ring-2 ring-blue-500"
|
44194
|
+
)
|
44195
|
+
},
|
44196
|
+
state.isSelected && /* @__PURE__ */ React.createElement(Icon$1, { name: "tick", className: "!h-5 !w-5" })
|
44197
|
+
)
|
44198
|
+
))
|
44213
44199
|
);
|
44214
44200
|
};
|
44215
44201
|
const mobiles = /iPhone|iPad|iPod|Android/i;
|
@@ -44233,17 +44219,15 @@ const Option = React.forwardRef(function Select2Option(props, ref) {
|
|
44233
44219
|
const isTag = tags && !!color2;
|
44234
44220
|
const handleClick = () => {
|
44235
44221
|
var _a;
|
44236
|
-
if (
|
44237
|
-
setOpen(false);
|
44238
|
-
} else {
|
44222
|
+
if (multiple) {
|
44239
44223
|
(_a = selectRef.current) == null ? void 0 : _a.focus();
|
44224
|
+
} else {
|
44225
|
+
setOpen(false);
|
44240
44226
|
}
|
44241
44227
|
};
|
44242
44228
|
const handleKeyDown = (event) => {
|
44243
|
-
if (isAriaSelectionKey(event)) {
|
44244
|
-
|
44245
|
-
setOpen(false);
|
44246
|
-
}
|
44229
|
+
if (isAriaSelectionKey(event) && (!multiple || event.key === "Tab")) {
|
44230
|
+
setOpen(false);
|
44247
44231
|
}
|
44248
44232
|
};
|
44249
44233
|
const isEmptyOption = children !== "";
|
@@ -44257,7 +44241,7 @@ const Option = React.forwardRef(function Select2Option(props, ref) {
|
|
44257
44241
|
value: props.value
|
44258
44242
|
}
|
44259
44243
|
) : void 0;
|
44260
|
-
return /* @__PURE__ */ React.createElement(Option$1, { ...otherProps, className, onClick: handleClick, onKeyDown: handleKeyDown, ref }, hasValue2 ? /* @__PURE__ */ React.createElement(Icon$1, { name: "tick", className: "pointer-events-none invisible -mx-0.5 !h-4 !w-4 group-aria-selected:visible" }) : null, typeof children
|
44244
|
+
return /* @__PURE__ */ React.createElement(Option$1, { ...otherProps, className, onClick: handleClick, onKeyDown: handleKeyDown, ref }, hasValue2 ? /* @__PURE__ */ React.createElement(Icon$1, { name: "tick", className: "pointer-events-none invisible -mx-0.5 !h-4 !w-4 group-aria-selected:visible" }) : null, typeof children === "string" ? isTag ? /* @__PURE__ */ React.createElement(Tag, { className: "pointer-events-none my-1", color: color2, icon: prefix2 }, children) : /* @__PURE__ */ React.createElement(React.Fragment, null, prefix2 ? typeof prefix2 === "string" ? /* @__PURE__ */ React.createElement(Icon$1, { name: prefix2, className: "!h-5 !w-5" }) : prefix2 : null, /* @__PURE__ */ React.createElement("span", { className: "flex w-full justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "flex flex-col" }, /* @__PURE__ */ React.createElement("span", null, children), description ? /* @__PURE__ */ React.createElement("span", { className: "text-grey-700 -mt-1.5 mb-1.5 text-xs", "data-taco": "description" }, description) : null), /* @__PURE__ */ React.createElement("span", { className: "flex flex-col self-center" }, postfix ? typeof postfix === "string" ? /* @__PURE__ */ React.createElement(Icon$1, { name: postfix, className: "!h-5 !w-5" }) : postfix : null))) : /* @__PURE__ */ React.createElement("span", null, children), popover ? /* @__PURE__ */ React.createElement(
|
44261
44245
|
IconButton,
|
44262
44246
|
{
|
44263
44247
|
icon: "ellipsis-vertical",
|
@@ -44309,7 +44293,7 @@ const Placeholder = ({ disabled, readOnly, ...props }) => {
|
|
44309
44293
|
const Trigger = React.forwardRef(function Select2Trigger(props, ref) {
|
44310
44294
|
const { multiple, value } = useSelect2Context();
|
44311
44295
|
if (Array.isArray(value) || multiple) {
|
44312
|
-
const values = Array.isArray(value) ? value : value
|
44296
|
+
const values = Array.isArray(value) ? value : value === void 0 ? void 0 : [value];
|
44313
44297
|
return /* @__PURE__ */ React.createElement(Multiple, { ...props, ref, values });
|
44314
44298
|
}
|
44315
44299
|
return /* @__PURE__ */ React.createElement(Single, { ...props, ref, value });
|
@@ -44423,7 +44407,7 @@ const Multiple = React.forwardRef(function Select2TriggerMultiple(props, ref) {
|
|
44423
44407
|
if (open) {
|
44424
44408
|
const hasValues = valuesAsChildren.length > 0;
|
44425
44409
|
className = clsx("!absolute z-20 !h-fit", buttonProps.className);
|
44426
|
-
content = /* @__PURE__ */ React.createElement(ScrollArea, { className: "my-1 flex max-h-[5.5rem] flex-col", onClick: forwardClick }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap gap-1"
|
44410
|
+
content = /* @__PURE__ */ React.createElement(ScrollArea, { className: "my-1 flex max-h-[5.5rem] flex-col", onClick: forwardClick }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-wrap gap-1", "data-taco": "select2-value" }, hasValues ? valuesAsChildren.map(
|
44427
44411
|
(child) => typeof child.props.children === "string" ? /* @__PURE__ */ React.createElement(
|
44428
44412
|
Tag,
|
44429
44413
|
{
|
@@ -44463,7 +44447,7 @@ const Multiple = React.forwardRef(function Select2TriggerMultiple(props, ref) {
|
|
44463
44447
|
))
|
44464
44448
|
}
|
44465
44449
|
)
|
44466
|
-
)));
|
44450
|
+
) : /* @__PURE__ */ React.createElement(Placeholder, { disabled, readOnly }, placeholder)));
|
44467
44451
|
} else {
|
44468
44452
|
content = /* @__PURE__ */ React.createElement(MultipleValue, { onClick: forwardClick, valuesAsChildren, placeholder });
|
44469
44453
|
}
|
@@ -44492,7 +44476,7 @@ const MultipleValue = ({ onClick, valuesAsChildren, placeholder }) => {
|
|
44492
44476
|
}
|
44493
44477
|
return "";
|
44494
44478
|
};
|
44495
|
-
return /* @__PURE__ */ React.createElement("div", { className: "relative flex w-full items-center gap-1 overflow-hidden", onClick }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-1 gap-1 truncate", ref: (ref) => setContentRef(ref) }, valuesAsChildren.length === 0 ? /* @__PURE__ */ React.createElement(Placeholder, { disabled, readOnly }, placeholder) : valuesAsChildren.map((child, index2) => {
|
44479
|
+
return /* @__PURE__ */ React.createElement("div", { className: "relative flex w-full items-center gap-1 overflow-hidden", onClick }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-1 gap-1 truncate", ref: (ref) => setContentRef(ref), "data-taco": "select2-value" }, valuesAsChildren.length === 0 ? /* @__PURE__ */ React.createElement(Placeholder, { disabled, readOnly }, placeholder) : valuesAsChildren.map((child, index2) => {
|
44496
44480
|
const classNames = {
|
44497
44481
|
truncate: index2 === boundaryIndex,
|
44498
44482
|
hidden: boundaryIndex !== void 0 && boundaryIndex !== null ? index2 > boundaryIndex : false
|
@@ -44573,7 +44557,7 @@ const BubbleSelect = (props) => {
|
|
44573
44557
|
const select = ref.current;
|
44574
44558
|
const descriptor = Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype, "value");
|
44575
44559
|
const setValue = descriptor.set;
|
44576
|
-
if (prevValue !== value && setValue) {
|
44560
|
+
if (prevValue !== value && setValue && select) {
|
44577
44561
|
if (Array.isArray(value)) {
|
44578
44562
|
value.forEach((v2) => {
|
44579
44563
|
const option = select.querySelector(`option[value='${CSS.escape(v2)}']`);
|
@@ -44623,7 +44607,6 @@ const Search = React.forwardRef(function ListboxSearch(props, ref) {
|
|
44623
44607
|
Input,
|
44624
44608
|
{
|
44625
44609
|
...props,
|
44626
|
-
autoFocus: true,
|
44627
44610
|
invalid: !!validationError,
|
44628
44611
|
onChange: handleChange,
|
44629
44612
|
onKeyDown: handleKeyDown,
|
@@ -44637,12 +44620,12 @@ const isGroup = (child) => !!child.props.heading || !!child.props.hasSeparator;
|
|
44637
44620
|
const useChildren = ({ children: initialChildren, emptyValue, multiple, open, setValue, value }) => {
|
44638
44621
|
const [searchQuery, setSearchQuery] = React.useState("");
|
44639
44622
|
const flattenedChildren = React.useMemo(() => {
|
44640
|
-
const initial = (initialChildren == null ? void 0 : initialChildren.
|
44623
|
+
const initial = (initialChildren == null ? void 0 : initialChildren.flatMap((child) => {
|
44641
44624
|
if (isGroup(child)) {
|
44642
44625
|
return child.props.children;
|
44643
44626
|
}
|
44644
44627
|
return child;
|
44645
|
-
})
|
44628
|
+
})) || [];
|
44646
44629
|
return initial;
|
44647
44630
|
}, [initialChildren]);
|
44648
44631
|
React.useEffect(() => {
|
@@ -44835,9 +44818,9 @@ const Select22 = React.forwardRef(function Select222(props, ref) {
|
|
44835
44818
|
const hasInlineCreation = onCreate2 && !createDialog;
|
44836
44819
|
const hasSearch = flattenedChildren.length > 5 || hasInlineCreation;
|
44837
44820
|
const visibleChildren = searchQuery === "" ? initialChildren : filteredChildren;
|
44838
|
-
const selectOptions = searchQuery === "" ? flattenedChildren.map((child) => child.props.value) : filteredChildren.
|
44821
|
+
const selectOptions = searchQuery === "" ? flattenedChildren.map((child) => child.props.value) : filteredChildren.flatMap(
|
44839
44822
|
(child) => isGroup(child) ? Array.isArray(child.props.children) && child.props.children.map((subChild) => subChild.props.value) : child.props.value
|
44840
|
-
)
|
44823
|
+
) || [];
|
44841
44824
|
const queryTimeoutRef = React.useRef("");
|
44842
44825
|
const typeahead = debounce$2(function() {
|
44843
44826
|
if (!queryTimeoutRef.current) {
|
@@ -44914,14 +44897,13 @@ const Select22 = React.forwardRef(function Select222(props, ref) {
|
|
44914
44897
|
if (searchQuery === "") {
|
44915
44898
|
if (areAllSelected) {
|
44916
44899
|
return texts.select2.deselectAll;
|
44917
|
-
} else {
|
44918
|
-
return texts.select2.selectAll;
|
44919
44900
|
}
|
44920
|
-
|
44901
|
+
return texts.select2.selectAll;
|
44902
|
+
}
|
44903
|
+
if (areAllSelected) {
|
44921
44904
|
return texts.select2.deselectAllResults;
|
44922
|
-
} else {
|
44923
|
-
return texts.select2.selectAllResults;
|
44924
44905
|
}
|
44906
|
+
return texts.select2.selectAllResults;
|
44925
44907
|
}, [areAllSelected, searchQuery]);
|
44926
44908
|
const selectAll = () => {
|
44927
44909
|
if (!Array.isArray(value) || value.length === 0) {
|
@@ -44947,7 +44929,7 @@ const Select22 = React.forwardRef(function Select222(props, ref) {
|
|
44947
44929
|
},
|
44948
44930
|
createCollectionClassName()
|
44949
44931
|
);
|
44950
|
-
return /* @__PURE__ */ React.createElement(Select2Context.Provider, { value: context }, /* @__PURE__ */ React.createElement($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement($cb5cc270b50c6fcd$export$41fb9f06171c75f4, { asChild: true, "data-taco": "Select2" }, /* @__PURE__ */ React.createElement(
|
44932
|
+
return /* @__PURE__ */ React.createElement(Select2Context.Provider, { value: context }, /* @__PURE__ */ React.createElement($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, { open, onOpenChange: setOpen }, /* @__PURE__ */ React.createElement($cb5cc270b50c6fcd$export$41fb9f06171c75f4, { asChild: true, "data-taco": "Select2", "aria-multiselectable": multiple }, /* @__PURE__ */ React.createElement(
|
44951
44933
|
Trigger,
|
44952
44934
|
{
|
44953
44935
|
...otherProps,
|
@@ -45036,7 +45018,7 @@ const ControlledHiddenField = (props) => {
|
|
45036
45018
|
bubbleValue = value === null ? "" : String(value);
|
45037
45019
|
}
|
45038
45020
|
}
|
45039
|
-
return /* @__PURE__ */ React.createElement(BubbleSelect, { "aria-hidden": true, key: String(bubbleValue), multiple, name, tabIndex: -1, value: bubbleValue }, emptyValue
|
45021
|
+
return /* @__PURE__ */ React.createElement(BubbleSelect, { "aria-hidden": true, key: String(bubbleValue), multiple, name, tabIndex: -1, value: bubbleValue }, emptyValue === void 0 ? null : /* @__PURE__ */ React.createElement("option", { value: emptyValue }), options.map((option) => /* @__PURE__ */ React.createElement("option", { key: String(option), value: String(option) })));
|
45040
45022
|
}
|
45041
45023
|
return null;
|
45042
45024
|
};
|
@@ -45152,7 +45134,7 @@ function Print(props) {
|
|
45152
45134
|
if (isSafari) {
|
45153
45135
|
try {
|
45154
45136
|
document.execCommand("print", false, void 0);
|
45155
|
-
} catch
|
45137
|
+
} catch {
|
45156
45138
|
window.print();
|
45157
45139
|
}
|
45158
45140
|
} else {
|
@@ -45303,7 +45285,7 @@ const FilterColumn = React.forwardRef((props, ref) => {
|
|
45303
45285
|
},
|
45304
45286
|
/* @__PURE__ */ React.createElement(Icon$1, { name: "eye-off", className: "text-grey-500 !h-5 !w-5" })
|
45305
45287
|
) : void 0,
|
45306
|
-
disabled: header.column.id !== value && (!header.column.getCanFilter() || !!filters.
|
45288
|
+
disabled: header.column.id !== value && (!header.column.getCanFilter() || !!filters.some((f2) => f2.id === header.column.id))
|
45307
45289
|
},
|
45308
45290
|
/* @__PURE__ */ React.createElement(React.Fragment, null, flexRender(header.column.columnDef.header, header.getContext()), header.column.parent ? ` (${flexRender((_b = (_a = header.column.parent) == null ? void 0 : _a.columnDef.meta) == null ? void 0 : _b.header, header.getContext())})` : "")
|
45309
45291
|
);
|
@@ -45404,7 +45386,7 @@ function FilterValue(props) {
|
|
45404
45386
|
{
|
45405
45387
|
column,
|
45406
45388
|
"data-query-selector": querySelector,
|
45407
|
-
onChange: (value2) => handleChange([isNaN(value2) ? void 0 : value2, toValue2]),
|
45389
|
+
onChange: (value2) => handleChange([Number.isNaN(value2) ? void 0 : value2, toValue2]),
|
45408
45390
|
placeholder: "from",
|
45409
45391
|
value: fromValue ?? ""
|
45410
45392
|
}
|
@@ -45413,7 +45395,7 @@ function FilterValue(props) {
|
|
45413
45395
|
{
|
45414
45396
|
column,
|
45415
45397
|
"data-query-selector": querySelector,
|
45416
|
-
onChange: (value2) => handleChange([fromValue, isNaN(value2) ? void 0 : value2]),
|
45398
|
+
onChange: (value2) => handleChange([fromValue, Number.isNaN(value2) ? void 0 : value2]),
|
45417
45399
|
placeholder: "to",
|
45418
45400
|
value: toValue2 ?? ""
|
45419
45401
|
}
|
@@ -45432,7 +45414,7 @@ function FilterValue(props) {
|
|
45432
45414
|
}
|
45433
45415
|
function Control(props) {
|
45434
45416
|
var _a, _b;
|
45435
|
-
const { column, comparator, onChange, value, ...attributes } = props;
|
45417
|
+
const { column, comparator: _1, onChange, value, ...attributes } = props;
|
45436
45418
|
const controlRenderer = (_a = column == null ? void 0 : column.columnDef.meta) == null ? void 0 : _a.control;
|
45437
45419
|
const dataType = (_b = column == null ? void 0 : column.columnDef.meta) == null ? void 0 : _b.dataType;
|
45438
45420
|
const filters = React.useContext(FilterContext);
|
@@ -45457,9 +45439,11 @@ function Control(props) {
|
|
45457
45439
|
}
|
45458
45440
|
if (controlRenderer === "datepicker" || dataType === "datetime" || dataType === "date") {
|
45459
45441
|
return /* @__PURE__ */ React.createElement(Datepicker, { ...attributes, onChange: (event) => onChange(event.detail), value });
|
45460
|
-
}
|
45442
|
+
}
|
45443
|
+
if (controlRenderer === "switch") {
|
45461
45444
|
return /* @__PURE__ */ React.createElement(Switch$1, { ...attributes, className: "m-1.5", checked: Boolean(value), onChange });
|
45462
|
-
}
|
45445
|
+
}
|
45446
|
+
if (controlRenderer === "checkbox") {
|
45463
45447
|
return /* @__PURE__ */ React.createElement(Checkbox$2, { ...attributes, className: "!m-1.5", checked: Boolean(value), onChange });
|
45464
45448
|
}
|
45465
45449
|
return /* @__PURE__ */ React.createElement(
|
@@ -45592,7 +45576,7 @@ function ManageFiltersPopover(props) {
|
|
45592
45576
|
filter: filter2,
|
45593
45577
|
position: index2,
|
45594
45578
|
onChange: handleChangeFilter,
|
45595
|
-
onRemove: filters.
|
45579
|
+
onRemove: filters.some((f2) => f2.id) || filters.length > 1 ? handleRemoveFilter : void 0
|
45596
45580
|
}
|
45597
45581
|
)), /* @__PURE__ */ React.createElement("div", { className: "justify-start" }, /* @__PURE__ */ React.createElement(Button$4, { appearance: "discrete", onClick: handleCreate, name: "add-filter" }, "+ ", texts.table.filters.buttons.addFilter))), /* @__PURE__ */ React.createElement(Group$6, { className: "ml-auto" }, /* @__PURE__ */ React.createElement(Popover.Close, null, /* @__PURE__ */ React.createElement(Button$4, { name: "close-filters" }, texts.table.filters.buttons.cancel)), /* @__PURE__ */ React.createElement(Button$4, { name: "clear-filters", onClick: handleClear }, texts.table.filters.buttons.clear), /* @__PURE__ */ React.createElement(Button$4, { appearance: "primary", name: "apply-filters", onClick: handleApply }, texts.table.filters.buttons.apply))))));
|
45598
45582
|
}
|
@@ -45623,7 +45607,7 @@ function Filters(props) {
|
|
45623
45607
|
if (!isLargeScreen && !appliedFilters.length) {
|
45624
45608
|
return /* @__PURE__ */ React.createElement(IconButton, { ...buttonProps, icon: "filter" });
|
45625
45609
|
}
|
45626
|
-
return /* @__PURE__ */ React.createElement(Button$4, { ...buttonProps }, /* @__PURE__ */ React.createElement(Icon$1, { className:
|
45610
|
+
return /* @__PURE__ */ React.createElement(Button$4, { ...buttonProps }, /* @__PURE__ */ React.createElement(Icon$1, { className: isLargeScreen ? void 0 : "-mr-1.5", name: appliedFilters.length ? "filter-solid" : "filter" }), isLargeScreen ? texts.table.filters.button : "", appliedFilters.length ? `(${appliedFilters.length})` : "");
|
45627
45611
|
}
|
45628
45612
|
function TableToolbar(props) {
|
45629
45613
|
const { children: customTools, table, ...attributes } = props;
|
@@ -51144,9 +51128,9 @@ const getNumber = (amount = "", decimalSeparator = ",") => {
|
|
51144
51128
|
}
|
51145
51129
|
let value;
|
51146
51130
|
if (decimalSeparator === ",") {
|
51147
|
-
value = Number(amount.
|
51131
|
+
value = Number(amount.replaceAll("\\.", "").replace(",", "."));
|
51148
51132
|
} else {
|
51149
|
-
value = Number(amount.
|
51133
|
+
value = Number(amount.replaceAll(",", ""));
|
51150
51134
|
}
|
51151
51135
|
return Number.isNaN(value) ? void 0 : value;
|
51152
51136
|
};
|
@@ -51205,9 +51189,8 @@ const sortTypes = (locale2) => {
|
|
51205
51189
|
const b2 = guess(rowB.values[columnId]);
|
51206
51190
|
if (typeof a2 === "string" && typeof b2 === "string") {
|
51207
51191
|
return compareBasicStrings(a2, b2, locale2);
|
51208
|
-
} else {
|
51209
|
-
return compareBasic(a2, b2);
|
51210
51192
|
}
|
51193
|
+
return compareBasic(a2, b2);
|
51211
51194
|
}
|
51212
51195
|
};
|
51213
51196
|
};
|
@@ -51707,7 +51690,7 @@ const useRowSelect = (onSelectedRows) => {
|
|
51707
51690
|
const { onChange: _, ...props } = getToggleAllRowsSelectedProps();
|
51708
51691
|
const onChange = (checked) => {
|
51709
51692
|
if (checked) {
|
51710
|
-
onSelectedRows(Object.assign({}, Array(rows.length).fill(true)));
|
51693
|
+
onSelectedRows(Object.assign({}, Array.from({ length: rows.length }).fill(true)));
|
51711
51694
|
} else {
|
51712
51695
|
onSelectedRows({});
|
51713
51696
|
}
|
@@ -51728,15 +51711,7 @@ const useRowSelect = (onSelectedRows) => {
|
|
51728
51711
|
}
|
51729
51712
|
lastSelectedSortedIndex.current = sortedIndex;
|
51730
51713
|
};
|
51731
|
-
return /* @__PURE__ */ React.createElement(
|
51732
|
-
Checkbox$2,
|
51733
|
-
{
|
51734
|
-
...props,
|
51735
|
-
className: "!mt-2.5",
|
51736
|
-
onClick,
|
51737
|
-
onChange: () => false
|
51738
|
-
}
|
51739
|
-
);
|
51714
|
+
return /* @__PURE__ */ React.createElement(Checkbox$2, { ...props, className: "!mt-2.5", onClick, onChange: () => false });
|
51740
51715
|
},
|
51741
51716
|
flex: "0 0 36px",
|
51742
51717
|
className: "flex-col justify-start !py-0"
|
@@ -51752,7 +51727,7 @@ const useTableKeyboardNavigation = (props, rows, rowProps, ref) => {
|
|
51752
51727
|
const useGlobalKeyboardNavigation = props.dangerouslyHijackGlobalKeyboardNavigation;
|
51753
51728
|
const [activeIndex, setActiveIndex] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
|
51754
51729
|
prop: props.activeIndex,
|
51755
|
-
defaultProp: props.defaultActiveIndex
|
51730
|
+
defaultProp: props.defaultActiveIndex === void 0 ? useGlobalKeyboardNavigation ? 0 : void 0 : props.defaultActiveIndex,
|
51756
51731
|
onChange: (index2) => {
|
51757
51732
|
var _a;
|
51758
51733
|
if (index2 !== void 0) {
|
@@ -51788,27 +51763,26 @@ const useTableKeyboardNavigation = (props, rows, rowProps, ref) => {
|
|
51788
51763
|
event.preventDefault();
|
51789
51764
|
currentRow.toggleRowExpanded();
|
51790
51765
|
return;
|
51791
|
-
}
|
51766
|
+
}
|
51767
|
+
if (!currentRow.isExpanded && event.key === "ArrowRight") {
|
51792
51768
|
event.preventDefault();
|
51793
51769
|
currentRow.toggleRowExpanded();
|
51794
51770
|
return;
|
51795
51771
|
}
|
51796
51772
|
}
|
51797
|
-
if (currentRow.toggleRowEditing) {
|
51798
|
-
if (
|
51799
|
-
|
51800
|
-
|
51801
|
-
|
51802
|
-
currentRow.toggleRowExpanded();
|
51803
|
-
}
|
51804
|
-
rowProps.onRowCreate(sanitizedRow, event);
|
51805
|
-
return;
|
51806
|
-
}
|
51807
|
-
if (event.key === "e") {
|
51808
|
-
event.preventDefault();
|
51809
|
-
currentRow.toggleRowEditing();
|
51810
|
-
return;
|
51773
|
+
if (currentRow.toggleRowEditing && currentRow.canEdit && !currentRow.isEditing) {
|
51774
|
+
if (rowProps.onRowCreate && event.shiftKey && event.key === "n") {
|
51775
|
+
event.preventDefault();
|
51776
|
+
if (!currentRow.isExpanded) {
|
51777
|
+
currentRow.toggleRowExpanded();
|
51811
51778
|
}
|
51779
|
+
rowProps.onRowCreate(sanitizedRow, event);
|
51780
|
+
return;
|
51781
|
+
}
|
51782
|
+
if (event.key === "e") {
|
51783
|
+
event.preventDefault();
|
51784
|
+
currentRow.toggleRowEditing();
|
51785
|
+
return;
|
51812
51786
|
}
|
51813
51787
|
}
|
51814
51788
|
if (rowProps.onRowEdit && event.key === "e" && !isModifierKeyPressed) {
|
@@ -51911,13 +51885,13 @@ const getRowProps = (onRowDrag) => (props, { instance, row }) => {
|
|
51911
51885
|
const onDragStart = (event) => {
|
51912
51886
|
event.persist();
|
51913
51887
|
row.toggleRowDragging();
|
51914
|
-
const indexPaths = [row.id, ...Object.keys(instance.state.selectedRowIds)];
|
51915
|
-
const data = instance.rows.filter((r2) => indexPaths.
|
51888
|
+
const indexPaths = /* @__PURE__ */ new Set([row.id, ...Object.keys(instance.state.selectedRowIds)]);
|
51889
|
+
const data = instance.rows.filter((r2) => indexPaths.has(r2.id)).map(sanitizeRowProps);
|
51916
51890
|
const showPlaceholder = (placeholder) => {
|
51917
51891
|
const element = window.document.createElement("div");
|
51918
51892
|
element.id = "yt-table__drag__placeholder";
|
51919
51893
|
element.innerText = placeholder;
|
51920
|
-
window.document.body.
|
51894
|
+
window.document.body.append(element);
|
51921
51895
|
if (typeof DataTransfer.prototype.setDragImage === "function") {
|
51922
51896
|
event.dataTransfer.setDragImage(element, 0, 20);
|
51923
51897
|
}
|
@@ -51927,7 +51901,7 @@ const getRowProps = (onRowDrag) => (props, { instance, row }) => {
|
|
51927
51901
|
const onDragEnd = () => {
|
51928
51902
|
const element = document.getElementById("yt-table__drag__placeholder");
|
51929
51903
|
if (element && element.parentNode) {
|
51930
|
-
element.
|
51904
|
+
element.remove();
|
51931
51905
|
}
|
51932
51906
|
row.toggleRowDragging();
|
51933
51907
|
};
|
@@ -52076,8 +52050,8 @@ const useTable = (props, ref) => {
|
|
52076
52050
|
initialState: {
|
52077
52051
|
// @ts-expect-error: not sure how to type this correctly right now
|
52078
52052
|
sortBy: getInternalSortRules(sortRules) || defaultSortRules,
|
52079
|
-
pageSize:
|
52080
|
-
pageIndex:
|
52053
|
+
pageSize: disablePagination ? void 0 : pageSize,
|
52054
|
+
pageIndex: disablePagination ? void 0 : pageIndex
|
52081
52055
|
},
|
52082
52056
|
manualPagination,
|
52083
52057
|
pageCount: manualPagination && length ? Math.ceil(length / pageSize) : -1,
|
@@ -52151,13 +52125,13 @@ const useTable = (props, ref) => {
|
|
52151
52125
|
tabIndex: otherProps.tabIndex ?? 0
|
52152
52126
|
},
|
52153
52127
|
state,
|
52154
|
-
pagination:
|
52128
|
+
pagination: disablePagination ? null : {
|
52155
52129
|
length: manualPagination && length ? length : data.length,
|
52156
52130
|
pageIndex: state.pageIndex,
|
52157
52131
|
pageSize: state.pageSize,
|
52158
52132
|
setPageIndex: gotoPage,
|
52159
52133
|
setPageSize
|
52160
|
-
}
|
52134
|
+
},
|
52161
52135
|
rows: visibleRows,
|
52162
52136
|
prepareRow: prepareRow2,
|
52163
52137
|
instance: sanitizedInstance
|
@@ -52178,7 +52152,7 @@ const renderCell = (cell, row) => {
|
|
52178
52152
|
};
|
52179
52153
|
return /* @__PURE__ */ React.createElement("div", { ...props, role: "gridcell", "data-taco": "table-cell" }, cell.render("Cell") || null);
|
52180
52154
|
};
|
52181
|
-
const Row$1 = React.forwardRef(function TableRow({ row, index: index2, instance, headerGroups, ...rowProps }, ref) {
|
52155
|
+
const Row$1 = React.forwardRef(function TableRow({ row, index: index2, instance, headerGroups: _1, ...rowProps }, ref) {
|
52182
52156
|
const {
|
52183
52157
|
activeIndex,
|
52184
52158
|
onRowClick,
|
@@ -53242,7 +53216,7 @@ const WindowedTable = React.forwardRef(function WindowedTable2(props, ref) {
|
|
53242
53216
|
}
|
53243
53217
|
}, [rows.length]);
|
53244
53218
|
const contentHeight = estimatedRowHeight * props.data.length || 0;
|
53245
|
-
const isScrollbarVisible = height
|
53219
|
+
const isScrollbarVisible = height === null ? false : contentHeight > height;
|
53246
53220
|
const className = clsx(tableProps.className, "yt-table--windowed", { "table-with-scrollbar": isScrollbarVisible });
|
53247
53221
|
let list;
|
53248
53222
|
const itemData = {
|
@@ -53292,7 +53266,7 @@ const WindowedTable = React.forwardRef(function WindowedTable2(props, ref) {
|
|
53292
53266
|
);
|
53293
53267
|
}
|
53294
53268
|
}
|
53295
|
-
return /* @__PURE__ */ React.createElement(BaseTable, { ...tableProps, className, headerRef, ref: tableRef }, list
|
53269
|
+
return /* @__PURE__ */ React.createElement(BaseTable, { ...tableProps, className, headerRef, ref: tableRef }, list || emptyStateRenderer());
|
53296
53270
|
});
|
53297
53271
|
WindowedTable.Column = () => null;
|
53298
53272
|
WindowedTable.Group = () => null;
|
@@ -53863,7 +53837,7 @@ function requirePullAt() {
|
|
53863
53837
|
}
|
53864
53838
|
var pullAtExports = requirePullAt();
|
53865
53839
|
const pullAt = /* @__PURE__ */ getDefaultExportFromCjs(pullAtExports);
|
53866
|
-
const insertChildTableRow = (data, rowIndexPath = void 0, values
|
53840
|
+
const insertChildTableRow = (data, rowIndexPath = void 0, values) => {
|
53867
53841
|
const nexTRow = JSON.parse(JSON.stringify(data));
|
53868
53842
|
let childRowIndexPath;
|
53869
53843
|
if (rowIndexPath) {
|
@@ -53871,12 +53845,12 @@ const insertChildTableRow = (data, rowIndexPath = void 0, values = {}) => {
|
|
53871
53845
|
const currentRow = getByRowIndexPath(nexTRow, rowIndexes.join("."));
|
53872
53846
|
const nextSubRows = (currentRow == null ? void 0 : currentRow.subRows) ?? [];
|
53873
53847
|
const path = rowIndexes.map((i2) => `[${i2}]`).join(".subRows") + ".subRows";
|
53874
|
-
nextSubRows.unshift(values);
|
53848
|
+
nextSubRows.unshift(values ?? {});
|
53875
53849
|
set(nexTRow, path, nextSubRows);
|
53876
53850
|
rowIndexes.push(0);
|
53877
53851
|
childRowIndexPath = rowIndexes.join(".");
|
53878
53852
|
} else {
|
53879
|
-
nexTRow.unshift(values);
|
53853
|
+
nexTRow.unshift(values ?? {});
|
53880
53854
|
childRowIndexPath = "0";
|
53881
53855
|
}
|
53882
53856
|
return [nexTRow, childRowIndexPath];
|
@@ -53900,7 +53874,9 @@ const useTableRowCreation = (data, tableRef) => {
|
|
53900
53874
|
const [internalData, setInternalData] = React.useState(JSON.parse(JSON.stringify(data)));
|
53901
53875
|
const [activeRowIndexPath, setActiveRowIndexPath] = React.useState(void 0);
|
53902
53876
|
React.useEffect(() => {
|
53903
|
-
if (activeRowIndexPath
|
53877
|
+
if (activeRowIndexPath === void 0) {
|
53878
|
+
setInternalData(data);
|
53879
|
+
} else {
|
53904
53880
|
const currentRow = getByRowIndexPath(internalData, activeRowIndexPath);
|
53905
53881
|
const parentId = getParentRowIndexPath(activeRowIndexPath);
|
53906
53882
|
const [nexTRow, newRowIndexPath] = insertChildTableRow(JSON.parse(JSON.stringify(data)), parentId, currentRow);
|
@@ -53909,8 +53885,6 @@ const useTableRowCreation = (data, tableRef) => {
|
|
53909
53885
|
if (tableRef == null ? void 0 : tableRef.current) {
|
53910
53886
|
tableRef.current.instance.toggleRowEditing(currentRow == null ? void 0 : currentRow._createKey);
|
53911
53887
|
}
|
53912
|
-
} else {
|
53913
|
-
setInternalData(data);
|
53914
53888
|
}
|
53915
53889
|
}, [JSON.stringify(data)]);
|
53916
53890
|
const create = (rowIndexPath = void 0, values = {}) => {
|
@@ -53939,9 +53913,11 @@ function willRowMove(cell, change, rowIndex, localization) {
|
|
53939
53913
|
const { table } = cell.getContext();
|
53940
53914
|
if (willRowMoveAfterSearch(cell, change, table, localization)) {
|
53941
53915
|
return "search";
|
53942
|
-
}
|
53916
|
+
}
|
53917
|
+
if (willRowMoveAfterFilter(cell, change, localization)) {
|
53943
53918
|
return "filter";
|
53944
|
-
}
|
53919
|
+
}
|
53920
|
+
if (willRowMoveAfterSorting(cell, change, rowIndex)) {
|
53945
53921
|
return "sorting";
|
53946
53922
|
}
|
53947
53923
|
return void 0;
|
@@ -54023,7 +53999,7 @@ const shortcut = { key: "e", meta: true, shift: false };
|
|
54023
53999
|
function isTableScrolled(ref) {
|
54024
54000
|
var _a, _b, _c, _d;
|
54025
54001
|
if (ref.current) {
|
54026
|
-
const height = parseFloat(((_b = (_a = ref.current) == null ? void 0 : _a.querySelector("tbody")) == null ? void 0 : _b.style.height) || "0") + parseFloat(((_d = (_c = ref.current) == null ? void 0 : _c.querySelector("tbody")) == null ? void 0 : _d.style.paddingBottom) || "0");
|
54002
|
+
const height = Number.parseFloat(((_b = (_a = ref.current) == null ? void 0 : _a.querySelector("tbody")) == null ? void 0 : _b.style.height) || "0") + Number.parseFloat(((_d = (_c = ref.current) == null ? void 0 : _c.querySelector("tbody")) == null ? void 0 : _d.style.paddingBottom) || "0");
|
54027
54003
|
const hasVerticalScrollbar = ref.current.scrollHeight > ref.current.clientHeight;
|
54028
54004
|
return [hasVerticalScrollbar, height > ref.current.scrollHeight];
|
54029
54005
|
}
|
@@ -55394,7 +55370,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55394
55370
|
var _a;
|
55395
55371
|
const tableMeta = cell.getContext().table.options.meta;
|
55396
55372
|
const state2 = tableMeta.editing.getState();
|
55397
|
-
const changes = nextValue
|
55373
|
+
const changes = nextValue === void 0 ? { ...state2.changes.rows[cell.row.id] } : { ...state2.changes.rows[cell.row.id], [cell.column.id]: nextValue };
|
55398
55374
|
const original = cell.row.original;
|
55399
55375
|
if (!Object.keys(changes).length) {
|
55400
55376
|
return;
|
@@ -55549,7 +55525,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55549
55525
|
}
|
55550
55526
|
}
|
55551
55527
|
await handleSave(changeSet);
|
55552
|
-
|
55528
|
+
complete(rowId2, table, rowChanges);
|
55553
55529
|
setRowStatus(rowId2, "saved");
|
55554
55530
|
setTimeout(() => {
|
55555
55531
|
setRowStatus(rowId2, void 0);
|
@@ -55600,7 +55576,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55600
55576
|
await handleDiscard();
|
55601
55577
|
}
|
55602
55578
|
}
|
55603
|
-
|
55579
|
+
function complete(rowId, table, changes) {
|
55604
55580
|
const handleDiscard2 = async () => {
|
55605
55581
|
await discardChanges(rowId, table);
|
55606
55582
|
};
|
@@ -55641,7 +55617,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55641
55617
|
temporaryRows: state.temporaryRows
|
55642
55618
|
};
|
55643
55619
|
}
|
55644
|
-
function useTableEditing(isEnabled = false, defaultToggleEditing = false, handleSave, handleChange, handleCreate, handleDiscard, rowIdentityAccessor, validator, onEvent) {
|
55620
|
+
function useTableEditing(isEnabled = false, defaultToggleEditing = false, handleSave, handleChange, handleCreate, handleDiscard, rowIdentityAccessor, validator, showEditingActions = false, onEvent) {
|
55645
55621
|
const [isEditing, setEditing] = React.useState(defaultToggleEditing);
|
55646
55622
|
const [isDetailedMode, toggleDetailedMode] = React.useState(false);
|
55647
55623
|
const createRowButtonRef = React.useRef(null);
|
@@ -55718,6 +55694,7 @@ function useTableEditing(isEnabled = false, defaultToggleEditing = false, handle
|
|
55718
55694
|
isEnabled,
|
55719
55695
|
isEditing,
|
55720
55696
|
isDetailedMode,
|
55697
|
+
showEditingActions,
|
55721
55698
|
toggleDetailedMode: isEnabled ? toggleDetailedMode : () => void 0,
|
55722
55699
|
toggleEditing: isEnabled ? toggleEditing : () => void 0,
|
55723
55700
|
lastFocusedCellIndex,
|
@@ -55762,8 +55739,8 @@ function RowMoveIndicator(props) {
|
|
55762
55739
|
return /* @__PURE__ */ React.createElement(Tooltip$3, { placement: "bottom", title: description.replace("[COLUMN]", columnMeta.header) }, /* @__PURE__ */ React.createElement("span", { "data-row-move-indicator": true }, /* @__PURE__ */ React.createElement(Icon$1, { name: "info", className: "-mt-0.5 mr-1 !h-4 !w-4 rounded-full bg-white !p-0 text-blue-500" }), title));
|
55763
55740
|
}
|
55764
55741
|
function getMessageFromReason(texts, reason) {
|
55765
|
-
let title
|
55766
|
-
let description
|
55742
|
+
let title;
|
55743
|
+
let description;
|
55767
55744
|
switch (reason) {
|
55768
55745
|
case "filter":
|
55769
55746
|
title = texts.table3.editing.rowIndicator.rowWillBeHidden;
|
@@ -55777,11 +55754,15 @@ function getMessageFromReason(texts, reason) {
|
|
55777
55754
|
title = texts.table3.editing.rowIndicator.rowWillMove;
|
55778
55755
|
description = texts.table3.editing.rowIndicator.rowWillMoveReasonSorting;
|
55779
55756
|
break;
|
55757
|
+
default:
|
55758
|
+
title = "";
|
55759
|
+
description = "";
|
55760
|
+
break;
|
55780
55761
|
}
|
55781
55762
|
return { title, description };
|
55782
55763
|
}
|
55783
55764
|
const Textarea = React__namespace.forwardRef(function Textarea2(props, ref) {
|
55784
|
-
const { defaultValue:
|
55765
|
+
const { defaultValue: _1, highlighted: _2, invalid: _3, onKeyDown, ...otherProps } = props;
|
55785
55766
|
const classNames = clsx(
|
55786
55767
|
getInputClasses(props),
|
55787
55768
|
"pt-[5px] pb-[7px] min-h-[75px] disabled:resize-none !leading-5",
|
@@ -56242,10 +56223,16 @@ function DiscardChangesConfirmationDialog(props) {
|
|
56242
56223
|
));
|
56243
56224
|
}
|
56244
56225
|
function Row(props) {
|
56245
|
-
const { row, index: index2, table } = props;
|
56226
|
+
const { row, index: index2, table, measureRow } = props;
|
56246
56227
|
const focusManager = useAugmentedFocusManager();
|
56247
56228
|
const tableMeta = table.options.meta;
|
56248
56229
|
const isActiveRow = tableMeta.rowActive.rowActiveIndex === index2;
|
56230
|
+
const rowRef = React.useRef(null);
|
56231
|
+
const hasErrors = tableMeta.editing.hasRowErrors(row.id);
|
56232
|
+
React.useLayoutEffect(() => {
|
56233
|
+
if (!measureRow || !rowRef.current) return;
|
56234
|
+
measureRow(rowRef.current.getBoundingClientRect().height);
|
56235
|
+
}, [hasErrors, measureRow, row.id]);
|
56249
56236
|
React.useEffect(() => {
|
56250
56237
|
if (tableMeta.editing.isEditing && isActiveRow && tableMeta.editing.lastFocusedCellIndex === void 0) {
|
56251
56238
|
const element = focusManager.focusFirst();
|
@@ -56264,7 +56251,7 @@ function Row(props) {
|
|
56264
56251
|
var _a;
|
56265
56252
|
if (tableMeta.editing.isEditing) {
|
56266
56253
|
const cellIndex = Number(((_a = event.target.closest("td")) == null ? void 0 : _a.getAttribute("data-cell-index")) ?? void 0);
|
56267
|
-
if (!isNaN(cellIndex)) {
|
56254
|
+
if (!Number.isNaN(cellIndex)) {
|
56268
56255
|
tableMeta.editing.setLastFocusedCellIndex(Number(cellIndex));
|
56269
56256
|
}
|
56270
56257
|
}
|
@@ -56297,12 +56284,12 @@ function Row(props) {
|
|
56297
56284
|
}
|
56298
56285
|
}
|
56299
56286
|
const attributes = {
|
56300
|
-
"data-row-editing-invalid": tableMeta.editing.hasRowErrors(row.id) ?
|
56287
|
+
"data-row-editing-invalid": tableMeta.editing.hasRowErrors(row.id) ? tableMeta.editing.hasRowErrorsShownInAlert(row.id) ? true : "unseen" : void 0,
|
56301
56288
|
"data-row-editing-status": rowStatus,
|
56302
56289
|
onFocus: handleFocus,
|
56303
56290
|
onKeyDown: handleKeyDown
|
56304
56291
|
};
|
56305
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DisplayRow, { ...props, ...attributes }, rowStatus === "saving" || rowStatus === "saved" ? /* @__PURE__ */ React.createElement(SaveStatus, { rowId: row.id, table }) : null), /* @__PURE__ */ React.createElement(
|
56292
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(DisplayRow, { ...props, ...attributes, ref: rowRef }, rowStatus === "saving" || rowStatus === "saved" ? /* @__PURE__ */ React.createElement(SaveStatus, { rowId: row.id, table }) : null), /* @__PURE__ */ React.createElement(
|
56306
56293
|
DiscardChangesConfirmationDialog,
|
56307
56294
|
{
|
56308
56295
|
open: showDiscardDialog,
|
@@ -56326,6 +56313,7 @@ function useTable3(props, ref) {
|
|
56326
56313
|
props.onEditingDiscard,
|
56327
56314
|
props.rowIdentityAccessor,
|
56328
56315
|
props.validator,
|
56316
|
+
props.showEditingActions,
|
56329
56317
|
props.onEvent
|
56330
56318
|
);
|
56331
56319
|
const data = React.useMemo(() => {
|
@@ -56337,44 +56325,48 @@ function useTable3(props, ref) {
|
|
56337
56325
|
const extendedProps = {
|
56338
56326
|
...props,
|
56339
56327
|
data,
|
56340
|
-
enableRowActions: editing.isEditing ? true : props.enableRowActions,
|
56341
|
-
//
|
56342
|
-
rowActions: editing.isEditing ? (props.rowActions ?? []).concat(
|
56343
|
-
|
56344
|
-
|
56345
|
-
|
56346
|
-
|
56347
|
-
|
56348
|
-
|
56349
|
-
|
56350
|
-
|
56328
|
+
enableRowActions: editing.isEditing && props.showEditingActions ? true : props.enableRowActions,
|
56329
|
+
// While editing, only show editing actions (and their menu) when showEditingActions is true
|
56330
|
+
rowActions: editing.isEditing ? (props.rowActions ?? []).concat(
|
56331
|
+
// Only add editing actions if showEditingActions is explicitly set to true
|
56332
|
+
props.showEditingActions === true ? [
|
56333
|
+
// Note: helpers includes internal rowId and table properties not in the public type, that is why "any" is used
|
56334
|
+
(_1, helpers) => /* @__PURE__ */ React.createElement(
|
56335
|
+
IconButton,
|
56336
|
+
{
|
56337
|
+
"aria-label": texts.table3.editing.actions.save,
|
56338
|
+
icon: "tick",
|
56339
|
+
disabled: !editing.hasChanges(helpers.rowId) || editing.hasRowErrors(helpers.rowId),
|
56340
|
+
onClick: async () => {
|
56341
|
+
await editing.saveChanges(helpers.table, helpers.rowId);
|
56342
|
+
}
|
56351
56343
|
}
|
56352
|
-
|
56353
|
-
|
56354
|
-
|
56355
|
-
|
56356
|
-
|
56357
|
-
|
56358
|
-
|
56359
|
-
|
56360
|
-
|
56361
|
-
|
56362
|
-
|
56363
|
-
|
56364
|
-
|
56365
|
-
|
56366
|
-
|
56367
|
-
|
56368
|
-
|
56369
|
-
|
56370
|
-
}
|
56344
|
+
),
|
56345
|
+
(_1, helpers) => /* @__PURE__ */ React.createElement(
|
56346
|
+
IconButton,
|
56347
|
+
{
|
56348
|
+
"aria-label": texts.table3.editing.actions.clear,
|
56349
|
+
icon: "close",
|
56350
|
+
disabled: !editing.hasChanges(helpers.rowId),
|
56351
|
+
dialog: (props2) => /* @__PURE__ */ React.createElement(
|
56352
|
+
DiscardChangesConfirmationDialog,
|
56353
|
+
{
|
56354
|
+
...props2,
|
56355
|
+
onDiscard: () => {
|
56356
|
+
editing.discardChanges(helpers.rowId, helpers.table);
|
56357
|
+
if (editing.temporaryRows.length) {
|
56358
|
+
requestAnimationFrame(() => {
|
56359
|
+
var _a;
|
56360
|
+
return (_a = editing.createRowButtonRef.current) == null ? void 0 : _a.focus();
|
56361
|
+
});
|
56362
|
+
}
|
56371
56363
|
}
|
56372
56364
|
}
|
56373
|
-
|
56374
|
-
|
56375
|
-
|
56376
|
-
|
56377
|
-
|
56365
|
+
)
|
56366
|
+
}
|
56367
|
+
)
|
56368
|
+
] : []
|
56369
|
+
) : props.rowActions
|
56378
56370
|
};
|
56379
56371
|
const meta = { editing };
|
56380
56372
|
const table = useTable$1(extendedProps, ref, RENDERERS, meta);
|
@@ -56404,7 +56396,7 @@ function useTable3(props, ref) {
|
|
56404
56396
|
if (table.ref.current) {
|
56405
56397
|
const instance = table.ref.current.instance;
|
56406
56398
|
if (table.meta.editing.isEnabled) {
|
56407
|
-
instance.editing.forceValidate = async () => table.meta.editing.forceValidate(table.instance);
|
56399
|
+
instance.editing.forceValidate = async () => await table.meta.editing.forceValidate(table.instance);
|
56408
56400
|
}
|
56409
56401
|
}
|
56410
56402
|
}, [table.meta.editing.forceValidate]);
|
@@ -56677,7 +56669,7 @@ const BaseTable3 = fixedForwardRef(function BaseTable32(props, ref) {
|
|
56677
56669
|
tableMeta: table3.meta,
|
56678
56670
|
tableRef: table3.ref
|
56679
56671
|
}
|
56680
|
-
),
|
56672
|
+
), isScrolled ? null : createWorkflow) : null
|
56681
56673
|
));
|
56682
56674
|
});
|
56683
56675
|
const Table3 = fixedForwardRef(function Table32(props, ref) {
|
@@ -63605,12 +63597,10 @@ const Tooltip$2 = ({
|
|
63605
63597
|
const skipButtonRef = React__namespace.useRef(null);
|
63606
63598
|
React__namespace.useEffect(() => {
|
63607
63599
|
const onWindowKeyDown = (event) => {
|
63608
|
-
if (!disableTourSkipOnEsc) {
|
63609
|
-
|
63610
|
-
|
63611
|
-
|
63612
|
-
return;
|
63613
|
-
}
|
63600
|
+
if (!disableTourSkipOnEsc && event.key === "Escape" && skipButtonRef.current !== null) {
|
63601
|
+
event.preventDefault();
|
63602
|
+
skipButtonRef.current.click();
|
63603
|
+
return;
|
63614
63604
|
}
|
63615
63605
|
};
|
63616
63606
|
window.addEventListener("keydown", onWindowKeyDown);
|
@@ -63667,20 +63657,14 @@ const Tour = (props) => {
|
|
63667
63657
|
[props.children]
|
63668
63658
|
);
|
63669
63659
|
const callback = (state) => {
|
63670
|
-
if (state.action === ACTIONS.SKIP && state.lifecycle === LIFECYCLE.COMPLETE) {
|
63671
|
-
|
63672
|
-
onClose(getStep(state.step.target));
|
63673
|
-
}
|
63660
|
+
if (onClose && state.action === ACTIONS.SKIP && state.lifecycle === LIFECYCLE.COMPLETE) {
|
63661
|
+
onClose(getStep(state.step.target));
|
63674
63662
|
}
|
63675
|
-
if (state.type === EVENTS.TOUR_END) {
|
63676
|
-
|
63677
|
-
onComplete();
|
63678
|
-
}
|
63663
|
+
if (onComplete && state.type === EVENTS.TOUR_END) {
|
63664
|
+
onComplete();
|
63679
63665
|
}
|
63680
|
-
if (state.lifecycle === LIFECYCLE.READY) {
|
63681
|
-
|
63682
|
-
onReady(getStep(state.step.target));
|
63683
|
-
}
|
63666
|
+
if (onReady && state.lifecycle === LIFECYCLE.READY) {
|
63667
|
+
onReady(getStep(state.step.target));
|
63684
63668
|
}
|
63685
63669
|
};
|
63686
63670
|
return /* @__PURE__ */ React__namespace.createElement(
|
@@ -87215,14 +87199,14 @@ function getAxisProps(axis, props, inverted = false) {
|
|
87215
87199
|
}
|
87216
87200
|
function stripCartesianProps(props) {
|
87217
87201
|
const {
|
87218
|
-
dataKey,
|
87219
|
-
showXAxis,
|
87220
|
-
showYAxis,
|
87221
|
-
xAxisScale,
|
87222
|
-
xAxisTickFormatter,
|
87223
|
-
yAxisScale,
|
87224
|
-
yAxisTickFormatter,
|
87225
|
-
yAxisWidth,
|
87202
|
+
dataKey: _1,
|
87203
|
+
showXAxis: _2,
|
87204
|
+
showYAxis: _3,
|
87205
|
+
xAxisScale: _4,
|
87206
|
+
xAxisTickFormatter: _5,
|
87207
|
+
yAxisScale: _6,
|
87208
|
+
yAxisTickFormatter: _7,
|
87209
|
+
yAxisWidth: _8,
|
87226
87210
|
...otherProps
|
87227
87211
|
} = props;
|
87228
87212
|
return otherProps;
|
@@ -87413,17 +87397,17 @@ const mapColor = (palette, prefix2 = "") => {
|
|
87413
87397
|
return Object.keys(palette).reduce((accum, color2) => {
|
87414
87398
|
if (color2 === "current") {
|
87415
87399
|
return accum;
|
87416
|
-
}
|
87400
|
+
}
|
87401
|
+
if (typeof palette[color2] === "string") {
|
87417
87402
|
return {
|
87418
87403
|
...accum,
|
87419
87404
|
[prefix2 ? color2 === "DEFAULT" ? prefix2 : `${prefix2}-${color2}` : color2]: palette[color2]
|
87420
87405
|
};
|
87421
|
-
} else {
|
87422
|
-
return {
|
87423
|
-
...accum,
|
87424
|
-
...mapColor(palette[color2], color2)
|
87425
|
-
};
|
87426
87406
|
}
|
87407
|
+
return {
|
87408
|
+
...accum,
|
87409
|
+
...mapColor(palette[color2], color2)
|
87410
|
+
};
|
87427
87411
|
}, {});
|
87428
87412
|
};
|
87429
87413
|
const colors = mapColor(THEME_COLORS);
|
@@ -87435,12 +87419,11 @@ const getInverseThemeColor = (hexCode) => {
|
|
87435
87419
|
if (shade) {
|
87436
87420
|
if (shade > 500) {
|
87437
87421
|
return getThemeColor(`${color2}-100`);
|
87438
|
-
} else {
|
87439
|
-
if (shade === 500 && (color2 === "red" || color2 === "blue" || color2 === "brown" || color2 === "purple" || color2 === "green")) {
|
87440
|
-
return "white";
|
87441
|
-
}
|
87442
|
-
return getThemeColor(`${color2}-900`);
|
87443
87422
|
}
|
87423
|
+
if (shade === 500 && (color2 === "red" || color2 === "blue" || color2 === "brown" || color2 === "purple" || color2 === "green")) {
|
87424
|
+
return "white";
|
87425
|
+
}
|
87426
|
+
return getThemeColor(`${color2}-900`);
|
87444
87427
|
}
|
87445
87428
|
return color2 === "black" ? "white" : "black";
|
87446
87429
|
};
|
@@ -87555,7 +87538,7 @@ function BarChart(props) {
|
|
87555
87538
|
children,
|
87556
87539
|
className: customClassName,
|
87557
87540
|
data,
|
87558
|
-
orientation,
|
87541
|
+
orientation: _1,
|
87559
87542
|
showLabels = false,
|
87560
87543
|
showLegend = false,
|
87561
87544
|
stacked = false,
|
@@ -87776,7 +87759,7 @@ const ActiveShape = (props) => {
|
|
87776
87759
|
endAngle,
|
87777
87760
|
innerRadius: outerRadius + 2,
|
87778
87761
|
outerRadius: outerRadius + HOVER_DONUT_WIDTH,
|
87779
|
-
fill: id2
|
87762
|
+
fill: id2 === void 0 ? getThemeColor("blue-500") : getThemeColor(pieColors[id2], "blue-500"),
|
87780
87763
|
opacity: 0.4
|
87781
87764
|
}
|
87782
87765
|
));
|
@@ -87833,7 +87816,7 @@ const LegacyDonutChart = function LegacyDonutChart2({ children, formatter, onCli
|
|
87833
87816
|
}, {});
|
87834
87817
|
const hoveredSegmentColor = getSegmentColor(hoveredItem);
|
87835
87818
|
const selectedSegmentColor = getSegmentColor(selectedItem);
|
87836
|
-
return hoveredItem.length
|
87819
|
+
return hoveredItem.length === 0 ? selectedSegmentColor : hoveredSegmentColor;
|
87837
87820
|
}, [hoveredItem, selectedItem]);
|
87838
87821
|
if (ref.current && !radius) {
|
87839
87822
|
return null;
|
@@ -88135,7 +88118,8 @@ const AgreementAvatar = React.forwardRef(function AgreementAvatar2(props, ref) {
|
|
88135
88118
|
const AgreementBadge = ({ agreement, ...props }) => {
|
88136
88119
|
if (agreement.isAdministrator) {
|
88137
88120
|
return /* @__PURE__ */ React.createElement(Badge2, { ...props, color: "blue", small: true }, "Admin");
|
88138
|
-
}
|
88121
|
+
}
|
88122
|
+
if (agreement.isDeveloper) {
|
88139
88123
|
return /* @__PURE__ */ React.createElement(Badge2, { ...props, color: "blue", small: true }, "Developer");
|
88140
88124
|
}
|
88141
88125
|
return null;
|
@@ -88523,7 +88507,7 @@ const Link3 = React.forwardRef(function Link23(props, ref) {
|
|
88523
88507
|
}
|
88524
88508
|
}
|
88525
88509
|
) : null,
|
88526
|
-
total
|
88510
|
+
total === void 0 ? null : /* @__PURE__ */ React.createElement(
|
88527
88511
|
Badge2,
|
88528
88512
|
{
|
88529
88513
|
className: clsx("flex-shrink-0 flex-grow-0 !font-normal", {
|
@@ -88532,7 +88516,7 @@ const Link3 = React.forwardRef(function Link23(props, ref) {
|
|
88532
88516
|
color: "transparent"
|
88533
88517
|
},
|
88534
88518
|
total
|
88535
|
-
)
|
88519
|
+
)
|
88536
88520
|
));
|
88537
88521
|
});
|
88538
88522
|
const Section = React.forwardRef(function Navigation22(props, ref) {
|
@@ -88614,7 +88598,10 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88614
88598
|
_lastUsedHiddenColumns.current = hiddenColumns;
|
88615
88599
|
let nextCache;
|
88616
88600
|
if (hasDataChanged || !direction) {
|
88617
|
-
nextCache = nextPages.reduce(
|
88601
|
+
nextCache = nextPages.reduce(
|
88602
|
+
(acc, p2) => ({ ...acc, [p2]: Array.from({ length: pageSize }).fill(void 0) }),
|
88603
|
+
{}
|
88604
|
+
);
|
88618
88605
|
} else {
|
88619
88606
|
nextCache = { ...currentData.cache };
|
88620
88607
|
}
|
@@ -88624,7 +88611,7 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88624
88611
|
} else if (direction === "backward" && currentData.rows.length >= DATASET_SIZE) {
|
88625
88612
|
delete nextCache[currentData.pages[currentData.pages.length - 1]];
|
88626
88613
|
}
|
88627
|
-
const rows = Object.values(nextCache).
|
88614
|
+
const rows = Object.values(nextCache).flat();
|
88628
88615
|
return {
|
88629
88616
|
cache: nextCache,
|
88630
88617
|
pages: nextPages,
|
@@ -88649,7 +88636,7 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88649
88636
|
const pages = [];
|
88650
88637
|
const cache = {};
|
88651
88638
|
const pageCount = Math.ceil(response.length / pageSize);
|
88652
|
-
Array.from(Array(pageCount).keys()).forEach((index2) => {
|
88639
|
+
Array.from(Array.from({ length: pageCount }).keys()).forEach((index2) => {
|
88653
88640
|
pages.push(index2);
|
88654
88641
|
const startIndex = index2 * pageSize;
|
88655
88642
|
cache[index2] = response.data.slice(startIndex, startIndex + pageSize);
|
@@ -88684,7 +88671,7 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88684
88671
|
(acc, p2, index22) => ({ ...acc, [p2]: responses[index22].data }),
|
88685
88672
|
{}
|
88686
88673
|
);
|
88687
|
-
const rows = Object.values(nextCache).
|
88674
|
+
const rows = Object.values(nextCache).flat();
|
88688
88675
|
setData({
|
88689
88676
|
cache: nextCache,
|
88690
88677
|
pages: nextPages,
|
@@ -88698,7 +88685,7 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88698
88685
|
}
|
88699
88686
|
}
|
88700
88687
|
const invalidate = async () => {
|
88701
|
-
return reloadCurrentPages(
|
88688
|
+
return await reloadCurrentPages(
|
88702
88689
|
getCurrentPage(data.pages),
|
88703
88690
|
_lastUsedSorting.current,
|
88704
88691
|
_lastUsedFilters.current,
|
@@ -88707,7 +88694,7 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88707
88694
|
);
|
88708
88695
|
};
|
88709
88696
|
const handleSort = async (sorting) => {
|
88710
|
-
return reloadCurrentPages(
|
88697
|
+
return await reloadCurrentPages(
|
88711
88698
|
getCurrentPage(data.pages),
|
88712
88699
|
sorting,
|
88713
88700
|
_lastUsedFilters.current,
|
@@ -88716,10 +88703,10 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88716
88703
|
);
|
88717
88704
|
};
|
88718
88705
|
const handleFilter = async (filters, hiddenColumns) => {
|
88719
|
-
return loadPage(0, _lastUsedSorting.current, filters, hiddenColumns, _lastUsedSearch.current);
|
88706
|
+
return await loadPage(0, _lastUsedSorting.current, filters, hiddenColumns, _lastUsedSearch.current);
|
88720
88707
|
};
|
88721
88708
|
const handleSearch = async (search, hiddenColumns) => {
|
88722
|
-
return loadPage(0, _lastUsedSorting.current, _lastUsedFilters.current, hiddenColumns, search);
|
88709
|
+
return await loadPage(0, _lastUsedSorting.current, _lastUsedFilters.current, hiddenColumns, search);
|
88723
88710
|
};
|
88724
88711
|
return [
|
88725
88712
|
{
|
@@ -88748,7 +88735,8 @@ function getDirection(pageIndex, currentPages) {
|
|
88748
88735
|
if (currentPages.length) {
|
88749
88736
|
if (pageIndex === currentPages[currentPages.length - 1] + 1) {
|
88750
88737
|
return "forward";
|
88751
|
-
}
|
88738
|
+
}
|
88739
|
+
if (pageIndex === currentPages[0] - 1 || currentPages.length === 2 && currentPages[0] !== 0 && pageIndex === currentPages[0]) {
|
88752
88740
|
return "backward";
|
88753
88741
|
}
|
88754
88742
|
}
|
@@ -88782,7 +88770,7 @@ const useBoundaryOverflowDetection = (ref, dependencies = []) => {
|
|
88782
88770
|
const useOnClickOutside = (ref, callback) => {
|
88783
88771
|
React.useEffect(() => {
|
88784
88772
|
const listener = (event) => {
|
88785
|
-
const refs =
|
88773
|
+
const refs = Array.isArray(ref) ? ref : [ref];
|
88786
88774
|
if (refs.some((currentRef) => !currentRef.current || currentRef.current.contains(event.target))) {
|
88787
88775
|
return;
|
88788
88776
|
}
|