@helpwave/hightide 0.8.11 → 0.8.12
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 +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +146 -141
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +73 -68
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14638,10 +14638,10 @@ var TableSortButton = ({
|
|
|
14638
14638
|
|
|
14639
14639
|
// src/components/layout/table/TableFilterButton.tsx
|
|
14640
14640
|
var import_lucide_react19 = require("lucide-react");
|
|
14641
|
-
var
|
|
14641
|
+
var import_react83 = require("react");
|
|
14642
14642
|
|
|
14643
14643
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
14644
|
-
var
|
|
14644
|
+
var import_react79 = require("react");
|
|
14645
14645
|
var import_lucide_react16 = require("lucide-react");
|
|
14646
14646
|
var import_clsx24 = __toESM(require("clsx"));
|
|
14647
14647
|
|
|
@@ -15452,6 +15452,7 @@ var DateTimePicker = ({
|
|
|
15452
15452
|
};
|
|
15453
15453
|
|
|
15454
15454
|
// src/components/user-interaction/date/DateTimePickerDialog.tsx
|
|
15455
|
+
var import_react68 = require("react");
|
|
15455
15456
|
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
15456
15457
|
var DateTimePickerDialog = ({
|
|
15457
15458
|
initialValue = null,
|
|
@@ -15479,6 +15480,10 @@ var DateTimePickerDialog = ({
|
|
|
15479
15480
|
onValueChange,
|
|
15480
15481
|
defaultValue: initialValue
|
|
15481
15482
|
});
|
|
15483
|
+
const [pickerState, setPickerState] = (0, import_react68.useState)(state ?? /* @__PURE__ */ new Date());
|
|
15484
|
+
(0, import_react68.useEffect)(() => {
|
|
15485
|
+
setPickerState(state ?? /* @__PURE__ */ new Date());
|
|
15486
|
+
}, [state]);
|
|
15482
15487
|
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
15483
15488
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "flex-row-2 justify-center w-full py-1", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
15484
15489
|
"span",
|
|
@@ -15493,9 +15498,9 @@ var DateTimePickerDialog = ({
|
|
|
15493
15498
|
{
|
|
15494
15499
|
...pickerProps,
|
|
15495
15500
|
mode,
|
|
15496
|
-
value:
|
|
15497
|
-
onValueChange:
|
|
15498
|
-
onEditComplete:
|
|
15501
|
+
value: pickerState,
|
|
15502
|
+
onValueChange: setPickerState,
|
|
15503
|
+
onEditComplete: setPickerState,
|
|
15499
15504
|
start,
|
|
15500
15505
|
end,
|
|
15501
15506
|
weekStart,
|
|
@@ -15508,7 +15513,7 @@ var DateTimePickerDialog = ({
|
|
|
15508
15513
|
}
|
|
15509
15514
|
),
|
|
15510
15515
|
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
15511
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Visibility, { isVisible: allowRemove && !!
|
|
15516
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Visibility, { isVisible: allowRemove && !!state, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
15512
15517
|
Button,
|
|
15513
15518
|
{
|
|
15514
15519
|
size: "md",
|
|
@@ -15521,14 +15526,14 @@ var DateTimePickerDialog = ({
|
|
|
15521
15526
|
children: translation("clear")
|
|
15522
15527
|
}
|
|
15523
15528
|
) }),
|
|
15524
|
-
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Visibility, { isVisible: !
|
|
15529
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Visibility, { isVisible: !state, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
15525
15530
|
Button,
|
|
15526
15531
|
{
|
|
15527
15532
|
size: "md",
|
|
15528
15533
|
color: "neutral",
|
|
15529
15534
|
onClick: () => {
|
|
15530
|
-
setState(
|
|
15531
|
-
onEditComplete?.(
|
|
15535
|
+
setState(state);
|
|
15536
|
+
onEditComplete?.(state);
|
|
15532
15537
|
},
|
|
15533
15538
|
className: "min-w-26",
|
|
15534
15539
|
children: translation("cancel")
|
|
@@ -15539,7 +15544,7 @@ var DateTimePickerDialog = ({
|
|
|
15539
15544
|
{
|
|
15540
15545
|
size: "md",
|
|
15541
15546
|
onClick: () => {
|
|
15542
|
-
onEditComplete?.(
|
|
15547
|
+
onEditComplete?.(pickerState);
|
|
15543
15548
|
},
|
|
15544
15549
|
className: "min-w-26",
|
|
15545
15550
|
children: translation("done")
|
|
@@ -15550,7 +15555,7 @@ var DateTimePickerDialog = ({
|
|
|
15550
15555
|
};
|
|
15551
15556
|
|
|
15552
15557
|
// src/hooks/focus/useFocusGuards.ts
|
|
15553
|
-
var
|
|
15558
|
+
var import_react69 = require("react");
|
|
15554
15559
|
var selectorName = "data-hw-focus-guard";
|
|
15555
15560
|
function FocusGuard() {
|
|
15556
15561
|
const element = document.createElement("div");
|
|
@@ -15588,7 +15593,7 @@ var FocusGuardsService = class _FocusGuardsService {
|
|
|
15588
15593
|
}
|
|
15589
15594
|
};
|
|
15590
15595
|
var useFocusGuards = () => {
|
|
15591
|
-
(0,
|
|
15596
|
+
(0, import_react69.useEffect)(() => {
|
|
15592
15597
|
FocusGuardsService.getInstance().add();
|
|
15593
15598
|
return () => {
|
|
15594
15599
|
FocusGuardsService.getInstance().remove();
|
|
@@ -15597,10 +15602,10 @@ var useFocusGuards = () => {
|
|
|
15597
15602
|
};
|
|
15598
15603
|
|
|
15599
15604
|
// src/hooks/focus/useFocusOnceVisible.ts
|
|
15600
|
-
var
|
|
15605
|
+
var import_react70 = __toESM(require("react"));
|
|
15601
15606
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
15602
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
15603
|
-
(0,
|
|
15607
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react70.default.useState(false);
|
|
15608
|
+
(0, import_react70.useEffect)(() => {
|
|
15604
15609
|
if (disable || hasUsedFocus) {
|
|
15605
15610
|
return;
|
|
15606
15611
|
}
|
|
@@ -15620,11 +15625,11 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
15620
15625
|
};
|
|
15621
15626
|
|
|
15622
15627
|
// src/hooks/focus/useIsMounted.ts
|
|
15623
|
-
var
|
|
15628
|
+
var import_react71 = require("react");
|
|
15624
15629
|
var isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
15625
|
-
var useIsomorphicEffect = isClient ?
|
|
15630
|
+
var useIsomorphicEffect = isClient ? import_react71.useLayoutEffect : import_react71.useEffect;
|
|
15626
15631
|
var useIsMounted = () => {
|
|
15627
|
-
const [isMounted, setIsMounted] = (0,
|
|
15632
|
+
const [isMounted, setIsMounted] = (0, import_react71.useState)(false);
|
|
15628
15633
|
useIsomorphicEffect(() => {
|
|
15629
15634
|
setIsMounted(true);
|
|
15630
15635
|
return () => {
|
|
@@ -15635,10 +15640,10 @@ var useIsMounted = () => {
|
|
|
15635
15640
|
};
|
|
15636
15641
|
|
|
15637
15642
|
// src/hooks/useHandleRefs.ts
|
|
15638
|
-
var
|
|
15643
|
+
var import_react72 = require("react");
|
|
15639
15644
|
function useHandleRefs(handleRef) {
|
|
15640
|
-
const refs = (0,
|
|
15641
|
-
(0,
|
|
15645
|
+
const refs = (0, import_react72.useRef)([]);
|
|
15646
|
+
(0, import_react72.useEffect)(() => {
|
|
15642
15647
|
refs.current = Object.keys(handleRef?.current ?? {}).map(
|
|
15643
15648
|
() => ({ current: null })
|
|
15644
15649
|
);
|
|
@@ -15651,10 +15656,10 @@ function useHandleRefs(handleRef) {
|
|
|
15651
15656
|
}
|
|
15652
15657
|
|
|
15653
15658
|
// src/hooks/useLogUnstableDependencies.ts
|
|
15654
|
-
var
|
|
15659
|
+
var import_react73 = __toESM(require("react"));
|
|
15655
15660
|
function useLogUnstableDependencies(name, value) {
|
|
15656
|
-
const prev =
|
|
15657
|
-
|
|
15661
|
+
const prev = import_react73.default.useRef(null);
|
|
15662
|
+
import_react73.default.useEffect(() => {
|
|
15658
15663
|
if (!prev.current) {
|
|
15659
15664
|
prev.current = value;
|
|
15660
15665
|
return;
|
|
@@ -15676,10 +15681,10 @@ function useLogUnstableDependencies(name, value) {
|
|
|
15676
15681
|
}
|
|
15677
15682
|
|
|
15678
15683
|
// src/hooks/useOverwritableState.ts
|
|
15679
|
-
var
|
|
15684
|
+
var import_react74 = require("react");
|
|
15680
15685
|
var useOverwritableState = (overwriteValue, onChange) => {
|
|
15681
|
-
const [state, setState] = (0,
|
|
15682
|
-
(0,
|
|
15686
|
+
const [state, setState] = (0, import_react74.useState)(overwriteValue);
|
|
15687
|
+
(0, import_react74.useEffect)(() => {
|
|
15683
15688
|
setState(overwriteValue);
|
|
15684
15689
|
}, [overwriteValue]);
|
|
15685
15690
|
const onChangeWrapper = (action) => {
|
|
@@ -15691,13 +15696,13 @@ var useOverwritableState = (overwriteValue, onChange) => {
|
|
|
15691
15696
|
};
|
|
15692
15697
|
|
|
15693
15698
|
// src/hooks/useRerender.ts
|
|
15694
|
-
var
|
|
15699
|
+
var import_react75 = require("react");
|
|
15695
15700
|
var useRerender = () => {
|
|
15696
|
-
return (0,
|
|
15701
|
+
return (0, import_react75.useReducer)(() => ({}), {})[1];
|
|
15697
15702
|
};
|
|
15698
15703
|
|
|
15699
15704
|
// src/hooks/useSearch.ts
|
|
15700
|
-
var
|
|
15705
|
+
var import_react76 = require("react");
|
|
15701
15706
|
|
|
15702
15707
|
// src/utils/simpleSearch.ts
|
|
15703
15708
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -15736,34 +15741,34 @@ var useSearch = ({
|
|
|
15736
15741
|
filter,
|
|
15737
15742
|
disabled = false
|
|
15738
15743
|
}) => {
|
|
15739
|
-
const [search, setSearch] = (0,
|
|
15740
|
-
const [result, setResult] = (0,
|
|
15741
|
-
const searchTags = (0,
|
|
15742
|
-
const updateSearch = (0,
|
|
15744
|
+
const [search, setSearch] = (0, import_react76.useState)(initialSearch ?? "");
|
|
15745
|
+
const [result, setResult] = (0, import_react76.useState)(list);
|
|
15746
|
+
const searchTags = (0, import_react76.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
15747
|
+
const updateSearch = (0, import_react76.useCallback)((newSearch) => {
|
|
15743
15748
|
const usedSearch = newSearch ?? search;
|
|
15744
15749
|
if (newSearch) {
|
|
15745
15750
|
setSearch(search);
|
|
15746
15751
|
}
|
|
15747
15752
|
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
15748
15753
|
}, [searchTags, list, search, searchMapping]);
|
|
15749
|
-
(0,
|
|
15754
|
+
(0, import_react76.useEffect)(() => {
|
|
15750
15755
|
if (isSearchInstant) {
|
|
15751
15756
|
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
15752
15757
|
}
|
|
15753
15758
|
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
15754
|
-
const filteredResult = (0,
|
|
15759
|
+
const filteredResult = (0, import_react76.useMemo)(() => {
|
|
15755
15760
|
if (!filter) {
|
|
15756
15761
|
return result;
|
|
15757
15762
|
}
|
|
15758
15763
|
return result.filter(filter);
|
|
15759
15764
|
}, [result, filter]);
|
|
15760
|
-
const sortedAndFilteredResult = (0,
|
|
15765
|
+
const sortedAndFilteredResult = (0, import_react76.useMemo)(() => {
|
|
15761
15766
|
if (!sortingFunction) {
|
|
15762
15767
|
return filteredResult;
|
|
15763
15768
|
}
|
|
15764
15769
|
return filteredResult.sort(sortingFunction);
|
|
15765
15770
|
}, [filteredResult, sortingFunction]);
|
|
15766
|
-
const usedResult = (0,
|
|
15771
|
+
const usedResult = (0, import_react76.useMemo)(() => {
|
|
15767
15772
|
if (!disabled) {
|
|
15768
15773
|
return sortedAndFilteredResult;
|
|
15769
15774
|
}
|
|
@@ -15780,23 +15785,23 @@ var useSearch = ({
|
|
|
15780
15785
|
};
|
|
15781
15786
|
|
|
15782
15787
|
// src/hooks/useUpdatingDateString.ts
|
|
15783
|
-
var
|
|
15788
|
+
var import_react77 = require("react");
|
|
15784
15789
|
var useUpdatingDateString = ({ absoluteFormat = "dateTime", localeOverride, date }) => {
|
|
15785
15790
|
const { locale: contextLocale } = useLocale();
|
|
15786
15791
|
const locale = localeOverride ?? contextLocale;
|
|
15787
|
-
const [dateAndTimeStrings, setDateAndTimeStrings] = (0,
|
|
15792
|
+
const [dateAndTimeStrings, setDateAndTimeStrings] = (0, import_react77.useState)({
|
|
15788
15793
|
compareDate: date,
|
|
15789
15794
|
absolute: DateUtils.formatAbsolute(date, locale, absoluteFormat),
|
|
15790
15795
|
relative: DateUtils.formatRelative(date, locale)
|
|
15791
15796
|
});
|
|
15792
|
-
(0,
|
|
15797
|
+
(0, import_react77.useEffect)(() => {
|
|
15793
15798
|
setDateAndTimeStrings({
|
|
15794
15799
|
compareDate: date,
|
|
15795
15800
|
absolute: DateUtils.formatAbsolute(date, locale, absoluteFormat),
|
|
15796
15801
|
relative: DateUtils.formatRelative(date, locale)
|
|
15797
15802
|
});
|
|
15798
15803
|
}, [date, absoluteFormat, locale]);
|
|
15799
|
-
(0,
|
|
15804
|
+
(0, import_react77.useEffect)(() => {
|
|
15800
15805
|
let timeoutId;
|
|
15801
15806
|
const startTimer = () => {
|
|
15802
15807
|
const now = /* @__PURE__ */ new Date();
|
|
@@ -15832,7 +15837,7 @@ var validateEmail = (email) => {
|
|
|
15832
15837
|
};
|
|
15833
15838
|
|
|
15834
15839
|
// src/hooks/useValidators.ts
|
|
15835
|
-
var
|
|
15840
|
+
var import_react78 = require("react");
|
|
15836
15841
|
var notEmpty = (value) => {
|
|
15837
15842
|
if (!value) {
|
|
15838
15843
|
return "notEmpty";
|
|
@@ -15882,7 +15887,7 @@ var UseValidators = {
|
|
|
15882
15887
|
};
|
|
15883
15888
|
var useTranslatedValidators = () => {
|
|
15884
15889
|
const translation = useHightideTranslation();
|
|
15885
|
-
return (0,
|
|
15890
|
+
return (0, import_react78.useMemo)(() => ({
|
|
15886
15891
|
notEmpty: (value) => {
|
|
15887
15892
|
const result = notEmpty(value);
|
|
15888
15893
|
if (result) {
|
|
@@ -15917,7 +15922,7 @@ var useTranslatedValidators = () => {
|
|
|
15917
15922
|
|
|
15918
15923
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
15919
15924
|
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
15920
|
-
var DateTimeInput = (0,
|
|
15925
|
+
var DateTimeInput = (0, import_react79.forwardRef)(function DateTimeInput2({
|
|
15921
15926
|
id: inputId,
|
|
15922
15927
|
value,
|
|
15923
15928
|
initialValue = null,
|
|
@@ -15945,37 +15950,37 @@ var DateTimeInput = (0, import_react78.forwardRef)(function DateTimeInput2({
|
|
|
15945
15950
|
...props
|
|
15946
15951
|
}, forwardedRef) {
|
|
15947
15952
|
const translation = useHightideTranslation();
|
|
15948
|
-
const [isOpen, setIsOpen] = (0,
|
|
15953
|
+
const [isOpen, setIsOpen] = (0, import_react79.useState)(false);
|
|
15949
15954
|
const [state, setState] = useControlledState({
|
|
15950
15955
|
value,
|
|
15951
15956
|
onValueChange,
|
|
15952
15957
|
defaultValue: initialValue
|
|
15953
15958
|
});
|
|
15954
|
-
const [dialogValue, setDialogValue] = (0,
|
|
15955
|
-
const [stringInputState, setStringInputState] = (0,
|
|
15959
|
+
const [dialogValue, setDialogValue] = (0, import_react79.useState)(state);
|
|
15960
|
+
const [stringInputState, setStringInputState] = (0, import_react79.useState)({
|
|
15956
15961
|
state: state ? DateUtils.toInputString(state, mode, precision) : "",
|
|
15957
15962
|
date: void 0
|
|
15958
15963
|
});
|
|
15959
|
-
(0,
|
|
15960
|
-
setDialogValue(state
|
|
15964
|
+
(0, import_react79.useEffect)(() => {
|
|
15965
|
+
setDialogValue(state);
|
|
15961
15966
|
setStringInputState({
|
|
15962
15967
|
state: state ? DateUtils.toInputString(state, mode) : "",
|
|
15963
15968
|
date: void 0
|
|
15964
15969
|
});
|
|
15965
15970
|
}, [mode, state]);
|
|
15966
|
-
const changeOpenWrapper = (0,
|
|
15971
|
+
const changeOpenWrapper = (0, import_react79.useCallback)((isOpen2) => {
|
|
15967
15972
|
onDialogOpeningChange?.(isOpen2);
|
|
15968
15973
|
setIsOpen(isOpen2);
|
|
15969
15974
|
}, [onDialogOpeningChange]);
|
|
15970
|
-
const generatedId = (0,
|
|
15971
|
-
const ids = (0,
|
|
15975
|
+
const generatedId = (0, import_react79.useId)();
|
|
15976
|
+
const ids = (0, import_react79.useMemo)(() => ({
|
|
15972
15977
|
input: inputId ?? `date-time-input-${generatedId}`,
|
|
15973
15978
|
popup: `date-time-input-popup-${generatedId}`,
|
|
15974
15979
|
label: `date-time-input-label-${generatedId}`
|
|
15975
15980
|
}), [generatedId, inputId]);
|
|
15976
|
-
const innerRef = (0,
|
|
15977
|
-
(0,
|
|
15978
|
-
(0,
|
|
15981
|
+
const innerRef = (0, import_react79.useRef)(null);
|
|
15982
|
+
(0, import_react79.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
15983
|
+
(0, import_react79.useEffect)(() => {
|
|
15979
15984
|
if (readOnly || disabled) {
|
|
15980
15985
|
changeOpenWrapper(false);
|
|
15981
15986
|
}
|
|
@@ -16101,12 +16106,12 @@ var DateTimeInput = (0, import_react78.forwardRef)(function DateTimeInput2({
|
|
|
16101
16106
|
});
|
|
16102
16107
|
|
|
16103
16108
|
// src/components/layout/table/TableFilterPopups.tsx
|
|
16104
|
-
var
|
|
16109
|
+
var import_react82 = require("react");
|
|
16105
16110
|
|
|
16106
16111
|
// src/components/user-interaction/select/MultiSelect.tsx
|
|
16107
|
-
var
|
|
16112
|
+
var import_react80 = require("react");
|
|
16108
16113
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
16109
|
-
var MultiSelect = (0,
|
|
16114
|
+
var MultiSelect = (0, import_react80.forwardRef)(function MultiSelect2({
|
|
16110
16115
|
children,
|
|
16111
16116
|
contentPanelProps,
|
|
16112
16117
|
buttonProps,
|
|
@@ -16123,7 +16128,7 @@ var import_lucide_react18 = require("lucide-react");
|
|
|
16123
16128
|
|
|
16124
16129
|
// src/components/user-interaction/Checkbox.tsx
|
|
16125
16130
|
var import_lucide_react17 = require("lucide-react");
|
|
16126
|
-
var
|
|
16131
|
+
var import_react81 = require("react");
|
|
16127
16132
|
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
16128
16133
|
var Checkbox = ({
|
|
16129
16134
|
value: controlledValue,
|
|
@@ -16141,7 +16146,7 @@ var Checkbox = ({
|
|
|
16141
16146
|
}) => {
|
|
16142
16147
|
const onEditCompleteStable = useEventCallbackStabilizer(onEditComplete);
|
|
16143
16148
|
const onValueChangeStable = useEventCallbackStabilizer(onValueChange);
|
|
16144
|
-
const onChangeWrapper = (0,
|
|
16149
|
+
const onChangeWrapper = (0, import_react81.useCallback)((value2) => {
|
|
16145
16150
|
onValueChangeStable(value2);
|
|
16146
16151
|
onEditCompleteStable(value2);
|
|
16147
16152
|
}, [onValueChangeStable, onEditCompleteStable]);
|
|
@@ -16363,8 +16368,8 @@ var TextFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
16363
16368
|
const translation = useHightideTranslation();
|
|
16364
16369
|
const operator = filterValue?.operator ?? "textContains";
|
|
16365
16370
|
const parameter = filterValue?.parameter ?? {};
|
|
16366
|
-
const id = (0,
|
|
16367
|
-
const availableOperators = (0,
|
|
16371
|
+
const id = (0, import_react82.useId)();
|
|
16372
|
+
const availableOperators = (0, import_react82.useMemo)(() => [
|
|
16368
16373
|
...TableFilterOperator.text,
|
|
16369
16374
|
...TableFilterOperator.generic
|
|
16370
16375
|
], []);
|
|
@@ -16424,7 +16429,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
16424
16429
|
const translation = useHightideTranslation();
|
|
16425
16430
|
const operator = filterValue?.operator ?? "numberBetween";
|
|
16426
16431
|
const parameter = filterValue?.parameter ?? {};
|
|
16427
|
-
const availableOperators = (0,
|
|
16432
|
+
const availableOperators = (0, import_react82.useMemo)(() => [
|
|
16428
16433
|
...TableFilterOperator.number,
|
|
16429
16434
|
...TableFilterOperator.generic
|
|
16430
16435
|
], []);
|
|
@@ -16507,7 +16512,7 @@ var NumberFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
16507
16512
|
};
|
|
16508
16513
|
var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
16509
16514
|
const translation = useHightideTranslation();
|
|
16510
|
-
const id = (0,
|
|
16515
|
+
const id = (0, import_react82.useId)();
|
|
16511
16516
|
const ids = {
|
|
16512
16517
|
startDate: `date-filter-start-date-${id}`,
|
|
16513
16518
|
endDate: `date-filter-end-date-${id}`,
|
|
@@ -16515,9 +16520,9 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
16515
16520
|
};
|
|
16516
16521
|
const operator = filterValue?.operator ?? "dateBetween";
|
|
16517
16522
|
const parameter = filterValue?.parameter ?? {};
|
|
16518
|
-
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0,
|
|
16519
|
-
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0,
|
|
16520
|
-
const availableOperators = (0,
|
|
16523
|
+
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0, import_react82.useState)(null);
|
|
16524
|
+
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0, import_react82.useState)(null);
|
|
16525
|
+
const availableOperators = (0, import_react82.useMemo)(() => [
|
|
16521
16526
|
...TableFilterOperator.date,
|
|
16522
16527
|
...TableFilterOperator.generic
|
|
16523
16528
|
], []);
|
|
@@ -16632,7 +16637,7 @@ var DateFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
16632
16637
|
};
|
|
16633
16638
|
var DatetimeFilter = ({ filterValue, onFilterValueChange }) => {
|
|
16634
16639
|
const translation = useHightideTranslation();
|
|
16635
|
-
const id = (0,
|
|
16640
|
+
const id = (0, import_react82.useId)();
|
|
16636
16641
|
const ids = {
|
|
16637
16642
|
startDate: `datetime-filter-start-date-${id}`,
|
|
16638
16643
|
endDate: `datetime-filter-end-date-${id}`,
|
|
@@ -16640,9 +16645,9 @@ var DatetimeFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
16640
16645
|
};
|
|
16641
16646
|
const operator = filterValue?.operator ?? "dateTimeBetween";
|
|
16642
16647
|
const parameter = filterValue?.parameter ?? {};
|
|
16643
|
-
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0,
|
|
16644
|
-
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0,
|
|
16645
|
-
const availableOperators = (0,
|
|
16648
|
+
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0, import_react82.useState)(null);
|
|
16649
|
+
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0, import_react82.useState)(null);
|
|
16650
|
+
const availableOperators = (0, import_react82.useMemo)(() => [
|
|
16646
16651
|
...TableFilterOperator.dateTime,
|
|
16647
16652
|
...TableFilterOperator.generic
|
|
16648
16653
|
], []);
|
|
@@ -16759,7 +16764,7 @@ var DatetimeFilter = ({ filterValue, onFilterValueChange }) => {
|
|
|
16759
16764
|
};
|
|
16760
16765
|
var BooleanFilter = ({ filterValue, onFilterValueChange }) => {
|
|
16761
16766
|
const operator = filterValue?.operator ?? "booleanIsTrue";
|
|
16762
|
-
const availableOperators = (0,
|
|
16767
|
+
const availableOperators = (0, import_react82.useMemo)(() => [
|
|
16763
16768
|
...TableFilterOperator.boolean,
|
|
16764
16769
|
...TableFilterOperator.generic
|
|
16765
16770
|
], []);
|
|
@@ -16783,11 +16788,11 @@ var TagsFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
16783
16788
|
const { table } = useTableStateWithoutSizingContext();
|
|
16784
16789
|
const operator = filterValue?.operator ?? "tagsContains";
|
|
16785
16790
|
const parameter = filterValue?.parameter ?? {};
|
|
16786
|
-
const availableOperators = (0,
|
|
16791
|
+
const availableOperators = (0, import_react82.useMemo)(() => [
|
|
16787
16792
|
...TableFilterOperator.multiTags,
|
|
16788
16793
|
...TableFilterOperator.generic
|
|
16789
16794
|
], []);
|
|
16790
|
-
const availableTags = (0,
|
|
16795
|
+
const availableTags = (0, import_react82.useMemo)(() => {
|
|
16791
16796
|
const column = table.getColumn(columnId);
|
|
16792
16797
|
if (!column) return [];
|
|
16793
16798
|
return column.columnDef.meta?.filterData?.tags ?? [];
|
|
@@ -16834,11 +16839,11 @@ var TagsSingleFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
16834
16839
|
const { table } = useTableStateWithoutSizingContext();
|
|
16835
16840
|
const operator = filterValue?.operator ?? "tagsSingleContains";
|
|
16836
16841
|
const parameter = filterValue?.parameter ?? {};
|
|
16837
|
-
const availableOperators = (0,
|
|
16842
|
+
const availableOperators = (0, import_react82.useMemo)(() => [
|
|
16838
16843
|
...TableFilterOperator.singleTag,
|
|
16839
16844
|
...TableFilterOperator.generic
|
|
16840
16845
|
], []);
|
|
16841
|
-
const availableTags = (0,
|
|
16846
|
+
const availableTags = (0, import_react82.useMemo)(() => {
|
|
16842
16847
|
const column = table.getColumn(columnId);
|
|
16843
16848
|
if (!column) return [];
|
|
16844
16849
|
return column.columnDef.meta?.filterData?.tags ?? [];
|
|
@@ -16897,7 +16902,7 @@ var TagsSingleFilter = ({ columnId, filterValue, onFilterValueChange }) => {
|
|
|
16897
16902
|
};
|
|
16898
16903
|
var GenericFilter = ({ filterValue, onFilterValueChange }) => {
|
|
16899
16904
|
const operator = filterValue?.operator ?? "notUndefined";
|
|
16900
|
-
const availableOperators = (0,
|
|
16905
|
+
const availableOperators = (0, import_react82.useMemo)(() => [
|
|
16901
16906
|
...TableFilterOperator.generic
|
|
16902
16907
|
], []);
|
|
16903
16908
|
return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { className: "flex-col-2 gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
@@ -16946,18 +16951,18 @@ var TableFilterButton = ({
|
|
|
16946
16951
|
}) => {
|
|
16947
16952
|
const translation = useHightideTranslation();
|
|
16948
16953
|
const columnFilterValue = column.getFilterValue();
|
|
16949
|
-
const [filterValue, setFilterValue] = (0,
|
|
16954
|
+
const [filterValue, setFilterValue] = (0, import_react83.useState)(columnFilterValue);
|
|
16950
16955
|
const hasFilter = !!filterValue;
|
|
16951
|
-
const anchorRef = (0,
|
|
16952
|
-
const containerRef = (0,
|
|
16953
|
-
const [isOpen, setIsOpen] = (0,
|
|
16954
|
-
const id = (0,
|
|
16955
|
-
const ids = (0,
|
|
16956
|
+
const anchorRef = (0, import_react83.useRef)(null);
|
|
16957
|
+
const containerRef = (0, import_react83.useRef)(null);
|
|
16958
|
+
const [isOpen, setIsOpen] = (0, import_react83.useState)(false);
|
|
16959
|
+
const id = (0, import_react83.useId)();
|
|
16960
|
+
const ids = (0, import_react83.useMemo)(() => ({
|
|
16956
16961
|
button: `table-filter-button-${id}`,
|
|
16957
16962
|
popup: `table-filter-popup-${id}`,
|
|
16958
16963
|
label: `table-filter-label-${id}`
|
|
16959
16964
|
}), [id]);
|
|
16960
|
-
(0,
|
|
16965
|
+
(0, import_react83.useEffect)(() => {
|
|
16961
16966
|
setFilterValue(columnFilterValue);
|
|
16962
16967
|
}, [columnFilterValue]);
|
|
16963
16968
|
const isTagsFilter = filterType === "multiTags" || filterType === "singleTag";
|
|
@@ -17032,11 +17037,11 @@ var TableFilterButton = ({
|
|
|
17032
17037
|
};
|
|
17033
17038
|
|
|
17034
17039
|
// src/components/layout/table/TableHeader.tsx
|
|
17035
|
-
var
|
|
17040
|
+
var import_react84 = require("react");
|
|
17036
17041
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
17037
17042
|
var TableHeader = ({ isSticky = false }) => {
|
|
17038
17043
|
const { table } = useTableStateWithoutSizingContext();
|
|
17039
|
-
const handleResizeMove = (0,
|
|
17044
|
+
const handleResizeMove = (0, import_react84.useCallback)((e) => {
|
|
17040
17045
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
17041
17046
|
const currentX = "touches" in e ? e.touches[0].clientX : e.clientX;
|
|
17042
17047
|
const deltaOffset = currentX - (table.getState().columnSizingInfo.startOffset ?? 0);
|
|
@@ -17052,7 +17057,7 @@ var TableHeader = ({ isSticky = false }) => {
|
|
|
17052
17057
|
deltaOffset
|
|
17053
17058
|
}));
|
|
17054
17059
|
}, [table]);
|
|
17055
|
-
const handleResizeEnd = (0,
|
|
17060
|
+
const handleResizeEnd = (0, import_react84.useCallback)(() => {
|
|
17056
17061
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
17057
17062
|
const newWidth = (table.getState().columnSizingInfo.startSize ?? 0) + (table.getState().columnSizingInfo.deltaOffset ?? 0);
|
|
17058
17063
|
table.setColumnSizing((prev) => {
|
|
@@ -17070,7 +17075,7 @@ var TableHeader = ({ isSticky = false }) => {
|
|
|
17070
17075
|
startSize: null
|
|
17071
17076
|
});
|
|
17072
17077
|
}, [table]);
|
|
17073
|
-
(0,
|
|
17078
|
+
(0, import_react84.useEffect)(() => {
|
|
17074
17079
|
window.addEventListener("pointermove", handleResizeMove);
|
|
17075
17080
|
window.addEventListener("pointerup", handleResizeEnd);
|
|
17076
17081
|
return () => {
|
|
@@ -17239,7 +17244,7 @@ var TablePagination = ({ allowChangingPageSize = true, pageSizeOptions, ...props
|
|
|
17239
17244
|
};
|
|
17240
17245
|
|
|
17241
17246
|
// src/components/layout/table/TableWithSelectionProvider.tsx
|
|
17242
|
-
var
|
|
17247
|
+
var import_react85 = require("react");
|
|
17243
17248
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
17244
17249
|
var TableWithSelectionProvider = ({
|
|
17245
17250
|
children,
|
|
@@ -17252,7 +17257,7 @@ var TableWithSelectionProvider = ({
|
|
|
17252
17257
|
...props
|
|
17253
17258
|
}) => {
|
|
17254
17259
|
const translation = useHightideTranslation();
|
|
17255
|
-
const columnDef = (0,
|
|
17260
|
+
const columnDef = (0, import_react85.useMemo)(() => [
|
|
17256
17261
|
{
|
|
17257
17262
|
id: selectionRowId,
|
|
17258
17263
|
header: ({ table }) => {
|
|
@@ -17295,7 +17300,7 @@ var TableWithSelectionProvider = ({
|
|
|
17295
17300
|
TableProvider,
|
|
17296
17301
|
{
|
|
17297
17302
|
...props,
|
|
17298
|
-
fillerRowCell: (0,
|
|
17303
|
+
fillerRowCell: (0, import_react85.useCallback)((columnId, table) => {
|
|
17299
17304
|
if (columnId === selectionRowId) {
|
|
17300
17305
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Checkbox, { value: false, disabled: true });
|
|
17301
17306
|
}
|
|
@@ -17313,7 +17318,7 @@ var TableWithSelectionProvider = ({
|
|
|
17313
17318
|
rowSelection,
|
|
17314
17319
|
...state
|
|
17315
17320
|
},
|
|
17316
|
-
onRowClick: (0,
|
|
17321
|
+
onRowClick: (0, import_react85.useCallback)((row, table) => {
|
|
17317
17322
|
if (!disableClickRowClickSelection) {
|
|
17318
17323
|
row.toggleSelected();
|
|
17319
17324
|
}
|
|
@@ -17355,7 +17360,7 @@ var TableWithSelection = ({
|
|
|
17355
17360
|
};
|
|
17356
17361
|
|
|
17357
17362
|
// src/components/layout/table/TableColumn.tsx
|
|
17358
|
-
var
|
|
17363
|
+
var import_react86 = require("react");
|
|
17359
17364
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
17360
17365
|
var TableColumnComponent = ({
|
|
17361
17366
|
filterType,
|
|
@@ -17367,11 +17372,11 @@ var TableColumnComponent = ({
|
|
|
17367
17372
|
"TableColumn: For filterType === multiTags or singleTag, filterData.tags must be set.",
|
|
17368
17373
|
(filterType === "multiTags" || filterType === "singleTag") && props.meta?.filterData?.tags === void 0
|
|
17369
17374
|
);
|
|
17370
|
-
const [column] = (0,
|
|
17375
|
+
const [column] = (0, import_react86.useState)({
|
|
17371
17376
|
...props,
|
|
17372
17377
|
filterFn
|
|
17373
17378
|
});
|
|
17374
|
-
(0,
|
|
17379
|
+
(0, import_react86.useEffect)(() => {
|
|
17375
17380
|
const unsubscribe = registerColumn(column);
|
|
17376
17381
|
return () => {
|
|
17377
17382
|
unsubscribe();
|
|
@@ -17379,34 +17384,34 @@ var TableColumnComponent = ({
|
|
|
17379
17384
|
}, [registerColumn, column]);
|
|
17380
17385
|
return null;
|
|
17381
17386
|
};
|
|
17382
|
-
var TableColumnFactory = () => (0,
|
|
17387
|
+
var TableColumnFactory = () => (0, import_react86.memo)(
|
|
17383
17388
|
TableColumnComponent,
|
|
17384
17389
|
(prevProps, nextProps) => {
|
|
17385
17390
|
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;
|
|
17386
17391
|
}
|
|
17387
17392
|
);
|
|
17388
17393
|
var TableColumn = (props) => {
|
|
17389
|
-
const TableColumnComponent2 = (0,
|
|
17394
|
+
const TableColumnComponent2 = (0, import_react86.useMemo)(() => TableColumnFactory(), []);
|
|
17390
17395
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(TableColumnComponent2, { ...props });
|
|
17391
17396
|
};
|
|
17392
17397
|
|
|
17393
17398
|
// src/components/layout/table/TableColumnSwitcher.tsx
|
|
17394
|
-
var
|
|
17399
|
+
var import_react87 = require("react");
|
|
17395
17400
|
var import_lucide_react20 = require("lucide-react");
|
|
17396
17401
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
17397
17402
|
var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
17398
17403
|
const { table } = useTableStateWithoutSizingContext();
|
|
17399
17404
|
const translation = useHightideTranslation();
|
|
17400
|
-
const containerRef = (0,
|
|
17401
|
-
const generatedId = (0,
|
|
17402
|
-
const ids = (0,
|
|
17405
|
+
const containerRef = (0, import_react87.useRef)(null);
|
|
17406
|
+
const generatedId = (0, import_react87.useId)();
|
|
17407
|
+
const ids = (0, import_react87.useMemo)(() => ({
|
|
17403
17408
|
popup: props.id ?? `table-column-picker-popup-${generatedId}`,
|
|
17404
17409
|
label: `table-column-picker-label-${generatedId}`
|
|
17405
17410
|
}), [generatedId, props.id]);
|
|
17406
17411
|
const tableState = table.getState();
|
|
17407
17412
|
const columnOrder = tableState.columnOrder;
|
|
17408
17413
|
const columnPinning = tableState.columnPinning;
|
|
17409
|
-
const columns = (0,
|
|
17414
|
+
const columns = (0, import_react87.useMemo)(() => {
|
|
17410
17415
|
const allColumns = table.getAllColumns();
|
|
17411
17416
|
const leftPinned = [];
|
|
17412
17417
|
const unpinned = [];
|
|
@@ -17664,7 +17669,7 @@ var TableColumnSwitcher = ({ buttonProps, ...props }) => {
|
|
|
17664
17669
|
};
|
|
17665
17670
|
|
|
17666
17671
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
17667
|
-
var
|
|
17672
|
+
var import_react88 = require("react");
|
|
17668
17673
|
var import_clsx28 = require("clsx");
|
|
17669
17674
|
|
|
17670
17675
|
// src/utils/writeToClipboard.ts
|
|
@@ -17687,7 +17692,7 @@ var CopyToClipboardWrapper = ({
|
|
|
17687
17692
|
...props
|
|
17688
17693
|
}) => {
|
|
17689
17694
|
const translation = useHightideTranslation();
|
|
17690
|
-
const [isShowingConfirmation, setIsShowingConfirmation] = (0,
|
|
17695
|
+
const [isShowingConfirmation, setIsShowingConfirmation] = (0, import_react88.useState)(false);
|
|
17691
17696
|
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
17692
17697
|
TooltipRoot,
|
|
17693
17698
|
{
|
|
@@ -17736,7 +17741,7 @@ var CopyToClipboardWrapper = ({
|
|
|
17736
17741
|
};
|
|
17737
17742
|
|
|
17738
17743
|
// src/components/user-interaction/Menu.tsx
|
|
17739
|
-
var
|
|
17744
|
+
var import_react89 = require("react");
|
|
17740
17745
|
var import_clsx29 = __toESM(require("clsx"));
|
|
17741
17746
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
17742
17747
|
var MenuItem = ({
|
|
@@ -17762,8 +17767,8 @@ var Menu = ({
|
|
|
17762
17767
|
disabled = false,
|
|
17763
17768
|
...props
|
|
17764
17769
|
}) => {
|
|
17765
|
-
const triggerRef = (0,
|
|
17766
|
-
const [isOpen, setIsOpen] = (0,
|
|
17770
|
+
const triggerRef = (0, import_react89.useRef)(null);
|
|
17771
|
+
const [isOpen, setIsOpen] = (0, import_react89.useState)(false);
|
|
17767
17772
|
const bag = {
|
|
17768
17773
|
isOpen,
|
|
17769
17774
|
close: () => setIsOpen(false),
|
|
@@ -17771,7 +17776,7 @@ var Menu = ({
|
|
|
17771
17776
|
disabled
|
|
17772
17777
|
};
|
|
17773
17778
|
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
17774
|
-
trigger(bag, (0,
|
|
17779
|
+
trigger(bag, (0, import_react89.useCallback)((el) => triggerRef.current = el, [])),
|
|
17775
17780
|
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)(
|
|
17776
17781
|
PopUp,
|
|
17777
17782
|
{
|
|
@@ -17793,7 +17798,7 @@ var Menu = ({
|
|
|
17793
17798
|
};
|
|
17794
17799
|
|
|
17795
17800
|
// src/components/user-interaction/ScrollPicker.tsx
|
|
17796
|
-
var
|
|
17801
|
+
var import_react90 = require("react");
|
|
17797
17802
|
var import_clsx30 = __toESM(require("clsx"));
|
|
17798
17803
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
17799
17804
|
var up = 1;
|
|
@@ -17814,7 +17819,7 @@ var ScrollPicker = ({
|
|
|
17814
17819
|
transition,
|
|
17815
17820
|
items,
|
|
17816
17821
|
lastTimeStamp
|
|
17817
|
-
}, setAnimation] = (0,
|
|
17822
|
+
}, setAnimation] = (0, import_react90.useState)({
|
|
17818
17823
|
targetIndex: selectedIndex,
|
|
17819
17824
|
currentIndex: disabled ? selectedIndex : 0,
|
|
17820
17825
|
velocity: 0,
|
|
@@ -17830,7 +17835,7 @@ var ScrollPicker = ({
|
|
|
17830
17835
|
const itemHeight = 40;
|
|
17831
17836
|
const distance = 8;
|
|
17832
17837
|
const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
|
|
17833
|
-
const getDirection = (0,
|
|
17838
|
+
const getDirection = (0, import_react90.useCallback)((targetIndex, currentIndex2, transition2, length) => {
|
|
17834
17839
|
if (targetIndex === currentIndex2) {
|
|
17835
17840
|
return transition2 > 0 ? up : down;
|
|
17836
17841
|
}
|
|
@@ -17840,7 +17845,7 @@ var ScrollPicker = ({
|
|
|
17840
17845
|
}
|
|
17841
17846
|
return distanceForward >= length / 2 ? down : up;
|
|
17842
17847
|
}, []);
|
|
17843
|
-
const animate = (0,
|
|
17848
|
+
const animate = (0, import_react90.useCallback)((timestamp, startTime) => {
|
|
17844
17849
|
setAnimation((prevState) => {
|
|
17845
17850
|
const {
|
|
17846
17851
|
targetIndex,
|
|
@@ -17913,7 +17918,7 @@ var ScrollPicker = ({
|
|
|
17913
17918
|
};
|
|
17914
17919
|
});
|
|
17915
17920
|
}, [disabled, getDirection, onChange]);
|
|
17916
|
-
(0,
|
|
17921
|
+
(0, import_react90.useEffect)(() => {
|
|
17917
17922
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
17918
17923
|
});
|
|
17919
17924
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -17991,7 +17996,7 @@ var ScrollPicker = ({
|
|
|
17991
17996
|
};
|
|
17992
17997
|
|
|
17993
17998
|
// src/components/user-interaction/Switch.tsx
|
|
17994
|
-
var
|
|
17999
|
+
var import_react91 = require("react");
|
|
17995
18000
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
17996
18001
|
var Switch = ({
|
|
17997
18002
|
value: controlledValue,
|
|
@@ -18006,7 +18011,7 @@ var Switch = ({
|
|
|
18006
18011
|
}) => {
|
|
18007
18012
|
const onEditCompleteStable = useEventCallbackStabilizer(onEditComplete);
|
|
18008
18013
|
const onValueChangeStable = useEventCallbackStabilizer(onValueChange);
|
|
18009
|
-
const onChangeWrapper = (0,
|
|
18014
|
+
const onChangeWrapper = (0, import_react91.useCallback)((value2) => {
|
|
18010
18015
|
onValueChangeStable(!value2);
|
|
18011
18016
|
onEditCompleteStable(!value2);
|
|
18012
18017
|
}, [onValueChangeStable, onEditCompleteStable]);
|
|
@@ -18046,10 +18051,10 @@ var Switch = ({
|
|
|
18046
18051
|
};
|
|
18047
18052
|
|
|
18048
18053
|
// src/components/user-interaction/Textarea.tsx
|
|
18049
|
-
var
|
|
18054
|
+
var import_react92 = require("react");
|
|
18050
18055
|
var import_clsx31 = __toESM(require("clsx"));
|
|
18051
18056
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
18052
|
-
var Textarea = (0,
|
|
18057
|
+
var Textarea = (0, import_react92.forwardRef)(function Textarea2({
|
|
18053
18058
|
value: controlledValue,
|
|
18054
18059
|
initialValue,
|
|
18055
18060
|
invalid = false,
|
|
@@ -18065,7 +18070,7 @@ var Textarea = (0, import_react91.forwardRef)(function Textarea2({
|
|
|
18065
18070
|
});
|
|
18066
18071
|
const { restartTimer, clearTimer } = useDelay(saveDelayOptions);
|
|
18067
18072
|
const onEditCompleteStable = useEventCallbackStabilizer(onEditComplete);
|
|
18068
|
-
const onEditCompleteWrapper = (0,
|
|
18073
|
+
const onEditCompleteWrapper = (0, import_react92.useCallback)((text) => {
|
|
18069
18074
|
onEditCompleteStable(text);
|
|
18070
18075
|
clearTimer();
|
|
18071
18076
|
}, [onEditCompleteStable, clearTimer]);
|
|
@@ -18103,7 +18108,7 @@ var TextareaWithHeadline = ({
|
|
|
18103
18108
|
containerClassName,
|
|
18104
18109
|
...props
|
|
18105
18110
|
}) => {
|
|
18106
|
-
const genId = (0,
|
|
18111
|
+
const genId = (0, import_react92.useId)();
|
|
18107
18112
|
const usedId = id ?? genId;
|
|
18108
18113
|
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
18109
18114
|
"div",
|
|
@@ -18176,11 +18181,11 @@ var TimeDisplay = ({
|
|
|
18176
18181
|
};
|
|
18177
18182
|
|
|
18178
18183
|
// src/components/user-interaction/input/InsideLabelInput.tsx
|
|
18179
|
-
var import_react92 = require("react");
|
|
18180
18184
|
var import_react93 = require("react");
|
|
18185
|
+
var import_react94 = require("react");
|
|
18181
18186
|
var import_clsx32 = __toESM(require("clsx"));
|
|
18182
18187
|
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
18183
|
-
var InsideLabelInput = (0,
|
|
18188
|
+
var InsideLabelInput = (0, import_react94.forwardRef)(function InsideLabelInput2({
|
|
18184
18189
|
id: customId,
|
|
18185
18190
|
value: controlledValue,
|
|
18186
18191
|
initialValue,
|
|
@@ -18193,8 +18198,8 @@ var InsideLabelInput = (0, import_react93.forwardRef)(function InsideLabelInput2
|
|
|
18193
18198
|
onValueChange,
|
|
18194
18199
|
defaultValue: initialValue
|
|
18195
18200
|
});
|
|
18196
|
-
const [isFocused, setIsFocused] = (0,
|
|
18197
|
-
const generatedId = (0,
|
|
18201
|
+
const [isFocused, setIsFocused] = (0, import_react94.useState)(false);
|
|
18202
|
+
const generatedId = (0, import_react93.useId)();
|
|
18198
18203
|
const id = customId ?? generatedId;
|
|
18199
18204
|
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: (0, import_clsx32.default)("relative"), children: [
|
|
18200
18205
|
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
@@ -18283,11 +18288,11 @@ var SearchBar = ({
|
|
|
18283
18288
|
};
|
|
18284
18289
|
|
|
18285
18290
|
// src/components/user-interaction/input/ToggleableInput.tsx
|
|
18286
|
-
var
|
|
18291
|
+
var import_react95 = require("react");
|
|
18287
18292
|
var import_lucide_react23 = require("lucide-react");
|
|
18288
18293
|
var import_clsx34 = __toESM(require("clsx"));
|
|
18289
18294
|
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
18290
|
-
var ToggleableInput = (0,
|
|
18295
|
+
var ToggleableInput = (0, import_react95.forwardRef)(function ToggleableInput2({
|
|
18291
18296
|
value: controlledValue,
|
|
18292
18297
|
initialValue,
|
|
18293
18298
|
onValueChange,
|
|
@@ -18300,10 +18305,10 @@ var ToggleableInput = (0, import_react94.forwardRef)(function ToggleableInput2({
|
|
|
18300
18305
|
onValueChange,
|
|
18301
18306
|
defaultValue: initialValue
|
|
18302
18307
|
});
|
|
18303
|
-
const [isEditing, setIsEditing] = (0,
|
|
18304
|
-
const innerRef = (0,
|
|
18305
|
-
(0,
|
|
18306
|
-
(0,
|
|
18308
|
+
const [isEditing, setIsEditing] = (0, import_react95.useState)(initialState !== "display");
|
|
18309
|
+
const innerRef = (0, import_react95.useRef)(null);
|
|
18310
|
+
(0, import_react95.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
18311
|
+
(0, import_react95.useEffect)(() => {
|
|
18307
18312
|
if (isEditing) {
|
|
18308
18313
|
innerRef.current?.focus();
|
|
18309
18314
|
}
|
|
@@ -18513,17 +18518,17 @@ var DateProperty = ({
|
|
|
18513
18518
|
var import_lucide_react28 = require("lucide-react");
|
|
18514
18519
|
|
|
18515
18520
|
// src/components/user-interaction/select/MultiSelectChipDisplay.tsx
|
|
18516
|
-
var
|
|
18521
|
+
var import_react96 = require("react");
|
|
18517
18522
|
var import_lucide_react27 = require("lucide-react");
|
|
18518
18523
|
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
18519
|
-
var MultiSelectChipDisplayButton = (0,
|
|
18524
|
+
var MultiSelectChipDisplayButton = (0, import_react96.forwardRef)(function MultiSelectChipDisplayButton2({
|
|
18520
18525
|
id,
|
|
18521
18526
|
...props
|
|
18522
18527
|
}, ref) {
|
|
18523
18528
|
const translation = useHightideTranslation();
|
|
18524
18529
|
const { state, trigger, item, ids, setIds } = useSelectContext();
|
|
18525
18530
|
const { register, unregister, toggleOpen } = trigger;
|
|
18526
|
-
(0,
|
|
18531
|
+
(0, import_react96.useEffect)(() => {
|
|
18527
18532
|
if (id) {
|
|
18528
18533
|
setIds((prev) => ({
|
|
18529
18534
|
...prev,
|
|
@@ -18531,9 +18536,9 @@ var MultiSelectChipDisplayButton = (0, import_react95.forwardRef)(function Multi
|
|
|
18531
18536
|
}));
|
|
18532
18537
|
}
|
|
18533
18538
|
}, [id, setIds]);
|
|
18534
|
-
const innerRef = (0,
|
|
18535
|
-
(0,
|
|
18536
|
-
(0,
|
|
18539
|
+
const innerRef = (0, import_react96.useRef)(null);
|
|
18540
|
+
(0, import_react96.useImperativeHandle)(ref, () => innerRef.current);
|
|
18541
|
+
(0, import_react96.useEffect)(() => {
|
|
18537
18542
|
register(innerRef);
|
|
18538
18543
|
return () => unregister();
|
|
18539
18544
|
}, [register, unregister]);
|
|
@@ -18605,7 +18610,7 @@ var MultiSelectChipDisplayButton = (0, import_react95.forwardRef)(function Multi
|
|
|
18605
18610
|
}
|
|
18606
18611
|
);
|
|
18607
18612
|
});
|
|
18608
|
-
var MultiSelectChipDisplay = (0,
|
|
18613
|
+
var MultiSelectChipDisplay = (0, import_react96.forwardRef)(function MultiSelectChipDisplay2({
|
|
18609
18614
|
children,
|
|
18610
18615
|
contentPanelProps,
|
|
18611
18616
|
chipDisplayProps,
|
|
@@ -18819,16 +18824,16 @@ var TextProperty = ({
|
|
|
18819
18824
|
};
|
|
18820
18825
|
|
|
18821
18826
|
// src/components/utils/Transition.tsx
|
|
18822
|
-
var
|
|
18827
|
+
var import_react97 = require("react");
|
|
18823
18828
|
function Transition({
|
|
18824
18829
|
children,
|
|
18825
18830
|
show,
|
|
18826
18831
|
includeAnimation = true
|
|
18827
18832
|
}) {
|
|
18828
|
-
const [isOpen, setIsOpen] = (0,
|
|
18829
|
-
const [isTransitioning, setIsTransitioning] = (0,
|
|
18833
|
+
const [isOpen, setIsOpen] = (0, import_react97.useState)(show);
|
|
18834
|
+
const [isTransitioning, setIsTransitioning] = (0, import_react97.useState)(!isOpen);
|
|
18830
18835
|
const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
|
|
18831
|
-
(0,
|
|
18836
|
+
(0, import_react97.useEffect)(() => {
|
|
18832
18837
|
setIsOpen(show);
|
|
18833
18838
|
setIsTransitioning(true);
|
|
18834
18839
|
}, [show]);
|