@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.js
CHANGED
@@ -65,8 +65,6 @@ const getOutlineColorShadeClasses = (state) => {
|
|
65
65
|
return "border-pink-700 text-pink-700";
|
66
66
|
case "orange":
|
67
67
|
return "border-orange-700 text-orange-700";
|
68
|
-
case "transparent":
|
69
|
-
case "grey":
|
70
68
|
default:
|
71
69
|
return "border-grey-700 text-grey-700";
|
72
70
|
}
|
@@ -91,7 +89,6 @@ const getSubtleColorShadeClasses = (value) => {
|
|
91
89
|
return "wcag-orange-100";
|
92
90
|
case "transparent":
|
93
91
|
return "wcag-transparent";
|
94
|
-
case "grey":
|
95
92
|
default:
|
96
93
|
return "wcag-grey-200";
|
97
94
|
}
|
@@ -116,7 +113,6 @@ const getColorShadeClasses = (value) => {
|
|
116
113
|
return "wcag-orange-700";
|
117
114
|
case "transparent":
|
118
115
|
return "wcag-transparent";
|
119
|
-
case "grey":
|
120
116
|
default:
|
121
117
|
return "wcag-grey-700";
|
122
118
|
}
|
@@ -5357,7 +5353,7 @@ function mergeRefs(refs) {
|
|
5357
5353
|
refs.forEach((ref) => {
|
5358
5354
|
if (typeof ref === "function") {
|
5359
5355
|
ref(value);
|
5360
|
-
} else if (ref
|
5356
|
+
} else if (ref !== null) {
|
5361
5357
|
ref.current = value;
|
5362
5358
|
}
|
5363
5359
|
});
|
@@ -5416,6 +5412,8 @@ const getDialogSizeClassnames = (size2) => {
|
|
5416
5412
|
return "w-md";
|
5417
5413
|
case "lg":
|
5418
5414
|
return "w-lg";
|
5415
|
+
default:
|
5416
|
+
return void 0;
|
5419
5417
|
}
|
5420
5418
|
};
|
5421
5419
|
const getDialogPositionClassnames = () => "mt-16 mx-auto";
|
@@ -5460,7 +5458,7 @@ const Content$a = React.forwardRef(function AlertDialogContent(props, ref) {
|
|
5460
5458
|
))));
|
5461
5459
|
});
|
5462
5460
|
const AlertDialog = React.forwardRef(function AlertDialog2(props, ref) {
|
5463
|
-
const { children:
|
5461
|
+
const { children: _initialChildren, defaultOpen, onChange, open, trigger, ...otherProps } = props;
|
5464
5462
|
const context = React.useMemo(
|
5465
5463
|
() => ({
|
5466
5464
|
props: otherProps,
|
@@ -9879,11 +9877,11 @@ function isElementInteractive(element) {
|
|
9879
9877
|
if (!element) {
|
9880
9878
|
return false;
|
9881
9879
|
}
|
9882
|
-
const interactiveElements = ["A", "BUTTON", "INPUT", "TEXTAREA", "SELECT", "LABEL", "OPTION"];
|
9883
|
-
const isInteractive = interactiveElements.
|
9880
|
+
const interactiveElements = /* @__PURE__ */ new Set(["A", "BUTTON", "INPUT", "TEXTAREA", "SELECT", "LABEL", "OPTION"]);
|
9881
|
+
const isInteractive = interactiveElements.has(element.tagName) && !element.hidden && !element.disabled && !element.readOnly;
|
9884
9882
|
if (!isInteractive) {
|
9885
9883
|
const focusableParent = element.closest(FOCUSABLE_ELEMENTS.join(","));
|
9886
|
-
return focusableParent ? interactiveElements.
|
9884
|
+
return focusableParent ? interactiveElements.has(focusableParent.tagName) : false;
|
9887
9885
|
}
|
9888
9886
|
return isInteractive;
|
9889
9887
|
}
|
@@ -9967,7 +9965,7 @@ const Button$5 = React.forwardRef(function Button2(props, ref) {
|
|
9967
9965
|
"aria-disabled": disabled ? "true" : void 0,
|
9968
9966
|
disabled,
|
9969
9967
|
target: Tag2 === "a" ? target : void 0,
|
9970
|
-
type: Tag2
|
9968
|
+
type: Tag2 === "a" ? void 0 : type,
|
9971
9969
|
ref: internalRef
|
9972
9970
|
},
|
9973
9971
|
React.Children.count(props.children) > 1 ? React.Children.map(props.children, (child) => typeof child === "string" ? /* @__PURE__ */ React.createElement("span", null, child) : child) : props.children
|
@@ -17643,7 +17641,7 @@ const useBoundingClientRectListener = (ref, dependencies) => {
|
|
17643
17641
|
}, dependencies);
|
17644
17642
|
return dimensions;
|
17645
17643
|
};
|
17646
|
-
const validSetSelectionRangeTypes = ["text", "search", "url", "tel", "password"];
|
17644
|
+
const validSetSelectionRangeTypes = /* @__PURE__ */ new Set(["text", "search", "url", "tel", "password"]);
|
17647
17645
|
const InputWithoutDeprecatedFeatures = React.forwardRef(function InputWithoutDeprecatedFeatures2(props, ref) {
|
17648
17646
|
const { highlighted, invalid, onKeyDown, postfix, prefix: prefix2, type = "text", ...attributes } = props;
|
17649
17647
|
const internalRef = useMergedRef(ref);
|
@@ -17666,15 +17664,13 @@ const InputWithoutDeprecatedFeatures = React.forwardRef(function InputWithoutDep
|
|
17666
17664
|
if (event.key.length === 1 && !isPressingMetaKey(event)) {
|
17667
17665
|
event.stopPropagation();
|
17668
17666
|
}
|
17669
|
-
if (validSetSelectionRangeTypes.
|
17670
|
-
|
17671
|
-
|
17672
|
-
|
17673
|
-
|
17674
|
-
|
17675
|
-
|
17676
|
-
internalRef.current.scrollLeft = scrollPosition;
|
17677
|
-
}
|
17667
|
+
if (validSetSelectionRangeTypes.has(type) && !event.shiftKey && (event.key === "Home" || event.key === "End")) {
|
17668
|
+
event.preventDefault();
|
17669
|
+
const position = event.key === "End" ? event.currentTarget.value.length : 0;
|
17670
|
+
event.currentTarget.setSelectionRange(position, position);
|
17671
|
+
if (internalRef.current) {
|
17672
|
+
const scrollPosition = event.key === "End" ? internalRef.current.scrollWidth : 0;
|
17673
|
+
internalRef.current.scrollLeft = scrollPosition;
|
17678
17674
|
}
|
17679
17675
|
}
|
17680
17676
|
if (typeof onKeyDown === "function") {
|
@@ -18064,9 +18060,9 @@ const getNextIndexFromKey = (key, length, index2, direction = "vertical") => {
|
|
18064
18060
|
const nextKey = direction === "horizontal" ? "ArrowRight" : "ArrowDown";
|
18065
18061
|
switch (key) {
|
18066
18062
|
case previousKey:
|
18067
|
-
return index2
|
18063
|
+
return index2 === void 0 ? 0 : index2 - 1 < 0 ? 0 : index2 - 1;
|
18068
18064
|
case nextKey:
|
18069
|
-
return index2
|
18065
|
+
return index2 === void 0 ? length - 1 : index2 + 1 >= length ? index2 : index2 + 1;
|
18070
18066
|
case "Home":
|
18071
18067
|
return 0;
|
18072
18068
|
case "End":
|
@@ -18104,13 +18100,13 @@ const scrollToChildElement = (parent, child) => {
|
|
18104
18100
|
const useListScrollTo = (internalRef, itemRefs) => {
|
18105
18101
|
const scrollTo2 = (index2) => {
|
18106
18102
|
if (internalRef && internalRef.current) {
|
18107
|
-
if (index2
|
18103
|
+
if (index2 === void 0) {
|
18104
|
+
internalRef.current.scrollTop = 0;
|
18105
|
+
} else {
|
18108
18106
|
const activeRef = itemRefs[index2];
|
18109
18107
|
if (activeRef && activeRef.current) {
|
18110
18108
|
scrollToChildElement(internalRef.current, activeRef.current);
|
18111
18109
|
}
|
18112
|
-
} else {
|
18113
|
-
internalRef.current.scrollTop = 0;
|
18114
18110
|
}
|
18115
18111
|
}
|
18116
18112
|
};
|
@@ -18122,7 +18118,8 @@ const getNextEnabledItem$1 = (event, data, index2) => {
|
|
18122
18118
|
if (nextIndex) {
|
18123
18119
|
if (nextIndex === index2) {
|
18124
18120
|
return index2;
|
18125
|
-
}
|
18121
|
+
}
|
18122
|
+
if (data[nextIndex] && data[nextIndex].disabled) {
|
18126
18123
|
return getNextEnabledItem$1(event, data, nextIndex);
|
18127
18124
|
}
|
18128
18125
|
}
|
@@ -18132,9 +18129,9 @@ const ScrollableList = React.forwardRef(function ScrollableList2(props, ref) {
|
|
18132
18129
|
const {
|
18133
18130
|
data,
|
18134
18131
|
disabled,
|
18135
|
-
highlighted,
|
18132
|
+
highlighted: _1,
|
18136
18133
|
id: id2,
|
18137
|
-
invalid:
|
18134
|
+
invalid: _2,
|
18138
18135
|
loading,
|
18139
18136
|
onChange: setCurrentIndex,
|
18140
18137
|
onClick,
|
@@ -18172,7 +18169,7 @@ const ScrollableList = React.forwardRef(function ScrollableList2(props, ref) {
|
|
18172
18169
|
}
|
18173
18170
|
if (onKeyDown) {
|
18174
18171
|
event.persist();
|
18175
|
-
const index2 = nextIndex
|
18172
|
+
const index2 = nextIndex === void 0 ? currentIndex : nextIndex;
|
18176
18173
|
onKeyDown(event, index2);
|
18177
18174
|
}
|
18178
18175
|
event.stopPropagation();
|
@@ -18196,11 +18193,11 @@ const ScrollableList = React.forwardRef(function ScrollableList2(props, ref) {
|
|
18196
18193
|
const getOptionCheckedState = (optionValue, index2) => {
|
18197
18194
|
if (optionValue === "#ALL-OPTIONS#") {
|
18198
18195
|
return allOptionsSelected;
|
18199
|
-
}
|
18196
|
+
}
|
18197
|
+
if (!optionValue || !selectedIndexes) {
|
18200
18198
|
return false;
|
18201
|
-
} else {
|
18202
|
-
return selectedIndexes.findIndex((i2) => i2 === index2) !== -1;
|
18203
18199
|
}
|
18200
|
+
return selectedIndexes.some((i2) => i2 === index2);
|
18204
18201
|
};
|
18205
18202
|
const options = data.map((option, index2) => {
|
18206
18203
|
const depth = option.path ? option.path.split(".").length - 1 : 0;
|
@@ -18312,14 +18309,13 @@ const searchForString = (child, value, strategy = "includes") => {
|
|
18312
18309
|
try {
|
18313
18310
|
if (typeof child !== "string" && ((_a = child.props) == null ? void 0 : _a.children)) {
|
18314
18311
|
if (Array.isArray((_b = child.props) == null ? void 0 : _b.children)) {
|
18315
|
-
return !!child.props.children.
|
18312
|
+
return !!child.props.children.some(
|
18316
18313
|
(subChild) => searchForString(subChild, value, strategy)
|
18317
18314
|
);
|
18318
18315
|
}
|
18319
18316
|
return searchForString((_c = child.props) == null ? void 0 : _c.children, value, strategy);
|
18320
|
-
} else {
|
18321
|
-
return child.toString().toLowerCase()[strategy](String(value).toLowerCase());
|
18322
18317
|
}
|
18318
|
+
return child.toString().toLowerCase()[strategy](String(value).toLowerCase());
|
18323
18319
|
} catch {
|
18324
18320
|
return false;
|
18325
18321
|
}
|
@@ -18418,7 +18414,7 @@ const useCombobox = (props, ref) => {
|
|
18418
18414
|
data: unfilteredData = [],
|
18419
18415
|
defaultValue: defaultValue2,
|
18420
18416
|
disabled,
|
18421
|
-
id:
|
18417
|
+
id: _nativeId,
|
18422
18418
|
inline,
|
18423
18419
|
loading: __,
|
18424
18420
|
onChange,
|
@@ -18442,7 +18438,7 @@ const useCombobox = (props, ref) => {
|
|
18442
18438
|
[shouldFilterData, inputValue, flattenedData]
|
18443
18439
|
);
|
18444
18440
|
const [currentIndex, setCurrentIndex] = React.useState(
|
18445
|
-
inputValue
|
18441
|
+
inputValue === void 0 ? void 0 : getIndexFromValue(data, inputValue)
|
18446
18442
|
);
|
18447
18443
|
const setInputValueByIndex = (index2, event) => {
|
18448
18444
|
if (index2 !== void 0) {
|
@@ -18458,10 +18454,10 @@ const useCombobox = (props, ref) => {
|
|
18458
18454
|
return;
|
18459
18455
|
}
|
18460
18456
|
const option = data[index2];
|
18461
|
-
if (option.value
|
18462
|
-
setInputValueByIndex(index2, event);
|
18463
|
-
} else {
|
18457
|
+
if (option.value === value) {
|
18464
18458
|
setInputValue(convertToInputValue(value));
|
18459
|
+
} else {
|
18460
|
+
setInputValueByIndex(index2, event);
|
18465
18461
|
}
|
18466
18462
|
};
|
18467
18463
|
React.useEffect(() => {
|
@@ -18569,10 +18565,8 @@ const useCombobox = (props, ref) => {
|
|
18569
18565
|
case "ArrowDown":
|
18570
18566
|
if (open) {
|
18571
18567
|
event.preventDefault();
|
18572
|
-
} else {
|
18573
|
-
|
18574
|
-
buttonRef.current.click();
|
18575
|
-
}
|
18568
|
+
} else if (!inline && buttonRef.current && !isElementInsideTable3OrReport(event.currentTarget)) {
|
18569
|
+
buttonRef.current.click();
|
18576
18570
|
}
|
18577
18571
|
break;
|
18578
18572
|
case "ArrowUp":
|
@@ -18587,13 +18581,11 @@ const useCombobox = (props, ref) => {
|
|
18587
18581
|
if (listRef.current) {
|
18588
18582
|
listRef.current.dispatchEvent(createCustomKeyboardEvent(event));
|
18589
18583
|
}
|
18590
|
-
if (inline && !open) {
|
18591
|
-
|
18592
|
-
|
18593
|
-
|
18594
|
-
|
18595
|
-
setOpen(true);
|
18596
|
-
}
|
18584
|
+
if (inline && !open && (event.key === "ArrowUp" || event.key === "ArrowDown") && !isElementInsideTable3OrReport(event.currentTarget)) {
|
18585
|
+
event.preventDefault();
|
18586
|
+
const initialIndex = event.key === "ArrowUp" ? data.length - 1 : 0;
|
18587
|
+
setCurrentIndex(currentIndex === void 0 ? initialIndex : currentIndex);
|
18588
|
+
setOpen(true);
|
18597
18589
|
}
|
18598
18590
|
}
|
18599
18591
|
if (!event.isDefaultPrevented() && onKeyDown) {
|
@@ -18779,7 +18771,7 @@ const parseFromCustomString = (date2 = "", mask = "dd.mm.yy", defaultMonth = voi
|
|
18779
18771
|
const inputParts = date2.split(/\D/);
|
18780
18772
|
if (inputParts.length === 1) {
|
18781
18773
|
const fullDate = inputParts[0];
|
18782
|
-
const unseparatedMask = mask.
|
18774
|
+
const unseparatedMask = mask.replaceAll(/[^dmy]/g, "");
|
18783
18775
|
day = fullDate.slice(unseparatedMask.indexOf("d"), unseparatedMask.lastIndexOf("d") + 1);
|
18784
18776
|
month = fullDate.slice(unseparatedMask.indexOf("m"), unseparatedMask.lastIndexOf("m") + 1);
|
18785
18777
|
year = getFullYear(fullDate.slice(unseparatedMask.indexOf("y"), unseparatedMask.lastIndexOf("y") + 3));
|
@@ -18794,12 +18786,12 @@ const parseFromCustomString = (date2 = "", mask = "dd.mm.yy", defaultMonth = voi
|
|
18794
18786
|
const currentDate = /* @__PURE__ */ new Date();
|
18795
18787
|
return new Date(
|
18796
18788
|
/* year */
|
18797
|
-
Object.is(year, NaN) ? defaultYear ?? currentDate.getFullYear() : year,
|
18789
|
+
Object.is(year, Number.NaN) ? defaultYear ?? currentDate.getFullYear() : year,
|
18798
18790
|
/* month */
|
18799
|
-
Object.is(month, NaN) ? defaultMonth ?? currentDate.getMonth() : month - 1,
|
18791
|
+
Object.is(month, Number.NaN) ? defaultMonth ?? currentDate.getMonth() : month - 1,
|
18800
18792
|
// months are zero based in javascript, so subtract a day
|
18801
18793
|
/* day */
|
18802
|
-
Object.is(day, NaN) ? currentDate.getDate() : day,
|
18794
|
+
Object.is(day, Number.NaN) ? currentDate.getDate() : day,
|
18803
18795
|
/* hours */
|
18804
18796
|
12,
|
18805
18797
|
/* minutes */
|
@@ -18840,10 +18832,10 @@ const useDatepicker = ({ defaultValue: _, calendar: calendar2, onBlur, onChange,
|
|
18840
18832
|
event.target.value = formattedValue;
|
18841
18833
|
const isEmpty = !event.target.value.trim();
|
18842
18834
|
if (onChange) {
|
18843
|
-
event.detail =
|
18835
|
+
event.detail = isEmpty ? null : valueAsDate;
|
18844
18836
|
onChange(event);
|
18845
18837
|
} else {
|
18846
|
-
setInternalValue(
|
18838
|
+
setInternalValue(isEmpty ? "" : formattedValue);
|
18847
18839
|
}
|
18848
18840
|
if (onBlur) {
|
18849
18841
|
onBlur(event);
|
@@ -18927,7 +18919,7 @@ const RenderPropWrapper$2 = React.forwardRef(function RenderPropWrapper2({ child
|
|
18927
18919
|
return children({ close, ref });
|
18928
18920
|
});
|
18929
18921
|
const Content$7 = React.forwardRef(function PopoverContent(props, ref) {
|
18930
|
-
const { placement: side, ...popoverContentProps } = props;
|
18922
|
+
const { placement: side, container, ...popoverContentProps } = props;
|
18931
18923
|
const className = clsx(getPopoverStyleClassnames(), props.className);
|
18932
18924
|
let output;
|
18933
18925
|
if (typeof props.children === "function") {
|
@@ -18935,7 +18927,7 @@ const Content$7 = React.forwardRef(function PopoverContent(props, ref) {
|
|
18935
18927
|
} else {
|
18936
18928
|
output = props.children;
|
18937
18929
|
}
|
18938
|
-
return /* @__PURE__ */ React.createElement($cb5cc270b50c6fcd$export$602eac185826482c,
|
18930
|
+
return /* @__PURE__ */ React.createElement($cb5cc270b50c6fcd$export$602eac185826482c, { container }, /* @__PURE__ */ React.createElement(
|
18939
18931
|
$cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,
|
18940
18932
|
{
|
18941
18933
|
...popoverContentProps,
|
@@ -25798,7 +25790,6 @@ const getDrawerSizeClassnames = (size2) => {
|
|
25798
25790
|
switch (size2) {
|
25799
25791
|
case "lg":
|
25800
25792
|
return "w-[600px]";
|
25801
|
-
case "md":
|
25802
25793
|
default:
|
25803
25794
|
return "w-[420px]";
|
25804
25795
|
}
|
@@ -26627,7 +26618,7 @@ const Title$3 = React__default.forwardRef(function DrawerTitle(props, externalRe
|
|
26627
26618
|
) : null, /* @__PURE__ */ React__default.createElement("span", { className: "line-clamp-2 inline-block overflow-y-hidden", style }, children));
|
26628
26619
|
});
|
26629
26620
|
const Footer$1 = React__default.forwardRef(function DrawerFooter(props, ref) {
|
26630
|
-
const { className, ...otherProps } = props;
|
26621
|
+
const { className: _1, ...otherProps } = props;
|
26631
26622
|
const cName = clsx("mt-auto flex justify-end grow-0 p-4 border-t-[1px] border-grey-300", props.className);
|
26632
26623
|
return /* @__PURE__ */ React__default.createElement("div", { ...otherProps, className: cName, ref });
|
26633
26624
|
});
|
@@ -26700,13 +26691,15 @@ const DrawerContent = React__default.forwardRef(function Content2(props, externa
|
|
26700
26691
|
var _a;
|
26701
26692
|
const isTargetInsideDrawerContent = (_a = ref.current) == null ? void 0 : _a.contains(event.target);
|
26702
26693
|
if (isTargetInsideDrawerContent) {
|
26703
|
-
if (
|
26704
|
-
|
26705
|
-
|
26706
|
-
|
26694
|
+
if (closeOnEscape) {
|
26695
|
+
if (setOpen) {
|
26696
|
+
setOpen(false);
|
26697
|
+
}
|
26707
26698
|
if (onClose) {
|
26708
26699
|
onClose();
|
26709
26700
|
}
|
26701
|
+
} else {
|
26702
|
+
event.preventDefault();
|
26710
26703
|
}
|
26711
26704
|
}
|
26712
26705
|
};
|
@@ -26757,7 +26750,7 @@ const DrawerContent = React__default.forwardRef(function Content2(props, externa
|
|
26757
26750
|
)) : null);
|
26758
26751
|
const styleProp = {
|
26759
26752
|
...style,
|
26760
|
-
|
26753
|
+
width: resizedWidth
|
26761
26754
|
};
|
26762
26755
|
return focusTrap ? /* @__PURE__ */ React__default.createElement(
|
26763
26756
|
$5d3850c4d0b4e6c7$export$7c6e2c02157bb7d2,
|
@@ -26814,7 +26807,7 @@ const Drawer = React.forwardRef(function Drawer2(props, ref) {
|
|
26814
26807
|
onChange = () => {
|
26815
26808
|
},
|
26816
26809
|
variant = "embedded",
|
26817
|
-
className,
|
26810
|
+
className: _1,
|
26818
26811
|
closeOnEscape = true,
|
26819
26812
|
onResize,
|
26820
26813
|
onClose,
|
@@ -26866,7 +26859,9 @@ const Drawer = React.forwardRef(function Drawer2(props, ref) {
|
|
26866
26859
|
);
|
26867
26860
|
const close = React.useCallback(() => {
|
26868
26861
|
setOpen(false);
|
26869
|
-
|
26862
|
+
if (onClose) {
|
26863
|
+
onClose();
|
26864
|
+
}
|
26870
26865
|
}, []);
|
26871
26866
|
React.useEffect(() => {
|
26872
26867
|
const outletSelector = `[data-taco="drawer-outlet"][data-taco-outlet-name="${outletName ?? DEFAULT_OUTLET_NAME}"]`;
|
@@ -26879,13 +26874,11 @@ const Drawer = React.forwardRef(function Drawer2(props, ref) {
|
|
26879
26874
|
drawerStack();
|
26880
26875
|
}
|
26881
26876
|
drawerStack = close;
|
26882
|
-
} else {
|
26883
|
-
|
26884
|
-
drawerStack = void 0;
|
26885
|
-
}
|
26877
|
+
} else if (drawerStack === close) {
|
26878
|
+
drawerStack = void 0;
|
26886
26879
|
}
|
26887
26880
|
}, [open]);
|
26888
|
-
return /* @__PURE__ */ React.createElement(DrawerContext.Provider, { value: context }, /* @__PURE__ */ React.createElement($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9, { modal: variant === "overlay"
|
26881
|
+
return /* @__PURE__ */ React.createElement(DrawerContext.Provider, { value: context }, /* @__PURE__ */ React.createElement($5d3850c4d0b4e6c7$export$be92b6f5f03c0fe9, { modal: variant === "overlay", open, onOpenChange: setOpen }, trigger && /* @__PURE__ */ React.createElement(Trigger$3, null, trigger), children));
|
26889
26882
|
});
|
26890
26883
|
Drawer.Trigger = Trigger$3;
|
26891
26884
|
Drawer.Content = Content$5;
|
@@ -26956,7 +26949,7 @@ const Title$2 = React.forwardRef(function DialogTitle2(props, ref) {
|
|
26956
26949
|
return /* @__PURE__ */ React.createElement("span", { ...props, className, ref });
|
26957
26950
|
});
|
26958
26951
|
const Content$4 = React.forwardRef(function HangerContent(props, ref) {
|
26959
|
-
const { placement: side, hideWhenDetached = false } = props;
|
26952
|
+
const { placement: side, hideWhenDetached = false, container } = props;
|
26960
26953
|
const context = React.useContext(HangerContext);
|
26961
26954
|
const { texts } = useLocalization();
|
26962
26955
|
const className = clsx(
|
@@ -26966,7 +26959,7 @@ const Content$4 = React.forwardRef(function HangerContent(props, ref) {
|
|
26966
26959
|
const handleInteractOutside = (event) => {
|
26967
26960
|
event.preventDefault();
|
26968
26961
|
};
|
26969
|
-
return /* @__PURE__ */ React.createElement($cb5cc270b50c6fcd$export$602eac185826482c,
|
26962
|
+
return /* @__PURE__ */ React.createElement($cb5cc270b50c6fcd$export$602eac185826482c, { container }, /* @__PURE__ */ React.createElement(
|
26970
26963
|
$cb5cc270b50c6fcd$export$7c6e2c02157bb7d2,
|
26971
26964
|
{
|
26972
26965
|
className,
|
@@ -28102,10 +28095,10 @@ const useListbox = ({
|
|
28102
28095
|
value = emptyValue,
|
28103
28096
|
...otherProps
|
28104
28097
|
}, ref) => {
|
28105
|
-
const data = useFlattenedData(emptyValue
|
28098
|
+
const data = useFlattenedData(emptyValue === void 0 ? externalData : [{ text: "", value: emptyValue }, ...externalData]);
|
28106
28099
|
const id2 = React.useMemo(() => nativeId || nanoid(), [nativeId]);
|
28107
28100
|
const inputRef = useMergedRef(ref);
|
28108
|
-
const currentIndex = value
|
28101
|
+
const currentIndex = value === void 0 ? void 0 : getIndexFromValue(data, value);
|
28109
28102
|
const { getNextIndex: getNextIndex2 } = useTypeahead({ data, currentIndex });
|
28110
28103
|
const setInputValueByIndex = (index2) => {
|
28111
28104
|
if (index2 !== void 0) {
|
@@ -28120,13 +28113,13 @@ const useListbox = ({
|
|
28120
28113
|
};
|
28121
28114
|
React.useEffect(() => {
|
28122
28115
|
if (data.length && currentIndex === void 0) {
|
28123
|
-
if (defaultValue2
|
28116
|
+
if (defaultValue2 === void 0) {
|
28117
|
+
setInputValueByIndex(0);
|
28118
|
+
} else {
|
28124
28119
|
const defaultValueIndex = getIndexFromValue(data, defaultValue2);
|
28125
28120
|
if (defaultValueIndex !== void 0) {
|
28126
28121
|
setInputValueByIndex(defaultValueIndex);
|
28127
28122
|
}
|
28128
|
-
} else {
|
28129
|
-
setInputValueByIndex(0);
|
28130
28123
|
}
|
28131
28124
|
}
|
28132
28125
|
}, [data]);
|
@@ -28239,19 +28232,17 @@ const useMultiListbox = ({
|
|
28239
28232
|
let newInputValue = "";
|
28240
28233
|
const currentInputValue = (_a = inputRef.current) == null ? void 0 : _a.value;
|
28241
28234
|
const currentValuesArray = (currentInputValue == null ? void 0 : currentInputValue.split(",")) || [];
|
28242
|
-
const optionAlreadySelected = currentValuesArray.
|
28235
|
+
const optionAlreadySelected = currentValuesArray.some((val) => val === String(option.value));
|
28243
28236
|
if (option.value === "#ALL-OPTIONS#") {
|
28244
|
-
if (
|
28245
|
-
newInputValue = data.filter((option2, index22) => index22 !== 0 && !option2.disabled).map((option2) => option2.value).join(",");
|
28246
|
-
} else {
|
28237
|
+
if (allOptionsSelected) {
|
28247
28238
|
newInputValue = "";
|
28248
|
-
}
|
28249
|
-
} else {
|
28250
|
-
if (optionAlreadySelected) {
|
28251
|
-
newInputValue = currentValuesArray.filter((val) => val !== String(option.value)).join(",");
|
28252
28239
|
} else {
|
28253
|
-
newInputValue =
|
28240
|
+
newInputValue = data.filter((option2, index22) => index22 !== 0 && !option2.disabled).map((option2) => option2.value).join(",");
|
28254
28241
|
}
|
28242
|
+
} else if (optionAlreadySelected) {
|
28243
|
+
newInputValue = currentValuesArray.filter((val) => val !== String(option.value)).join(",");
|
28244
|
+
} else {
|
28245
|
+
newInputValue = currentInputValue ? `${currentInputValue},${option.value}` : option.value;
|
28255
28246
|
}
|
28256
28247
|
setInputValueByRef(inputRef.current, newInputValue);
|
28257
28248
|
}
|
@@ -28287,7 +28278,7 @@ const useMultiListbox = ({
|
|
28287
28278
|
break;
|
28288
28279
|
}
|
28289
28280
|
}
|
28290
|
-
setCurrentIndex(index2
|
28281
|
+
setCurrentIndex(index2 === void 0 ? 0 : index2);
|
28291
28282
|
if (onKeyDown) {
|
28292
28283
|
event.persist();
|
28293
28284
|
onKeyDown(event);
|
@@ -29695,7 +29686,7 @@ const $d08ef79370b62062$export$6d4de93b380beddf = $d08ef79370b62062$export$f34ec
|
|
29695
29686
|
const Content$2 = React.forwardRef(function MenuContent(props, ref) {
|
29696
29687
|
const internalRef = useMergedRef(ref);
|
29697
29688
|
const menu = useCurrentMenu();
|
29698
|
-
const { align = "start", children, placement: side, ...otherProps } = props;
|
29689
|
+
const { align = "start", children: _1, placement: side, ...otherProps } = props;
|
29699
29690
|
const className = clsx("border border-transparent rounded block outline-none p-1 yt-shadow wcag-white", props.className);
|
29700
29691
|
const childrenRefs = React.useRef([]);
|
29701
29692
|
const childrenWithRefs = React.Children.toArray(props.children).filter((child) => !!child).map((child, index2) => {
|
@@ -29869,13 +29860,11 @@ const Trigger$1 = React.forwardRef(function MenuTrigger(props, ref) {
|
|
29869
29860
|
const internalRef = useMergedRef(ref);
|
29870
29861
|
const handleKeyDown = (event) => {
|
29871
29862
|
var _a;
|
29872
|
-
if (event.key === "ArrowDown") {
|
29873
|
-
|
29874
|
-
|
29875
|
-
(
|
29876
|
-
|
29877
|
-
);
|
29878
|
-
}
|
29863
|
+
if (event.key === "ArrowDown" && isElementInsideTable3OrReport(event.currentTarget)) {
|
29864
|
+
event.preventDefault();
|
29865
|
+
(_a = event.currentTarget.parentNode) == null ? void 0 : _a.dispatchEvent(
|
29866
|
+
createCustomKeyboardEvent(event)
|
29867
|
+
);
|
29879
29868
|
}
|
29880
29869
|
};
|
29881
29870
|
React.useEffect(() => {
|
@@ -30267,7 +30256,7 @@ const OverflowGroup = React__default.forwardRef(function OverflowGroup2(props, r
|
|
30267
30256
|
const { texts } = useLocalization();
|
30268
30257
|
const intersectedChildIndex = useIntersectionObserver(internalRef, buttonWidth);
|
30269
30258
|
const children = React__default.Children.toArray(props.children);
|
30270
|
-
const hiddenChildren = intersectedChildIndex
|
30259
|
+
const hiddenChildren = intersectedChildIndex === void 0 ? [] : children.slice(intersectedChildIndex);
|
30271
30260
|
const hiddenChildrenCount = hiddenChildren.length;
|
30272
30261
|
const moreButtonText = hiddenChildrenCount ? `${hiddenChildrenCount} ${texts.header.more}` : "";
|
30273
30262
|
const MoreButton = (moreButton == null ? void 0 : moreButton(moreButtonText)) ?? /* @__PURE__ */ React__default.createElement(IconButton, { icon: "more" });
|
@@ -30333,7 +30322,7 @@ const useSelect = ({
|
|
30333
30322
|
id: nativeId,
|
30334
30323
|
multiselect,
|
30335
30324
|
onBlur,
|
30336
|
-
onClick,
|
30325
|
+
onClick: _1,
|
30337
30326
|
onChange,
|
30338
30327
|
readOnly,
|
30339
30328
|
tabIndex,
|
@@ -30356,20 +30345,16 @@ const useSelect = ({
|
|
30356
30345
|
if (value === void 0) {
|
30357
30346
|
if (defaultValue2 !== void 0 && findByValue(flattenedData, defaultValue2)) {
|
30358
30347
|
setInputValueByRef(inputRef.current, defaultValue2);
|
30359
|
-
} else {
|
30360
|
-
|
30361
|
-
|
30362
|
-
|
30363
|
-
setInputValueByRef(inputRef.current, data[0].value);
|
30364
|
-
}
|
30348
|
+
} else if (emptyValue !== void 0) {
|
30349
|
+
setInputValueByRef(inputRef.current, emptyValue);
|
30350
|
+
} else if (data.length > 0) {
|
30351
|
+
setInputValueByRef(inputRef.current, data[0].value);
|
30365
30352
|
}
|
30366
|
-
} else {
|
30367
|
-
if (
|
30368
|
-
|
30369
|
-
|
30370
|
-
|
30371
|
-
setInputValueByRef(inputRef.current, data[0].value);
|
30372
|
-
}
|
30353
|
+
} else if (!multiselect && !findByValue(flattenedData, value)) {
|
30354
|
+
if (emptyValue !== void 0) {
|
30355
|
+
setInputValueByRef(inputRef.current, emptyValue);
|
30356
|
+
} else if (data.length > 0) {
|
30357
|
+
setInputValueByRef(inputRef.current, data[0].value);
|
30373
30358
|
}
|
30374
30359
|
}
|
30375
30360
|
}, []);
|
@@ -30515,7 +30500,7 @@ const useSelect = ({
|
|
30515
30500
|
};
|
30516
30501
|
};
|
30517
30502
|
const BaseSelect = React.forwardRef(function BaseSelect2(props, ref) {
|
30518
|
-
const { autoFocus, className: externalClassName, highlighted, style, ...otherProps } = props;
|
30503
|
+
const { autoFocus, className: externalClassName, highlighted: _1, style, ...otherProps } = props;
|
30519
30504
|
const { button, listbox, popover, input, text: text2, more = 0 } = useSelect(otherProps, ref);
|
30520
30505
|
const internalRef = React.useRef(null);
|
30521
30506
|
const selectDimensions = useBoundingClientRectListener(internalRef);
|
@@ -30900,7 +30885,7 @@ const RadioGroupItem = React.forwardRef(function RadioGroupItem2(props, ref) {
|
|
30900
30885
|
);
|
30901
30886
|
});
|
30902
30887
|
const RadioGroup2 = React.forwardRef(function RadioGroup22(props, ref) {
|
30903
|
-
const { disabled, invalid, required, readOnly, orientation = "vertical", ...otherProps } = props;
|
30888
|
+
const { disabled: _1, invalid: _2, required: _3, readOnly: _4, orientation = "vertical", ...otherProps } = props;
|
30904
30889
|
const values = React.useMemo(() => {
|
30905
30890
|
const radioGroupItemValues = [];
|
30906
30891
|
React.Children.forEach(props.children, (child) => {
|
@@ -30915,9 +30900,9 @@ const RadioGroup2 = React.forwardRef(function RadioGroup22(props, ref) {
|
|
30915
30900
|
let defaultValue2;
|
30916
30901
|
if (props.onChange) {
|
30917
30902
|
handleChange = (value2) => props.onChange(getRadioItemByValue(values, value2));
|
30918
|
-
value = props.value
|
30903
|
+
value = props.value === void 0 ? void 0 : String(props.value ?? "");
|
30919
30904
|
} else {
|
30920
|
-
defaultValue2 = props.defaultValue
|
30905
|
+
defaultValue2 = props.defaultValue === void 0 ? void 0 : String(props.defaultValue ?? "");
|
30921
30906
|
}
|
30922
30907
|
const className = clsx(
|
30923
30908
|
"flex items-start",
|
@@ -34742,11 +34727,11 @@ class DataType {
|
|
34742
34727
|
const localeNumberSeparators = /* @__PURE__ */ new Map();
|
34743
34728
|
class NumericDataType extends DataType {
|
34744
34729
|
static format(value, locale2, options) {
|
34745
|
-
if (value === void 0 || typeof value !== "number" || isNaN(value)) {
|
34730
|
+
if (value === void 0 || typeof value !== "number" || Number.isNaN(value)) {
|
34746
34731
|
return "";
|
34747
34732
|
}
|
34748
34733
|
const localisedValue = new Intl.NumberFormat(locale2, options).format(value);
|
34749
|
-
return localisedValue.
|
34734
|
+
return localisedValue.replaceAll(/[\u00A0\u202F]/g, " ");
|
34750
34735
|
}
|
34751
34736
|
static parse(value, locale2) {
|
34752
34737
|
if (value === void 0 || value === null || typeof value !== "string") {
|
@@ -34755,7 +34740,7 @@ class NumericDataType extends DataType {
|
|
34755
34740
|
if (value === "Infinity" || value === "-Infinity") {
|
34756
34741
|
return Number(value);
|
34757
34742
|
}
|
34758
|
-
let sanitizedValue = value.replaceAll(" ", "").
|
34743
|
+
let sanitizedValue = value.replaceAll(" ", "").replaceAll(/[^0-9.,-]+/g, "");
|
34759
34744
|
if (!sanitizedValue.length) {
|
34760
34745
|
return void 0;
|
34761
34746
|
}
|
@@ -34766,7 +34751,7 @@ class NumericDataType extends DataType {
|
|
34766
34751
|
sanitizedValue = sanitizedValue.replaceAll(",", "");
|
34767
34752
|
}
|
34768
34753
|
const output = Number(sanitizedValue);
|
34769
|
-
if (isNaN(output)) {
|
34754
|
+
if (Number.isNaN(output)) {
|
34770
34755
|
return void 0;
|
34771
34756
|
}
|
34772
34757
|
return output;
|
@@ -34792,10 +34777,10 @@ class DateTimeDataType extends DataType {
|
|
34792
34777
|
} else {
|
34793
34778
|
return "";
|
34794
34779
|
}
|
34795
|
-
if (isNaN(date2.getTime())) {
|
34780
|
+
if (Number.isNaN(date2.getTime())) {
|
34796
34781
|
return "";
|
34797
34782
|
}
|
34798
|
-
return new Intl.DateTimeFormat(locale2, options).format(date2).
|
34783
|
+
return new Intl.DateTimeFormat(locale2, options).format(date2).replaceAll(/[\u00A0\u202F]/g, " ");
|
34799
34784
|
}
|
34800
34785
|
static parse(value, locale2) {
|
34801
34786
|
if (value === void 0 || value === null || typeof value !== "string") {
|
@@ -34848,8 +34833,9 @@ class DateTimeDataType extends DataType {
|
|
34848
34833
|
return mask2 + "MM";
|
34849
34834
|
case "year":
|
34850
34835
|
return mask2 + "yyyy";
|
34836
|
+
default:
|
34837
|
+
return mask2;
|
34851
34838
|
}
|
34852
|
-
return mask2;
|
34853
34839
|
}, "");
|
34854
34840
|
localeDateMasks.set(locale2, mask);
|
34855
34841
|
return mask;
|
@@ -35023,7 +35009,8 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35023
35009
|
case TableFilterComparator.IsEqualTo: {
|
35024
35010
|
if (dataType === "boolean") {
|
35025
35011
|
return cellValue === query;
|
35026
|
-
}
|
35012
|
+
}
|
35013
|
+
if (isDateColumn) {
|
35027
35014
|
return isWeakEqual$1(query, valueAsDate);
|
35028
35015
|
}
|
35029
35016
|
return evaluate(isWeakEqual);
|
@@ -35031,7 +35018,8 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35031
35018
|
case TableFilterComparator.IsNotEqualTo: {
|
35032
35019
|
if (dataType === "boolean") {
|
35033
35020
|
return cellValue !== query;
|
35034
|
-
}
|
35021
|
+
}
|
35022
|
+
if (isDateColumn) {
|
35035
35023
|
return !isWeakEqual$1(query, valueAsDate);
|
35036
35024
|
}
|
35037
35025
|
return !evaluate(isWeakEqual);
|
@@ -35039,7 +35027,8 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35039
35027
|
case TableFilterComparator.IsGreaterThan: {
|
35040
35028
|
if (isDateColumn) {
|
35041
35029
|
return query.getTime() < valueAsDate.getTime();
|
35042
|
-
}
|
35030
|
+
}
|
35031
|
+
if (isNumberColumn) {
|
35043
35032
|
return compareNumbers2((q, v2) => q < v2);
|
35044
35033
|
}
|
35045
35034
|
return false;
|
@@ -35047,7 +35036,8 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35047
35036
|
case TableFilterComparator.IsLessThan: {
|
35048
35037
|
if (isDateColumn) {
|
35049
35038
|
return query.getTime() > valueAsDate.getTime();
|
35050
|
-
}
|
35039
|
+
}
|
35040
|
+
if (isNumberColumn) {
|
35051
35041
|
return compareNumbers2((q, v2) => q > v2);
|
35052
35042
|
}
|
35053
35043
|
return false;
|
@@ -35055,7 +35045,8 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35055
35045
|
case TableFilterComparator.IsLessThanOrEqualTo: {
|
35056
35046
|
if (isDateColumn) {
|
35057
35047
|
return query.getTime() > valueAsDate.getTime() || isWeakEqual$1(valueAsDate, query);
|
35058
|
-
}
|
35048
|
+
}
|
35049
|
+
if (isNumberColumn) {
|
35059
35050
|
return compareNumbers2((q, v2) => q >= v2);
|
35060
35051
|
}
|
35061
35052
|
return false;
|
@@ -35063,7 +35054,8 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35063
35054
|
case TableFilterComparator.IsGreaterThanOrEqualTo: {
|
35064
35055
|
if (isDateColumn) {
|
35065
35056
|
return query.getTime() < valueAsDate.getTime() || isWeakEqual$1(valueAsDate, query);
|
35066
|
-
}
|
35057
|
+
}
|
35058
|
+
if (isNumberColumn) {
|
35067
35059
|
return compareNumbers2((q, v2) => q <= v2);
|
35068
35060
|
}
|
35069
35061
|
return false;
|
@@ -35073,14 +35065,17 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35073
35065
|
if (isDateColumn) {
|
35074
35066
|
if (fromValue !== void 0 && valueAsDate.getTime() < fromValue.getTime()) {
|
35075
35067
|
return false;
|
35076
|
-
}
|
35068
|
+
}
|
35069
|
+
if (toValue2 !== void 0 && valueAsDate.getTime() > toValue2.getTime()) {
|
35077
35070
|
return false;
|
35078
35071
|
}
|
35079
35072
|
return true;
|
35080
|
-
}
|
35073
|
+
}
|
35074
|
+
if (isNumberColumn) {
|
35081
35075
|
if (fromValue !== void 0 && cellValue < fromValue) {
|
35082
35076
|
return false;
|
35083
|
-
}
|
35077
|
+
}
|
35078
|
+
if (toValue2 !== void 0 && cellValue > toValue2) {
|
35084
35079
|
return false;
|
35085
35080
|
}
|
35086
35081
|
return true;
|
@@ -35105,8 +35100,9 @@ function columnFilterFn(row, cellValue, meta, filter2, localization) {
|
|
35105
35100
|
}
|
35106
35101
|
return query.every((v2) => !isWeakEqual(String(cellValue), v2));
|
35107
35102
|
}
|
35103
|
+
default:
|
35104
|
+
return false;
|
35108
35105
|
}
|
35109
|
-
return false;
|
35110
35106
|
} catch (e3) {
|
35111
35107
|
console.error(e3);
|
35112
35108
|
return true;
|
@@ -35118,29 +35114,29 @@ const flattenCellValue = (cellValue) => {
|
|
35118
35114
|
function isMatched(query, cellValue, rowValue, dataType, dataTypeOptions, localization, matcher = isWeakContains) {
|
35119
35115
|
if (typeof cellValue === "object") {
|
35120
35116
|
return flattenCellValue(cellValue).flat(Infinity).find((y2) => matcher(y2, query));
|
35117
|
+
}
|
35118
|
+
const dataTypeProperties = getDataTypeProperties(dataType);
|
35119
|
+
if (dataTypeProperties.getDisplayValue) {
|
35120
|
+
const cellDisplayValue = dataTypeProperties.getDisplayValue(cellValue, rowValue, {
|
35121
|
+
dataTypeOptions,
|
35122
|
+
localization
|
35123
|
+
});
|
35124
|
+
if (Array.isArray(cellDisplayValue)) {
|
35125
|
+
return cellDisplayValue.some((cdv) => matcher(cdv, query));
|
35126
|
+
}
|
35127
|
+
if (cellDisplayValue !== void 0 && isWeakContains(cellDisplayValue, query)) {
|
35128
|
+
return true;
|
35129
|
+
}
|
35121
35130
|
} else {
|
35122
|
-
const
|
35123
|
-
if (
|
35124
|
-
|
35125
|
-
dataTypeOptions,
|
35126
|
-
localization
|
35127
|
-
});
|
35128
|
-
if (Array.isArray(cellDisplayValue)) {
|
35129
|
-
return cellDisplayValue.some((cdv) => matcher(cdv, query));
|
35130
|
-
} else if (cellDisplayValue !== void 0 && isWeakContains(cellDisplayValue, query)) {
|
35131
|
-
return true;
|
35132
|
-
}
|
35133
|
-
} else {
|
35134
|
-
const cellValueAsString = String(cellValue ?? "");
|
35135
|
-
if (cellValueAsString !== void 0 && matcher(cellValueAsString, query)) {
|
35136
|
-
return true;
|
35137
|
-
}
|
35131
|
+
const cellValueAsString = String(cellValue ?? "");
|
35132
|
+
if (cellValueAsString !== void 0 && matcher(cellValueAsString, query)) {
|
35133
|
+
return true;
|
35138
35134
|
}
|
35139
|
-
|
35140
|
-
|
35141
|
-
|
35142
|
-
|
35143
|
-
|
35135
|
+
}
|
35136
|
+
if (typeof query !== typeof cellValue && dataTypeProperties.parse) {
|
35137
|
+
const parsedQuery = dataTypeProperties.parse(query, localization.locale);
|
35138
|
+
if (parsedQuery !== void 0 && matcher(cellValue, parsedQuery)) {
|
35139
|
+
return true;
|
35144
35140
|
}
|
35145
35141
|
}
|
35146
35142
|
return false;
|
@@ -35191,7 +35187,7 @@ function resetHighlightedColumnIndexes(searchQuery, table, localization) {
|
|
35191
35187
|
indexes.push([rowIndex, columnIndex]);
|
35192
35188
|
}
|
35193
35189
|
}
|
35194
|
-
} catch
|
35190
|
+
} catch {
|
35195
35191
|
}
|
35196
35192
|
});
|
35197
35193
|
});
|
@@ -35238,12 +35234,10 @@ function orderColumn(column, { orderingDisabled, orderingEnabled }) {
|
|
35238
35234
|
groupedColumn.columns.forEach(
|
35239
35235
|
(subcolumn) => orderColumn(subcolumn, { orderingDisabled, orderingEnabled })
|
35240
35236
|
);
|
35237
|
+
} else if ((_a = column.meta) == null ? void 0 : _a.enableOrdering) {
|
35238
|
+
orderingEnabled.push(column.id);
|
35241
35239
|
} else {
|
35242
|
-
|
35243
|
-
orderingEnabled.push(column.id);
|
35244
|
-
} else {
|
35245
|
-
orderingDisabled.push(column.id);
|
35246
|
-
}
|
35240
|
+
orderingDisabled.push(column.id);
|
35247
35241
|
}
|
35248
35242
|
}
|
35249
35243
|
function ensureOrdering(columns, settingsOrder, pinnedOrder = [], internalColumnsPinnedToTheRight = ["__actions"]) {
|
@@ -35254,6 +35248,7 @@ function ensureOrdering(columns, settingsOrder, pinnedOrder = [], internalColumn
|
|
35254
35248
|
if (Array.isArray(settingsOrder)) {
|
35255
35249
|
orderedColumns = columns.slice().sort(
|
35256
35250
|
// the magic >>> 0 here ensures that columns that aren't found in settings, but are children, are pushed to the end
|
35251
|
+
// oxlint-disable-next-line no-bitwise, prefer-math-trunc
|
35257
35252
|
(a2, b2) => (settingsOrder.indexOf(a2.id) >>> 0) - (settingsOrder.indexOf(b2.id) >>> 0)
|
35258
35253
|
);
|
35259
35254
|
}
|
@@ -35278,12 +35273,13 @@ function ensureOrdering(columns, settingsOrder, pinnedOrder = [], internalColumn
|
|
35278
35273
|
if (Array.isArray(pinnedOrder)) {
|
35279
35274
|
orderingEnabled.sort(
|
35280
35275
|
// the magic >>> 0 here ensures that columns that aren't found in settings, but are children, are pushed to the end
|
35276
|
+
// oxlint-disable-next-line no-bitwise, prefer-math-trunc
|
35281
35277
|
(a2, b2) => (pinnedOrder.indexOf(a2) >>> 0) - (pinnedOrder.indexOf(b2) >>> 0)
|
35282
35278
|
);
|
35283
35279
|
}
|
35284
35280
|
const order2 = [...internalColumns, ...orderingDisabled, ...orderingEnabled];
|
35285
35281
|
internalColumnsPinnedToTheRight.forEach((id2) => {
|
35286
|
-
if (columns.
|
35282
|
+
if (columns.some((column) => column.id === id2)) {
|
35287
35283
|
order2.push(id2);
|
35288
35284
|
}
|
35289
35285
|
});
|
@@ -35451,7 +35447,7 @@ function processChildren(child, columns, defaultSizing, defaultSorting, defaultV
|
|
35451
35447
|
column.cell = (info) => formattedValueRenderer(info.getValue(), info.row.original);
|
35452
35448
|
}
|
35453
35449
|
if (typeof footer === "function") {
|
35454
|
-
column.footer = (info) => footer(info.table.getRowModel().rows.flatMap((row) => row.original
|
35450
|
+
column.footer = (info) => footer(info.table.getRowModel().rows.flatMap((row) => row.original === void 0 ? [] : row.original));
|
35455
35451
|
}
|
35456
35452
|
if (enableColumnFilter) {
|
35457
35453
|
column.filterFn = "tacoFilter";
|
@@ -35632,12 +35628,10 @@ function useReactTableInitialState(props, columns, persistedSettings, defaults2)
|
|
35632
35628
|
columnOrder.indexOf(columnPinning.left[columnPinning.left.length - 1]),
|
35633
35629
|
columnOrder
|
35634
35630
|
);
|
35631
|
+
} else if (props.defaultColumnFreezingIndex === void 0) {
|
35632
|
+
columnPinning.left = unfreezeAllExternalColumns(columnOrder);
|
35635
35633
|
} else {
|
35636
|
-
|
35637
|
-
columnPinning.left = freezeUptoExternalColumn(props.defaultColumnFreezingIndex, columnOrder);
|
35638
|
-
} else {
|
35639
|
-
columnPinning.left = unfreezeAllExternalColumns(columnOrder);
|
35640
|
-
}
|
35634
|
+
columnPinning.left = freezeUptoExternalColumn(props.defaultColumnFreezingIndex, columnOrder);
|
35641
35635
|
}
|
35642
35636
|
const columnSizing = {
|
35643
35637
|
...defaults2.defaultSizing,
|
@@ -35850,9 +35844,8 @@ const useLocalStorage = (key, initialValue) => {
|
|
35850
35844
|
if (typeof localStorageValue !== "string") {
|
35851
35845
|
localStorage.setItem(key, JSON.stringify(initialValue));
|
35852
35846
|
return initialValue;
|
35853
|
-
} else {
|
35854
|
-
return JSON.parse(localStorageValue || "null");
|
35855
35847
|
}
|
35848
|
+
return JSON.parse(localStorageValue || "null");
|
35856
35849
|
} catch {
|
35857
35850
|
return initialValue;
|
35858
35851
|
}
|
@@ -35930,7 +35923,7 @@ function useTableRowActive$1(isEnabled = false, initialRowActiveIndex) {
|
|
35930
35923
|
const [rowHoverIndex, setRowHoverIndex] = React__default.useState(void 0);
|
35931
35924
|
const [isHoverStatePaused, setHoverStatePaused] = useIsHoverStatePaused();
|
35932
35925
|
const move = (direction, length, scrollToIndex) => {
|
35933
|
-
const nextIndex = rowActiveIndex
|
35926
|
+
const nextIndex = rowActiveIndex === void 0 ? 0 : getNextIndex(direction, rowActiveIndex, length);
|
35934
35927
|
scrollToIndex(nextIndex);
|
35935
35928
|
setTimeout(() => setRowActiveIndex(nextIndex), 50);
|
35936
35929
|
};
|
@@ -35952,7 +35945,8 @@ function useTableRowActive$1(isEnabled = false, initialRowActiveIndex) {
|
|
35952
35945
|
move(-1, length, scrollToIndex);
|
35953
35946
|
}
|
35954
35947
|
return;
|
35955
|
-
}
|
35948
|
+
}
|
35949
|
+
if (event.key === "ArrowDown") {
|
35956
35950
|
event.preventDefault();
|
35957
35951
|
if (event.ctrlKey || event.metaKey) {
|
35958
35952
|
const newIndex = length - 1;
|
@@ -36085,7 +36079,8 @@ function useTableRowSelection(isEnabled = false) {
|
|
36085
36079
|
(_b = rows[rowActiveIndex]) == null ? void 0 : _b.toggleSelected();
|
36086
36080
|
}
|
36087
36081
|
return;
|
36088
|
-
}
|
36082
|
+
}
|
36083
|
+
if ((event.ctrlKey || event.metaKey) && event.key === "a" && !["INPUT", "TEXTAREA"].includes((_c = event.target) == null ? void 0 : _c.tagName)) {
|
36089
36084
|
event.preventDefault();
|
36090
36085
|
table.toggleAllRowsSelected();
|
36091
36086
|
return;
|
@@ -36147,9 +36142,8 @@ function useTableDataLoader(fetchPage, fetchAll, options = { pageSize: DEFAULT_P
|
|
36147
36142
|
}
|
36148
36143
|
if (_pendingPageRequests.current[pageIndex]) {
|
36149
36144
|
return;
|
36150
|
-
} else {
|
36151
|
-
_pendingPageRequests.current[pageIndex] = true;
|
36152
36145
|
}
|
36146
|
+
_pendingPageRequests.current[pageIndex] = true;
|
36153
36147
|
_lastUsedPageIndex.current = pageIndex;
|
36154
36148
|
_lastUsedSorting.current = sorting;
|
36155
36149
|
_lastUsedFilters.current = filters;
|
@@ -36160,7 +36154,7 @@ function useTableDataLoader(fetchPage, fetchAll, options = { pageSize: DEFAULT_P
|
|
36160
36154
|
let nextData;
|
36161
36155
|
if (reset || length.current !== response.length) {
|
36162
36156
|
length.current = response.length;
|
36163
|
-
nextData = Array(length.current).fill(void 0);
|
36157
|
+
nextData = Array.from({ length: length.current }).fill(void 0);
|
36164
36158
|
} else {
|
36165
36159
|
nextData = [...currentData];
|
36166
36160
|
}
|
@@ -36182,11 +36176,11 @@ function useTableDataLoader(fetchPage, fetchAll, options = { pageSize: DEFAULT_P
|
|
36182
36176
|
length.current = response.length;
|
36183
36177
|
setData(() => {
|
36184
36178
|
let nextData;
|
36185
|
-
if (response.data.length
|
36186
|
-
nextData = Array(response.length).fill(void 0);
|
36187
|
-
nextData.splice(0, response.data.length, ...response.data);
|
36188
|
-
} else {
|
36179
|
+
if (response.data.length === response.length) {
|
36189
36180
|
nextData = [...response.data];
|
36181
|
+
} else {
|
36182
|
+
nextData = Array.from({ length: response.length }).fill(void 0);
|
36183
|
+
nextData.splice(0, response.data.length, ...response.data);
|
36190
36184
|
}
|
36191
36185
|
return nextData;
|
36192
36186
|
});
|
@@ -36194,7 +36188,6 @@ function useTableDataLoader(fetchPage, fetchAll, options = { pageSize: DEFAULT_P
|
|
36194
36188
|
}
|
36195
36189
|
};
|
36196
36190
|
const reloadCurrentPages = async (pageIndex, sorting, filters, hiddenColumns) => {
|
36197
|
-
_lastUsedPageIndex.current;
|
36198
36191
|
const pageIndexes = pageIndex === 0 ? [0, 1] : [pageIndex - 1, pageIndex];
|
36199
36192
|
if (length.current !== void 0) {
|
36200
36193
|
const pageCount = Math.ceil(length.current / pageSize);
|
@@ -36212,7 +36205,7 @@ function useTableDataLoader(fetchPage, fetchAll, options = { pageSize: DEFAULT_P
|
|
36212
36205
|
pageIndexes.map((pageIndex2) => fetchPage(pageIndex2, pageSize, sorting, filters, hiddenColumns))
|
36213
36206
|
);
|
36214
36207
|
length.current = responses[0].length;
|
36215
|
-
const nextData = Array(length.current).fill(void 0);
|
36208
|
+
const nextData = Array.from({ length: length.current }).fill(void 0);
|
36216
36209
|
responses.forEach((response, index2) => {
|
36217
36210
|
const startIndex = pageIndexes[index2] * pageSize;
|
36218
36211
|
nextData.splice(startIndex, pageSize, ...response.data);
|
@@ -36225,36 +36218,33 @@ function useTableDataLoader(fetchPage, fetchAll, options = { pageSize: DEFAULT_P
|
|
36225
36218
|
};
|
36226
36219
|
const invalidate = async () => {
|
36227
36220
|
if (_lastUsedSearch.current) {
|
36228
|
-
return loadAll(_lastUsedSorting.current, _lastUsedFilters.current, _lastUsedHiddenColumns.current);
|
36229
|
-
} else {
|
36230
|
-
return reloadCurrentPages(
|
36231
|
-
_lastUsedPageIndex.current ?? 0,
|
36232
|
-
_lastUsedSorting.current,
|
36233
|
-
_lastUsedFilters.current,
|
36234
|
-
_lastUsedHiddenColumns.current
|
36235
|
-
);
|
36221
|
+
return await loadAll(_lastUsedSorting.current, _lastUsedFilters.current, _lastUsedHiddenColumns.current);
|
36236
36222
|
}
|
36223
|
+
return await reloadCurrentPages(
|
36224
|
+
_lastUsedPageIndex.current ?? 0,
|
36225
|
+
_lastUsedSorting.current,
|
36226
|
+
_lastUsedFilters.current,
|
36227
|
+
_lastUsedHiddenColumns.current
|
36228
|
+
);
|
36237
36229
|
};
|
36238
36230
|
const handleSort = async (sorting) => {
|
36239
36231
|
if (_lastUsedSearch.current) {
|
36240
|
-
return loadAll(sorting, _lastUsedFilters.current, _lastUsedHiddenColumns.current);
|
36241
|
-
} else {
|
36242
|
-
return reloadCurrentPages(
|
36243
|
-
_lastUsedPageIndex.current ?? 0,
|
36244
|
-
sorting,
|
36245
|
-
_lastUsedFilters.current,
|
36246
|
-
_lastUsedHiddenColumns.current
|
36247
|
-
);
|
36232
|
+
return await loadAll(sorting, _lastUsedFilters.current, _lastUsedHiddenColumns.current);
|
36248
36233
|
}
|
36234
|
+
return await reloadCurrentPages(
|
36235
|
+
_lastUsedPageIndex.current ?? 0,
|
36236
|
+
sorting,
|
36237
|
+
_lastUsedFilters.current,
|
36238
|
+
_lastUsedHiddenColumns.current
|
36239
|
+
);
|
36249
36240
|
};
|
36250
36241
|
const handleFilter = async (filters) => {
|
36251
36242
|
if (_lastUsedSearch.current) {
|
36252
|
-
return loadAll(_lastUsedSorting.current, filters, _lastUsedHiddenColumns.current);
|
36253
|
-
} else {
|
36254
|
-
return loadPage(_lastUsedPageIndex.current ?? 0, _lastUsedSorting.current, filters, _lastUsedHiddenColumns.current);
|
36243
|
+
return await loadAll(_lastUsedSorting.current, filters, _lastUsedHiddenColumns.current);
|
36255
36244
|
}
|
36245
|
+
return await loadPage(_lastUsedPageIndex.current ?? 0, _lastUsedSorting.current, filters, _lastUsedHiddenColumns.current);
|
36256
36246
|
};
|
36257
|
-
const handleSearch =
|
36247
|
+
const handleSearch = (search) => {
|
36258
36248
|
_lastUsedSearch.current = search || void 0;
|
36259
36249
|
};
|
36260
36250
|
return [
|
@@ -36347,7 +36337,8 @@ function useEnabledSettings(isEnabled) {
|
|
36347
36337
|
),
|
36348
36338
|
false
|
36349
36339
|
];
|
36350
|
-
}
|
36340
|
+
}
|
36341
|
+
if (isEnabled === true) {
|
36351
36342
|
return [DEFAULT_ENABLED_OPTIONS, true];
|
36352
36343
|
}
|
36353
36344
|
const options = { ...DEFAULT_ENABLED_OPTIONS, ...isEnabled };
|
@@ -36393,9 +36384,8 @@ function useLazyEffect(effect, deps) {
|
|
36393
36384
|
React__default.useEffect(() => {
|
36394
36385
|
if (readyRef.current) {
|
36395
36386
|
return effect();
|
36396
|
-
} else {
|
36397
|
-
readyRef.current = true;
|
36398
36387
|
}
|
36388
|
+
readyRef.current = true;
|
36399
36389
|
}, deps);
|
36400
36390
|
React__default.useEffect(
|
36401
36391
|
() => () => {
|
@@ -36648,7 +36638,7 @@ function useTableRowActiveListener$1(table, onRowActive) {
|
|
36648
36638
|
var _a;
|
36649
36639
|
const meta = table.options.meta;
|
36650
36640
|
const rows = table.getRowModel().flatRows;
|
36651
|
-
const currentRow = meta.rowActive.rowActiveIndex
|
36641
|
+
const currentRow = meta.rowActive.rowActiveIndex === void 0 ? void 0 : (_a = rows[meta.rowActive.rowActiveIndex]) == null ? void 0 : _a.original;
|
36652
36642
|
React__default.useEffect(() => {
|
36653
36643
|
if (meta.rowActive.isEnabled && onRowActive) {
|
36654
36644
|
onRowActive(currentRow);
|
@@ -37816,7 +37806,7 @@ function RowWithServerLoading(props) {
|
|
37816
37806
|
}
|
37817
37807
|
const Skeleton = React__default.forwardRef(function Skeleton2(props, ref) {
|
37818
37808
|
const { cellsCount, index: index2 } = props;
|
37819
|
-
return /* @__PURE__ */ React__default.createElement("tr", { "data-row-index": index2, "data-row-id": index2, ref }, Array(cellsCount).
|
37809
|
+
return /* @__PURE__ */ React__default.createElement("tr", { "data-row-index": index2, "data-row-id": index2, ref }, Array.from({ length: cellsCount }).map((_, index22) => /* @__PURE__ */ React__default.createElement("td", { key: index22 }, /* @__PURE__ */ React__default.createElement("span", { className: "bg-grey-100 text-grey-700 h-4 w-full text-center text-xs" }))));
|
37820
37810
|
});
|
37821
37811
|
function getScrollPaddingEndOffset(table) {
|
37822
37812
|
const tableMeta = table.options.meta;
|
@@ -37899,8 +37889,8 @@ function useTableRenderer(renderers, table, tableRef, length, defaultRowActiveIn
|
|
37899
37889
|
if (count2 || table.getBottomRows().length) {
|
37900
37890
|
style = {
|
37901
37891
|
height: totalSize,
|
37902
|
-
paddingBottom: isNaN(paddingBottom) ? 0 : paddingBottom,
|
37903
|
-
paddingTop: isNaN(paddingTop) ? 0 : paddingTop
|
37892
|
+
paddingBottom: Number.isNaN(paddingBottom) ? 0 : paddingBottom,
|
37893
|
+
paddingTop: Number.isNaN(paddingTop) ? 0 : paddingTop
|
37904
37894
|
};
|
37905
37895
|
}
|
37906
37896
|
if (count2) {
|
@@ -37993,19 +37983,19 @@ function useTableRowActiveListener(table, tableRef) {
|
|
37993
37983
|
}, [tableMeta.rowActive.rowActiveIndex]);
|
37994
37984
|
}
|
37995
37985
|
function Actions(props) {
|
37996
|
-
var _a;
|
37986
|
+
var _a, _b;
|
37997
37987
|
const { actions, actionsLength, data, isActiveRow, rowId, table } = props;
|
37998
37988
|
const { texts } = useLocalization();
|
37999
37989
|
const tableMeta = table.options.meta;
|
38000
37990
|
const visibleActions = actions.map((action) => {
|
38001
|
-
var _a2,
|
37991
|
+
var _a2, _b2;
|
38002
37992
|
const helpers = {
|
38003
37993
|
rowId,
|
38004
37994
|
table
|
38005
37995
|
};
|
38006
37996
|
if ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEnabled) {
|
38007
37997
|
helpers.editing = {
|
38008
|
-
isEditing: ((
|
37998
|
+
isEditing: ((_b2 = tableMeta.editing) == null ? void 0 : _b2.isEditing) ?? false,
|
38009
37999
|
removeRowChanges: () => tableMeta.editing.discardChanges(rowId, table),
|
38010
38000
|
save: () => tableMeta.editing.saveChanges(table, rowId)
|
38011
38001
|
};
|
@@ -38013,16 +38003,16 @@ function Actions(props) {
|
|
38013
38003
|
return action(data, helpers);
|
38014
38004
|
}).filter((action) => !!action);
|
38015
38005
|
let length = actionsLength;
|
38016
|
-
if ((_a = tableMeta.editing) == null ? void 0 : _a.isEditing) {
|
38006
|
+
if (((_a = tableMeta.editing) == null ? void 0 : _a.isEditing) && ((_b = tableMeta.editing) == null ? void 0 : _b.showEditingActions)) {
|
38017
38007
|
const lengthWithoutEditingItems = visibleActions.length - 1;
|
38018
38008
|
if (lengthWithoutEditingItems < actionsLength) {
|
38019
38009
|
length = lengthWithoutEditingItems;
|
38020
38010
|
}
|
38021
38011
|
}
|
38022
38012
|
const handleMenuButtonKeyDown = (event) => {
|
38023
|
-
var _a2,
|
38013
|
+
var _a2, _b2;
|
38024
38014
|
const isLastRowActive = tableMeta.rowActive.rowActiveIndex === tableMeta.length - 1;
|
38025
|
-
if (event.key === "Tab" && isLastRowActive && ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEditing) && ((
|
38015
|
+
if (event.key === "Tab" && isLastRowActive && ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEditing) && ((_b2 = tableMeta.editing) == null ? void 0 : _b2.hasChanges())) {
|
38026
38016
|
tableMeta.editing.saveChanges(table);
|
38027
38017
|
}
|
38028
38018
|
};
|
@@ -38051,9 +38041,9 @@ function Actions(props) {
|
|
38051
38041
|
onKeyDown: handleMenuButtonKeyDown,
|
38052
38042
|
tabIndex: isActiveRow ? 0 : -1,
|
38053
38043
|
menu: (menuProps) => /* @__PURE__ */ React__default.createElement(Menu$1, { ...menuProps }, /* @__PURE__ */ React__default.createElement(Menu$1.Content, { onKeyDown: handleMenuContentKeyDown }, actionsInMenu.map((action, i2) => {
|
38054
|
-
var _a2;
|
38044
|
+
var _a2, _b2;
|
38055
38045
|
const item = /* @__PURE__ */ React__default.createElement(Menu$1.Item, { key: i2, ...action.props, shortcut: action.props.shortcut }, action.props["aria-label"]);
|
38056
|
-
const isFirstEditingMenuItem = ((_a2 = tableMeta.editing) == null ? void 0 : _a2.isEditing) && actionsInMenu.length > 2 && i2 === actionsInMenu.length - 2;
|
38046
|
+
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;
|
38057
38047
|
if (isFirstEditingMenuItem) {
|
38058
38048
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, { key: i2 }, /* @__PURE__ */ React__default.createElement(Menu$1.Separator, null), item);
|
38059
38049
|
}
|
@@ -38488,114 +38478,115 @@ const useResizeObserver$1 = (ref, enabled = true) => {
|
|
38488
38478
|
}, [enabled]);
|
38489
38479
|
return size2;
|
38490
38480
|
};
|
38491
|
-
const DisplayRow = React__default.memo(
|
38492
|
-
|
38493
|
-
|
38494
|
-
|
38495
|
-
|
38496
|
-
|
38497
|
-
|
38498
|
-
|
38499
|
-
|
38500
|
-
|
38501
|
-
const handleClick = React__default.useCallback(
|
38502
|
-
(event) => {
|
38503
|
-
var _a2;
|
38504
|
-
const clickedElement = event.target;
|
38505
|
-
if (!((_a2 = event.currentTarget) == null ? void 0 : _a2.contains(event.target)) || isElementInteractive(clickedElement)) {
|
38506
|
-
return;
|
38507
|
-
}
|
38508
|
-
tableMeta.rowClick.handleClick(event, row.original);
|
38509
|
-
},
|
38510
|
-
[row.original]
|
38511
|
-
);
|
38512
|
-
const handleClickCapture = React__default.useCallback(() => {
|
38513
|
-
tableMeta.rowActive.setRowActiveIndex(index2);
|
38514
|
-
}, [index2]);
|
38515
|
-
if (tableMeta.rowActive.isEnabled) {
|
38516
|
-
attributes["data-row-active"] = tableMeta.rowActive.rowActiveIndex === index2 ? true : void 0;
|
38517
|
-
attributes.onClickCapture = handleClickCapture;
|
38518
|
-
}
|
38519
|
-
if (tableMeta.rowClick.isEnabled(row.original)) {
|
38520
|
-
attributes.onClick = handleClick;
|
38521
|
-
}
|
38522
|
-
if (tableMeta.rowDrag.isEnabled) {
|
38523
|
-
attributes["aria-grabbed"] = !!tableMeta.rowDrag.dragging[row.id];
|
38524
|
-
attributes.draggable = true;
|
38525
|
-
const GHOST_ELEMENT_ID = "taco_table_dragging";
|
38526
|
-
attributes.onDragStart = (event) => {
|
38527
|
-
var _a2, _b2, _c2, _d;
|
38528
|
-
let rows = [row];
|
38529
|
-
if (row.getCanSelect()) {
|
38530
|
-
rows = row.getIsSelected() ? table.getSelectedRowModel().rows : [row, ...table.getSelectedRowModel().rows];
|
38531
|
-
}
|
38532
|
-
const data = rows.map((row2) => row2.original);
|
38533
|
-
(_b2 = (_a2 = tableMeta.rowDrag).setDragging) == null ? void 0 : _b2.call(
|
38534
|
-
_a2,
|
38535
|
-
rows.reduce((dragging, rowBeingDragged) => ({ ...dragging, [rowBeingDragged.id]: true }), {})
|
38536
|
-
);
|
38537
|
-
event.dataTransfer.setData("text", JSON.stringify(data));
|
38538
|
-
const showPlaceholder = (text2) => {
|
38539
|
-
const ghost = document.createElement("div");
|
38540
|
-
ghost.id = GHOST_ELEMENT_ID;
|
38541
|
-
ghost.className = "wcag-blue rounded flex w-48 p-4 absolute -ml-[100vw]";
|
38542
|
-
ghost.innerText = text2;
|
38543
|
-
document.body.appendChild(ghost);
|
38544
|
-
event.dataTransfer.setDragImage(ghost, 0, 0);
|
38545
|
-
};
|
38546
|
-
const setDataTransfer = (text2) => event.dataTransfer.setData("text", text2);
|
38547
|
-
(_d = (_c2 = tableMeta.rowDrag).handleRowDrag) == null ? void 0 : _d.call(_c2, data, showPlaceholder, setDataTransfer);
|
38548
|
-
};
|
38549
|
-
attributes.onDragEnd = () => {
|
38550
|
-
var _a2, _b2, _c2;
|
38551
|
-
(_a2 = document.getElementById(GHOST_ELEMENT_ID)) == null ? void 0 : _a2.remove();
|
38552
|
-
(_c2 = (_b2 = tableMeta.rowDrag).setDragging) == null ? void 0 : _c2.call(_b2, {});
|
38481
|
+
const DisplayRow = React__default.memo(
|
38482
|
+
React__default.forwardRef(function DisplayRow2(props, externalRef) {
|
38483
|
+
var _a, _b, _c;
|
38484
|
+
const { children, cellRenderer: CellRenderer, index: index2, measureRow, row, table, ...otherAttributes } = props;
|
38485
|
+
const tableMeta = table.options.meta;
|
38486
|
+
const attributes = {
|
38487
|
+
...otherAttributes,
|
38488
|
+
"data-row-id": row.id,
|
38489
|
+
"data-row-index": index2,
|
38490
|
+
tabIndex: -1
|
38553
38491
|
};
|
38554
|
-
|
38555
|
-
|
38556
|
-
|
38557
|
-
|
38558
|
-
|
38559
|
-
|
38560
|
-
|
38561
|
-
|
38562
|
-
|
38563
|
-
|
38564
|
-
|
38565
|
-
|
38566
|
-
|
38567
|
-
|
38568
|
-
|
38569
|
-
|
38570
|
-
|
38571
|
-
|
38572
|
-
|
38573
|
-
|
38574
|
-
|
38575
|
-
|
38576
|
-
|
38577
|
-
|
38578
|
-
|
38579
|
-
|
38492
|
+
const handleClick = React__default.useCallback(
|
38493
|
+
(event) => {
|
38494
|
+
var _a2;
|
38495
|
+
const clickedElement = event.target;
|
38496
|
+
if (!((_a2 = event.currentTarget) == null ? void 0 : _a2.contains(event.target)) || isElementInteractive(clickedElement)) {
|
38497
|
+
return;
|
38498
|
+
}
|
38499
|
+
tableMeta.rowClick.handleClick(event, row.original);
|
38500
|
+
},
|
38501
|
+
[row.original]
|
38502
|
+
);
|
38503
|
+
const handleClickCapture = React__default.useCallback(() => {
|
38504
|
+
tableMeta.rowActive.setRowActiveIndex(index2);
|
38505
|
+
}, [index2]);
|
38506
|
+
if (tableMeta.rowActive.isEnabled) {
|
38507
|
+
attributes["data-row-active"] = tableMeta.rowActive.rowActiveIndex === index2 ? true : void 0;
|
38508
|
+
attributes.onClickCapture = handleClickCapture;
|
38509
|
+
}
|
38510
|
+
if (tableMeta.rowClick.isEnabled(row.original)) {
|
38511
|
+
attributes.onClick = handleClick;
|
38512
|
+
}
|
38513
|
+
if (tableMeta.rowDrag.isEnabled) {
|
38514
|
+
attributes["aria-grabbed"] = !!tableMeta.rowDrag.dragging[row.id];
|
38515
|
+
attributes.draggable = true;
|
38516
|
+
const GHOST_ELEMENT_ID = "taco_table_dragging";
|
38517
|
+
attributes.onDragStart = (event) => {
|
38518
|
+
var _a2, _b2, _c2, _d;
|
38519
|
+
let rows = [row];
|
38520
|
+
if (row.getCanSelect()) {
|
38521
|
+
rows = row.getIsSelected() ? table.getSelectedRowModel().rows : [row, ...table.getSelectedRowModel().rows];
|
38522
|
+
}
|
38523
|
+
const data = rows.map((row2) => row2.original);
|
38524
|
+
(_b2 = (_a2 = tableMeta.rowDrag).setDragging) == null ? void 0 : _b2.call(
|
38525
|
+
_a2,
|
38526
|
+
rows.reduce((dragging, rowBeingDragged) => ({ ...dragging, [rowBeingDragged.id]: true }), {})
|
38527
|
+
);
|
38528
|
+
event.dataTransfer.setData("text", JSON.stringify(data));
|
38529
|
+
const showPlaceholder = (text2) => {
|
38530
|
+
const ghost = document.createElement("div");
|
38531
|
+
ghost.id = GHOST_ELEMENT_ID;
|
38532
|
+
ghost.className = "wcag-blue rounded flex w-48 p-4 absolute -ml-[100vw]";
|
38533
|
+
ghost.innerText = text2;
|
38534
|
+
document.body.append(ghost);
|
38535
|
+
event.dataTransfer.setDragImage(ghost, 0, 0);
|
38536
|
+
};
|
38537
|
+
const setDataTransfer = (text2) => event.dataTransfer.setData("text", text2);
|
38538
|
+
(_d = (_c2 = tableMeta.rowDrag).handleRowDrag) == null ? void 0 : _d.call(_c2, data, showPlaceholder, setDataTransfer);
|
38539
|
+
};
|
38540
|
+
attributes.onDragEnd = () => {
|
38541
|
+
var _a2, _b2, _c2;
|
38542
|
+
(_a2 = document.getElementById(GHOST_ELEMENT_ID)) == null ? void 0 : _a2.remove();
|
38543
|
+
(_c2 = (_b2 = tableMeta.rowDrag).setDragging) == null ? void 0 : _c2.call(_b2, {});
|
38544
|
+
};
|
38545
|
+
}
|
38546
|
+
const [isDraggedOver, dropTargetProps] = useDropTarget((event) => {
|
38547
|
+
var _a2, _b2;
|
38548
|
+
return (_b2 = (_a2 = tableMeta.rowDrop).handleDrop) == null ? void 0 : _b2.call(_a2, event, row.original);
|
38549
|
+
});
|
38550
|
+
if (tableMeta.rowDrop.isEnabled) {
|
38551
|
+
attributes.onDragEnter = dropTargetProps == null ? void 0 : dropTargetProps.onDragEnter;
|
38552
|
+
attributes.onDragLeave = dropTargetProps == null ? void 0 : dropTargetProps.onDragLeave;
|
38553
|
+
attributes.onDragOver = dropTargetProps == null ? void 0 : dropTargetProps.onDragOver;
|
38554
|
+
attributes.onDrop = dropTargetProps == null ? void 0 : dropTargetProps.onDrop;
|
38555
|
+
attributes["data-row-dragged-over"] = isDraggedOver;
|
38556
|
+
}
|
38557
|
+
if (table.options.enableGrouping) {
|
38558
|
+
attributes["data-row-group"] = row.getIsGrouped() ? true : void 0;
|
38559
|
+
}
|
38560
|
+
if (row.getCanSelect()) {
|
38561
|
+
attributes["data-row-selected"] = row.getIsSelected() || row.getIsAllSubRowsSelected() ? true : void 0;
|
38562
|
+
}
|
38563
|
+
let expandedRow;
|
38564
|
+
if (tableMeta.rowExpansion.isEnabled && row.getIsExpanded()) {
|
38565
|
+
attributes["data-row-expanded"] = true;
|
38566
|
+
expandedRow = (_c = (_b = (_a = tableMeta.rowExpansion).rowExpansionRenderer) == null ? void 0 : _b.call(_a, row.original)) == null ? void 0 : _c();
|
38567
|
+
}
|
38568
|
+
const rowMeta = row.original._meta;
|
38569
|
+
if (rowMeta == null ? void 0 : rowMeta.layout) {
|
38580
38570
|
attributes["data-row-meta-layout"] = rowMeta.layout;
|
38581
38571
|
}
|
38582
|
-
|
38583
|
-
|
38584
|
-
|
38585
|
-
|
38586
|
-
|
38587
|
-
|
38588
|
-
|
38589
|
-
|
38590
|
-
|
38591
|
-
|
38592
|
-
|
38593
|
-
|
38594
|
-
|
38595
|
-
|
38596
|
-
|
38597
|
-
|
38598
|
-
})
|
38572
|
+
const ref = React__default.useRef(null);
|
38573
|
+
const expansionRef = React__default.useRef(null);
|
38574
|
+
const expandedRowSize = useResizeObserver$1(expansionRef, !!expandedRow);
|
38575
|
+
React__default.useEffect(() => {
|
38576
|
+
var _a2, _b2;
|
38577
|
+
const rowHeight = ((_a2 = ref.current) == null ? void 0 : _a2.getBoundingClientRect().height) ?? 0;
|
38578
|
+
const expansionHeight = ((_b2 = expansionRef.current) == null ? void 0 : _b2.getBoundingClientRect().height) ?? 0;
|
38579
|
+
measureRow(rowHeight + expansionHeight);
|
38580
|
+
}, [expansionRef.current, expandedRowSize == null ? void 0 : expandedRowSize.height]);
|
38581
|
+
const className = clsx("group/row", otherAttributes.className, {
|
38582
|
+
"hover:cursor-grab": tableMeta.rowDrag.isEnabled && typeof attributes.onClick !== "function",
|
38583
|
+
"hover:cursor-pointer": typeof attributes.onClick === "function"
|
38584
|
+
});
|
38585
|
+
const isGrouped = row.getIsGrouped();
|
38586
|
+
const mergedRef = mergeRefs([ref, externalRef]);
|
38587
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement("tr", { ...attributes, className, ref: mergedRef }, children, row.getVisibleCells().filter((cell) => !(isGrouped && cell.column.id === "__actions")).map((cell, cellIndex) => /* @__PURE__ */ React__default.createElement(Cell$2, { key: cell.id, cell, index: cellIndex, renderer: CellRenderer }))), expandedRow ? /* @__PURE__ */ React__default.createElement("tr", { "data-row-parent-id": row.id, ref: expansionRef }, /* @__PURE__ */ React__default.createElement("td", { className: "col-span-full" }, expandedRow)) : null);
|
38588
|
+
})
|
38589
|
+
);
|
38599
38590
|
function DisplayCell(props) {
|
38600
38591
|
const { cell, cellRef, index: index2, isHighlighted, ...cellAttributes } = props;
|
38601
38592
|
const columnMeta = cell.column.columnDef.meta;
|
@@ -38657,18 +38648,16 @@ function Resizer(props) {
|
|
38657
38648
|
const handleResize = (event) => {
|
38658
38649
|
if (event.detail >= 2) {
|
38659
38650
|
onResetSize();
|
38660
|
-
} else {
|
38661
|
-
|
38662
|
-
|
38663
|
-
|
38664
|
-
|
38665
|
-
|
38666
|
-
setTimeout(() => {
|
38667
|
-
onResize == null ? void 0 : onResize(event);
|
38668
|
-
}, 1);
|
38669
|
-
} else {
|
38651
|
+
} else if (!Number.isInteger(width) && headerRef) {
|
38652
|
+
setColumnSizing((sizes) => ({
|
38653
|
+
...sizes,
|
38654
|
+
[id2]: headerRef.getBoundingClientRect().width
|
38655
|
+
}));
|
38656
|
+
setTimeout(() => {
|
38670
38657
|
onResize == null ? void 0 : onResize(event);
|
38671
|
-
}
|
38658
|
+
}, 1);
|
38659
|
+
} else {
|
38660
|
+
onResize == null ? void 0 : onResize(event);
|
38672
38661
|
}
|
38673
38662
|
};
|
38674
38663
|
const handle = /* @__PURE__ */ React__default.createElement(
|
@@ -38682,6 +38671,7 @@ function Resizer(props) {
|
|
38682
38671
|
"!visible": isResizing
|
38683
38672
|
}
|
38684
38673
|
),
|
38674
|
+
"data-taco": "resize-handle",
|
38685
38675
|
onClick: handleClick,
|
38686
38676
|
onMouseDown: handleResize,
|
38687
38677
|
onTouchStart: handleResize
|
@@ -38801,25 +38791,21 @@ function HeaderMenu(props) {
|
|
38801
38791
|
const { texts } = useLocalization();
|
38802
38792
|
const [popover, setPopover] = React__default.useState(void 0);
|
38803
38793
|
let popoverElement;
|
38804
|
-
if (popover) {
|
38794
|
+
if (popover === "goto") {
|
38805
38795
|
const handleClosePopover = () => setPopover(void 0);
|
38806
|
-
|
38807
|
-
|
38808
|
-
|
38809
|
-
const
|
38810
|
-
|
38811
|
-
|
38812
|
-
|
38813
|
-
|
38814
|
-
|
38815
|
-
|
38816
|
-
} finally {
|
38817
|
-
handleClosePopover();
|
38818
|
-
}
|
38819
|
-
};
|
38820
|
-
popoverElement = (props2) => /* @__PURE__ */ React__default.createElement(GotoPopover, { ...props2, open: true, onChange: handleClosePopover, onGoto: goto });
|
38796
|
+
if (handleGoto) {
|
38797
|
+
const goto = async (query) => {
|
38798
|
+
try {
|
38799
|
+
const index22 = await handleGoto(query);
|
38800
|
+
setRowActiveIndex(index22);
|
38801
|
+
scrollToIndex(index22);
|
38802
|
+
} catch (e3) {
|
38803
|
+
console.error(e3);
|
38804
|
+
} finally {
|
38805
|
+
handleClosePopover();
|
38821
38806
|
}
|
38822
|
-
}
|
38807
|
+
};
|
38808
|
+
popoverElement = (props2) => /* @__PURE__ */ React__default.createElement(GotoPopover, { ...props2, open: true, onChange: handleClosePopover, onGoto: goto });
|
38823
38809
|
}
|
38824
38810
|
}
|
38825
38811
|
const memoedMenuItems = React__default.useMemo(() => {
|
@@ -39106,14 +39092,14 @@ const MemoedHeader = React__default.memo(function MemoedHeader2(props) {
|
|
39106
39092
|
className,
|
39107
39093
|
"data-cell-align": isGroup2 ? "center" : align,
|
39108
39094
|
"data-cell-id": id2,
|
39109
|
-
"data-cell-pinned": isPinned
|
39095
|
+
"data-cell-pinned": isPinned || void 0,
|
39110
39096
|
"data-taco": isGroup2 ? isPlaceholder ? "grouped-column-header-placeholder" : "grouped-column-header" : "column-header",
|
39111
39097
|
"data-parent-group-id": props.parentId ? props.parentId : void 0,
|
39112
|
-
"data-rows-expanded": isExpanded
|
39098
|
+
"data-rows-expanded": isExpanded || void 0,
|
39113
39099
|
style,
|
39114
39100
|
ref: setRef
|
39115
39101
|
},
|
39116
|
-
|
39102
|
+
isPlaceholder ? null : /* @__PURE__ */ React__default.createElement(HeaderContent, { children, tooltip, isInternalColumnHeader: !!isInternalColumn(id2) }),
|
39117
39103
|
sortDirection ? /* @__PURE__ */ React__default.createElement(SortIndicator, { direction: sortDirection }) : null,
|
39118
39104
|
hasMenu ? /* @__PURE__ */ React__default.createElement(
|
39119
39105
|
HeaderMenu,
|
@@ -39241,16 +39227,14 @@ function Body(props) {
|
|
39241
39227
|
scrollToIndex(prevIndex);
|
39242
39228
|
});
|
39243
39229
|
}
|
39244
|
-
} else {
|
39245
|
-
|
39246
|
-
|
39247
|
-
|
39248
|
-
|
39249
|
-
|
39250
|
-
|
39251
|
-
|
39252
|
-
});
|
39253
|
-
}
|
39230
|
+
} else if (!isLastRow) {
|
39231
|
+
event.preventDefault();
|
39232
|
+
const nextIndex = tableMeta.rowActive.rowActiveIndex + 1;
|
39233
|
+
tableMeta.rowActive.setRowActiveIndex(nextIndex);
|
39234
|
+
requestAnimationFrame(() => {
|
39235
|
+
focusManager.focusFirst();
|
39236
|
+
scrollToIndex(nextIndex);
|
39237
|
+
});
|
39254
39238
|
}
|
39255
39239
|
}
|
39256
39240
|
}
|
@@ -39362,7 +39346,7 @@ const MemoedFooter = React__default.memo(function MemoedFooter2(props) {
|
|
39362
39346
|
key: footer.id,
|
39363
39347
|
"data-cell-align": align,
|
39364
39348
|
"data-cell-id": footer.id,
|
39365
|
-
"data-cell-pinned": isPinned
|
39349
|
+
"data-cell-pinned": isPinned || void 0,
|
39366
39350
|
style
|
39367
39351
|
},
|
39368
39352
|
content
|
@@ -39580,11 +39564,9 @@ function Search$1(props) {
|
|
39580
39564
|
}
|
39581
39565
|
}, [tableMeta.search.highlightedColumnIndexes.length]);
|
39582
39566
|
React__default.useEffect(() => {
|
39583
|
-
if (tableMeta.server._experimentalDataLoader2 && tableMeta.search.highlightedColumnIndexes.length) {
|
39584
|
-
|
39585
|
-
|
39586
|
-
scrollTo2(tableMeta.search.highlightedColumnIndexes[0][0]);
|
39587
|
-
}
|
39567
|
+
if (tableMeta.server._experimentalDataLoader2 && tableMeta.search.highlightedColumnIndexes.length && query !== lastResultQuery.current) {
|
39568
|
+
lastResultQuery.current = query;
|
39569
|
+
scrollTo2(tableMeta.search.highlightedColumnIndexes[0][0]);
|
39588
39570
|
}
|
39589
39571
|
}, [tableMeta.search.highlightedColumnIndexes.length, query]);
|
39590
39572
|
const handleFocus = async () => {
|
@@ -39613,7 +39595,7 @@ function Search$1(props) {
|
|
39613
39595
|
}, 150);
|
39614
39596
|
}
|
39615
39597
|
};
|
39616
|
-
const handleToggleExcludeUnmatchedResults = (enabled) => {
|
39598
|
+
const handleToggleExcludeUnmatchedResults = async (enabled) => {
|
39617
39599
|
tableMeta.search.setEnableGlobalFilter(enabled, table);
|
39618
39600
|
requestAnimationFrame(() => {
|
39619
39601
|
var _a2;
|
@@ -39621,9 +39603,8 @@ function Search$1(props) {
|
|
39621
39603
|
});
|
39622
39604
|
if (tableMeta.search.handleSearch) {
|
39623
39605
|
setLoading(true);
|
39624
|
-
tableMeta.search.handleSearch(enabled ? query : void 0, hiddenColumns)
|
39625
|
-
|
39626
|
-
});
|
39606
|
+
await tableMeta.search.handleSearch(enabled ? query : void 0, hiddenColumns);
|
39607
|
+
setLoading(false);
|
39627
39608
|
}
|
39628
39609
|
};
|
39629
39610
|
const handleNextResult = () => {
|
@@ -39670,7 +39651,7 @@ function Search$1(props) {
|
|
39670
39651
|
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
|
39671
39652
|
SearchInput22,
|
39672
39653
|
{
|
39673
|
-
findCurrent: tableMeta.search.currentHighlightColumnIndex
|
39654
|
+
findCurrent: tableMeta.search.currentHighlightColumnIndex === void 0 ? null : tableMeta.search.currentHighlightColumnIndex + 1,
|
39674
39655
|
findTotal: ((_a = tableMeta.search.highlightedColumnIndexes) == null ? void 0 : _a.length) ?? null,
|
39675
39656
|
loading: tableMeta.server._experimentalDataLoader2 ? loading : tableMeta.server.loading,
|
39676
39657
|
name: "table-search",
|
@@ -43498,7 +43479,7 @@ function getContainerById(children, id2) {
|
|
43498
43479
|
if (list) {
|
43499
43480
|
return list == null ? void 0 : list.props;
|
43500
43481
|
}
|
43501
|
-
return (_a = lists.find((l2) => React__default.Children.toArray(l2.props.children).
|
43482
|
+
return (_a = lists.find((l2) => React__default.Children.toArray(l2.props.children).some((child) => child.props.id === id2))) == null ? void 0 : _a.props;
|
43502
43483
|
}
|
43503
43484
|
function Container$1(externalProps) {
|
43504
43485
|
const { children, reorder, move } = externalProps;
|
@@ -43601,7 +43582,7 @@ function HideOrOrderPopover(props) {
|
|
43601
43582
|
const listClassName = "flex max-h-64 flex-col gap-y-px overflow-auto";
|
43602
43583
|
const handleReorder = (activeId, overId) => {
|
43603
43584
|
var _a;
|
43604
|
-
if (columns.
|
43585
|
+
if (columns.some((column) => {
|
43605
43586
|
var _a2;
|
43606
43587
|
return column.id === overId && ((_a2 = column.columnDef.meta) == null ? void 0 : _a2.enableOrdering) === false;
|
43607
43588
|
})) {
|
@@ -43657,23 +43638,19 @@ function Settings(props) {
|
|
43657
43638
|
const canChangeRowHeight = tableMeta.rowHeight.isEnabled;
|
43658
43639
|
const [popover, setPopover] = React__default.useState(void 0);
|
43659
43640
|
let popoverElement;
|
43660
|
-
if (popover) {
|
43641
|
+
if (popover === "columnSettings") {
|
43661
43642
|
const handleClosePopover = () => setPopover(void 0);
|
43662
|
-
|
43663
|
-
|
43664
|
-
|
43665
|
-
|
43666
|
-
|
43667
|
-
|
43668
|
-
|
43669
|
-
|
43670
|
-
|
43671
|
-
onChange: handleClosePopover,
|
43672
|
-
table
|
43673
|
-
}
|
43674
|
-
);
|
43643
|
+
if (canHideOrOrder) {
|
43644
|
+
popoverElement = (popoverProps) => /* @__PURE__ */ React__default.createElement(
|
43645
|
+
HideOrOrderPopover,
|
43646
|
+
{
|
43647
|
+
...popoverProps,
|
43648
|
+
id: `${id2}-columnSettings`,
|
43649
|
+
open: true,
|
43650
|
+
onChange: handleClosePopover,
|
43651
|
+
table
|
43675
43652
|
}
|
43676
|
-
|
43653
|
+
);
|
43677
43654
|
}
|
43678
43655
|
}
|
43679
43656
|
return /* @__PURE__ */ React__default.createElement(
|
@@ -43739,13 +43716,11 @@ const Root$1 = React__default.forwardRef(function CollectionRoot(props, ref) {
|
|
43739
43716
|
};
|
43740
43717
|
const setActiveIndexByElement = React__default.useCallback(
|
43741
43718
|
(option) => {
|
43742
|
-
if (internalRef.current) {
|
43743
|
-
|
43744
|
-
|
43745
|
-
|
43746
|
-
|
43747
|
-
setActiveOption(nextActiveIndex, internalRef.current, option);
|
43748
|
-
}
|
43719
|
+
if (internalRef.current && option.matches(querySelector2)) {
|
43720
|
+
const options = getOptionsFromCollection(internalRef.current, querySelector2);
|
43721
|
+
const nextActiveIndex = Array.from(options).indexOf(option);
|
43722
|
+
if (nextActiveIndex > -1) {
|
43723
|
+
setActiveOption(nextActiveIndex, internalRef.current, option);
|
43749
43724
|
}
|
43750
43725
|
}
|
43751
43726
|
},
|
@@ -43849,23 +43824,23 @@ const getNextEnabledItem = (event, options, activeIndex, recurse = true) => {
|
|
43849
43824
|
if (nextIndex !== void 0) {
|
43850
43825
|
if (nextIndex === activeIndex) {
|
43851
43826
|
return activeIndex;
|
43852
|
-
}
|
43853
|
-
|
43854
|
-
|
43855
|
-
|
43856
|
-
|
43857
|
-
|
43858
|
-
|
43859
|
-
|
43860
|
-
|
43861
|
-
|
43862
|
-
|
43863
|
-
|
43864
|
-
|
43865
|
-
|
43866
|
-
|
43867
|
-
|
43868
|
-
|
43827
|
+
}
|
43828
|
+
if (options.item(nextIndex) && isSkippableItem(options.item(nextIndex))) {
|
43829
|
+
if (recurse && nextIndex === 0) {
|
43830
|
+
return getNextEnabledItem(
|
43831
|
+
new KeyboardEvent(event.type, { ...event, key: "ArrowDown" }),
|
43832
|
+
options,
|
43833
|
+
nextIndex,
|
43834
|
+
false
|
43835
|
+
);
|
43836
|
+
}
|
43837
|
+
if (recurse && nextIndex === options.length - 1) {
|
43838
|
+
return getNextEnabledItem(
|
43839
|
+
new KeyboardEvent(event.type, { ...event, key: "ArrowUp" }),
|
43840
|
+
options,
|
43841
|
+
nextIndex,
|
43842
|
+
false
|
43843
|
+
);
|
43869
43844
|
}
|
43870
43845
|
return getNextEnabledItem(event, options, nextIndex, recurse);
|
43871
43846
|
}
|
@@ -43891,7 +43866,7 @@ const Root = React__default.forwardRef(function Listbox22(props, ref) {
|
|
43891
43866
|
multiple,
|
43892
43867
|
readOnly = false,
|
43893
43868
|
setValue,
|
43894
|
-
title,
|
43869
|
+
title: _1,
|
43895
43870
|
value,
|
43896
43871
|
...otherProps
|
43897
43872
|
} = props;
|
@@ -43927,12 +43902,14 @@ const createListboxValueSetter = (multiple, setValue) => (nextValue) => {
|
|
43927
43902
|
if (multiple) {
|
43928
43903
|
if (value === void 0) {
|
43929
43904
|
return [nextValue];
|
43930
|
-
}
|
43905
|
+
}
|
43906
|
+
if (Array.isArray(value)) {
|
43931
43907
|
if (value.includes(nextValue)) {
|
43932
43908
|
return value.filter((v2) => v2 !== nextValue);
|
43933
43909
|
}
|
43934
43910
|
return [...value, nextValue];
|
43935
|
-
}
|
43911
|
+
}
|
43912
|
+
if (value === nextValue) {
|
43936
43913
|
return [];
|
43937
43914
|
}
|
43938
43915
|
return [value, nextValue];
|
@@ -43941,7 +43918,7 @@ const createListboxValueSetter = (multiple, setValue) => (nextValue) => {
|
|
43941
43918
|
});
|
43942
43919
|
};
|
43943
43920
|
const Option$1 = React__default.forwardRef(function Listbox2Option(props, ref) {
|
43944
|
-
const { disabled, id: nativeId, title, value, ...otherProps } = props;
|
43921
|
+
const { disabled, id: nativeId, title: _1, value, ...otherProps } = props;
|
43945
43922
|
const { disabled: listboxDisabled, readOnly: listboxReadOnly, setValue, value: currentValue } = useListbox2Context();
|
43946
43923
|
const id2 = "option-" + useId$1(nativeId);
|
43947
43924
|
const selected = Array.isArray(currentValue) ? currentValue.includes(value) : currentValue === value;
|
@@ -43949,9 +43926,8 @@ const Option$1 = React__default.forwardRef(function Listbox2Option(props, ref) {
|
|
43949
43926
|
if (disabled || listboxDisabled || listboxReadOnly) {
|
43950
43927
|
event.stopPropagation();
|
43951
43928
|
return;
|
43952
|
-
} else {
|
43953
|
-
setValue(value);
|
43954
43929
|
}
|
43930
|
+
setValue(value);
|
43955
43931
|
if (typeof props.onClick === "function") {
|
43956
43932
|
props.onClick(event);
|
43957
43933
|
}
|
@@ -43960,7 +43936,8 @@ const Option$1 = React__default.forwardRef(function Listbox2Option(props, ref) {
|
|
43960
43936
|
if (disabled || listboxDisabled || listboxReadOnly) {
|
43961
43937
|
event.stopPropagation();
|
43962
43938
|
return;
|
43963
|
-
}
|
43939
|
+
}
|
43940
|
+
if (isAriaSelectionKey(event)) {
|
43964
43941
|
setValue(value);
|
43965
43942
|
}
|
43966
43943
|
if (typeof props.onKeyDown === "function") {
|
@@ -44010,7 +43987,7 @@ const Tag = React__default.forwardRef((props, ref) => {
|
|
44010
43987
|
getSubtleColorShadeClasses(color2),
|
44011
43988
|
props.className
|
44012
43989
|
);
|
44013
|
-
return /* @__PURE__ */ React__default.createElement("span", { ...otherProps, className, ref, "data-taco": "tag" }, /* @__PURE__ */ React__default.createElement("span", { className: "flex items-center truncate px-2", ref: textRef }, icon ? typeof icon === "string" ? /* @__PURE__ */ React__default.createElement(Icon$1, { name: icon, className: "-ml-1 mr-1 !h-5 !w-5" }) : React__default.cloneElement(icon, {
|
43990
|
+
return /* @__PURE__ */ React__default.createElement("span", { ...otherProps, className, ref, "data-taco": "tag", "data-taco-color": color2 }, /* @__PURE__ */ React__default.createElement("span", { className: "flex items-center truncate px-2", ref: textRef }, icon ? typeof icon === "string" ? /* @__PURE__ */ React__default.createElement(Icon$1, { name: icon, className: "-ml-1 mr-1 !h-5 !w-5" }) : React__default.cloneElement(icon, {
|
44014
43991
|
className: clsx(icon.props.className, "mr-1 -ml-1")
|
44015
43992
|
}) : null, /* @__PURE__ */ React__default.createElement("span", { className: "truncate" }, children)), onDelete ? /* @__PURE__ */ React__default.createElement(
|
44016
43993
|
Icon$1,
|
@@ -44034,7 +44011,6 @@ const getFontSize = (fontSize) => {
|
|
44034
44011
|
return "text-xs";
|
44035
44012
|
case FontSizes.large:
|
44036
44013
|
return "text-base";
|
44037
|
-
case FontSizes.medium:
|
44038
44014
|
default:
|
44039
44015
|
return "text-sm";
|
44040
44016
|
}
|
@@ -44068,7 +44044,8 @@ const EditPopover = (props) => {
|
|
44068
44044
|
if (event.key === "Escape") {
|
44069
44045
|
close();
|
44070
44046
|
} else if (event.key === "Enter") {
|
44071
|
-
handleSave(close)
|
44047
|
+
const fn = handleSave(close);
|
44048
|
+
await fn(event);
|
44072
44049
|
}
|
44073
44050
|
};
|
44074
44051
|
const handleDelete = (close) => async (event) => {
|
@@ -44113,9 +44090,8 @@ const EditPopover = (props) => {
|
|
44113
44090
|
const preventKeyDownPropagation = (event) => {
|
44114
44091
|
if (event.key === "Escape" || event.key === "Tab" || event.key === "Tab" && event.shiftKey) {
|
44115
44092
|
return;
|
44116
|
-
} else {
|
44117
|
-
event.stopPropagation();
|
44118
44093
|
}
|
44094
|
+
event.stopPropagation();
|
44119
44095
|
};
|
44120
44096
|
const popoverContentKeyDown = (event) => {
|
44121
44097
|
if (event.key === "Tab" || event.key === "Tab" && event.shiftKey) {
|
@@ -44181,17 +44157,27 @@ const Colours = (props) => {
|
|
44181
44157
|
onChange: (value) => onChangeColor(value),
|
44182
44158
|
value: color2
|
44183
44159
|
},
|
44184
|
-
AVAILABLE_COLORS.map((availableColor) => /* @__PURE__ */ React__default.createElement(
|
44185
|
-
|
44160
|
+
AVAILABLE_COLORS.map((availableColor) => /* @__PURE__ */ React__default.createElement(
|
44161
|
+
$b6c3ddc6086f204d$export$d7b12c4107be0d61,
|
44186
44162
|
{
|
44187
|
-
|
44188
|
-
|
44189
|
-
|
44190
|
-
|
44191
|
-
|
44163
|
+
key: availableColor,
|
44164
|
+
"aria-label": color2,
|
44165
|
+
onKeyDown,
|
44166
|
+
value: availableColor,
|
44167
|
+
"data-taco": `${availableColor}-radio`
|
44192
44168
|
},
|
44193
|
-
state
|
44194
|
-
|
44169
|
+
(state) => /* @__PURE__ */ React__default.createElement(
|
44170
|
+
"div",
|
44171
|
+
{
|
44172
|
+
className: clsx(
|
44173
|
+
"flex h-6 w-6 cursor-pointer items-center justify-center rounded",
|
44174
|
+
getSubtleColorShadeClasses(availableColor),
|
44175
|
+
state.isFocusVisible && "ring-2 ring-blue-500"
|
44176
|
+
)
|
44177
|
+
},
|
44178
|
+
state.isSelected && /* @__PURE__ */ React__default.createElement(Icon$1, { name: "tick", className: "!h-5 !w-5" })
|
44179
|
+
)
|
44180
|
+
))
|
44195
44181
|
);
|
44196
44182
|
};
|
44197
44183
|
const mobiles = /iPhone|iPad|iPod|Android/i;
|
@@ -44215,17 +44201,15 @@ const Option = React__default.forwardRef(function Select2Option(props, ref) {
|
|
44215
44201
|
const isTag = tags && !!color2;
|
44216
44202
|
const handleClick = () => {
|
44217
44203
|
var _a;
|
44218
|
-
if (
|
44219
|
-
setOpen(false);
|
44220
|
-
} else {
|
44204
|
+
if (multiple) {
|
44221
44205
|
(_a = selectRef.current) == null ? void 0 : _a.focus();
|
44206
|
+
} else {
|
44207
|
+
setOpen(false);
|
44222
44208
|
}
|
44223
44209
|
};
|
44224
44210
|
const handleKeyDown = (event) => {
|
44225
|
-
if (isAriaSelectionKey(event)) {
|
44226
|
-
|
44227
|
-
setOpen(false);
|
44228
|
-
}
|
44211
|
+
if (isAriaSelectionKey(event) && (!multiple || event.key === "Tab")) {
|
44212
|
+
setOpen(false);
|
44229
44213
|
}
|
44230
44214
|
};
|
44231
44215
|
const isEmptyOption = children !== "";
|
@@ -44239,7 +44223,7 @@ const Option = React__default.forwardRef(function Select2Option(props, ref) {
|
|
44239
44223
|
value: props.value
|
44240
44224
|
}
|
44241
44225
|
) : void 0;
|
44242
|
-
return /* @__PURE__ */ React__default.createElement(Option$1, { ...otherProps, className, onClick: handleClick, onKeyDown: handleKeyDown, ref }, hasValue2 ? /* @__PURE__ */ React__default.createElement(Icon$1, { name: "tick", className: "pointer-events-none invisible -mx-0.5 !h-4 !w-4 group-aria-selected:visible" }) : null, typeof children
|
44226
|
+
return /* @__PURE__ */ React__default.createElement(Option$1, { ...otherProps, className, onClick: handleClick, onKeyDown: handleKeyDown, ref }, hasValue2 ? /* @__PURE__ */ React__default.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__default.createElement(Tag, { className: "pointer-events-none my-1", color: color2, icon: prefix2 }, children) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, prefix2 ? typeof prefix2 === "string" ? /* @__PURE__ */ React__default.createElement(Icon$1, { name: prefix2, className: "!h-5 !w-5" }) : prefix2 : null, /* @__PURE__ */ React__default.createElement("span", { className: "flex w-full justify-between" }, /* @__PURE__ */ React__default.createElement("span", { className: "flex flex-col" }, /* @__PURE__ */ React__default.createElement("span", null, children), description ? /* @__PURE__ */ React__default.createElement("span", { className: "text-grey-700 -mt-1.5 mb-1.5 text-xs", "data-taco": "description" }, description) : null), /* @__PURE__ */ React__default.createElement("span", { className: "flex flex-col self-center" }, postfix ? typeof postfix === "string" ? /* @__PURE__ */ React__default.createElement(Icon$1, { name: postfix, className: "!h-5 !w-5" }) : postfix : null))) : /* @__PURE__ */ React__default.createElement("span", null, children), popover ? /* @__PURE__ */ React__default.createElement(
|
44243
44227
|
IconButton,
|
44244
44228
|
{
|
44245
44229
|
icon: "ellipsis-vertical",
|
@@ -44291,7 +44275,7 @@ const Placeholder = ({ disabled, readOnly, ...props }) => {
|
|
44291
44275
|
const Trigger = React__default.forwardRef(function Select2Trigger(props, ref) {
|
44292
44276
|
const { multiple, value } = useSelect2Context();
|
44293
44277
|
if (Array.isArray(value) || multiple) {
|
44294
|
-
const values = Array.isArray(value) ? value : value
|
44278
|
+
const values = Array.isArray(value) ? value : value === void 0 ? void 0 : [value];
|
44295
44279
|
return /* @__PURE__ */ React__default.createElement(Multiple, { ...props, ref, values });
|
44296
44280
|
}
|
44297
44281
|
return /* @__PURE__ */ React__default.createElement(Single, { ...props, ref, value });
|
@@ -44405,7 +44389,7 @@ const Multiple = React__default.forwardRef(function Select2TriggerMultiple(props
|
|
44405
44389
|
if (open) {
|
44406
44390
|
const hasValues = valuesAsChildren.length > 0;
|
44407
44391
|
className = clsx("!absolute z-20 !h-fit", buttonProps.className);
|
44408
|
-
content = /* @__PURE__ */ React__default.createElement(ScrollArea, { className: "my-1 flex max-h-[5.5rem] flex-col", onClick: forwardClick }, /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-wrap gap-1"
|
44392
|
+
content = /* @__PURE__ */ React__default.createElement(ScrollArea, { className: "my-1 flex max-h-[5.5rem] flex-col", onClick: forwardClick }, /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-wrap gap-1", "data-taco": "select2-value" }, hasValues ? valuesAsChildren.map(
|
44409
44393
|
(child) => typeof child.props.children === "string" ? /* @__PURE__ */ React__default.createElement(
|
44410
44394
|
Tag,
|
44411
44395
|
{
|
@@ -44445,7 +44429,7 @@ const Multiple = React__default.forwardRef(function Select2TriggerMultiple(props
|
|
44445
44429
|
))
|
44446
44430
|
}
|
44447
44431
|
)
|
44448
|
-
)));
|
44432
|
+
) : /* @__PURE__ */ React__default.createElement(Placeholder, { disabled, readOnly }, placeholder)));
|
44449
44433
|
} else {
|
44450
44434
|
content = /* @__PURE__ */ React__default.createElement(MultipleValue, { onClick: forwardClick, valuesAsChildren, placeholder });
|
44451
44435
|
}
|
@@ -44474,7 +44458,7 @@ const MultipleValue = ({ onClick, valuesAsChildren, placeholder }) => {
|
|
44474
44458
|
}
|
44475
44459
|
return "";
|
44476
44460
|
};
|
44477
|
-
return /* @__PURE__ */ React__default.createElement("div", { className: "relative flex w-full items-center gap-1 overflow-hidden", onClick }, /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-1 gap-1 truncate", ref: (ref) => setContentRef(ref) }, valuesAsChildren.length === 0 ? /* @__PURE__ */ React__default.createElement(Placeholder, { disabled, readOnly }, placeholder) : valuesAsChildren.map((child, index2) => {
|
44461
|
+
return /* @__PURE__ */ React__default.createElement("div", { className: "relative flex w-full items-center gap-1 overflow-hidden", onClick }, /* @__PURE__ */ React__default.createElement("div", { className: "flex flex-1 gap-1 truncate", ref: (ref) => setContentRef(ref), "data-taco": "select2-value" }, valuesAsChildren.length === 0 ? /* @__PURE__ */ React__default.createElement(Placeholder, { disabled, readOnly }, placeholder) : valuesAsChildren.map((child, index2) => {
|
44478
44462
|
const classNames = {
|
44479
44463
|
truncate: index2 === boundaryIndex,
|
44480
44464
|
hidden: boundaryIndex !== void 0 && boundaryIndex !== null ? index2 > boundaryIndex : false
|
@@ -44555,7 +44539,7 @@ const BubbleSelect = (props) => {
|
|
44555
44539
|
const select = ref.current;
|
44556
44540
|
const descriptor = Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype, "value");
|
44557
44541
|
const setValue = descriptor.set;
|
44558
|
-
if (prevValue !== value && setValue) {
|
44542
|
+
if (prevValue !== value && setValue && select) {
|
44559
44543
|
if (Array.isArray(value)) {
|
44560
44544
|
value.forEach((v2) => {
|
44561
44545
|
const option = select.querySelector(`option[value='${CSS.escape(v2)}']`);
|
@@ -44605,7 +44589,6 @@ const Search = React__default.forwardRef(function ListboxSearch(props, ref) {
|
|
44605
44589
|
Input,
|
44606
44590
|
{
|
44607
44591
|
...props,
|
44608
|
-
autoFocus: true,
|
44609
44592
|
invalid: !!validationError,
|
44610
44593
|
onChange: handleChange,
|
44611
44594
|
onKeyDown: handleKeyDown,
|
@@ -44619,12 +44602,12 @@ const isGroup = (child) => !!child.props.heading || !!child.props.hasSeparator;
|
|
44619
44602
|
const useChildren = ({ children: initialChildren, emptyValue, multiple, open, setValue, value }) => {
|
44620
44603
|
const [searchQuery, setSearchQuery] = React__default.useState("");
|
44621
44604
|
const flattenedChildren = React__default.useMemo(() => {
|
44622
|
-
const initial = (initialChildren == null ? void 0 : initialChildren.
|
44605
|
+
const initial = (initialChildren == null ? void 0 : initialChildren.flatMap((child) => {
|
44623
44606
|
if (isGroup(child)) {
|
44624
44607
|
return child.props.children;
|
44625
44608
|
}
|
44626
44609
|
return child;
|
44627
|
-
})
|
44610
|
+
})) || [];
|
44628
44611
|
return initial;
|
44629
44612
|
}, [initialChildren]);
|
44630
44613
|
React__default.useEffect(() => {
|
@@ -44817,9 +44800,9 @@ const Select22 = React__default.forwardRef(function Select222(props, ref) {
|
|
44817
44800
|
const hasInlineCreation = onCreate2 && !createDialog;
|
44818
44801
|
const hasSearch = flattenedChildren.length > 5 || hasInlineCreation;
|
44819
44802
|
const visibleChildren = searchQuery === "" ? initialChildren : filteredChildren;
|
44820
|
-
const selectOptions = searchQuery === "" ? flattenedChildren.map((child) => child.props.value) : filteredChildren.
|
44803
|
+
const selectOptions = searchQuery === "" ? flattenedChildren.map((child) => child.props.value) : filteredChildren.flatMap(
|
44821
44804
|
(child) => isGroup(child) ? Array.isArray(child.props.children) && child.props.children.map((subChild) => subChild.props.value) : child.props.value
|
44822
|
-
)
|
44805
|
+
) || [];
|
44823
44806
|
const queryTimeoutRef = React__default.useRef("");
|
44824
44807
|
const typeahead = debounce$2(function() {
|
44825
44808
|
if (!queryTimeoutRef.current) {
|
@@ -44896,14 +44879,13 @@ const Select22 = React__default.forwardRef(function Select222(props, ref) {
|
|
44896
44879
|
if (searchQuery === "") {
|
44897
44880
|
if (areAllSelected) {
|
44898
44881
|
return texts.select2.deselectAll;
|
44899
|
-
} else {
|
44900
|
-
return texts.select2.selectAll;
|
44901
44882
|
}
|
44902
|
-
|
44883
|
+
return texts.select2.selectAll;
|
44884
|
+
}
|
44885
|
+
if (areAllSelected) {
|
44903
44886
|
return texts.select2.deselectAllResults;
|
44904
|
-
} else {
|
44905
|
-
return texts.select2.selectAllResults;
|
44906
44887
|
}
|
44888
|
+
return texts.select2.selectAllResults;
|
44907
44889
|
}, [areAllSelected, searchQuery]);
|
44908
44890
|
const selectAll = () => {
|
44909
44891
|
if (!Array.isArray(value) || value.length === 0) {
|
@@ -44929,7 +44911,7 @@ const Select22 = React__default.forwardRef(function Select222(props, ref) {
|
|
44929
44911
|
},
|
44930
44912
|
createCollectionClassName()
|
44931
44913
|
);
|
44932
|
-
return /* @__PURE__ */ React__default.createElement(Select2Context.Provider, { value: context }, /* @__PURE__ */ React__default.createElement($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__default.createElement($cb5cc270b50c6fcd$export$41fb9f06171c75f4, { asChild: true, "data-taco": "Select2" }, /* @__PURE__ */ React__default.createElement(
|
44914
|
+
return /* @__PURE__ */ React__default.createElement(Select2Context.Provider, { value: context }, /* @__PURE__ */ React__default.createElement($cb5cc270b50c6fcd$export$be92b6f5f03c0fe9, { open, onOpenChange: setOpen }, /* @__PURE__ */ React__default.createElement($cb5cc270b50c6fcd$export$41fb9f06171c75f4, { asChild: true, "data-taco": "Select2", "aria-multiselectable": multiple }, /* @__PURE__ */ React__default.createElement(
|
44933
44915
|
Trigger,
|
44934
44916
|
{
|
44935
44917
|
...otherProps,
|
@@ -45018,7 +45000,7 @@ const ControlledHiddenField = (props) => {
|
|
45018
45000
|
bubbleValue = value === null ? "" : String(value);
|
45019
45001
|
}
|
45020
45002
|
}
|
45021
|
-
return /* @__PURE__ */ React__default.createElement(BubbleSelect, { "aria-hidden": true, key: String(bubbleValue), multiple, name, tabIndex: -1, value: bubbleValue }, emptyValue
|
45003
|
+
return /* @__PURE__ */ React__default.createElement(BubbleSelect, { "aria-hidden": true, key: String(bubbleValue), multiple, name, tabIndex: -1, value: bubbleValue }, emptyValue === void 0 ? null : /* @__PURE__ */ React__default.createElement("option", { value: emptyValue }), options.map((option) => /* @__PURE__ */ React__default.createElement("option", { key: String(option), value: String(option) })));
|
45022
45004
|
}
|
45023
45005
|
return null;
|
45024
45006
|
};
|
@@ -45134,7 +45116,7 @@ function Print(props) {
|
|
45134
45116
|
if (isSafari) {
|
45135
45117
|
try {
|
45136
45118
|
document.execCommand("print", false, void 0);
|
45137
|
-
} catch
|
45119
|
+
} catch {
|
45138
45120
|
window.print();
|
45139
45121
|
}
|
45140
45122
|
} else {
|
@@ -45285,7 +45267,7 @@ const FilterColumn = React__default.forwardRef((props, ref) => {
|
|
45285
45267
|
},
|
45286
45268
|
/* @__PURE__ */ React__default.createElement(Icon$1, { name: "eye-off", className: "text-grey-500 !h-5 !w-5" })
|
45287
45269
|
) : void 0,
|
45288
|
-
disabled: header.column.id !== value && (!header.column.getCanFilter() || !!filters.
|
45270
|
+
disabled: header.column.id !== value && (!header.column.getCanFilter() || !!filters.some((f2) => f2.id === header.column.id))
|
45289
45271
|
},
|
45290
45272
|
/* @__PURE__ */ React__default.createElement(React__default.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())})` : "")
|
45291
45273
|
);
|
@@ -45386,7 +45368,7 @@ function FilterValue(props) {
|
|
45386
45368
|
{
|
45387
45369
|
column,
|
45388
45370
|
"data-query-selector": querySelector,
|
45389
|
-
onChange: (value2) => handleChange([isNaN(value2) ? void 0 : value2, toValue2]),
|
45371
|
+
onChange: (value2) => handleChange([Number.isNaN(value2) ? void 0 : value2, toValue2]),
|
45390
45372
|
placeholder: "from",
|
45391
45373
|
value: fromValue ?? ""
|
45392
45374
|
}
|
@@ -45395,7 +45377,7 @@ function FilterValue(props) {
|
|
45395
45377
|
{
|
45396
45378
|
column,
|
45397
45379
|
"data-query-selector": querySelector,
|
45398
|
-
onChange: (value2) => handleChange([fromValue, isNaN(value2) ? void 0 : value2]),
|
45380
|
+
onChange: (value2) => handleChange([fromValue, Number.isNaN(value2) ? void 0 : value2]),
|
45399
45381
|
placeholder: "to",
|
45400
45382
|
value: toValue2 ?? ""
|
45401
45383
|
}
|
@@ -45414,7 +45396,7 @@ function FilterValue(props) {
|
|
45414
45396
|
}
|
45415
45397
|
function Control(props) {
|
45416
45398
|
var _a, _b;
|
45417
|
-
const { column, comparator, onChange, value, ...attributes } = props;
|
45399
|
+
const { column, comparator: _1, onChange, value, ...attributes } = props;
|
45418
45400
|
const controlRenderer = (_a = column == null ? void 0 : column.columnDef.meta) == null ? void 0 : _a.control;
|
45419
45401
|
const dataType = (_b = column == null ? void 0 : column.columnDef.meta) == null ? void 0 : _b.dataType;
|
45420
45402
|
const filters = React__default.useContext(FilterContext);
|
@@ -45439,9 +45421,11 @@ function Control(props) {
|
|
45439
45421
|
}
|
45440
45422
|
if (controlRenderer === "datepicker" || dataType === "datetime" || dataType === "date") {
|
45441
45423
|
return /* @__PURE__ */ React__default.createElement(Datepicker, { ...attributes, onChange: (event) => onChange(event.detail), value });
|
45442
|
-
}
|
45424
|
+
}
|
45425
|
+
if (controlRenderer === "switch") {
|
45443
45426
|
return /* @__PURE__ */ React__default.createElement(Switch$1, { ...attributes, className: "m-1.5", checked: Boolean(value), onChange });
|
45444
|
-
}
|
45427
|
+
}
|
45428
|
+
if (controlRenderer === "checkbox") {
|
45445
45429
|
return /* @__PURE__ */ React__default.createElement(Checkbox$2, { ...attributes, className: "!m-1.5", checked: Boolean(value), onChange });
|
45446
45430
|
}
|
45447
45431
|
return /* @__PURE__ */ React__default.createElement(
|
@@ -45574,7 +45558,7 @@ function ManageFiltersPopover(props) {
|
|
45574
45558
|
filter: filter2,
|
45575
45559
|
position: index2,
|
45576
45560
|
onChange: handleChangeFilter,
|
45577
|
-
onRemove: filters.
|
45561
|
+
onRemove: filters.some((f2) => f2.id) || filters.length > 1 ? handleRemoveFilter : void 0
|
45578
45562
|
}
|
45579
45563
|
)), /* @__PURE__ */ React__default.createElement("div", { className: "justify-start" }, /* @__PURE__ */ React__default.createElement(Button$4, { appearance: "discrete", onClick: handleCreate, name: "add-filter" }, "+ ", texts.table.filters.buttons.addFilter))), /* @__PURE__ */ React__default.createElement(Group$6, { className: "ml-auto" }, /* @__PURE__ */ React__default.createElement(Popover.Close, null, /* @__PURE__ */ React__default.createElement(Button$4, { name: "close-filters" }, texts.table.filters.buttons.cancel)), /* @__PURE__ */ React__default.createElement(Button$4, { name: "clear-filters", onClick: handleClear }, texts.table.filters.buttons.clear), /* @__PURE__ */ React__default.createElement(Button$4, { appearance: "primary", name: "apply-filters", onClick: handleApply }, texts.table.filters.buttons.apply))))));
|
45580
45564
|
}
|
@@ -45605,7 +45589,7 @@ function Filters(props) {
|
|
45605
45589
|
if (!isLargeScreen && !appliedFilters.length) {
|
45606
45590
|
return /* @__PURE__ */ React__default.createElement(IconButton, { ...buttonProps, icon: "filter" });
|
45607
45591
|
}
|
45608
|
-
return /* @__PURE__ */ React__default.createElement(Button$4, { ...buttonProps }, /* @__PURE__ */ React__default.createElement(Icon$1, { className:
|
45592
|
+
return /* @__PURE__ */ React__default.createElement(Button$4, { ...buttonProps }, /* @__PURE__ */ React__default.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})` : "");
|
45609
45593
|
}
|
45610
45594
|
function TableToolbar(props) {
|
45611
45595
|
const { children: customTools, table, ...attributes } = props;
|
@@ -51126,9 +51110,9 @@ const getNumber = (amount = "", decimalSeparator = ",") => {
|
|
51126
51110
|
}
|
51127
51111
|
let value;
|
51128
51112
|
if (decimalSeparator === ",") {
|
51129
|
-
value = Number(amount.
|
51113
|
+
value = Number(amount.replaceAll("\\.", "").replace(",", "."));
|
51130
51114
|
} else {
|
51131
|
-
value = Number(amount.
|
51115
|
+
value = Number(amount.replaceAll(",", ""));
|
51132
51116
|
}
|
51133
51117
|
return Number.isNaN(value) ? void 0 : value;
|
51134
51118
|
};
|
@@ -51187,9 +51171,8 @@ const sortTypes = (locale2) => {
|
|
51187
51171
|
const b2 = guess(rowB.values[columnId]);
|
51188
51172
|
if (typeof a2 === "string" && typeof b2 === "string") {
|
51189
51173
|
return compareBasicStrings(a2, b2, locale2);
|
51190
|
-
} else {
|
51191
|
-
return compareBasic(a2, b2);
|
51192
51174
|
}
|
51175
|
+
return compareBasic(a2, b2);
|
51193
51176
|
}
|
51194
51177
|
};
|
51195
51178
|
};
|
@@ -51689,7 +51672,7 @@ const useRowSelect = (onSelectedRows) => {
|
|
51689
51672
|
const { onChange: _, ...props } = getToggleAllRowsSelectedProps();
|
51690
51673
|
const onChange = (checked) => {
|
51691
51674
|
if (checked) {
|
51692
|
-
onSelectedRows(Object.assign({}, Array(rows.length).fill(true)));
|
51675
|
+
onSelectedRows(Object.assign({}, Array.from({ length: rows.length }).fill(true)));
|
51693
51676
|
} else {
|
51694
51677
|
onSelectedRows({});
|
51695
51678
|
}
|
@@ -51710,15 +51693,7 @@ const useRowSelect = (onSelectedRows) => {
|
|
51710
51693
|
}
|
51711
51694
|
lastSelectedSortedIndex.current = sortedIndex;
|
51712
51695
|
};
|
51713
|
-
return /* @__PURE__ */ React__default.createElement(
|
51714
|
-
Checkbox$2,
|
51715
|
-
{
|
51716
|
-
...props,
|
51717
|
-
className: "!mt-2.5",
|
51718
|
-
onClick,
|
51719
|
-
onChange: () => false
|
51720
|
-
}
|
51721
|
-
);
|
51696
|
+
return /* @__PURE__ */ React__default.createElement(Checkbox$2, { ...props, className: "!mt-2.5", onClick, onChange: () => false });
|
51722
51697
|
},
|
51723
51698
|
flex: "0 0 36px",
|
51724
51699
|
className: "flex-col justify-start !py-0"
|
@@ -51734,7 +51709,7 @@ const useTableKeyboardNavigation = (props, rows, rowProps, ref) => {
|
|
51734
51709
|
const useGlobalKeyboardNavigation = props.dangerouslyHijackGlobalKeyboardNavigation;
|
51735
51710
|
const [activeIndex, setActiveIndex] = $71cd76cc60e0454e$export$6f32135080cb4c3$1({
|
51736
51711
|
prop: props.activeIndex,
|
51737
|
-
defaultProp: props.defaultActiveIndex
|
51712
|
+
defaultProp: props.defaultActiveIndex === void 0 ? useGlobalKeyboardNavigation ? 0 : void 0 : props.defaultActiveIndex,
|
51738
51713
|
onChange: (index2) => {
|
51739
51714
|
var _a;
|
51740
51715
|
if (index2 !== void 0) {
|
@@ -51770,27 +51745,26 @@ const useTableKeyboardNavigation = (props, rows, rowProps, ref) => {
|
|
51770
51745
|
event.preventDefault();
|
51771
51746
|
currentRow.toggleRowExpanded();
|
51772
51747
|
return;
|
51773
|
-
}
|
51748
|
+
}
|
51749
|
+
if (!currentRow.isExpanded && event.key === "ArrowRight") {
|
51774
51750
|
event.preventDefault();
|
51775
51751
|
currentRow.toggleRowExpanded();
|
51776
51752
|
return;
|
51777
51753
|
}
|
51778
51754
|
}
|
51779
|
-
if (currentRow.toggleRowEditing) {
|
51780
|
-
if (
|
51781
|
-
|
51782
|
-
|
51783
|
-
|
51784
|
-
currentRow.toggleRowExpanded();
|
51785
|
-
}
|
51786
|
-
rowProps.onRowCreate(sanitizedRow, event);
|
51787
|
-
return;
|
51788
|
-
}
|
51789
|
-
if (event.key === "e") {
|
51790
|
-
event.preventDefault();
|
51791
|
-
currentRow.toggleRowEditing();
|
51792
|
-
return;
|
51755
|
+
if (currentRow.toggleRowEditing && currentRow.canEdit && !currentRow.isEditing) {
|
51756
|
+
if (rowProps.onRowCreate && event.shiftKey && event.key === "n") {
|
51757
|
+
event.preventDefault();
|
51758
|
+
if (!currentRow.isExpanded) {
|
51759
|
+
currentRow.toggleRowExpanded();
|
51793
51760
|
}
|
51761
|
+
rowProps.onRowCreate(sanitizedRow, event);
|
51762
|
+
return;
|
51763
|
+
}
|
51764
|
+
if (event.key === "e") {
|
51765
|
+
event.preventDefault();
|
51766
|
+
currentRow.toggleRowEditing();
|
51767
|
+
return;
|
51794
51768
|
}
|
51795
51769
|
}
|
51796
51770
|
if (rowProps.onRowEdit && event.key === "e" && !isModifierKeyPressed) {
|
@@ -51893,13 +51867,13 @@ const getRowProps = (onRowDrag) => (props, { instance, row }) => {
|
|
51893
51867
|
const onDragStart = (event) => {
|
51894
51868
|
event.persist();
|
51895
51869
|
row.toggleRowDragging();
|
51896
|
-
const indexPaths = [row.id, ...Object.keys(instance.state.selectedRowIds)];
|
51897
|
-
const data = instance.rows.filter((r2) => indexPaths.
|
51870
|
+
const indexPaths = /* @__PURE__ */ new Set([row.id, ...Object.keys(instance.state.selectedRowIds)]);
|
51871
|
+
const data = instance.rows.filter((r2) => indexPaths.has(r2.id)).map(sanitizeRowProps);
|
51898
51872
|
const showPlaceholder = (placeholder) => {
|
51899
51873
|
const element = window.document.createElement("div");
|
51900
51874
|
element.id = "yt-table__drag__placeholder";
|
51901
51875
|
element.innerText = placeholder;
|
51902
|
-
window.document.body.
|
51876
|
+
window.document.body.append(element);
|
51903
51877
|
if (typeof DataTransfer.prototype.setDragImage === "function") {
|
51904
51878
|
event.dataTransfer.setDragImage(element, 0, 20);
|
51905
51879
|
}
|
@@ -51909,7 +51883,7 @@ const getRowProps = (onRowDrag) => (props, { instance, row }) => {
|
|
51909
51883
|
const onDragEnd = () => {
|
51910
51884
|
const element = document.getElementById("yt-table__drag__placeholder");
|
51911
51885
|
if (element && element.parentNode) {
|
51912
|
-
element.
|
51886
|
+
element.remove();
|
51913
51887
|
}
|
51914
51888
|
row.toggleRowDragging();
|
51915
51889
|
};
|
@@ -52058,8 +52032,8 @@ const useTable = (props, ref) => {
|
|
52058
52032
|
initialState: {
|
52059
52033
|
// @ts-expect-error: not sure how to type this correctly right now
|
52060
52034
|
sortBy: getInternalSortRules(sortRules) || defaultSortRules,
|
52061
|
-
pageSize:
|
52062
|
-
pageIndex:
|
52035
|
+
pageSize: disablePagination ? void 0 : pageSize,
|
52036
|
+
pageIndex: disablePagination ? void 0 : pageIndex
|
52063
52037
|
},
|
52064
52038
|
manualPagination,
|
52065
52039
|
pageCount: manualPagination && length ? Math.ceil(length / pageSize) : -1,
|
@@ -52133,13 +52107,13 @@ const useTable = (props, ref) => {
|
|
52133
52107
|
tabIndex: otherProps.tabIndex ?? 0
|
52134
52108
|
},
|
52135
52109
|
state,
|
52136
|
-
pagination:
|
52110
|
+
pagination: disablePagination ? null : {
|
52137
52111
|
length: manualPagination && length ? length : data.length,
|
52138
52112
|
pageIndex: state.pageIndex,
|
52139
52113
|
pageSize: state.pageSize,
|
52140
52114
|
setPageIndex: gotoPage,
|
52141
52115
|
setPageSize
|
52142
|
-
}
|
52116
|
+
},
|
52143
52117
|
rows: visibleRows,
|
52144
52118
|
prepareRow: prepareRow2,
|
52145
52119
|
instance: sanitizedInstance
|
@@ -52160,7 +52134,7 @@ const renderCell = (cell, row) => {
|
|
52160
52134
|
};
|
52161
52135
|
return /* @__PURE__ */ React__default.createElement("div", { ...props, role: "gridcell", "data-taco": "table-cell" }, cell.render("Cell") || null);
|
52162
52136
|
};
|
52163
|
-
const Row$1 = React__default.forwardRef(function TableRow({ row, index: index2, instance, headerGroups, ...rowProps }, ref) {
|
52137
|
+
const Row$1 = React__default.forwardRef(function TableRow({ row, index: index2, instance, headerGroups: _1, ...rowProps }, ref) {
|
52164
52138
|
const {
|
52165
52139
|
activeIndex,
|
52166
52140
|
onRowClick,
|
@@ -53224,7 +53198,7 @@ const WindowedTable = React__default.forwardRef(function WindowedTable2(props, r
|
|
53224
53198
|
}
|
53225
53199
|
}, [rows.length]);
|
53226
53200
|
const contentHeight = estimatedRowHeight * props.data.length || 0;
|
53227
|
-
const isScrollbarVisible = height
|
53201
|
+
const isScrollbarVisible = height === null ? false : contentHeight > height;
|
53228
53202
|
const className = clsx(tableProps.className, "yt-table--windowed", { "table-with-scrollbar": isScrollbarVisible });
|
53229
53203
|
let list;
|
53230
53204
|
const itemData = {
|
@@ -53274,7 +53248,7 @@ const WindowedTable = React__default.forwardRef(function WindowedTable2(props, r
|
|
53274
53248
|
);
|
53275
53249
|
}
|
53276
53250
|
}
|
53277
|
-
return /* @__PURE__ */ React__default.createElement(BaseTable, { ...tableProps, className, headerRef, ref: tableRef }, list
|
53251
|
+
return /* @__PURE__ */ React__default.createElement(BaseTable, { ...tableProps, className, headerRef, ref: tableRef }, list || emptyStateRenderer());
|
53278
53252
|
});
|
53279
53253
|
WindowedTable.Column = () => null;
|
53280
53254
|
WindowedTable.Group = () => null;
|
@@ -53845,7 +53819,7 @@ function requirePullAt() {
|
|
53845
53819
|
}
|
53846
53820
|
var pullAtExports = requirePullAt();
|
53847
53821
|
const pullAt = /* @__PURE__ */ getDefaultExportFromCjs(pullAtExports);
|
53848
|
-
const insertChildTableRow = (data, rowIndexPath = void 0, values
|
53822
|
+
const insertChildTableRow = (data, rowIndexPath = void 0, values) => {
|
53849
53823
|
const nexTRow = JSON.parse(JSON.stringify(data));
|
53850
53824
|
let childRowIndexPath;
|
53851
53825
|
if (rowIndexPath) {
|
@@ -53853,12 +53827,12 @@ const insertChildTableRow = (data, rowIndexPath = void 0, values = {}) => {
|
|
53853
53827
|
const currentRow = getByRowIndexPath(nexTRow, rowIndexes.join("."));
|
53854
53828
|
const nextSubRows = (currentRow == null ? void 0 : currentRow.subRows) ?? [];
|
53855
53829
|
const path = rowIndexes.map((i2) => `[${i2}]`).join(".subRows") + ".subRows";
|
53856
|
-
nextSubRows.unshift(values);
|
53830
|
+
nextSubRows.unshift(values ?? {});
|
53857
53831
|
set(nexTRow, path, nextSubRows);
|
53858
53832
|
rowIndexes.push(0);
|
53859
53833
|
childRowIndexPath = rowIndexes.join(".");
|
53860
53834
|
} else {
|
53861
|
-
nexTRow.unshift(values);
|
53835
|
+
nexTRow.unshift(values ?? {});
|
53862
53836
|
childRowIndexPath = "0";
|
53863
53837
|
}
|
53864
53838
|
return [nexTRow, childRowIndexPath];
|
@@ -53882,7 +53856,9 @@ const useTableRowCreation = (data, tableRef) => {
|
|
53882
53856
|
const [internalData, setInternalData] = React__default.useState(JSON.parse(JSON.stringify(data)));
|
53883
53857
|
const [activeRowIndexPath, setActiveRowIndexPath] = React__default.useState(void 0);
|
53884
53858
|
React__default.useEffect(() => {
|
53885
|
-
if (activeRowIndexPath
|
53859
|
+
if (activeRowIndexPath === void 0) {
|
53860
|
+
setInternalData(data);
|
53861
|
+
} else {
|
53886
53862
|
const currentRow = getByRowIndexPath(internalData, activeRowIndexPath);
|
53887
53863
|
const parentId = getParentRowIndexPath(activeRowIndexPath);
|
53888
53864
|
const [nexTRow, newRowIndexPath] = insertChildTableRow(JSON.parse(JSON.stringify(data)), parentId, currentRow);
|
@@ -53891,8 +53867,6 @@ const useTableRowCreation = (data, tableRef) => {
|
|
53891
53867
|
if (tableRef == null ? void 0 : tableRef.current) {
|
53892
53868
|
tableRef.current.instance.toggleRowEditing(currentRow == null ? void 0 : currentRow._createKey);
|
53893
53869
|
}
|
53894
|
-
} else {
|
53895
|
-
setInternalData(data);
|
53896
53870
|
}
|
53897
53871
|
}, [JSON.stringify(data)]);
|
53898
53872
|
const create = (rowIndexPath = void 0, values = {}) => {
|
@@ -53921,9 +53895,11 @@ function willRowMove(cell, change, rowIndex, localization) {
|
|
53921
53895
|
const { table } = cell.getContext();
|
53922
53896
|
if (willRowMoveAfterSearch(cell, change, table, localization)) {
|
53923
53897
|
return "search";
|
53924
|
-
}
|
53898
|
+
}
|
53899
|
+
if (willRowMoveAfterFilter(cell, change, localization)) {
|
53925
53900
|
return "filter";
|
53926
|
-
}
|
53901
|
+
}
|
53902
|
+
if (willRowMoveAfterSorting(cell, change, rowIndex)) {
|
53927
53903
|
return "sorting";
|
53928
53904
|
}
|
53929
53905
|
return void 0;
|
@@ -54005,7 +53981,7 @@ const shortcut = { key: "e", meta: true, shift: false };
|
|
54005
53981
|
function isTableScrolled(ref) {
|
54006
53982
|
var _a, _b, _c, _d;
|
54007
53983
|
if (ref.current) {
|
54008
|
-
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");
|
53984
|
+
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");
|
54009
53985
|
const hasVerticalScrollbar = ref.current.scrollHeight > ref.current.clientHeight;
|
54010
53986
|
return [hasVerticalScrollbar, height > ref.current.scrollHeight];
|
54011
53987
|
}
|
@@ -55376,7 +55352,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55376
55352
|
var _a;
|
55377
55353
|
const tableMeta = cell.getContext().table.options.meta;
|
55378
55354
|
const state2 = tableMeta.editing.getState();
|
55379
|
-
const changes = nextValue
|
55355
|
+
const changes = nextValue === void 0 ? { ...state2.changes.rows[cell.row.id] } : { ...state2.changes.rows[cell.row.id], [cell.column.id]: nextValue };
|
55380
55356
|
const original = cell.row.original;
|
55381
55357
|
if (!Object.keys(changes).length) {
|
55382
55358
|
return;
|
@@ -55531,7 +55507,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55531
55507
|
}
|
55532
55508
|
}
|
55533
55509
|
await handleSave(changeSet);
|
55534
|
-
|
55510
|
+
complete(rowId2, table, rowChanges);
|
55535
55511
|
setRowStatus(rowId2, "saved");
|
55536
55512
|
setTimeout(() => {
|
55537
55513
|
setRowStatus(rowId2, void 0);
|
@@ -55582,7 +55558,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55582
55558
|
await handleDiscard();
|
55583
55559
|
}
|
55584
55560
|
}
|
55585
|
-
|
55561
|
+
function complete(rowId, table, changes) {
|
55586
55562
|
const handleDiscard2 = async () => {
|
55587
55563
|
await discardChanges(rowId, table);
|
55588
55564
|
};
|
@@ -55623,7 +55599,7 @@ function usePendingChangesState(handleSave, handleChange, handleDiscard, rowIden
|
|
55623
55599
|
temporaryRows: state.temporaryRows
|
55624
55600
|
};
|
55625
55601
|
}
|
55626
|
-
function useTableEditing(isEnabled = false, defaultToggleEditing = false, handleSave, handleChange, handleCreate, handleDiscard, rowIdentityAccessor, validator, onEvent) {
|
55602
|
+
function useTableEditing(isEnabled = false, defaultToggleEditing = false, handleSave, handleChange, handleCreate, handleDiscard, rowIdentityAccessor, validator, showEditingActions = false, onEvent) {
|
55627
55603
|
const [isEditing, setEditing] = React__default.useState(defaultToggleEditing);
|
55628
55604
|
const [isDetailedMode, toggleDetailedMode] = React__default.useState(false);
|
55629
55605
|
const createRowButtonRef = React__default.useRef(null);
|
@@ -55700,6 +55676,7 @@ function useTableEditing(isEnabled = false, defaultToggleEditing = false, handle
|
|
55700
55676
|
isEnabled,
|
55701
55677
|
isEditing,
|
55702
55678
|
isDetailedMode,
|
55679
|
+
showEditingActions,
|
55703
55680
|
toggleDetailedMode: isEnabled ? toggleDetailedMode : () => void 0,
|
55704
55681
|
toggleEditing: isEnabled ? toggleEditing : () => void 0,
|
55705
55682
|
lastFocusedCellIndex,
|
@@ -55744,8 +55721,8 @@ function RowMoveIndicator(props) {
|
|
55744
55721
|
return /* @__PURE__ */ React__default.createElement(Tooltip$3, { placement: "bottom", title: description.replace("[COLUMN]", columnMeta.header) }, /* @__PURE__ */ React__default.createElement("span", { "data-row-move-indicator": true }, /* @__PURE__ */ React__default.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));
|
55745
55722
|
}
|
55746
55723
|
function getMessageFromReason(texts, reason) {
|
55747
|
-
let title
|
55748
|
-
let description
|
55724
|
+
let title;
|
55725
|
+
let description;
|
55749
55726
|
switch (reason) {
|
55750
55727
|
case "filter":
|
55751
55728
|
title = texts.table3.editing.rowIndicator.rowWillBeHidden;
|
@@ -55759,11 +55736,15 @@ function getMessageFromReason(texts, reason) {
|
|
55759
55736
|
title = texts.table3.editing.rowIndicator.rowWillMove;
|
55760
55737
|
description = texts.table3.editing.rowIndicator.rowWillMoveReasonSorting;
|
55761
55738
|
break;
|
55739
|
+
default:
|
55740
|
+
title = "";
|
55741
|
+
description = "";
|
55742
|
+
break;
|
55762
55743
|
}
|
55763
55744
|
return { title, description };
|
55764
55745
|
}
|
55765
55746
|
const Textarea = React.forwardRef(function Textarea2(props, ref) {
|
55766
|
-
const { defaultValue:
|
55747
|
+
const { defaultValue: _1, highlighted: _2, invalid: _3, onKeyDown, ...otherProps } = props;
|
55767
55748
|
const classNames = clsx(
|
55768
55749
|
getInputClasses(props),
|
55769
55750
|
"pt-[5px] pb-[7px] min-h-[75px] disabled:resize-none !leading-5",
|
@@ -56224,10 +56205,16 @@ function DiscardChangesConfirmationDialog(props) {
|
|
56224
56205
|
));
|
56225
56206
|
}
|
56226
56207
|
function Row(props) {
|
56227
|
-
const { row, index: index2, table } = props;
|
56208
|
+
const { row, index: index2, table, measureRow } = props;
|
56228
56209
|
const focusManager = useAugmentedFocusManager();
|
56229
56210
|
const tableMeta = table.options.meta;
|
56230
56211
|
const isActiveRow = tableMeta.rowActive.rowActiveIndex === index2;
|
56212
|
+
const rowRef = React__default.useRef(null);
|
56213
|
+
const hasErrors = tableMeta.editing.hasRowErrors(row.id);
|
56214
|
+
React__default.useLayoutEffect(() => {
|
56215
|
+
if (!measureRow || !rowRef.current) return;
|
56216
|
+
measureRow(rowRef.current.getBoundingClientRect().height);
|
56217
|
+
}, [hasErrors, measureRow, row.id]);
|
56231
56218
|
React__default.useEffect(() => {
|
56232
56219
|
if (tableMeta.editing.isEditing && isActiveRow && tableMeta.editing.lastFocusedCellIndex === void 0) {
|
56233
56220
|
const element = focusManager.focusFirst();
|
@@ -56246,7 +56233,7 @@ function Row(props) {
|
|
56246
56233
|
var _a;
|
56247
56234
|
if (tableMeta.editing.isEditing) {
|
56248
56235
|
const cellIndex = Number(((_a = event.target.closest("td")) == null ? void 0 : _a.getAttribute("data-cell-index")) ?? void 0);
|
56249
|
-
if (!isNaN(cellIndex)) {
|
56236
|
+
if (!Number.isNaN(cellIndex)) {
|
56250
56237
|
tableMeta.editing.setLastFocusedCellIndex(Number(cellIndex));
|
56251
56238
|
}
|
56252
56239
|
}
|
@@ -56279,12 +56266,12 @@ function Row(props) {
|
|
56279
56266
|
}
|
56280
56267
|
}
|
56281
56268
|
const attributes = {
|
56282
|
-
"data-row-editing-invalid": tableMeta.editing.hasRowErrors(row.id) ?
|
56269
|
+
"data-row-editing-invalid": tableMeta.editing.hasRowErrors(row.id) ? tableMeta.editing.hasRowErrorsShownInAlert(row.id) ? true : "unseen" : void 0,
|
56283
56270
|
"data-row-editing-status": rowStatus,
|
56284
56271
|
onFocus: handleFocus,
|
56285
56272
|
onKeyDown: handleKeyDown
|
56286
56273
|
};
|
56287
|
-
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(DisplayRow, { ...props, ...attributes }, rowStatus === "saving" || rowStatus === "saved" ? /* @__PURE__ */ React__default.createElement(SaveStatus, { rowId: row.id, table }) : null), /* @__PURE__ */ React__default.createElement(
|
56274
|
+
return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(DisplayRow, { ...props, ...attributes, ref: rowRef }, rowStatus === "saving" || rowStatus === "saved" ? /* @__PURE__ */ React__default.createElement(SaveStatus, { rowId: row.id, table }) : null), /* @__PURE__ */ React__default.createElement(
|
56288
56275
|
DiscardChangesConfirmationDialog,
|
56289
56276
|
{
|
56290
56277
|
open: showDiscardDialog,
|
@@ -56308,6 +56295,7 @@ function useTable3(props, ref) {
|
|
56308
56295
|
props.onEditingDiscard,
|
56309
56296
|
props.rowIdentityAccessor,
|
56310
56297
|
props.validator,
|
56298
|
+
props.showEditingActions,
|
56311
56299
|
props.onEvent
|
56312
56300
|
);
|
56313
56301
|
const data = React__default.useMemo(() => {
|
@@ -56319,44 +56307,48 @@ function useTable3(props, ref) {
|
|
56319
56307
|
const extendedProps = {
|
56320
56308
|
...props,
|
56321
56309
|
data,
|
56322
|
-
enableRowActions: editing.isEditing ? true : props.enableRowActions,
|
56323
|
-
//
|
56324
|
-
rowActions: editing.isEditing ? (props.rowActions ?? []).concat(
|
56325
|
-
|
56326
|
-
|
56327
|
-
|
56328
|
-
|
56329
|
-
|
56330
|
-
|
56331
|
-
|
56332
|
-
|
56310
|
+
enableRowActions: editing.isEditing && props.showEditingActions ? true : props.enableRowActions,
|
56311
|
+
// While editing, only show editing actions (and their menu) when showEditingActions is true
|
56312
|
+
rowActions: editing.isEditing ? (props.rowActions ?? []).concat(
|
56313
|
+
// Only add editing actions if showEditingActions is explicitly set to true
|
56314
|
+
props.showEditingActions === true ? [
|
56315
|
+
// Note: helpers includes internal rowId and table properties not in the public type, that is why "any" is used
|
56316
|
+
(_1, helpers) => /* @__PURE__ */ React__default.createElement(
|
56317
|
+
IconButton,
|
56318
|
+
{
|
56319
|
+
"aria-label": texts.table3.editing.actions.save,
|
56320
|
+
icon: "tick",
|
56321
|
+
disabled: !editing.hasChanges(helpers.rowId) || editing.hasRowErrors(helpers.rowId),
|
56322
|
+
onClick: async () => {
|
56323
|
+
await editing.saveChanges(helpers.table, helpers.rowId);
|
56324
|
+
}
|
56333
56325
|
}
|
56334
|
-
|
56335
|
-
|
56336
|
-
|
56337
|
-
|
56338
|
-
|
56339
|
-
|
56340
|
-
|
56341
|
-
|
56342
|
-
|
56343
|
-
|
56344
|
-
|
56345
|
-
|
56346
|
-
|
56347
|
-
|
56348
|
-
|
56349
|
-
|
56350
|
-
|
56351
|
-
|
56352
|
-
}
|
56326
|
+
),
|
56327
|
+
(_1, helpers) => /* @__PURE__ */ React__default.createElement(
|
56328
|
+
IconButton,
|
56329
|
+
{
|
56330
|
+
"aria-label": texts.table3.editing.actions.clear,
|
56331
|
+
icon: "close",
|
56332
|
+
disabled: !editing.hasChanges(helpers.rowId),
|
56333
|
+
dialog: (props2) => /* @__PURE__ */ React__default.createElement(
|
56334
|
+
DiscardChangesConfirmationDialog,
|
56335
|
+
{
|
56336
|
+
...props2,
|
56337
|
+
onDiscard: () => {
|
56338
|
+
editing.discardChanges(helpers.rowId, helpers.table);
|
56339
|
+
if (editing.temporaryRows.length) {
|
56340
|
+
requestAnimationFrame(() => {
|
56341
|
+
var _a;
|
56342
|
+
return (_a = editing.createRowButtonRef.current) == null ? void 0 : _a.focus();
|
56343
|
+
});
|
56344
|
+
}
|
56353
56345
|
}
|
56354
56346
|
}
|
56355
|
-
|
56356
|
-
|
56357
|
-
|
56358
|
-
|
56359
|
-
|
56347
|
+
)
|
56348
|
+
}
|
56349
|
+
)
|
56350
|
+
] : []
|
56351
|
+
) : props.rowActions
|
56360
56352
|
};
|
56361
56353
|
const meta = { editing };
|
56362
56354
|
const table = useTable$1(extendedProps, ref, RENDERERS, meta);
|
@@ -56386,7 +56378,7 @@ function useTable3(props, ref) {
|
|
56386
56378
|
if (table.ref.current) {
|
56387
56379
|
const instance = table.ref.current.instance;
|
56388
56380
|
if (table.meta.editing.isEnabled) {
|
56389
|
-
instance.editing.forceValidate = async () => table.meta.editing.forceValidate(table.instance);
|
56381
|
+
instance.editing.forceValidate = async () => await table.meta.editing.forceValidate(table.instance);
|
56390
56382
|
}
|
56391
56383
|
}
|
56392
56384
|
}, [table.meta.editing.forceValidate]);
|
@@ -56659,7 +56651,7 @@ const BaseTable3 = fixedForwardRef(function BaseTable32(props, ref) {
|
|
56659
56651
|
tableMeta: table3.meta,
|
56660
56652
|
tableRef: table3.ref
|
56661
56653
|
}
|
56662
|
-
),
|
56654
|
+
), isScrolled ? null : createWorkflow) : null
|
56663
56655
|
));
|
56664
56656
|
});
|
56665
56657
|
const Table3 = fixedForwardRef(function Table32(props, ref) {
|
@@ -63587,12 +63579,10 @@ const Tooltip$2 = ({
|
|
63587
63579
|
const skipButtonRef = React.useRef(null);
|
63588
63580
|
React.useEffect(() => {
|
63589
63581
|
const onWindowKeyDown = (event) => {
|
63590
|
-
if (!disableTourSkipOnEsc) {
|
63591
|
-
|
63592
|
-
|
63593
|
-
|
63594
|
-
return;
|
63595
|
-
}
|
63582
|
+
if (!disableTourSkipOnEsc && event.key === "Escape" && skipButtonRef.current !== null) {
|
63583
|
+
event.preventDefault();
|
63584
|
+
skipButtonRef.current.click();
|
63585
|
+
return;
|
63596
63586
|
}
|
63597
63587
|
};
|
63598
63588
|
window.addEventListener("keydown", onWindowKeyDown);
|
@@ -63649,20 +63639,14 @@ const Tour = (props) => {
|
|
63649
63639
|
[props.children]
|
63650
63640
|
);
|
63651
63641
|
const callback = (state) => {
|
63652
|
-
if (state.action === ACTIONS.SKIP && state.lifecycle === LIFECYCLE.COMPLETE) {
|
63653
|
-
|
63654
|
-
onClose(getStep(state.step.target));
|
63655
|
-
}
|
63642
|
+
if (onClose && state.action === ACTIONS.SKIP && state.lifecycle === LIFECYCLE.COMPLETE) {
|
63643
|
+
onClose(getStep(state.step.target));
|
63656
63644
|
}
|
63657
|
-
if (state.type === EVENTS.TOUR_END) {
|
63658
|
-
|
63659
|
-
onComplete();
|
63660
|
-
}
|
63645
|
+
if (onComplete && state.type === EVENTS.TOUR_END) {
|
63646
|
+
onComplete();
|
63661
63647
|
}
|
63662
|
-
if (state.lifecycle === LIFECYCLE.READY) {
|
63663
|
-
|
63664
|
-
onReady(getStep(state.step.target));
|
63665
|
-
}
|
63648
|
+
if (onReady && state.lifecycle === LIFECYCLE.READY) {
|
63649
|
+
onReady(getStep(state.step.target));
|
63666
63650
|
}
|
63667
63651
|
};
|
63668
63652
|
return /* @__PURE__ */ React.createElement(
|
@@ -87197,14 +87181,14 @@ function getAxisProps(axis, props, inverted = false) {
|
|
87197
87181
|
}
|
87198
87182
|
function stripCartesianProps(props) {
|
87199
87183
|
const {
|
87200
|
-
dataKey,
|
87201
|
-
showXAxis,
|
87202
|
-
showYAxis,
|
87203
|
-
xAxisScale,
|
87204
|
-
xAxisTickFormatter,
|
87205
|
-
yAxisScale,
|
87206
|
-
yAxisTickFormatter,
|
87207
|
-
yAxisWidth,
|
87184
|
+
dataKey: _1,
|
87185
|
+
showXAxis: _2,
|
87186
|
+
showYAxis: _3,
|
87187
|
+
xAxisScale: _4,
|
87188
|
+
xAxisTickFormatter: _5,
|
87189
|
+
yAxisScale: _6,
|
87190
|
+
yAxisTickFormatter: _7,
|
87191
|
+
yAxisWidth: _8,
|
87208
87192
|
...otherProps
|
87209
87193
|
} = props;
|
87210
87194
|
return otherProps;
|
@@ -87395,17 +87379,17 @@ const mapColor = (palette, prefix2 = "") => {
|
|
87395
87379
|
return Object.keys(palette).reduce((accum, color2) => {
|
87396
87380
|
if (color2 === "current") {
|
87397
87381
|
return accum;
|
87398
|
-
}
|
87382
|
+
}
|
87383
|
+
if (typeof palette[color2] === "string") {
|
87399
87384
|
return {
|
87400
87385
|
...accum,
|
87401
87386
|
[prefix2 ? color2 === "DEFAULT" ? prefix2 : `${prefix2}-${color2}` : color2]: palette[color2]
|
87402
87387
|
};
|
87403
|
-
} else {
|
87404
|
-
return {
|
87405
|
-
...accum,
|
87406
|
-
...mapColor(palette[color2], color2)
|
87407
|
-
};
|
87408
87388
|
}
|
87389
|
+
return {
|
87390
|
+
...accum,
|
87391
|
+
...mapColor(palette[color2], color2)
|
87392
|
+
};
|
87409
87393
|
}, {});
|
87410
87394
|
};
|
87411
87395
|
const colors = mapColor(THEME_COLORS);
|
@@ -87417,12 +87401,11 @@ const getInverseThemeColor = (hexCode) => {
|
|
87417
87401
|
if (shade) {
|
87418
87402
|
if (shade > 500) {
|
87419
87403
|
return getThemeColor(`${color2}-100`);
|
87420
|
-
} else {
|
87421
|
-
if (shade === 500 && (color2 === "red" || color2 === "blue" || color2 === "brown" || color2 === "purple" || color2 === "green")) {
|
87422
|
-
return "white";
|
87423
|
-
}
|
87424
|
-
return getThemeColor(`${color2}-900`);
|
87425
87404
|
}
|
87405
|
+
if (shade === 500 && (color2 === "red" || color2 === "blue" || color2 === "brown" || color2 === "purple" || color2 === "green")) {
|
87406
|
+
return "white";
|
87407
|
+
}
|
87408
|
+
return getThemeColor(`${color2}-900`);
|
87426
87409
|
}
|
87427
87410
|
return color2 === "black" ? "white" : "black";
|
87428
87411
|
};
|
@@ -87537,7 +87520,7 @@ function BarChart(props) {
|
|
87537
87520
|
children,
|
87538
87521
|
className: customClassName,
|
87539
87522
|
data,
|
87540
|
-
orientation,
|
87523
|
+
orientation: _1,
|
87541
87524
|
showLabels = false,
|
87542
87525
|
showLegend = false,
|
87543
87526
|
stacked = false,
|
@@ -87758,7 +87741,7 @@ const ActiveShape = (props) => {
|
|
87758
87741
|
endAngle,
|
87759
87742
|
innerRadius: outerRadius + 2,
|
87760
87743
|
outerRadius: outerRadius + HOVER_DONUT_WIDTH,
|
87761
|
-
fill: id2
|
87744
|
+
fill: id2 === void 0 ? getThemeColor("blue-500") : getThemeColor(pieColors[id2], "blue-500"),
|
87762
87745
|
opacity: 0.4
|
87763
87746
|
}
|
87764
87747
|
));
|
@@ -87815,7 +87798,7 @@ const LegacyDonutChart = function LegacyDonutChart2({ children, formatter, onCli
|
|
87815
87798
|
}, {});
|
87816
87799
|
const hoveredSegmentColor = getSegmentColor(hoveredItem);
|
87817
87800
|
const selectedSegmentColor = getSegmentColor(selectedItem);
|
87818
|
-
return hoveredItem.length
|
87801
|
+
return hoveredItem.length === 0 ? selectedSegmentColor : hoveredSegmentColor;
|
87819
87802
|
}, [hoveredItem, selectedItem]);
|
87820
87803
|
if (ref.current && !radius) {
|
87821
87804
|
return null;
|
@@ -88117,7 +88100,8 @@ const AgreementAvatar = React__default.forwardRef(function AgreementAvatar2(prop
|
|
88117
88100
|
const AgreementBadge = ({ agreement, ...props }) => {
|
88118
88101
|
if (agreement.isAdministrator) {
|
88119
88102
|
return /* @__PURE__ */ React__default.createElement(Badge2, { ...props, color: "blue", small: true }, "Admin");
|
88120
|
-
}
|
88103
|
+
}
|
88104
|
+
if (agreement.isDeveloper) {
|
88121
88105
|
return /* @__PURE__ */ React__default.createElement(Badge2, { ...props, color: "blue", small: true }, "Developer");
|
88122
88106
|
}
|
88123
88107
|
return null;
|
@@ -88505,7 +88489,7 @@ const Link3 = React__default.forwardRef(function Link23(props, ref) {
|
|
88505
88489
|
}
|
88506
88490
|
}
|
88507
88491
|
) : null,
|
88508
|
-
total
|
88492
|
+
total === void 0 ? null : /* @__PURE__ */ React__default.createElement(
|
88509
88493
|
Badge2,
|
88510
88494
|
{
|
88511
88495
|
className: clsx("flex-shrink-0 flex-grow-0 !font-normal", {
|
@@ -88514,7 +88498,7 @@ const Link3 = React__default.forwardRef(function Link23(props, ref) {
|
|
88514
88498
|
color: "transparent"
|
88515
88499
|
},
|
88516
88500
|
total
|
88517
|
-
)
|
88501
|
+
)
|
88518
88502
|
));
|
88519
88503
|
});
|
88520
88504
|
const Section = React__default.forwardRef(function Navigation22(props, ref) {
|
@@ -88596,7 +88580,10 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88596
88580
|
_lastUsedHiddenColumns.current = hiddenColumns;
|
88597
88581
|
let nextCache;
|
88598
88582
|
if (hasDataChanged || !direction) {
|
88599
|
-
nextCache = nextPages.reduce(
|
88583
|
+
nextCache = nextPages.reduce(
|
88584
|
+
(acc, p2) => ({ ...acc, [p2]: Array.from({ length: pageSize }).fill(void 0) }),
|
88585
|
+
{}
|
88586
|
+
);
|
88600
88587
|
} else {
|
88601
88588
|
nextCache = { ...currentData.cache };
|
88602
88589
|
}
|
@@ -88606,7 +88593,7 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88606
88593
|
} else if (direction === "backward" && currentData.rows.length >= DATASET_SIZE) {
|
88607
88594
|
delete nextCache[currentData.pages[currentData.pages.length - 1]];
|
88608
88595
|
}
|
88609
|
-
const rows = Object.values(nextCache).
|
88596
|
+
const rows = Object.values(nextCache).flat();
|
88610
88597
|
return {
|
88611
88598
|
cache: nextCache,
|
88612
88599
|
pages: nextPages,
|
@@ -88631,7 +88618,7 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88631
88618
|
const pages = [];
|
88632
88619
|
const cache = {};
|
88633
88620
|
const pageCount = Math.ceil(response.length / pageSize);
|
88634
|
-
Array.from(Array(pageCount).keys()).forEach((index2) => {
|
88621
|
+
Array.from(Array.from({ length: pageCount }).keys()).forEach((index2) => {
|
88635
88622
|
pages.push(index2);
|
88636
88623
|
const startIndex = index2 * pageSize;
|
88637
88624
|
cache[index2] = response.data.slice(startIndex, startIndex + pageSize);
|
@@ -88666,7 +88653,7 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88666
88653
|
(acc, p2, index22) => ({ ...acc, [p2]: responses[index22].data }),
|
88667
88654
|
{}
|
88668
88655
|
);
|
88669
|
-
const rows = Object.values(nextCache).
|
88656
|
+
const rows = Object.values(nextCache).flat();
|
88670
88657
|
setData({
|
88671
88658
|
cache: nextCache,
|
88672
88659
|
pages: nextPages,
|
@@ -88680,7 +88667,7 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88680
88667
|
}
|
88681
88668
|
}
|
88682
88669
|
const invalidate = async () => {
|
88683
|
-
return reloadCurrentPages(
|
88670
|
+
return await reloadCurrentPages(
|
88684
88671
|
getCurrentPage(data.pages),
|
88685
88672
|
_lastUsedSorting.current,
|
88686
88673
|
_lastUsedFilters.current,
|
@@ -88689,7 +88676,7 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88689
88676
|
);
|
88690
88677
|
};
|
88691
88678
|
const handleSort = async (sorting) => {
|
88692
|
-
return reloadCurrentPages(
|
88679
|
+
return await reloadCurrentPages(
|
88693
88680
|
getCurrentPage(data.pages),
|
88694
88681
|
sorting,
|
88695
88682
|
_lastUsedFilters.current,
|
@@ -88698,10 +88685,10 @@ function useTableDataLoader2(fetchPage, fetchAll, options = { pageSize: DEFAULT_
|
|
88698
88685
|
);
|
88699
88686
|
};
|
88700
88687
|
const handleFilter = async (filters, hiddenColumns) => {
|
88701
|
-
return loadPage(0, _lastUsedSorting.current, filters, hiddenColumns, _lastUsedSearch.current);
|
88688
|
+
return await loadPage(0, _lastUsedSorting.current, filters, hiddenColumns, _lastUsedSearch.current);
|
88702
88689
|
};
|
88703
88690
|
const handleSearch = async (search, hiddenColumns) => {
|
88704
|
-
return loadPage(0, _lastUsedSorting.current, _lastUsedFilters.current, hiddenColumns, search);
|
88691
|
+
return await loadPage(0, _lastUsedSorting.current, _lastUsedFilters.current, hiddenColumns, search);
|
88705
88692
|
};
|
88706
88693
|
return [
|
88707
88694
|
{
|
@@ -88730,7 +88717,8 @@ function getDirection(pageIndex, currentPages) {
|
|
88730
88717
|
if (currentPages.length) {
|
88731
88718
|
if (pageIndex === currentPages[currentPages.length - 1] + 1) {
|
88732
88719
|
return "forward";
|
88733
|
-
}
|
88720
|
+
}
|
88721
|
+
if (pageIndex === currentPages[0] - 1 || currentPages.length === 2 && currentPages[0] !== 0 && pageIndex === currentPages[0]) {
|
88734
88722
|
return "backward";
|
88735
88723
|
}
|
88736
88724
|
}
|
@@ -88764,7 +88752,7 @@ const useBoundaryOverflowDetection = (ref, dependencies = []) => {
|
|
88764
88752
|
const useOnClickOutside = (ref, callback) => {
|
88765
88753
|
React__default.useEffect(() => {
|
88766
88754
|
const listener = (event) => {
|
88767
|
-
const refs =
|
88755
|
+
const refs = Array.isArray(ref) ? ref : [ref];
|
88768
88756
|
if (refs.some((currentRef) => !currentRef.current || currentRef.current.contains(event.target))) {
|
88769
88757
|
return;
|
88770
88758
|
}
|