@helpwave/hightide 0.6.6 → 0.6.7
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/index.d.mts +215 -178
- package/dist/index.d.ts +215 -178
- package/dist/index.js +1653 -1544
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1707 -1602
- package/dist/index.mjs.map +1 -1
- package/dist/style/globals.css +36 -21
- package/dist/style/uncompiled/theme/components/table.css +14 -14
- package/dist/style/uncompiled/theme/components/tooltip.css +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6380,13 +6380,15 @@ __export(index_exports, {
|
|
|
6380
6380
|
TabPanel: () => TabPanel,
|
|
6381
6381
|
TabSwitcher: () => TabSwitcher,
|
|
6382
6382
|
TabView: () => TabView,
|
|
6383
|
+
Table: () => Table,
|
|
6383
6384
|
TableBody: () => TableBody,
|
|
6384
|
-
TableBodyContext: () => TableBodyContext,
|
|
6385
6385
|
TableCell: () => TableCell,
|
|
6386
6386
|
TableColumn: () => TableColumn,
|
|
6387
6387
|
TableColumnDefinitionContext: () => TableColumnDefinitionContext,
|
|
6388
|
-
|
|
6388
|
+
TableColumnSwitcher: () => TableColumnSwitcher,
|
|
6389
|
+
TableColumnSwitcherPopUp: () => TableColumnSwitcherPopUp,
|
|
6389
6390
|
TableContainerContext: () => TableContainerContext,
|
|
6391
|
+
TableDataContext: () => TableDataContext,
|
|
6390
6392
|
TableDisplay: () => TableDisplay,
|
|
6391
6393
|
TableFilter: () => TableFilter,
|
|
6392
6394
|
TableFilterButton: () => TableFilterButton,
|
|
@@ -6394,10 +6396,12 @@ __export(index_exports, {
|
|
|
6394
6396
|
TableFilterOperator: () => TableFilterOperator,
|
|
6395
6397
|
TableHeader: () => TableHeader,
|
|
6396
6398
|
TableHeaderContext: () => TableHeaderContext,
|
|
6397
|
-
|
|
6399
|
+
TablePageSizeSelect: () => TablePageSizeSelect,
|
|
6398
6400
|
TablePagination: () => TablePagination,
|
|
6401
|
+
TablePaginationMenu: () => TablePaginationMenu,
|
|
6399
6402
|
TableProvider: () => TableProvider,
|
|
6400
6403
|
TableSortButton: () => TableSortButton,
|
|
6404
|
+
TableWithSelection: () => TableWithSelection,
|
|
6401
6405
|
TableWithSelectionProvider: () => TableWithSelectionProvider,
|
|
6402
6406
|
TagIcon: () => TagIcon,
|
|
6403
6407
|
TagsFilter: () => TagsFilter,
|
|
@@ -6478,9 +6482,9 @@ __export(index_exports, {
|
|
|
6478
6482
|
useSearch: () => useSearch,
|
|
6479
6483
|
useSelectContext: () => useSelectContext,
|
|
6480
6484
|
useTabContext: () => useTabContext,
|
|
6481
|
-
useTableBodyContext: () => useTableBodyContext,
|
|
6482
6485
|
useTableColumnDefinitionContext: () => useTableColumnDefinitionContext,
|
|
6483
6486
|
useTableContainerContext: () => useTableContainerContext,
|
|
6487
|
+
useTableDataContext: () => useTableDataContext,
|
|
6484
6488
|
useTableHeaderContext: () => useTableHeaderContext,
|
|
6485
6489
|
useTheme: () => useTheme,
|
|
6486
6490
|
useTransitionState: () => useTransitionState,
|
|
@@ -7903,86 +7907,136 @@ function calculatePosition({
|
|
|
7903
7907
|
anchorRect,
|
|
7904
7908
|
options
|
|
7905
7909
|
}) {
|
|
7906
|
-
const { verticalAlignment, horizontalAlignment, gap, screenPadding } = options;
|
|
7907
|
-
const
|
|
7908
|
-
|
|
7909
|
-
|
|
7910
|
-
|
|
7911
|
-
|
|
7912
|
-
|
|
7913
|
-
|
|
7914
|
-
|
|
7915
|
-
|
|
7916
|
-
|
|
7917
|
-
|
|
7918
|
-
|
|
7919
|
-
|
|
7920
|
-
|
|
7921
|
-
|
|
7922
|
-
|
|
7923
|
-
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
|
|
7927
|
-
|
|
7928
|
-
|
|
7929
|
-
|
|
7930
|
-
|
|
7931
|
-
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
|
|
7935
|
-
|
|
7936
|
-
|
|
7937
|
-
|
|
7938
|
-
|
|
7939
|
-
|
|
7940
|
-
|
|
7941
|
-
|
|
7942
|
-
|
|
7943
|
-
|
|
7944
|
-
|
|
7945
|
-
|
|
7946
|
-
|
|
7947
|
-
|
|
7948
|
-
|
|
7949
|
-
|
|
7950
|
-
|
|
7951
|
-
|
|
7952
|
-
|
|
7953
|
-
|
|
7954
|
-
|
|
7955
|
-
|
|
7956
|
-
|
|
7957
|
-
|
|
7958
|
-
|
|
7959
|
-
|
|
7960
|
-
|
|
7961
|
-
|
|
7962
|
-
|
|
7963
|
-
|
|
7964
|
-
if (
|
|
7965
|
-
|
|
7966
|
-
|
|
7967
|
-
|
|
7910
|
+
const { verticalAlignment, horizontalAlignment, gap, screenPadding, avoidOverlap } = options;
|
|
7911
|
+
const calculateBasicPosition = (hAlign, vAlign) => {
|
|
7912
|
+
const windowWidth = windowRect.width;
|
|
7913
|
+
const windowHeight = windowRect.height;
|
|
7914
|
+
const maxWidth = windowWidth - 2 * screenPadding;
|
|
7915
|
+
const maxHeight = windowHeight - 2 * screenPadding;
|
|
7916
|
+
const width = Math.min(containerRect.width, maxWidth);
|
|
7917
|
+
const height = Math.min(containerRect.height, maxHeight);
|
|
7918
|
+
const anchorCenterX = anchorRect.left + anchorRect.width / 2;
|
|
7919
|
+
const anchorCenterY = anchorRect.top + anchorRect.height / 2;
|
|
7920
|
+
let left;
|
|
7921
|
+
let top;
|
|
7922
|
+
let translateXPercent;
|
|
7923
|
+
let translateYPercent;
|
|
7924
|
+
switch (hAlign) {
|
|
7925
|
+
case "beforeStart":
|
|
7926
|
+
left = anchorRect.left;
|
|
7927
|
+
translateXPercent = -100;
|
|
7928
|
+
break;
|
|
7929
|
+
case "afterStart":
|
|
7930
|
+
left = anchorRect.left;
|
|
7931
|
+
translateXPercent = 0;
|
|
7932
|
+
break;
|
|
7933
|
+
case "center":
|
|
7934
|
+
left = anchorCenterX;
|
|
7935
|
+
translateXPercent = -50;
|
|
7936
|
+
break;
|
|
7937
|
+
case "beforeEnd":
|
|
7938
|
+
left = anchorRect.right;
|
|
7939
|
+
translateXPercent = -100;
|
|
7940
|
+
break;
|
|
7941
|
+
case "afterEnd":
|
|
7942
|
+
left = anchorRect.right;
|
|
7943
|
+
translateXPercent = 0;
|
|
7944
|
+
break;
|
|
7945
|
+
}
|
|
7946
|
+
switch (vAlign) {
|
|
7947
|
+
case "beforeStart":
|
|
7948
|
+
top = anchorRect.top;
|
|
7949
|
+
translateYPercent = -100;
|
|
7950
|
+
break;
|
|
7951
|
+
case "afterStart":
|
|
7952
|
+
top = anchorRect.top;
|
|
7953
|
+
translateYPercent = 0;
|
|
7954
|
+
break;
|
|
7955
|
+
case "center":
|
|
7956
|
+
top = anchorCenterY;
|
|
7957
|
+
translateYPercent = -50;
|
|
7958
|
+
break;
|
|
7959
|
+
case "beforeEnd":
|
|
7960
|
+
top = anchorRect.bottom;
|
|
7961
|
+
translateYPercent = -100;
|
|
7962
|
+
break;
|
|
7963
|
+
case "afterEnd":
|
|
7964
|
+
top = anchorRect.bottom;
|
|
7965
|
+
translateYPercent = 0;
|
|
7966
|
+
break;
|
|
7967
|
+
}
|
|
7968
|
+
if (gap !== 0) {
|
|
7969
|
+
if (hAlign === "afterEnd") {
|
|
7970
|
+
left += gap;
|
|
7971
|
+
} else if (hAlign === "beforeStart") {
|
|
7972
|
+
left -= gap;
|
|
7973
|
+
}
|
|
7974
|
+
if (vAlign === "afterEnd") {
|
|
7975
|
+
top += gap;
|
|
7976
|
+
} else if (vAlign === "beforeStart") {
|
|
7977
|
+
top -= gap;
|
|
7978
|
+
}
|
|
7968
7979
|
}
|
|
7969
|
-
|
|
7970
|
-
|
|
7971
|
-
|
|
7972
|
-
|
|
7980
|
+
const targetLeft = left + width * translateXPercent / 100;
|
|
7981
|
+
const targetTop = top + height * translateYPercent / 100;
|
|
7982
|
+
const clampedLeft = MathUtil.clamp(targetLeft, [screenPadding, windowWidth - screenPadding - width]);
|
|
7983
|
+
const clampedTop = MathUtil.clamp(targetTop, [screenPadding, windowHeight - screenPadding - height]);
|
|
7984
|
+
return {
|
|
7985
|
+
left,
|
|
7986
|
+
top,
|
|
7987
|
+
clampedLeft,
|
|
7988
|
+
clampedTop,
|
|
7989
|
+
width,
|
|
7990
|
+
height,
|
|
7991
|
+
maxWidth,
|
|
7992
|
+
maxHeight
|
|
7993
|
+
};
|
|
7994
|
+
};
|
|
7995
|
+
const calculateOverlap = (left, top, width, height) => {
|
|
7996
|
+
const floatingRect = {
|
|
7997
|
+
left,
|
|
7998
|
+
top,
|
|
7999
|
+
right: left + width,
|
|
8000
|
+
bottom: top + height
|
|
8001
|
+
};
|
|
8002
|
+
const overlapLeft = Math.max(floatingRect.left, anchorRect.left);
|
|
8003
|
+
const overlapTop = Math.max(floatingRect.top, anchorRect.top);
|
|
8004
|
+
const overlapRight = Math.min(floatingRect.right, anchorRect.right);
|
|
8005
|
+
const overlapBottom = Math.min(floatingRect.bottom, anchorRect.bottom);
|
|
8006
|
+
const overlapWidth = Math.max(0, overlapRight - overlapLeft);
|
|
8007
|
+
const overlapHeight = Math.max(0, overlapBottom - overlapTop);
|
|
8008
|
+
return overlapWidth * overlapHeight;
|
|
8009
|
+
};
|
|
8010
|
+
const originalPos = calculateBasicPosition(horizontalAlignment, verticalAlignment);
|
|
8011
|
+
let bestPosition = originalPos;
|
|
8012
|
+
if (avoidOverlap && (horizontalAlignment === "beforeStart" || horizontalAlignment === "afterEnd" || verticalAlignment === "beforeStart" || verticalAlignment === "afterEnd")) {
|
|
8013
|
+
let bestOverlap = calculateOverlap(originalPos.clampedLeft, originalPos.clampedTop, originalPos.width, originalPos.height);
|
|
8014
|
+
let altHorizontalAlignment = horizontalAlignment;
|
|
8015
|
+
let altVerticalAlignment = verticalAlignment;
|
|
8016
|
+
if (horizontalAlignment === "beforeStart") {
|
|
8017
|
+
altHorizontalAlignment = "afterEnd";
|
|
8018
|
+
} else if (horizontalAlignment === "afterEnd") {
|
|
8019
|
+
altHorizontalAlignment = "beforeStart";
|
|
8020
|
+
}
|
|
8021
|
+
if (verticalAlignment === "beforeStart") {
|
|
8022
|
+
altVerticalAlignment = "afterEnd";
|
|
8023
|
+
} else if (verticalAlignment === "afterEnd") {
|
|
8024
|
+
altVerticalAlignment = "beforeStart";
|
|
8025
|
+
}
|
|
8026
|
+
const altPos = calculateBasicPosition(altHorizontalAlignment, altVerticalAlignment);
|
|
8027
|
+
const altOverlap = calculateOverlap(altPos.clampedLeft, altPos.clampedTop, altPos.width, altPos.height);
|
|
8028
|
+
if (altOverlap < bestOverlap) {
|
|
8029
|
+
bestPosition = altPos;
|
|
8030
|
+
bestOverlap = altOverlap;
|
|
7973
8031
|
}
|
|
7974
8032
|
}
|
|
7975
|
-
const
|
|
7976
|
-
const
|
|
7977
|
-
const clampedLeft = MathUtil.clamp(targetLeft, [screenPadding, windowWidth - screenPadding - width]);
|
|
7978
|
-
const clampedTop = MathUtil.clamp(targetTop, [screenPadding, windowHeight - screenPadding - height]);
|
|
7979
|
-
const adjustedTranslateX = (clampedLeft - left) / width * 100;
|
|
7980
|
-
const adjustedTranslateY = (clampedTop - top) / height * 100;
|
|
8033
|
+
const adjustedTranslateX = (bestPosition.clampedLeft - bestPosition.left) / bestPosition.width * 100;
|
|
8034
|
+
const adjustedTranslateY = (bestPosition.clampedTop - bestPosition.top) / bestPosition.height * 100;
|
|
7981
8035
|
return {
|
|
7982
|
-
left,
|
|
7983
|
-
top,
|
|
7984
|
-
maxWidth,
|
|
7985
|
-
maxHeight,
|
|
8036
|
+
left: bestPosition.left,
|
|
8037
|
+
top: bestPosition.top,
|
|
8038
|
+
maxWidth: bestPosition.maxWidth,
|
|
8039
|
+
maxHeight: bestPosition.maxHeight,
|
|
7986
8040
|
transform: `translate(${adjustedTranslateX}%, ${adjustedTranslateY}%)`,
|
|
7987
8041
|
transformOrigin: "top left"
|
|
7988
8042
|
};
|
|
@@ -7996,6 +8050,7 @@ function useAnchoredPosition({
|
|
|
7996
8050
|
pollingInterval = 100,
|
|
7997
8051
|
verticalAlignment = "afterEnd",
|
|
7998
8052
|
horizontalAlignment = "afterStart",
|
|
8053
|
+
avoidOverlap = false,
|
|
7999
8054
|
screenPadding = 16,
|
|
8000
8055
|
gap = 4
|
|
8001
8056
|
}) {
|
|
@@ -8004,8 +8059,9 @@ function useAnchoredPosition({
|
|
|
8004
8059
|
horizontalAlignment,
|
|
8005
8060
|
verticalAlignment,
|
|
8006
8061
|
screenPadding,
|
|
8007
|
-
gap
|
|
8008
|
-
|
|
8062
|
+
gap,
|
|
8063
|
+
avoidOverlap
|
|
8064
|
+
}), [horizontalAlignment, verticalAlignment, screenPadding, gap, avoidOverlap]);
|
|
8009
8065
|
const calculate2 = (0, import_react8.useCallback)(() => {
|
|
8010
8066
|
const containerRect = containerRef.current?.getBoundingClientRect();
|
|
8011
8067
|
if (!containerRect) {
|
|
@@ -8202,6 +8258,7 @@ var hightideTranslation = {
|
|
|
8202
8258
|
"cancel": `Abbrechen`,
|
|
8203
8259
|
"carousel": `Karussell`,
|
|
8204
8260
|
"change": `\xC4ndern`,
|
|
8261
|
+
"changeColumnDisplay": `Spaltenanzeige \xE4ndern`,
|
|
8205
8262
|
"chooseLanguage": `W\xE4hle deine bevorzugte Sprache`,
|
|
8206
8263
|
"chooseSlide": `W\xE4hle die angezeigte Slide aus`,
|
|
8207
8264
|
"chooseTheme": `W\xE4hle dein bevorzugtes Farbschema.`,
|
|
@@ -8241,6 +8298,7 @@ var hightideTranslation = {
|
|
|
8241
8298
|
"filterNonWhitespace": `Nicht leer`,
|
|
8242
8299
|
"filterNotUndefined": `Definiert`,
|
|
8243
8300
|
"filterUndefined": `Undefiniert`,
|
|
8301
|
+
"first": `Erste`,
|
|
8244
8302
|
"goodToSeeYou": `Sch\xF6n dich zu sehen`,
|
|
8245
8303
|
"greaterThan": `Gr\xF6\xDFer als`,
|
|
8246
8304
|
"greaterThanOrEqual": `Gr\xF6\xDFer oder gleich`,
|
|
@@ -8251,6 +8309,7 @@ var hightideTranslation = {
|
|
|
8251
8309
|
"isFalse": `Ist falsch`,
|
|
8252
8310
|
"isTrue": `Ist wahr`,
|
|
8253
8311
|
"language": `Sprache`,
|
|
8312
|
+
"last": `Letzte`,
|
|
8254
8313
|
"less": `Weniger`,
|
|
8255
8314
|
"lessThan": `Kleiner als`,
|
|
8256
8315
|
"lessThanOrEqual": `Kleiner oder gleich`,
|
|
@@ -8496,6 +8555,7 @@ var hightideTranslation = {
|
|
|
8496
8555
|
"cancel": `Cancel`,
|
|
8497
8556
|
"carousel": `Carousel`,
|
|
8498
8557
|
"change": `Change`,
|
|
8558
|
+
"changeColumnDisplay": `Change column display`,
|
|
8499
8559
|
"chooseLanguage": `Choose your language`,
|
|
8500
8560
|
"chooseSlide": `Choose slide to display`,
|
|
8501
8561
|
"chooseTheme": `Choose your preferred color theme.`,
|
|
@@ -8535,6 +8595,7 @@ var hightideTranslation = {
|
|
|
8535
8595
|
"filterNonWhitespace": `Non-whitespace`,
|
|
8536
8596
|
"filterNotUndefined": `Defined`,
|
|
8537
8597
|
"filterUndefined": `Undefined`,
|
|
8598
|
+
"first": `First`,
|
|
8538
8599
|
"goodToSeeYou": `Good to see you`,
|
|
8539
8600
|
"greaterThan": `Greater than`,
|
|
8540
8601
|
"greaterThanOrEqual": `Greater than or equal`,
|
|
@@ -8545,6 +8606,7 @@ var hightideTranslation = {
|
|
|
8545
8606
|
"isFalse": `Is false`,
|
|
8546
8607
|
"isTrue": `Is true`,
|
|
8547
8608
|
"language": `Language`,
|
|
8609
|
+
"last": `Last`,
|
|
8548
8610
|
"less": `Less`,
|
|
8549
8611
|
"lessThan": `Less than`,
|
|
8550
8612
|
"lessThanOrEqual": `Less than or equal`,
|
|
@@ -8799,7 +8861,8 @@ var import_react11 = require("react");
|
|
|
8799
8861
|
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
8800
8862
|
var defaultConfig = {
|
|
8801
8863
|
tooltip: {
|
|
8802
|
-
appearDelay:
|
|
8864
|
+
appearDelay: 0,
|
|
8865
|
+
isAnimated: false
|
|
8803
8866
|
},
|
|
8804
8867
|
theme: {
|
|
8805
8868
|
initialTheme: "light"
|
|
@@ -9663,9 +9726,9 @@ var useTransitionState = ({
|
|
|
9663
9726
|
const hasAnimation = (0, import_react17.useRef)(false);
|
|
9664
9727
|
const [timeout] = (0, import_react17.useState)(initialTimeout);
|
|
9665
9728
|
(0, import_react17.useEffect)(() => {
|
|
9666
|
-
if (isOpen && state !== "opened") {
|
|
9729
|
+
if (isOpen && (state !== "opened" && state !== "opening")) {
|
|
9667
9730
|
dispatch("open");
|
|
9668
|
-
} else if (!isOpen && state !== "closed") {
|
|
9731
|
+
} else if (!isOpen && (state !== "closed" && state !== "closing")) {
|
|
9669
9732
|
dispatch("close");
|
|
9670
9733
|
}
|
|
9671
9734
|
}, [isOpen, state]);
|
|
@@ -9697,6 +9760,8 @@ var useTransitionState = ({
|
|
|
9697
9760
|
});
|
|
9698
9761
|
} else {
|
|
9699
9762
|
dispatch("finished");
|
|
9763
|
+
hasAnimation.current = false;
|
|
9764
|
+
clearTimeout(timer.current);
|
|
9700
9765
|
}
|
|
9701
9766
|
}
|
|
9702
9767
|
}, [ref, state]);
|
|
@@ -12530,9 +12595,128 @@ var Navigation = ({ ...props }) => {
|
|
|
12530
12595
|
|
|
12531
12596
|
// src/components/layout/navigation/Pagination.tsx
|
|
12532
12597
|
var import_lucide_react11 = require("lucide-react");
|
|
12533
|
-
var
|
|
12598
|
+
var import_clsx22 = __toESM(require("clsx"));
|
|
12599
|
+
var import_react52 = require("react");
|
|
12600
|
+
|
|
12601
|
+
// src/components/user-interaction/Tooltip.tsx
|
|
12534
12602
|
var import_react49 = require("react");
|
|
12603
|
+
var import_react50 = require("react");
|
|
12604
|
+
var import_react51 = require("react");
|
|
12605
|
+
var import_clsx21 = require("clsx");
|
|
12535
12606
|
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
12607
|
+
var Tooltip = ({
|
|
12608
|
+
tooltip,
|
|
12609
|
+
children,
|
|
12610
|
+
appearDelay: appearOverwrite,
|
|
12611
|
+
isAnimated: isAnimatedOverwrite,
|
|
12612
|
+
tooltipClassName,
|
|
12613
|
+
containerClassName,
|
|
12614
|
+
position = "bottom",
|
|
12615
|
+
disabled = false
|
|
12616
|
+
}) => {
|
|
12617
|
+
const id = (0, import_react50.useId)();
|
|
12618
|
+
const [open, setOpen] = (0, import_react51.useState)(false);
|
|
12619
|
+
const timeoutRef = (0, import_react51.useRef)(void 0);
|
|
12620
|
+
const { config } = useHightideConfig();
|
|
12621
|
+
const appearDelay = (0, import_react51.useMemo)(
|
|
12622
|
+
() => appearOverwrite ?? config.tooltip.appearDelay,
|
|
12623
|
+
[appearOverwrite, config.tooltip.appearDelay]
|
|
12624
|
+
);
|
|
12625
|
+
const isAnimated = (0, import_react51.useMemo)(
|
|
12626
|
+
() => isAnimatedOverwrite ?? config.tooltip.isAnimated,
|
|
12627
|
+
[isAnimatedOverwrite, config.tooltip.isAnimated]
|
|
12628
|
+
);
|
|
12629
|
+
const anchor = (0, import_react51.useRef)(null);
|
|
12630
|
+
const container = (0, import_react51.useRef)(null);
|
|
12631
|
+
const isActive = !disabled && open;
|
|
12632
|
+
const { isVisible, transitionState } = useTransitionState(
|
|
12633
|
+
(0, import_react51.useMemo)(() => ({ isOpen: isActive, ref: container }), [isActive])
|
|
12634
|
+
);
|
|
12635
|
+
const verticalAlignment = (0, import_react51.useMemo)(
|
|
12636
|
+
() => position === "top" ? "beforeStart" : position === "bottom" ? "afterEnd" : "center",
|
|
12637
|
+
[position]
|
|
12638
|
+
);
|
|
12639
|
+
const horizontalAlignment = (0, import_react51.useMemo)(
|
|
12640
|
+
() => position === "left" ? "beforeStart" : position === "right" ? "afterEnd" : "center",
|
|
12641
|
+
[position]
|
|
12642
|
+
);
|
|
12643
|
+
const { zIndex } = useOverlayRegistry({ isActive });
|
|
12644
|
+
const openWithDelay = (0, import_react51.useCallback)(() => {
|
|
12645
|
+
if (timeoutRef.current || open) return;
|
|
12646
|
+
if (appearDelay < 0) {
|
|
12647
|
+
setOpen(true);
|
|
12648
|
+
return;
|
|
12649
|
+
}
|
|
12650
|
+
timeoutRef.current = setTimeout(() => {
|
|
12651
|
+
timeoutRef.current = void 0;
|
|
12652
|
+
setOpen(true);
|
|
12653
|
+
}, appearDelay);
|
|
12654
|
+
}, [appearDelay, open]);
|
|
12655
|
+
const close3 = (0, import_react51.useCallback)(() => {
|
|
12656
|
+
if (timeoutRef.current) {
|
|
12657
|
+
clearTimeout(timeoutRef.current);
|
|
12658
|
+
timeoutRef.current = void 0;
|
|
12659
|
+
}
|
|
12660
|
+
setOpen(false);
|
|
12661
|
+
}, []);
|
|
12662
|
+
(0, import_react49.useEffect)(() => {
|
|
12663
|
+
if (!open) return;
|
|
12664
|
+
const closeOnBlur = () => close3();
|
|
12665
|
+
const closeOnScroll = () => close3();
|
|
12666
|
+
window.addEventListener("blur", closeOnBlur);
|
|
12667
|
+
window.addEventListener("scroll", closeOnScroll, true);
|
|
12668
|
+
return () => {
|
|
12669
|
+
window.removeEventListener("blur", closeOnBlur);
|
|
12670
|
+
window.removeEventListener("scroll", closeOnScroll, true);
|
|
12671
|
+
};
|
|
12672
|
+
}, [open, close3]);
|
|
12673
|
+
(0, import_react49.useEffect)(() => {
|
|
12674
|
+
return () => {
|
|
12675
|
+
if (timeoutRef.current) {
|
|
12676
|
+
clearTimeout(timeoutRef.current);
|
|
12677
|
+
timeoutRef.current = void 0;
|
|
12678
|
+
}
|
|
12679
|
+
};
|
|
12680
|
+
}, []);
|
|
12681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12682
|
+
"div",
|
|
12683
|
+
{
|
|
12684
|
+
ref: anchor,
|
|
12685
|
+
className: (0, import_clsx21.clsx)("relative inline-block", containerClassName),
|
|
12686
|
+
"aria-describedby": isVisible ? id : void 0,
|
|
12687
|
+
onPointerEnter: openWithDelay,
|
|
12688
|
+
onPointerLeave: close3,
|
|
12689
|
+
onPointerCancel: close3,
|
|
12690
|
+
onFocus: openWithDelay,
|
|
12691
|
+
onBlur: close3,
|
|
12692
|
+
children: [
|
|
12693
|
+
children,
|
|
12694
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Visibility, { isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12695
|
+
AnchoredFloatingContainer,
|
|
12696
|
+
{
|
|
12697
|
+
ref: container,
|
|
12698
|
+
id,
|
|
12699
|
+
anchor,
|
|
12700
|
+
options: {
|
|
12701
|
+
verticalAlignment,
|
|
12702
|
+
horizontalAlignment,
|
|
12703
|
+
avoidOverlap: true
|
|
12704
|
+
},
|
|
12705
|
+
"data-state": transitionState,
|
|
12706
|
+
"data-animated": isAnimated ? "" : void 0,
|
|
12707
|
+
role: "tooltip",
|
|
12708
|
+
className: (0, import_clsx21.clsx)("tooltip", tooltipClassName),
|
|
12709
|
+
style: { zIndex, position: "fixed" },
|
|
12710
|
+
children: tooltip
|
|
12711
|
+
}
|
|
12712
|
+
) }) })
|
|
12713
|
+
]
|
|
12714
|
+
}
|
|
12715
|
+
);
|
|
12716
|
+
};
|
|
12717
|
+
|
|
12718
|
+
// src/components/layout/navigation/Pagination.tsx
|
|
12719
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
12536
12720
|
var Pagination = ({
|
|
12537
12721
|
pageIndex,
|
|
12538
12722
|
pageCount,
|
|
@@ -12541,11 +12725,11 @@ var Pagination = ({
|
|
|
12541
12725
|
style
|
|
12542
12726
|
}) => {
|
|
12543
12727
|
const translation = useHightideTranslation();
|
|
12544
|
-
const [value, setValue] = (0,
|
|
12728
|
+
const [value, setValue] = (0, import_react52.useState)((pageIndex + 1).toString());
|
|
12545
12729
|
const noPages = pageCount === 0;
|
|
12546
12730
|
const onFirstPage = pageIndex === 0 && !noPages;
|
|
12547
12731
|
const onLastPage = pageIndex === pageCount - 1;
|
|
12548
|
-
(0,
|
|
12732
|
+
(0, import_react52.useEffect)(() => {
|
|
12549
12733
|
if (noPages) {
|
|
12550
12734
|
setValue("0");
|
|
12551
12735
|
} else {
|
|
@@ -12555,8 +12739,8 @@ var Pagination = ({
|
|
|
12555
12739
|
const changePage = (page) => {
|
|
12556
12740
|
onPageIndexChanged(page);
|
|
12557
12741
|
};
|
|
12558
|
-
return /* @__PURE__ */ (0,
|
|
12559
|
-
/* @__PURE__ */ (0,
|
|
12742
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: (0, import_clsx22.default)("flex-row-1", className), style, children: [
|
|
12743
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Tooltip, { tooltip: translation("first"), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12560
12744
|
Button,
|
|
12561
12745
|
{
|
|
12562
12746
|
layout: "icon",
|
|
@@ -12564,10 +12748,10 @@ var Pagination = ({
|
|
|
12564
12748
|
color: "neutral",
|
|
12565
12749
|
onClick: () => changePage(0),
|
|
12566
12750
|
disabled: onFirstPage || noPages,
|
|
12567
|
-
children: /* @__PURE__ */ (0,
|
|
12751
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react11.ChevronFirst, {})
|
|
12568
12752
|
}
|
|
12569
|
-
),
|
|
12570
|
-
/* @__PURE__ */ (0,
|
|
12753
|
+
) }),
|
|
12754
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Tooltip, { tooltip: translation("previous"), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12571
12755
|
Button,
|
|
12572
12756
|
{
|
|
12573
12757
|
layout: "icon",
|
|
@@ -12575,15 +12759,15 @@ var Pagination = ({
|
|
|
12575
12759
|
color: "neutral",
|
|
12576
12760
|
onClick: () => changePage(pageIndex - 1),
|
|
12577
12761
|
disabled: onFirstPage || noPages,
|
|
12578
|
-
children: /* @__PURE__ */ (0,
|
|
12762
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react11.ChevronLeft, {})
|
|
12579
12763
|
}
|
|
12580
|
-
),
|
|
12581
|
-
/* @__PURE__ */ (0,
|
|
12582
|
-
/* @__PURE__ */ (0,
|
|
12764
|
+
) }),
|
|
12765
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)("div", { className: "flex-row-2 min-w-56 items-center justify-center mx-2 text-center", children: [
|
|
12766
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12583
12767
|
Input,
|
|
12584
12768
|
{
|
|
12585
12769
|
value,
|
|
12586
|
-
className: (0,
|
|
12770
|
+
className: (0, import_clsx22.default)(
|
|
12587
12771
|
"w-24 text-center font-bold input-indicator-hidden h-10"
|
|
12588
12772
|
),
|
|
12589
12773
|
type: "number",
|
|
@@ -12603,8 +12787,8 @@ var Pagination = ({
|
|
|
12603
12787
|
editCompleteOptions: { delay: 800 }
|
|
12604
12788
|
}
|
|
12605
12789
|
),
|
|
12606
|
-
/* @__PURE__ */ (0,
|
|
12607
|
-
/* @__PURE__ */ (0,
|
|
12790
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)("span", { className: "select-none w-10", children: translation("of") }),
|
|
12791
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12608
12792
|
"span",
|
|
12609
12793
|
{
|
|
12610
12794
|
className: "flex-row-2 w-24 items-center justify-center select-none h-10 bg-input-background text-input-text rounded-md font-bold",
|
|
@@ -12612,7 +12796,7 @@ var Pagination = ({
|
|
|
12612
12796
|
}
|
|
12613
12797
|
)
|
|
12614
12798
|
] }),
|
|
12615
|
-
/* @__PURE__ */ (0,
|
|
12799
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Tooltip, { tooltip: translation("next"), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12616
12800
|
Button,
|
|
12617
12801
|
{
|
|
12618
12802
|
layout: "icon",
|
|
@@ -12620,10 +12804,10 @@ var Pagination = ({
|
|
|
12620
12804
|
color: "neutral",
|
|
12621
12805
|
onClick: () => changePage(pageIndex + 1),
|
|
12622
12806
|
disabled: onLastPage || noPages,
|
|
12623
|
-
children: /* @__PURE__ */ (0,
|
|
12807
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react11.ChevronRight, {})
|
|
12624
12808
|
}
|
|
12625
|
-
),
|
|
12626
|
-
/* @__PURE__ */ (0,
|
|
12809
|
+
) }),
|
|
12810
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Tooltip, { tooltip: translation("last"), children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12627
12811
|
Button,
|
|
12628
12812
|
{
|
|
12629
12813
|
layout: "icon",
|
|
@@ -12631,16 +12815,16 @@ var Pagination = ({
|
|
|
12631
12815
|
color: "neutral",
|
|
12632
12816
|
onClick: () => changePage(pageCount - 1),
|
|
12633
12817
|
disabled: onLastPage || noPages,
|
|
12634
|
-
children: /* @__PURE__ */ (0,
|
|
12818
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react11.ChevronLast, {})
|
|
12635
12819
|
}
|
|
12636
|
-
)
|
|
12820
|
+
) })
|
|
12637
12821
|
] });
|
|
12638
12822
|
};
|
|
12639
12823
|
|
|
12640
12824
|
// src/components/layout/navigation/StepperBar.tsx
|
|
12641
12825
|
var import_lucide_react12 = require("lucide-react");
|
|
12642
|
-
var
|
|
12643
|
-
var
|
|
12826
|
+
var import_clsx23 = __toESM(require("clsx"));
|
|
12827
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
12644
12828
|
var defaultState = {
|
|
12645
12829
|
currentStep: 0,
|
|
12646
12830
|
seenSteps: /* @__PURE__ */ new Set([0])
|
|
@@ -12662,12 +12846,12 @@ var StepperBar = ({
|
|
|
12662
12846
|
seenSteps.add(newStep);
|
|
12663
12847
|
onChange({ currentStep: newStep, seenSteps });
|
|
12664
12848
|
};
|
|
12665
|
-
return /* @__PURE__ */ (0,
|
|
12849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
12666
12850
|
"div",
|
|
12667
12851
|
{
|
|
12668
|
-
className: (0,
|
|
12852
|
+
className: (0, import_clsx23.default)("flex-row-2 justify-between", className),
|
|
12669
12853
|
children: [
|
|
12670
|
-
/* @__PURE__ */ (0,
|
|
12854
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex-row-2 flex-[2] justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
12671
12855
|
Button,
|
|
12672
12856
|
{
|
|
12673
12857
|
disabled: currentStep === 0 || disabledSteps.has(currentStep),
|
|
@@ -12676,18 +12860,18 @@ var StepperBar = ({
|
|
|
12676
12860
|
},
|
|
12677
12861
|
className: "flex-row-1 items-center justify-center",
|
|
12678
12862
|
children: [
|
|
12679
|
-
/* @__PURE__ */ (0,
|
|
12863
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react12.ChevronLeft, { size: 14 }),
|
|
12680
12864
|
translation("back")
|
|
12681
12865
|
]
|
|
12682
12866
|
}
|
|
12683
12867
|
) }),
|
|
12684
|
-
/* @__PURE__ */ (0,
|
|
12868
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex-row-2 flex-[5] justify-center items-center", children: showDots && dots.map((value, index) => {
|
|
12685
12869
|
const seen = seenSteps.has(index);
|
|
12686
|
-
return /* @__PURE__ */ (0,
|
|
12870
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12687
12871
|
"div",
|
|
12688
12872
|
{
|
|
12689
12873
|
onClick: () => seen && update(index),
|
|
12690
|
-
className: (0,
|
|
12874
|
+
className: (0, import_clsx23.default)(
|
|
12691
12875
|
"rounded-full w-4 h-4",
|
|
12692
12876
|
{
|
|
12693
12877
|
"bg-stepperbar-dot-active hover:brightness-75": index === currentStep && seen && !disabledSteps.has(currentStep),
|
|
@@ -12703,7 +12887,7 @@ var StepperBar = ({
|
|
|
12703
12887
|
index
|
|
12704
12888
|
);
|
|
12705
12889
|
}) }),
|
|
12706
|
-
currentStep !== numberOfSteps && /* @__PURE__ */ (0,
|
|
12890
|
+
currentStep !== numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
12707
12891
|
Button,
|
|
12708
12892
|
{
|
|
12709
12893
|
onClick: () => update(currentStep + 1),
|
|
@@ -12711,18 +12895,18 @@ var StepperBar = ({
|
|
|
12711
12895
|
disabled: disabledSteps.has(currentStep),
|
|
12712
12896
|
children: [
|
|
12713
12897
|
translation("next"),
|
|
12714
|
-
/* @__PURE__ */ (0,
|
|
12898
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react12.ChevronRight, { size: 14 })
|
|
12715
12899
|
]
|
|
12716
12900
|
}
|
|
12717
12901
|
) }),
|
|
12718
|
-
currentStep === numberOfSteps && /* @__PURE__ */ (0,
|
|
12902
|
+
currentStep === numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
12719
12903
|
Button,
|
|
12720
12904
|
{
|
|
12721
12905
|
disabled: disabledSteps.has(currentStep),
|
|
12722
12906
|
onClick: onFinish,
|
|
12723
12907
|
className: "flex-row-1 items-center justify-center",
|
|
12724
12908
|
children: [
|
|
12725
|
-
/* @__PURE__ */ (0,
|
|
12909
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react12.Check, { size: 14 }),
|
|
12726
12910
|
finishText ?? translation("confirm")
|
|
12727
12911
|
]
|
|
12728
12912
|
}
|
|
@@ -12733,7 +12917,7 @@ var StepperBar = ({
|
|
|
12733
12917
|
};
|
|
12734
12918
|
var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
|
|
12735
12919
|
const [usedState, setUsedState] = useOverwritableState(state, onChange);
|
|
12736
|
-
return /* @__PURE__ */ (0,
|
|
12920
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12737
12921
|
StepperBar,
|
|
12738
12922
|
{
|
|
12739
12923
|
...props,
|
|
@@ -12744,17 +12928,17 @@ var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
|
|
|
12744
12928
|
};
|
|
12745
12929
|
|
|
12746
12930
|
// src/components/layout/popup/PopUpOpener.tsx
|
|
12747
|
-
var
|
|
12931
|
+
var import_react53 = require("react");
|
|
12748
12932
|
function PopUpOpener({ children }) {
|
|
12749
12933
|
const context = usePopUpContext();
|
|
12750
|
-
const ref = (0,
|
|
12751
|
-
(0,
|
|
12934
|
+
const ref = (0, import_react53.useRef)(null);
|
|
12935
|
+
(0, import_react53.useEffect)(() => {
|
|
12752
12936
|
context.setTriggerRef(ref);
|
|
12753
12937
|
return () => {
|
|
12754
12938
|
context.setTriggerRef(null);
|
|
12755
12939
|
};
|
|
12756
12940
|
}, []);
|
|
12757
|
-
const bag = (0,
|
|
12941
|
+
const bag = (0, import_react53.useMemo)(() => ({
|
|
12758
12942
|
open: () => context.setIsOpen(true),
|
|
12759
12943
|
close: () => context.setIsOpen(false),
|
|
12760
12944
|
toggleOpen: () => context.setIsOpen((prev) => !prev),
|
|
@@ -12772,8 +12956,8 @@ function PopUpOpener({ children }) {
|
|
|
12772
12956
|
}
|
|
12773
12957
|
|
|
12774
12958
|
// src/components/layout/popup/PopUpRoot.tsx
|
|
12775
|
-
var
|
|
12776
|
-
var
|
|
12959
|
+
var import_react54 = require("react");
|
|
12960
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
12777
12961
|
function PopUpRoot({
|
|
12778
12962
|
children,
|
|
12779
12963
|
isOpen: controlledIsOpen,
|
|
@@ -12782,17 +12966,17 @@ function PopUpRoot({
|
|
|
12782
12966
|
popUpId: popUpIdOverwrite,
|
|
12783
12967
|
triggerId: triggerIdOverwrite
|
|
12784
12968
|
}) {
|
|
12785
|
-
const generatedPopUpId = (0,
|
|
12786
|
-
const generatedTriggerId = (0,
|
|
12969
|
+
const generatedPopUpId = (0, import_react54.useId)();
|
|
12970
|
+
const generatedTriggerId = (0, import_react54.useId)();
|
|
12787
12971
|
const [isOpen, setIsOpen] = useControlledState({
|
|
12788
12972
|
value: controlledIsOpen,
|
|
12789
12973
|
onValueChange: onIsOpenChange,
|
|
12790
12974
|
defaultValue: initialIsOpen
|
|
12791
12975
|
});
|
|
12792
|
-
const [triggerRef, setTriggerRef] = (0,
|
|
12793
|
-
const popUpId = (0,
|
|
12794
|
-
const triggerId = (0,
|
|
12795
|
-
const contextValue = (0,
|
|
12976
|
+
const [triggerRef, setTriggerRef] = (0, import_react54.useState)(null);
|
|
12977
|
+
const popUpId = (0, import_react54.useMemo)(() => popUpIdOverwrite ?? `pop-up-${generatedPopUpId}`, [popUpIdOverwrite, generatedPopUpId]);
|
|
12978
|
+
const triggerId = (0, import_react54.useMemo)(() => triggerIdOverwrite ?? `pop-up-trigger-${generatedTriggerId}`, [triggerIdOverwrite, generatedTriggerId]);
|
|
12979
|
+
const contextValue = (0, import_react54.useMemo)(() => ({
|
|
12796
12980
|
isOpen,
|
|
12797
12981
|
setIsOpen,
|
|
12798
12982
|
popUpId,
|
|
@@ -12800,525 +12984,589 @@ function PopUpRoot({
|
|
|
12800
12984
|
triggerRef,
|
|
12801
12985
|
setTriggerRef
|
|
12802
12986
|
}), [isOpen, setIsOpen, popUpId, triggerId, triggerRef]);
|
|
12803
|
-
return /* @__PURE__ */ (0,
|
|
12987
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(PopUpContext.Provider, { value: contextValue, children });
|
|
12804
12988
|
}
|
|
12805
12989
|
|
|
12806
12990
|
// src/components/layout/table/FillerCell.tsx
|
|
12991
|
+
var import_clsx24 = __toESM(require("clsx"));
|
|
12807
12992
|
var import_lucide_react13 = require("lucide-react");
|
|
12808
|
-
var
|
|
12993
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
12809
12994
|
var FillerCell = ({ ...props }) => {
|
|
12810
|
-
return /* @__PURE__ */ (0,
|
|
12995
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12811
12996
|
"div",
|
|
12812
12997
|
{
|
|
12813
12998
|
...props,
|
|
12814
|
-
|
|
12815
|
-
children: /* @__PURE__ */ (0,
|
|
12999
|
+
className: (0, import_clsx24.default)("table-filler-cell", props.className),
|
|
13000
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react13.Minus, { className: "max-w-4 max-h-4" })
|
|
12816
13001
|
}
|
|
12817
13002
|
);
|
|
12818
13003
|
};
|
|
12819
13004
|
|
|
12820
|
-
// src/components/layout/table/
|
|
12821
|
-
var
|
|
12822
|
-
|
|
13005
|
+
// src/components/layout/table/TableProvider.tsx
|
|
13006
|
+
var import_react57 = require("react");
|
|
13007
|
+
|
|
13008
|
+
// src/components/layout/table/columnSizeUtil.ts
|
|
13009
|
+
var calculate = ({
|
|
13010
|
+
previousSizing,
|
|
13011
|
+
newSizing,
|
|
13012
|
+
columnIds,
|
|
13013
|
+
target,
|
|
13014
|
+
minWidthsPerColumn,
|
|
13015
|
+
maxWidthsPerColumn
|
|
13016
|
+
}) => {
|
|
13017
|
+
if (columnIds.length === 0) {
|
|
13018
|
+
return {};
|
|
13019
|
+
}
|
|
13020
|
+
const deltas = {};
|
|
13021
|
+
const removedColumns = Object.keys(newSizing).filter((columnId) => !columnIds.includes(columnId));
|
|
13022
|
+
for (const columnId of removedColumns) {
|
|
13023
|
+
delete newSizing[columnId];
|
|
13024
|
+
}
|
|
13025
|
+
for (const columnId of columnIds) {
|
|
13026
|
+
if (!newSizing[columnId]) {
|
|
13027
|
+
newSizing[columnId] = 0;
|
|
13028
|
+
continue;
|
|
13029
|
+
}
|
|
13030
|
+
const delta = (newSizing[columnId] ?? 0) - (previousSizing[columnId] ?? 0);
|
|
13031
|
+
if (delta !== 0) {
|
|
13032
|
+
deltas[columnId] = delta;
|
|
13033
|
+
}
|
|
13034
|
+
}
|
|
13035
|
+
const minWidth = Object.values(minWidthsPerColumn).reduce((previousValue, currentValue) => previousValue + currentValue, 0);
|
|
13036
|
+
const maxWidth = maxWidthsPerColumn ? Object.values(maxWidthsPerColumn).reduce((previousValue, currentValue) => previousValue + currentValue, 0) : Infinity;
|
|
13037
|
+
if (minWidth > maxWidth) {
|
|
13038
|
+
throw new Error("Min width is greater than max width");
|
|
13039
|
+
}
|
|
13040
|
+
const hasTargetWidth = target?.width !== void 0;
|
|
13041
|
+
const result = {
|
|
13042
|
+
...newSizing
|
|
13043
|
+
};
|
|
13044
|
+
for (const columnId of columnIds) {
|
|
13045
|
+
result[columnId] = MathUtil.clamp(result[columnId], [minWidthsPerColumn[columnId], maxWidthsPerColumn?.[columnId] ?? Infinity]);
|
|
13046
|
+
}
|
|
13047
|
+
if (!hasTargetWidth) {
|
|
13048
|
+
return result;
|
|
13049
|
+
}
|
|
13050
|
+
let targetWidth = target?.width ?? -1;
|
|
13051
|
+
if (hasTargetWidth) {
|
|
13052
|
+
switch (target?.behaviour) {
|
|
13053
|
+
case "equalOrHigher":
|
|
13054
|
+
targetWidth = Math.max(target.width, minWidth);
|
|
13055
|
+
break;
|
|
13056
|
+
}
|
|
13057
|
+
}
|
|
13058
|
+
const resultWidth = Object.values(result).reduce((previousValue, currentValue) => previousValue + currentValue, 0);
|
|
13059
|
+
if (resultWidth == targetWidth) {
|
|
13060
|
+
return result;
|
|
13061
|
+
} else if (resultWidth < targetWidth) {
|
|
13062
|
+
const widthToGive = targetWidth - resultWidth;
|
|
13063
|
+
const lastColumnId = columnIds[columnIds.length - 1];
|
|
13064
|
+
result[lastColumnId] += widthToGive;
|
|
13065
|
+
return result;
|
|
13066
|
+
} else {
|
|
13067
|
+
const widthToTake = resultWidth - targetWidth;
|
|
13068
|
+
const lastColumnId = columnIds[columnIds.length - 1];
|
|
13069
|
+
const isLastColumnChanging = Object.keys(deltas).find((columnId) => columnId === lastColumnId) !== void 0;
|
|
13070
|
+
if (isLastColumnChanging) {
|
|
13071
|
+
return result;
|
|
13072
|
+
} else {
|
|
13073
|
+
result[lastColumnId] -= Math.max(widthToTake, minWidthsPerColumn[lastColumnId]);
|
|
13074
|
+
return result;
|
|
13075
|
+
}
|
|
13076
|
+
}
|
|
13077
|
+
};
|
|
13078
|
+
var toSizeVars = (sizing) => {
|
|
13079
|
+
return Object.entries(sizing).reduce((previousValue, [columnId, size]) => {
|
|
13080
|
+
return {
|
|
13081
|
+
...previousValue,
|
|
13082
|
+
[`--header-${columnId}-size`]: size
|
|
13083
|
+
};
|
|
13084
|
+
}, {});
|
|
13085
|
+
};
|
|
13086
|
+
var ColumnSizeUtil = {
|
|
13087
|
+
calculate,
|
|
13088
|
+
toSizeVars
|
|
13089
|
+
};
|
|
12823
13090
|
|
|
12824
13091
|
// src/components/layout/table/TableContext.tsx
|
|
12825
|
-
var
|
|
12826
|
-
var
|
|
12827
|
-
var
|
|
12828
|
-
const context = (0,
|
|
12829
|
-
if (!context) throw new Error("
|
|
13092
|
+
var import_react55 = require("react");
|
|
13093
|
+
var TableDataContext = (0, import_react55.createContext)(null);
|
|
13094
|
+
var useTableDataContext = () => {
|
|
13095
|
+
const context = (0, import_react55.useContext)(TableDataContext);
|
|
13096
|
+
if (!context) throw new Error("useTableDataContext must be used within a <TableDataContext.Provider> like <TableData>");
|
|
12830
13097
|
return context;
|
|
12831
13098
|
};
|
|
12832
|
-
var TableColumnDefinitionContext = (0,
|
|
13099
|
+
var TableColumnDefinitionContext = (0, import_react55.createContext)(null);
|
|
12833
13100
|
var useTableColumnDefinitionContext = () => {
|
|
12834
|
-
const context = (0,
|
|
13101
|
+
const context = (0, import_react55.useContext)(TableColumnDefinitionContext);
|
|
12835
13102
|
if (!context) throw new Error("useTableColumnDefinitionContext must be used within a <TableColumnDefinitionContext.Provider> like <TableColumnDefinition>");
|
|
12836
13103
|
return context;
|
|
12837
13104
|
};
|
|
12838
|
-
var TableHeaderContext = (0,
|
|
13105
|
+
var TableHeaderContext = (0, import_react55.createContext)(null);
|
|
12839
13106
|
var useTableHeaderContext = () => {
|
|
12840
|
-
const context = (0,
|
|
13107
|
+
const context = (0, import_react55.useContext)(TableHeaderContext);
|
|
12841
13108
|
if (!context) throw new Error("useTableHeaderContext must be used within a <TableHeaderContext.Provider> like <TableHeader>");
|
|
12842
13109
|
return context;
|
|
12843
13110
|
};
|
|
12844
|
-
var TableContainerContext = (0,
|
|
13111
|
+
var TableContainerContext = (0, import_react55.createContext)(null);
|
|
12845
13112
|
var useTableContainerContext = () => {
|
|
12846
|
-
const context = (0,
|
|
13113
|
+
const context = (0, import_react55.useContext)(TableContainerContext);
|
|
12847
13114
|
if (!context) throw new Error("useTableContainerContext must be used within a <TableContainerContext.Provider> like <TableContainer>");
|
|
12848
13115
|
return context;
|
|
12849
13116
|
};
|
|
12850
13117
|
|
|
12851
|
-
// src/components/layout/table/
|
|
12852
|
-
var
|
|
12853
|
-
|
|
12854
|
-
|
|
12855
|
-
|
|
12856
|
-
|
|
12857
|
-
|
|
12858
|
-
|
|
12859
|
-
"tr",
|
|
12860
|
-
{
|
|
12861
|
-
onClick: () => onRowClick?.(row, table),
|
|
12862
|
-
"data-name": "table-body-row",
|
|
12863
|
-
className: BagFunctionUtil.resolve(table.options.meta?.bodyRowClassName, row.original),
|
|
12864
|
-
children: row.getVisibleCells().map((cell) => {
|
|
12865
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("td", { "data-name": "table-body-cell", children: (0, import_react_table.flexRender)(
|
|
12866
|
-
cell.column.columnDef.cell,
|
|
12867
|
-
cell.getContext()
|
|
12868
|
-
) }, cell.id);
|
|
12869
|
-
})
|
|
12870
|
-
},
|
|
12871
|
-
row.id
|
|
12872
|
-
);
|
|
12873
|
-
}),
|
|
12874
|
-
isUsingFillerRows && range(pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
|
|
12875
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("tr", { "data-name": "table-body-filler-row", children: columns.map((column) => {
|
|
12876
|
-
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("td", { "data-name": "table-body-filler-cell", children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(FillerCell, {}) }, column.id);
|
|
12877
|
-
}) }, "filler-row-" + index);
|
|
12878
|
-
})
|
|
12879
|
-
] });
|
|
12880
|
-
});
|
|
12881
|
-
var TableBody = TableBodyVisual;
|
|
12882
|
-
|
|
12883
|
-
// src/components/layout/table/TableCell.tsx
|
|
12884
|
-
var import_clsx23 = require("clsx");
|
|
12885
|
-
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
12886
|
-
var TableCell = ({
|
|
12887
|
-
children,
|
|
12888
|
-
className
|
|
12889
|
-
}) => {
|
|
12890
|
-
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: (0, import_clsx23.clsx)("block max-w-full overflow-ellipsis truncate", className), children });
|
|
12891
|
-
};
|
|
12892
|
-
|
|
12893
|
-
// src/components/layout/table/TableColumn.tsx
|
|
12894
|
-
var import_react54 = require("react");
|
|
12895
|
-
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
12896
|
-
var TableColumnComponent = ({
|
|
12897
|
-
filterType,
|
|
12898
|
-
...props
|
|
12899
|
-
}) => {
|
|
12900
|
-
const { registerColumn } = useTableColumnDefinitionContext();
|
|
12901
|
-
const filterFn = filterType ?? props.filterFn;
|
|
12902
|
-
useLogOnce(
|
|
12903
|
-
"TableColumn: For filterType === tags, filterData.tags must be set.",
|
|
12904
|
-
filterType === "tags" && props.meta?.filterData?.tags === void 0
|
|
12905
|
-
);
|
|
12906
|
-
const [column] = (0, import_react54.useState)({
|
|
12907
|
-
...props,
|
|
12908
|
-
filterFn
|
|
12909
|
-
});
|
|
12910
|
-
(0, import_react54.useEffect)(() => {
|
|
12911
|
-
const unsubscribe = registerColumn(column);
|
|
12912
|
-
return () => {
|
|
12913
|
-
unsubscribe();
|
|
12914
|
-
};
|
|
12915
|
-
}, [registerColumn, column]);
|
|
12916
|
-
return null;
|
|
13118
|
+
// src/components/layout/table/TableFilter.ts
|
|
13119
|
+
var TableFilterOperator = {
|
|
13120
|
+
text: ["textEquals", "textNotEquals", "textNotWhitespace", "textContains", "textNotContains", "textStartsWith", "textEndsWith"],
|
|
13121
|
+
number: ["numberEquals", "numberNotEquals", "numberGreaterThan", "numberGreaterThanOrEqual", "numberLessThan", "numberLessThanOrEqual", "numberBetween", "numberNotBetween"],
|
|
13122
|
+
date: ["dateEquals", "dateNotEquals", "dateGreaterThan", "dateGreaterThanOrEqual", "dateLessThan", "dateLessThanOrEqual", "dateBetween", "dateNotBetween"],
|
|
13123
|
+
boolean: ["booleanIsTrue", "booleanIsFalse"],
|
|
13124
|
+
tags: ["tagsEquals", "tagsNotEquals", "tagsContains", "tagsNotContains"],
|
|
13125
|
+
generic: ["undefined", "notUndefined"]
|
|
12917
13126
|
};
|
|
12918
|
-
|
|
12919
|
-
|
|
12920
|
-
|
|
12921
|
-
|
|
13127
|
+
function isTableFilterCategory(value) {
|
|
13128
|
+
return typeof value === "string" && value in TableFilterOperator;
|
|
13129
|
+
}
|
|
13130
|
+
var textFilter = (row, columnId, filterValue) => {
|
|
13131
|
+
const value = row.getValue(columnId);
|
|
13132
|
+
const parameter = filterValue.parameter;
|
|
13133
|
+
const operator = filterValue.operator;
|
|
13134
|
+
if (operator === "textNotWhitespace") {
|
|
13135
|
+
return value?.toString().trim().length > 0;
|
|
13136
|
+
}
|
|
13137
|
+
const searchText = (parameter.searchText ?? "").toLowerCase();
|
|
13138
|
+
const cellText = value?.toString().toLowerCase() ?? "";
|
|
13139
|
+
switch (operator) {
|
|
13140
|
+
case "textEquals":
|
|
13141
|
+
return cellText === searchText;
|
|
13142
|
+
case "textNotEquals":
|
|
13143
|
+
return cellText !== searchText;
|
|
13144
|
+
case "textContains":
|
|
13145
|
+
return cellText.includes(searchText);
|
|
13146
|
+
case "textNotContains":
|
|
13147
|
+
return !cellText.includes(searchText);
|
|
13148
|
+
case "textStartsWith":
|
|
13149
|
+
return cellText.startsWith(searchText);
|
|
13150
|
+
case "textEndsWith":
|
|
13151
|
+
return cellText.endsWith(searchText);
|
|
13152
|
+
case "undefined":
|
|
13153
|
+
return value === void 0 || value === null;
|
|
13154
|
+
case "notUndefined":
|
|
13155
|
+
return value !== void 0 && value !== null;
|
|
13156
|
+
default:
|
|
13157
|
+
return false;
|
|
12922
13158
|
}
|
|
12923
|
-
);
|
|
12924
|
-
var TableColumn = (props) => {
|
|
12925
|
-
const TableColumnComponent2 = (0, import_react54.useMemo)(() => TableColumnFactory(), []);
|
|
12926
|
-
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TableColumnComponent2, { ...props });
|
|
12927
13159
|
};
|
|
12928
|
-
|
|
12929
|
-
|
|
12930
|
-
|
|
12931
|
-
|
|
12932
|
-
|
|
12933
|
-
|
|
12934
|
-
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
|
|
12949
|
-
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
const column = columnMap.get(columnId);
|
|
12968
|
-
if (column) {
|
|
12969
|
-
unpinned.push(column);
|
|
12970
|
-
columnMap.delete(columnId);
|
|
12971
|
-
}
|
|
12972
|
-
}
|
|
12973
|
-
}
|
|
12974
|
-
for (const column of columnMap.values()) {
|
|
12975
|
-
const pinState = column.getIsPinned();
|
|
12976
|
-
if (pinState === "left") {
|
|
12977
|
-
leftPinned.push(column);
|
|
12978
|
-
} else if (pinState === "right") {
|
|
12979
|
-
rightPinned.push(column);
|
|
12980
|
-
} else {
|
|
12981
|
-
unpinned.push(column);
|
|
12982
|
-
}
|
|
12983
|
-
}
|
|
12984
|
-
} else {
|
|
12985
|
-
for (const column of allColumns) {
|
|
12986
|
-
const pinState = column.getIsPinned();
|
|
12987
|
-
if (pinState === "left") {
|
|
12988
|
-
leftPinned.push(column);
|
|
12989
|
-
} else if (pinState === "right") {
|
|
12990
|
-
rightPinned.push(column);
|
|
12991
|
-
} else {
|
|
12992
|
-
unpinned.push(column);
|
|
12993
|
-
}
|
|
12994
|
-
}
|
|
13160
|
+
var numberFilter = (row, columnId, filterValue) => {
|
|
13161
|
+
const value = row.getValue(columnId);
|
|
13162
|
+
const parameter = filterValue.parameter;
|
|
13163
|
+
const operator = filterValue.operator;
|
|
13164
|
+
switch (operator) {
|
|
13165
|
+
case "numberEquals":
|
|
13166
|
+
return value === parameter.compareValue;
|
|
13167
|
+
case "numberNotEquals":
|
|
13168
|
+
return value !== parameter.compareValue;
|
|
13169
|
+
case "numberGreaterThan":
|
|
13170
|
+
return value > (parameter.compareValue ?? 0);
|
|
13171
|
+
case "numberGreaterThanOrEqual":
|
|
13172
|
+
return value >= (parameter.compareValue ?? 0);
|
|
13173
|
+
case "numberLessThan":
|
|
13174
|
+
return value < (parameter.compareValue ?? 0);
|
|
13175
|
+
case "numberLessThanOrEqual":
|
|
13176
|
+
return value <= (parameter.compareValue ?? 0);
|
|
13177
|
+
case "numberBetween":
|
|
13178
|
+
return value >= (parameter.min ?? -Infinity) && value <= (parameter.max ?? Infinity);
|
|
13179
|
+
case "numberNotBetween":
|
|
13180
|
+
return value < (parameter.min ?? -Infinity) || value > (parameter.max ?? Infinity);
|
|
13181
|
+
case "undefined":
|
|
13182
|
+
return value === void 0 || value === null;
|
|
13183
|
+
case "notUndefined":
|
|
13184
|
+
return value !== void 0 && value !== null;
|
|
13185
|
+
default:
|
|
13186
|
+
return false;
|
|
13187
|
+
}
|
|
13188
|
+
};
|
|
13189
|
+
var dateFilter = (row, columnId, filterValue) => {
|
|
13190
|
+
const value = row.getValue(columnId);
|
|
13191
|
+
const parameter = filterValue.parameter;
|
|
13192
|
+
const operator = filterValue.operator;
|
|
13193
|
+
const parseDate = (dateValue) => {
|
|
13194
|
+
if (!dateValue) return null;
|
|
13195
|
+
if (dateValue instanceof Date) return dateValue;
|
|
13196
|
+
if (typeof dateValue === "string" || typeof dateValue === "number") {
|
|
13197
|
+
const parsed = new Date(dateValue);
|
|
13198
|
+
return isNaN(parsed.getTime()) ? null : parsed;
|
|
12995
13199
|
}
|
|
12996
|
-
return
|
|
12997
|
-
}, [table, columnOrder, columnPinning]);
|
|
12998
|
-
const moveColumn = (columnId, direction) => {
|
|
12999
|
-
const currentColumns = columns.map((col) => col.id);
|
|
13000
|
-
const currentIndex = currentColumns.indexOf(columnId);
|
|
13001
|
-
if (currentIndex === -1) return;
|
|
13002
|
-
const column = table.getColumn(columnId);
|
|
13003
|
-
if (!column) return;
|
|
13004
|
-
const isPinned = column.getIsPinned();
|
|
13005
|
-
if (isPinned) return;
|
|
13006
|
-
const newIndex = direction === "up" ? currentIndex - 1 : currentIndex + 1;
|
|
13007
|
-
if (newIndex < 0 || newIndex >= currentColumns.length) return;
|
|
13008
|
-
const targetColumn = table.getColumn(currentColumns[newIndex]);
|
|
13009
|
-
if (!targetColumn) return;
|
|
13010
|
-
const targetIsPinned = targetColumn.getIsPinned();
|
|
13011
|
-
if (targetIsPinned !== isPinned) return;
|
|
13012
|
-
const newOrder = [...currentColumns];
|
|
13013
|
-
const temp = newOrder[currentIndex];
|
|
13014
|
-
newOrder[currentIndex] = newOrder[newIndex];
|
|
13015
|
-
newOrder[newIndex] = temp;
|
|
13016
|
-
table.setColumnOrder(newOrder);
|
|
13017
|
-
};
|
|
13018
|
-
const toggleColumnVisibility = (columnId) => {
|
|
13019
|
-
const column = table.getColumn(columnId);
|
|
13020
|
-
column?.toggleVisibility();
|
|
13200
|
+
return null;
|
|
13021
13201
|
};
|
|
13022
|
-
const
|
|
13023
|
-
const
|
|
13024
|
-
|
|
13025
|
-
|
|
13202
|
+
const normalizeToDateOnly = (date2) => {
|
|
13203
|
+
const normalized = new Date(date2);
|
|
13204
|
+
normalized.setHours(0, 0, 0, 0);
|
|
13205
|
+
return normalized;
|
|
13026
13206
|
};
|
|
13027
|
-
const
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
const col = table.getColumn(id);
|
|
13036
|
-
return col && !col.getIsPinned();
|
|
13037
|
-
});
|
|
13038
|
-
if (pinState === "left") {
|
|
13039
|
-
const newOrder = [columnId, ...unpinnedColumns];
|
|
13040
|
-
table.setColumnOrder(newOrder);
|
|
13041
|
-
} else if (pinState === "right") {
|
|
13042
|
-
const newOrder = [...unpinnedColumns, columnId];
|
|
13043
|
-
table.setColumnOrder(newOrder);
|
|
13207
|
+
const date = parseDate(value);
|
|
13208
|
+
if (!date && !TableFilterOperator.generic.some((o) => o === operator)) return false;
|
|
13209
|
+
const normalizedDate = date ? normalizeToDateOnly(date) : null;
|
|
13210
|
+
switch (operator) {
|
|
13211
|
+
case "dateEquals": {
|
|
13212
|
+
const filterDate = parseDate(parameter.compareDate);
|
|
13213
|
+
if (!filterDate || !normalizedDate) return false;
|
|
13214
|
+
return normalizedDate.getTime() === normalizeToDateOnly(filterDate).getTime();
|
|
13044
13215
|
}
|
|
13045
|
-
|
|
13046
|
-
|
|
13047
|
-
|
|
13048
|
-
|
|
13049
|
-
if (typeof header === "string") {
|
|
13050
|
-
return header;
|
|
13216
|
+
case "dateNotEquals": {
|
|
13217
|
+
const filterDate = parseDate(parameter.compareDate);
|
|
13218
|
+
if (!filterDate || !normalizedDate) return false;
|
|
13219
|
+
return normalizedDate.getTime() !== normalizeToDateOnly(filterDate).getTime();
|
|
13051
13220
|
}
|
|
13052
|
-
|
|
13053
|
-
|
|
13221
|
+
case "dateGreaterThan": {
|
|
13222
|
+
const filterDate = parseDate(parameter.compareDate);
|
|
13223
|
+
if (!filterDate || !normalizedDate) return false;
|
|
13224
|
+
return normalizedDate > normalizeToDateOnly(filterDate);
|
|
13054
13225
|
}
|
|
13055
|
-
|
|
13056
|
-
|
|
13057
|
-
|
|
13058
|
-
|
|
13059
|
-
{
|
|
13060
|
-
...props,
|
|
13061
|
-
ref: containerRef,
|
|
13062
|
-
id: ids.popup,
|
|
13063
|
-
options: {
|
|
13064
|
-
verticalAlignment: "afterEnd",
|
|
13065
|
-
horizontalAlignment: "center",
|
|
13066
|
-
...props.options
|
|
13067
|
-
},
|
|
13068
|
-
role: "dialog",
|
|
13069
|
-
"aria-labelledby": ids.label,
|
|
13070
|
-
"aria-describedby": ids.label,
|
|
13071
|
-
className: "flex-col-1 p-2 items-start min-w-72",
|
|
13072
|
-
children: [
|
|
13073
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex-col-1", children: [
|
|
13074
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { id: ids.label, className: "typography-title-md font-semibold", children: translation("columnPicker") }),
|
|
13075
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "text-description typography-label-sm mb-2", children: translation("columnPickerDescription") })
|
|
13076
|
-
] }),
|
|
13077
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex-col-1 overflow-y-auto w-full", children: columns.map((column, index) => {
|
|
13078
|
-
const columnId = column.id;
|
|
13079
|
-
const isVisible = column.getIsVisible();
|
|
13080
|
-
const pinState = column.getIsPinned();
|
|
13081
|
-
const isPinned = column.getCanPin() && !!pinState;
|
|
13082
|
-
const prevColumn = index > 0 ? columns[index - 1] : null;
|
|
13083
|
-
const nextColumn = index < columns.length - 1 ? columns[index + 1] : null;
|
|
13084
|
-
const prevIsPinned = prevColumn?.getCanPin() && !!prevColumn.getIsPinned();
|
|
13085
|
-
const nextIsPinned = nextColumn?.getCanPin() && !!nextColumn.getIsPinned();
|
|
13086
|
-
const canMoveUp = index > 0 && !isPinned && !prevIsPinned;
|
|
13087
|
-
const canMoveDown = index < columns.length - 1 && !isPinned && !nextIsPinned;
|
|
13088
|
-
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex-row-2 items-center justify-between gap-2 w-full", children: [
|
|
13089
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex-row-2 gap-1", children: isPinned ? /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
13090
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13091
|
-
Button,
|
|
13092
|
-
{
|
|
13093
|
-
layout: "icon",
|
|
13094
|
-
size: "sm",
|
|
13095
|
-
color: "neutral",
|
|
13096
|
-
coloringStyle: "text",
|
|
13097
|
-
disabled: pinState === "left",
|
|
13098
|
-
onClick: () => pinColumn(columnId, "left"),
|
|
13099
|
-
"aria-label": translation("pinLeft"),
|
|
13100
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react14.ChevronLeft, { className: "size-4" })
|
|
13101
|
-
}
|
|
13102
|
-
),
|
|
13103
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13104
|
-
Button,
|
|
13105
|
-
{
|
|
13106
|
-
layout: "icon",
|
|
13107
|
-
size: "sm",
|
|
13108
|
-
color: "neutral",
|
|
13109
|
-
coloringStyle: "text",
|
|
13110
|
-
disabled: pinState === "right",
|
|
13111
|
-
onClick: () => pinColumn(columnId, "right"),
|
|
13112
|
-
"aria-label": translation("pinRight"),
|
|
13113
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react14.ChevronRight, { className: "size-4" })
|
|
13114
|
-
}
|
|
13115
|
-
)
|
|
13116
|
-
] }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
13117
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13118
|
-
Button,
|
|
13119
|
-
{
|
|
13120
|
-
layout: "icon",
|
|
13121
|
-
size: "sm",
|
|
13122
|
-
color: "neutral",
|
|
13123
|
-
coloringStyle: "text",
|
|
13124
|
-
disabled: !canMoveUp,
|
|
13125
|
-
onClick: () => moveColumn(columnId, "up"),
|
|
13126
|
-
"aria-label": translation("moveUp"),
|
|
13127
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react14.ChevronUp, { className: "size-4" })
|
|
13128
|
-
}
|
|
13129
|
-
),
|
|
13130
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13131
|
-
Button,
|
|
13132
|
-
{
|
|
13133
|
-
layout: "icon",
|
|
13134
|
-
size: "sm",
|
|
13135
|
-
color: "neutral",
|
|
13136
|
-
coloringStyle: "text",
|
|
13137
|
-
disabled: !canMoveDown,
|
|
13138
|
-
onClick: () => moveColumn(columnId, "down"),
|
|
13139
|
-
"aria-label": translation("moveDown"),
|
|
13140
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react14.ChevronDown, { className: "size-4" })
|
|
13141
|
-
}
|
|
13142
|
-
)
|
|
13143
|
-
] }) }),
|
|
13144
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "flex-1 typography-label-lg", children: getColumnHeader(columnId) }),
|
|
13145
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
|
|
13146
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13147
|
-
Button,
|
|
13148
|
-
{
|
|
13149
|
-
layout: "icon",
|
|
13150
|
-
size: "sm",
|
|
13151
|
-
color: "neutral",
|
|
13152
|
-
coloringStyle: "text",
|
|
13153
|
-
disabled: !column.getCanHide(),
|
|
13154
|
-
onClick: () => toggleColumnVisibility(columnId),
|
|
13155
|
-
"aria-label": isVisible ? translation("hideColumn") : translation("showColumn"),
|
|
13156
|
-
children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react14.Eye, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react14.EyeOff, { className: "size-4" })
|
|
13157
|
-
}
|
|
13158
|
-
),
|
|
13159
|
-
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13160
|
-
Button,
|
|
13161
|
-
{
|
|
13162
|
-
layout: "icon",
|
|
13163
|
-
size: "sm",
|
|
13164
|
-
color: "neutral",
|
|
13165
|
-
coloringStyle: "text",
|
|
13166
|
-
disabled: !column.getCanPin(),
|
|
13167
|
-
onClick: () => {
|
|
13168
|
-
if (isPinned) {
|
|
13169
|
-
unpinColumn(columnId);
|
|
13170
|
-
} else {
|
|
13171
|
-
pinColumn(columnId, "left");
|
|
13172
|
-
}
|
|
13173
|
-
},
|
|
13174
|
-
"aria-label": isPinned ? translation("unpin") : translation("pinLeft"),
|
|
13175
|
-
children: isPinned ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react14.PinOff, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react14.Pin, { className: "size-4" })
|
|
13176
|
-
}
|
|
13177
|
-
)
|
|
13178
|
-
] })
|
|
13179
|
-
] }, columnId);
|
|
13180
|
-
}) })
|
|
13181
|
-
]
|
|
13226
|
+
case "dateGreaterThanOrEqual": {
|
|
13227
|
+
const filterDate = parseDate(parameter.compareDate);
|
|
13228
|
+
if (!filterDate || !normalizedDate) return false;
|
|
13229
|
+
return normalizedDate >= normalizeToDateOnly(filterDate);
|
|
13182
13230
|
}
|
|
13183
|
-
|
|
13231
|
+
case "dateLessThan": {
|
|
13232
|
+
const filterDate = parseDate(parameter.compareDate);
|
|
13233
|
+
if (!filterDate || !normalizedDate) return false;
|
|
13234
|
+
return normalizedDate < normalizeToDateOnly(filterDate);
|
|
13235
|
+
}
|
|
13236
|
+
case "dateLessThanOrEqual": {
|
|
13237
|
+
const filterDate = parseDate(parameter.compareDate);
|
|
13238
|
+
if (!filterDate || !normalizedDate) return false;
|
|
13239
|
+
return normalizedDate <= normalizeToDateOnly(filterDate);
|
|
13240
|
+
}
|
|
13241
|
+
case "dateBetween": {
|
|
13242
|
+
const minDate = parseDate(parameter.min);
|
|
13243
|
+
const maxDate = parseDate(parameter.max);
|
|
13244
|
+
if (!minDate || !maxDate || !normalizedDate) return false;
|
|
13245
|
+
return normalizedDate >= normalizeToDateOnly(minDate) && normalizedDate <= normalizeToDateOnly(maxDate);
|
|
13246
|
+
}
|
|
13247
|
+
case "dateNotBetween": {
|
|
13248
|
+
const minDate = parseDate(parameter.min);
|
|
13249
|
+
const maxDate = parseDate(parameter.max);
|
|
13250
|
+
if (!minDate || !maxDate || !normalizedDate) return false;
|
|
13251
|
+
return normalizedDate < normalizeToDateOnly(minDate) || normalizedDate > normalizeToDateOnly(maxDate);
|
|
13252
|
+
}
|
|
13253
|
+
case "undefined":
|
|
13254
|
+
return value === void 0 || value === null;
|
|
13255
|
+
case "notUndefined":
|
|
13256
|
+
return value !== void 0 && value !== null;
|
|
13257
|
+
default:
|
|
13258
|
+
return false;
|
|
13259
|
+
}
|
|
13260
|
+
};
|
|
13261
|
+
var booleanFilter = (row, columnId, filterValue) => {
|
|
13262
|
+
const value = row.getValue(columnId);
|
|
13263
|
+
const operator = filterValue.operator;
|
|
13264
|
+
switch (operator) {
|
|
13265
|
+
case "booleanIsTrue":
|
|
13266
|
+
return value === true;
|
|
13267
|
+
case "booleanIsFalse":
|
|
13268
|
+
return value === false;
|
|
13269
|
+
case "undefined":
|
|
13270
|
+
return value === void 0 || value === null;
|
|
13271
|
+
case "notUndefined":
|
|
13272
|
+
return value !== void 0 && value !== null;
|
|
13273
|
+
default:
|
|
13274
|
+
return false;
|
|
13275
|
+
}
|
|
13276
|
+
};
|
|
13277
|
+
var tagsFilter = (row, columnId, filterValue) => {
|
|
13278
|
+
const value = row.getValue(columnId);
|
|
13279
|
+
const parameter = filterValue.parameter;
|
|
13280
|
+
const operator = filterValue.operator;
|
|
13281
|
+
switch (operator) {
|
|
13282
|
+
case "tagsEquals": {
|
|
13283
|
+
if (!Array.isArray(value) || !Array.isArray(parameter.searchTags)) return false;
|
|
13284
|
+
if (value.length !== parameter.searchTags.length) return false;
|
|
13285
|
+
const valueSet = new Set(value);
|
|
13286
|
+
const searchTagsSet = new Set(parameter.searchTags);
|
|
13287
|
+
if (valueSet.size !== searchTagsSet.size) return false;
|
|
13288
|
+
return Array.from(valueSet).every((tag) => searchTagsSet.has(tag));
|
|
13289
|
+
}
|
|
13290
|
+
case "tagsNotEquals": {
|
|
13291
|
+
if (!Array.isArray(value) || !Array.isArray(parameter.searchTags)) return true;
|
|
13292
|
+
if (value.length !== parameter.searchTags.length) return true;
|
|
13293
|
+
const valueSet = new Set(value);
|
|
13294
|
+
const searchTagsSet = new Set(parameter.searchTags);
|
|
13295
|
+
if (valueSet.size !== searchTagsSet.size) return true;
|
|
13296
|
+
return !Array.from(valueSet).every((tag) => searchTagsSet.has(tag));
|
|
13297
|
+
}
|
|
13298
|
+
case "tagsContains": {
|
|
13299
|
+
if (!Array.isArray(value) || !Array.isArray(parameter.searchTags)) return false;
|
|
13300
|
+
return parameter.searchTags.every((tag) => value.includes(tag));
|
|
13301
|
+
}
|
|
13302
|
+
case "tagsNotContains": {
|
|
13303
|
+
if (!Array.isArray(value) || !Array.isArray(parameter.searchTags)) return true;
|
|
13304
|
+
return !parameter.searchTags.every((tag) => value.includes(tag));
|
|
13305
|
+
}
|
|
13306
|
+
case "undefined":
|
|
13307
|
+
return value === void 0 || value === null;
|
|
13308
|
+
case "notUndefined":
|
|
13309
|
+
return value !== void 0 && value !== null;
|
|
13310
|
+
default:
|
|
13311
|
+
return false;
|
|
13312
|
+
}
|
|
13313
|
+
};
|
|
13314
|
+
var genericFilter = (row, columnId, filterValue) => {
|
|
13315
|
+
const value = row.getValue(columnId);
|
|
13316
|
+
const operator = filterValue.operator;
|
|
13317
|
+
switch (operator) {
|
|
13318
|
+
case "undefined":
|
|
13319
|
+
return value === void 0 || value === null;
|
|
13320
|
+
case "notUndefined":
|
|
13321
|
+
return value !== void 0 && value !== null;
|
|
13322
|
+
default:
|
|
13323
|
+
return false;
|
|
13324
|
+
}
|
|
13325
|
+
};
|
|
13326
|
+
var TableFilter = {
|
|
13327
|
+
text: textFilter,
|
|
13328
|
+
number: numberFilter,
|
|
13329
|
+
date: dateFilter,
|
|
13330
|
+
boolean: booleanFilter,
|
|
13331
|
+
tags: tagsFilter,
|
|
13332
|
+
generic: genericFilter
|
|
13184
13333
|
};
|
|
13185
13334
|
|
|
13186
|
-
// src/components/layout/table/
|
|
13187
|
-
var
|
|
13188
|
-
var import_clsx30 = __toESM(require("clsx"));
|
|
13189
|
-
|
|
13190
|
-
// src/components/layout/table/TableSortButton.tsx
|
|
13191
|
-
var import_lucide_react15 = require("lucide-react");
|
|
13192
|
-
var import_clsx25 = __toESM(require("clsx"));
|
|
13335
|
+
// src/components/layout/table/TableProvider.tsx
|
|
13336
|
+
var import_react_table = require("@tanstack/react-table");
|
|
13193
13337
|
|
|
13194
|
-
// src/
|
|
13338
|
+
// src/hooks/useResizeCallbackWrapper.ts
|
|
13195
13339
|
var import_react56 = require("react");
|
|
13196
|
-
var
|
|
13197
|
-
var import_react58 = require("react");
|
|
13198
|
-
var import_clsx24 = require("clsx");
|
|
13199
|
-
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
13200
|
-
var Tooltip = ({
|
|
13201
|
-
tooltip,
|
|
13202
|
-
children,
|
|
13203
|
-
appearDelay: appearOverwrite,
|
|
13204
|
-
tooltipClassName,
|
|
13205
|
-
containerClassName,
|
|
13206
|
-
position = "bottom",
|
|
13207
|
-
disabled = false
|
|
13208
|
-
}) => {
|
|
13209
|
-
const id = (0, import_react57.useId)();
|
|
13210
|
-
const [open, setOpen] = (0, import_react58.useState)(false);
|
|
13211
|
-
const timeoutRef = (0, import_react58.useRef)(void 0);
|
|
13212
|
-
const { config } = useHightideConfig();
|
|
13213
|
-
const appearDelay = (0, import_react58.useMemo)(
|
|
13214
|
-
() => appearOverwrite ?? config.tooltip.appearDelay,
|
|
13215
|
-
[appearOverwrite, config.tooltip.appearDelay]
|
|
13216
|
-
);
|
|
13217
|
-
const anchor = (0, import_react58.useRef)(null);
|
|
13218
|
-
const container = (0, import_react58.useRef)(null);
|
|
13219
|
-
const triangle = (0, import_react58.useRef)(null);
|
|
13220
|
-
const isActive = !disabled && open;
|
|
13221
|
-
const { isVisible, transitionState } = useTransitionState(
|
|
13222
|
-
(0, import_react58.useMemo)(() => ({ isOpen: isActive, ref: triangle }), [isActive])
|
|
13223
|
-
);
|
|
13224
|
-
const verticalAlignment = (0, import_react58.useMemo)(
|
|
13225
|
-
() => position === "top" ? "beforeStart" : position === "bottom" ? "afterEnd" : "center",
|
|
13226
|
-
[position]
|
|
13227
|
-
);
|
|
13228
|
-
const horizontalAlignment = (0, import_react58.useMemo)(
|
|
13229
|
-
() => position === "left" ? "beforeStart" : position === "right" ? "afterEnd" : "center",
|
|
13230
|
-
[position]
|
|
13231
|
-
);
|
|
13232
|
-
const { zIndex } = useOverlayRegistry({ isActive });
|
|
13233
|
-
const openWithDelay = (0, import_react58.useCallback)(() => {
|
|
13234
|
-
if (timeoutRef.current || open) return;
|
|
13235
|
-
timeoutRef.current = setTimeout(() => {
|
|
13236
|
-
timeoutRef.current = void 0;
|
|
13237
|
-
setOpen(true);
|
|
13238
|
-
}, appearDelay);
|
|
13239
|
-
}, [appearDelay, open]);
|
|
13240
|
-
const close3 = (0, import_react58.useCallback)(() => {
|
|
13241
|
-
if (timeoutRef.current) {
|
|
13242
|
-
clearTimeout(timeoutRef.current);
|
|
13243
|
-
timeoutRef.current = void 0;
|
|
13244
|
-
}
|
|
13245
|
-
setOpen(false);
|
|
13246
|
-
}, []);
|
|
13340
|
+
var useResizeCallbackWrapper = (callback) => {
|
|
13247
13341
|
(0, import_react56.useEffect)(() => {
|
|
13248
|
-
|
|
13249
|
-
const closeOnBlur = () => close3();
|
|
13250
|
-
const closeOnScroll = () => close3();
|
|
13251
|
-
window.addEventListener("blur", closeOnBlur);
|
|
13252
|
-
window.addEventListener("scroll", closeOnScroll, true);
|
|
13342
|
+
window.addEventListener("resize", callback);
|
|
13253
13343
|
return () => {
|
|
13254
|
-
window.removeEventListener("
|
|
13255
|
-
window.removeEventListener("scroll", closeOnScroll, true);
|
|
13344
|
+
window.removeEventListener("resize", callback);
|
|
13256
13345
|
};
|
|
13257
|
-
}, [
|
|
13258
|
-
|
|
13259
|
-
|
|
13260
|
-
|
|
13261
|
-
|
|
13262
|
-
|
|
13263
|
-
|
|
13346
|
+
}, [callback]);
|
|
13347
|
+
};
|
|
13348
|
+
|
|
13349
|
+
// src/components/layout/table/TableCell.tsx
|
|
13350
|
+
var import_clsx25 = require("clsx");
|
|
13351
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
13352
|
+
var TableCell = ({
|
|
13353
|
+
children,
|
|
13354
|
+
className
|
|
13355
|
+
}) => {
|
|
13356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: (0, import_clsx25.clsx)("table-default-cell", className), children });
|
|
13357
|
+
};
|
|
13358
|
+
|
|
13359
|
+
// src/components/layout/table/TableProvider.tsx
|
|
13360
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
13361
|
+
var TableProvider = ({
|
|
13362
|
+
data,
|
|
13363
|
+
isUsingFillerRows = true,
|
|
13364
|
+
fillerRow,
|
|
13365
|
+
initialState,
|
|
13366
|
+
onRowClick,
|
|
13367
|
+
defaultColumn: defaultColumnOverwrite,
|
|
13368
|
+
state,
|
|
13369
|
+
columns: columnsProp,
|
|
13370
|
+
children,
|
|
13371
|
+
...tableOptions
|
|
13372
|
+
}) => {
|
|
13373
|
+
const [registeredColumns, setRegisteredColumns] = (0, import_react57.useState)([]);
|
|
13374
|
+
const containerRef = (0, import_react57.useRef)(null);
|
|
13375
|
+
const registerColumn = (0, import_react57.useCallback)((column) => {
|
|
13376
|
+
setRegisteredColumns((prev) => {
|
|
13377
|
+
return [...prev, column];
|
|
13378
|
+
});
|
|
13379
|
+
return () => {
|
|
13380
|
+
setRegisteredColumns((prev) => {
|
|
13381
|
+
return prev.filter((value) => value.id !== column.id);
|
|
13382
|
+
});
|
|
13264
13383
|
};
|
|
13265
13384
|
}, []);
|
|
13266
|
-
|
|
13267
|
-
|
|
13268
|
-
{
|
|
13269
|
-
|
|
13270
|
-
className: (0, import_clsx24.clsx)("relative inline-block", containerClassName),
|
|
13271
|
-
"aria-describedby": isVisible ? id : void 0,
|
|
13272
|
-
onPointerEnter: openWithDelay,
|
|
13273
|
-
onPointerLeave: close3,
|
|
13274
|
-
onPointerCancel: close3,
|
|
13275
|
-
onFocus: openWithDelay,
|
|
13276
|
-
onBlur: close3,
|
|
13277
|
-
children: [
|
|
13278
|
-
children,
|
|
13279
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Visibility, { isVisible, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Portal, { children: [
|
|
13280
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13281
|
-
AnchoredFloatingContainer,
|
|
13282
|
-
{
|
|
13283
|
-
ref: triangle,
|
|
13284
|
-
anchor,
|
|
13285
|
-
options: {
|
|
13286
|
-
verticalAlignment,
|
|
13287
|
-
horizontalAlignment,
|
|
13288
|
-
gap: 0
|
|
13289
|
-
},
|
|
13290
|
-
"data-name": "tooltip-triangle",
|
|
13291
|
-
"data-state": transitionState,
|
|
13292
|
-
"data-position": position,
|
|
13293
|
-
style: { zIndex, position: "fixed" }
|
|
13294
|
-
}
|
|
13295
|
-
),
|
|
13296
|
-
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13297
|
-
AnchoredFloatingContainer,
|
|
13298
|
-
{
|
|
13299
|
-
ref: container,
|
|
13300
|
-
id,
|
|
13301
|
-
anchor,
|
|
13302
|
-
options: {
|
|
13303
|
-
verticalAlignment,
|
|
13304
|
-
horizontalAlignment
|
|
13305
|
-
},
|
|
13306
|
-
"data-name": PropsUtil.dataAttributes.name("tooltip"),
|
|
13307
|
-
"data-state": transitionState,
|
|
13308
|
-
role: "tooltip",
|
|
13309
|
-
className: tooltipClassName,
|
|
13310
|
-
style: { zIndex, position: "fixed" },
|
|
13311
|
-
children: tooltip
|
|
13312
|
-
}
|
|
13313
|
-
)
|
|
13314
|
-
] }) })
|
|
13315
|
-
]
|
|
13385
|
+
const columns = (0, import_react57.useMemo)(() => {
|
|
13386
|
+
const contextColumns = Array.from(registeredColumns.values());
|
|
13387
|
+
if (columnsProp) {
|
|
13388
|
+
return [...contextColumns, ...columnsProp];
|
|
13316
13389
|
}
|
|
13317
|
-
|
|
13390
|
+
return contextColumns;
|
|
13391
|
+
}, [columnsProp, registeredColumns]);
|
|
13392
|
+
const defaultColumn = (0, import_react57.useMemo)(() => {
|
|
13393
|
+
return {
|
|
13394
|
+
minSize: 60,
|
|
13395
|
+
maxSize: 800,
|
|
13396
|
+
cell: ({ cell }) => {
|
|
13397
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TableCell, { children: String(cell.getValue()) });
|
|
13398
|
+
},
|
|
13399
|
+
enableResizing: true,
|
|
13400
|
+
enablePinning: true,
|
|
13401
|
+
...defaultColumnOverwrite
|
|
13402
|
+
};
|
|
13403
|
+
}, [defaultColumnOverwrite]);
|
|
13404
|
+
const [columnSizing, setColumnSizing] = (0, import_react57.useState)(columns.reduce((previousValue, currentValue) => {
|
|
13405
|
+
return {
|
|
13406
|
+
...previousValue,
|
|
13407
|
+
[currentValue.id]: currentValue.size ?? defaultColumn.size ?? currentValue.minSize ?? defaultColumn.minSize
|
|
13408
|
+
};
|
|
13409
|
+
}, {}));
|
|
13410
|
+
const [columnOrder, setColumnOrder] = (0, import_react57.useState)(state?.columnOrder ?? initialState?.columnOrder ?? []);
|
|
13411
|
+
(0, import_react57.useEffect)(() => {
|
|
13412
|
+
setColumnOrder((prev) => {
|
|
13413
|
+
const columnIds = columns.map((column) => column.id);
|
|
13414
|
+
const newColumnIds = columnIds.filter((columnId) => !prev.includes(columnId));
|
|
13415
|
+
const withoutRemovedColumns = prev.filter((columnId) => !columnIds.includes(columnId));
|
|
13416
|
+
return [...withoutRemovedColumns, ...newColumnIds];
|
|
13417
|
+
});
|
|
13418
|
+
}, [columns]);
|
|
13419
|
+
const adjustColumnSizes = (0, import_react57.useCallback)((previousSizing, newSizing) => {
|
|
13420
|
+
return ColumnSizeUtil.calculate({
|
|
13421
|
+
previousSizing,
|
|
13422
|
+
newSizing,
|
|
13423
|
+
minWidthsPerColumn: columns.reduce((previousValue, currentValue) => {
|
|
13424
|
+
return {
|
|
13425
|
+
...previousValue,
|
|
13426
|
+
[currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
|
|
13427
|
+
};
|
|
13428
|
+
}, {}),
|
|
13429
|
+
maxWidthsPerColumn: columns.reduce((previousValue, currentValue) => {
|
|
13430
|
+
return {
|
|
13431
|
+
...previousValue,
|
|
13432
|
+
[currentValue.id]: currentValue.maxSize ?? defaultColumn.maxSize
|
|
13433
|
+
};
|
|
13434
|
+
}, {}),
|
|
13435
|
+
columnIds: columns.map((column) => column.id),
|
|
13436
|
+
target: {
|
|
13437
|
+
width: Math.floor(containerRef.current?.getBoundingClientRect().width ?? 0),
|
|
13438
|
+
behaviour: "equalOrHigher"
|
|
13439
|
+
}
|
|
13440
|
+
});
|
|
13441
|
+
}, [columns, defaultColumn.maxSize, defaultColumn.minSize]);
|
|
13442
|
+
(0, import_react57.useEffect)(() => {
|
|
13443
|
+
setColumnSizing((prev) => adjustColumnSizes(prev, prev));
|
|
13444
|
+
}, [adjustColumnSizes, columns, defaultColumn.maxSize, defaultColumn.minSize]);
|
|
13445
|
+
useResizeCallbackWrapper((0, import_react57.useCallback)(() => {
|
|
13446
|
+
setColumnSizing((prev) => adjustColumnSizes(prev, prev));
|
|
13447
|
+
}, [adjustColumnSizes]));
|
|
13448
|
+
const table = (0, import_react_table.useReactTable)({
|
|
13449
|
+
data,
|
|
13450
|
+
getCoreRowModel: (0, import_react_table.getCoreRowModel)(),
|
|
13451
|
+
getFilteredRowModel: (0, import_react_table.getFilteredRowModel)(),
|
|
13452
|
+
getSortedRowModel: (0, import_react_table.getSortedRowModel)(),
|
|
13453
|
+
getPaginationRowModel: (0, import_react_table.getPaginationRowModel)(),
|
|
13454
|
+
initialState,
|
|
13455
|
+
defaultColumn,
|
|
13456
|
+
columns,
|
|
13457
|
+
state: {
|
|
13458
|
+
...state,
|
|
13459
|
+
columnSizing,
|
|
13460
|
+
columnOrder
|
|
13461
|
+
},
|
|
13462
|
+
filterFns: {
|
|
13463
|
+
...tableOptions?.filterFns,
|
|
13464
|
+
text: TableFilter.text,
|
|
13465
|
+
number: TableFilter.number,
|
|
13466
|
+
date: TableFilter.date,
|
|
13467
|
+
boolean: TableFilter.boolean,
|
|
13468
|
+
tags: TableFilter.tags,
|
|
13469
|
+
generic: TableFilter.generic
|
|
13470
|
+
},
|
|
13471
|
+
onColumnSizingChange: (updaterOrValue) => {
|
|
13472
|
+
setColumnSizing((previous) => {
|
|
13473
|
+
const newSizing = typeof updaterOrValue === "function" ? updaterOrValue(previous) : updaterOrValue;
|
|
13474
|
+
return adjustColumnSizes(previous, newSizing);
|
|
13475
|
+
});
|
|
13476
|
+
},
|
|
13477
|
+
onColumnOrderChange: (updaterOrValue) => {
|
|
13478
|
+
setColumnOrder(updaterOrValue);
|
|
13479
|
+
if (tableOptions.onColumnOrderChange) {
|
|
13480
|
+
tableOptions.onColumnOrderChange(updaterOrValue);
|
|
13481
|
+
}
|
|
13482
|
+
},
|
|
13483
|
+
autoResetPageIndex: false,
|
|
13484
|
+
enableColumnResizing: true,
|
|
13485
|
+
columnResizeMode: "onChange",
|
|
13486
|
+
...tableOptions
|
|
13487
|
+
});
|
|
13488
|
+
const columnSizeVars = (0, import_react57.useMemo)(() => {
|
|
13489
|
+
return ColumnSizeUtil.toSizeVars(columnSizing);
|
|
13490
|
+
}, [columnSizing]);
|
|
13491
|
+
const pagination = table.getState().pagination;
|
|
13492
|
+
const rowSelection = table.getState().rowSelection;
|
|
13493
|
+
const rows = table.getRowModel().rows;
|
|
13494
|
+
const columnFilters = table.getState().columnFilters;
|
|
13495
|
+
const columnVisibility = table.getState().columnVisibility;
|
|
13496
|
+
const columnPinning = table.getState().columnPinning;
|
|
13497
|
+
const columnSorting = table.getState().sorting;
|
|
13498
|
+
const tableDataContextValue = (0, import_react57.useMemo)(() => ({
|
|
13499
|
+
table,
|
|
13500
|
+
columns,
|
|
13501
|
+
data,
|
|
13502
|
+
pagination,
|
|
13503
|
+
rowSelection,
|
|
13504
|
+
isUsingFillerRows,
|
|
13505
|
+
fillerRow,
|
|
13506
|
+
onRowClick,
|
|
13507
|
+
rows,
|
|
13508
|
+
columnOrder,
|
|
13509
|
+
columnFilters,
|
|
13510
|
+
columnVisibility,
|
|
13511
|
+
columnPinning,
|
|
13512
|
+
columnSorting
|
|
13513
|
+
}), [table, data, pagination, rowSelection, isUsingFillerRows, fillerRow, onRowClick, columns, rows, columnOrder, columnFilters, columnVisibility, columnPinning, columnSorting]);
|
|
13514
|
+
const tableColumnDefinitionContextValue = (0, import_react57.useMemo)(() => ({
|
|
13515
|
+
table,
|
|
13516
|
+
registerColumn
|
|
13517
|
+
}), [table, registerColumn]);
|
|
13518
|
+
const tableHeaderContextValue = (0, import_react57.useMemo)(() => ({
|
|
13519
|
+
table,
|
|
13520
|
+
sizeVars: columnSizeVars
|
|
13521
|
+
}), [table, columnSizeVars]);
|
|
13522
|
+
const tableContainerContextValue = (0, import_react57.useMemo)(() => ({
|
|
13523
|
+
table,
|
|
13524
|
+
containerRef
|
|
13525
|
+
}), [table, containerRef]);
|
|
13526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TableDataContext.Provider, { value: tableDataContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TableColumnDefinitionContext.Provider, { value: tableColumnDefinitionContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TableHeaderContext.Provider, { value: tableHeaderContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TableContainerContext.Provider, { value: tableContainerContextValue, children }) }) }) });
|
|
13318
13527
|
};
|
|
13319
13528
|
|
|
13529
|
+
// src/components/layout/table/TableBody.tsx
|
|
13530
|
+
var import_react_table2 = require("@tanstack/react-table");
|
|
13531
|
+
var import_react58 = __toESM(require("react"));
|
|
13532
|
+
var import_clsx26 = __toESM(require("clsx"));
|
|
13533
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
13534
|
+
var TableBody = import_react58.default.memo(function TableBodyVisual() {
|
|
13535
|
+
const { table, onRowClick, isUsingFillerRows, fillerRow, pagination, rows } = useTableDataContext();
|
|
13536
|
+
const columns = table.getAllColumns();
|
|
13537
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("tbody", { children: [
|
|
13538
|
+
rows.map((row) => {
|
|
13539
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13540
|
+
"tr",
|
|
13541
|
+
{
|
|
13542
|
+
onClick: () => onRowClick?.(row, table),
|
|
13543
|
+
className: (0, import_clsx26.default)("table-body-row", BagFunctionUtil.resolve(table.options.meta?.bodyRowClassName, row.original)),
|
|
13544
|
+
children: row.getVisibleCells().map((cell) => {
|
|
13545
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("td", { className: (0, import_clsx26.default)("table-body-cell", cell.column.columnDef.meta?.className), children: (0, import_react_table2.flexRender)(
|
|
13546
|
+
cell.column.columnDef.cell,
|
|
13547
|
+
cell.getContext()
|
|
13548
|
+
) }, cell.id);
|
|
13549
|
+
})
|
|
13550
|
+
},
|
|
13551
|
+
row.id
|
|
13552
|
+
);
|
|
13553
|
+
}),
|
|
13554
|
+
isUsingFillerRows && range(pagination.pageSize - rows.length, { allowEmptyRange: true }).map((row, index) => {
|
|
13555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("tr", { className: (0, import_clsx26.default)("table-body-filler-row"), children: columns.map((column) => {
|
|
13556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("td", { className: (0, import_clsx26.default)("table-body-filler-cell", column.columnDef.meta?.className), children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(FillerCell, {}) }, column.id);
|
|
13557
|
+
}) }, "filler-row-" + index);
|
|
13558
|
+
})
|
|
13559
|
+
] });
|
|
13560
|
+
});
|
|
13561
|
+
|
|
13562
|
+
// src/components/layout/table/TableHeader.tsx
|
|
13563
|
+
var import_react_table3 = require("@tanstack/react-table");
|
|
13564
|
+
var import_clsx32 = __toESM(require("clsx"));
|
|
13565
|
+
|
|
13320
13566
|
// src/components/layout/table/TableSortButton.tsx
|
|
13321
|
-
var
|
|
13567
|
+
var import_lucide_react14 = require("lucide-react");
|
|
13568
|
+
var import_clsx27 = __toESM(require("clsx"));
|
|
13569
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
13322
13570
|
var TableSortButton = ({
|
|
13323
13571
|
sortDirection,
|
|
13324
13572
|
invert = false,
|
|
@@ -13330,28 +13578,28 @@ var TableSortButton = ({
|
|
|
13330
13578
|
}) => {
|
|
13331
13579
|
const translation = useHightideTranslation();
|
|
13332
13580
|
const { sortingsCount, index } = sortingIndexDisplay;
|
|
13333
|
-
let icon = /* @__PURE__ */ (0,
|
|
13581
|
+
let icon = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react14.ChevronsUpDown, { className: "size-4" });
|
|
13334
13582
|
if (sortDirection) {
|
|
13335
13583
|
let usedSortDirection = sortDirection;
|
|
13336
13584
|
if (invert) {
|
|
13337
13585
|
usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
|
|
13338
13586
|
}
|
|
13339
|
-
icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0,
|
|
13587
|
+
icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react14.ChevronUp, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react14.ChevronDown, { className: "size-4" });
|
|
13340
13588
|
}
|
|
13341
13589
|
const hasSortingIndex = !!sortingIndexDisplay && sortingsCount > 1 && index > 0;
|
|
13342
|
-
return /* @__PURE__ */ (0,
|
|
13590
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Tooltip, { tooltip: translation("rSortingOrderAfter", { otherSortings: index - 1 }), disabled: !hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
13343
13591
|
Button,
|
|
13344
13592
|
{
|
|
13345
13593
|
layout: hasSortingIndex ? "default" : "icon",
|
|
13346
13594
|
color,
|
|
13347
13595
|
size,
|
|
13348
|
-
className: (0,
|
|
13596
|
+
className: (0, import_clsx27.default)("relative", className),
|
|
13349
13597
|
...props,
|
|
13350
13598
|
children: [
|
|
13351
|
-
/* @__PURE__ */ (0,
|
|
13599
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13352
13600
|
"div",
|
|
13353
13601
|
{
|
|
13354
|
-
className: (0,
|
|
13602
|
+
className: (0, import_clsx27.default)("absolute bottom-0 right-1/2 translate-x-1/2 translate-y-2/3 z-1 primary coloring-solid rounded-full h-4 w-5 text-sm"),
|
|
13355
13603
|
children: `${index}.`
|
|
13356
13604
|
}
|
|
13357
13605
|
) }),
|
|
@@ -13362,13 +13610,13 @@ var TableSortButton = ({
|
|
|
13362
13610
|
};
|
|
13363
13611
|
|
|
13364
13612
|
// src/components/layout/table/TableFilterButton.tsx
|
|
13365
|
-
var
|
|
13613
|
+
var import_lucide_react18 = require("lucide-react");
|
|
13366
13614
|
var import_react67 = require("react");
|
|
13367
13615
|
|
|
13368
13616
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
13369
13617
|
var import_react64 = require("react");
|
|
13370
|
-
var
|
|
13371
|
-
var
|
|
13618
|
+
var import_lucide_react16 = require("lucide-react");
|
|
13619
|
+
var import_clsx31 = __toESM(require("clsx"));
|
|
13372
13620
|
|
|
13373
13621
|
// src/utils/date.ts
|
|
13374
13622
|
var monthsList = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
|
|
@@ -13541,11 +13789,11 @@ var DateUtils = {
|
|
|
13541
13789
|
};
|
|
13542
13790
|
|
|
13543
13791
|
// src/components/user-interaction/date/DateTimePicker.tsx
|
|
13544
|
-
var
|
|
13792
|
+
var import_clsx30 = __toESM(require("clsx"));
|
|
13545
13793
|
|
|
13546
13794
|
// src/components/user-interaction/date/TimePicker.tsx
|
|
13547
13795
|
var import_react59 = require("react");
|
|
13548
|
-
var
|
|
13796
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
13549
13797
|
var TimePicker = ({
|
|
13550
13798
|
value = /* @__PURE__ */ new Date(),
|
|
13551
13799
|
onValueChange,
|
|
@@ -13593,10 +13841,10 @@ var TimePicker = ({
|
|
|
13593
13841
|
onValueChange?.(newDate);
|
|
13594
13842
|
onEditComplete?.(newDate);
|
|
13595
13843
|
};
|
|
13596
|
-
return /* @__PURE__ */ (0,
|
|
13597
|
-
/* @__PURE__ */ (0,
|
|
13844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { "data-name": "time-picker-container", className, children: [
|
|
13845
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { "data-name": "time-picker-value-column", children: hours.map((hour2) => {
|
|
13598
13846
|
const isSelected = hour2 === value.getHours() - (!is24HourFormat && isPM ? 12 : 0);
|
|
13599
|
-
return /* @__PURE__ */ (0,
|
|
13847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13600
13848
|
Button,
|
|
13601
13849
|
{
|
|
13602
13850
|
size: "sm",
|
|
@@ -13608,9 +13856,9 @@ var TimePicker = ({
|
|
|
13608
13856
|
hour2
|
|
13609
13857
|
);
|
|
13610
13858
|
}) }),
|
|
13611
|
-
/* @__PURE__ */ (0,
|
|
13859
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { "data-name": "time-picker-value-column", children: minutes.map((minute) => {
|
|
13612
13860
|
const isSelected = minute === closestMinute;
|
|
13613
|
-
return /* @__PURE__ */ (0,
|
|
13861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13614
13862
|
Button,
|
|
13615
13863
|
{
|
|
13616
13864
|
size: "sm",
|
|
@@ -13622,8 +13870,8 @@ var TimePicker = ({
|
|
|
13622
13870
|
minute + minuteIncrement
|
|
13623
13871
|
);
|
|
13624
13872
|
}) }),
|
|
13625
|
-
!is24HourFormat && /* @__PURE__ */ (0,
|
|
13626
|
-
/* @__PURE__ */ (0,
|
|
13873
|
+
!is24HourFormat && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { "data-name": "time-picker-value-column", children: [
|
|
13874
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13627
13875
|
Button,
|
|
13628
13876
|
{
|
|
13629
13877
|
size: "sm",
|
|
@@ -13632,7 +13880,7 @@ var TimePicker = ({
|
|
|
13632
13880
|
children: "AM"
|
|
13633
13881
|
}
|
|
13634
13882
|
),
|
|
13635
|
-
/* @__PURE__ */ (0,
|
|
13883
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13636
13884
|
Button,
|
|
13637
13885
|
{
|
|
13638
13886
|
size: "sm",
|
|
@@ -13650,7 +13898,7 @@ var TimePickerUncontrolled = ({
|
|
|
13650
13898
|
...props
|
|
13651
13899
|
}) => {
|
|
13652
13900
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
13653
|
-
return /* @__PURE__ */ (0,
|
|
13901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13654
13902
|
TimePicker,
|
|
13655
13903
|
{
|
|
13656
13904
|
...props,
|
|
@@ -13662,12 +13910,12 @@ var TimePickerUncontrolled = ({
|
|
|
13662
13910
|
|
|
13663
13911
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
13664
13912
|
var import_react62 = require("react");
|
|
13665
|
-
var
|
|
13666
|
-
var
|
|
13913
|
+
var import_lucide_react15 = require("lucide-react");
|
|
13914
|
+
var import_clsx29 = __toESM(require("clsx"));
|
|
13667
13915
|
|
|
13668
13916
|
// src/components/user-interaction/date/DayPicker.tsx
|
|
13669
13917
|
var import_react60 = require("react");
|
|
13670
|
-
var
|
|
13918
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
13671
13919
|
var DayPicker = ({
|
|
13672
13920
|
displayedMonth,
|
|
13673
13921
|
value,
|
|
@@ -13690,14 +13938,14 @@ var DayPicker = ({
|
|
|
13690
13938
|
if (!providedStart) return;
|
|
13691
13939
|
return new Date(providedStart.getFullYear(), providedStart.getMonth(), providedStart.getDate());
|
|
13692
13940
|
}, [providedStart]);
|
|
13693
|
-
return /* @__PURE__ */ (0,
|
|
13694
|
-
/* @__PURE__ */ (0,
|
|
13695
|
-
weeks.map((week, index) => /* @__PURE__ */ (0,
|
|
13941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className, "data-name": "day-picker-container", children: [
|
|
13942
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { "data-name": "day-picker-header-row", children: weeks[0].map((weekDay, index) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { "data-name": "day-picker-header-item", children: new Intl.DateTimeFormat(locale, { weekday: "long" }).format(weekDay).substring(0, 2) }, index)) }),
|
|
13943
|
+
weeks.map((week, index) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { "data-name": "day-picker-body-row", children: week.map((date) => {
|
|
13696
13944
|
const isSelected = !!value && DateUtils.equalDate(value, date);
|
|
13697
13945
|
const isToday = DateUtils.equalDate(/* @__PURE__ */ new Date(), date);
|
|
13698
13946
|
const isSameMonth = date.getMonth() === month;
|
|
13699
13947
|
const isDayValid = isInTimeSpan(date, start, end);
|
|
13700
|
-
return /* @__PURE__ */ (0,
|
|
13948
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13701
13949
|
"button",
|
|
13702
13950
|
{
|
|
13703
13951
|
disabled: !isDayValid,
|
|
@@ -13731,7 +13979,7 @@ var DayPickerUncontrolled = ({
|
|
|
13731
13979
|
...props
|
|
13732
13980
|
}) => {
|
|
13733
13981
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
13734
|
-
return /* @__PURE__ */ (0,
|
|
13982
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13735
13983
|
DayPicker,
|
|
13736
13984
|
{
|
|
13737
13985
|
value,
|
|
@@ -13743,8 +13991,8 @@ var DayPickerUncontrolled = ({
|
|
|
13743
13991
|
|
|
13744
13992
|
// src/components/user-interaction/date/YearMonthPicker.tsx
|
|
13745
13993
|
var import_react61 = require("react");
|
|
13746
|
-
var
|
|
13747
|
-
var
|
|
13994
|
+
var import_clsx28 = __toESM(require("clsx"));
|
|
13995
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
13748
13996
|
var YearRow = (0, import_react61.memo)(function YearRow2({
|
|
13749
13997
|
year,
|
|
13750
13998
|
selectedMonthIndex,
|
|
@@ -13762,22 +14010,22 @@ var YearRow = (0, import_react61.memo)(function YearRow2({
|
|
|
13762
14010
|
}
|
|
13763
14011
|
}, [isSelectedYear]);
|
|
13764
14012
|
const monthGrid = (0, import_react61.useMemo)(() => equalSizeGroups([...DateUtils.monthsList], 3), []);
|
|
13765
|
-
return /* @__PURE__ */ (0,
|
|
14013
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
13766
14014
|
ExpandableRoot,
|
|
13767
14015
|
{
|
|
13768
14016
|
ref: isSelectedYear ? ref : void 0,
|
|
13769
14017
|
isExpanded,
|
|
13770
14018
|
onExpandedChange: setIsExpanded,
|
|
13771
14019
|
children: [
|
|
13772
|
-
/* @__PURE__ */ (0,
|
|
13773
|
-
/* @__PURE__ */ (0,
|
|
14020
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ExpandableHeader, { className: (0, import_clsx28.default)("px-2", { "text-primary font-bold": isSelectedYear }), children: year }),
|
|
14021
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ExpandableContent, { className: "gap-y-1 px-2 expandable-content-h-39", children: isExpanded && monthGrid.map((group, groupIdx) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex-row-1", children: group.map((month) => {
|
|
13774
14022
|
const monthIndex = DateUtils.monthsList.indexOf(month);
|
|
13775
14023
|
const currentTimestamp = new Date(year, monthIndex).getTime();
|
|
13776
14024
|
const isAfterStart = minTimestamp === void 0 || currentTimestamp >= minTimestamp;
|
|
13777
14025
|
const isBeforeEnd = maxTimestamp === void 0 || currentTimestamp <= maxTimestamp;
|
|
13778
14026
|
const isValid = isAfterStart && isBeforeEnd;
|
|
13779
14027
|
const isSelectedMonth = monthIndex === selectedMonthIndex;
|
|
13780
|
-
return /* @__PURE__ */ (0,
|
|
14028
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13781
14029
|
Button,
|
|
13782
14030
|
{
|
|
13783
14031
|
disabled: !isValid,
|
|
@@ -13834,17 +14082,17 @@ var YearMonthPicker = ({
|
|
|
13834
14082
|
onValueChange2?.(newDate);
|
|
13835
14083
|
onEditComplete2?.(newDate);
|
|
13836
14084
|
}, []);
|
|
13837
|
-
return /* @__PURE__ */ (0,
|
|
14085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13838
14086
|
InfiniteScroll,
|
|
13839
14087
|
{
|
|
13840
14088
|
itemCount: years.length,
|
|
13841
|
-
className: (0,
|
|
14089
|
+
className: (0, import_clsx28.default)("flex-col-1 h-full select-none", className),
|
|
13842
14090
|
initialIndex: years.findIndex((year) => year === value.getFullYear()),
|
|
13843
14091
|
children: (index) => {
|
|
13844
14092
|
const year = years[index];
|
|
13845
14093
|
const isSelectedYear = value.getFullYear() === year;
|
|
13846
14094
|
const selectedMonthIndex = isSelectedYear ? value.getMonth() : void 0;
|
|
13847
|
-
return /* @__PURE__ */ (0,
|
|
14095
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13848
14096
|
YearRow,
|
|
13849
14097
|
{
|
|
13850
14098
|
year,
|
|
@@ -13866,7 +14114,7 @@ var YearMonthPickerUncontrolled = ({
|
|
|
13866
14114
|
...props
|
|
13867
14115
|
}) => {
|
|
13868
14116
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
13869
|
-
return /* @__PURE__ */ (0,
|
|
14117
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13870
14118
|
YearMonthPicker,
|
|
13871
14119
|
{
|
|
13872
14120
|
value,
|
|
@@ -13877,7 +14125,7 @@ var YearMonthPickerUncontrolled = ({
|
|
|
13877
14125
|
};
|
|
13878
14126
|
|
|
13879
14127
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
13880
|
-
var
|
|
14128
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
13881
14129
|
var DatePicker = ({
|
|
13882
14130
|
value = /* @__PURE__ */ new Date(),
|
|
13883
14131
|
start,
|
|
@@ -13893,25 +14141,25 @@ var DatePicker = ({
|
|
|
13893
14141
|
const { locale } = useLocale();
|
|
13894
14142
|
const [displayedMonth, setDisplayedMonth] = (0, import_react62.useState)(new Date(value.getFullYear(), value.getMonth(), 1));
|
|
13895
14143
|
const [displayMode, setDisplayMode] = (0, import_react62.useState)(initialDisplay);
|
|
13896
|
-
return /* @__PURE__ */ (0,
|
|
13897
|
-
/* @__PURE__ */ (0,
|
|
13898
|
-
/* @__PURE__ */ (0,
|
|
14144
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: (0, import_clsx29.default)("flex-col-3", className), children: [
|
|
14145
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex-row-2 items-center justify-between", children: [
|
|
14146
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
13899
14147
|
Button,
|
|
13900
14148
|
{
|
|
13901
14149
|
size: "sm",
|
|
13902
14150
|
coloringStyle: "text",
|
|
13903
|
-
className: (0,
|
|
14151
|
+
className: (0, import_clsx29.default)("flex-row-1 items-center cursor-pointer select-none", {
|
|
13904
14152
|
"text-disabled": displayMode !== "day"
|
|
13905
14153
|
}),
|
|
13906
14154
|
onClick: () => setDisplayMode(displayMode === "day" ? "yearMonth" : "day"),
|
|
13907
14155
|
children: [
|
|
13908
14156
|
`${new Intl.DateTimeFormat(LocalizationUtil.localToLanguage(locale), { month: "long" }).format(displayedMonth)} ${displayedMonth.getFullYear()}`,
|
|
13909
|
-
/* @__PURE__ */ (0,
|
|
14157
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react15.ChevronDown, { size: 16 })
|
|
13910
14158
|
]
|
|
13911
14159
|
}
|
|
13912
14160
|
),
|
|
13913
|
-
displayMode === "day" && /* @__PURE__ */ (0,
|
|
13914
|
-
/* @__PURE__ */ (0,
|
|
14161
|
+
displayMode === "day" && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
14162
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13915
14163
|
Button,
|
|
13916
14164
|
{
|
|
13917
14165
|
size: "sm",
|
|
@@ -13922,10 +14170,10 @@ var DatePicker = ({
|
|
|
13922
14170
|
onValueChange(newDate);
|
|
13923
14171
|
setDisplayedMonth(newDate);
|
|
13924
14172
|
},
|
|
13925
|
-
children: /* @__PURE__ */ (0,
|
|
14173
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react15.Calendar, { className: "size-5" })
|
|
13926
14174
|
}
|
|
13927
14175
|
),
|
|
13928
|
-
/* @__PURE__ */ (0,
|
|
14176
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13929
14177
|
Button,
|
|
13930
14178
|
{
|
|
13931
14179
|
size: "sm",
|
|
@@ -13933,10 +14181,10 @@ var DatePicker = ({
|
|
|
13933
14181
|
onClick: () => {
|
|
13934
14182
|
setDisplayedMonth(subtractDuration(displayedMonth, { months: 1 }));
|
|
13935
14183
|
},
|
|
13936
|
-
children: /* @__PURE__ */ (0,
|
|
14184
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react15.ArrowUp, { size: 20 })
|
|
13937
14185
|
}
|
|
13938
14186
|
),
|
|
13939
|
-
/* @__PURE__ */ (0,
|
|
14187
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13940
14188
|
Button,
|
|
13941
14189
|
{
|
|
13942
14190
|
size: "sm",
|
|
@@ -13944,12 +14192,12 @@ var DatePicker = ({
|
|
|
13944
14192
|
onClick: () => {
|
|
13945
14193
|
setDisplayedMonth(addDuration(displayedMonth, { months: 1 }));
|
|
13946
14194
|
},
|
|
13947
|
-
children: /* @__PURE__ */ (0,
|
|
14195
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react15.ArrowDown, { size: 20 })
|
|
13948
14196
|
}
|
|
13949
14197
|
)
|
|
13950
14198
|
] })
|
|
13951
14199
|
] }),
|
|
13952
|
-
displayMode === "yearMonth" ? /* @__PURE__ */ (0,
|
|
14200
|
+
displayMode === "yearMonth" ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13953
14201
|
YearMonthPicker,
|
|
13954
14202
|
{
|
|
13955
14203
|
...yearMonthPickerProps,
|
|
@@ -13966,7 +14214,7 @@ var DatePicker = ({
|
|
|
13966
14214
|
},
|
|
13967
14215
|
className: "h-60 max-h-60"
|
|
13968
14216
|
}
|
|
13969
|
-
) : /* @__PURE__ */ (0,
|
|
14217
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13970
14218
|
DayPicker,
|
|
13971
14219
|
{
|
|
13972
14220
|
...dayPickerProps,
|
|
@@ -13988,7 +14236,7 @@ var DatePickerUncontrolled = ({
|
|
|
13988
14236
|
...props
|
|
13989
14237
|
}) => {
|
|
13990
14238
|
const [date, setDate] = useOverwritableState(value, onValueChange);
|
|
13991
|
-
return /* @__PURE__ */ (0,
|
|
14239
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13992
14240
|
DatePicker,
|
|
13993
14241
|
{
|
|
13994
14242
|
...props,
|
|
@@ -13999,7 +14247,7 @@ var DatePickerUncontrolled = ({
|
|
|
13999
14247
|
};
|
|
14000
14248
|
|
|
14001
14249
|
// src/components/user-interaction/date/DateTimePicker.tsx
|
|
14002
|
-
var
|
|
14250
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
14003
14251
|
var DateTimePicker = ({
|
|
14004
14252
|
value = /* @__PURE__ */ new Date(),
|
|
14005
14253
|
start,
|
|
@@ -14018,7 +14266,7 @@ var DateTimePicker = ({
|
|
|
14018
14266
|
let dateDisplay;
|
|
14019
14267
|
let timeDisplay;
|
|
14020
14268
|
if (useDate) {
|
|
14021
|
-
dateDisplay = /* @__PURE__ */ (0,
|
|
14269
|
+
dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14022
14270
|
DatePicker,
|
|
14023
14271
|
{
|
|
14024
14272
|
...datePickerProps,
|
|
@@ -14034,27 +14282,27 @@ var DateTimePicker = ({
|
|
|
14034
14282
|
);
|
|
14035
14283
|
}
|
|
14036
14284
|
if (useTime) {
|
|
14037
|
-
timeDisplay = /* @__PURE__ */ (0,
|
|
14285
|
+
timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14038
14286
|
TimePicker,
|
|
14039
14287
|
{
|
|
14040
14288
|
...timePickerProps,
|
|
14041
14289
|
is24HourFormat,
|
|
14042
14290
|
minuteIncrement,
|
|
14043
|
-
className: (0,
|
|
14291
|
+
className: (0, import_clsx30.default)({ "justify-between": mode === "time" }),
|
|
14044
14292
|
value,
|
|
14045
14293
|
onValueChange,
|
|
14046
14294
|
onEditComplete
|
|
14047
14295
|
}
|
|
14048
14296
|
);
|
|
14049
14297
|
}
|
|
14050
|
-
return /* @__PURE__ */ (0,
|
|
14298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-row-2 min-h-71 max-h-71", children: [
|
|
14051
14299
|
dateDisplay,
|
|
14052
14300
|
timeDisplay
|
|
14053
14301
|
] });
|
|
14054
14302
|
};
|
|
14055
14303
|
var DateTimePickerUncontrolled = ({ value: initialValue, onValueChange, ...props }) => {
|
|
14056
14304
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14057
|
-
return /* @__PURE__ */ (0,
|
|
14305
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14058
14306
|
DateTimePicker,
|
|
14059
14307
|
{
|
|
14060
14308
|
...props,
|
|
@@ -14066,7 +14314,7 @@ var DateTimePickerUncontrolled = ({ value: initialValue, onValueChange, ...props
|
|
|
14066
14314
|
|
|
14067
14315
|
// src/components/user-interaction/date/DateTimePickerDialog.tsx
|
|
14068
14316
|
var import_react63 = require("react");
|
|
14069
|
-
var
|
|
14317
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
14070
14318
|
var DateTimePickerDialog = ({
|
|
14071
14319
|
defaultValue,
|
|
14072
14320
|
value,
|
|
@@ -14089,8 +14337,8 @@ var DateTimePickerDialog = ({
|
|
|
14089
14337
|
const initialValue = (0, import_react63.useMemo)(() => {
|
|
14090
14338
|
return state;
|
|
14091
14339
|
}, []);
|
|
14092
|
-
return /* @__PURE__ */ (0,
|
|
14093
|
-
/* @__PURE__ */ (0,
|
|
14340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
14341
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "flex-row-2 justify-center w-full py-1", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14094
14342
|
"span",
|
|
14095
14343
|
{
|
|
14096
14344
|
id: labelId,
|
|
@@ -14098,7 +14346,7 @@ var DateTimePickerDialog = ({
|
|
|
14098
14346
|
children: label ?? translation("sDateTimeSelect", { datetimeMode: mode })
|
|
14099
14347
|
}
|
|
14100
14348
|
) }),
|
|
14101
|
-
/* @__PURE__ */ (0,
|
|
14349
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14102
14350
|
DateTimePicker,
|
|
14103
14351
|
{
|
|
14104
14352
|
...pickerProps,
|
|
@@ -14108,8 +14356,8 @@ var DateTimePickerDialog = ({
|
|
|
14108
14356
|
onEditComplete: setState
|
|
14109
14357
|
}
|
|
14110
14358
|
),
|
|
14111
|
-
/* @__PURE__ */ (0,
|
|
14112
|
-
/* @__PURE__ */ (0,
|
|
14359
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
14360
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Visibility, { isVisible: allowRemove && !!initialValue, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14113
14361
|
Button,
|
|
14114
14362
|
{
|
|
14115
14363
|
size: "md",
|
|
@@ -14122,7 +14370,7 @@ var DateTimePickerDialog = ({
|
|
|
14122
14370
|
children: translation("clear")
|
|
14123
14371
|
}
|
|
14124
14372
|
) }),
|
|
14125
|
-
/* @__PURE__ */ (0,
|
|
14373
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Visibility, { isVisible: !initialValue, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14126
14374
|
Button,
|
|
14127
14375
|
{
|
|
14128
14376
|
size: "md",
|
|
@@ -14135,7 +14383,7 @@ var DateTimePickerDialog = ({
|
|
|
14135
14383
|
children: translation("cancel")
|
|
14136
14384
|
}
|
|
14137
14385
|
) }),
|
|
14138
|
-
/* @__PURE__ */ (0,
|
|
14386
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14139
14387
|
Button,
|
|
14140
14388
|
{
|
|
14141
14389
|
size: "md",
|
|
@@ -14152,7 +14400,7 @@ var DateTimePickerDialog = ({
|
|
|
14152
14400
|
};
|
|
14153
14401
|
|
|
14154
14402
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
14155
|
-
var
|
|
14403
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
14156
14404
|
var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
14157
14405
|
value,
|
|
14158
14406
|
defaultValue = null,
|
|
@@ -14207,9 +14455,9 @@ var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
|
14207
14455
|
}
|
|
14208
14456
|
}, [changeOpenWrapper, readOnly, disabled]);
|
|
14209
14457
|
const clickHandler = PropsUtil.aria.click(() => changeOpenWrapper(true));
|
|
14210
|
-
return /* @__PURE__ */ (0,
|
|
14211
|
-
/* @__PURE__ */ (0,
|
|
14212
|
-
/* @__PURE__ */ (0,
|
|
14458
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
14459
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { ...containerProps, ref: innerRef, className: (0, import_clsx31.default)("relative w-full", containerProps?.className), children: [
|
|
14460
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14213
14461
|
"div",
|
|
14214
14462
|
{
|
|
14215
14463
|
...props,
|
|
@@ -14226,7 +14474,7 @@ var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
|
14226
14474
|
"aria-haspopup": "dialog",
|
|
14227
14475
|
"aria-expanded": isOpen,
|
|
14228
14476
|
"aria-controls": isOpen ? ids.popup : void 0,
|
|
14229
|
-
className: (0,
|
|
14477
|
+
className: (0, import_clsx31.default)(
|
|
14230
14478
|
"pr-10 w-full flex-row-2 items-center justify-between h-10 px-3 rounded-md input-element",
|
|
14231
14479
|
"outline-offset-0 outline-primary focus:outline-1 focus:outline-offset-1 focus:border-primary duration-(--animation-duration-in)",
|
|
14232
14480
|
{ "hover:cursor-pointer": !readOnly },
|
|
@@ -14235,7 +14483,7 @@ var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
|
14235
14483
|
children: state ? DateUtils.formatAbsolute(state, locale, mode === "dateTime") : placeholder ?? translation("clickToSelect")
|
|
14236
14484
|
}
|
|
14237
14485
|
),
|
|
14238
|
-
/* @__PURE__ */ (0,
|
|
14486
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Visibility, { isVisible: !readOnly, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14239
14487
|
Button,
|
|
14240
14488
|
{
|
|
14241
14489
|
coloringStyle: "text",
|
|
@@ -14251,11 +14499,11 @@ var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
|
14251
14499
|
"aria-expanded": isOpen,
|
|
14252
14500
|
"aria-controls": isOpen ? ids.popup : void 0,
|
|
14253
14501
|
"aria-label": translation("sDateTimeSelect", { datetimeMode: mode }),
|
|
14254
|
-
children: /* @__PURE__ */ (0,
|
|
14502
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_lucide_react16.CalendarIcon, { className: "size-5" })
|
|
14255
14503
|
}
|
|
14256
14504
|
) })
|
|
14257
14505
|
] }),
|
|
14258
|
-
/* @__PURE__ */ (0,
|
|
14506
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14259
14507
|
PopUp,
|
|
14260
14508
|
{
|
|
14261
14509
|
ref: containerRef,
|
|
@@ -14275,7 +14523,7 @@ var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
|
14275
14523
|
role: "dialog",
|
|
14276
14524
|
"aria-labelledby": ids.label,
|
|
14277
14525
|
className: "flex-col-2 p-2",
|
|
14278
|
-
children: /* @__PURE__ */ (0,
|
|
14526
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14279
14527
|
DateTimePickerDialog,
|
|
14280
14528
|
{
|
|
14281
14529
|
value: dialogValue,
|
|
@@ -14298,235 +14546,18 @@ var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
|
14298
14546
|
// src/components/layout/table/TableFilterPopups.tsx
|
|
14299
14547
|
var import_react66 = require("react");
|
|
14300
14548
|
|
|
14301
|
-
// src/components/layout/table/TableFilter.ts
|
|
14302
|
-
var TableFilterOperator = {
|
|
14303
|
-
text: ["textEquals", "textNotEquals", "textNotWhitespace", "textContains", "textNotContains", "textStartsWith", "textEndsWith"],
|
|
14304
|
-
number: ["numberEquals", "numberNotEquals", "numberGreaterThan", "numberGreaterThanOrEqual", "numberLessThan", "numberLessThanOrEqual", "numberBetween", "numberNotBetween"],
|
|
14305
|
-
date: ["dateEquals", "dateNotEquals", "dateGreaterThan", "dateGreaterThanOrEqual", "dateLessThan", "dateLessThanOrEqual", "dateBetween", "dateNotBetween"],
|
|
14306
|
-
boolean: ["booleanIsTrue", "booleanIsFalse"],
|
|
14307
|
-
tags: ["tagsEquals", "tagsNotEquals", "tagsContains", "tagsNotContains"],
|
|
14308
|
-
generic: ["undefined", "notUndefined"]
|
|
14309
|
-
};
|
|
14310
|
-
function isTableFilterCategory(value) {
|
|
14311
|
-
return typeof value === "string" && value in TableFilterOperator;
|
|
14312
|
-
}
|
|
14313
|
-
var textFilter = (row, columnId, filterValue) => {
|
|
14314
|
-
const value = row.getValue(columnId);
|
|
14315
|
-
const parameter = filterValue.parameter;
|
|
14316
|
-
const operator = filterValue.operator;
|
|
14317
|
-
if (operator === "textNotWhitespace") {
|
|
14318
|
-
return value?.toString().trim().length > 0;
|
|
14319
|
-
}
|
|
14320
|
-
const searchText = (parameter.searchText ?? "").toLowerCase();
|
|
14321
|
-
const cellText = value?.toString().toLowerCase() ?? "";
|
|
14322
|
-
switch (operator) {
|
|
14323
|
-
case "textEquals":
|
|
14324
|
-
return cellText === searchText;
|
|
14325
|
-
case "textNotEquals":
|
|
14326
|
-
return cellText !== searchText;
|
|
14327
|
-
case "textContains":
|
|
14328
|
-
return cellText.includes(searchText);
|
|
14329
|
-
case "textNotContains":
|
|
14330
|
-
return !cellText.includes(searchText);
|
|
14331
|
-
case "textStartsWith":
|
|
14332
|
-
return cellText.startsWith(searchText);
|
|
14333
|
-
case "textEndsWith":
|
|
14334
|
-
return cellText.endsWith(searchText);
|
|
14335
|
-
case "undefined":
|
|
14336
|
-
return value === void 0 || value === null;
|
|
14337
|
-
case "notUndefined":
|
|
14338
|
-
return value !== void 0 && value !== null;
|
|
14339
|
-
default:
|
|
14340
|
-
return false;
|
|
14341
|
-
}
|
|
14342
|
-
};
|
|
14343
|
-
var numberFilter = (row, columnId, filterValue) => {
|
|
14344
|
-
const value = row.getValue(columnId);
|
|
14345
|
-
const parameter = filterValue.parameter;
|
|
14346
|
-
const operator = filterValue.operator;
|
|
14347
|
-
switch (operator) {
|
|
14348
|
-
case "numberEquals":
|
|
14349
|
-
return value === parameter.compareValue;
|
|
14350
|
-
case "numberNotEquals":
|
|
14351
|
-
return value !== parameter.compareValue;
|
|
14352
|
-
case "numberGreaterThan":
|
|
14353
|
-
return value > (parameter.compareValue ?? 0);
|
|
14354
|
-
case "numberGreaterThanOrEqual":
|
|
14355
|
-
return value >= (parameter.compareValue ?? 0);
|
|
14356
|
-
case "numberLessThan":
|
|
14357
|
-
return value < (parameter.compareValue ?? 0);
|
|
14358
|
-
case "numberLessThanOrEqual":
|
|
14359
|
-
return value <= (parameter.compareValue ?? 0);
|
|
14360
|
-
case "numberBetween":
|
|
14361
|
-
return value >= (parameter.min ?? -Infinity) && value <= (parameter.max ?? Infinity);
|
|
14362
|
-
case "numberNotBetween":
|
|
14363
|
-
return value < (parameter.min ?? -Infinity) || value > (parameter.max ?? Infinity);
|
|
14364
|
-
case "undefined":
|
|
14365
|
-
return value === void 0 || value === null;
|
|
14366
|
-
case "notUndefined":
|
|
14367
|
-
return value !== void 0 && value !== null;
|
|
14368
|
-
default:
|
|
14369
|
-
return false;
|
|
14370
|
-
}
|
|
14371
|
-
};
|
|
14372
|
-
var dateFilter = (row, columnId, filterValue) => {
|
|
14373
|
-
const value = row.getValue(columnId);
|
|
14374
|
-
const parameter = filterValue.parameter;
|
|
14375
|
-
const operator = filterValue.operator;
|
|
14376
|
-
const parseDate = (dateValue) => {
|
|
14377
|
-
if (!dateValue) return null;
|
|
14378
|
-
if (dateValue instanceof Date) return dateValue;
|
|
14379
|
-
if (typeof dateValue === "string" || typeof dateValue === "number") {
|
|
14380
|
-
const parsed = new Date(dateValue);
|
|
14381
|
-
return isNaN(parsed.getTime()) ? null : parsed;
|
|
14382
|
-
}
|
|
14383
|
-
return null;
|
|
14384
|
-
};
|
|
14385
|
-
const normalizeToDateOnly = (date2) => {
|
|
14386
|
-
const normalized = new Date(date2);
|
|
14387
|
-
normalized.setHours(0, 0, 0, 0);
|
|
14388
|
-
return normalized;
|
|
14389
|
-
};
|
|
14390
|
-
const date = parseDate(value);
|
|
14391
|
-
if (!date && !TableFilterOperator.generic.some((o) => o === operator)) return false;
|
|
14392
|
-
const normalizedDate = date ? normalizeToDateOnly(date) : null;
|
|
14393
|
-
switch (operator) {
|
|
14394
|
-
case "dateEquals": {
|
|
14395
|
-
const filterDate = parseDate(parameter.compareDate);
|
|
14396
|
-
if (!filterDate || !normalizedDate) return false;
|
|
14397
|
-
return normalizedDate.getTime() === normalizeToDateOnly(filterDate).getTime();
|
|
14398
|
-
}
|
|
14399
|
-
case "dateNotEquals": {
|
|
14400
|
-
const filterDate = parseDate(parameter.compareDate);
|
|
14401
|
-
if (!filterDate || !normalizedDate) return false;
|
|
14402
|
-
return normalizedDate.getTime() !== normalizeToDateOnly(filterDate).getTime();
|
|
14403
|
-
}
|
|
14404
|
-
case "dateGreaterThan": {
|
|
14405
|
-
const filterDate = parseDate(parameter.compareDate);
|
|
14406
|
-
if (!filterDate || !normalizedDate) return false;
|
|
14407
|
-
return normalizedDate > normalizeToDateOnly(filterDate);
|
|
14408
|
-
}
|
|
14409
|
-
case "dateGreaterThanOrEqual": {
|
|
14410
|
-
const filterDate = parseDate(parameter.compareDate);
|
|
14411
|
-
if (!filterDate || !normalizedDate) return false;
|
|
14412
|
-
return normalizedDate >= normalizeToDateOnly(filterDate);
|
|
14413
|
-
}
|
|
14414
|
-
case "dateLessThan": {
|
|
14415
|
-
const filterDate = parseDate(parameter.compareDate);
|
|
14416
|
-
if (!filterDate || !normalizedDate) return false;
|
|
14417
|
-
return normalizedDate < normalizeToDateOnly(filterDate);
|
|
14418
|
-
}
|
|
14419
|
-
case "dateLessThanOrEqual": {
|
|
14420
|
-
const filterDate = parseDate(parameter.compareDate);
|
|
14421
|
-
if (!filterDate || !normalizedDate) return false;
|
|
14422
|
-
return normalizedDate <= normalizeToDateOnly(filterDate);
|
|
14423
|
-
}
|
|
14424
|
-
case "dateBetween": {
|
|
14425
|
-
const minDate = parseDate(parameter.min);
|
|
14426
|
-
const maxDate = parseDate(parameter.max);
|
|
14427
|
-
if (!minDate || !maxDate || !normalizedDate) return false;
|
|
14428
|
-
return normalizedDate >= normalizeToDateOnly(minDate) && normalizedDate <= normalizeToDateOnly(maxDate);
|
|
14429
|
-
}
|
|
14430
|
-
case "dateNotBetween": {
|
|
14431
|
-
const minDate = parseDate(parameter.min);
|
|
14432
|
-
const maxDate = parseDate(parameter.max);
|
|
14433
|
-
if (!minDate || !maxDate || !normalizedDate) return false;
|
|
14434
|
-
return normalizedDate < normalizeToDateOnly(minDate) || normalizedDate > normalizeToDateOnly(maxDate);
|
|
14435
|
-
}
|
|
14436
|
-
case "undefined":
|
|
14437
|
-
return value === void 0 || value === null;
|
|
14438
|
-
case "notUndefined":
|
|
14439
|
-
return value !== void 0 && value !== null;
|
|
14440
|
-
default:
|
|
14441
|
-
return false;
|
|
14442
|
-
}
|
|
14443
|
-
};
|
|
14444
|
-
var booleanFilter = (row, columnId, filterValue) => {
|
|
14445
|
-
const value = row.getValue(columnId);
|
|
14446
|
-
const operator = filterValue.operator;
|
|
14447
|
-
switch (operator) {
|
|
14448
|
-
case "booleanIsTrue":
|
|
14449
|
-
return value === true;
|
|
14450
|
-
case "booleanIsFalse":
|
|
14451
|
-
return value === false;
|
|
14452
|
-
case "undefined":
|
|
14453
|
-
return value === void 0 || value === null;
|
|
14454
|
-
case "notUndefined":
|
|
14455
|
-
return value !== void 0 && value !== null;
|
|
14456
|
-
default:
|
|
14457
|
-
return false;
|
|
14458
|
-
}
|
|
14459
|
-
};
|
|
14460
|
-
var tagsFilter = (row, columnId, filterValue) => {
|
|
14461
|
-
const value = row.getValue(columnId);
|
|
14462
|
-
const parameter = filterValue.parameter;
|
|
14463
|
-
const operator = filterValue.operator;
|
|
14464
|
-
switch (operator) {
|
|
14465
|
-
case "tagsEquals": {
|
|
14466
|
-
if (!Array.isArray(value) || !Array.isArray(parameter.searchTags)) return false;
|
|
14467
|
-
if (value.length !== parameter.searchTags.length) return false;
|
|
14468
|
-
const valueSet = new Set(value);
|
|
14469
|
-
const searchTagsSet = new Set(parameter.searchTags);
|
|
14470
|
-
if (valueSet.size !== searchTagsSet.size) return false;
|
|
14471
|
-
return Array.from(valueSet).every((tag) => searchTagsSet.has(tag));
|
|
14472
|
-
}
|
|
14473
|
-
case "tagsNotEquals": {
|
|
14474
|
-
if (!Array.isArray(value) || !Array.isArray(parameter.searchTags)) return true;
|
|
14475
|
-
if (value.length !== parameter.searchTags.length) return true;
|
|
14476
|
-
const valueSet = new Set(value);
|
|
14477
|
-
const searchTagsSet = new Set(parameter.searchTags);
|
|
14478
|
-
if (valueSet.size !== searchTagsSet.size) return true;
|
|
14479
|
-
return !Array.from(valueSet).every((tag) => searchTagsSet.has(tag));
|
|
14480
|
-
}
|
|
14481
|
-
case "tagsContains": {
|
|
14482
|
-
if (!Array.isArray(value) || !Array.isArray(parameter.searchTags)) return false;
|
|
14483
|
-
return parameter.searchTags.every((tag) => value.includes(tag));
|
|
14484
|
-
}
|
|
14485
|
-
case "tagsNotContains": {
|
|
14486
|
-
if (!Array.isArray(value) || !Array.isArray(parameter.searchTags)) return true;
|
|
14487
|
-
return !parameter.searchTags.every((tag) => value.includes(tag));
|
|
14488
|
-
}
|
|
14489
|
-
case "undefined":
|
|
14490
|
-
return value === void 0 || value === null;
|
|
14491
|
-
case "notUndefined":
|
|
14492
|
-
return value !== void 0 && value !== null;
|
|
14493
|
-
default:
|
|
14494
|
-
return false;
|
|
14495
|
-
}
|
|
14496
|
-
};
|
|
14497
|
-
var genericFilter = (row, columnId, filterValue) => {
|
|
14498
|
-
const value = row.getValue(columnId);
|
|
14499
|
-
const operator = filterValue.operator;
|
|
14500
|
-
switch (operator) {
|
|
14501
|
-
case "undefined":
|
|
14502
|
-
return value === void 0 || value === null;
|
|
14503
|
-
case "notUndefined":
|
|
14504
|
-
return value !== void 0 && value !== null;
|
|
14505
|
-
default:
|
|
14506
|
-
return false;
|
|
14507
|
-
}
|
|
14508
|
-
};
|
|
14509
|
-
var TableFilter = {
|
|
14510
|
-
text: textFilter,
|
|
14511
|
-
number: numberFilter,
|
|
14512
|
-
date: dateFilter,
|
|
14513
|
-
boolean: booleanFilter,
|
|
14514
|
-
tags: tagsFilter,
|
|
14515
|
-
generic: genericFilter
|
|
14516
|
-
};
|
|
14517
|
-
|
|
14518
14549
|
// src/components/user-interaction/select/MultiSelect.tsx
|
|
14519
14550
|
var import_react65 = require("react");
|
|
14520
|
-
var
|
|
14551
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
14521
14552
|
var MultiSelect = (0, import_react65.forwardRef)(function MultiSelect2({
|
|
14522
14553
|
children,
|
|
14523
14554
|
contentPanelProps,
|
|
14524
14555
|
buttonProps,
|
|
14525
14556
|
...props
|
|
14526
14557
|
}, ref) {
|
|
14527
|
-
return /* @__PURE__ */ (0,
|
|
14528
|
-
/* @__PURE__ */ (0,
|
|
14529
|
-
/* @__PURE__ */ (0,
|
|
14558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(MultiSelectRoot, { ...props, children: [
|
|
14559
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(MultiSelectButton, { ref, ...buttonProps }),
|
|
14560
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(MultiSelectContent, { ...contentPanelProps, children })
|
|
14530
14561
|
] });
|
|
14531
14562
|
});
|
|
14532
14563
|
var MultiSelectUncontrolled = (0, import_react65.forwardRef)(function MultiSelectUncontrolled2({
|
|
@@ -14535,7 +14566,7 @@ var MultiSelectUncontrolled = (0, import_react65.forwardRef)(function MultiSelec
|
|
|
14535
14566
|
...props
|
|
14536
14567
|
}, ref) {
|
|
14537
14568
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14538
|
-
return /* @__PURE__ */ (0,
|
|
14569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14539
14570
|
MultiSelect,
|
|
14540
14571
|
{
|
|
14541
14572
|
...props,
|
|
@@ -14547,120 +14578,120 @@ var MultiSelectUncontrolled = (0, import_react65.forwardRef)(function MultiSelec
|
|
|
14547
14578
|
});
|
|
14548
14579
|
|
|
14549
14580
|
// src/components/layout/table/TableFilterPopups.tsx
|
|
14550
|
-
var
|
|
14551
|
-
var
|
|
14581
|
+
var import_lucide_react17 = require("lucide-react");
|
|
14582
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14552
14583
|
var getOperatorInfo = (operator) => {
|
|
14553
14584
|
switch (operator) {
|
|
14554
14585
|
case "textEquals":
|
|
14555
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14586
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14556
14587
|
case "textNotEquals":
|
|
14557
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14588
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14558
14589
|
case "textNotWhitespace":
|
|
14559
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14590
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.TextInitial, { className: "w-4 h-4" }), translationKey: "filterNonWhitespace" };
|
|
14560
14591
|
case "textContains":
|
|
14561
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14592
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14562
14593
|
case "textNotContains":
|
|
14563
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14594
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
14564
14595
|
case "textStartsWith":
|
|
14565
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14596
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ArrowRight, { className: "w-4 h-4" }), translationKey: "startsWith" };
|
|
14566
14597
|
case "textEndsWith":
|
|
14567
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14598
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ArrowLeft, { className: "w-4 h-4" }), translationKey: "endsWith" };
|
|
14568
14599
|
case "numberEquals":
|
|
14569
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14600
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14570
14601
|
case "numberNotEquals":
|
|
14571
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14602
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14572
14603
|
case "numberGreaterThan":
|
|
14573
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14604
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "w-4 h-4" }), translationKey: "greaterThan" };
|
|
14574
14605
|
case "numberGreaterThanOrEqual":
|
|
14575
14606
|
return {
|
|
14576
|
-
icon: /* @__PURE__ */ (0,
|
|
14577
|
-
/* @__PURE__ */ (0,
|
|
14578
|
-
/* @__PURE__ */ (0,
|
|
14607
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14608
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "w-4 h-4" }),
|
|
14609
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "-ml-1 w-4 h-4" })
|
|
14579
14610
|
] }),
|
|
14580
14611
|
translationKey: "greaterThanOrEqual"
|
|
14581
14612
|
};
|
|
14582
14613
|
case "numberLessThan":
|
|
14583
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14614
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "w-4 h-4" }), translationKey: "lessThan" };
|
|
14584
14615
|
case "numberLessThanOrEqual":
|
|
14585
14616
|
return {
|
|
14586
|
-
icon: /* @__PURE__ */ (0,
|
|
14587
|
-
/* @__PURE__ */ (0,
|
|
14588
|
-
/* @__PURE__ */ (0,
|
|
14617
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14618
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "w-4 h-4" }),
|
|
14619
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "-ml-1 w-4 h-4" })
|
|
14589
14620
|
] }),
|
|
14590
14621
|
translationKey: "lessThanOrEqual"
|
|
14591
14622
|
};
|
|
14592
14623
|
case "numberBetween":
|
|
14593
14624
|
return {
|
|
14594
|
-
icon: /* @__PURE__ */ (0,
|
|
14595
|
-
/* @__PURE__ */ (0,
|
|
14596
|
-
/* @__PURE__ */ (0,
|
|
14625
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14626
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "w-4 h-4" }),
|
|
14627
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "-ml-1 w-4 h-4" })
|
|
14597
14628
|
] }),
|
|
14598
14629
|
translationKey: "between"
|
|
14599
14630
|
};
|
|
14600
14631
|
case "numberNotBetween":
|
|
14601
14632
|
return {
|
|
14602
|
-
icon: /* @__PURE__ */ (0,
|
|
14603
|
-
/* @__PURE__ */ (0,
|
|
14604
|
-
/* @__PURE__ */ (0,
|
|
14633
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14634
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "w-4 h-4" }),
|
|
14635
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "-ml-1 w-4 h-4" })
|
|
14605
14636
|
] }),
|
|
14606
14637
|
translationKey: "notBetween"
|
|
14607
14638
|
};
|
|
14608
14639
|
case "dateEquals":
|
|
14609
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14640
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14610
14641
|
case "dateNotEquals":
|
|
14611
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14642
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14612
14643
|
case "dateGreaterThan":
|
|
14613
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14644
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "w-4 h-4" }), translationKey: "after" };
|
|
14614
14645
|
case "dateGreaterThanOrEqual":
|
|
14615
14646
|
return {
|
|
14616
|
-
icon: /* @__PURE__ */ (0,
|
|
14617
|
-
/* @__PURE__ */ (0,
|
|
14618
|
-
/* @__PURE__ */ (0,
|
|
14647
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14648
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "w-4 h-4" }),
|
|
14649
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "-ml-1 w-4 h-4" })
|
|
14619
14650
|
] }),
|
|
14620
14651
|
translationKey: "onOrAfter"
|
|
14621
14652
|
};
|
|
14622
14653
|
case "dateLessThan":
|
|
14623
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14654
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "w-4 h-4" }), translationKey: "before" };
|
|
14624
14655
|
case "dateLessThanOrEqual":
|
|
14625
14656
|
return {
|
|
14626
|
-
icon: /* @__PURE__ */ (0,
|
|
14627
|
-
/* @__PURE__ */ (0,
|
|
14628
|
-
/* @__PURE__ */ (0,
|
|
14657
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14658
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "w-4 h-4" }),
|
|
14659
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "-ml-1 w-4 h-4" })
|
|
14629
14660
|
] }),
|
|
14630
14661
|
translationKey: "onOrBefore"
|
|
14631
14662
|
};
|
|
14632
14663
|
case "dateBetween":
|
|
14633
14664
|
return {
|
|
14634
|
-
icon: /* @__PURE__ */ (0,
|
|
14635
|
-
/* @__PURE__ */ (0,
|
|
14636
|
-
/* @__PURE__ */ (0,
|
|
14665
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14666
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "w-4 h-4" }),
|
|
14667
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "-ml-1 w-4 h-4" })
|
|
14637
14668
|
] }),
|
|
14638
14669
|
translationKey: "between"
|
|
14639
14670
|
};
|
|
14640
14671
|
case "dateNotBetween":
|
|
14641
14672
|
return {
|
|
14642
|
-
icon: /* @__PURE__ */ (0,
|
|
14643
|
-
/* @__PURE__ */ (0,
|
|
14644
|
-
/* @__PURE__ */ (0,
|
|
14673
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14674
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "w-4 h-4" }),
|
|
14675
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "-ml-1 w-4 h-4" })
|
|
14645
14676
|
] }),
|
|
14646
14677
|
translationKey: "notBetween"
|
|
14647
14678
|
};
|
|
14648
14679
|
case "booleanIsTrue":
|
|
14649
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14680
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.CheckCircle2, { className: "w-4 h-4" }), translationKey: "isTrue" };
|
|
14650
14681
|
case "booleanIsFalse":
|
|
14651
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14682
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.XCircle, { className: "w-4 h-4" }), translationKey: "isFalse" };
|
|
14652
14683
|
case "tagsEquals":
|
|
14653
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14684
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14654
14685
|
case "tagsNotEquals":
|
|
14655
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14686
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14656
14687
|
case "tagsContains":
|
|
14657
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14688
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14658
14689
|
case "tagsNotContains":
|
|
14659
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14690
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
14660
14691
|
case "undefined":
|
|
14661
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14692
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.CircleDashed, { className: "w-4 h-4" }), translationKey: "filterUndefined" };
|
|
14662
14693
|
case "notUndefined":
|
|
14663
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14694
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.CircleDot, { className: "w-4 h-4" }), translationKey: "filterNotUndefined" };
|
|
14664
14695
|
default:
|
|
14665
14696
|
return { icon: null, translationKey: "undefined translation" };
|
|
14666
14697
|
}
|
|
@@ -14669,7 +14700,7 @@ var OperatorLabel = ({ operator }) => {
|
|
|
14669
14700
|
const translation = useHightideTranslation();
|
|
14670
14701
|
const { icon, translationKey } = getOperatorInfo(operator);
|
|
14671
14702
|
const label = typeof translationKey === "string" ? translation(translationKey) : translationKey;
|
|
14672
|
-
return /* @__PURE__ */ (0,
|
|
14703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-1 items-center gap-2", children: [
|
|
14673
14704
|
icon,
|
|
14674
14705
|
label
|
|
14675
14706
|
] });
|
|
@@ -14683,8 +14714,8 @@ var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14683
14714
|
...TableFilterOperator.generic
|
|
14684
14715
|
], []);
|
|
14685
14716
|
const needsParameterInput = !["textNotWhitespace", "undefined", "notUndefined"].includes(operator);
|
|
14686
|
-
return /* @__PURE__ */ (0,
|
|
14687
|
-
/* @__PURE__ */ (0,
|
|
14717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
14718
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14688
14719
|
Select,
|
|
14689
14720
|
{
|
|
14690
14721
|
value: operator,
|
|
@@ -14695,11 +14726,11 @@ var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14695
14726
|
});
|
|
14696
14727
|
},
|
|
14697
14728
|
buttonProps: { className: "min-w-64" },
|
|
14698
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
14729
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
14699
14730
|
}
|
|
14700
14731
|
),
|
|
14701
|
-
/* @__PURE__ */ (0,
|
|
14702
|
-
/* @__PURE__ */ (0,
|
|
14732
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
14733
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14703
14734
|
Input,
|
|
14704
14735
|
{
|
|
14705
14736
|
value: parameter.searchText ?? "",
|
|
@@ -14713,7 +14744,7 @@ var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14713
14744
|
className: "min-w-64"
|
|
14714
14745
|
}
|
|
14715
14746
|
) }),
|
|
14716
|
-
/* @__PURE__ */ (0,
|
|
14747
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm text-description h-10", children: translation("noParameterRequired") }) })
|
|
14717
14748
|
] });
|
|
14718
14749
|
};
|
|
14719
14750
|
var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14726,8 +14757,8 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14726
14757
|
], []);
|
|
14727
14758
|
const needsRangeInput = operator === "numberBetween" || operator === "numberNotBetween";
|
|
14728
14759
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14729
|
-
return /* @__PURE__ */ (0,
|
|
14730
|
-
/* @__PURE__ */ (0,
|
|
14760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
14761
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14731
14762
|
Select,
|
|
14732
14763
|
{
|
|
14733
14764
|
value: operator,
|
|
@@ -14738,12 +14769,12 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14738
14769
|
});
|
|
14739
14770
|
},
|
|
14740
14771
|
buttonProps: { className: "min-w-64" },
|
|
14741
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
14772
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
14742
14773
|
}
|
|
14743
14774
|
),
|
|
14744
|
-
/* @__PURE__ */ (0,
|
|
14745
|
-
/* @__PURE__ */ (0,
|
|
14746
|
-
/* @__PURE__ */ (0,
|
|
14775
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
14776
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
14777
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FormFieldLayout, { label: translation("min"), children: ({ ariaAttributes, interactionStates, id }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14747
14778
|
Input,
|
|
14748
14779
|
{
|
|
14749
14780
|
...ariaAttributes,
|
|
@@ -14762,7 +14793,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14762
14793
|
className: "input-indicator-hidden min-w-64"
|
|
14763
14794
|
}
|
|
14764
14795
|
) }),
|
|
14765
|
-
/* @__PURE__ */ (0,
|
|
14796
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FormFieldLayout, { label: translation("max"), children: ({ ariaAttributes, interactionStates, id }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14766
14797
|
Input,
|
|
14767
14798
|
{
|
|
14768
14799
|
...ariaAttributes,
|
|
@@ -14782,7 +14813,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14782
14813
|
}
|
|
14783
14814
|
) })
|
|
14784
14815
|
] }) }),
|
|
14785
|
-
/* @__PURE__ */ (0,
|
|
14816
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14786
14817
|
Input,
|
|
14787
14818
|
{
|
|
14788
14819
|
value: parameter.compareValue?.toString() ?? "",
|
|
@@ -14798,7 +14829,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14798
14829
|
className: "min-w-64"
|
|
14799
14830
|
}
|
|
14800
14831
|
) }),
|
|
14801
|
-
/* @__PURE__ */ (0,
|
|
14832
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
14802
14833
|
] });
|
|
14803
14834
|
};
|
|
14804
14835
|
var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14813,8 +14844,8 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14813
14844
|
], []);
|
|
14814
14845
|
const needsRangeInput = operator === "dateBetween" || operator === "dateNotBetween";
|
|
14815
14846
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14816
|
-
return /* @__PURE__ */ (0,
|
|
14817
|
-
/* @__PURE__ */ (0,
|
|
14847
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
14848
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14818
14849
|
Select,
|
|
14819
14850
|
{
|
|
14820
14851
|
value: operator,
|
|
@@ -14825,12 +14856,12 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14825
14856
|
});
|
|
14826
14857
|
},
|
|
14827
14858
|
buttonProps: { className: "min-w-64" },
|
|
14828
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
14859
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
14829
14860
|
}
|
|
14830
14861
|
),
|
|
14831
|
-
/* @__PURE__ */ (0,
|
|
14832
|
-
/* @__PURE__ */ (0,
|
|
14833
|
-
/* @__PURE__ */ (0,
|
|
14862
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
14863
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
14864
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14834
14865
|
DateTimeInput,
|
|
14835
14866
|
{
|
|
14836
14867
|
value: temporaryMinDateValue ?? parameter.min ?? null,
|
|
@@ -14863,7 +14894,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14863
14894
|
className: "min-w-64"
|
|
14864
14895
|
}
|
|
14865
14896
|
),
|
|
14866
|
-
/* @__PURE__ */ (0,
|
|
14897
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14867
14898
|
DateTimeInput,
|
|
14868
14899
|
{
|
|
14869
14900
|
value: temporaryMaxDateValue ?? parameter.max ?? null,
|
|
@@ -14896,7 +14927,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14896
14927
|
}
|
|
14897
14928
|
)
|
|
14898
14929
|
] }) }),
|
|
14899
|
-
/* @__PURE__ */ (0,
|
|
14930
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14900
14931
|
DateTimeInput,
|
|
14901
14932
|
{
|
|
14902
14933
|
value: parameter.compareDate ?? null,
|
|
@@ -14912,7 +14943,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14912
14943
|
className: "min-w-64"
|
|
14913
14944
|
}
|
|
14914
14945
|
) }),
|
|
14915
|
-
/* @__PURE__ */ (0,
|
|
14946
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
14916
14947
|
] });
|
|
14917
14948
|
};
|
|
14918
14949
|
var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14921,7 +14952,7 @@ var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14921
14952
|
...TableFilterOperator.boolean,
|
|
14922
14953
|
...TableFilterOperator.generic
|
|
14923
14954
|
], []);
|
|
14924
|
-
return /* @__PURE__ */ (0,
|
|
14955
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14925
14956
|
Select,
|
|
14926
14957
|
{
|
|
14927
14958
|
value: operator,
|
|
@@ -14932,13 +14963,13 @@ var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14932
14963
|
});
|
|
14933
14964
|
},
|
|
14934
14965
|
buttonProps: { className: "min-w-64" },
|
|
14935
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
14966
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
14936
14967
|
}
|
|
14937
14968
|
) });
|
|
14938
14969
|
};
|
|
14939
14970
|
var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
14940
14971
|
const translation = useHightideTranslation();
|
|
14941
|
-
const { table } =
|
|
14972
|
+
const { table } = useTableDataContext();
|
|
14942
14973
|
const operator = filterValue?.operator ?? "tagsContains";
|
|
14943
14974
|
const parameter = filterValue?.parameter ?? {};
|
|
14944
14975
|
const availableOperators = (0, import_react66.useMemo)(() => [
|
|
@@ -14954,8 +14985,8 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14954
14985
|
return null;
|
|
14955
14986
|
}
|
|
14956
14987
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14957
|
-
return /* @__PURE__ */ (0,
|
|
14958
|
-
/* @__PURE__ */ (0,
|
|
14988
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
14989
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14959
14990
|
Select,
|
|
14960
14991
|
{
|
|
14961
14992
|
value: operator,
|
|
@@ -14966,11 +14997,11 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14966
14997
|
});
|
|
14967
14998
|
},
|
|
14968
14999
|
buttonProps: { className: "min-w-64" },
|
|
14969
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
15000
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
14970
15001
|
}
|
|
14971
15002
|
),
|
|
14972
|
-
/* @__PURE__ */ (0,
|
|
14973
|
-
/* @__PURE__ */ (0,
|
|
15003
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15004
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14974
15005
|
MultiSelectUncontrolled,
|
|
14975
15006
|
{
|
|
14976
15007
|
value: Array.isArray(parameter.searchTags) ? parameter.searchTags.map((tag) => String(tag)) : [],
|
|
@@ -14981,10 +15012,10 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14981
15012
|
});
|
|
14982
15013
|
},
|
|
14983
15014
|
buttonProps: { className: "min-w-64" },
|
|
14984
|
-
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0,
|
|
15015
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(MultiSelectOption, { value: tag, children: label }, tag))
|
|
14985
15016
|
}
|
|
14986
15017
|
) }),
|
|
14987
|
-
/* @__PURE__ */ (0,
|
|
15018
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: !needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "text-sm text-description", children: translation("noParameterRequired") }) })
|
|
14988
15019
|
] });
|
|
14989
15020
|
};
|
|
14990
15021
|
var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14992,7 +15023,7 @@ var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14992
15023
|
const availableOperators = (0, import_react66.useMemo)(() => [
|
|
14993
15024
|
...TableFilterOperator.generic
|
|
14994
15025
|
], []);
|
|
14995
|
-
return /* @__PURE__ */ (0,
|
|
15026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14996
15027
|
Select,
|
|
14997
15028
|
{
|
|
14998
15029
|
value: operator,
|
|
@@ -15003,31 +15034,31 @@ var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
15003
15034
|
});
|
|
15004
15035
|
},
|
|
15005
15036
|
buttonProps: { className: "min-w-64" },
|
|
15006
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
15037
|
+
children: availableOperators.map((op) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(SelectOption, { value: op, iconAppearance: "right", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(OperatorLabel, { operator: op }) }, op))
|
|
15007
15038
|
}
|
|
15008
15039
|
) });
|
|
15009
15040
|
};
|
|
15010
15041
|
var TableFilterContent = ({ filterType, ...props }) => {
|
|
15011
15042
|
switch (filterType) {
|
|
15012
15043
|
case "text":
|
|
15013
|
-
return /* @__PURE__ */ (0,
|
|
15044
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TextFilter, { ...props });
|
|
15014
15045
|
case "number":
|
|
15015
|
-
return /* @__PURE__ */ (0,
|
|
15046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(NumberFilter, { ...props });
|
|
15016
15047
|
case "date":
|
|
15017
|
-
return /* @__PURE__ */ (0,
|
|
15048
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DateFilter, { ...props });
|
|
15018
15049
|
case "boolean":
|
|
15019
|
-
return /* @__PURE__ */ (0,
|
|
15050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(BooleanFilter, { ...props });
|
|
15020
15051
|
case "tags":
|
|
15021
|
-
return /* @__PURE__ */ (0,
|
|
15052
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TagsFilter, { ...props });
|
|
15022
15053
|
case "generic":
|
|
15023
|
-
return /* @__PURE__ */ (0,
|
|
15054
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(GenericFilter, { ...props });
|
|
15024
15055
|
default:
|
|
15025
15056
|
return null;
|
|
15026
15057
|
}
|
|
15027
15058
|
};
|
|
15028
15059
|
|
|
15029
15060
|
// src/components/layout/table/TableFilterButton.tsx
|
|
15030
|
-
var
|
|
15061
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
15031
15062
|
var TableFilterButton = ({
|
|
15032
15063
|
filterType,
|
|
15033
15064
|
column
|
|
@@ -15051,8 +15082,8 @@ var TableFilterButton = ({
|
|
|
15051
15082
|
if (filterType === "tags" && (!column.columnDef.meta?.filterData?.tags?.length || column.columnDef.meta.filterData.tags.length === 0)) {
|
|
15052
15083
|
return null;
|
|
15053
15084
|
}
|
|
15054
|
-
return /* @__PURE__ */ (0,
|
|
15055
|
-
/* @__PURE__ */ (0,
|
|
15085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
15086
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
15056
15087
|
Button,
|
|
15057
15088
|
{
|
|
15058
15089
|
ref: anchorRef,
|
|
@@ -15068,12 +15099,12 @@ var TableFilterButton = ({
|
|
|
15068
15099
|
"aria-labelledby": ids.label,
|
|
15069
15100
|
className: "relative",
|
|
15070
15101
|
children: [
|
|
15071
|
-
/* @__PURE__ */ (0,
|
|
15072
|
-
/* @__PURE__ */ (0,
|
|
15102
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.FilterIcon, { className: "size-4" }),
|
|
15103
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: hasFilter, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "absolute -top-1 -right-1 w-2 h-2 rounded-full bg-primary" }) })
|
|
15073
15104
|
]
|
|
15074
15105
|
}
|
|
15075
15106
|
),
|
|
15076
|
-
/* @__PURE__ */ (0,
|
|
15107
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
15077
15108
|
PopUp,
|
|
15078
15109
|
{
|
|
15079
15110
|
ref: containerRef,
|
|
@@ -15089,8 +15120,8 @@ var TableFilterButton = ({
|
|
|
15089
15120
|
"aria-labelledby": ids.label,
|
|
15090
15121
|
className: "flex-col-2 p-2 items-start",
|
|
15091
15122
|
children: [
|
|
15092
|
-
/* @__PURE__ */ (0,
|
|
15093
|
-
/* @__PURE__ */ (0,
|
|
15123
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { id: ids.label, className: "typography-label-lg font-semibold", children: translation("filter") }),
|
|
15124
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15094
15125
|
TableFilterContent,
|
|
15095
15126
|
{
|
|
15096
15127
|
columnId: column.id,
|
|
@@ -15099,12 +15130,12 @@ var TableFilterButton = ({
|
|
|
15099
15130
|
onFilterValueChange: setFilterValue
|
|
15100
15131
|
}
|
|
15101
15132
|
),
|
|
15102
|
-
/* @__PURE__ */ (0,
|
|
15103
|
-
hasFilter && /* @__PURE__ */ (0,
|
|
15133
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-2 justify-end w-full", children: [
|
|
15134
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Button, { color: "negative", size: "sm", onClick: () => {
|
|
15104
15135
|
column.setFilterValue(void 0);
|
|
15105
15136
|
setIsOpen(false);
|
|
15106
15137
|
}, children: translation("remove") }),
|
|
15107
|
-
/* @__PURE__ */ (0,
|
|
15138
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Button, { size: "sm", onClick: () => {
|
|
15108
15139
|
if (filterValue) {
|
|
15109
15140
|
column.setFilterValue(filterValue);
|
|
15110
15141
|
}
|
|
@@ -15119,8 +15150,8 @@ var TableFilterButton = ({
|
|
|
15119
15150
|
|
|
15120
15151
|
// src/components/layout/table/TableHeader.tsx
|
|
15121
15152
|
var import_react68 = require("react");
|
|
15122
|
-
var
|
|
15123
|
-
var TableHeader = ({ table: tableOverride }) => {
|
|
15153
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
15154
|
+
var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
15124
15155
|
const { table: tableState } = useTableHeaderContext();
|
|
15125
15156
|
const table = tableOverride ?? tableState;
|
|
15126
15157
|
const handleResizeMove = (0, import_react68.useCallback)((e) => {
|
|
@@ -15165,8 +15196,8 @@ var TableHeader = ({ table: tableOverride }) => {
|
|
|
15165
15196
|
window.removeEventListener("pointerup", handleResizeEnd);
|
|
15166
15197
|
};
|
|
15167
15198
|
}, [handleResizeEnd, handleResizeMove, table]);
|
|
15168
|
-
return /* @__PURE__ */ (0,
|
|
15169
|
-
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0,
|
|
15199
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
15200
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
15170
15201
|
"col",
|
|
15171
15202
|
{
|
|
15172
15203
|
style: {
|
|
@@ -15177,16 +15208,16 @@ var TableHeader = ({ table: tableOverride }) => {
|
|
|
15177
15208
|
},
|
|
15178
15209
|
header.id
|
|
15179
15210
|
)) }, headerGroup.id)),
|
|
15180
|
-
/* @__PURE__ */ (0,
|
|
15181
|
-
return /* @__PURE__ */ (0,
|
|
15211
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("tr", { className: (0, import_clsx32.default)("table-header-row", table.options.meta?.headerRowClassName), children: headerGroup.headers.map((header) => {
|
|
15212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
15182
15213
|
"th",
|
|
15183
15214
|
{
|
|
15184
15215
|
colSpan: header.colSpan,
|
|
15185
|
-
"data-
|
|
15186
|
-
className: (0,
|
|
15216
|
+
"data-sticky": isSticky ? "" : void 0,
|
|
15217
|
+
className: (0, import_clsx32.default)("table-header-cell group/table-header-cell", header.column.columnDef.meta?.className),
|
|
15187
15218
|
children: [
|
|
15188
|
-
/* @__PURE__ */ (0,
|
|
15189
|
-
/* @__PURE__ */ (0,
|
|
15219
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Visibility, { isVisible: !header.isPlaceholder, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "flex-row-1 items-center", children: [
|
|
15220
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Visibility, { isVisible: header.column.getCanSort(), children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
15190
15221
|
TableSortButton,
|
|
15191
15222
|
{
|
|
15192
15223
|
sortDirection: header.column.getIsSorted(),
|
|
@@ -15212,19 +15243,19 @@ var TableHeader = ({ table: tableOverride }) => {
|
|
|
15212
15243
|
}
|
|
15213
15244
|
}
|
|
15214
15245
|
) }),
|
|
15215
|
-
/* @__PURE__ */ (0,
|
|
15246
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Visibility, { isVisible: header.column.getCanFilter() && isTableFilterCategory(header.column.columnDef.filterFn), children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
15216
15247
|
TableFilterButton,
|
|
15217
15248
|
{
|
|
15218
15249
|
column: header.column,
|
|
15219
15250
|
filterType: header.column.columnDef.filterFn
|
|
15220
15251
|
}
|
|
15221
15252
|
) }),
|
|
15222
|
-
(0,
|
|
15253
|
+
(0, import_react_table3.flexRender)(
|
|
15223
15254
|
header.column.columnDef.header,
|
|
15224
15255
|
header.getContext()
|
|
15225
15256
|
)
|
|
15226
15257
|
] }) }),
|
|
15227
|
-
/* @__PURE__ */ (0,
|
|
15258
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Visibility, { isVisible: header.column.getCanResize(), children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
15228
15259
|
"div",
|
|
15229
15260
|
{
|
|
15230
15261
|
onPointerDown: (e) => {
|
|
@@ -15255,336 +15286,88 @@ var TableHeader = ({ table: tableOverride }) => {
|
|
|
15255
15286
|
};
|
|
15256
15287
|
|
|
15257
15288
|
// src/components/layout/table/TableDisplay.tsx
|
|
15258
|
-
var
|
|
15289
|
+
var import_clsx33 = __toESM(require("clsx"));
|
|
15290
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
15259
15291
|
var TableDisplay = ({
|
|
15260
15292
|
children,
|
|
15261
15293
|
containerProps,
|
|
15294
|
+
tableHeaderProps,
|
|
15262
15295
|
...props
|
|
15263
15296
|
}) => {
|
|
15264
|
-
const { table } =
|
|
15297
|
+
const { table } = useTableDataContext();
|
|
15265
15298
|
const { containerRef } = useTableContainerContext();
|
|
15266
15299
|
const { sizeVars } = useTableHeaderContext();
|
|
15267
|
-
return /* @__PURE__ */ (0,
|
|
15300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { ...containerProps, ref: containerRef, className: (0, import_clsx33.default)("table-container", containerProps?.className), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
15268
15301
|
"table",
|
|
15269
15302
|
{
|
|
15270
15303
|
...props,
|
|
15271
|
-
|
|
15304
|
+
className: (0, import_clsx33.default)("table", props.className),
|
|
15272
15305
|
style: {
|
|
15273
15306
|
...sizeVars,
|
|
15274
15307
|
width: Math.floor(Math.max(table.getTotalSize(), containerRef.current?.offsetWidth ?? table.getTotalSize()))
|
|
15275
15308
|
},
|
|
15276
15309
|
children: [
|
|
15277
15310
|
children,
|
|
15278
|
-
/* @__PURE__ */ (0,
|
|
15279
|
-
/* @__PURE__ */ (0,
|
|
15311
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TableHeader, { ...tableHeaderProps }),
|
|
15312
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TableBody, {})
|
|
15280
15313
|
]
|
|
15281
|
-
}
|
|
15282
|
-
) });
|
|
15283
|
-
};
|
|
15284
|
-
|
|
15285
|
-
// src/components/layout/table/TablePagination.tsx
|
|
15286
|
-
var import_react69 = require("react");
|
|
15287
|
-
var
|
|
15288
|
-
var
|
|
15289
|
-
|
|
15290
|
-
|
|
15291
|
-
|
|
15292
|
-
const
|
|
15293
|
-
|
|
15294
|
-
|
|
15295
|
-
|
|
15296
|
-
|
|
15297
|
-
|
|
15298
|
-
|
|
15299
|
-
|
|
15300
|
-
|
|
15301
|
-
|
|
15302
|
-
|
|
15303
|
-
|
|
15304
|
-
|
|
15305
|
-
|
|
15306
|
-
|
|
15307
|
-
var
|
|
15308
|
-
|
|
15309
|
-
|
|
15310
|
-
|
|
15311
|
-
|
|
15312
|
-
const
|
|
15313
|
-
|
|
15314
|
-
|
|
15315
|
-
|
|
15316
|
-
|
|
15317
|
-
|
|
15318
|
-
|
|
15319
|
-
|
|
15320
|
-
|
|
15321
|
-
|
|
15322
|
-
|
|
15323
|
-
|
|
15324
|
-
|
|
15325
|
-
|
|
15326
|
-
|
|
15327
|
-
|
|
15328
|
-
|
|
15329
|
-
previousSizing,
|
|
15330
|
-
newSizing,
|
|
15331
|
-
columnIds,
|
|
15332
|
-
target,
|
|
15333
|
-
minWidthsPerColumn,
|
|
15334
|
-
maxWidthsPerColumn
|
|
15335
|
-
}) => {
|
|
15336
|
-
if (columnIds.length === 0) {
|
|
15337
|
-
return {};
|
|
15338
|
-
}
|
|
15339
|
-
const deltas = {};
|
|
15340
|
-
const removedColumns = Object.keys(newSizing).filter((columnId) => !columnIds.includes(columnId));
|
|
15341
|
-
for (const columnId of removedColumns) {
|
|
15342
|
-
delete newSizing[columnId];
|
|
15343
|
-
}
|
|
15344
|
-
for (const columnId of columnIds) {
|
|
15345
|
-
if (!newSizing[columnId]) {
|
|
15346
|
-
newSizing[columnId] = 0;
|
|
15347
|
-
continue;
|
|
15348
|
-
}
|
|
15349
|
-
const delta = (newSizing[columnId] ?? 0) - (previousSizing[columnId] ?? 0);
|
|
15350
|
-
if (delta !== 0) {
|
|
15351
|
-
deltas[columnId] = delta;
|
|
15352
|
-
}
|
|
15353
|
-
}
|
|
15354
|
-
const minWidth = Object.values(minWidthsPerColumn).reduce((previousValue, currentValue) => previousValue + currentValue, 0);
|
|
15355
|
-
const maxWidth = maxWidthsPerColumn ? Object.values(maxWidthsPerColumn).reduce((previousValue, currentValue) => previousValue + currentValue, 0) : Infinity;
|
|
15356
|
-
if (minWidth > maxWidth) {
|
|
15357
|
-
throw new Error("Min width is greater than max width");
|
|
15358
|
-
}
|
|
15359
|
-
const hasTargetWidth = target?.width !== void 0;
|
|
15360
|
-
const result = {
|
|
15361
|
-
...newSizing
|
|
15362
|
-
};
|
|
15363
|
-
for (const columnId of columnIds) {
|
|
15364
|
-
result[columnId] = MathUtil.clamp(result[columnId], [minWidthsPerColumn[columnId], maxWidthsPerColumn?.[columnId] ?? Infinity]);
|
|
15365
|
-
}
|
|
15366
|
-
if (!hasTargetWidth) {
|
|
15367
|
-
return result;
|
|
15368
|
-
}
|
|
15369
|
-
let targetWidth = target?.width ?? -1;
|
|
15370
|
-
if (hasTargetWidth) {
|
|
15371
|
-
switch (target?.behaviour) {
|
|
15372
|
-
case "equalOrHigher":
|
|
15373
|
-
targetWidth = Math.max(target.width, minWidth);
|
|
15374
|
-
break;
|
|
15375
|
-
}
|
|
15376
|
-
}
|
|
15377
|
-
const resultWidth = Object.values(result).reduce((previousValue, currentValue) => previousValue + currentValue, 0);
|
|
15378
|
-
if (resultWidth == targetWidth) {
|
|
15379
|
-
return result;
|
|
15380
|
-
} else if (resultWidth < targetWidth) {
|
|
15381
|
-
const widthToGive = targetWidth - resultWidth;
|
|
15382
|
-
const lastColumnId = columnIds[columnIds.length - 1];
|
|
15383
|
-
result[lastColumnId] += widthToGive;
|
|
15384
|
-
return result;
|
|
15385
|
-
} else {
|
|
15386
|
-
const widthToTake = resultWidth - targetWidth;
|
|
15387
|
-
const lastColumnId = columnIds[columnIds.length - 1];
|
|
15388
|
-
const isLastColumnChanging = Object.keys(deltas).find((columnId) => columnId === lastColumnId) !== void 0;
|
|
15389
|
-
if (isLastColumnChanging) {
|
|
15390
|
-
return result;
|
|
15391
|
-
} else {
|
|
15392
|
-
result[lastColumnId] -= Math.max(widthToTake, minWidthsPerColumn[lastColumnId]);
|
|
15393
|
-
return result;
|
|
15394
|
-
}
|
|
15395
|
-
}
|
|
15396
|
-
};
|
|
15397
|
-
var toSizeVars = (sizing) => {
|
|
15398
|
-
return Object.entries(sizing).reduce((previousValue, [columnId, size]) => {
|
|
15399
|
-
return {
|
|
15400
|
-
...previousValue,
|
|
15401
|
-
[`--header-${columnId}-size`]: size
|
|
15402
|
-
};
|
|
15403
|
-
}, {});
|
|
15404
|
-
};
|
|
15405
|
-
var ColumnSizeUtil = {
|
|
15406
|
-
calculate,
|
|
15407
|
-
toSizeVars
|
|
15408
|
-
};
|
|
15409
|
-
|
|
15410
|
-
// src/components/layout/table/TableProvider.tsx
|
|
15411
|
-
var import_react_table3 = require("@tanstack/react-table");
|
|
15412
|
-
|
|
15413
|
-
// src/hooks/useResizeCallbackWrapper.ts
|
|
15414
|
-
var import_react70 = require("react");
|
|
15415
|
-
var useResizeCallbackWrapper = (callback) => {
|
|
15416
|
-
(0, import_react70.useEffect)(() => {
|
|
15417
|
-
window.addEventListener("resize", callback);
|
|
15418
|
-
return () => {
|
|
15419
|
-
window.removeEventListener("resize", callback);
|
|
15420
|
-
};
|
|
15421
|
-
}, [callback]);
|
|
15422
|
-
};
|
|
15423
|
-
|
|
15424
|
-
// src/components/layout/table/TableProvider.tsx
|
|
15425
|
-
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
15426
|
-
var TableProvider = ({
|
|
15427
|
-
data,
|
|
15428
|
-
isUsingFillerRows = true,
|
|
15429
|
-
fillerRow,
|
|
15430
|
-
initialState,
|
|
15431
|
-
onRowClick,
|
|
15432
|
-
defaultColumn: defaultColumnOverwrite,
|
|
15433
|
-
state,
|
|
15434
|
-
columns: columnsProp,
|
|
15435
|
-
children,
|
|
15436
|
-
...tableOptions
|
|
15437
|
-
}) => {
|
|
15438
|
-
const [registeredColumns, setRegisteredColumns] = (0, import_react71.useState)([]);
|
|
15439
|
-
const containerRef = (0, import_react71.useRef)(null);
|
|
15440
|
-
const registerColumn = (0, import_react71.useCallback)((column) => {
|
|
15441
|
-
setRegisteredColumns((prev) => {
|
|
15442
|
-
return [...prev, column];
|
|
15443
|
-
});
|
|
15444
|
-
return () => {
|
|
15445
|
-
setRegisteredColumns((prev) => {
|
|
15446
|
-
return prev.filter((value) => value.id !== column.id);
|
|
15447
|
-
});
|
|
15448
|
-
};
|
|
15449
|
-
}, []);
|
|
15450
|
-
const columns = (0, import_react71.useMemo)(() => {
|
|
15451
|
-
const contextColumns = Array.from(registeredColumns.values());
|
|
15452
|
-
if (columnsProp) {
|
|
15453
|
-
return [...contextColumns, ...columnsProp];
|
|
15454
|
-
}
|
|
15455
|
-
return contextColumns;
|
|
15456
|
-
}, [columnsProp, registeredColumns]);
|
|
15457
|
-
const defaultColumn = (0, import_react71.useMemo)(() => {
|
|
15458
|
-
return {
|
|
15459
|
-
minSize: 60,
|
|
15460
|
-
maxSize: 800,
|
|
15461
|
-
cell: ({ cell }) => {
|
|
15462
|
-
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TableCell, { children: String(cell.getValue()) });
|
|
15463
|
-
},
|
|
15464
|
-
enableResizing: true,
|
|
15465
|
-
enablePinning: true,
|
|
15466
|
-
...defaultColumnOverwrite
|
|
15467
|
-
};
|
|
15468
|
-
}, [defaultColumnOverwrite]);
|
|
15469
|
-
const [columnSizing, setColumnSizing] = (0, import_react71.useState)(columns.reduce((previousValue, currentValue) => {
|
|
15470
|
-
return {
|
|
15471
|
-
...previousValue,
|
|
15472
|
-
[currentValue.id]: currentValue.size ?? defaultColumn.size ?? currentValue.minSize ?? defaultColumn.minSize
|
|
15473
|
-
};
|
|
15474
|
-
}, {}));
|
|
15475
|
-
const [columnOrder, setColumnOrder] = (0, import_react71.useState)(state?.columnOrder ?? initialState?.columnOrder ?? []);
|
|
15476
|
-
(0, import_react71.useEffect)(() => {
|
|
15477
|
-
setColumnOrder((prev) => {
|
|
15478
|
-
const columnIds = columns.map((column) => column.id);
|
|
15479
|
-
const newColumnIds = columnIds.filter((columnId) => !prev.includes(columnId));
|
|
15480
|
-
const withoutRemovedColumns = prev.filter((columnId) => !columnIds.includes(columnId));
|
|
15481
|
-
return [...withoutRemovedColumns, ...newColumnIds];
|
|
15482
|
-
});
|
|
15483
|
-
}, [columns]);
|
|
15484
|
-
const adjustColumnSizes = (0, import_react71.useCallback)((previousSizing, newSizing) => {
|
|
15485
|
-
return ColumnSizeUtil.calculate({
|
|
15486
|
-
previousSizing,
|
|
15487
|
-
newSizing,
|
|
15488
|
-
minWidthsPerColumn: columns.reduce((previousValue, currentValue) => {
|
|
15489
|
-
return {
|
|
15490
|
-
...previousValue,
|
|
15491
|
-
[currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
|
|
15492
|
-
};
|
|
15493
|
-
}, {}),
|
|
15494
|
-
maxWidthsPerColumn: columns.reduce((previousValue, currentValue) => {
|
|
15495
|
-
return {
|
|
15496
|
-
...previousValue,
|
|
15497
|
-
[currentValue.id]: currentValue.maxSize ?? defaultColumn.maxSize
|
|
15498
|
-
};
|
|
15499
|
-
}, {}),
|
|
15500
|
-
columnIds: columns.map((column) => column.id),
|
|
15501
|
-
target: {
|
|
15502
|
-
width: Math.floor(containerRef.current?.getBoundingClientRect().width ?? 0),
|
|
15503
|
-
behaviour: "equalOrHigher"
|
|
15504
|
-
}
|
|
15505
|
-
});
|
|
15506
|
-
}, [columns, defaultColumn.maxSize, defaultColumn.minSize]);
|
|
15507
|
-
(0, import_react71.useEffect)(() => {
|
|
15508
|
-
setColumnSizing((prev) => adjustColumnSizes(prev, prev));
|
|
15509
|
-
}, [adjustColumnSizes, columns, defaultColumn.maxSize, defaultColumn.minSize]);
|
|
15510
|
-
useResizeCallbackWrapper((0, import_react71.useCallback)(() => {
|
|
15511
|
-
setColumnSizing((prev) => adjustColumnSizes(prev, prev));
|
|
15512
|
-
}, [adjustColumnSizes]));
|
|
15513
|
-
const table = (0, import_react_table3.useReactTable)({
|
|
15514
|
-
data,
|
|
15515
|
-
getCoreRowModel: (0, import_react_table3.getCoreRowModel)(),
|
|
15516
|
-
getFilteredRowModel: (0, import_react_table3.getFilteredRowModel)(),
|
|
15517
|
-
getSortedRowModel: (0, import_react_table3.getSortedRowModel)(),
|
|
15518
|
-
getPaginationRowModel: (0, import_react_table3.getPaginationRowModel)(),
|
|
15519
|
-
initialState,
|
|
15520
|
-
defaultColumn,
|
|
15521
|
-
columns,
|
|
15522
|
-
state: {
|
|
15523
|
-
...state,
|
|
15524
|
-
columnSizing,
|
|
15525
|
-
columnOrder
|
|
15526
|
-
},
|
|
15527
|
-
filterFns: {
|
|
15528
|
-
...tableOptions?.filterFns,
|
|
15529
|
-
text: TableFilter.text,
|
|
15530
|
-
number: TableFilter.number,
|
|
15531
|
-
date: TableFilter.date,
|
|
15532
|
-
boolean: TableFilter.boolean,
|
|
15533
|
-
tags: TableFilter.tags,
|
|
15534
|
-
generic: TableFilter.generic
|
|
15535
|
-
},
|
|
15536
|
-
onColumnSizingChange: (updaterOrValue) => {
|
|
15537
|
-
setColumnSizing((previous) => {
|
|
15538
|
-
const newSizing = typeof updaterOrValue === "function" ? updaterOrValue(previous) : updaterOrValue;
|
|
15539
|
-
return adjustColumnSizes(previous, newSizing);
|
|
15540
|
-
});
|
|
15541
|
-
},
|
|
15542
|
-
onColumnOrderChange: (updaterOrValue) => {
|
|
15543
|
-
setColumnOrder(updaterOrValue);
|
|
15544
|
-
if (tableOptions.onColumnOrderChange) {
|
|
15545
|
-
tableOptions.onColumnOrderChange(updaterOrValue);
|
|
15546
|
-
}
|
|
15547
|
-
},
|
|
15548
|
-
autoResetPageIndex: false,
|
|
15549
|
-
enableColumnResizing: true,
|
|
15550
|
-
columnResizeMode: "onChange",
|
|
15551
|
-
...tableOptions
|
|
15552
|
-
});
|
|
15553
|
-
const columnSizeVars = (0, import_react71.useMemo)(() => {
|
|
15554
|
-
return ColumnSizeUtil.toSizeVars(columnSizing);
|
|
15555
|
-
}, [columnSizing]);
|
|
15556
|
-
const pagination = table.getState().pagination;
|
|
15557
|
-
const tableBodyContextValue = (0, import_react71.useMemo)(() => ({
|
|
15558
|
-
table,
|
|
15559
|
-
columns,
|
|
15560
|
-
data,
|
|
15561
|
-
pagination,
|
|
15562
|
-
isUsingFillerRows,
|
|
15563
|
-
fillerRow,
|
|
15564
|
-
onRowClick
|
|
15565
|
-
}), [table, data, pagination, isUsingFillerRows, fillerRow, onRowClick, columns]);
|
|
15566
|
-
const tableColumnDefinitionContextValue = (0, import_react71.useMemo)(() => ({
|
|
15567
|
-
table,
|
|
15568
|
-
registerColumn
|
|
15569
|
-
}), [table, registerColumn]);
|
|
15570
|
-
const tableHeaderContextValue = (0, import_react71.useMemo)(() => ({
|
|
15571
|
-
table,
|
|
15572
|
-
sizeVars: columnSizeVars
|
|
15573
|
-
}), [table, columnSizeVars]);
|
|
15574
|
-
const tableContainerContextValue = (0, import_react71.useMemo)(() => ({
|
|
15575
|
-
table,
|
|
15576
|
-
containerRef
|
|
15577
|
-
}), [table, containerRef]);
|
|
15578
|
-
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TableBodyContext.Provider, { value: tableBodyContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TableColumnDefinitionContext.Provider, { value: tableColumnDefinitionContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TableHeaderContext.Provider, { value: tableHeaderContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(TableContainerContext.Provider, { value: tableContainerContextValue, children }) }) }) });
|
|
15314
|
+
}
|
|
15315
|
+
) });
|
|
15316
|
+
};
|
|
15317
|
+
|
|
15318
|
+
// src/components/layout/table/TablePagination.tsx
|
|
15319
|
+
var import_react69 = require("react");
|
|
15320
|
+
var import_clsx34 = __toESM(require("clsx"));
|
|
15321
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
15322
|
+
var TablePaginationMenu = () => {
|
|
15323
|
+
const { table } = useTableDataContext();
|
|
15324
|
+
(0, import_react69.useEffect)(() => {
|
|
15325
|
+
const { pageIndex } = table.getState().pagination;
|
|
15326
|
+
const pageCount = table.getPageCount();
|
|
15327
|
+
if (pageIndex >= pageCount || pageIndex < 0) {
|
|
15328
|
+
table.setPageIndex(MathUtil.clamp(pageIndex, [0, pageCount - 1]));
|
|
15329
|
+
}
|
|
15330
|
+
}, [table]);
|
|
15331
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
15332
|
+
Pagination,
|
|
15333
|
+
{
|
|
15334
|
+
pageIndex: table.getState().pagination.pageIndex,
|
|
15335
|
+
pageCount: table.getPageCount(),
|
|
15336
|
+
onPageIndexChanged: (page) => table.setPageIndex(page)
|
|
15337
|
+
}
|
|
15338
|
+
);
|
|
15339
|
+
};
|
|
15340
|
+
var defaultPageSizeOptions = [10, 25, 50, 100];
|
|
15341
|
+
var TablePageSizeSelect = ({
|
|
15342
|
+
pageSizeOptions = defaultPageSizeOptions,
|
|
15343
|
+
...props
|
|
15344
|
+
}) => {
|
|
15345
|
+
const { table } = useTableDataContext();
|
|
15346
|
+
const currentPageSize = table.getState().pagination.pageSize;
|
|
15347
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
15348
|
+
Select,
|
|
15349
|
+
{
|
|
15350
|
+
...props,
|
|
15351
|
+
value: currentPageSize.toString(),
|
|
15352
|
+
onValueChange: (value) => table.setPageSize(Number(value)),
|
|
15353
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(SelectOption, { value: size.toString(), children: size }, size))
|
|
15354
|
+
}
|
|
15355
|
+
);
|
|
15356
|
+
};
|
|
15357
|
+
var TablePagination = ({ allowChangingPageSize = true, pageSizeOptions, ...props }) => {
|
|
15358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { ...props, className: (0, import_clsx34.default)("flex-row-2 items-center justify-center", props.className), children: /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "relative", children: [
|
|
15359
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(TablePaginationMenu, {}),
|
|
15360
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(Visibility, { isVisible: allowChangingPageSize, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(TablePageSizeSelect, { pageSizeOptions, buttonProps: { className: "absolute left-1/1 top-1/2 -translate-y-1/2 translate-x-4 h-10 min-w-24" } }) })
|
|
15361
|
+
] }) });
|
|
15579
15362
|
};
|
|
15580
15363
|
|
|
15581
15364
|
// src/components/layout/table/TableWithSelectionProvider.tsx
|
|
15582
|
-
var
|
|
15365
|
+
var import_clsx35 = __toESM(require("clsx"));
|
|
15583
15366
|
|
|
15584
15367
|
// src/components/user-interaction/Checkbox.tsx
|
|
15585
|
-
var
|
|
15586
|
-
var
|
|
15587
|
-
var
|
|
15368
|
+
var import_lucide_react19 = require("lucide-react");
|
|
15369
|
+
var import_react70 = require("react");
|
|
15370
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
15588
15371
|
var Checkbox = ({
|
|
15589
15372
|
value = false,
|
|
15590
15373
|
indeterminate = false,
|
|
@@ -15598,11 +15381,11 @@ var Checkbox = ({
|
|
|
15598
15381
|
alwaysShowCheckIcon = false,
|
|
15599
15382
|
...props
|
|
15600
15383
|
}) => {
|
|
15601
|
-
const onChangeWrapper = (0,
|
|
15384
|
+
const onChangeWrapper = (0, import_react70.useCallback)(() => {
|
|
15602
15385
|
onValueChange?.(!value);
|
|
15603
15386
|
onEditComplete?.(!value);
|
|
15604
15387
|
}, [onEditComplete, onValueChange, value]);
|
|
15605
|
-
return /* @__PURE__ */ (0,
|
|
15388
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
15606
15389
|
"div",
|
|
15607
15390
|
{
|
|
15608
15391
|
...props,
|
|
@@ -15629,122 +15412,444 @@ var Checkbox = ({
|
|
|
15629
15412
|
"aria-checked": indeterminate ? "mixed" : value,
|
|
15630
15413
|
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
15631
15414
|
children: [
|
|
15632
|
-
/* @__PURE__ */ (0,
|
|
15633
|
-
/* @__PURE__ */ (0,
|
|
15415
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react19.Minus, { "data-name": "checkbox-indicator", "aria-hidden": true }) }),
|
|
15416
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react19.Check, { "data-name": "checkbox-indicator", "aria-hidden": true }) })
|
|
15634
15417
|
]
|
|
15635
15418
|
}
|
|
15636
|
-
);
|
|
15637
|
-
};
|
|
15638
|
-
var CheckboxUncontrolled = ({
|
|
15639
|
-
value: initialValue,
|
|
15640
|
-
onValueChange,
|
|
15641
|
-
...props
|
|
15642
|
-
}) => {
|
|
15643
|
-
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
15644
|
-
return /* @__PURE__ */ (0,
|
|
15645
|
-
Checkbox,
|
|
15646
|
-
{
|
|
15647
|
-
...props,
|
|
15648
|
-
value,
|
|
15649
|
-
onValueChange: setValue
|
|
15419
|
+
);
|
|
15420
|
+
};
|
|
15421
|
+
var CheckboxUncontrolled = ({
|
|
15422
|
+
value: initialValue,
|
|
15423
|
+
onValueChange,
|
|
15424
|
+
...props
|
|
15425
|
+
}) => {
|
|
15426
|
+
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
15427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
15428
|
+
Checkbox,
|
|
15429
|
+
{
|
|
15430
|
+
...props,
|
|
15431
|
+
value,
|
|
15432
|
+
onValueChange: setValue
|
|
15433
|
+
}
|
|
15434
|
+
);
|
|
15435
|
+
};
|
|
15436
|
+
|
|
15437
|
+
// src/components/layout/table/TableWithSelectionProvider.tsx
|
|
15438
|
+
var import_react71 = require("react");
|
|
15439
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
15440
|
+
var TableWithSelectionProvider = ({
|
|
15441
|
+
children,
|
|
15442
|
+
state,
|
|
15443
|
+
fillerRow,
|
|
15444
|
+
rowSelection,
|
|
15445
|
+
disableClickRowClickSelection = false,
|
|
15446
|
+
selectionRowId = "selection",
|
|
15447
|
+
onRowClick,
|
|
15448
|
+
meta,
|
|
15449
|
+
...props
|
|
15450
|
+
}) => {
|
|
15451
|
+
const columnDef = (0, import_react71.useMemo)(() => [
|
|
15452
|
+
{
|
|
15453
|
+
id: selectionRowId,
|
|
15454
|
+
header: ({ table }) => {
|
|
15455
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
15456
|
+
Checkbox,
|
|
15457
|
+
{
|
|
15458
|
+
value: table.getIsAllRowsSelected(),
|
|
15459
|
+
indeterminate: table.getIsSomeRowsSelected(),
|
|
15460
|
+
onValueChange: (value) => {
|
|
15461
|
+
const newValue = !!value;
|
|
15462
|
+
table.toggleAllRowsSelected(newValue);
|
|
15463
|
+
}
|
|
15464
|
+
}
|
|
15465
|
+
);
|
|
15466
|
+
},
|
|
15467
|
+
cell: ({ row }) => {
|
|
15468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Checkbox, { disabled: !row.getCanSelect(), value: row.getIsSelected(), onValueChange: row.getToggleSelectedHandler() });
|
|
15469
|
+
},
|
|
15470
|
+
size: 60,
|
|
15471
|
+
minSize: 60,
|
|
15472
|
+
maxSize: 60,
|
|
15473
|
+
enableResizing: false,
|
|
15474
|
+
enableSorting: false,
|
|
15475
|
+
enableHiding: false,
|
|
15476
|
+
enableColumnFilter: false
|
|
15477
|
+
},
|
|
15478
|
+
...props.columns ?? []
|
|
15479
|
+
], [selectionRowId, props.columns]);
|
|
15480
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
15481
|
+
TableProvider,
|
|
15482
|
+
{
|
|
15483
|
+
...props,
|
|
15484
|
+
fillerRow: (0, import_react71.useCallback)((columnId, table) => {
|
|
15485
|
+
if (columnId === selectionRowId) {
|
|
15486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Checkbox, { value: false, disabled: true, className: "max-w-6" });
|
|
15487
|
+
}
|
|
15488
|
+
return fillerRow?.(columnId, table) ?? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(FillerCell, {});
|
|
15489
|
+
}, [fillerRow, selectionRowId]),
|
|
15490
|
+
columns: columnDef,
|
|
15491
|
+
initialState: {
|
|
15492
|
+
...props.initialState,
|
|
15493
|
+
columnPinning: {
|
|
15494
|
+
...props.initialState?.columnPinning,
|
|
15495
|
+
left: [selectionRowId, ...props.initialState?.columnPinning?.left ?? []]
|
|
15496
|
+
}
|
|
15497
|
+
},
|
|
15498
|
+
state: {
|
|
15499
|
+
rowSelection,
|
|
15500
|
+
...state
|
|
15501
|
+
},
|
|
15502
|
+
onRowClick: (0, import_react71.useCallback)((row, table) => {
|
|
15503
|
+
if (!disableClickRowClickSelection) {
|
|
15504
|
+
row.toggleSelected();
|
|
15505
|
+
}
|
|
15506
|
+
onRowClick?.(row, table);
|
|
15507
|
+
}, [disableClickRowClickSelection, onRowClick]),
|
|
15508
|
+
meta: {
|
|
15509
|
+
...meta,
|
|
15510
|
+
bodyRowClassName: (0, import_clsx35.default)(
|
|
15511
|
+
{ "cursor-pointer": !disableClickRowClickSelection },
|
|
15512
|
+
meta?.bodyRowClassName
|
|
15513
|
+
)
|
|
15514
|
+
},
|
|
15515
|
+
children
|
|
15516
|
+
}
|
|
15517
|
+
);
|
|
15518
|
+
};
|
|
15519
|
+
|
|
15520
|
+
// src/components/layout/table/Table.tsx
|
|
15521
|
+
var import_clsx36 = __toESM(require("clsx"));
|
|
15522
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
15523
|
+
var Table = ({ children, table, paginationOptions, displayProps, header, footer, ...props }) => {
|
|
15524
|
+
const { showPagination = true, allowChangingPageSize, pageSizeOptions } = paginationOptions ?? {};
|
|
15525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { ...props, className: (0, import_clsx36.default)("flex-col-3", props.className), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(TableProvider, { ...table, children: [
|
|
15526
|
+
header,
|
|
15527
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TableDisplay, { ...displayProps, children }),
|
|
15528
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Visibility, { isVisible: showPagination, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TablePagination, { allowChangingPageSize, pageSizeOptions }) }),
|
|
15529
|
+
footer
|
|
15530
|
+
] }) });
|
|
15531
|
+
};
|
|
15532
|
+
var TableWithSelection = ({
|
|
15533
|
+
children,
|
|
15534
|
+
table,
|
|
15535
|
+
paginationOptions,
|
|
15536
|
+
displayProps,
|
|
15537
|
+
header,
|
|
15538
|
+
footer,
|
|
15539
|
+
...props
|
|
15540
|
+
}) => {
|
|
15541
|
+
const { showPagination = true, allowChangingPageSize, pageSizeOptions } = paginationOptions ?? {};
|
|
15542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { ...props, className: (0, import_clsx36.default)("flex-col-3", props.className), children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(TableWithSelectionProvider, { ...table, children: [
|
|
15543
|
+
header,
|
|
15544
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TableDisplay, { ...displayProps, children }),
|
|
15545
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Visibility, { isVisible: showPagination, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TablePagination, { allowChangingPageSize, pageSizeOptions }) }),
|
|
15546
|
+
footer
|
|
15547
|
+
] }) });
|
|
15548
|
+
};
|
|
15549
|
+
|
|
15550
|
+
// src/components/layout/table/TableColumn.tsx
|
|
15551
|
+
var import_react72 = require("react");
|
|
15552
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
15553
|
+
var TableColumnComponent = ({
|
|
15554
|
+
filterType,
|
|
15555
|
+
...props
|
|
15556
|
+
}) => {
|
|
15557
|
+
const { registerColumn } = useTableColumnDefinitionContext();
|
|
15558
|
+
const filterFn = filterType ?? props.filterFn;
|
|
15559
|
+
useLogOnce(
|
|
15560
|
+
"TableColumn: For filterType === tags, filterData.tags must be set.",
|
|
15561
|
+
filterType === "tags" && props.meta?.filterData?.tags === void 0
|
|
15562
|
+
);
|
|
15563
|
+
const [column] = (0, import_react72.useState)({
|
|
15564
|
+
...props,
|
|
15565
|
+
filterFn
|
|
15566
|
+
});
|
|
15567
|
+
(0, import_react72.useEffect)(() => {
|
|
15568
|
+
const unsubscribe = registerColumn(column);
|
|
15569
|
+
return () => {
|
|
15570
|
+
unsubscribe();
|
|
15571
|
+
};
|
|
15572
|
+
}, [registerColumn, column]);
|
|
15573
|
+
return null;
|
|
15574
|
+
};
|
|
15575
|
+
var TableColumnFactory = () => (0, import_react72.memo)(
|
|
15576
|
+
TableColumnComponent,
|
|
15577
|
+
(prevProps, nextProps) => {
|
|
15578
|
+
return prevProps.filterType === nextProps.filterType && prevProps.id === nextProps.id && prevProps["accessorKey"] === nextProps["accessorKey"] && prevProps.enableColumnFilter === nextProps.enableColumnFilter && prevProps.enableGlobalFilter === nextProps.enableGlobalFilter && prevProps.enableGrouping === nextProps.enableGrouping && prevProps.enableHiding === nextProps.enableHiding && prevProps.enablePinning === nextProps.enablePinning && prevProps.enableResizing === nextProps.enableResizing && prevProps.enableSorting === nextProps.enableSorting && prevProps.meta === nextProps.meta, prevProps.cell === nextProps.cell;
|
|
15579
|
+
}
|
|
15580
|
+
);
|
|
15581
|
+
var TableColumn = (props) => {
|
|
15582
|
+
const TableColumnComponent2 = (0, import_react72.useMemo)(() => TableColumnFactory(), []);
|
|
15583
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(TableColumnComponent2, { ...props });
|
|
15584
|
+
};
|
|
15585
|
+
|
|
15586
|
+
// src/components/layout/table/TableColumnSwitcher.tsx
|
|
15587
|
+
var import_react73 = require("react");
|
|
15588
|
+
var import_lucide_react20 = require("lucide-react");
|
|
15589
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
15590
|
+
var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
15591
|
+
const { table } = useTableDataContext();
|
|
15592
|
+
const translation = useHightideTranslation();
|
|
15593
|
+
const containerRef = (0, import_react73.useRef)(null);
|
|
15594
|
+
const generatedId = (0, import_react73.useId)();
|
|
15595
|
+
const ids = (0, import_react73.useMemo)(() => ({
|
|
15596
|
+
popup: props.id ?? `table-column-picker-popup-${generatedId}`,
|
|
15597
|
+
label: `table-column-picker-label-${generatedId}`
|
|
15598
|
+
}), [generatedId, props.id]);
|
|
15599
|
+
const tableState = table.getState();
|
|
15600
|
+
const columnOrder = tableState.columnOrder;
|
|
15601
|
+
const columnPinning = tableState.columnPinning;
|
|
15602
|
+
const columns = (0, import_react73.useMemo)(() => {
|
|
15603
|
+
const allColumns = table.getAllColumns();
|
|
15604
|
+
const leftPinned = [];
|
|
15605
|
+
const unpinned = [];
|
|
15606
|
+
const rightPinned = [];
|
|
15607
|
+
const columnMap = new Map(allColumns.map((col) => [col.id, col]));
|
|
15608
|
+
const processColumns = (columnIds, targetArray) => {
|
|
15609
|
+
for (const columnId of columnIds) {
|
|
15610
|
+
const column = columnMap.get(columnId);
|
|
15611
|
+
if (column) {
|
|
15612
|
+
targetArray.push(column);
|
|
15613
|
+
columnMap.delete(columnId);
|
|
15614
|
+
}
|
|
15615
|
+
}
|
|
15616
|
+
};
|
|
15617
|
+
if (columnOrder.length > 0) {
|
|
15618
|
+
const leftPinnedIds = columnPinning?.left ?? [];
|
|
15619
|
+
const rightPinnedIds = columnPinning?.right ?? [];
|
|
15620
|
+
processColumns(leftPinnedIds, leftPinned);
|
|
15621
|
+
processColumns(rightPinnedIds, rightPinned);
|
|
15622
|
+
for (const columnId of columnOrder) {
|
|
15623
|
+
if (!leftPinnedIds.includes(columnId) && !rightPinnedIds.includes(columnId)) {
|
|
15624
|
+
const column = columnMap.get(columnId);
|
|
15625
|
+
if (column) {
|
|
15626
|
+
unpinned.push(column);
|
|
15627
|
+
columnMap.delete(columnId);
|
|
15628
|
+
}
|
|
15629
|
+
}
|
|
15630
|
+
}
|
|
15631
|
+
for (const column of columnMap.values()) {
|
|
15632
|
+
const pinState = column.getIsPinned();
|
|
15633
|
+
if (pinState === "left") {
|
|
15634
|
+
leftPinned.push(column);
|
|
15635
|
+
} else if (pinState === "right") {
|
|
15636
|
+
rightPinned.push(column);
|
|
15637
|
+
} else {
|
|
15638
|
+
unpinned.push(column);
|
|
15639
|
+
}
|
|
15640
|
+
}
|
|
15641
|
+
} else {
|
|
15642
|
+
for (const column of allColumns) {
|
|
15643
|
+
const pinState = column.getIsPinned();
|
|
15644
|
+
if (pinState === "left") {
|
|
15645
|
+
leftPinned.push(column);
|
|
15646
|
+
} else if (pinState === "right") {
|
|
15647
|
+
rightPinned.push(column);
|
|
15648
|
+
} else {
|
|
15649
|
+
unpinned.push(column);
|
|
15650
|
+
}
|
|
15651
|
+
}
|
|
15652
|
+
}
|
|
15653
|
+
return [...leftPinned, ...unpinned, ...rightPinned];
|
|
15654
|
+
}, [table, columnOrder, columnPinning]);
|
|
15655
|
+
const moveColumn = (columnId, direction) => {
|
|
15656
|
+
const currentColumns = columns.map((col) => col.id);
|
|
15657
|
+
const currentIndex = currentColumns.indexOf(columnId);
|
|
15658
|
+
if (currentIndex === -1) return;
|
|
15659
|
+
const column = table.getColumn(columnId);
|
|
15660
|
+
if (!column) return;
|
|
15661
|
+
const isPinned = column.getIsPinned();
|
|
15662
|
+
if (isPinned) return;
|
|
15663
|
+
const newIndex = direction === "up" ? currentIndex - 1 : currentIndex + 1;
|
|
15664
|
+
if (newIndex < 0 || newIndex >= currentColumns.length) return;
|
|
15665
|
+
const targetColumn = table.getColumn(currentColumns[newIndex]);
|
|
15666
|
+
if (!targetColumn) return;
|
|
15667
|
+
const targetIsPinned = targetColumn.getIsPinned();
|
|
15668
|
+
if (targetIsPinned !== isPinned) return;
|
|
15669
|
+
const newOrder = [...currentColumns];
|
|
15670
|
+
const temp = newOrder[currentIndex];
|
|
15671
|
+
newOrder[currentIndex] = newOrder[newIndex];
|
|
15672
|
+
newOrder[newIndex] = temp;
|
|
15673
|
+
table.setColumnOrder(newOrder);
|
|
15674
|
+
};
|
|
15675
|
+
const toggleColumnVisibility = (columnId) => {
|
|
15676
|
+
const column = table.getColumn(columnId);
|
|
15677
|
+
column?.toggleVisibility();
|
|
15678
|
+
};
|
|
15679
|
+
const pinColumn = (columnId, side) => {
|
|
15680
|
+
const column = table.getColumn(columnId);
|
|
15681
|
+
if (!column || !column.getCanPin()) return;
|
|
15682
|
+
column.pin(side);
|
|
15683
|
+
};
|
|
15684
|
+
const unpinColumn = (columnId) => {
|
|
15685
|
+
const column = table.getColumn(columnId);
|
|
15686
|
+
if (!column || !column.getCanPin()) return;
|
|
15687
|
+
const pinState = column.getIsPinned();
|
|
15688
|
+
if (!pinState) return;
|
|
15689
|
+
column.pin(false);
|
|
15690
|
+
const currentOrder = table.getState().columnOrder;
|
|
15691
|
+
const unpinnedColumns = currentOrder.filter((id) => {
|
|
15692
|
+
const col = table.getColumn(id);
|
|
15693
|
+
return col && !col.getIsPinned();
|
|
15694
|
+
});
|
|
15695
|
+
if (pinState === "left") {
|
|
15696
|
+
const newOrder = [columnId, ...unpinnedColumns];
|
|
15697
|
+
table.setColumnOrder(newOrder);
|
|
15698
|
+
} else if (pinState === "right") {
|
|
15699
|
+
const newOrder = [...unpinnedColumns, columnId];
|
|
15700
|
+
table.setColumnOrder(newOrder);
|
|
15701
|
+
}
|
|
15702
|
+
};
|
|
15703
|
+
const getColumnHeader = (columnId) => {
|
|
15704
|
+
const column = table.getColumn(columnId);
|
|
15705
|
+
const header = column?.columnDef.header;
|
|
15706
|
+
if (typeof header === "string") {
|
|
15707
|
+
return header;
|
|
15650
15708
|
}
|
|
15651
|
-
|
|
15652
|
-
|
|
15653
|
-
|
|
15654
|
-
|
|
15655
|
-
|
|
15656
|
-
|
|
15657
|
-
|
|
15658
|
-
children,
|
|
15659
|
-
state,
|
|
15660
|
-
fillerRow,
|
|
15661
|
-
rowSelection,
|
|
15662
|
-
disableClickRowClickSelection = false,
|
|
15663
|
-
selectionRowId = "selection",
|
|
15664
|
-
onRowClick,
|
|
15665
|
-
meta,
|
|
15666
|
-
...props
|
|
15667
|
-
}) => {
|
|
15668
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
15669
|
-
TableProvider,
|
|
15709
|
+
if (typeof header === "function") {
|
|
15710
|
+
return columnId;
|
|
15711
|
+
}
|
|
15712
|
+
return columnId;
|
|
15713
|
+
};
|
|
15714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
15715
|
+
PopUp,
|
|
15670
15716
|
{
|
|
15671
15717
|
...props,
|
|
15672
|
-
|
|
15673
|
-
|
|
15674
|
-
|
|
15675
|
-
|
|
15676
|
-
|
|
15677
|
-
|
|
15678
|
-
initialState: {
|
|
15679
|
-
...props.initialState,
|
|
15680
|
-
columnPinning: {
|
|
15681
|
-
...props.initialState?.columnPinning,
|
|
15682
|
-
left: [selectionRowId, ...props.initialState?.columnPinning?.left ?? []]
|
|
15683
|
-
}
|
|
15684
|
-
},
|
|
15685
|
-
state: {
|
|
15686
|
-
rowSelection,
|
|
15687
|
-
...state
|
|
15688
|
-
},
|
|
15689
|
-
onRowClick: (0, import_react73.useCallback)((row, table) => {
|
|
15690
|
-
if (!disableClickRowClickSelection) {
|
|
15691
|
-
row.toggleSelected();
|
|
15692
|
-
}
|
|
15693
|
-
onRowClick?.(row, table);
|
|
15694
|
-
}, [disableClickRowClickSelection, onRowClick]),
|
|
15695
|
-
meta: {
|
|
15696
|
-
...meta,
|
|
15697
|
-
bodyRowClassName: (0, import_clsx31.default)(
|
|
15698
|
-
{ "cursor-pointer": !disableClickRowClickSelection },
|
|
15699
|
-
meta?.bodyRowClassName
|
|
15700
|
-
)
|
|
15718
|
+
ref: containerRef,
|
|
15719
|
+
id: ids.popup,
|
|
15720
|
+
options: {
|
|
15721
|
+
verticalAlignment: "afterEnd",
|
|
15722
|
+
horizontalAlignment: "center",
|
|
15723
|
+
...props.options
|
|
15701
15724
|
},
|
|
15725
|
+
role: "dialog",
|
|
15726
|
+
"aria-labelledby": ids.label,
|
|
15727
|
+
"aria-describedby": ids.label,
|
|
15728
|
+
className: "flex-col-1 p-2 items-start min-w-72",
|
|
15702
15729
|
children: [
|
|
15703
|
-
/* @__PURE__ */ (0,
|
|
15704
|
-
|
|
15705
|
-
{
|
|
15706
|
-
|
|
15707
|
-
|
|
15708
|
-
|
|
15709
|
-
|
|
15730
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-col-1", children: [
|
|
15731
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { id: ids.label, className: "typography-title-md font-semibold", children: translation("columnPicker") }),
|
|
15732
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-description typography-label-sm mb-2", children: translation("columnPickerDescription") })
|
|
15733
|
+
] }),
|
|
15734
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "flex-col-1 overflow-y-auto w-full", children: columns.map((column, index) => {
|
|
15735
|
+
const columnId = column.id;
|
|
15736
|
+
const isVisible = column.getIsVisible();
|
|
15737
|
+
const pinState = column.getIsPinned();
|
|
15738
|
+
const isPinned = column.getCanPin() && !!pinState;
|
|
15739
|
+
const prevColumn = index > 0 ? columns[index - 1] : null;
|
|
15740
|
+
const nextColumn = index < columns.length - 1 ? columns[index + 1] : null;
|
|
15741
|
+
const prevIsPinned = prevColumn?.getCanPin() && !!prevColumn.getIsPinned();
|
|
15742
|
+
const nextIsPinned = nextColumn?.getCanPin() && !!nextColumn.getIsPinned();
|
|
15743
|
+
const canMoveUp = index > 0 && !isPinned && !prevIsPinned;
|
|
15744
|
+
const canMoveDown = index < columns.length - 1 && !isPinned && !nextIsPinned;
|
|
15745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-row-2 items-center justify-between gap-2 w-full", children: [
|
|
15746
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "flex-row-2 gap-1", children: isPinned ? /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
15747
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15748
|
+
Button,
|
|
15710
15749
|
{
|
|
15711
|
-
|
|
15712
|
-
|
|
15713
|
-
|
|
15714
|
-
|
|
15715
|
-
|
|
15716
|
-
|
|
15750
|
+
layout: "icon",
|
|
15751
|
+
size: "sm",
|
|
15752
|
+
color: "neutral",
|
|
15753
|
+
coloringStyle: "text",
|
|
15754
|
+
disabled: pinState === "left",
|
|
15755
|
+
onClick: () => pinColumn(columnId, "left"),
|
|
15756
|
+
"aria-label": translation("pinLeft"),
|
|
15757
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react20.ChevronLeft, { className: "size-4" })
|
|
15717
15758
|
}
|
|
15718
|
-
)
|
|
15719
|
-
|
|
15720
|
-
|
|
15721
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15722
|
-
Checkbox,
|
|
15759
|
+
),
|
|
15760
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15761
|
+
Button,
|
|
15723
15762
|
{
|
|
15724
|
-
|
|
15725
|
-
|
|
15726
|
-
|
|
15763
|
+
layout: "icon",
|
|
15764
|
+
size: "sm",
|
|
15765
|
+
color: "neutral",
|
|
15766
|
+
coloringStyle: "text",
|
|
15767
|
+
disabled: pinState === "right",
|
|
15768
|
+
onClick: () => pinColumn(columnId, "right"),
|
|
15769
|
+
"aria-label": translation("pinRight"),
|
|
15770
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react20.ChevronRight, { className: "size-4" })
|
|
15727
15771
|
}
|
|
15728
|
-
)
|
|
15729
|
-
},
|
|
15730
|
-
|
|
15731
|
-
|
|
15732
|
-
|
|
15733
|
-
|
|
15734
|
-
|
|
15735
|
-
|
|
15736
|
-
|
|
15737
|
-
|
|
15738
|
-
|
|
15739
|
-
|
|
15772
|
+
)
|
|
15773
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
15774
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15775
|
+
Button,
|
|
15776
|
+
{
|
|
15777
|
+
layout: "icon",
|
|
15778
|
+
size: "sm",
|
|
15779
|
+
color: "neutral",
|
|
15780
|
+
coloringStyle: "text",
|
|
15781
|
+
disabled: !canMoveUp,
|
|
15782
|
+
onClick: () => moveColumn(columnId, "up"),
|
|
15783
|
+
"aria-label": translation("moveUp"),
|
|
15784
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react20.ChevronUp, { className: "size-4" })
|
|
15785
|
+
}
|
|
15786
|
+
),
|
|
15787
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15788
|
+
Button,
|
|
15789
|
+
{
|
|
15790
|
+
layout: "icon",
|
|
15791
|
+
size: "sm",
|
|
15792
|
+
color: "neutral",
|
|
15793
|
+
coloringStyle: "text",
|
|
15794
|
+
disabled: !canMoveDown,
|
|
15795
|
+
onClick: () => moveColumn(columnId, "down"),
|
|
15796
|
+
"aria-label": translation("moveDown"),
|
|
15797
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react20.ChevronDown, { className: "size-4" })
|
|
15798
|
+
}
|
|
15799
|
+
)
|
|
15800
|
+
] }) }),
|
|
15801
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "flex-1 typography-label-lg", children: getColumnHeader(columnId) }),
|
|
15802
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
15803
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15804
|
+
Button,
|
|
15805
|
+
{
|
|
15806
|
+
layout: "icon",
|
|
15807
|
+
size: "sm",
|
|
15808
|
+
color: "neutral",
|
|
15809
|
+
coloringStyle: "text",
|
|
15810
|
+
disabled: !column.getCanHide(),
|
|
15811
|
+
onClick: () => toggleColumnVisibility(columnId),
|
|
15812
|
+
"aria-label": isVisible ? translation("hideColumn") : translation("showColumn"),
|
|
15813
|
+
children: isVisible ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react20.Eye, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react20.EyeOff, { className: "size-4" })
|
|
15814
|
+
}
|
|
15815
|
+
),
|
|
15816
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15817
|
+
Button,
|
|
15818
|
+
{
|
|
15819
|
+
layout: "icon",
|
|
15820
|
+
size: "sm",
|
|
15821
|
+
color: "neutral",
|
|
15822
|
+
coloringStyle: "text",
|
|
15823
|
+
disabled: !column.getCanPin(),
|
|
15824
|
+
onClick: () => {
|
|
15825
|
+
if (isPinned) {
|
|
15826
|
+
unpinColumn(columnId);
|
|
15827
|
+
} else {
|
|
15828
|
+
pinColumn(columnId, "left");
|
|
15829
|
+
}
|
|
15830
|
+
},
|
|
15831
|
+
"aria-label": isPinned ? translation("unpin") : translation("pinLeft"),
|
|
15832
|
+
children: isPinned ? /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react20.PinOff, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react20.Pin, { className: "size-4" })
|
|
15833
|
+
}
|
|
15834
|
+
)
|
|
15835
|
+
] })
|
|
15836
|
+
] }, columnId);
|
|
15837
|
+
}) })
|
|
15740
15838
|
]
|
|
15741
15839
|
}
|
|
15742
15840
|
);
|
|
15743
15841
|
};
|
|
15842
|
+
var TableColumnSwitcher = ({ buttonProps, ...props }) => {
|
|
15843
|
+
const translation = useHightideTranslation();
|
|
15844
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(PopUpRoot, { children: [
|
|
15845
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(PopUpOpener, { children: ({ props: props2 }) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Tooltip, { tooltip: translation("changeColumnDisplay"), children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(Button, { ...props2, size: "md", layout: "icon", color: "neutral", coloringStyle: "solid", ...buttonProps, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react20.ArrowLeftRightIcon, { className: "size-4" }) }) }) }),
|
|
15846
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TableColumnSwitcherPopUp, { ...props })
|
|
15847
|
+
] });
|
|
15848
|
+
};
|
|
15744
15849
|
|
|
15745
15850
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
15746
15851
|
var import_react74 = require("react");
|
|
15747
|
-
var
|
|
15852
|
+
var import_clsx37 = require("clsx");
|
|
15748
15853
|
|
|
15749
15854
|
// src/utils/writeToClipboard.ts
|
|
15750
15855
|
var writeToClipboard = (text) => {
|
|
@@ -15753,7 +15858,7 @@ var writeToClipboard = (text) => {
|
|
|
15753
15858
|
|
|
15754
15859
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
15755
15860
|
var import_lucide_react21 = require("lucide-react");
|
|
15756
|
-
var
|
|
15861
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
15757
15862
|
var CopyToClipboardWrapper = ({
|
|
15758
15863
|
children,
|
|
15759
15864
|
textToCopy,
|
|
@@ -15784,10 +15889,10 @@ var CopyToClipboardWrapper = ({
|
|
|
15784
15889
|
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
15785
15890
|
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
15786
15891
|
};
|
|
15787
|
-
return /* @__PURE__ */ (0,
|
|
15892
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
15788
15893
|
"div",
|
|
15789
15894
|
{
|
|
15790
|
-
className: (0,
|
|
15895
|
+
className: (0, import_clsx37.clsx)("relative inline-block cursor-copy", containerClassName),
|
|
15791
15896
|
onMouseEnter: () => {
|
|
15792
15897
|
setIsShowingIndication(true);
|
|
15793
15898
|
},
|
|
@@ -15802,10 +15907,10 @@ var CopyToClipboardWrapper = ({
|
|
|
15802
15907
|
},
|
|
15803
15908
|
children: [
|
|
15804
15909
|
children,
|
|
15805
|
-
/* @__PURE__ */ (0,
|
|
15910
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
15806
15911
|
"div",
|
|
15807
15912
|
{
|
|
15808
|
-
className: (0,
|
|
15913
|
+
className: (0, import_clsx37.clsx)(
|
|
15809
15914
|
`absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
|
|
15810
15915
|
shadow-around-md bg-tooltip-background cursor-default pointer-events-none`,
|
|
15811
15916
|
"transition-opacity duration-200",
|
|
@@ -15817,18 +15922,18 @@ var CopyToClipboardWrapper = ({
|
|
|
15817
15922
|
opacity: isShowingIndication || isShowingConfirmation ? 1 : 0
|
|
15818
15923
|
},
|
|
15819
15924
|
children: [
|
|
15820
|
-
isShowingConfirmation && /* @__PURE__ */ (0,
|
|
15821
|
-
/* @__PURE__ */ (0,
|
|
15925
|
+
isShowingConfirmation && /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex-row-1", children: [
|
|
15926
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_lucide_react21.CheckIcon, { size: 16, className: "text-positive" }),
|
|
15822
15927
|
translation("copied")
|
|
15823
15928
|
] }),
|
|
15824
|
-
isShowingIndication && /* @__PURE__ */ (0,
|
|
15825
|
-
/* @__PURE__ */ (0,
|
|
15929
|
+
isShowingIndication && /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex-row-1 text-description", children: [
|
|
15930
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_lucide_react21.Copy, { size: 16 }),
|
|
15826
15931
|
translation("clickToCopy")
|
|
15827
15932
|
] }),
|
|
15828
|
-
/* @__PURE__ */ (0,
|
|
15933
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
15829
15934
|
"div",
|
|
15830
15935
|
{
|
|
15831
|
-
className: (0,
|
|
15936
|
+
className: (0, import_clsx37.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
|
|
15832
15937
|
style: { ...triangleStyle[position], zIndex: zIndex + 1 }
|
|
15833
15938
|
}
|
|
15834
15939
|
)
|
|
@@ -15842,7 +15947,7 @@ var CopyToClipboardWrapper = ({
|
|
|
15842
15947
|
|
|
15843
15948
|
// src/components/user-interaction/Menu.tsx
|
|
15844
15949
|
var import_react76 = require("react");
|
|
15845
|
-
var
|
|
15950
|
+
var import_clsx38 = __toESM(require("clsx"));
|
|
15846
15951
|
|
|
15847
15952
|
// src/hooks/useHoverState.ts
|
|
15848
15953
|
var import_react75 = require("react");
|
|
@@ -15889,16 +15994,16 @@ var useHoverState = (props = void 0) => {
|
|
|
15889
15994
|
};
|
|
15890
15995
|
|
|
15891
15996
|
// src/components/user-interaction/Menu.tsx
|
|
15892
|
-
var
|
|
15997
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
15893
15998
|
var MenuItem = ({
|
|
15894
15999
|
children,
|
|
15895
16000
|
onClick,
|
|
15896
16001
|
isDisabled = false,
|
|
15897
16002
|
className
|
|
15898
|
-
}) => /* @__PURE__ */ (0,
|
|
16003
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15899
16004
|
"div",
|
|
15900
16005
|
{
|
|
15901
|
-
className: (0,
|
|
16006
|
+
className: (0, import_clsx38.default)("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
|
|
15902
16007
|
"text-disabled cursor-not-allowed": isDisabled,
|
|
15903
16008
|
"text-menu-text hover:bg-primary/20": !isDisabled,
|
|
15904
16009
|
"cursor-pointer": !!onClick
|
|
@@ -15922,9 +16027,9 @@ var Menu = ({
|
|
|
15922
16027
|
toggleOpen: () => setIsOpen((prevState) => !prevState),
|
|
15923
16028
|
disabled
|
|
15924
16029
|
};
|
|
15925
|
-
return /* @__PURE__ */ (0,
|
|
16030
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
15926
16031
|
trigger(bag, (0, import_react76.useCallback)((el) => triggerRef.current = el, [])),
|
|
15927
|
-
/* @__PURE__ */ (0,
|
|
16032
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15928
16033
|
PopUp,
|
|
15929
16034
|
{
|
|
15930
16035
|
...props,
|
|
@@ -15946,8 +16051,8 @@ var Menu = ({
|
|
|
15946
16051
|
|
|
15947
16052
|
// src/components/user-interaction/ScrollPicker.tsx
|
|
15948
16053
|
var import_react77 = require("react");
|
|
15949
|
-
var
|
|
15950
|
-
var
|
|
16054
|
+
var import_clsx39 = __toESM(require("clsx"));
|
|
16055
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
15951
16056
|
var up = 1;
|
|
15952
16057
|
var down = -1;
|
|
15953
16058
|
var ScrollPicker = ({
|
|
@@ -16086,7 +16191,7 @@ var ScrollPicker = ({
|
|
|
16086
16191
|
}
|
|
16087
16192
|
return MathUtil.clamp(1 - opacityValue / max);
|
|
16088
16193
|
};
|
|
16089
|
-
return /* @__PURE__ */ (0,
|
|
16194
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
16090
16195
|
"div",
|
|
16091
16196
|
{
|
|
16092
16197
|
className: "relative overflow-hidden",
|
|
@@ -16097,15 +16202,15 @@ var ScrollPicker = ({
|
|
|
16097
16202
|
setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + deltaY }));
|
|
16098
16203
|
}
|
|
16099
16204
|
},
|
|
16100
|
-
children: /* @__PURE__ */ (0,
|
|
16101
|
-
/* @__PURE__ */ (0,
|
|
16205
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
|
|
16206
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
16102
16207
|
"div",
|
|
16103
16208
|
{
|
|
16104
16209
|
className: "absolute z-[1] top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-full min-w-[40px] border border-divider/50 border-y-2 border-x-0 ",
|
|
16105
16210
|
style: { height: `${itemHeight}px` }
|
|
16106
16211
|
}
|
|
16107
16212
|
),
|
|
16108
|
-
/* @__PURE__ */ (0,
|
|
16213
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
16109
16214
|
"div",
|
|
16110
16215
|
{
|
|
16111
16216
|
className: "flex-col-2 select-none",
|
|
@@ -16113,10 +16218,10 @@ var ScrollPicker = ({
|
|
|
16113
16218
|
transform: `translateY(${-transition * (distance + itemHeight)}px)`,
|
|
16114
16219
|
columnGap: `${distance}px`
|
|
16115
16220
|
},
|
|
16116
|
-
children: shownItems.map(({ name: name2, index }, arrayIndex) => /* @__PURE__ */ (0,
|
|
16221
|
+
children: shownItems.map(({ name: name2, index }, arrayIndex) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
16117
16222
|
"div",
|
|
16118
16223
|
{
|
|
16119
|
-
className: (0,
|
|
16224
|
+
className: (0, import_clsx39.default)(
|
|
16120
16225
|
`flex-col-2 items-center justify-center rounded-md`,
|
|
16121
16226
|
{
|
|
16122
16227
|
"text-primary font-bold": currentIndex === index,
|
|
@@ -16144,8 +16249,8 @@ var ScrollPicker = ({
|
|
|
16144
16249
|
|
|
16145
16250
|
// src/components/user-interaction/Textarea.tsx
|
|
16146
16251
|
var import_react78 = require("react");
|
|
16147
|
-
var
|
|
16148
|
-
var
|
|
16252
|
+
var import_clsx40 = __toESM(require("clsx"));
|
|
16253
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
16149
16254
|
var Textarea = (0, import_react78.forwardRef)(function Textarea2({
|
|
16150
16255
|
invalid = false,
|
|
16151
16256
|
onValueChange,
|
|
@@ -16158,7 +16263,7 @@ var Textarea = (0, import_react78.forwardRef)(function Textarea2({
|
|
|
16158
16263
|
onEditComplete?.(text);
|
|
16159
16264
|
clearTimer();
|
|
16160
16265
|
};
|
|
16161
|
-
return /* @__PURE__ */ (0,
|
|
16266
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
16162
16267
|
"textarea",
|
|
16163
16268
|
{
|
|
16164
16269
|
...props,
|
|
@@ -16188,7 +16293,7 @@ var TextareaUncontrolled = ({
|
|
|
16188
16293
|
...props
|
|
16189
16294
|
}) => {
|
|
16190
16295
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
16191
|
-
return /* @__PURE__ */ (0,
|
|
16296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
16192
16297
|
Textarea,
|
|
16193
16298
|
{
|
|
16194
16299
|
...props,
|
|
@@ -16208,10 +16313,10 @@ var TextareaWithHeadline = ({
|
|
|
16208
16313
|
}) => {
|
|
16209
16314
|
const genId = (0, import_react78.useId)();
|
|
16210
16315
|
const usedId = id ?? genId;
|
|
16211
|
-
return /* @__PURE__ */ (0,
|
|
16316
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
16212
16317
|
"div",
|
|
16213
16318
|
{
|
|
16214
|
-
className: (0,
|
|
16319
|
+
className: (0, import_clsx40.default)(
|
|
16215
16320
|
"group flex-col-3 border-2 rounded-lg",
|
|
16216
16321
|
{
|
|
16217
16322
|
"bg-input-background text-input-text hover:border-primary focus-within:border-primary": !disabled,
|
|
@@ -16220,13 +16325,13 @@ var TextareaWithHeadline = ({
|
|
|
16220
16325
|
containerClassName
|
|
16221
16326
|
),
|
|
16222
16327
|
children: [
|
|
16223
|
-
headline && /* @__PURE__ */ (0,
|
|
16224
|
-
/* @__PURE__ */ (0,
|
|
16328
|
+
headline && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("label", { ...headlineProps, htmlFor: usedId, className: (0, import_clsx40.default)("typography-lable-md text-label", headlineProps.className), children: headline }),
|
|
16329
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
16225
16330
|
Textarea,
|
|
16226
16331
|
{
|
|
16227
16332
|
...props,
|
|
16228
16333
|
id: usedId,
|
|
16229
|
-
className: (0,
|
|
16334
|
+
className: (0, import_clsx40.default)(
|
|
16230
16335
|
"border-transparent focus:ring-0 focus-visible:ring-0 resize-none h-32",
|
|
16231
16336
|
className
|
|
16232
16337
|
)
|
|
@@ -16238,7 +16343,7 @@ var TextareaWithHeadline = ({
|
|
|
16238
16343
|
};
|
|
16239
16344
|
|
|
16240
16345
|
// src/components/user-interaction/date/TimeDisplay.tsx
|
|
16241
|
-
var
|
|
16346
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
16242
16347
|
var TimeDisplay = ({
|
|
16243
16348
|
date,
|
|
16244
16349
|
mode = "daysFromToday"
|
|
@@ -16275,14 +16380,14 @@ var TimeDisplay = ({
|
|
|
16275
16380
|
} else {
|
|
16276
16381
|
fullString = `${date.getDate()}. ${monthToTranslation[date.getMonth()]} ${date.getFullYear()}`;
|
|
16277
16382
|
}
|
|
16278
|
-
return /* @__PURE__ */ (0,
|
|
16383
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { children: fullString });
|
|
16279
16384
|
};
|
|
16280
16385
|
|
|
16281
16386
|
// src/components/user-interaction/input/InsideLabelInput.tsx
|
|
16282
16387
|
var import_react79 = require("react");
|
|
16283
16388
|
var import_react80 = require("react");
|
|
16284
|
-
var
|
|
16285
|
-
var
|
|
16389
|
+
var import_clsx41 = __toESM(require("clsx"));
|
|
16390
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
16286
16391
|
var InsideLabelInput = (0, import_react80.forwardRef)(function InsideLabelInput2({
|
|
16287
16392
|
id: customId,
|
|
16288
16393
|
label,
|
|
@@ -16292,13 +16397,13 @@ var InsideLabelInput = (0, import_react80.forwardRef)(function InsideLabelInput2
|
|
|
16292
16397
|
const [isFocused, setIsFocused] = (0, import_react80.useState)(false);
|
|
16293
16398
|
const generatedId = (0, import_react79.useId)();
|
|
16294
16399
|
const id = customId ?? generatedId;
|
|
16295
|
-
return /* @__PURE__ */ (0,
|
|
16296
|
-
/* @__PURE__ */ (0,
|
|
16400
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: (0, import_clsx41.default)("relative"), children: [
|
|
16401
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16297
16402
|
Input,
|
|
16298
16403
|
{
|
|
16299
16404
|
...props,
|
|
16300
16405
|
id,
|
|
16301
|
-
className: (0,
|
|
16406
|
+
className: (0, import_clsx41.default)("h-14 px-4 pb-2 py-6.5", props.className),
|
|
16302
16407
|
ref: forwardedRef,
|
|
16303
16408
|
"aria-labelledby": id + "-label",
|
|
16304
16409
|
onFocus: (event) => {
|
|
@@ -16311,13 +16416,13 @@ var InsideLabelInput = (0, import_react80.forwardRef)(function InsideLabelInput2
|
|
|
16311
16416
|
}
|
|
16312
16417
|
}
|
|
16313
16418
|
),
|
|
16314
|
-
/* @__PURE__ */ (0,
|
|
16419
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16315
16420
|
"label",
|
|
16316
16421
|
{
|
|
16317
16422
|
id: id + "-label",
|
|
16318
16423
|
"aria-hidden": true,
|
|
16319
16424
|
"data-display": isFocused || !!value ? "small" : "full",
|
|
16320
|
-
className: (0,
|
|
16425
|
+
className: (0, import_clsx41.default)(
|
|
16321
16426
|
// margin left to account for the border which is ignored for absolute positions
|
|
16322
16427
|
"absolute left-4 ml-0.5 top-2 transition-all delay-25 pointer-events-none touch-none",
|
|
16323
16428
|
"data-[display=small]:top-2 data-[display=small]:h-force-4.5 data-[display=small]:typography-caption-sm data-[display=small]:overflow-y-hidden",
|
|
@@ -16333,7 +16438,7 @@ var InsideLabelInputUncontrolled = ({
|
|
|
16333
16438
|
...props
|
|
16334
16439
|
}) => {
|
|
16335
16440
|
const [value, setValue] = useOverwritableState(initialValue, props.onValueChange);
|
|
16336
|
-
return /* @__PURE__ */ (0,
|
|
16441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16337
16442
|
InsideLabelInput,
|
|
16338
16443
|
{
|
|
16339
16444
|
...props,
|
|
@@ -16345,8 +16450,8 @@ var InsideLabelInputUncontrolled = ({
|
|
|
16345
16450
|
|
|
16346
16451
|
// src/components/user-interaction/input/SearchBar.tsx
|
|
16347
16452
|
var import_lucide_react22 = require("lucide-react");
|
|
16348
|
-
var
|
|
16349
|
-
var
|
|
16453
|
+
var import_clsx42 = require("clsx");
|
|
16454
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
16350
16455
|
var SearchBar = ({
|
|
16351
16456
|
value: initialValue,
|
|
16352
16457
|
onSearch,
|
|
@@ -16357,8 +16462,8 @@ var SearchBar = ({
|
|
|
16357
16462
|
}) => {
|
|
16358
16463
|
const translation = useHightideTranslation();
|
|
16359
16464
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
16360
|
-
return /* @__PURE__ */ (0,
|
|
16361
|
-
/* @__PURE__ */ (0,
|
|
16465
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { ...containerProps, className: (0, import_clsx42.clsx)("relative", containerProps?.className), children: [
|
|
16466
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
16362
16467
|
InputUncontrolled,
|
|
16363
16468
|
{
|
|
16364
16469
|
...inputProps,
|
|
@@ -16366,10 +16471,10 @@ var SearchBar = ({
|
|
|
16366
16471
|
onValueChange: setValue,
|
|
16367
16472
|
onEditComplete: onSearch,
|
|
16368
16473
|
placeholder: inputProps.placeholder ?? translation("search"),
|
|
16369
|
-
className: (0,
|
|
16474
|
+
className: (0, import_clsx42.clsx)("pr-10 w-full", inputProps.className)
|
|
16370
16475
|
}
|
|
16371
16476
|
),
|
|
16372
|
-
/* @__PURE__ */ (0,
|
|
16477
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
16373
16478
|
Button,
|
|
16374
16479
|
{
|
|
16375
16480
|
...searchButtonProps,
|
|
@@ -16378,8 +16483,8 @@ var SearchBar = ({
|
|
|
16378
16483
|
color: "neutral",
|
|
16379
16484
|
coloringStyle: "text",
|
|
16380
16485
|
onClick: () => onSearch(value),
|
|
16381
|
-
className: (0,
|
|
16382
|
-
children: /* @__PURE__ */ (0,
|
|
16486
|
+
className: (0, import_clsx42.clsx)("absolute right-1 top-1/2 -translate-y-1/2", searchButtonProps?.className),
|
|
16487
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react22.Search, { className: "w-full h-full" })
|
|
16383
16488
|
}
|
|
16384
16489
|
)
|
|
16385
16490
|
] });
|
|
@@ -16388,8 +16493,8 @@ var SearchBar = ({
|
|
|
16388
16493
|
// src/components/user-interaction/input/ToggleableInput.tsx
|
|
16389
16494
|
var import_react81 = require("react");
|
|
16390
16495
|
var import_lucide_react23 = require("lucide-react");
|
|
16391
|
-
var
|
|
16392
|
-
var
|
|
16496
|
+
var import_clsx43 = __toESM(require("clsx"));
|
|
16497
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
16393
16498
|
var ToggleableInput = (0, import_react81.forwardRef)(function ToggleableInput2({
|
|
16394
16499
|
value,
|
|
16395
16500
|
initialState = "display",
|
|
@@ -16404,8 +16509,8 @@ var ToggleableInput = (0, import_react81.forwardRef)(function ToggleableInput2({
|
|
|
16404
16509
|
innerRef.current?.focus();
|
|
16405
16510
|
}
|
|
16406
16511
|
}, [isEditing]);
|
|
16407
|
-
return /* @__PURE__ */ (0,
|
|
16408
|
-
/* @__PURE__ */ (0,
|
|
16512
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: (0, import_clsx43.default)("relative flex-row-2", { "flex-1": isEditing }), children: [
|
|
16513
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
16409
16514
|
Input,
|
|
16410
16515
|
{
|
|
16411
16516
|
...props,
|
|
@@ -16426,14 +16531,14 @@ var ToggleableInput = (0, import_react81.forwardRef)(function ToggleableInput2({
|
|
|
16426
16531
|
},
|
|
16427
16532
|
"data-name": props["data-name"] ?? "togglable-input",
|
|
16428
16533
|
"data-isEditing": isEditing ? "" : void 0,
|
|
16429
|
-
className: (0,
|
|
16534
|
+
className: (0, import_clsx43.default)(`w-full rounded-md`, {
|
|
16430
16535
|
"text-transparent": !isEditing
|
|
16431
16536
|
})
|
|
16432
16537
|
}
|
|
16433
16538
|
),
|
|
16434
|
-
!isEditing && /* @__PURE__ */ (0,
|
|
16435
|
-
/* @__PURE__ */ (0,
|
|
16436
|
-
/* @__PURE__ */ (0,
|
|
16539
|
+
!isEditing && /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
|
|
16540
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: (0, import_clsx43.default)(" truncate"), children: value }),
|
|
16541
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_lucide_react23.Pencil, { className: (0, import_clsx43.default)(`size-force-4`, { "text-transparent": isEditing }) })
|
|
16437
16542
|
] })
|
|
16438
16543
|
] });
|
|
16439
16544
|
});
|
|
@@ -16443,7 +16548,7 @@ var ToggleableInputUncontrolled = ({
|
|
|
16443
16548
|
...restProps
|
|
16444
16549
|
}) => {
|
|
16445
16550
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
16446
|
-
return /* @__PURE__ */ (0,
|
|
16551
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
16447
16552
|
ToggleableInput,
|
|
16448
16553
|
{
|
|
16449
16554
|
value,
|
|
@@ -16458,7 +16563,7 @@ var import_lucide_react25 = require("lucide-react");
|
|
|
16458
16563
|
|
|
16459
16564
|
// src/components/user-interaction/properties/PropertyBase.tsx
|
|
16460
16565
|
var import_lucide_react24 = require("lucide-react");
|
|
16461
|
-
var
|
|
16566
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
16462
16567
|
var PropertyBase = ({
|
|
16463
16568
|
name: name2,
|
|
16464
16569
|
children,
|
|
@@ -16477,29 +16582,29 @@ var PropertyBase = ({
|
|
|
16477
16582
|
const isClearEnabled = allowClear && !readOnly;
|
|
16478
16583
|
const isRemoveEnabled = allowRemove && !readOnly;
|
|
16479
16584
|
const showActionsContainer = isClearEnabled || isRemoveEnabled;
|
|
16480
|
-
return /* @__PURE__ */ (0,
|
|
16585
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
16481
16586
|
"div",
|
|
16482
16587
|
{
|
|
16483
16588
|
className: className ? `group/property ${className}` : "group/property",
|
|
16484
16589
|
"data-name": "property-root",
|
|
16485
16590
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
16486
16591
|
children: [
|
|
16487
|
-
/* @__PURE__ */ (0,
|
|
16592
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
16488
16593
|
"div",
|
|
16489
16594
|
{
|
|
16490
16595
|
className,
|
|
16491
16596
|
"data-name": "property-title",
|
|
16492
16597
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
16493
16598
|
children: [
|
|
16494
|
-
/* @__PURE__ */ (0,
|
|
16495
|
-
/* @__PURE__ */ (0,
|
|
16496
|
-
/* @__PURE__ */ (0,
|
|
16599
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Tooltip, { tooltip: name2, containerClassName: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "flex-row-1 items-center", children: [
|
|
16600
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { "data-name": "property-title-icon", children: icon }),
|
|
16601
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { "data-name": "property-title-text", children: name2 })
|
|
16497
16602
|
] }) }),
|
|
16498
|
-
invalid && /* @__PURE__ */ (0,
|
|
16603
|
+
invalid && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react24.AlertTriangle, { className: "size-force-6" })
|
|
16499
16604
|
]
|
|
16500
16605
|
}
|
|
16501
16606
|
),
|
|
16502
|
-
/* @__PURE__ */ (0,
|
|
16607
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
16503
16608
|
"div",
|
|
16504
16609
|
{
|
|
16505
16610
|
className,
|
|
@@ -16507,8 +16612,8 @@ var PropertyBase = ({
|
|
|
16507
16612
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
16508
16613
|
children: [
|
|
16509
16614
|
children({ required, hasValue, invalid }),
|
|
16510
|
-
showActionsContainer && /* @__PURE__ */ (0,
|
|
16511
|
-
isClearEnabled && /* @__PURE__ */ (0,
|
|
16615
|
+
showActionsContainer && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { "data-name": "property-actions", children: [
|
|
16616
|
+
isClearEnabled && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Tooltip, { tooltip: translation("clearValue"), children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
16512
16617
|
Button,
|
|
16513
16618
|
{
|
|
16514
16619
|
onClick: onValueClear,
|
|
@@ -16517,10 +16622,10 @@ var PropertyBase = ({
|
|
|
16517
16622
|
coloringStyle: "text",
|
|
16518
16623
|
layout: "icon",
|
|
16519
16624
|
size: "sm",
|
|
16520
|
-
children: /* @__PURE__ */ (0,
|
|
16625
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react24.X, { className: "size-force-5" })
|
|
16521
16626
|
}
|
|
16522
16627
|
) }),
|
|
16523
|
-
isRemoveEnabled && /* @__PURE__ */ (0,
|
|
16628
|
+
isRemoveEnabled && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Tooltip, { tooltip: translation("removeProperty"), children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
16524
16629
|
Button,
|
|
16525
16630
|
{
|
|
16526
16631
|
onClick: onRemove,
|
|
@@ -16528,7 +16633,7 @@ var PropertyBase = ({
|
|
|
16528
16633
|
coloringStyle: "text",
|
|
16529
16634
|
layout: "icon",
|
|
16530
16635
|
size: "sm",
|
|
16531
|
-
children: /* @__PURE__ */ (0,
|
|
16636
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react24.Trash, { className: "size-force-5" })
|
|
16532
16637
|
}
|
|
16533
16638
|
) })
|
|
16534
16639
|
] })
|
|
@@ -16541,7 +16646,7 @@ var PropertyBase = ({
|
|
|
16541
16646
|
};
|
|
16542
16647
|
|
|
16543
16648
|
// src/components/user-interaction/properties/CheckboxProperty.tsx
|
|
16544
|
-
var
|
|
16649
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
16545
16650
|
var CheckboxProperty = ({
|
|
16546
16651
|
value,
|
|
16547
16652
|
onValueChange,
|
|
@@ -16550,15 +16655,15 @@ var CheckboxProperty = ({
|
|
|
16550
16655
|
...baseProps
|
|
16551
16656
|
}) => {
|
|
16552
16657
|
const translation = useHightideTranslation();
|
|
16553
|
-
return /* @__PURE__ */ (0,
|
|
16658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
16554
16659
|
PropertyBase,
|
|
16555
16660
|
{
|
|
16556
16661
|
...baseProps,
|
|
16557
16662
|
hasValue: value !== void 0,
|
|
16558
16663
|
readOnly,
|
|
16559
|
-
icon: /* @__PURE__ */ (0,
|
|
16560
|
-
children: () => /* @__PURE__ */ (0,
|
|
16561
|
-
/* @__PURE__ */ (0,
|
|
16664
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react25.Check, { size: 24 }),
|
|
16665
|
+
children: () => /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
16666
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
16562
16667
|
Button,
|
|
16563
16668
|
{
|
|
16564
16669
|
color: value ? "positive" : "neutral",
|
|
@@ -16571,7 +16676,7 @@ var CheckboxProperty = ({
|
|
|
16571
16676
|
children: translation("yes")
|
|
16572
16677
|
}
|
|
16573
16678
|
),
|
|
16574
|
-
/* @__PURE__ */ (0,
|
|
16679
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
16575
16680
|
Button,
|
|
16576
16681
|
{
|
|
16577
16682
|
color: !value && value !== void 0 ? "negative" : "neutral",
|
|
@@ -16591,7 +16696,7 @@ var CheckboxProperty = ({
|
|
|
16591
16696
|
|
|
16592
16697
|
// src/components/user-interaction/properties/DateProperty.tsx
|
|
16593
16698
|
var import_lucide_react26 = require("lucide-react");
|
|
16594
|
-
var
|
|
16699
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
16595
16700
|
var DateProperty = ({
|
|
16596
16701
|
value,
|
|
16597
16702
|
onValueChange,
|
|
@@ -16601,13 +16706,13 @@ var DateProperty = ({
|
|
|
16601
16706
|
...baseProps
|
|
16602
16707
|
}) => {
|
|
16603
16708
|
const hasValue = !!value;
|
|
16604
|
-
return /* @__PURE__ */ (0,
|
|
16709
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16605
16710
|
PropertyBase,
|
|
16606
16711
|
{
|
|
16607
16712
|
...baseProps,
|
|
16608
16713
|
hasValue,
|
|
16609
|
-
icon: /* @__PURE__ */ (0,
|
|
16610
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
16714
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react26.CalendarDays, { size: 24 }),
|
|
16715
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16611
16716
|
DateTimeInput,
|
|
16612
16717
|
{
|
|
16613
16718
|
value,
|
|
@@ -16629,7 +16734,7 @@ var import_lucide_react28 = require("lucide-react");
|
|
|
16629
16734
|
// src/components/user-interaction/select/MultiSelectChipDisplay.tsx
|
|
16630
16735
|
var import_react82 = require("react");
|
|
16631
16736
|
var import_lucide_react27 = require("lucide-react");
|
|
16632
|
-
var
|
|
16737
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
16633
16738
|
var MultiSelectChipDisplayButton = (0, import_react82.forwardRef)(function MultiSelectChipDisplayButton2({
|
|
16634
16739
|
id,
|
|
16635
16740
|
...props
|
|
@@ -16652,7 +16757,7 @@ var MultiSelectChipDisplayButton = (0, import_react82.forwardRef)(function Multi
|
|
|
16652
16757
|
}, [register, unregister]);
|
|
16653
16758
|
const disabled = !!props?.disabled || !!state.disabled;
|
|
16654
16759
|
const invalid = state.invalid;
|
|
16655
|
-
return /* @__PURE__ */ (0,
|
|
16760
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
16656
16761
|
"div",
|
|
16657
16762
|
{
|
|
16658
16763
|
...props,
|
|
@@ -16668,9 +16773,9 @@ var MultiSelectChipDisplayButton = (0, import_react82.forwardRef)(function Multi
|
|
|
16668
16773
|
"aria-invalid": invalid,
|
|
16669
16774
|
"aria-disabled": disabled,
|
|
16670
16775
|
children: [
|
|
16671
|
-
state.selectedOptions.map(({ value, label }) => /* @__PURE__ */ (0,
|
|
16776
|
+
state.selectedOptions.map(({ value, label }) => /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(Chip, { className: "gap-x-2", children: [
|
|
16672
16777
|
label,
|
|
16673
|
-
/* @__PURE__ */ (0,
|
|
16778
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
16674
16779
|
Button,
|
|
16675
16780
|
{
|
|
16676
16781
|
onClick: () => {
|
|
@@ -16681,11 +16786,11 @@ var MultiSelectChipDisplayButton = (0, import_react82.forwardRef)(function Multi
|
|
|
16681
16786
|
coloringStyle: "text",
|
|
16682
16787
|
layout: "icon",
|
|
16683
16788
|
className: "flex-row-0 items-center",
|
|
16684
|
-
children: /* @__PURE__ */ (0,
|
|
16789
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react27.XIcon, { className: "size-5" })
|
|
16685
16790
|
}
|
|
16686
16791
|
)
|
|
16687
16792
|
] }, value)),
|
|
16688
|
-
/* @__PURE__ */ (0,
|
|
16793
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
16689
16794
|
Button,
|
|
16690
16795
|
{
|
|
16691
16796
|
id: ids.trigger,
|
|
@@ -16711,7 +16816,7 @@ var MultiSelectChipDisplayButton = (0, import_react82.forwardRef)(function Multi
|
|
|
16711
16816
|
"aria-expanded": state.isOpen,
|
|
16712
16817
|
"aria-controls": state.isOpen ? ids.content : void 0,
|
|
16713
16818
|
className: "size-9",
|
|
16714
|
-
children: /* @__PURE__ */ (0,
|
|
16819
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react27.Plus, {})
|
|
16715
16820
|
}
|
|
16716
16821
|
)
|
|
16717
16822
|
]
|
|
@@ -16724,9 +16829,9 @@ var MultiSelectChipDisplay = (0, import_react82.forwardRef)(function MultiSelect
|
|
|
16724
16829
|
chipDisplayProps,
|
|
16725
16830
|
...props
|
|
16726
16831
|
}, ref) {
|
|
16727
|
-
return /* @__PURE__ */ (0,
|
|
16728
|
-
/* @__PURE__ */ (0,
|
|
16729
|
-
/* @__PURE__ */ (0,
|
|
16832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(MultiSelectRoot, { ...props, children: [
|
|
16833
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(MultiSelectChipDisplayButton, { ref, ...chipDisplayProps }),
|
|
16834
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(MultiSelectContent, { ...contentPanelProps, children })
|
|
16730
16835
|
] });
|
|
16731
16836
|
});
|
|
16732
16837
|
var MultiSelectChipDisplayUncontrolled = (0, import_react82.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
|
|
@@ -16735,7 +16840,7 @@ var MultiSelectChipDisplayUncontrolled = (0, import_react82.forwardRef)(function
|
|
|
16735
16840
|
...props
|
|
16736
16841
|
}, ref) {
|
|
16737
16842
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
16738
|
-
return /* @__PURE__ */ (0,
|
|
16843
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
16739
16844
|
MultiSelectChipDisplay,
|
|
16740
16845
|
{
|
|
16741
16846
|
...props,
|
|
@@ -16747,7 +16852,7 @@ var MultiSelectChipDisplayUncontrolled = (0, import_react82.forwardRef)(function
|
|
|
16747
16852
|
});
|
|
16748
16853
|
|
|
16749
16854
|
// src/components/user-interaction/properties/MultiSelectProperty.tsx
|
|
16750
|
-
var
|
|
16855
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
16751
16856
|
var MultiSelectProperty = ({
|
|
16752
16857
|
children,
|
|
16753
16858
|
value,
|
|
@@ -16756,18 +16861,18 @@ var MultiSelectProperty = ({
|
|
|
16756
16861
|
...props
|
|
16757
16862
|
}) => {
|
|
16758
16863
|
const hasValue = value.length > 0;
|
|
16759
|
-
return /* @__PURE__ */ (0,
|
|
16864
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
16760
16865
|
PropertyBase,
|
|
16761
16866
|
{
|
|
16762
16867
|
...props,
|
|
16763
16868
|
hasValue,
|
|
16764
|
-
icon: /* @__PURE__ */ (0,
|
|
16765
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
16869
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_lucide_react28.List, { size: 24 }),
|
|
16870
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
16766
16871
|
"div",
|
|
16767
16872
|
{
|
|
16768
16873
|
"data-name": "property-input-wrapper",
|
|
16769
16874
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
16770
|
-
children: /* @__PURE__ */ (0,
|
|
16875
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
16771
16876
|
MultiSelectChipDisplay,
|
|
16772
16877
|
{
|
|
16773
16878
|
value,
|
|
@@ -16793,7 +16898,7 @@ var MultiSelectProperty = ({
|
|
|
16793
16898
|
|
|
16794
16899
|
// src/components/user-interaction/properties/NumberProperty.tsx
|
|
16795
16900
|
var import_lucide_react29 = require("lucide-react");
|
|
16796
|
-
var
|
|
16901
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
16797
16902
|
var NumberProperty = ({
|
|
16798
16903
|
value,
|
|
16799
16904
|
onRemove,
|
|
@@ -16805,20 +16910,20 @@ var NumberProperty = ({
|
|
|
16805
16910
|
}) => {
|
|
16806
16911
|
const translation = useHightideTranslation();
|
|
16807
16912
|
const hasValue = value !== void 0;
|
|
16808
|
-
return /* @__PURE__ */ (0,
|
|
16913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16809
16914
|
PropertyBase,
|
|
16810
16915
|
{
|
|
16811
16916
|
...baseProps,
|
|
16812
16917
|
onRemove,
|
|
16813
16918
|
hasValue,
|
|
16814
|
-
icon: /* @__PURE__ */ (0,
|
|
16815
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
16919
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_lucide_react29.Binary, { size: 24 }),
|
|
16920
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
16816
16921
|
"div",
|
|
16817
16922
|
{
|
|
16818
16923
|
"data-name": "property-input-wrapper",
|
|
16819
16924
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
16820
16925
|
children: [
|
|
16821
|
-
/* @__PURE__ */ (0,
|
|
16926
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16822
16927
|
Input,
|
|
16823
16928
|
{
|
|
16824
16929
|
className: "w-full pr-8",
|
|
@@ -16846,7 +16951,7 @@ var NumberProperty = ({
|
|
|
16846
16951
|
}
|
|
16847
16952
|
}
|
|
16848
16953
|
),
|
|
16849
|
-
suffix && /* @__PURE__ */ (0,
|
|
16954
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16850
16955
|
"span",
|
|
16851
16956
|
{
|
|
16852
16957
|
"data-name": "property-suffix",
|
|
@@ -16863,7 +16968,7 @@ var NumberProperty = ({
|
|
|
16863
16968
|
|
|
16864
16969
|
// src/components/user-interaction/properties/SelectProperty.tsx
|
|
16865
16970
|
var import_lucide_react30 = require("lucide-react");
|
|
16866
|
-
var
|
|
16971
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
16867
16972
|
var SingleSelectProperty = ({
|
|
16868
16973
|
children,
|
|
16869
16974
|
value,
|
|
@@ -16872,18 +16977,18 @@ var SingleSelectProperty = ({
|
|
|
16872
16977
|
...props
|
|
16873
16978
|
}) => {
|
|
16874
16979
|
const hasValue = value !== void 0;
|
|
16875
|
-
return /* @__PURE__ */ (0,
|
|
16980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16876
16981
|
PropertyBase,
|
|
16877
16982
|
{
|
|
16878
16983
|
...props,
|
|
16879
16984
|
hasValue,
|
|
16880
|
-
icon: /* @__PURE__ */ (0,
|
|
16881
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
16985
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_lucide_react30.List, { size: 24 }),
|
|
16986
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16882
16987
|
"div",
|
|
16883
16988
|
{
|
|
16884
16989
|
"data-name": "property-input-wrapper",
|
|
16885
16990
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
16886
|
-
children: /* @__PURE__ */ (0,
|
|
16991
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16887
16992
|
Select,
|
|
16888
16993
|
{
|
|
16889
16994
|
value,
|
|
@@ -16906,7 +17011,7 @@ var SingleSelectProperty = ({
|
|
|
16906
17011
|
|
|
16907
17012
|
// src/components/user-interaction/properties/TextProperty.tsx
|
|
16908
17013
|
var import_lucide_react31 = require("lucide-react");
|
|
16909
|
-
var
|
|
17014
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
16910
17015
|
var TextProperty = ({
|
|
16911
17016
|
value,
|
|
16912
17017
|
readOnly,
|
|
@@ -16917,14 +17022,14 @@ var TextProperty = ({
|
|
|
16917
17022
|
}) => {
|
|
16918
17023
|
const translation = useHightideTranslation();
|
|
16919
17024
|
const hasValue = value !== void 0;
|
|
16920
|
-
return /* @__PURE__ */ (0,
|
|
17025
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16921
17026
|
PropertyBase,
|
|
16922
17027
|
{
|
|
16923
17028
|
...baseProps,
|
|
16924
17029
|
onRemove,
|
|
16925
17030
|
hasValue,
|
|
16926
|
-
icon: /* @__PURE__ */ (0,
|
|
16927
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
17031
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_lucide_react31.Text, { size: 24 }),
|
|
17032
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16928
17033
|
Textarea,
|
|
16929
17034
|
{
|
|
16930
17035
|
className: "w-full",
|
|
@@ -16989,14 +17094,14 @@ function Transition({
|
|
|
16989
17094
|
}
|
|
16990
17095
|
|
|
16991
17096
|
// src/global-contexts/HightideProvider.tsx
|
|
16992
|
-
var
|
|
17097
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
16993
17098
|
var HightideProvider = ({
|
|
16994
17099
|
children,
|
|
16995
17100
|
theme,
|
|
16996
17101
|
locale,
|
|
16997
17102
|
config
|
|
16998
17103
|
}) => {
|
|
16999
|
-
return /* @__PURE__ */ (0,
|
|
17104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(LocaleProvider, { ...locale, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(ThemeProvider, { ...theme, children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(HightideConfigProvider, { ...config, children }) }) });
|
|
17000
17105
|
};
|
|
17001
17106
|
|
|
17002
17107
|
// src/hooks/focus/useFocusGuards.ts
|
|
@@ -17119,7 +17224,7 @@ function useLogUnstableDependencies(name2, value) {
|
|
|
17119
17224
|
}
|
|
17120
17225
|
}
|
|
17121
17226
|
if (Object.keys(changes).length > 0) {
|
|
17122
|
-
console.
|
|
17227
|
+
console.info(`[${name2}] changed`, changes);
|
|
17123
17228
|
}
|
|
17124
17229
|
prev.current = value;
|
|
17125
17230
|
});
|
|
@@ -17665,13 +17770,15 @@ var PromiseUtils = {
|
|
|
17665
17770
|
TabPanel,
|
|
17666
17771
|
TabSwitcher,
|
|
17667
17772
|
TabView,
|
|
17773
|
+
Table,
|
|
17668
17774
|
TableBody,
|
|
17669
|
-
TableBodyContext,
|
|
17670
17775
|
TableCell,
|
|
17671
17776
|
TableColumn,
|
|
17672
17777
|
TableColumnDefinitionContext,
|
|
17673
|
-
|
|
17778
|
+
TableColumnSwitcher,
|
|
17779
|
+
TableColumnSwitcherPopUp,
|
|
17674
17780
|
TableContainerContext,
|
|
17781
|
+
TableDataContext,
|
|
17675
17782
|
TableDisplay,
|
|
17676
17783
|
TableFilter,
|
|
17677
17784
|
TableFilterButton,
|
|
@@ -17679,10 +17786,12 @@ var PromiseUtils = {
|
|
|
17679
17786
|
TableFilterOperator,
|
|
17680
17787
|
TableHeader,
|
|
17681
17788
|
TableHeaderContext,
|
|
17682
|
-
|
|
17789
|
+
TablePageSizeSelect,
|
|
17683
17790
|
TablePagination,
|
|
17791
|
+
TablePaginationMenu,
|
|
17684
17792
|
TableProvider,
|
|
17685
17793
|
TableSortButton,
|
|
17794
|
+
TableWithSelection,
|
|
17686
17795
|
TableWithSelectionProvider,
|
|
17687
17796
|
TagIcon,
|
|
17688
17797
|
TagsFilter,
|
|
@@ -17763,9 +17872,9 @@ var PromiseUtils = {
|
|
|
17763
17872
|
useSearch,
|
|
17764
17873
|
useSelectContext,
|
|
17765
17874
|
useTabContext,
|
|
17766
|
-
useTableBodyContext,
|
|
17767
17875
|
useTableColumnDefinitionContext,
|
|
17768
17876
|
useTableContainerContext,
|
|
17877
|
+
useTableDataContext,
|
|
17769
17878
|
useTableHeaderContext,
|
|
17770
17879
|
useTheme,
|
|
17771
17880
|
useTransitionState,
|