@helpwave/hightide 0.6.6 → 0.6.8
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 +1658 -1558
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1712 -1616
- package/dist/index.mjs.map +1 -1
- package/dist/style/globals.css +78 -43
- package/dist/style/uncompiled/theme/components/checkbox.css +6 -5
- package/dist/style/uncompiled/theme/components/expandable.css +3 -3
- package/dist/style/uncompiled/theme/components/expansion-icon.css +1 -1
- package/dist/style/uncompiled/theme/components/input-elements.css +3 -3
- package/dist/style/uncompiled/theme/components/property.css +10 -10
- package/dist/style/uncompiled/theme/components/table.css +18 -14
- package/dist/style/uncompiled/theme/components/textarea.css +1 -1
- 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,590 @@ 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
|
+
"data-clickable": PropsUtil.dataAttributes.bool(!!onRowClick),
|
|
13544
|
+
className: (0, import_clsx26.default)("table-body-row", BagFunctionUtil.resolve(table.options.meta?.bodyRowClassName, row.original)),
|
|
13545
|
+
children: row.getVisibleCells().map((cell) => {
|
|
13546
|
+
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)(
|
|
13547
|
+
cell.column.columnDef.cell,
|
|
13548
|
+
cell.getContext()
|
|
13549
|
+
) }, cell.id);
|
|
13550
|
+
})
|
|
13551
|
+
},
|
|
13552
|
+
row.id
|
|
13553
|
+
);
|
|
13554
|
+
}),
|
|
13555
|
+
isUsingFillerRows && range(pagination.pageSize - rows.length, { allowEmptyRange: true }).map((row, index) => {
|
|
13556
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("tr", { className: (0, import_clsx26.default)("table-body-filler-row"), children: columns.map((column) => {
|
|
13557
|
+
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);
|
|
13558
|
+
}) }, "filler-row-" + index);
|
|
13559
|
+
})
|
|
13560
|
+
] });
|
|
13561
|
+
});
|
|
13562
|
+
|
|
13563
|
+
// src/components/layout/table/TableHeader.tsx
|
|
13564
|
+
var import_react_table3 = require("@tanstack/react-table");
|
|
13565
|
+
var import_clsx32 = __toESM(require("clsx"));
|
|
13566
|
+
|
|
13320
13567
|
// src/components/layout/table/TableSortButton.tsx
|
|
13321
|
-
var
|
|
13568
|
+
var import_lucide_react14 = require("lucide-react");
|
|
13569
|
+
var import_clsx27 = __toESM(require("clsx"));
|
|
13570
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
13322
13571
|
var TableSortButton = ({
|
|
13323
13572
|
sortDirection,
|
|
13324
13573
|
invert = false,
|
|
@@ -13330,28 +13579,28 @@ var TableSortButton = ({
|
|
|
13330
13579
|
}) => {
|
|
13331
13580
|
const translation = useHightideTranslation();
|
|
13332
13581
|
const { sortingsCount, index } = sortingIndexDisplay;
|
|
13333
|
-
let icon = /* @__PURE__ */ (0,
|
|
13582
|
+
let icon = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react14.ChevronsUpDown, { className: "size-4" });
|
|
13334
13583
|
if (sortDirection) {
|
|
13335
13584
|
let usedSortDirection = sortDirection;
|
|
13336
13585
|
if (invert) {
|
|
13337
13586
|
usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
|
|
13338
13587
|
}
|
|
13339
|
-
icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0,
|
|
13588
|
+
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
13589
|
}
|
|
13341
13590
|
const hasSortingIndex = !!sortingIndexDisplay && sortingsCount > 1 && index > 0;
|
|
13342
|
-
return /* @__PURE__ */ (0,
|
|
13591
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Tooltip, { tooltip: translation("rSortingOrderAfter", { otherSortings: index - 1 }), disabled: !hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
13343
13592
|
Button,
|
|
13344
13593
|
{
|
|
13345
13594
|
layout: hasSortingIndex ? "default" : "icon",
|
|
13346
13595
|
color,
|
|
13347
13596
|
size,
|
|
13348
|
-
className: (0,
|
|
13597
|
+
className: (0, import_clsx27.default)("relative", className),
|
|
13349
13598
|
...props,
|
|
13350
13599
|
children: [
|
|
13351
|
-
/* @__PURE__ */ (0,
|
|
13600
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13352
13601
|
"div",
|
|
13353
13602
|
{
|
|
13354
|
-
className: (0,
|
|
13603
|
+
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
13604
|
children: `${index}.`
|
|
13356
13605
|
}
|
|
13357
13606
|
) }),
|
|
@@ -13362,13 +13611,13 @@ var TableSortButton = ({
|
|
|
13362
13611
|
};
|
|
13363
13612
|
|
|
13364
13613
|
// src/components/layout/table/TableFilterButton.tsx
|
|
13365
|
-
var
|
|
13614
|
+
var import_lucide_react18 = require("lucide-react");
|
|
13366
13615
|
var import_react67 = require("react");
|
|
13367
13616
|
|
|
13368
13617
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
13369
13618
|
var import_react64 = require("react");
|
|
13370
|
-
var
|
|
13371
|
-
var
|
|
13619
|
+
var import_lucide_react16 = require("lucide-react");
|
|
13620
|
+
var import_clsx31 = __toESM(require("clsx"));
|
|
13372
13621
|
|
|
13373
13622
|
// src/utils/date.ts
|
|
13374
13623
|
var monthsList = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
|
|
@@ -13541,11 +13790,11 @@ var DateUtils = {
|
|
|
13541
13790
|
};
|
|
13542
13791
|
|
|
13543
13792
|
// src/components/user-interaction/date/DateTimePicker.tsx
|
|
13544
|
-
var
|
|
13793
|
+
var import_clsx30 = __toESM(require("clsx"));
|
|
13545
13794
|
|
|
13546
13795
|
// src/components/user-interaction/date/TimePicker.tsx
|
|
13547
13796
|
var import_react59 = require("react");
|
|
13548
|
-
var
|
|
13797
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
13549
13798
|
var TimePicker = ({
|
|
13550
13799
|
value = /* @__PURE__ */ new Date(),
|
|
13551
13800
|
onValueChange,
|
|
@@ -13593,10 +13842,10 @@ var TimePicker = ({
|
|
|
13593
13842
|
onValueChange?.(newDate);
|
|
13594
13843
|
onEditComplete?.(newDate);
|
|
13595
13844
|
};
|
|
13596
|
-
return /* @__PURE__ */ (0,
|
|
13597
|
-
/* @__PURE__ */ (0,
|
|
13845
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { "data-name": "time-picker-container", className, children: [
|
|
13846
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { "data-name": "time-picker-value-column", children: hours.map((hour2) => {
|
|
13598
13847
|
const isSelected = hour2 === value.getHours() - (!is24HourFormat && isPM ? 12 : 0);
|
|
13599
|
-
return /* @__PURE__ */ (0,
|
|
13848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13600
13849
|
Button,
|
|
13601
13850
|
{
|
|
13602
13851
|
size: "sm",
|
|
@@ -13608,9 +13857,9 @@ var TimePicker = ({
|
|
|
13608
13857
|
hour2
|
|
13609
13858
|
);
|
|
13610
13859
|
}) }),
|
|
13611
|
-
/* @__PURE__ */ (0,
|
|
13860
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { "data-name": "time-picker-value-column", children: minutes.map((minute) => {
|
|
13612
13861
|
const isSelected = minute === closestMinute;
|
|
13613
|
-
return /* @__PURE__ */ (0,
|
|
13862
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13614
13863
|
Button,
|
|
13615
13864
|
{
|
|
13616
13865
|
size: "sm",
|
|
@@ -13622,8 +13871,8 @@ var TimePicker = ({
|
|
|
13622
13871
|
minute + minuteIncrement
|
|
13623
13872
|
);
|
|
13624
13873
|
}) }),
|
|
13625
|
-
!is24HourFormat && /* @__PURE__ */ (0,
|
|
13626
|
-
/* @__PURE__ */ (0,
|
|
13874
|
+
!is24HourFormat && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { "data-name": "time-picker-value-column", children: [
|
|
13875
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13627
13876
|
Button,
|
|
13628
13877
|
{
|
|
13629
13878
|
size: "sm",
|
|
@@ -13632,7 +13881,7 @@ var TimePicker = ({
|
|
|
13632
13881
|
children: "AM"
|
|
13633
13882
|
}
|
|
13634
13883
|
),
|
|
13635
|
-
/* @__PURE__ */ (0,
|
|
13884
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13636
13885
|
Button,
|
|
13637
13886
|
{
|
|
13638
13887
|
size: "sm",
|
|
@@ -13650,7 +13899,7 @@ var TimePickerUncontrolled = ({
|
|
|
13650
13899
|
...props
|
|
13651
13900
|
}) => {
|
|
13652
13901
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
13653
|
-
return /* @__PURE__ */ (0,
|
|
13902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13654
13903
|
TimePicker,
|
|
13655
13904
|
{
|
|
13656
13905
|
...props,
|
|
@@ -13662,12 +13911,12 @@ var TimePickerUncontrolled = ({
|
|
|
13662
13911
|
|
|
13663
13912
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
13664
13913
|
var import_react62 = require("react");
|
|
13665
|
-
var
|
|
13666
|
-
var
|
|
13914
|
+
var import_lucide_react15 = require("lucide-react");
|
|
13915
|
+
var import_clsx29 = __toESM(require("clsx"));
|
|
13667
13916
|
|
|
13668
13917
|
// src/components/user-interaction/date/DayPicker.tsx
|
|
13669
13918
|
var import_react60 = require("react");
|
|
13670
|
-
var
|
|
13919
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
13671
13920
|
var DayPicker = ({
|
|
13672
13921
|
displayedMonth,
|
|
13673
13922
|
value,
|
|
@@ -13690,14 +13939,14 @@ var DayPicker = ({
|
|
|
13690
13939
|
if (!providedStart) return;
|
|
13691
13940
|
return new Date(providedStart.getFullYear(), providedStart.getMonth(), providedStart.getDate());
|
|
13692
13941
|
}, [providedStart]);
|
|
13693
|
-
return /* @__PURE__ */ (0,
|
|
13694
|
-
/* @__PURE__ */ (0,
|
|
13695
|
-
weeks.map((week, index) => /* @__PURE__ */ (0,
|
|
13942
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className, "data-name": "day-picker-container", children: [
|
|
13943
|
+
/* @__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)) }),
|
|
13944
|
+
weeks.map((week, index) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { "data-name": "day-picker-body-row", children: week.map((date) => {
|
|
13696
13945
|
const isSelected = !!value && DateUtils.equalDate(value, date);
|
|
13697
13946
|
const isToday = DateUtils.equalDate(/* @__PURE__ */ new Date(), date);
|
|
13698
13947
|
const isSameMonth = date.getMonth() === month;
|
|
13699
13948
|
const isDayValid = isInTimeSpan(date, start, end);
|
|
13700
|
-
return /* @__PURE__ */ (0,
|
|
13949
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13701
13950
|
"button",
|
|
13702
13951
|
{
|
|
13703
13952
|
disabled: !isDayValid,
|
|
@@ -13731,7 +13980,7 @@ var DayPickerUncontrolled = ({
|
|
|
13731
13980
|
...props
|
|
13732
13981
|
}) => {
|
|
13733
13982
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
13734
|
-
return /* @__PURE__ */ (0,
|
|
13983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13735
13984
|
DayPicker,
|
|
13736
13985
|
{
|
|
13737
13986
|
value,
|
|
@@ -13743,8 +13992,8 @@ var DayPickerUncontrolled = ({
|
|
|
13743
13992
|
|
|
13744
13993
|
// src/components/user-interaction/date/YearMonthPicker.tsx
|
|
13745
13994
|
var import_react61 = require("react");
|
|
13746
|
-
var
|
|
13747
|
-
var
|
|
13995
|
+
var import_clsx28 = __toESM(require("clsx"));
|
|
13996
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
13748
13997
|
var YearRow = (0, import_react61.memo)(function YearRow2({
|
|
13749
13998
|
year,
|
|
13750
13999
|
selectedMonthIndex,
|
|
@@ -13762,22 +14011,22 @@ var YearRow = (0, import_react61.memo)(function YearRow2({
|
|
|
13762
14011
|
}
|
|
13763
14012
|
}, [isSelectedYear]);
|
|
13764
14013
|
const monthGrid = (0, import_react61.useMemo)(() => equalSizeGroups([...DateUtils.monthsList], 3), []);
|
|
13765
|
-
return /* @__PURE__ */ (0,
|
|
14014
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
13766
14015
|
ExpandableRoot,
|
|
13767
14016
|
{
|
|
13768
14017
|
ref: isSelectedYear ? ref : void 0,
|
|
13769
14018
|
isExpanded,
|
|
13770
14019
|
onExpandedChange: setIsExpanded,
|
|
13771
14020
|
children: [
|
|
13772
|
-
/* @__PURE__ */ (0,
|
|
13773
|
-
/* @__PURE__ */ (0,
|
|
14021
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ExpandableHeader, { className: (0, import_clsx28.default)("px-2", { "text-primary font-bold": isSelectedYear }), children: year }),
|
|
14022
|
+
/* @__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
14023
|
const monthIndex = DateUtils.monthsList.indexOf(month);
|
|
13775
14024
|
const currentTimestamp = new Date(year, monthIndex).getTime();
|
|
13776
14025
|
const isAfterStart = minTimestamp === void 0 || currentTimestamp >= minTimestamp;
|
|
13777
14026
|
const isBeforeEnd = maxTimestamp === void 0 || currentTimestamp <= maxTimestamp;
|
|
13778
14027
|
const isValid = isAfterStart && isBeforeEnd;
|
|
13779
14028
|
const isSelectedMonth = monthIndex === selectedMonthIndex;
|
|
13780
|
-
return /* @__PURE__ */ (0,
|
|
14029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13781
14030
|
Button,
|
|
13782
14031
|
{
|
|
13783
14032
|
disabled: !isValid,
|
|
@@ -13834,17 +14083,17 @@ var YearMonthPicker = ({
|
|
|
13834
14083
|
onValueChange2?.(newDate);
|
|
13835
14084
|
onEditComplete2?.(newDate);
|
|
13836
14085
|
}, []);
|
|
13837
|
-
return /* @__PURE__ */ (0,
|
|
14086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13838
14087
|
InfiniteScroll,
|
|
13839
14088
|
{
|
|
13840
14089
|
itemCount: years.length,
|
|
13841
|
-
className: (0,
|
|
14090
|
+
className: (0, import_clsx28.default)("flex-col-1 h-full select-none", className),
|
|
13842
14091
|
initialIndex: years.findIndex((year) => year === value.getFullYear()),
|
|
13843
14092
|
children: (index) => {
|
|
13844
14093
|
const year = years[index];
|
|
13845
14094
|
const isSelectedYear = value.getFullYear() === year;
|
|
13846
14095
|
const selectedMonthIndex = isSelectedYear ? value.getMonth() : void 0;
|
|
13847
|
-
return /* @__PURE__ */ (0,
|
|
14096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13848
14097
|
YearRow,
|
|
13849
14098
|
{
|
|
13850
14099
|
year,
|
|
@@ -13866,7 +14115,7 @@ var YearMonthPickerUncontrolled = ({
|
|
|
13866
14115
|
...props
|
|
13867
14116
|
}) => {
|
|
13868
14117
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
13869
|
-
return /* @__PURE__ */ (0,
|
|
14118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13870
14119
|
YearMonthPicker,
|
|
13871
14120
|
{
|
|
13872
14121
|
value,
|
|
@@ -13877,7 +14126,7 @@ var YearMonthPickerUncontrolled = ({
|
|
|
13877
14126
|
};
|
|
13878
14127
|
|
|
13879
14128
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
13880
|
-
var
|
|
14129
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
13881
14130
|
var DatePicker = ({
|
|
13882
14131
|
value = /* @__PURE__ */ new Date(),
|
|
13883
14132
|
start,
|
|
@@ -13893,25 +14142,25 @@ var DatePicker = ({
|
|
|
13893
14142
|
const { locale } = useLocale();
|
|
13894
14143
|
const [displayedMonth, setDisplayedMonth] = (0, import_react62.useState)(new Date(value.getFullYear(), value.getMonth(), 1));
|
|
13895
14144
|
const [displayMode, setDisplayMode] = (0, import_react62.useState)(initialDisplay);
|
|
13896
|
-
return /* @__PURE__ */ (0,
|
|
13897
|
-
/* @__PURE__ */ (0,
|
|
13898
|
-
/* @__PURE__ */ (0,
|
|
14145
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: (0, import_clsx29.default)("flex-col-3", className), children: [
|
|
14146
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex-row-2 items-center justify-between", children: [
|
|
14147
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
13899
14148
|
Button,
|
|
13900
14149
|
{
|
|
13901
14150
|
size: "sm",
|
|
13902
14151
|
coloringStyle: "text",
|
|
13903
|
-
className: (0,
|
|
14152
|
+
className: (0, import_clsx29.default)("flex-row-1 items-center cursor-pointer select-none", {
|
|
13904
14153
|
"text-disabled": displayMode !== "day"
|
|
13905
14154
|
}),
|
|
13906
14155
|
onClick: () => setDisplayMode(displayMode === "day" ? "yearMonth" : "day"),
|
|
13907
14156
|
children: [
|
|
13908
14157
|
`${new Intl.DateTimeFormat(LocalizationUtil.localToLanguage(locale), { month: "long" }).format(displayedMonth)} ${displayedMonth.getFullYear()}`,
|
|
13909
|
-
/* @__PURE__ */ (0,
|
|
14158
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react15.ChevronDown, { size: 16 })
|
|
13910
14159
|
]
|
|
13911
14160
|
}
|
|
13912
14161
|
),
|
|
13913
|
-
displayMode === "day" && /* @__PURE__ */ (0,
|
|
13914
|
-
/* @__PURE__ */ (0,
|
|
14162
|
+
displayMode === "day" && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
14163
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13915
14164
|
Button,
|
|
13916
14165
|
{
|
|
13917
14166
|
size: "sm",
|
|
@@ -13922,10 +14171,10 @@ var DatePicker = ({
|
|
|
13922
14171
|
onValueChange(newDate);
|
|
13923
14172
|
setDisplayedMonth(newDate);
|
|
13924
14173
|
},
|
|
13925
|
-
children: /* @__PURE__ */ (0,
|
|
14174
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react15.Calendar, { className: "size-5" })
|
|
13926
14175
|
}
|
|
13927
14176
|
),
|
|
13928
|
-
/* @__PURE__ */ (0,
|
|
14177
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13929
14178
|
Button,
|
|
13930
14179
|
{
|
|
13931
14180
|
size: "sm",
|
|
@@ -13933,10 +14182,10 @@ var DatePicker = ({
|
|
|
13933
14182
|
onClick: () => {
|
|
13934
14183
|
setDisplayedMonth(subtractDuration(displayedMonth, { months: 1 }));
|
|
13935
14184
|
},
|
|
13936
|
-
children: /* @__PURE__ */ (0,
|
|
14185
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react15.ArrowUp, { size: 20 })
|
|
13937
14186
|
}
|
|
13938
14187
|
),
|
|
13939
|
-
/* @__PURE__ */ (0,
|
|
14188
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13940
14189
|
Button,
|
|
13941
14190
|
{
|
|
13942
14191
|
size: "sm",
|
|
@@ -13944,12 +14193,12 @@ var DatePicker = ({
|
|
|
13944
14193
|
onClick: () => {
|
|
13945
14194
|
setDisplayedMonth(addDuration(displayedMonth, { months: 1 }));
|
|
13946
14195
|
},
|
|
13947
|
-
children: /* @__PURE__ */ (0,
|
|
14196
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react15.ArrowDown, { size: 20 })
|
|
13948
14197
|
}
|
|
13949
14198
|
)
|
|
13950
14199
|
] })
|
|
13951
14200
|
] }),
|
|
13952
|
-
displayMode === "yearMonth" ? /* @__PURE__ */ (0,
|
|
14201
|
+
displayMode === "yearMonth" ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13953
14202
|
YearMonthPicker,
|
|
13954
14203
|
{
|
|
13955
14204
|
...yearMonthPickerProps,
|
|
@@ -13966,7 +14215,7 @@ var DatePicker = ({
|
|
|
13966
14215
|
},
|
|
13967
14216
|
className: "h-60 max-h-60"
|
|
13968
14217
|
}
|
|
13969
|
-
) : /* @__PURE__ */ (0,
|
|
14218
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13970
14219
|
DayPicker,
|
|
13971
14220
|
{
|
|
13972
14221
|
...dayPickerProps,
|
|
@@ -13988,7 +14237,7 @@ var DatePickerUncontrolled = ({
|
|
|
13988
14237
|
...props
|
|
13989
14238
|
}) => {
|
|
13990
14239
|
const [date, setDate] = useOverwritableState(value, onValueChange);
|
|
13991
|
-
return /* @__PURE__ */ (0,
|
|
14240
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
13992
14241
|
DatePicker,
|
|
13993
14242
|
{
|
|
13994
14243
|
...props,
|
|
@@ -13999,7 +14248,7 @@ var DatePickerUncontrolled = ({
|
|
|
13999
14248
|
};
|
|
14000
14249
|
|
|
14001
14250
|
// src/components/user-interaction/date/DateTimePicker.tsx
|
|
14002
|
-
var
|
|
14251
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
14003
14252
|
var DateTimePicker = ({
|
|
14004
14253
|
value = /* @__PURE__ */ new Date(),
|
|
14005
14254
|
start,
|
|
@@ -14018,7 +14267,7 @@ var DateTimePicker = ({
|
|
|
14018
14267
|
let dateDisplay;
|
|
14019
14268
|
let timeDisplay;
|
|
14020
14269
|
if (useDate) {
|
|
14021
|
-
dateDisplay = /* @__PURE__ */ (0,
|
|
14270
|
+
dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14022
14271
|
DatePicker,
|
|
14023
14272
|
{
|
|
14024
14273
|
...datePickerProps,
|
|
@@ -14034,27 +14283,27 @@ var DateTimePicker = ({
|
|
|
14034
14283
|
);
|
|
14035
14284
|
}
|
|
14036
14285
|
if (useTime) {
|
|
14037
|
-
timeDisplay = /* @__PURE__ */ (0,
|
|
14286
|
+
timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14038
14287
|
TimePicker,
|
|
14039
14288
|
{
|
|
14040
14289
|
...timePickerProps,
|
|
14041
14290
|
is24HourFormat,
|
|
14042
14291
|
minuteIncrement,
|
|
14043
|
-
className: (0,
|
|
14292
|
+
className: (0, import_clsx30.default)({ "justify-between": mode === "time" }),
|
|
14044
14293
|
value,
|
|
14045
14294
|
onValueChange,
|
|
14046
14295
|
onEditComplete
|
|
14047
14296
|
}
|
|
14048
14297
|
);
|
|
14049
14298
|
}
|
|
14050
|
-
return /* @__PURE__ */ (0,
|
|
14299
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex-row-2 min-h-71 max-h-71", children: [
|
|
14051
14300
|
dateDisplay,
|
|
14052
14301
|
timeDisplay
|
|
14053
14302
|
] });
|
|
14054
14303
|
};
|
|
14055
14304
|
var DateTimePickerUncontrolled = ({ value: initialValue, onValueChange, ...props }) => {
|
|
14056
14305
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14057
|
-
return /* @__PURE__ */ (0,
|
|
14306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14058
14307
|
DateTimePicker,
|
|
14059
14308
|
{
|
|
14060
14309
|
...props,
|
|
@@ -14066,7 +14315,7 @@ var DateTimePickerUncontrolled = ({ value: initialValue, onValueChange, ...props
|
|
|
14066
14315
|
|
|
14067
14316
|
// src/components/user-interaction/date/DateTimePickerDialog.tsx
|
|
14068
14317
|
var import_react63 = require("react");
|
|
14069
|
-
var
|
|
14318
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
14070
14319
|
var DateTimePickerDialog = ({
|
|
14071
14320
|
defaultValue,
|
|
14072
14321
|
value,
|
|
@@ -14089,8 +14338,8 @@ var DateTimePickerDialog = ({
|
|
|
14089
14338
|
const initialValue = (0, import_react63.useMemo)(() => {
|
|
14090
14339
|
return state;
|
|
14091
14340
|
}, []);
|
|
14092
|
-
return /* @__PURE__ */ (0,
|
|
14093
|
-
/* @__PURE__ */ (0,
|
|
14341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
|
|
14342
|
+
/* @__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
14343
|
"span",
|
|
14095
14344
|
{
|
|
14096
14345
|
id: labelId,
|
|
@@ -14098,7 +14347,7 @@ var DateTimePickerDialog = ({
|
|
|
14098
14347
|
children: label ?? translation("sDateTimeSelect", { datetimeMode: mode })
|
|
14099
14348
|
}
|
|
14100
14349
|
) }),
|
|
14101
|
-
/* @__PURE__ */ (0,
|
|
14350
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14102
14351
|
DateTimePicker,
|
|
14103
14352
|
{
|
|
14104
14353
|
...pickerProps,
|
|
@@ -14108,8 +14357,8 @@ var DateTimePickerDialog = ({
|
|
|
14108
14357
|
onEditComplete: setState
|
|
14109
14358
|
}
|
|
14110
14359
|
),
|
|
14111
|
-
/* @__PURE__ */ (0,
|
|
14112
|
-
/* @__PURE__ */ (0,
|
|
14360
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
14361
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Visibility, { isVisible: allowRemove && !!initialValue, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14113
14362
|
Button,
|
|
14114
14363
|
{
|
|
14115
14364
|
size: "md",
|
|
@@ -14122,7 +14371,7 @@ var DateTimePickerDialog = ({
|
|
|
14122
14371
|
children: translation("clear")
|
|
14123
14372
|
}
|
|
14124
14373
|
) }),
|
|
14125
|
-
/* @__PURE__ */ (0,
|
|
14374
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Visibility, { isVisible: !initialValue, children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14126
14375
|
Button,
|
|
14127
14376
|
{
|
|
14128
14377
|
size: "md",
|
|
@@ -14135,7 +14384,7 @@ var DateTimePickerDialog = ({
|
|
|
14135
14384
|
children: translation("cancel")
|
|
14136
14385
|
}
|
|
14137
14386
|
) }),
|
|
14138
|
-
/* @__PURE__ */ (0,
|
|
14387
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14139
14388
|
Button,
|
|
14140
14389
|
{
|
|
14141
14390
|
size: "md",
|
|
@@ -14152,7 +14401,7 @@ var DateTimePickerDialog = ({
|
|
|
14152
14401
|
};
|
|
14153
14402
|
|
|
14154
14403
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
14155
|
-
var
|
|
14404
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
14156
14405
|
var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
14157
14406
|
value,
|
|
14158
14407
|
defaultValue = null,
|
|
@@ -14207,9 +14456,9 @@ var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
|
14207
14456
|
}
|
|
14208
14457
|
}, [changeOpenWrapper, readOnly, disabled]);
|
|
14209
14458
|
const clickHandler = PropsUtil.aria.click(() => changeOpenWrapper(true));
|
|
14210
|
-
return /* @__PURE__ */ (0,
|
|
14211
|
-
/* @__PURE__ */ (0,
|
|
14212
|
-
/* @__PURE__ */ (0,
|
|
14459
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
|
|
14460
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { ...containerProps, ref: innerRef, className: (0, import_clsx31.default)("relative w-full", containerProps?.className), children: [
|
|
14461
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14213
14462
|
"div",
|
|
14214
14463
|
{
|
|
14215
14464
|
...props,
|
|
@@ -14226,7 +14475,7 @@ var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
|
14226
14475
|
"aria-haspopup": "dialog",
|
|
14227
14476
|
"aria-expanded": isOpen,
|
|
14228
14477
|
"aria-controls": isOpen ? ids.popup : void 0,
|
|
14229
|
-
className: (0,
|
|
14478
|
+
className: (0, import_clsx31.default)(
|
|
14230
14479
|
"pr-10 w-full flex-row-2 items-center justify-between h-10 px-3 rounded-md input-element",
|
|
14231
14480
|
"outline-offset-0 outline-primary focus:outline-1 focus:outline-offset-1 focus:border-primary duration-(--animation-duration-in)",
|
|
14232
14481
|
{ "hover:cursor-pointer": !readOnly },
|
|
@@ -14235,7 +14484,7 @@ var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
|
14235
14484
|
children: state ? DateUtils.formatAbsolute(state, locale, mode === "dateTime") : placeholder ?? translation("clickToSelect")
|
|
14236
14485
|
}
|
|
14237
14486
|
),
|
|
14238
|
-
/* @__PURE__ */ (0,
|
|
14487
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Visibility, { isVisible: !readOnly, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14239
14488
|
Button,
|
|
14240
14489
|
{
|
|
14241
14490
|
coloringStyle: "text",
|
|
@@ -14251,11 +14500,11 @@ var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
|
14251
14500
|
"aria-expanded": isOpen,
|
|
14252
14501
|
"aria-controls": isOpen ? ids.popup : void 0,
|
|
14253
14502
|
"aria-label": translation("sDateTimeSelect", { datetimeMode: mode }),
|
|
14254
|
-
children: /* @__PURE__ */ (0,
|
|
14503
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_lucide_react16.CalendarIcon, { className: "size-5" })
|
|
14255
14504
|
}
|
|
14256
14505
|
) })
|
|
14257
14506
|
] }),
|
|
14258
|
-
/* @__PURE__ */ (0,
|
|
14507
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14259
14508
|
PopUp,
|
|
14260
14509
|
{
|
|
14261
14510
|
ref: containerRef,
|
|
@@ -14275,7 +14524,7 @@ var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
|
14275
14524
|
role: "dialog",
|
|
14276
14525
|
"aria-labelledby": ids.label,
|
|
14277
14526
|
className: "flex-col-2 p-2",
|
|
14278
|
-
children: /* @__PURE__ */ (0,
|
|
14527
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14279
14528
|
DateTimePickerDialog,
|
|
14280
14529
|
{
|
|
14281
14530
|
value: dialogValue,
|
|
@@ -14298,235 +14547,18 @@ var DateTimeInput = (0, import_react64.forwardRef)(function DateTimeInput2({
|
|
|
14298
14547
|
// src/components/layout/table/TableFilterPopups.tsx
|
|
14299
14548
|
var import_react66 = require("react");
|
|
14300
14549
|
|
|
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
14550
|
// src/components/user-interaction/select/MultiSelect.tsx
|
|
14519
14551
|
var import_react65 = require("react");
|
|
14520
|
-
var
|
|
14552
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
14521
14553
|
var MultiSelect = (0, import_react65.forwardRef)(function MultiSelect2({
|
|
14522
14554
|
children,
|
|
14523
14555
|
contentPanelProps,
|
|
14524
14556
|
buttonProps,
|
|
14525
14557
|
...props
|
|
14526
14558
|
}, ref) {
|
|
14527
|
-
return /* @__PURE__ */ (0,
|
|
14528
|
-
/* @__PURE__ */ (0,
|
|
14529
|
-
/* @__PURE__ */ (0,
|
|
14559
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(MultiSelectRoot, { ...props, children: [
|
|
14560
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(MultiSelectButton, { ref, ...buttonProps }),
|
|
14561
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(MultiSelectContent, { ...contentPanelProps, children })
|
|
14530
14562
|
] });
|
|
14531
14563
|
});
|
|
14532
14564
|
var MultiSelectUncontrolled = (0, import_react65.forwardRef)(function MultiSelectUncontrolled2({
|
|
@@ -14535,7 +14567,7 @@ var MultiSelectUncontrolled = (0, import_react65.forwardRef)(function MultiSelec
|
|
|
14535
14567
|
...props
|
|
14536
14568
|
}, ref) {
|
|
14537
14569
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14538
|
-
return /* @__PURE__ */ (0,
|
|
14570
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14539
14571
|
MultiSelect,
|
|
14540
14572
|
{
|
|
14541
14573
|
...props,
|
|
@@ -14547,120 +14579,120 @@ var MultiSelectUncontrolled = (0, import_react65.forwardRef)(function MultiSelec
|
|
|
14547
14579
|
});
|
|
14548
14580
|
|
|
14549
14581
|
// src/components/layout/table/TableFilterPopups.tsx
|
|
14550
|
-
var
|
|
14551
|
-
var
|
|
14582
|
+
var import_lucide_react17 = require("lucide-react");
|
|
14583
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14552
14584
|
var getOperatorInfo = (operator) => {
|
|
14553
14585
|
switch (operator) {
|
|
14554
14586
|
case "textEquals":
|
|
14555
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14587
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14556
14588
|
case "textNotEquals":
|
|
14557
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14589
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14558
14590
|
case "textNotWhitespace":
|
|
14559
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14591
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.TextInitial, { className: "w-4 h-4" }), translationKey: "filterNonWhitespace" };
|
|
14560
14592
|
case "textContains":
|
|
14561
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14593
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14562
14594
|
case "textNotContains":
|
|
14563
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14595
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
14564
14596
|
case "textStartsWith":
|
|
14565
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14597
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ArrowRight, { className: "w-4 h-4" }), translationKey: "startsWith" };
|
|
14566
14598
|
case "textEndsWith":
|
|
14567
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14599
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ArrowLeft, { className: "w-4 h-4" }), translationKey: "endsWith" };
|
|
14568
14600
|
case "numberEquals":
|
|
14569
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14601
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14570
14602
|
case "numberNotEquals":
|
|
14571
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14603
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14572
14604
|
case "numberGreaterThan":
|
|
14573
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14605
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "w-4 h-4" }), translationKey: "greaterThan" };
|
|
14574
14606
|
case "numberGreaterThanOrEqual":
|
|
14575
14607
|
return {
|
|
14576
|
-
icon: /* @__PURE__ */ (0,
|
|
14577
|
-
/* @__PURE__ */ (0,
|
|
14578
|
-
/* @__PURE__ */ (0,
|
|
14608
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14609
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "w-4 h-4" }),
|
|
14610
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "-ml-1 w-4 h-4" })
|
|
14579
14611
|
] }),
|
|
14580
14612
|
translationKey: "greaterThanOrEqual"
|
|
14581
14613
|
};
|
|
14582
14614
|
case "numberLessThan":
|
|
14583
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14615
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "w-4 h-4" }), translationKey: "lessThan" };
|
|
14584
14616
|
case "numberLessThanOrEqual":
|
|
14585
14617
|
return {
|
|
14586
|
-
icon: /* @__PURE__ */ (0,
|
|
14587
|
-
/* @__PURE__ */ (0,
|
|
14588
|
-
/* @__PURE__ */ (0,
|
|
14618
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14619
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "w-4 h-4" }),
|
|
14620
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "-ml-1 w-4 h-4" })
|
|
14589
14621
|
] }),
|
|
14590
14622
|
translationKey: "lessThanOrEqual"
|
|
14591
14623
|
};
|
|
14592
14624
|
case "numberBetween":
|
|
14593
14625
|
return {
|
|
14594
|
-
icon: /* @__PURE__ */ (0,
|
|
14595
|
-
/* @__PURE__ */ (0,
|
|
14596
|
-
/* @__PURE__ */ (0,
|
|
14626
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14627
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "w-4 h-4" }),
|
|
14628
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "-ml-1 w-4 h-4" })
|
|
14597
14629
|
] }),
|
|
14598
14630
|
translationKey: "between"
|
|
14599
14631
|
};
|
|
14600
14632
|
case "numberNotBetween":
|
|
14601
14633
|
return {
|
|
14602
|
-
icon: /* @__PURE__ */ (0,
|
|
14603
|
-
/* @__PURE__ */ (0,
|
|
14604
|
-
/* @__PURE__ */ (0,
|
|
14634
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14635
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "w-4 h-4" }),
|
|
14636
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "-ml-1 w-4 h-4" })
|
|
14605
14637
|
] }),
|
|
14606
14638
|
translationKey: "notBetween"
|
|
14607
14639
|
};
|
|
14608
14640
|
case "dateEquals":
|
|
14609
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14641
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14610
14642
|
case "dateNotEquals":
|
|
14611
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14643
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14612
14644
|
case "dateGreaterThan":
|
|
14613
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14645
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "w-4 h-4" }), translationKey: "after" };
|
|
14614
14646
|
case "dateGreaterThanOrEqual":
|
|
14615
14647
|
return {
|
|
14616
|
-
icon: /* @__PURE__ */ (0,
|
|
14617
|
-
/* @__PURE__ */ (0,
|
|
14618
|
-
/* @__PURE__ */ (0,
|
|
14648
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14649
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "w-4 h-4" }),
|
|
14650
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "-ml-1 w-4 h-4" })
|
|
14619
14651
|
] }),
|
|
14620
14652
|
translationKey: "onOrAfter"
|
|
14621
14653
|
};
|
|
14622
14654
|
case "dateLessThan":
|
|
14623
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14655
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "w-4 h-4" }), translationKey: "before" };
|
|
14624
14656
|
case "dateLessThanOrEqual":
|
|
14625
14657
|
return {
|
|
14626
|
-
icon: /* @__PURE__ */ (0,
|
|
14627
|
-
/* @__PURE__ */ (0,
|
|
14628
|
-
/* @__PURE__ */ (0,
|
|
14658
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14659
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "w-4 h-4" }),
|
|
14660
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "-ml-1 w-4 h-4" })
|
|
14629
14661
|
] }),
|
|
14630
14662
|
translationKey: "onOrBefore"
|
|
14631
14663
|
};
|
|
14632
14664
|
case "dateBetween":
|
|
14633
14665
|
return {
|
|
14634
|
-
icon: /* @__PURE__ */ (0,
|
|
14635
|
-
/* @__PURE__ */ (0,
|
|
14636
|
-
/* @__PURE__ */ (0,
|
|
14666
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14667
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "w-4 h-4" }),
|
|
14668
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "-ml-1 w-4 h-4" })
|
|
14637
14669
|
] }),
|
|
14638
14670
|
translationKey: "between"
|
|
14639
14671
|
};
|
|
14640
14672
|
case "dateNotBetween":
|
|
14641
14673
|
return {
|
|
14642
|
-
icon: /* @__PURE__ */ (0,
|
|
14643
|
-
/* @__PURE__ */ (0,
|
|
14644
|
-
/* @__PURE__ */ (0,
|
|
14674
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-0 items-center", children: [
|
|
14675
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronLeft, { className: "w-4 h-4" }),
|
|
14676
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.ChevronRight, { className: "-ml-1 w-4 h-4" })
|
|
14645
14677
|
] }),
|
|
14646
14678
|
translationKey: "notBetween"
|
|
14647
14679
|
};
|
|
14648
14680
|
case "booleanIsTrue":
|
|
14649
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14681
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.CheckCircle2, { className: "w-4 h-4" }), translationKey: "isTrue" };
|
|
14650
14682
|
case "booleanIsFalse":
|
|
14651
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14683
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.XCircle, { className: "w-4 h-4" }), translationKey: "isFalse" };
|
|
14652
14684
|
case "tagsEquals":
|
|
14653
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14685
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.Equal, { className: "w-4 h-4" }), translationKey: "equals" };
|
|
14654
14686
|
case "tagsNotEquals":
|
|
14655
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14687
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.EqualNot, { className: "w-4 h-4" }), translationKey: "notEquals" };
|
|
14656
14688
|
case "tagsContains":
|
|
14657
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14689
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.SearchCheck, { className: "w-4 h-4" }), translationKey: "contains" };
|
|
14658
14690
|
case "tagsNotContains":
|
|
14659
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14691
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.SearchX, { className: "w-4 h-4" }), translationKey: "notContains" };
|
|
14660
14692
|
case "undefined":
|
|
14661
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14693
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.CircleDashed, { className: "w-4 h-4" }), translationKey: "filterUndefined" };
|
|
14662
14694
|
case "notUndefined":
|
|
14663
|
-
return { icon: /* @__PURE__ */ (0,
|
|
14695
|
+
return { icon: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_lucide_react17.CircleDot, { className: "w-4 h-4" }), translationKey: "filterNotUndefined" };
|
|
14664
14696
|
default:
|
|
14665
14697
|
return { icon: null, translationKey: "undefined translation" };
|
|
14666
14698
|
}
|
|
@@ -14669,7 +14701,7 @@ var OperatorLabel = ({ operator }) => {
|
|
|
14669
14701
|
const translation = useHightideTranslation();
|
|
14670
14702
|
const { icon, translationKey } = getOperatorInfo(operator);
|
|
14671
14703
|
const label = typeof translationKey === "string" ? translation(translationKey) : translationKey;
|
|
14672
|
-
return /* @__PURE__ */ (0,
|
|
14704
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-row-1 items-center gap-2", children: [
|
|
14673
14705
|
icon,
|
|
14674
14706
|
label
|
|
14675
14707
|
] });
|
|
@@ -14683,8 +14715,8 @@ var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14683
14715
|
...TableFilterOperator.generic
|
|
14684
14716
|
], []);
|
|
14685
14717
|
const needsParameterInput = !["textNotWhitespace", "undefined", "notUndefined"].includes(operator);
|
|
14686
|
-
return /* @__PURE__ */ (0,
|
|
14687
|
-
/* @__PURE__ */ (0,
|
|
14718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
14719
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14688
14720
|
Select,
|
|
14689
14721
|
{
|
|
14690
14722
|
value: operator,
|
|
@@ -14695,11 +14727,11 @@ var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14695
14727
|
});
|
|
14696
14728
|
},
|
|
14697
14729
|
buttonProps: { className: "min-w-64" },
|
|
14698
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
14730
|
+
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
14731
|
}
|
|
14700
14732
|
),
|
|
14701
|
-
/* @__PURE__ */ (0,
|
|
14702
|
-
/* @__PURE__ */ (0,
|
|
14733
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
14734
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14703
14735
|
Input,
|
|
14704
14736
|
{
|
|
14705
14737
|
value: parameter.searchText ?? "",
|
|
@@ -14713,7 +14745,7 @@ var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14713
14745
|
className: "min-w-64"
|
|
14714
14746
|
}
|
|
14715
14747
|
) }),
|
|
14716
|
-
/* @__PURE__ */ (0,
|
|
14748
|
+
/* @__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
14749
|
] });
|
|
14718
14750
|
};
|
|
14719
14751
|
var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14726,8 +14758,8 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14726
14758
|
], []);
|
|
14727
14759
|
const needsRangeInput = operator === "numberBetween" || operator === "numberNotBetween";
|
|
14728
14760
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14729
|
-
return /* @__PURE__ */ (0,
|
|
14730
|
-
/* @__PURE__ */ (0,
|
|
14761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
14762
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14731
14763
|
Select,
|
|
14732
14764
|
{
|
|
14733
14765
|
value: operator,
|
|
@@ -14738,12 +14770,12 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14738
14770
|
});
|
|
14739
14771
|
},
|
|
14740
14772
|
buttonProps: { className: "min-w-64" },
|
|
14741
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
14773
|
+
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
14774
|
}
|
|
14743
14775
|
),
|
|
14744
|
-
/* @__PURE__ */ (0,
|
|
14745
|
-
/* @__PURE__ */ (0,
|
|
14746
|
-
/* @__PURE__ */ (0,
|
|
14776
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
14777
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
14778
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FormFieldLayout, { label: translation("min"), children: ({ ariaAttributes, interactionStates, id }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14747
14779
|
Input,
|
|
14748
14780
|
{
|
|
14749
14781
|
...ariaAttributes,
|
|
@@ -14762,7 +14794,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14762
14794
|
className: "input-indicator-hidden min-w-64"
|
|
14763
14795
|
}
|
|
14764
14796
|
) }),
|
|
14765
|
-
/* @__PURE__ */ (0,
|
|
14797
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(FormFieldLayout, { label: translation("max"), children: ({ ariaAttributes, interactionStates, id }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14766
14798
|
Input,
|
|
14767
14799
|
{
|
|
14768
14800
|
...ariaAttributes,
|
|
@@ -14782,7 +14814,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14782
14814
|
}
|
|
14783
14815
|
) })
|
|
14784
14816
|
] }) }),
|
|
14785
|
-
/* @__PURE__ */ (0,
|
|
14817
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14786
14818
|
Input,
|
|
14787
14819
|
{
|
|
14788
14820
|
value: parameter.compareValue?.toString() ?? "",
|
|
@@ -14798,7 +14830,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14798
14830
|
className: "min-w-64"
|
|
14799
14831
|
}
|
|
14800
14832
|
) }),
|
|
14801
|
-
/* @__PURE__ */ (0,
|
|
14833
|
+
/* @__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
14834
|
] });
|
|
14803
14835
|
};
|
|
14804
14836
|
var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14813,8 +14845,8 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14813
14845
|
], []);
|
|
14814
14846
|
const needsRangeInput = operator === "dateBetween" || operator === "dateNotBetween";
|
|
14815
14847
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14816
|
-
return /* @__PURE__ */ (0,
|
|
14817
|
-
/* @__PURE__ */ (0,
|
|
14848
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
14849
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14818
14850
|
Select,
|
|
14819
14851
|
{
|
|
14820
14852
|
value: operator,
|
|
@@ -14825,12 +14857,12 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14825
14857
|
});
|
|
14826
14858
|
},
|
|
14827
14859
|
buttonProps: { className: "min-w-64" },
|
|
14828
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
14860
|
+
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
14861
|
}
|
|
14830
14862
|
),
|
|
14831
|
-
/* @__PURE__ */ (0,
|
|
14832
|
-
/* @__PURE__ */ (0,
|
|
14833
|
-
/* @__PURE__ */ (0,
|
|
14863
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
14864
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: needsRangeInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
14865
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14834
14866
|
DateTimeInput,
|
|
14835
14867
|
{
|
|
14836
14868
|
value: temporaryMinDateValue ?? parameter.min ?? null,
|
|
@@ -14863,7 +14895,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14863
14895
|
className: "min-w-64"
|
|
14864
14896
|
}
|
|
14865
14897
|
),
|
|
14866
|
-
/* @__PURE__ */ (0,
|
|
14898
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14867
14899
|
DateTimeInput,
|
|
14868
14900
|
{
|
|
14869
14901
|
value: temporaryMaxDateValue ?? parameter.max ?? null,
|
|
@@ -14896,7 +14928,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14896
14928
|
}
|
|
14897
14929
|
)
|
|
14898
14930
|
] }) }),
|
|
14899
|
-
/* @__PURE__ */ (0,
|
|
14931
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: !needsRangeInput && needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14900
14932
|
DateTimeInput,
|
|
14901
14933
|
{
|
|
14902
14934
|
value: parameter.compareDate ?? null,
|
|
@@ -14912,7 +14944,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14912
14944
|
className: "min-w-64"
|
|
14913
14945
|
}
|
|
14914
14946
|
) }),
|
|
14915
|
-
/* @__PURE__ */ (0,
|
|
14947
|
+
/* @__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
14948
|
] });
|
|
14917
14949
|
};
|
|
14918
14950
|
var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14921,7 +14953,7 @@ var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14921
14953
|
...TableFilterOperator.boolean,
|
|
14922
14954
|
...TableFilterOperator.generic
|
|
14923
14955
|
], []);
|
|
14924
|
-
return /* @__PURE__ */ (0,
|
|
14956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14925
14957
|
Select,
|
|
14926
14958
|
{
|
|
14927
14959
|
value: operator,
|
|
@@ -14932,13 +14964,13 @@ var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14932
14964
|
});
|
|
14933
14965
|
},
|
|
14934
14966
|
buttonProps: { className: "min-w-64" },
|
|
14935
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
14967
|
+
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
14968
|
}
|
|
14937
14969
|
) });
|
|
14938
14970
|
};
|
|
14939
14971
|
var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
14940
14972
|
const translation = useHightideTranslation();
|
|
14941
|
-
const { table } =
|
|
14973
|
+
const { table } = useTableDataContext();
|
|
14942
14974
|
const operator = filterValue?.operator ?? "tagsContains";
|
|
14943
14975
|
const parameter = filterValue?.parameter ?? {};
|
|
14944
14976
|
const availableOperators = (0, import_react66.useMemo)(() => [
|
|
@@ -14954,8 +14986,8 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14954
14986
|
return null;
|
|
14955
14987
|
}
|
|
14956
14988
|
const needsParameterInput = operator !== "undefined" && operator !== "notUndefined";
|
|
14957
|
-
return /* @__PURE__ */ (0,
|
|
14958
|
-
/* @__PURE__ */ (0,
|
|
14989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: "flex-col-2 gap-2", children: [
|
|
14990
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14959
14991
|
Select,
|
|
14960
14992
|
{
|
|
14961
14993
|
value: operator,
|
|
@@ -14966,11 +14998,11 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14966
14998
|
});
|
|
14967
14999
|
},
|
|
14968
15000
|
buttonProps: { className: "min-w-64" },
|
|
14969
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
15001
|
+
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
15002
|
}
|
|
14971
15003
|
),
|
|
14972
|
-
/* @__PURE__ */ (0,
|
|
14973
|
-
/* @__PURE__ */ (0,
|
|
15004
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { className: "typography-label-lg font-semibold", children: translation("parameter") }),
|
|
15005
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(Visibility, { isVisible: needsParameterInput, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14974
15006
|
MultiSelectUncontrolled,
|
|
14975
15007
|
{
|
|
14976
15008
|
value: Array.isArray(parameter.searchTags) ? parameter.searchTags.map((tag) => String(tag)) : [],
|
|
@@ -14981,10 +15013,10 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
14981
15013
|
});
|
|
14982
15014
|
},
|
|
14983
15015
|
buttonProps: { className: "min-w-64" },
|
|
14984
|
-
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0,
|
|
15016
|
+
children: availableTags.map(({ tag, label }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(MultiSelectOption, { value: tag, children: label }, tag))
|
|
14985
15017
|
}
|
|
14986
15018
|
) }),
|
|
14987
|
-
/* @__PURE__ */ (0,
|
|
15019
|
+
/* @__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
15020
|
] });
|
|
14989
15021
|
};
|
|
14990
15022
|
var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
@@ -14992,7 +15024,7 @@ var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
14992
15024
|
const availableOperators = (0, import_react66.useMemo)(() => [
|
|
14993
15025
|
...TableFilterOperator.generic
|
|
14994
15026
|
], []);
|
|
14995
|
-
return /* @__PURE__ */ (0,
|
|
15027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14996
15028
|
Select,
|
|
14997
15029
|
{
|
|
14998
15030
|
value: operator,
|
|
@@ -15003,31 +15035,31 @@ var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
15003
15035
|
});
|
|
15004
15036
|
},
|
|
15005
15037
|
buttonProps: { className: "min-w-64" },
|
|
15006
|
-
children: availableOperators.map((op) => /* @__PURE__ */ (0,
|
|
15038
|
+
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
15039
|
}
|
|
15008
15040
|
) });
|
|
15009
15041
|
};
|
|
15010
15042
|
var TableFilterContent = ({ filterType, ...props }) => {
|
|
15011
15043
|
switch (filterType) {
|
|
15012
15044
|
case "text":
|
|
15013
|
-
return /* @__PURE__ */ (0,
|
|
15045
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TextFilter, { ...props });
|
|
15014
15046
|
case "number":
|
|
15015
|
-
return /* @__PURE__ */ (0,
|
|
15047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(NumberFilter, { ...props });
|
|
15016
15048
|
case "date":
|
|
15017
|
-
return /* @__PURE__ */ (0,
|
|
15049
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(DateFilter, { ...props });
|
|
15018
15050
|
case "boolean":
|
|
15019
|
-
return /* @__PURE__ */ (0,
|
|
15051
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(BooleanFilter, { ...props });
|
|
15020
15052
|
case "tags":
|
|
15021
|
-
return /* @__PURE__ */ (0,
|
|
15053
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(TagsFilter, { ...props });
|
|
15022
15054
|
case "generic":
|
|
15023
|
-
return /* @__PURE__ */ (0,
|
|
15055
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(GenericFilter, { ...props });
|
|
15024
15056
|
default:
|
|
15025
15057
|
return null;
|
|
15026
15058
|
}
|
|
15027
15059
|
};
|
|
15028
15060
|
|
|
15029
15061
|
// src/components/layout/table/TableFilterButton.tsx
|
|
15030
|
-
var
|
|
15062
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
15031
15063
|
var TableFilterButton = ({
|
|
15032
15064
|
filterType,
|
|
15033
15065
|
column
|
|
@@ -15051,8 +15083,8 @@ var TableFilterButton = ({
|
|
|
15051
15083
|
if (filterType === "tags" && (!column.columnDef.meta?.filterData?.tags?.length || column.columnDef.meta.filterData.tags.length === 0)) {
|
|
15052
15084
|
return null;
|
|
15053
15085
|
}
|
|
15054
|
-
return /* @__PURE__ */ (0,
|
|
15055
|
-
/* @__PURE__ */ (0,
|
|
15086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
15087
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
15056
15088
|
Button,
|
|
15057
15089
|
{
|
|
15058
15090
|
ref: anchorRef,
|
|
@@ -15068,12 +15100,12 @@ var TableFilterButton = ({
|
|
|
15068
15100
|
"aria-labelledby": ids.label,
|
|
15069
15101
|
className: "relative",
|
|
15070
15102
|
children: [
|
|
15071
|
-
/* @__PURE__ */ (0,
|
|
15072
|
-
/* @__PURE__ */ (0,
|
|
15103
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react18.FilterIcon, { className: "size-4" }),
|
|
15104
|
+
/* @__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
15105
|
]
|
|
15074
15106
|
}
|
|
15075
15107
|
),
|
|
15076
|
-
/* @__PURE__ */ (0,
|
|
15108
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
15077
15109
|
PopUp,
|
|
15078
15110
|
{
|
|
15079
15111
|
ref: containerRef,
|
|
@@ -15089,8 +15121,8 @@ var TableFilterButton = ({
|
|
|
15089
15121
|
"aria-labelledby": ids.label,
|
|
15090
15122
|
className: "flex-col-2 p-2 items-start",
|
|
15091
15123
|
children: [
|
|
15092
|
-
/* @__PURE__ */ (0,
|
|
15093
|
-
/* @__PURE__ */ (0,
|
|
15124
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { id: ids.label, className: "typography-label-lg font-semibold", children: translation("filter") }),
|
|
15125
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
15094
15126
|
TableFilterContent,
|
|
15095
15127
|
{
|
|
15096
15128
|
columnId: column.id,
|
|
@@ -15099,12 +15131,12 @@ var TableFilterButton = ({
|
|
|
15099
15131
|
onFilterValueChange: setFilterValue
|
|
15100
15132
|
}
|
|
15101
15133
|
),
|
|
15102
|
-
/* @__PURE__ */ (0,
|
|
15103
|
-
hasFilter && /* @__PURE__ */ (0,
|
|
15134
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-2 justify-end w-full", children: [
|
|
15135
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Button, { color: "negative", size: "sm", onClick: () => {
|
|
15104
15136
|
column.setFilterValue(void 0);
|
|
15105
15137
|
setIsOpen(false);
|
|
15106
15138
|
}, children: translation("remove") }),
|
|
15107
|
-
/* @__PURE__ */ (0,
|
|
15139
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Button, { size: "sm", onClick: () => {
|
|
15108
15140
|
if (filterValue) {
|
|
15109
15141
|
column.setFilterValue(filterValue);
|
|
15110
15142
|
}
|
|
@@ -15119,8 +15151,8 @@ var TableFilterButton = ({
|
|
|
15119
15151
|
|
|
15120
15152
|
// src/components/layout/table/TableHeader.tsx
|
|
15121
15153
|
var import_react68 = require("react");
|
|
15122
|
-
var
|
|
15123
|
-
var TableHeader = ({ table: tableOverride }) => {
|
|
15154
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
15155
|
+
var TableHeader = ({ table: tableOverride, isSticky = false }) => {
|
|
15124
15156
|
const { table: tableState } = useTableHeaderContext();
|
|
15125
15157
|
const table = tableOverride ?? tableState;
|
|
15126
15158
|
const handleResizeMove = (0, import_react68.useCallback)((e) => {
|
|
@@ -15165,8 +15197,8 @@ var TableHeader = ({ table: tableOverride }) => {
|
|
|
15165
15197
|
window.removeEventListener("pointerup", handleResizeEnd);
|
|
15166
15198
|
};
|
|
15167
15199
|
}, [handleResizeEnd, handleResizeMove, table]);
|
|
15168
|
-
return /* @__PURE__ */ (0,
|
|
15169
|
-
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0,
|
|
15200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
|
|
15201
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
15170
15202
|
"col",
|
|
15171
15203
|
{
|
|
15172
15204
|
style: {
|
|
@@ -15177,16 +15209,16 @@ var TableHeader = ({ table: tableOverride }) => {
|
|
|
15177
15209
|
},
|
|
15178
15210
|
header.id
|
|
15179
15211
|
)) }, headerGroup.id)),
|
|
15180
|
-
/* @__PURE__ */ (0,
|
|
15181
|
-
return /* @__PURE__ */ (0,
|
|
15212
|
+
/* @__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) => {
|
|
15213
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
|
|
15182
15214
|
"th",
|
|
15183
15215
|
{
|
|
15184
15216
|
colSpan: header.colSpan,
|
|
15185
|
-
"data-
|
|
15186
|
-
className: (0,
|
|
15217
|
+
"data-sticky": isSticky ? "" : void 0,
|
|
15218
|
+
className: (0, import_clsx32.default)("table-header-cell group/table-header-cell", header.column.columnDef.meta?.className),
|
|
15187
15219
|
children: [
|
|
15188
|
-
/* @__PURE__ */ (0,
|
|
15189
|
-
/* @__PURE__ */ (0,
|
|
15220
|
+
/* @__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: [
|
|
15221
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Visibility, { isVisible: header.column.getCanSort(), children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
15190
15222
|
TableSortButton,
|
|
15191
15223
|
{
|
|
15192
15224
|
sortDirection: header.column.getIsSorted(),
|
|
@@ -15212,19 +15244,19 @@ var TableHeader = ({ table: tableOverride }) => {
|
|
|
15212
15244
|
}
|
|
15213
15245
|
}
|
|
15214
15246
|
) }),
|
|
15215
|
-
/* @__PURE__ */ (0,
|
|
15247
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Visibility, { isVisible: header.column.getCanFilter() && isTableFilterCategory(header.column.columnDef.filterFn), children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
15216
15248
|
TableFilterButton,
|
|
15217
15249
|
{
|
|
15218
15250
|
column: header.column,
|
|
15219
15251
|
filterType: header.column.columnDef.filterFn
|
|
15220
15252
|
}
|
|
15221
15253
|
) }),
|
|
15222
|
-
(0,
|
|
15254
|
+
(0, import_react_table3.flexRender)(
|
|
15223
15255
|
header.column.columnDef.header,
|
|
15224
15256
|
header.getContext()
|
|
15225
15257
|
)
|
|
15226
15258
|
] }) }),
|
|
15227
|
-
/* @__PURE__ */ (0,
|
|
15259
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Visibility, { isVisible: header.column.getCanResize(), children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
15228
15260
|
"div",
|
|
15229
15261
|
{
|
|
15230
15262
|
onPointerDown: (e) => {
|
|
@@ -15255,336 +15287,86 @@ var TableHeader = ({ table: tableOverride }) => {
|
|
|
15255
15287
|
};
|
|
15256
15288
|
|
|
15257
15289
|
// src/components/layout/table/TableDisplay.tsx
|
|
15258
|
-
var
|
|
15290
|
+
var import_clsx33 = __toESM(require("clsx"));
|
|
15291
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
15259
15292
|
var TableDisplay = ({
|
|
15260
15293
|
children,
|
|
15261
15294
|
containerProps,
|
|
15295
|
+
tableHeaderProps,
|
|
15262
15296
|
...props
|
|
15263
15297
|
}) => {
|
|
15264
|
-
const { table } =
|
|
15265
|
-
const { containerRef } = useTableContainerContext();
|
|
15266
|
-
const { sizeVars } = useTableHeaderContext();
|
|
15267
|
-
return /* @__PURE__ */ (0,
|
|
15268
|
-
"table",
|
|
15269
|
-
{
|
|
15270
|
-
...props,
|
|
15271
|
-
|
|
15272
|
-
style: {
|
|
15273
|
-
...sizeVars,
|
|
15274
|
-
width: Math.floor(Math.max(table.getTotalSize(), containerRef.current?.offsetWidth ?? table.getTotalSize()))
|
|
15275
|
-
},
|
|
15276
|
-
children: [
|
|
15277
|
-
children,
|
|
15278
|
-
/* @__PURE__ */ (0,
|
|
15279
|
-
/* @__PURE__ */ (0,
|
|
15280
|
-
]
|
|
15281
|
-
}
|
|
15282
|
-
) });
|
|
15283
|
-
};
|
|
15284
|
-
|
|
15285
|
-
// src/components/layout/table/TablePagination.tsx
|
|
15286
|
-
var import_react69 = require("react");
|
|
15287
|
-
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
15288
|
-
var TablePagination = () => {
|
|
15289
|
-
const { table } = useTableBodyContext();
|
|
15290
|
-
(0, import_react69.useEffect)(() => {
|
|
15291
|
-
const { pageIndex } = table.getState().pagination;
|
|
15292
|
-
const pageCount = table.getPageCount();
|
|
15293
|
-
if (pageIndex >= pageCount || pageIndex < 0) {
|
|
15294
|
-
table.setPageIndex(MathUtil.clamp(pageIndex, [0, pageCount - 1]));
|
|
15295
|
-
}
|
|
15296
|
-
}, [table]);
|
|
15297
|
-
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
15298
|
-
Pagination,
|
|
15299
|
-
{
|
|
15300
|
-
pageIndex: table.getState().pagination.pageIndex,
|
|
15301
|
-
pageCount: table.getPageCount(),
|
|
15302
|
-
onPageIndexChanged: (page) => table.setPageIndex(page)
|
|
15303
|
-
}
|
|
15304
|
-
);
|
|
15305
|
-
};
|
|
15306
|
-
var defaultPageSizeOptions = [10, 25, 50, 100];
|
|
15307
|
-
var TablePageSizeController = ({
|
|
15308
|
-
pageSizeOptions = defaultPageSizeOptions,
|
|
15309
|
-
...props
|
|
15310
|
-
}) => {
|
|
15311
|
-
const { table } = useTableBodyContext();
|
|
15312
|
-
const currentPageSize = table.getState().pagination.pageSize;
|
|
15313
|
-
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
15314
|
-
Select,
|
|
15315
|
-
{
|
|
15316
|
-
...props,
|
|
15317
|
-
value: currentPageSize.toString(),
|
|
15318
|
-
onValueChange: (value) => table.setPageSize(Number(value)),
|
|
15319
|
-
children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(SelectOption, { value: size.toString(), children: size }, size))
|
|
15320
|
-
}
|
|
15321
|
-
);
|
|
15322
|
-
};
|
|
15323
|
-
|
|
15324
|
-
// src/components/layout/table/TableProvider.tsx
|
|
15325
|
-
var import_react71 = require("react");
|
|
15326
|
-
|
|
15327
|
-
// src/components/layout/table/columnSizeUtil.ts
|
|
15328
|
-
var calculate = ({
|
|
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 }) }) }) });
|
|
15298
|
+
const { table } = useTableDataContext();
|
|
15299
|
+
const { containerRef } = useTableContainerContext();
|
|
15300
|
+
const { sizeVars } = useTableHeaderContext();
|
|
15301
|
+
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)(
|
|
15302
|
+
"table",
|
|
15303
|
+
{
|
|
15304
|
+
...props,
|
|
15305
|
+
className: (0, import_clsx33.default)("table", props.className),
|
|
15306
|
+
style: {
|
|
15307
|
+
...sizeVars,
|
|
15308
|
+
width: Math.floor(Math.max(table.getTotalSize(), containerRef.current?.offsetWidth ?? table.getTotalSize()))
|
|
15309
|
+
},
|
|
15310
|
+
children: [
|
|
15311
|
+
children,
|
|
15312
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TableHeader, { ...tableHeaderProps }),
|
|
15313
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(TableBody, {})
|
|
15314
|
+
]
|
|
15315
|
+
}
|
|
15316
|
+
) });
|
|
15579
15317
|
};
|
|
15580
15318
|
|
|
15581
|
-
// src/components/layout/table/
|
|
15582
|
-
var
|
|
15319
|
+
// src/components/layout/table/TablePagination.tsx
|
|
15320
|
+
var import_react69 = require("react");
|
|
15321
|
+
var import_clsx34 = __toESM(require("clsx"));
|
|
15322
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
15323
|
+
var TablePaginationMenu = () => {
|
|
15324
|
+
const { table } = useTableDataContext();
|
|
15325
|
+
(0, import_react69.useEffect)(() => {
|
|
15326
|
+
const { pageIndex } = table.getState().pagination;
|
|
15327
|
+
const pageCount = table.getPageCount();
|
|
15328
|
+
if (pageIndex >= pageCount || pageIndex < 0) {
|
|
15329
|
+
table.setPageIndex(MathUtil.clamp(pageIndex, [0, pageCount - 1]));
|
|
15330
|
+
}
|
|
15331
|
+
}, [table]);
|
|
15332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
15333
|
+
Pagination,
|
|
15334
|
+
{
|
|
15335
|
+
pageIndex: table.getState().pagination.pageIndex,
|
|
15336
|
+
pageCount: table.getPageCount(),
|
|
15337
|
+
onPageIndexChanged: (page) => table.setPageIndex(page)
|
|
15338
|
+
}
|
|
15339
|
+
);
|
|
15340
|
+
};
|
|
15341
|
+
var defaultPageSizeOptions = [10, 25, 50, 100];
|
|
15342
|
+
var TablePageSizeSelect = ({
|
|
15343
|
+
pageSizeOptions = defaultPageSizeOptions,
|
|
15344
|
+
...props
|
|
15345
|
+
}) => {
|
|
15346
|
+
const { table } = useTableDataContext();
|
|
15347
|
+
const currentPageSize = table.getState().pagination.pageSize;
|
|
15348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
15349
|
+
Select,
|
|
15350
|
+
{
|
|
15351
|
+
...props,
|
|
15352
|
+
value: currentPageSize.toString(),
|
|
15353
|
+
onValueChange: (value) => table.setPageSize(Number(value)),
|
|
15354
|
+
children: pageSizeOptions.map((size) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(SelectOption, { value: size.toString(), children: size }, size))
|
|
15355
|
+
}
|
|
15356
|
+
);
|
|
15357
|
+
};
|
|
15358
|
+
var TablePagination = ({ allowChangingPageSize = true, pageSizeOptions, ...props }) => {
|
|
15359
|
+
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: [
|
|
15360
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(TablePaginationMenu, {}),
|
|
15361
|
+
/* @__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" } }) })
|
|
15362
|
+
] }) });
|
|
15363
|
+
};
|
|
15583
15364
|
|
|
15584
15365
|
// src/components/user-interaction/Checkbox.tsx
|
|
15585
|
-
var
|
|
15586
|
-
var
|
|
15587
|
-
var
|
|
15366
|
+
var import_lucide_react19 = require("lucide-react");
|
|
15367
|
+
var import_react70 = require("react");
|
|
15368
|
+
var import_clsx35 = __toESM(require("clsx"));
|
|
15369
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
15588
15370
|
var Checkbox = ({
|
|
15589
15371
|
value = false,
|
|
15590
15372
|
indeterminate = false,
|
|
@@ -15598,11 +15380,11 @@ var Checkbox = ({
|
|
|
15598
15380
|
alwaysShowCheckIcon = false,
|
|
15599
15381
|
...props
|
|
15600
15382
|
}) => {
|
|
15601
|
-
const onChangeWrapper = (0,
|
|
15383
|
+
const onChangeWrapper = (0, import_react70.useCallback)(() => {
|
|
15602
15384
|
onValueChange?.(!value);
|
|
15603
15385
|
onEditComplete?.(!value);
|
|
15604
15386
|
}, [onEditComplete, onValueChange, value]);
|
|
15605
|
-
return /* @__PURE__ */ (0,
|
|
15387
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
15606
15388
|
"div",
|
|
15607
15389
|
{
|
|
15608
15390
|
...props,
|
|
@@ -15620,7 +15402,6 @@ var Checkbox = ({
|
|
|
15620
15402
|
props.onKeyDown?.(event);
|
|
15621
15403
|
}
|
|
15622
15404
|
},
|
|
15623
|
-
"data-name": PropsUtil.dataAttributes.name("checkbox", props),
|
|
15624
15405
|
"data-checked": !indeterminate ? value : "indeterminate",
|
|
15625
15406
|
"data-size": size ?? void 0,
|
|
15626
15407
|
...PropsUtil.dataAttributes.interactionStates({ disabled, invalid, readOnly, required }),
|
|
@@ -15628,123 +15409,438 @@ var Checkbox = ({
|
|
|
15628
15409
|
tabIndex: disabled ? -1 : 0,
|
|
15629
15410
|
"aria-checked": indeterminate ? "mixed" : value,
|
|
15630
15411
|
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
15412
|
+
className: (0, import_clsx35.default)("checkbox", props.className),
|
|
15631
15413
|
children: [
|
|
15632
|
-
/* @__PURE__ */ (0,
|
|
15633
|
-
/* @__PURE__ */ (0,
|
|
15414
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react19.Minus, { className: "checkbox-indicator", "aria-hidden": true }) }),
|
|
15415
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react19.Check, { className: "checkbox-indicator", "aria-hidden": true }) })
|
|
15634
15416
|
]
|
|
15635
15417
|
}
|
|
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
|
|
15418
|
+
);
|
|
15419
|
+
};
|
|
15420
|
+
var CheckboxUncontrolled = ({
|
|
15421
|
+
value: initialValue,
|
|
15422
|
+
onValueChange,
|
|
15423
|
+
...props
|
|
15424
|
+
}) => {
|
|
15425
|
+
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
15426
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
15427
|
+
Checkbox,
|
|
15428
|
+
{
|
|
15429
|
+
...props,
|
|
15430
|
+
value,
|
|
15431
|
+
onValueChange: setValue
|
|
15432
|
+
}
|
|
15433
|
+
);
|
|
15434
|
+
};
|
|
15435
|
+
|
|
15436
|
+
// src/components/layout/table/TableWithSelectionProvider.tsx
|
|
15437
|
+
var import_react71 = require("react");
|
|
15438
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
15439
|
+
var TableWithSelectionProvider = ({
|
|
15440
|
+
children,
|
|
15441
|
+
state,
|
|
15442
|
+
fillerRow,
|
|
15443
|
+
rowSelection,
|
|
15444
|
+
disableClickRowClickSelection = false,
|
|
15445
|
+
selectionRowId = "selection",
|
|
15446
|
+
onRowClick,
|
|
15447
|
+
...props
|
|
15448
|
+
}) => {
|
|
15449
|
+
const columnDef = (0, import_react71.useMemo)(() => [
|
|
15450
|
+
{
|
|
15451
|
+
id: selectionRowId,
|
|
15452
|
+
header: ({ table }) => {
|
|
15453
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
15454
|
+
Checkbox,
|
|
15455
|
+
{
|
|
15456
|
+
value: table.getIsAllRowsSelected(),
|
|
15457
|
+
indeterminate: table.getIsSomeRowsSelected(),
|
|
15458
|
+
onValueChange: (value) => {
|
|
15459
|
+
const newValue = !!value;
|
|
15460
|
+
table.toggleAllRowsSelected(newValue);
|
|
15461
|
+
}
|
|
15462
|
+
}
|
|
15463
|
+
);
|
|
15464
|
+
},
|
|
15465
|
+
cell: ({ row }) => {
|
|
15466
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Checkbox, { disabled: !row.getCanSelect(), value: row.getIsSelected(), onValueChange: row.getToggleSelectedHandler() });
|
|
15467
|
+
},
|
|
15468
|
+
size: 60,
|
|
15469
|
+
minSize: 60,
|
|
15470
|
+
maxSize: 60,
|
|
15471
|
+
enableResizing: false,
|
|
15472
|
+
enableSorting: false,
|
|
15473
|
+
enableHiding: false,
|
|
15474
|
+
enableColumnFilter: false
|
|
15475
|
+
},
|
|
15476
|
+
...props.columns ?? []
|
|
15477
|
+
], [selectionRowId, props.columns]);
|
|
15478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
15479
|
+
TableProvider,
|
|
15480
|
+
{
|
|
15481
|
+
...props,
|
|
15482
|
+
fillerRow: (0, import_react71.useCallback)((columnId, table) => {
|
|
15483
|
+
if (columnId === selectionRowId) {
|
|
15484
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Checkbox, { value: false, disabled: true, className: "max-w-6" });
|
|
15485
|
+
}
|
|
15486
|
+
return fillerRow?.(columnId, table) ?? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(FillerCell, {});
|
|
15487
|
+
}, [fillerRow, selectionRowId]),
|
|
15488
|
+
columns: columnDef,
|
|
15489
|
+
initialState: {
|
|
15490
|
+
...props.initialState,
|
|
15491
|
+
columnPinning: {
|
|
15492
|
+
...props.initialState?.columnPinning,
|
|
15493
|
+
left: [selectionRowId, ...props.initialState?.columnPinning?.left ?? []]
|
|
15494
|
+
}
|
|
15495
|
+
},
|
|
15496
|
+
state: {
|
|
15497
|
+
rowSelection,
|
|
15498
|
+
...state
|
|
15499
|
+
},
|
|
15500
|
+
onRowClick: (0, import_react71.useCallback)((row, table) => {
|
|
15501
|
+
if (!disableClickRowClickSelection) {
|
|
15502
|
+
row.toggleSelected();
|
|
15503
|
+
}
|
|
15504
|
+
onRowClick?.(row, table);
|
|
15505
|
+
}, [disableClickRowClickSelection, onRowClick]),
|
|
15506
|
+
children
|
|
15507
|
+
}
|
|
15508
|
+
);
|
|
15509
|
+
};
|
|
15510
|
+
|
|
15511
|
+
// src/components/layout/table/Table.tsx
|
|
15512
|
+
var import_clsx36 = __toESM(require("clsx"));
|
|
15513
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
15514
|
+
var Table = ({ children, table, paginationOptions, displayProps, header, footer, ...props }) => {
|
|
15515
|
+
const { showPagination = true, allowChangingPageSize, pageSizeOptions } = paginationOptions ?? {};
|
|
15516
|
+
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: [
|
|
15517
|
+
header,
|
|
15518
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TableDisplay, { ...displayProps, children }),
|
|
15519
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Visibility, { isVisible: showPagination, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TablePagination, { allowChangingPageSize, pageSizeOptions }) }),
|
|
15520
|
+
footer
|
|
15521
|
+
] }) });
|
|
15522
|
+
};
|
|
15523
|
+
var TableWithSelection = ({
|
|
15524
|
+
children,
|
|
15525
|
+
table,
|
|
15526
|
+
paginationOptions,
|
|
15527
|
+
displayProps,
|
|
15528
|
+
header,
|
|
15529
|
+
footer,
|
|
15530
|
+
...props
|
|
15531
|
+
}) => {
|
|
15532
|
+
const { showPagination = true, allowChangingPageSize, pageSizeOptions } = paginationOptions ?? {};
|
|
15533
|
+
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: [
|
|
15534
|
+
header,
|
|
15535
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TableDisplay, { ...displayProps, children }),
|
|
15536
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Visibility, { isVisible: showPagination, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(TablePagination, { allowChangingPageSize, pageSizeOptions }) }),
|
|
15537
|
+
footer
|
|
15538
|
+
] }) });
|
|
15539
|
+
};
|
|
15540
|
+
|
|
15541
|
+
// src/components/layout/table/TableColumn.tsx
|
|
15542
|
+
var import_react72 = require("react");
|
|
15543
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
15544
|
+
var TableColumnComponent = ({
|
|
15545
|
+
filterType,
|
|
15546
|
+
...props
|
|
15547
|
+
}) => {
|
|
15548
|
+
const { registerColumn } = useTableColumnDefinitionContext();
|
|
15549
|
+
const filterFn = filterType ?? props.filterFn;
|
|
15550
|
+
useLogOnce(
|
|
15551
|
+
"TableColumn: For filterType === tags, filterData.tags must be set.",
|
|
15552
|
+
filterType === "tags" && props.meta?.filterData?.tags === void 0
|
|
15553
|
+
);
|
|
15554
|
+
const [column] = (0, import_react72.useState)({
|
|
15555
|
+
...props,
|
|
15556
|
+
filterFn
|
|
15557
|
+
});
|
|
15558
|
+
(0, import_react72.useEffect)(() => {
|
|
15559
|
+
const unsubscribe = registerColumn(column);
|
|
15560
|
+
return () => {
|
|
15561
|
+
unsubscribe();
|
|
15562
|
+
};
|
|
15563
|
+
}, [registerColumn, column]);
|
|
15564
|
+
return null;
|
|
15565
|
+
};
|
|
15566
|
+
var TableColumnFactory = () => (0, import_react72.memo)(
|
|
15567
|
+
TableColumnComponent,
|
|
15568
|
+
(prevProps, nextProps) => {
|
|
15569
|
+
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;
|
|
15570
|
+
}
|
|
15571
|
+
);
|
|
15572
|
+
var TableColumn = (props) => {
|
|
15573
|
+
const TableColumnComponent2 = (0, import_react72.useMemo)(() => TableColumnFactory(), []);
|
|
15574
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(TableColumnComponent2, { ...props });
|
|
15575
|
+
};
|
|
15576
|
+
|
|
15577
|
+
// src/components/layout/table/TableColumnSwitcher.tsx
|
|
15578
|
+
var import_react73 = require("react");
|
|
15579
|
+
var import_lucide_react20 = require("lucide-react");
|
|
15580
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
15581
|
+
var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
15582
|
+
const { table } = useTableDataContext();
|
|
15583
|
+
const translation = useHightideTranslation();
|
|
15584
|
+
const containerRef = (0, import_react73.useRef)(null);
|
|
15585
|
+
const generatedId = (0, import_react73.useId)();
|
|
15586
|
+
const ids = (0, import_react73.useMemo)(() => ({
|
|
15587
|
+
popup: props.id ?? `table-column-picker-popup-${generatedId}`,
|
|
15588
|
+
label: `table-column-picker-label-${generatedId}`
|
|
15589
|
+
}), [generatedId, props.id]);
|
|
15590
|
+
const tableState = table.getState();
|
|
15591
|
+
const columnOrder = tableState.columnOrder;
|
|
15592
|
+
const columnPinning = tableState.columnPinning;
|
|
15593
|
+
const columns = (0, import_react73.useMemo)(() => {
|
|
15594
|
+
const allColumns = table.getAllColumns();
|
|
15595
|
+
const leftPinned = [];
|
|
15596
|
+
const unpinned = [];
|
|
15597
|
+
const rightPinned = [];
|
|
15598
|
+
const columnMap = new Map(allColumns.map((col) => [col.id, col]));
|
|
15599
|
+
const processColumns = (columnIds, targetArray) => {
|
|
15600
|
+
for (const columnId of columnIds) {
|
|
15601
|
+
const column = columnMap.get(columnId);
|
|
15602
|
+
if (column) {
|
|
15603
|
+
targetArray.push(column);
|
|
15604
|
+
columnMap.delete(columnId);
|
|
15605
|
+
}
|
|
15606
|
+
}
|
|
15607
|
+
};
|
|
15608
|
+
if (columnOrder.length > 0) {
|
|
15609
|
+
const leftPinnedIds = columnPinning?.left ?? [];
|
|
15610
|
+
const rightPinnedIds = columnPinning?.right ?? [];
|
|
15611
|
+
processColumns(leftPinnedIds, leftPinned);
|
|
15612
|
+
processColumns(rightPinnedIds, rightPinned);
|
|
15613
|
+
for (const columnId of columnOrder) {
|
|
15614
|
+
if (!leftPinnedIds.includes(columnId) && !rightPinnedIds.includes(columnId)) {
|
|
15615
|
+
const column = columnMap.get(columnId);
|
|
15616
|
+
if (column) {
|
|
15617
|
+
unpinned.push(column);
|
|
15618
|
+
columnMap.delete(columnId);
|
|
15619
|
+
}
|
|
15620
|
+
}
|
|
15621
|
+
}
|
|
15622
|
+
for (const column of columnMap.values()) {
|
|
15623
|
+
const pinState = column.getIsPinned();
|
|
15624
|
+
if (pinState === "left") {
|
|
15625
|
+
leftPinned.push(column);
|
|
15626
|
+
} else if (pinState === "right") {
|
|
15627
|
+
rightPinned.push(column);
|
|
15628
|
+
} else {
|
|
15629
|
+
unpinned.push(column);
|
|
15630
|
+
}
|
|
15631
|
+
}
|
|
15632
|
+
} else {
|
|
15633
|
+
for (const column of allColumns) {
|
|
15634
|
+
const pinState = column.getIsPinned();
|
|
15635
|
+
if (pinState === "left") {
|
|
15636
|
+
leftPinned.push(column);
|
|
15637
|
+
} else if (pinState === "right") {
|
|
15638
|
+
rightPinned.push(column);
|
|
15639
|
+
} else {
|
|
15640
|
+
unpinned.push(column);
|
|
15641
|
+
}
|
|
15642
|
+
}
|
|
15643
|
+
}
|
|
15644
|
+
return [...leftPinned, ...unpinned, ...rightPinned];
|
|
15645
|
+
}, [table, columnOrder, columnPinning]);
|
|
15646
|
+
const moveColumn = (columnId, direction) => {
|
|
15647
|
+
const currentColumns = columns.map((col) => col.id);
|
|
15648
|
+
const currentIndex = currentColumns.indexOf(columnId);
|
|
15649
|
+
if (currentIndex === -1) return;
|
|
15650
|
+
const column = table.getColumn(columnId);
|
|
15651
|
+
if (!column) return;
|
|
15652
|
+
const isPinned = column.getIsPinned();
|
|
15653
|
+
if (isPinned) return;
|
|
15654
|
+
const newIndex = direction === "up" ? currentIndex - 1 : currentIndex + 1;
|
|
15655
|
+
if (newIndex < 0 || newIndex >= currentColumns.length) return;
|
|
15656
|
+
const targetColumn = table.getColumn(currentColumns[newIndex]);
|
|
15657
|
+
if (!targetColumn) return;
|
|
15658
|
+
const targetIsPinned = targetColumn.getIsPinned();
|
|
15659
|
+
if (targetIsPinned !== isPinned) return;
|
|
15660
|
+
const newOrder = [...currentColumns];
|
|
15661
|
+
const temp = newOrder[currentIndex];
|
|
15662
|
+
newOrder[currentIndex] = newOrder[newIndex];
|
|
15663
|
+
newOrder[newIndex] = temp;
|
|
15664
|
+
table.setColumnOrder(newOrder);
|
|
15665
|
+
};
|
|
15666
|
+
const toggleColumnVisibility = (columnId) => {
|
|
15667
|
+
const column = table.getColumn(columnId);
|
|
15668
|
+
column?.toggleVisibility();
|
|
15669
|
+
};
|
|
15670
|
+
const pinColumn = (columnId, side) => {
|
|
15671
|
+
const column = table.getColumn(columnId);
|
|
15672
|
+
if (!column || !column.getCanPin()) return;
|
|
15673
|
+
column.pin(side);
|
|
15674
|
+
};
|
|
15675
|
+
const unpinColumn = (columnId) => {
|
|
15676
|
+
const column = table.getColumn(columnId);
|
|
15677
|
+
if (!column || !column.getCanPin()) return;
|
|
15678
|
+
const pinState = column.getIsPinned();
|
|
15679
|
+
if (!pinState) return;
|
|
15680
|
+
column.pin(false);
|
|
15681
|
+
const currentOrder = table.getState().columnOrder;
|
|
15682
|
+
const unpinnedColumns = currentOrder.filter((id) => {
|
|
15683
|
+
const col = table.getColumn(id);
|
|
15684
|
+
return col && !col.getIsPinned();
|
|
15685
|
+
});
|
|
15686
|
+
if (pinState === "left") {
|
|
15687
|
+
const newOrder = [columnId, ...unpinnedColumns];
|
|
15688
|
+
table.setColumnOrder(newOrder);
|
|
15689
|
+
} else if (pinState === "right") {
|
|
15690
|
+
const newOrder = [...unpinnedColumns, columnId];
|
|
15691
|
+
table.setColumnOrder(newOrder);
|
|
15692
|
+
}
|
|
15693
|
+
};
|
|
15694
|
+
const getColumnHeader = (columnId) => {
|
|
15695
|
+
const column = table.getColumn(columnId);
|
|
15696
|
+
const header = column?.columnDef.header;
|
|
15697
|
+
if (typeof header === "string") {
|
|
15698
|
+
return header;
|
|
15650
15699
|
}
|
|
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,
|
|
15700
|
+
if (typeof header === "function") {
|
|
15701
|
+
return columnId;
|
|
15702
|
+
}
|
|
15703
|
+
return columnId;
|
|
15704
|
+
};
|
|
15705
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
15706
|
+
PopUp,
|
|
15670
15707
|
{
|
|
15671
15708
|
...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
|
-
)
|
|
15709
|
+
ref: containerRef,
|
|
15710
|
+
id: ids.popup,
|
|
15711
|
+
options: {
|
|
15712
|
+
verticalAlignment: "afterEnd",
|
|
15713
|
+
horizontalAlignment: "center",
|
|
15714
|
+
...props.options
|
|
15701
15715
|
},
|
|
15716
|
+
role: "dialog",
|
|
15717
|
+
"aria-labelledby": ids.label,
|
|
15718
|
+
"aria-describedby": ids.label,
|
|
15719
|
+
className: "flex-col-1 p-2 items-start min-w-72",
|
|
15702
15720
|
children: [
|
|
15703
|
-
/* @__PURE__ */ (0,
|
|
15704
|
-
|
|
15705
|
-
{
|
|
15706
|
-
|
|
15707
|
-
|
|
15708
|
-
|
|
15709
|
-
|
|
15721
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-col-1", children: [
|
|
15722
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { id: ids.label, className: "typography-title-md font-semibold", children: translation("columnPicker") }),
|
|
15723
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("span", { className: "text-description typography-label-sm mb-2", children: translation("columnPickerDescription") })
|
|
15724
|
+
] }),
|
|
15725
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "flex-col-1 overflow-y-auto w-full", children: columns.map((column, index) => {
|
|
15726
|
+
const columnId = column.id;
|
|
15727
|
+
const isVisible = column.getIsVisible();
|
|
15728
|
+
const pinState = column.getIsPinned();
|
|
15729
|
+
const isPinned = column.getCanPin() && !!pinState;
|
|
15730
|
+
const prevColumn = index > 0 ? columns[index - 1] : null;
|
|
15731
|
+
const nextColumn = index < columns.length - 1 ? columns[index + 1] : null;
|
|
15732
|
+
const prevIsPinned = prevColumn?.getCanPin() && !!prevColumn.getIsPinned();
|
|
15733
|
+
const nextIsPinned = nextColumn?.getCanPin() && !!nextColumn.getIsPinned();
|
|
15734
|
+
const canMoveUp = index > 0 && !isPinned && !prevIsPinned;
|
|
15735
|
+
const canMoveDown = index < columns.length - 1 && !isPinned && !nextIsPinned;
|
|
15736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)("div", { className: "flex-row-2 items-center justify-between gap-2 w-full", children: [
|
|
15737
|
+
/* @__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: [
|
|
15738
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15739
|
+
Button,
|
|
15710
15740
|
{
|
|
15711
|
-
|
|
15712
|
-
|
|
15713
|
-
|
|
15714
|
-
|
|
15715
|
-
|
|
15716
|
-
|
|
15741
|
+
layout: "icon",
|
|
15742
|
+
size: "sm",
|
|
15743
|
+
color: "neutral",
|
|
15744
|
+
coloringStyle: "text",
|
|
15745
|
+
disabled: pinState === "left",
|
|
15746
|
+
onClick: () => pinColumn(columnId, "left"),
|
|
15747
|
+
"aria-label": translation("pinLeft"),
|
|
15748
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react20.ChevronLeft, { className: "size-4" })
|
|
15717
15749
|
}
|
|
15718
|
-
)
|
|
15719
|
-
|
|
15720
|
-
|
|
15721
|
-
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15722
|
-
Checkbox,
|
|
15750
|
+
),
|
|
15751
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15752
|
+
Button,
|
|
15723
15753
|
{
|
|
15724
|
-
|
|
15725
|
-
|
|
15726
|
-
|
|
15754
|
+
layout: "icon",
|
|
15755
|
+
size: "sm",
|
|
15756
|
+
color: "neutral",
|
|
15757
|
+
coloringStyle: "text",
|
|
15758
|
+
disabled: pinState === "right",
|
|
15759
|
+
onClick: () => pinColumn(columnId, "right"),
|
|
15760
|
+
"aria-label": translation("pinRight"),
|
|
15761
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react20.ChevronRight, { className: "size-4" })
|
|
15727
15762
|
}
|
|
15728
|
-
)
|
|
15729
|
-
},
|
|
15730
|
-
|
|
15731
|
-
|
|
15732
|
-
|
|
15733
|
-
|
|
15734
|
-
|
|
15735
|
-
|
|
15736
|
-
|
|
15737
|
-
|
|
15738
|
-
|
|
15739
|
-
|
|
15763
|
+
)
|
|
15764
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
15765
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15766
|
+
Button,
|
|
15767
|
+
{
|
|
15768
|
+
layout: "icon",
|
|
15769
|
+
size: "sm",
|
|
15770
|
+
color: "neutral",
|
|
15771
|
+
coloringStyle: "text",
|
|
15772
|
+
disabled: !canMoveUp,
|
|
15773
|
+
onClick: () => moveColumn(columnId, "up"),
|
|
15774
|
+
"aria-label": translation("moveUp"),
|
|
15775
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react20.ChevronUp, { className: "size-4" })
|
|
15776
|
+
}
|
|
15777
|
+
),
|
|
15778
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15779
|
+
Button,
|
|
15780
|
+
{
|
|
15781
|
+
layout: "icon",
|
|
15782
|
+
size: "sm",
|
|
15783
|
+
color: "neutral",
|
|
15784
|
+
coloringStyle: "text",
|
|
15785
|
+
disabled: !canMoveDown,
|
|
15786
|
+
onClick: () => moveColumn(columnId, "down"),
|
|
15787
|
+
"aria-label": translation("moveDown"),
|
|
15788
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react20.ChevronDown, { className: "size-4" })
|
|
15789
|
+
}
|
|
15790
|
+
)
|
|
15791
|
+
] }) }),
|
|
15792
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)("div", { className: "flex-1 typography-label-lg", children: getColumnHeader(columnId) }),
|
|
15793
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [
|
|
15794
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15795
|
+
Button,
|
|
15796
|
+
{
|
|
15797
|
+
layout: "icon",
|
|
15798
|
+
size: "sm",
|
|
15799
|
+
color: "neutral",
|
|
15800
|
+
coloringStyle: "text",
|
|
15801
|
+
disabled: !column.getCanHide(),
|
|
15802
|
+
onClick: () => toggleColumnVisibility(columnId),
|
|
15803
|
+
"aria-label": isVisible ? translation("hideColumn") : translation("showColumn"),
|
|
15804
|
+
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" })
|
|
15805
|
+
}
|
|
15806
|
+
),
|
|
15807
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15808
|
+
Button,
|
|
15809
|
+
{
|
|
15810
|
+
layout: "icon",
|
|
15811
|
+
size: "sm",
|
|
15812
|
+
color: "neutral",
|
|
15813
|
+
coloringStyle: "text",
|
|
15814
|
+
disabled: !column.getCanPin(),
|
|
15815
|
+
onClick: () => {
|
|
15816
|
+
if (isPinned) {
|
|
15817
|
+
unpinColumn(columnId);
|
|
15818
|
+
} else {
|
|
15819
|
+
pinColumn(columnId, "left");
|
|
15820
|
+
}
|
|
15821
|
+
},
|
|
15822
|
+
"aria-label": isPinned ? translation("unpin") : translation("pinLeft"),
|
|
15823
|
+
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" })
|
|
15824
|
+
}
|
|
15825
|
+
)
|
|
15826
|
+
] })
|
|
15827
|
+
] }, columnId);
|
|
15828
|
+
}) })
|
|
15740
15829
|
]
|
|
15741
15830
|
}
|
|
15742
15831
|
);
|
|
15743
15832
|
};
|
|
15833
|
+
var TableColumnSwitcher = ({ buttonProps, ...props }) => {
|
|
15834
|
+
const translation = useHightideTranslation();
|
|
15835
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(PopUpRoot, { children: [
|
|
15836
|
+
/* @__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" }) }) }) }),
|
|
15837
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(TableColumnSwitcherPopUp, { ...props })
|
|
15838
|
+
] });
|
|
15839
|
+
};
|
|
15744
15840
|
|
|
15745
15841
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
15746
15842
|
var import_react74 = require("react");
|
|
15747
|
-
var
|
|
15843
|
+
var import_clsx37 = require("clsx");
|
|
15748
15844
|
|
|
15749
15845
|
// src/utils/writeToClipboard.ts
|
|
15750
15846
|
var writeToClipboard = (text) => {
|
|
@@ -15753,7 +15849,7 @@ var writeToClipboard = (text) => {
|
|
|
15753
15849
|
|
|
15754
15850
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
15755
15851
|
var import_lucide_react21 = require("lucide-react");
|
|
15756
|
-
var
|
|
15852
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
15757
15853
|
var CopyToClipboardWrapper = ({
|
|
15758
15854
|
children,
|
|
15759
15855
|
textToCopy,
|
|
@@ -15784,10 +15880,10 @@ var CopyToClipboardWrapper = ({
|
|
|
15784
15880
|
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
15785
15881
|
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
15786
15882
|
};
|
|
15787
|
-
return /* @__PURE__ */ (0,
|
|
15883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
15788
15884
|
"div",
|
|
15789
15885
|
{
|
|
15790
|
-
className: (0,
|
|
15886
|
+
className: (0, import_clsx37.clsx)("relative inline-block cursor-copy", containerClassName),
|
|
15791
15887
|
onMouseEnter: () => {
|
|
15792
15888
|
setIsShowingIndication(true);
|
|
15793
15889
|
},
|
|
@@ -15802,10 +15898,10 @@ var CopyToClipboardWrapper = ({
|
|
|
15802
15898
|
},
|
|
15803
15899
|
children: [
|
|
15804
15900
|
children,
|
|
15805
|
-
/* @__PURE__ */ (0,
|
|
15901
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(
|
|
15806
15902
|
"div",
|
|
15807
15903
|
{
|
|
15808
|
-
className: (0,
|
|
15904
|
+
className: (0, import_clsx37.clsx)(
|
|
15809
15905
|
`absolute text-xs font-semibold text-tooltip-text px-2 py-1 rounded whitespace-nowrap
|
|
15810
15906
|
shadow-around-md bg-tooltip-background cursor-default pointer-events-none`,
|
|
15811
15907
|
"transition-opacity duration-200",
|
|
@@ -15817,18 +15913,18 @@ var CopyToClipboardWrapper = ({
|
|
|
15817
15913
|
opacity: isShowingIndication || isShowingConfirmation ? 1 : 0
|
|
15818
15914
|
},
|
|
15819
15915
|
children: [
|
|
15820
|
-
isShowingConfirmation && /* @__PURE__ */ (0,
|
|
15821
|
-
/* @__PURE__ */ (0,
|
|
15916
|
+
isShowingConfirmation && /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex-row-1", children: [
|
|
15917
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_lucide_react21.CheckIcon, { size: 16, className: "text-positive" }),
|
|
15822
15918
|
translation("copied")
|
|
15823
15919
|
] }),
|
|
15824
|
-
isShowingIndication && /* @__PURE__ */ (0,
|
|
15825
|
-
/* @__PURE__ */ (0,
|
|
15920
|
+
isShowingIndication && /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "flex-row-1 text-description", children: [
|
|
15921
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_lucide_react21.Copy, { size: 16 }),
|
|
15826
15922
|
translation("clickToCopy")
|
|
15827
15923
|
] }),
|
|
15828
|
-
/* @__PURE__ */ (0,
|
|
15924
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
15829
15925
|
"div",
|
|
15830
15926
|
{
|
|
15831
|
-
className: (0,
|
|
15927
|
+
className: (0, import_clsx37.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
|
|
15832
15928
|
style: { ...triangleStyle[position], zIndex: zIndex + 1 }
|
|
15833
15929
|
}
|
|
15834
15930
|
)
|
|
@@ -15842,7 +15938,7 @@ var CopyToClipboardWrapper = ({
|
|
|
15842
15938
|
|
|
15843
15939
|
// src/components/user-interaction/Menu.tsx
|
|
15844
15940
|
var import_react76 = require("react");
|
|
15845
|
-
var
|
|
15941
|
+
var import_clsx38 = __toESM(require("clsx"));
|
|
15846
15942
|
|
|
15847
15943
|
// src/hooks/useHoverState.ts
|
|
15848
15944
|
var import_react75 = require("react");
|
|
@@ -15889,16 +15985,16 @@ var useHoverState = (props = void 0) => {
|
|
|
15889
15985
|
};
|
|
15890
15986
|
|
|
15891
15987
|
// src/components/user-interaction/Menu.tsx
|
|
15892
|
-
var
|
|
15988
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
15893
15989
|
var MenuItem = ({
|
|
15894
15990
|
children,
|
|
15895
15991
|
onClick,
|
|
15896
15992
|
isDisabled = false,
|
|
15897
15993
|
className
|
|
15898
|
-
}) => /* @__PURE__ */ (0,
|
|
15994
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15899
15995
|
"div",
|
|
15900
15996
|
{
|
|
15901
|
-
className: (0,
|
|
15997
|
+
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
15998
|
"text-disabled cursor-not-allowed": isDisabled,
|
|
15903
15999
|
"text-menu-text hover:bg-primary/20": !isDisabled,
|
|
15904
16000
|
"cursor-pointer": !!onClick
|
|
@@ -15922,9 +16018,9 @@ var Menu = ({
|
|
|
15922
16018
|
toggleOpen: () => setIsOpen((prevState) => !prevState),
|
|
15923
16019
|
disabled
|
|
15924
16020
|
};
|
|
15925
|
-
return /* @__PURE__ */ (0,
|
|
16021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [
|
|
15926
16022
|
trigger(bag, (0, import_react76.useCallback)((el) => triggerRef.current = el, [])),
|
|
15927
|
-
/* @__PURE__ */ (0,
|
|
16023
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15928
16024
|
PopUp,
|
|
15929
16025
|
{
|
|
15930
16026
|
...props,
|
|
@@ -15946,8 +16042,8 @@ var Menu = ({
|
|
|
15946
16042
|
|
|
15947
16043
|
// src/components/user-interaction/ScrollPicker.tsx
|
|
15948
16044
|
var import_react77 = require("react");
|
|
15949
|
-
var
|
|
15950
|
-
var
|
|
16045
|
+
var import_clsx39 = __toESM(require("clsx"));
|
|
16046
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
15951
16047
|
var up = 1;
|
|
15952
16048
|
var down = -1;
|
|
15953
16049
|
var ScrollPicker = ({
|
|
@@ -16086,7 +16182,7 @@ var ScrollPicker = ({
|
|
|
16086
16182
|
}
|
|
16087
16183
|
return MathUtil.clamp(1 - opacityValue / max);
|
|
16088
16184
|
};
|
|
16089
|
-
return /* @__PURE__ */ (0,
|
|
16185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
16090
16186
|
"div",
|
|
16091
16187
|
{
|
|
16092
16188
|
className: "relative overflow-hidden",
|
|
@@ -16097,15 +16193,15 @@ var ScrollPicker = ({
|
|
|
16097
16193
|
setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + deltaY }));
|
|
16098
16194
|
}
|
|
16099
16195
|
},
|
|
16100
|
-
children: /* @__PURE__ */ (0,
|
|
16101
|
-
/* @__PURE__ */ (0,
|
|
16196
|
+
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: [
|
|
16197
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
16102
16198
|
"div",
|
|
16103
16199
|
{
|
|
16104
16200
|
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
16201
|
style: { height: `${itemHeight}px` }
|
|
16106
16202
|
}
|
|
16107
16203
|
),
|
|
16108
|
-
/* @__PURE__ */ (0,
|
|
16204
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
16109
16205
|
"div",
|
|
16110
16206
|
{
|
|
16111
16207
|
className: "flex-col-2 select-none",
|
|
@@ -16113,10 +16209,10 @@ var ScrollPicker = ({
|
|
|
16113
16209
|
transform: `translateY(${-transition * (distance + itemHeight)}px)`,
|
|
16114
16210
|
columnGap: `${distance}px`
|
|
16115
16211
|
},
|
|
16116
|
-
children: shownItems.map(({ name: name2, index }, arrayIndex) => /* @__PURE__ */ (0,
|
|
16212
|
+
children: shownItems.map(({ name: name2, index }, arrayIndex) => /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
16117
16213
|
"div",
|
|
16118
16214
|
{
|
|
16119
|
-
className: (0,
|
|
16215
|
+
className: (0, import_clsx39.default)(
|
|
16120
16216
|
`flex-col-2 items-center justify-center rounded-md`,
|
|
16121
16217
|
{
|
|
16122
16218
|
"text-primary font-bold": currentIndex === index,
|
|
@@ -16144,8 +16240,8 @@ var ScrollPicker = ({
|
|
|
16144
16240
|
|
|
16145
16241
|
// src/components/user-interaction/Textarea.tsx
|
|
16146
16242
|
var import_react78 = require("react");
|
|
16147
|
-
var
|
|
16148
|
-
var
|
|
16243
|
+
var import_clsx40 = __toESM(require("clsx"));
|
|
16244
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
16149
16245
|
var Textarea = (0, import_react78.forwardRef)(function Textarea2({
|
|
16150
16246
|
invalid = false,
|
|
16151
16247
|
onValueChange,
|
|
@@ -16158,7 +16254,7 @@ var Textarea = (0, import_react78.forwardRef)(function Textarea2({
|
|
|
16158
16254
|
onEditComplete?.(text);
|
|
16159
16255
|
clearTimer();
|
|
16160
16256
|
};
|
|
16161
|
-
return /* @__PURE__ */ (0,
|
|
16257
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
16162
16258
|
"textarea",
|
|
16163
16259
|
{
|
|
16164
16260
|
...props,
|
|
@@ -16188,7 +16284,7 @@ var TextareaUncontrolled = ({
|
|
|
16188
16284
|
...props
|
|
16189
16285
|
}) => {
|
|
16190
16286
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
16191
|
-
return /* @__PURE__ */ (0,
|
|
16287
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
16192
16288
|
Textarea,
|
|
16193
16289
|
{
|
|
16194
16290
|
...props,
|
|
@@ -16208,10 +16304,10 @@ var TextareaWithHeadline = ({
|
|
|
16208
16304
|
}) => {
|
|
16209
16305
|
const genId = (0, import_react78.useId)();
|
|
16210
16306
|
const usedId = id ?? genId;
|
|
16211
|
-
return /* @__PURE__ */ (0,
|
|
16307
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(
|
|
16212
16308
|
"div",
|
|
16213
16309
|
{
|
|
16214
|
-
className: (0,
|
|
16310
|
+
className: (0, import_clsx40.default)(
|
|
16215
16311
|
"group flex-col-3 border-2 rounded-lg",
|
|
16216
16312
|
{
|
|
16217
16313
|
"bg-input-background text-input-text hover:border-primary focus-within:border-primary": !disabled,
|
|
@@ -16220,13 +16316,13 @@ var TextareaWithHeadline = ({
|
|
|
16220
16316
|
containerClassName
|
|
16221
16317
|
),
|
|
16222
16318
|
children: [
|
|
16223
|
-
headline && /* @__PURE__ */ (0,
|
|
16224
|
-
/* @__PURE__ */ (0,
|
|
16319
|
+
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 }),
|
|
16320
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
16225
16321
|
Textarea,
|
|
16226
16322
|
{
|
|
16227
16323
|
...props,
|
|
16228
16324
|
id: usedId,
|
|
16229
|
-
className: (0,
|
|
16325
|
+
className: (0, import_clsx40.default)(
|
|
16230
16326
|
"border-transparent focus:ring-0 focus-visible:ring-0 resize-none h-32",
|
|
16231
16327
|
className
|
|
16232
16328
|
)
|
|
@@ -16238,7 +16334,7 @@ var TextareaWithHeadline = ({
|
|
|
16238
16334
|
};
|
|
16239
16335
|
|
|
16240
16336
|
// src/components/user-interaction/date/TimeDisplay.tsx
|
|
16241
|
-
var
|
|
16337
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
16242
16338
|
var TimeDisplay = ({
|
|
16243
16339
|
date,
|
|
16244
16340
|
mode = "daysFromToday"
|
|
@@ -16275,14 +16371,14 @@ var TimeDisplay = ({
|
|
|
16275
16371
|
} else {
|
|
16276
16372
|
fullString = `${date.getDate()}. ${monthToTranslation[date.getMonth()]} ${date.getFullYear()}`;
|
|
16277
16373
|
}
|
|
16278
|
-
return /* @__PURE__ */ (0,
|
|
16374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { children: fullString });
|
|
16279
16375
|
};
|
|
16280
16376
|
|
|
16281
16377
|
// src/components/user-interaction/input/InsideLabelInput.tsx
|
|
16282
16378
|
var import_react79 = require("react");
|
|
16283
16379
|
var import_react80 = require("react");
|
|
16284
|
-
var
|
|
16285
|
-
var
|
|
16380
|
+
var import_clsx41 = __toESM(require("clsx"));
|
|
16381
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
16286
16382
|
var InsideLabelInput = (0, import_react80.forwardRef)(function InsideLabelInput2({
|
|
16287
16383
|
id: customId,
|
|
16288
16384
|
label,
|
|
@@ -16292,13 +16388,13 @@ var InsideLabelInput = (0, import_react80.forwardRef)(function InsideLabelInput2
|
|
|
16292
16388
|
const [isFocused, setIsFocused] = (0, import_react80.useState)(false);
|
|
16293
16389
|
const generatedId = (0, import_react79.useId)();
|
|
16294
16390
|
const id = customId ?? generatedId;
|
|
16295
|
-
return /* @__PURE__ */ (0,
|
|
16296
|
-
/* @__PURE__ */ (0,
|
|
16391
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: (0, import_clsx41.default)("relative"), children: [
|
|
16392
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16297
16393
|
Input,
|
|
16298
16394
|
{
|
|
16299
16395
|
...props,
|
|
16300
16396
|
id,
|
|
16301
|
-
className: (0,
|
|
16397
|
+
className: (0, import_clsx41.default)("h-14 px-4 pb-2 py-6.5", props.className),
|
|
16302
16398
|
ref: forwardedRef,
|
|
16303
16399
|
"aria-labelledby": id + "-label",
|
|
16304
16400
|
onFocus: (event) => {
|
|
@@ -16311,13 +16407,13 @@ var InsideLabelInput = (0, import_react80.forwardRef)(function InsideLabelInput2
|
|
|
16311
16407
|
}
|
|
16312
16408
|
}
|
|
16313
16409
|
),
|
|
16314
|
-
/* @__PURE__ */ (0,
|
|
16410
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16315
16411
|
"label",
|
|
16316
16412
|
{
|
|
16317
16413
|
id: id + "-label",
|
|
16318
16414
|
"aria-hidden": true,
|
|
16319
16415
|
"data-display": isFocused || !!value ? "small" : "full",
|
|
16320
|
-
className: (0,
|
|
16416
|
+
className: (0, import_clsx41.default)(
|
|
16321
16417
|
// margin left to account for the border which is ignored for absolute positions
|
|
16322
16418
|
"absolute left-4 ml-0.5 top-2 transition-all delay-25 pointer-events-none touch-none",
|
|
16323
16419
|
"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 +16429,7 @@ var InsideLabelInputUncontrolled = ({
|
|
|
16333
16429
|
...props
|
|
16334
16430
|
}) => {
|
|
16335
16431
|
const [value, setValue] = useOverwritableState(initialValue, props.onValueChange);
|
|
16336
|
-
return /* @__PURE__ */ (0,
|
|
16432
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
16337
16433
|
InsideLabelInput,
|
|
16338
16434
|
{
|
|
16339
16435
|
...props,
|
|
@@ -16345,8 +16441,8 @@ var InsideLabelInputUncontrolled = ({
|
|
|
16345
16441
|
|
|
16346
16442
|
// src/components/user-interaction/input/SearchBar.tsx
|
|
16347
16443
|
var import_lucide_react22 = require("lucide-react");
|
|
16348
|
-
var
|
|
16349
|
-
var
|
|
16444
|
+
var import_clsx42 = require("clsx");
|
|
16445
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
16350
16446
|
var SearchBar = ({
|
|
16351
16447
|
value: initialValue,
|
|
16352
16448
|
onSearch,
|
|
@@ -16357,8 +16453,8 @@ var SearchBar = ({
|
|
|
16357
16453
|
}) => {
|
|
16358
16454
|
const translation = useHightideTranslation();
|
|
16359
16455
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
16360
|
-
return /* @__PURE__ */ (0,
|
|
16361
|
-
/* @__PURE__ */ (0,
|
|
16456
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { ...containerProps, className: (0, import_clsx42.clsx)("relative", containerProps?.className), children: [
|
|
16457
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
16362
16458
|
InputUncontrolled,
|
|
16363
16459
|
{
|
|
16364
16460
|
...inputProps,
|
|
@@ -16366,10 +16462,10 @@ var SearchBar = ({
|
|
|
16366
16462
|
onValueChange: setValue,
|
|
16367
16463
|
onEditComplete: onSearch,
|
|
16368
16464
|
placeholder: inputProps.placeholder ?? translation("search"),
|
|
16369
|
-
className: (0,
|
|
16465
|
+
className: (0, import_clsx42.clsx)("pr-10 w-full", inputProps.className)
|
|
16370
16466
|
}
|
|
16371
16467
|
),
|
|
16372
|
-
/* @__PURE__ */ (0,
|
|
16468
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
16373
16469
|
Button,
|
|
16374
16470
|
{
|
|
16375
16471
|
...searchButtonProps,
|
|
@@ -16378,8 +16474,8 @@ var SearchBar = ({
|
|
|
16378
16474
|
color: "neutral",
|
|
16379
16475
|
coloringStyle: "text",
|
|
16380
16476
|
onClick: () => onSearch(value),
|
|
16381
|
-
className: (0,
|
|
16382
|
-
children: /* @__PURE__ */ (0,
|
|
16477
|
+
className: (0, import_clsx42.clsx)("absolute right-1 top-1/2 -translate-y-1/2", searchButtonProps?.className),
|
|
16478
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_lucide_react22.Search, { className: "w-full h-full" })
|
|
16383
16479
|
}
|
|
16384
16480
|
)
|
|
16385
16481
|
] });
|
|
@@ -16388,8 +16484,8 @@ var SearchBar = ({
|
|
|
16388
16484
|
// src/components/user-interaction/input/ToggleableInput.tsx
|
|
16389
16485
|
var import_react81 = require("react");
|
|
16390
16486
|
var import_lucide_react23 = require("lucide-react");
|
|
16391
|
-
var
|
|
16392
|
-
var
|
|
16487
|
+
var import_clsx43 = __toESM(require("clsx"));
|
|
16488
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
16393
16489
|
var ToggleableInput = (0, import_react81.forwardRef)(function ToggleableInput2({
|
|
16394
16490
|
value,
|
|
16395
16491
|
initialState = "display",
|
|
@@ -16404,8 +16500,8 @@ var ToggleableInput = (0, import_react81.forwardRef)(function ToggleableInput2({
|
|
|
16404
16500
|
innerRef.current?.focus();
|
|
16405
16501
|
}
|
|
16406
16502
|
}, [isEditing]);
|
|
16407
|
-
return /* @__PURE__ */ (0,
|
|
16408
|
-
/* @__PURE__ */ (0,
|
|
16503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: (0, import_clsx43.default)("relative flex-row-2", { "flex-1": isEditing }), children: [
|
|
16504
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
16409
16505
|
Input,
|
|
16410
16506
|
{
|
|
16411
16507
|
...props,
|
|
@@ -16426,14 +16522,14 @@ var ToggleableInput = (0, import_react81.forwardRef)(function ToggleableInput2({
|
|
|
16426
16522
|
},
|
|
16427
16523
|
"data-name": props["data-name"] ?? "togglable-input",
|
|
16428
16524
|
"data-isEditing": isEditing ? "" : void 0,
|
|
16429
|
-
className: (0,
|
|
16525
|
+
className: (0, import_clsx43.default)(`w-full rounded-md`, {
|
|
16430
16526
|
"text-transparent": !isEditing
|
|
16431
16527
|
})
|
|
16432
16528
|
}
|
|
16433
16529
|
),
|
|
16434
|
-
!isEditing && /* @__PURE__ */ (0,
|
|
16435
|
-
/* @__PURE__ */ (0,
|
|
16436
|
-
/* @__PURE__ */ (0,
|
|
16530
|
+
!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: [
|
|
16531
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: (0, import_clsx43.default)(" truncate"), children: value }),
|
|
16532
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_lucide_react23.Pencil, { className: (0, import_clsx43.default)(`size-force-4`, { "text-transparent": isEditing }) })
|
|
16437
16533
|
] })
|
|
16438
16534
|
] });
|
|
16439
16535
|
});
|
|
@@ -16443,7 +16539,7 @@ var ToggleableInputUncontrolled = ({
|
|
|
16443
16539
|
...restProps
|
|
16444
16540
|
}) => {
|
|
16445
16541
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
16446
|
-
return /* @__PURE__ */ (0,
|
|
16542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
16447
16543
|
ToggleableInput,
|
|
16448
16544
|
{
|
|
16449
16545
|
value,
|
|
@@ -16458,7 +16554,7 @@ var import_lucide_react25 = require("lucide-react");
|
|
|
16458
16554
|
|
|
16459
16555
|
// src/components/user-interaction/properties/PropertyBase.tsx
|
|
16460
16556
|
var import_lucide_react24 = require("lucide-react");
|
|
16461
|
-
var
|
|
16557
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
16462
16558
|
var PropertyBase = ({
|
|
16463
16559
|
name: name2,
|
|
16464
16560
|
children,
|
|
@@ -16477,29 +16573,29 @@ var PropertyBase = ({
|
|
|
16477
16573
|
const isClearEnabled = allowClear && !readOnly;
|
|
16478
16574
|
const isRemoveEnabled = allowRemove && !readOnly;
|
|
16479
16575
|
const showActionsContainer = isClearEnabled || isRemoveEnabled;
|
|
16480
|
-
return /* @__PURE__ */ (0,
|
|
16576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
16481
16577
|
"div",
|
|
16482
16578
|
{
|
|
16483
16579
|
className: className ? `group/property ${className}` : "group/property",
|
|
16484
16580
|
"data-name": "property-root",
|
|
16485
16581
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
16486
16582
|
children: [
|
|
16487
|
-
/* @__PURE__ */ (0,
|
|
16583
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
16488
16584
|
"div",
|
|
16489
16585
|
{
|
|
16490
16586
|
className,
|
|
16491
16587
|
"data-name": "property-title",
|
|
16492
16588
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
16493
16589
|
children: [
|
|
16494
|
-
/* @__PURE__ */ (0,
|
|
16495
|
-
/* @__PURE__ */ (0,
|
|
16496
|
-
/* @__PURE__ */ (0,
|
|
16590
|
+
/* @__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: [
|
|
16591
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { "data-name": "property-title-icon", children: icon }),
|
|
16592
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { "data-name": "property-title-text", children: name2 })
|
|
16497
16593
|
] }) }),
|
|
16498
|
-
invalid && /* @__PURE__ */ (0,
|
|
16594
|
+
invalid && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react24.AlertTriangle, { className: "size-force-6" })
|
|
16499
16595
|
]
|
|
16500
16596
|
}
|
|
16501
16597
|
),
|
|
16502
|
-
/* @__PURE__ */ (0,
|
|
16598
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
16503
16599
|
"div",
|
|
16504
16600
|
{
|
|
16505
16601
|
className,
|
|
@@ -16507,8 +16603,8 @@ var PropertyBase = ({
|
|
|
16507
16603
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
16508
16604
|
children: [
|
|
16509
16605
|
children({ required, hasValue, invalid }),
|
|
16510
|
-
showActionsContainer && /* @__PURE__ */ (0,
|
|
16511
|
-
isClearEnabled && /* @__PURE__ */ (0,
|
|
16606
|
+
showActionsContainer && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { "data-name": "property-actions", children: [
|
|
16607
|
+
isClearEnabled && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Tooltip, { tooltip: translation("clearValue"), children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
16512
16608
|
Button,
|
|
16513
16609
|
{
|
|
16514
16610
|
onClick: onValueClear,
|
|
@@ -16517,10 +16613,10 @@ var PropertyBase = ({
|
|
|
16517
16613
|
coloringStyle: "text",
|
|
16518
16614
|
layout: "icon",
|
|
16519
16615
|
size: "sm",
|
|
16520
|
-
children: /* @__PURE__ */ (0,
|
|
16616
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react24.X, { className: "size-force-5" })
|
|
16521
16617
|
}
|
|
16522
16618
|
) }),
|
|
16523
|
-
isRemoveEnabled && /* @__PURE__ */ (0,
|
|
16619
|
+
isRemoveEnabled && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Tooltip, { tooltip: translation("removeProperty"), children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
16524
16620
|
Button,
|
|
16525
16621
|
{
|
|
16526
16622
|
onClick: onRemove,
|
|
@@ -16528,7 +16624,7 @@ var PropertyBase = ({
|
|
|
16528
16624
|
coloringStyle: "text",
|
|
16529
16625
|
layout: "icon",
|
|
16530
16626
|
size: "sm",
|
|
16531
|
-
children: /* @__PURE__ */ (0,
|
|
16627
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_lucide_react24.Trash, { className: "size-force-5" })
|
|
16532
16628
|
}
|
|
16533
16629
|
) })
|
|
16534
16630
|
] })
|
|
@@ -16541,7 +16637,7 @@ var PropertyBase = ({
|
|
|
16541
16637
|
};
|
|
16542
16638
|
|
|
16543
16639
|
// src/components/user-interaction/properties/CheckboxProperty.tsx
|
|
16544
|
-
var
|
|
16640
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
16545
16641
|
var CheckboxProperty = ({
|
|
16546
16642
|
value,
|
|
16547
16643
|
onValueChange,
|
|
@@ -16550,15 +16646,15 @@ var CheckboxProperty = ({
|
|
|
16550
16646
|
...baseProps
|
|
16551
16647
|
}) => {
|
|
16552
16648
|
const translation = useHightideTranslation();
|
|
16553
|
-
return /* @__PURE__ */ (0,
|
|
16649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
16554
16650
|
PropertyBase,
|
|
16555
16651
|
{
|
|
16556
16652
|
...baseProps,
|
|
16557
16653
|
hasValue: value !== void 0,
|
|
16558
16654
|
readOnly,
|
|
16559
|
-
icon: /* @__PURE__ */ (0,
|
|
16560
|
-
children: () => /* @__PURE__ */ (0,
|
|
16561
|
-
/* @__PURE__ */ (0,
|
|
16655
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_lucide_react25.Check, { size: 24 }),
|
|
16656
|
+
children: () => /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
16657
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
16562
16658
|
Button,
|
|
16563
16659
|
{
|
|
16564
16660
|
color: value ? "positive" : "neutral",
|
|
@@ -16571,7 +16667,7 @@ var CheckboxProperty = ({
|
|
|
16571
16667
|
children: translation("yes")
|
|
16572
16668
|
}
|
|
16573
16669
|
),
|
|
16574
|
-
/* @__PURE__ */ (0,
|
|
16670
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
16575
16671
|
Button,
|
|
16576
16672
|
{
|
|
16577
16673
|
color: !value && value !== void 0 ? "negative" : "neutral",
|
|
@@ -16591,7 +16687,7 @@ var CheckboxProperty = ({
|
|
|
16591
16687
|
|
|
16592
16688
|
// src/components/user-interaction/properties/DateProperty.tsx
|
|
16593
16689
|
var import_lucide_react26 = require("lucide-react");
|
|
16594
|
-
var
|
|
16690
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
16595
16691
|
var DateProperty = ({
|
|
16596
16692
|
value,
|
|
16597
16693
|
onValueChange,
|
|
@@ -16601,13 +16697,13 @@ var DateProperty = ({
|
|
|
16601
16697
|
...baseProps
|
|
16602
16698
|
}) => {
|
|
16603
16699
|
const hasValue = !!value;
|
|
16604
|
-
return /* @__PURE__ */ (0,
|
|
16700
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16605
16701
|
PropertyBase,
|
|
16606
16702
|
{
|
|
16607
16703
|
...baseProps,
|
|
16608
16704
|
hasValue,
|
|
16609
|
-
icon: /* @__PURE__ */ (0,
|
|
16610
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
16705
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_lucide_react26.CalendarDays, { size: 24 }),
|
|
16706
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
16611
16707
|
DateTimeInput,
|
|
16612
16708
|
{
|
|
16613
16709
|
value,
|
|
@@ -16629,7 +16725,7 @@ var import_lucide_react28 = require("lucide-react");
|
|
|
16629
16725
|
// src/components/user-interaction/select/MultiSelectChipDisplay.tsx
|
|
16630
16726
|
var import_react82 = require("react");
|
|
16631
16727
|
var import_lucide_react27 = require("lucide-react");
|
|
16632
|
-
var
|
|
16728
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
16633
16729
|
var MultiSelectChipDisplayButton = (0, import_react82.forwardRef)(function MultiSelectChipDisplayButton2({
|
|
16634
16730
|
id,
|
|
16635
16731
|
...props
|
|
@@ -16652,7 +16748,7 @@ var MultiSelectChipDisplayButton = (0, import_react82.forwardRef)(function Multi
|
|
|
16652
16748
|
}, [register, unregister]);
|
|
16653
16749
|
const disabled = !!props?.disabled || !!state.disabled;
|
|
16654
16750
|
const invalid = state.invalid;
|
|
16655
|
-
return /* @__PURE__ */ (0,
|
|
16751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
|
|
16656
16752
|
"div",
|
|
16657
16753
|
{
|
|
16658
16754
|
...props,
|
|
@@ -16668,9 +16764,9 @@ var MultiSelectChipDisplayButton = (0, import_react82.forwardRef)(function Multi
|
|
|
16668
16764
|
"aria-invalid": invalid,
|
|
16669
16765
|
"aria-disabled": disabled,
|
|
16670
16766
|
children: [
|
|
16671
|
-
state.selectedOptions.map(({ value, label }) => /* @__PURE__ */ (0,
|
|
16767
|
+
state.selectedOptions.map(({ value, label }) => /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(Chip, { className: "gap-x-2", children: [
|
|
16672
16768
|
label,
|
|
16673
|
-
/* @__PURE__ */ (0,
|
|
16769
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
16674
16770
|
Button,
|
|
16675
16771
|
{
|
|
16676
16772
|
onClick: () => {
|
|
@@ -16681,11 +16777,11 @@ var MultiSelectChipDisplayButton = (0, import_react82.forwardRef)(function Multi
|
|
|
16681
16777
|
coloringStyle: "text",
|
|
16682
16778
|
layout: "icon",
|
|
16683
16779
|
className: "flex-row-0 items-center",
|
|
16684
|
-
children: /* @__PURE__ */ (0,
|
|
16780
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react27.XIcon, { className: "size-5" })
|
|
16685
16781
|
}
|
|
16686
16782
|
)
|
|
16687
16783
|
] }, value)),
|
|
16688
|
-
/* @__PURE__ */ (0,
|
|
16784
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
16689
16785
|
Button,
|
|
16690
16786
|
{
|
|
16691
16787
|
id: ids.trigger,
|
|
@@ -16711,7 +16807,7 @@ var MultiSelectChipDisplayButton = (0, import_react82.forwardRef)(function Multi
|
|
|
16711
16807
|
"aria-expanded": state.isOpen,
|
|
16712
16808
|
"aria-controls": state.isOpen ? ids.content : void 0,
|
|
16713
16809
|
className: "size-9",
|
|
16714
|
-
children: /* @__PURE__ */ (0,
|
|
16810
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_lucide_react27.Plus, {})
|
|
16715
16811
|
}
|
|
16716
16812
|
)
|
|
16717
16813
|
]
|
|
@@ -16724,9 +16820,9 @@ var MultiSelectChipDisplay = (0, import_react82.forwardRef)(function MultiSelect
|
|
|
16724
16820
|
chipDisplayProps,
|
|
16725
16821
|
...props
|
|
16726
16822
|
}, ref) {
|
|
16727
|
-
return /* @__PURE__ */ (0,
|
|
16728
|
-
/* @__PURE__ */ (0,
|
|
16729
|
-
/* @__PURE__ */ (0,
|
|
16823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(MultiSelectRoot, { ...props, children: [
|
|
16824
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(MultiSelectChipDisplayButton, { ref, ...chipDisplayProps }),
|
|
16825
|
+
/* @__PURE__ */ (0, import_jsx_runtime87.jsx)(MultiSelectContent, { ...contentPanelProps, children })
|
|
16730
16826
|
] });
|
|
16731
16827
|
});
|
|
16732
16828
|
var MultiSelectChipDisplayUncontrolled = (0, import_react82.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
|
|
@@ -16735,7 +16831,7 @@ var MultiSelectChipDisplayUncontrolled = (0, import_react82.forwardRef)(function
|
|
|
16735
16831
|
...props
|
|
16736
16832
|
}, ref) {
|
|
16737
16833
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
16738
|
-
return /* @__PURE__ */ (0,
|
|
16834
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
16739
16835
|
MultiSelectChipDisplay,
|
|
16740
16836
|
{
|
|
16741
16837
|
...props,
|
|
@@ -16747,7 +16843,7 @@ var MultiSelectChipDisplayUncontrolled = (0, import_react82.forwardRef)(function
|
|
|
16747
16843
|
});
|
|
16748
16844
|
|
|
16749
16845
|
// src/components/user-interaction/properties/MultiSelectProperty.tsx
|
|
16750
|
-
var
|
|
16846
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
16751
16847
|
var MultiSelectProperty = ({
|
|
16752
16848
|
children,
|
|
16753
16849
|
value,
|
|
@@ -16756,18 +16852,18 @@ var MultiSelectProperty = ({
|
|
|
16756
16852
|
...props
|
|
16757
16853
|
}) => {
|
|
16758
16854
|
const hasValue = value.length > 0;
|
|
16759
|
-
return /* @__PURE__ */ (0,
|
|
16855
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
16760
16856
|
PropertyBase,
|
|
16761
16857
|
{
|
|
16762
16858
|
...props,
|
|
16763
16859
|
hasValue,
|
|
16764
|
-
icon: /* @__PURE__ */ (0,
|
|
16765
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
16860
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_lucide_react28.List, { size: 24 }),
|
|
16861
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
16766
16862
|
"div",
|
|
16767
16863
|
{
|
|
16768
16864
|
"data-name": "property-input-wrapper",
|
|
16769
16865
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
16770
|
-
children: /* @__PURE__ */ (0,
|
|
16866
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
|
|
16771
16867
|
MultiSelectChipDisplay,
|
|
16772
16868
|
{
|
|
16773
16869
|
value,
|
|
@@ -16793,7 +16889,7 @@ var MultiSelectProperty = ({
|
|
|
16793
16889
|
|
|
16794
16890
|
// src/components/user-interaction/properties/NumberProperty.tsx
|
|
16795
16891
|
var import_lucide_react29 = require("lucide-react");
|
|
16796
|
-
var
|
|
16892
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
16797
16893
|
var NumberProperty = ({
|
|
16798
16894
|
value,
|
|
16799
16895
|
onRemove,
|
|
@@ -16805,20 +16901,20 @@ var NumberProperty = ({
|
|
|
16805
16901
|
}) => {
|
|
16806
16902
|
const translation = useHightideTranslation();
|
|
16807
16903
|
const hasValue = value !== void 0;
|
|
16808
|
-
return /* @__PURE__ */ (0,
|
|
16904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16809
16905
|
PropertyBase,
|
|
16810
16906
|
{
|
|
16811
16907
|
...baseProps,
|
|
16812
16908
|
onRemove,
|
|
16813
16909
|
hasValue,
|
|
16814
|
-
icon: /* @__PURE__ */ (0,
|
|
16815
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
16910
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_lucide_react29.Binary, { size: 24 }),
|
|
16911
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
|
|
16816
16912
|
"div",
|
|
16817
16913
|
{
|
|
16818
16914
|
"data-name": "property-input-wrapper",
|
|
16819
16915
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
16820
16916
|
children: [
|
|
16821
|
-
/* @__PURE__ */ (0,
|
|
16917
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16822
16918
|
Input,
|
|
16823
16919
|
{
|
|
16824
16920
|
className: "w-full pr-8",
|
|
@@ -16846,7 +16942,7 @@ var NumberProperty = ({
|
|
|
16846
16942
|
}
|
|
16847
16943
|
}
|
|
16848
16944
|
),
|
|
16849
|
-
suffix && /* @__PURE__ */ (0,
|
|
16945
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
|
|
16850
16946
|
"span",
|
|
16851
16947
|
{
|
|
16852
16948
|
"data-name": "property-suffix",
|
|
@@ -16863,7 +16959,7 @@ var NumberProperty = ({
|
|
|
16863
16959
|
|
|
16864
16960
|
// src/components/user-interaction/properties/SelectProperty.tsx
|
|
16865
16961
|
var import_lucide_react30 = require("lucide-react");
|
|
16866
|
-
var
|
|
16962
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
16867
16963
|
var SingleSelectProperty = ({
|
|
16868
16964
|
children,
|
|
16869
16965
|
value,
|
|
@@ -16872,18 +16968,18 @@ var SingleSelectProperty = ({
|
|
|
16872
16968
|
...props
|
|
16873
16969
|
}) => {
|
|
16874
16970
|
const hasValue = value !== void 0;
|
|
16875
|
-
return /* @__PURE__ */ (0,
|
|
16971
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16876
16972
|
PropertyBase,
|
|
16877
16973
|
{
|
|
16878
16974
|
...props,
|
|
16879
16975
|
hasValue,
|
|
16880
|
-
icon: /* @__PURE__ */ (0,
|
|
16881
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
16976
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_lucide_react30.List, { size: 24 }),
|
|
16977
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16882
16978
|
"div",
|
|
16883
16979
|
{
|
|
16884
16980
|
"data-name": "property-input-wrapper",
|
|
16885
16981
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
16886
|
-
children: /* @__PURE__ */ (0,
|
|
16982
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
16887
16983
|
Select,
|
|
16888
16984
|
{
|
|
16889
16985
|
value,
|
|
@@ -16906,7 +17002,7 @@ var SingleSelectProperty = ({
|
|
|
16906
17002
|
|
|
16907
17003
|
// src/components/user-interaction/properties/TextProperty.tsx
|
|
16908
17004
|
var import_lucide_react31 = require("lucide-react");
|
|
16909
|
-
var
|
|
17005
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
16910
17006
|
var TextProperty = ({
|
|
16911
17007
|
value,
|
|
16912
17008
|
readOnly,
|
|
@@ -16917,14 +17013,14 @@ var TextProperty = ({
|
|
|
16917
17013
|
}) => {
|
|
16918
17014
|
const translation = useHightideTranslation();
|
|
16919
17015
|
const hasValue = value !== void 0;
|
|
16920
|
-
return /* @__PURE__ */ (0,
|
|
17016
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16921
17017
|
PropertyBase,
|
|
16922
17018
|
{
|
|
16923
17019
|
...baseProps,
|
|
16924
17020
|
onRemove,
|
|
16925
17021
|
hasValue,
|
|
16926
|
-
icon: /* @__PURE__ */ (0,
|
|
16927
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
17022
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_lucide_react31.Text, { size: 24 }),
|
|
17023
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
|
|
16928
17024
|
Textarea,
|
|
16929
17025
|
{
|
|
16930
17026
|
className: "w-full",
|
|
@@ -16989,14 +17085,14 @@ function Transition({
|
|
|
16989
17085
|
}
|
|
16990
17086
|
|
|
16991
17087
|
// src/global-contexts/HightideProvider.tsx
|
|
16992
|
-
var
|
|
17088
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
16993
17089
|
var HightideProvider = ({
|
|
16994
17090
|
children,
|
|
16995
17091
|
theme,
|
|
16996
17092
|
locale,
|
|
16997
17093
|
config
|
|
16998
17094
|
}) => {
|
|
16999
|
-
return /* @__PURE__ */ (0,
|
|
17095
|
+
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
17096
|
};
|
|
17001
17097
|
|
|
17002
17098
|
// src/hooks/focus/useFocusGuards.ts
|
|
@@ -17119,7 +17215,7 @@ function useLogUnstableDependencies(name2, value) {
|
|
|
17119
17215
|
}
|
|
17120
17216
|
}
|
|
17121
17217
|
if (Object.keys(changes).length > 0) {
|
|
17122
|
-
console.
|
|
17218
|
+
console.info(`[${name2}] changed`, changes);
|
|
17123
17219
|
}
|
|
17124
17220
|
prev.current = value;
|
|
17125
17221
|
});
|
|
@@ -17665,13 +17761,15 @@ var PromiseUtils = {
|
|
|
17665
17761
|
TabPanel,
|
|
17666
17762
|
TabSwitcher,
|
|
17667
17763
|
TabView,
|
|
17764
|
+
Table,
|
|
17668
17765
|
TableBody,
|
|
17669
|
-
TableBodyContext,
|
|
17670
17766
|
TableCell,
|
|
17671
17767
|
TableColumn,
|
|
17672
17768
|
TableColumnDefinitionContext,
|
|
17673
|
-
|
|
17769
|
+
TableColumnSwitcher,
|
|
17770
|
+
TableColumnSwitcherPopUp,
|
|
17674
17771
|
TableContainerContext,
|
|
17772
|
+
TableDataContext,
|
|
17675
17773
|
TableDisplay,
|
|
17676
17774
|
TableFilter,
|
|
17677
17775
|
TableFilterButton,
|
|
@@ -17679,10 +17777,12 @@ var PromiseUtils = {
|
|
|
17679
17777
|
TableFilterOperator,
|
|
17680
17778
|
TableHeader,
|
|
17681
17779
|
TableHeaderContext,
|
|
17682
|
-
|
|
17780
|
+
TablePageSizeSelect,
|
|
17683
17781
|
TablePagination,
|
|
17782
|
+
TablePaginationMenu,
|
|
17684
17783
|
TableProvider,
|
|
17685
17784
|
TableSortButton,
|
|
17785
|
+
TableWithSelection,
|
|
17686
17786
|
TableWithSelectionProvider,
|
|
17687
17787
|
TagIcon,
|
|
17688
17788
|
TagsFilter,
|
|
@@ -17763,9 +17863,9 @@ var PromiseUtils = {
|
|
|
17763
17863
|
useSearch,
|
|
17764
17864
|
useSelectContext,
|
|
17765
17865
|
useTabContext,
|
|
17766
|
-
useTableBodyContext,
|
|
17767
17866
|
useTableColumnDefinitionContext,
|
|
17768
17867
|
useTableContainerContext,
|
|
17868
|
+
useTableDataContext,
|
|
17769
17869
|
useTableHeaderContext,
|
|
17770
17870
|
useTheme,
|
|
17771
17871
|
useTransitionState,
|