@helpwave/hightide 0.12.2 → 0.12.4
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 +25 -3
- package/dist/index.d.ts +25 -3
- package/dist/index.js +861 -653
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +251 -44
- package/dist/index.mjs.map +1 -1
- package/dist/style/globals.css +10 -0
- package/dist/style/uncompiled/theme/components/app-page.css +8 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7186,6 +7186,7 @@ __export(index_exports, {
|
|
|
7186
7186
|
useSelectOptionDisplayLocation: () => useSelectOptionDisplayLocation,
|
|
7187
7187
|
useSingleSelection: () => useSingleSelection,
|
|
7188
7188
|
useStorage: () => useStorage,
|
|
7189
|
+
useSwipeGesture: () => useSwipeGesture,
|
|
7189
7190
|
useTabContext: () => useTabContext,
|
|
7190
7191
|
useTableColumnDefinitionContext: () => useTableColumnDefinitionContext,
|
|
7191
7192
|
useTableContainerContext: () => useTableContainerContext,
|
|
@@ -8654,7 +8655,7 @@ var ProcessModelCanvas = ({
|
|
|
8654
8655
|
};
|
|
8655
8656
|
|
|
8656
8657
|
// src/components/display-and-visualization/process-model/ProcessModelTraceReplay.tsx
|
|
8657
|
-
var
|
|
8658
|
+
var import_react40 = require("react");
|
|
8658
8659
|
var import_clsx9 = __toESM(require("clsx"));
|
|
8659
8660
|
|
|
8660
8661
|
// src/global-contexts/LocaleContext.tsx
|
|
@@ -9828,7 +9829,7 @@ function useHightideTranslation(extensions, overwrites) {
|
|
|
9828
9829
|
}
|
|
9829
9830
|
|
|
9830
9831
|
// src/components/user-interaction/Select/Select.tsx
|
|
9831
|
-
var
|
|
9832
|
+
var import_react39 = require("react");
|
|
9832
9833
|
|
|
9833
9834
|
// src/components/user-interaction/Select/SelectRoot.tsx
|
|
9834
9835
|
var import_react20 = require("react");
|
|
@@ -10611,11 +10612,11 @@ var SelectButton = (0, import_react22.forwardRef)(
|
|
|
10611
10612
|
);
|
|
10612
10613
|
|
|
10613
10614
|
// src/components/user-interaction/Select/SelectContent.tsx
|
|
10614
|
-
var
|
|
10615
|
+
var import_react38 = require("react");
|
|
10615
10616
|
var import_clsx8 = __toESM(require("clsx"));
|
|
10616
10617
|
|
|
10617
10618
|
// src/components/layout/popup/PopUp.tsx
|
|
10618
|
-
var
|
|
10619
|
+
var import_react34 = require("react");
|
|
10619
10620
|
|
|
10620
10621
|
// src/components/utils/Portal.tsx
|
|
10621
10622
|
var import_react_dom = require("react-dom");
|
|
@@ -10974,7 +10975,6 @@ var AnchoredFloatingContainer = (0, import_react27.forwardRef)(function Floating
|
|
|
10974
10975
|
// src/components/utils/FocusTrap.tsx
|
|
10975
10976
|
var import_react29 = require("react");
|
|
10976
10977
|
var import_react30 = require("react");
|
|
10977
|
-
var import_react31 = require("react");
|
|
10978
10978
|
|
|
10979
10979
|
// src/hooks/focus/useFocusTrap.ts
|
|
10980
10980
|
var import_react28 = require("react");
|
|
@@ -10994,7 +10994,7 @@ var createFocusGuard = () => {
|
|
|
10994
10994
|
return div;
|
|
10995
10995
|
};
|
|
10996
10996
|
function getContainedFocusableElements(element) {
|
|
10997
|
-
return element?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');
|
|
10997
|
+
return [...element?.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])') ?? []];
|
|
10998
10998
|
}
|
|
10999
10999
|
var FocusTrapService = class {
|
|
11000
11000
|
constructor() {
|
|
@@ -11004,7 +11004,7 @@ var FocusTrapService = class {
|
|
|
11004
11004
|
const active = this.getActive();
|
|
11005
11005
|
if (!active || !active.container.current) return;
|
|
11006
11006
|
const { container } = active;
|
|
11007
|
-
if (!container.current.contains(event.target)) {
|
|
11007
|
+
if (container.current && !container.current.contains(event.target)) {
|
|
11008
11008
|
this.focusElement();
|
|
11009
11009
|
}
|
|
11010
11010
|
};
|
|
@@ -11020,10 +11020,10 @@ var FocusTrapService = class {
|
|
|
11020
11020
|
const containerElement = container.current;
|
|
11021
11021
|
if (initialFocusElement?.current) {
|
|
11022
11022
|
initialFocusElement.current.focus();
|
|
11023
|
-
} else {
|
|
11023
|
+
} else if (containerElement) {
|
|
11024
11024
|
const elements = getContainedFocusableElements(containerElement);
|
|
11025
11025
|
if (elements && elements.length > 0) {
|
|
11026
|
-
const first = elements
|
|
11026
|
+
const first = elements[0];
|
|
11027
11027
|
first.focus();
|
|
11028
11028
|
} else {
|
|
11029
11029
|
containerElement.focus();
|
|
@@ -11100,10 +11100,10 @@ var useFocusTrap = ({
|
|
|
11100
11100
|
const containerElement = container.current;
|
|
11101
11101
|
if (initialFocus?.current) {
|
|
11102
11102
|
initialFocus.current.focus();
|
|
11103
|
-
} else {
|
|
11103
|
+
} else if (containerElement) {
|
|
11104
11104
|
const elements = getContainedFocusableElements(containerElement);
|
|
11105
11105
|
if (elements && elements.length > 0) {
|
|
11106
|
-
const first = elements
|
|
11106
|
+
const first = elements[0];
|
|
11107
11107
|
first.focus();
|
|
11108
11108
|
} else {
|
|
11109
11109
|
console.warn("No focusable elements found in the focus trap. Affected element: ", containerElement);
|
|
@@ -11131,12 +11131,13 @@ var useFocusTrap = ({
|
|
|
11131
11131
|
service.register({ id, pause, focus, focusLast, unpause, container, initialFocusElement: initialFocus });
|
|
11132
11132
|
return () => {
|
|
11133
11133
|
service.unregister(id);
|
|
11134
|
-
lastFocusRef.current =
|
|
11134
|
+
lastFocusRef.current = null;
|
|
11135
11135
|
};
|
|
11136
11136
|
}
|
|
11137
11137
|
}, [active, container, focusElement, id, initialFocus]);
|
|
11138
11138
|
(0, import_react28.useEffect)(() => {
|
|
11139
|
-
|
|
11139
|
+
const containerElement = container.current;
|
|
11140
|
+
if (active && !paused && containerElement) {
|
|
11140
11141
|
let onKeyDown = function(event) {
|
|
11141
11142
|
const key = event.key;
|
|
11142
11143
|
const elements = getContainedFocusableElements(containerElement);
|
|
@@ -11153,7 +11154,6 @@ var useFocusTrap = ({
|
|
|
11153
11154
|
event.preventDefault();
|
|
11154
11155
|
}
|
|
11155
11156
|
};
|
|
11156
|
-
const containerElement = container.current;
|
|
11157
11157
|
containerElement.addEventListener("keydown", onKeyDown);
|
|
11158
11158
|
return () => {
|
|
11159
11159
|
containerElement.removeEventListener("keydown", onKeyDown);
|
|
@@ -11170,21 +11170,33 @@ var FocusTrap = ({ children, ...props }) => {
|
|
|
11170
11170
|
});
|
|
11171
11171
|
return children;
|
|
11172
11172
|
};
|
|
11173
|
-
var FocusTrapWrapper = (0,
|
|
11173
|
+
var FocusTrapWrapper = (0, import_react30.forwardRef)(function FocusTrap2({
|
|
11174
11174
|
active,
|
|
11175
11175
|
initialFocus,
|
|
11176
11176
|
...props
|
|
11177
11177
|
}, forwardedRef) {
|
|
11178
11178
|
const innerRef = (0, import_react29.useRef)(null);
|
|
11179
|
-
(0, import_react30.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
11180
11179
|
useFocusTrap({ container: innerRef, active, initialFocus });
|
|
11181
|
-
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11180
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
11181
|
+
"div",
|
|
11182
|
+
{
|
|
11183
|
+
ref: (node) => {
|
|
11184
|
+
innerRef.current = node;
|
|
11185
|
+
if (typeof forwardedRef === "function") {
|
|
11186
|
+
forwardedRef(node);
|
|
11187
|
+
} else if (forwardedRef) {
|
|
11188
|
+
forwardedRef.current = node;
|
|
11189
|
+
}
|
|
11190
|
+
},
|
|
11191
|
+
...props
|
|
11192
|
+
}
|
|
11193
|
+
);
|
|
11182
11194
|
});
|
|
11183
11195
|
|
|
11184
11196
|
// src/hooks/useOutsideClick.ts
|
|
11185
|
-
var
|
|
11197
|
+
var import_react31 = require("react");
|
|
11186
11198
|
var useOutsideClick = ({ refs, onOutsideClick, active = true }) => {
|
|
11187
|
-
(0,
|
|
11199
|
+
(0, import_react31.useEffect)(() => {
|
|
11188
11200
|
if (!active) return;
|
|
11189
11201
|
const listener = (event) => {
|
|
11190
11202
|
if (event.target === null) return;
|
|
@@ -11205,17 +11217,17 @@ var useOutsideClick = ({ refs, onOutsideClick, active = true }) => {
|
|
|
11205
11217
|
};
|
|
11206
11218
|
|
|
11207
11219
|
// src/hooks/usePresenceRef.ts
|
|
11208
|
-
var
|
|
11220
|
+
var import_react32 = require("react");
|
|
11209
11221
|
var usePresenceRef = ({
|
|
11210
11222
|
isOpen = true
|
|
11211
11223
|
}) => {
|
|
11212
|
-
const [isPresent, setIsPresent] = (0,
|
|
11213
|
-
const ref = (0,
|
|
11214
|
-
const refAssignment = (0,
|
|
11224
|
+
const [isPresent, setIsPresent] = (0, import_react32.useState)(false);
|
|
11225
|
+
const ref = (0, import_react32.useRef)(null);
|
|
11226
|
+
const refAssignment = (0, import_react32.useCallback)((node) => {
|
|
11215
11227
|
ref.current = node;
|
|
11216
11228
|
setIsPresent((prev) => prev || !!node);
|
|
11217
11229
|
}, []);
|
|
11218
|
-
(0,
|
|
11230
|
+
(0, import_react32.useEffect)(() => {
|
|
11219
11231
|
if (!isOpen) {
|
|
11220
11232
|
setIsPresent(false);
|
|
11221
11233
|
}
|
|
@@ -11228,7 +11240,7 @@ var usePresenceRef = ({
|
|
|
11228
11240
|
};
|
|
11229
11241
|
|
|
11230
11242
|
// src/hooks/useOverlayRegistry.ts
|
|
11231
|
-
var
|
|
11243
|
+
var import_react33 = require("react");
|
|
11232
11244
|
var OverlayRegistry = class _OverlayRegistry {
|
|
11233
11245
|
constructor() {
|
|
11234
11246
|
// The frontmost overlay is at the end of the array
|
|
@@ -11293,18 +11305,18 @@ var OverlayRegistry = class _OverlayRegistry {
|
|
|
11293
11305
|
}
|
|
11294
11306
|
};
|
|
11295
11307
|
var useOverlayRegistry = (props = {}) => {
|
|
11296
|
-
const generatedId = (0,
|
|
11297
|
-
const item = (0,
|
|
11308
|
+
const generatedId = (0, import_react33.useId)();
|
|
11309
|
+
const item = (0, import_react33.useMemo)(() => ({
|
|
11298
11310
|
id: props.id ?? generatedId,
|
|
11299
11311
|
tags: props.tags
|
|
11300
11312
|
}), [props.id, generatedId, props.tags]);
|
|
11301
|
-
const [value, setValue] = (0,
|
|
11313
|
+
const [value, setValue] = (0, import_react33.useState)({
|
|
11302
11314
|
activeId: null,
|
|
11303
11315
|
itemInformation: {},
|
|
11304
11316
|
tagItemCounts: {}
|
|
11305
11317
|
});
|
|
11306
|
-
const registry = (0,
|
|
11307
|
-
(0,
|
|
11318
|
+
const registry = (0, import_react33.useMemo)(() => OverlayRegistry.getInstance(), []);
|
|
11319
|
+
(0, import_react33.useEffect)(() => {
|
|
11308
11320
|
if (!props.isActive) {
|
|
11309
11321
|
return;
|
|
11310
11322
|
}
|
|
@@ -11335,7 +11347,7 @@ var useOverlayRegistry = (props = {}) => {
|
|
|
11335
11347
|
|
|
11336
11348
|
// src/components/layout/popup/PopUp.tsx
|
|
11337
11349
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
11338
|
-
var PopUp = (0,
|
|
11350
|
+
var PopUp = (0, import_react34.forwardRef)(function PopUp2({
|
|
11339
11351
|
children,
|
|
11340
11352
|
isOpen: isOpenOverwrite,
|
|
11341
11353
|
focusTrapOptions,
|
|
@@ -11347,23 +11359,23 @@ var PopUp = (0, import_react35.forwardRef)(function PopUp2({
|
|
|
11347
11359
|
anchorExcludedFromOutsideClick = false,
|
|
11348
11360
|
...props
|
|
11349
11361
|
}, forwardRef36) {
|
|
11350
|
-
const context = (0,
|
|
11362
|
+
const context = (0, import_react34.useContext)(PopUpContext);
|
|
11351
11363
|
const isOpen = isOpenOverwrite ?? context?.isOpen ?? false;
|
|
11352
11364
|
const anchor = anchorOverwrite ?? context?.triggerRef ?? void 0;
|
|
11353
11365
|
const id = props.id ?? context?.popUpId;
|
|
11354
11366
|
const { refAssignment, isPresent, ref } = usePresenceRef({ isOpen });
|
|
11355
|
-
(0,
|
|
11367
|
+
(0, import_react34.useImperativeHandle)(forwardRef36, () => ref.current, [ref]);
|
|
11356
11368
|
const onCloseStable = useEventCallbackStabilizer(onClose);
|
|
11357
11369
|
const onOutsideClickStable = useEventCallbackStabilizer(onOutsideClick);
|
|
11358
|
-
const onCloseWrapper = (0,
|
|
11370
|
+
const onCloseWrapper = (0, import_react34.useCallback)(() => {
|
|
11359
11371
|
onCloseStable();
|
|
11360
11372
|
context?.setIsOpen(false);
|
|
11361
11373
|
}, [onCloseStable, context]);
|
|
11362
|
-
const { zIndex, tagPositions } = useOverlayRegistry({ isActive: isOpen, tags: (0,
|
|
11374
|
+
const { zIndex, tagPositions } = useOverlayRegistry({ isActive: isOpen, tags: (0, import_react34.useMemo)(() => ["popup"], []) });
|
|
11363
11375
|
const isInFront = tagPositions?.["popup"] === 0;
|
|
11364
11376
|
const isOutsideClickActive = isOpen && isInFront && (outsideClickOptions?.active ?? true);
|
|
11365
11377
|
useOutsideClick({
|
|
11366
|
-
onOutsideClick: (0,
|
|
11378
|
+
onOutsideClick: (0, import_react34.useCallback)((event) => {
|
|
11367
11379
|
if (event.defaultPrevented) return;
|
|
11368
11380
|
onCloseWrapper();
|
|
11369
11381
|
onOutsideClickStable(event);
|
|
@@ -11400,16 +11412,16 @@ var PopUp = (0, import_react35.forwardRef)(function PopUp2({
|
|
|
11400
11412
|
});
|
|
11401
11413
|
|
|
11402
11414
|
// src/components/user-interaction/input/Input.tsx
|
|
11403
|
-
var
|
|
11415
|
+
var import_react37 = require("react");
|
|
11404
11416
|
|
|
11405
11417
|
// src/hooks/useDelay.ts
|
|
11406
|
-
var
|
|
11418
|
+
var import_react35 = require("react");
|
|
11407
11419
|
var defaultOptions2 = {
|
|
11408
11420
|
delay: 3e3,
|
|
11409
11421
|
disabled: false
|
|
11410
11422
|
};
|
|
11411
11423
|
function useDelay(options) {
|
|
11412
|
-
const [timer, setTimer] = (0,
|
|
11424
|
+
const [timer, setTimer] = (0, import_react35.useState)(void 0);
|
|
11413
11425
|
const { delay, disabled } = {
|
|
11414
11426
|
...defaultOptions2,
|
|
11415
11427
|
...options
|
|
@@ -11428,12 +11440,12 @@ function useDelay(options) {
|
|
|
11428
11440
|
setTimer(void 0);
|
|
11429
11441
|
}, delay));
|
|
11430
11442
|
};
|
|
11431
|
-
(0,
|
|
11443
|
+
(0, import_react35.useEffect)(() => {
|
|
11432
11444
|
return () => {
|
|
11433
11445
|
clearTimeout(timer);
|
|
11434
11446
|
};
|
|
11435
11447
|
}, [timer]);
|
|
11436
|
-
(0,
|
|
11448
|
+
(0, import_react35.useEffect)(() => {
|
|
11437
11449
|
if (disabled) {
|
|
11438
11450
|
clearTimeout(timer);
|
|
11439
11451
|
setTimer(void 0);
|
|
@@ -11443,9 +11455,9 @@ function useDelay(options) {
|
|
|
11443
11455
|
}
|
|
11444
11456
|
|
|
11445
11457
|
// src/hooks/focus/useFocusManagement.ts
|
|
11446
|
-
var
|
|
11458
|
+
var import_react36 = require("react");
|
|
11447
11459
|
function useFocusManagement() {
|
|
11448
|
-
const getFocusableElements = (0,
|
|
11460
|
+
const getFocusableElements = (0, import_react36.useCallback)(() => {
|
|
11449
11461
|
return Array.from(
|
|
11450
11462
|
document.querySelectorAll(
|
|
11451
11463
|
'input, button, select, textarea, a[href], [tabindex]:not([tabindex="-1"])'
|
|
@@ -11454,7 +11466,7 @@ function useFocusManagement() {
|
|
|
11454
11466
|
(el) => el instanceof HTMLElement && !el.hasAttribute("disabled") && !el.hasAttribute("hidden") && el.tabIndex !== -1
|
|
11455
11467
|
);
|
|
11456
11468
|
}, []);
|
|
11457
|
-
const getNextFocusElement = (0,
|
|
11469
|
+
const getNextFocusElement = (0, import_react36.useCallback)(() => {
|
|
11458
11470
|
const elements = getFocusableElements();
|
|
11459
11471
|
if (elements.length === 0) {
|
|
11460
11472
|
return void 0;
|
|
@@ -11466,11 +11478,11 @@ function useFocusManagement() {
|
|
|
11466
11478
|
}
|
|
11467
11479
|
return nextElement;
|
|
11468
11480
|
}, [getFocusableElements]);
|
|
11469
|
-
const focusNext = (0,
|
|
11481
|
+
const focusNext = (0, import_react36.useCallback)(() => {
|
|
11470
11482
|
const nextElement = getNextFocusElement();
|
|
11471
11483
|
nextElement?.focus();
|
|
11472
11484
|
}, [getNextFocusElement]);
|
|
11473
|
-
const getPreviousFocusElement = (0,
|
|
11485
|
+
const getPreviousFocusElement = (0, import_react36.useCallback)(() => {
|
|
11474
11486
|
const elements = getFocusableElements();
|
|
11475
11487
|
if (elements.length === 0) {
|
|
11476
11488
|
return void 0;
|
|
@@ -11486,7 +11498,7 @@ function useFocusManagement() {
|
|
|
11486
11498
|
}
|
|
11487
11499
|
return previousElement;
|
|
11488
11500
|
}, [getFocusableElements]);
|
|
11489
|
-
const focusPrevious = (0,
|
|
11501
|
+
const focusPrevious = (0, import_react36.useCallback)(() => {
|
|
11490
11502
|
const previousElement = getPreviousFocusElement();
|
|
11491
11503
|
if (previousElement) previousElement.focus();
|
|
11492
11504
|
}, [getPreviousFocusElement]);
|
|
@@ -11507,7 +11519,7 @@ var defaultEditCompleteOptions = {
|
|
|
11507
11519
|
afterDelay: false,
|
|
11508
11520
|
delay: 2500
|
|
11509
11521
|
};
|
|
11510
|
-
var Input = (0,
|
|
11522
|
+
var Input = (0, import_react37.forwardRef)(function Input2({
|
|
11511
11523
|
value: controlledValue,
|
|
11512
11524
|
initialValue,
|
|
11513
11525
|
invalid = false,
|
|
@@ -11531,8 +11543,8 @@ var Input = (0, import_react38.forwardRef)(function Input2({
|
|
|
11531
11543
|
restartTimer,
|
|
11532
11544
|
clearTimer
|
|
11533
11545
|
} = useDelay({ delay, disabled: !afterDelay || props.disabled || props.readOnly });
|
|
11534
|
-
const innerRef = (0,
|
|
11535
|
-
(0,
|
|
11546
|
+
const innerRef = (0, import_react37.useRef)(null);
|
|
11547
|
+
(0, import_react37.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
11536
11548
|
const { focusNext } = useFocusManagement();
|
|
11537
11549
|
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
11538
11550
|
"input",
|
|
@@ -11578,7 +11590,7 @@ var Input = (0, import_react38.forwardRef)(function Input2({
|
|
|
11578
11590
|
|
|
11579
11591
|
// src/components/user-interaction/Select/SelectContent.tsx
|
|
11580
11592
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
11581
|
-
var SelectContent = (0,
|
|
11593
|
+
var SelectContent = (0, import_react38.forwardRef)(function SelectContent2({
|
|
11582
11594
|
id,
|
|
11583
11595
|
options,
|
|
11584
11596
|
showSearch: showSearchOverride,
|
|
@@ -11586,18 +11598,18 @@ var SelectContent = (0, import_react39.forwardRef)(function SelectContent2({
|
|
|
11586
11598
|
...props
|
|
11587
11599
|
}, ref) {
|
|
11588
11600
|
const translation = useHightideTranslation();
|
|
11589
|
-
const innerRef = (0,
|
|
11590
|
-
const searchInputRef = (0,
|
|
11591
|
-
(0,
|
|
11601
|
+
const innerRef = (0, import_react38.useRef)(null);
|
|
11602
|
+
const searchInputRef = (0, import_react38.useRef)(null);
|
|
11603
|
+
(0, import_react38.useImperativeHandle)(ref, () => innerRef.current);
|
|
11592
11604
|
const context = useSelectContext();
|
|
11593
11605
|
const { config, handleTypeaheadKey, toggleSelection, highlightNext, highlightPrevious, highlightFirst, highlightLast, highlightedId } = context;
|
|
11594
11606
|
const { setIds } = config;
|
|
11595
|
-
(0,
|
|
11607
|
+
(0, import_react38.useEffect)(() => {
|
|
11596
11608
|
if (id) setIds((prev) => ({ ...prev, content: id }));
|
|
11597
11609
|
}, [id, setIds]);
|
|
11598
11610
|
const showSearch = showSearchOverride ?? context.search.hasSearch;
|
|
11599
11611
|
const listboxAriaLabel = showSearch ? translation("searchResults") : void 0;
|
|
11600
|
-
const keyHandler = (0,
|
|
11612
|
+
const keyHandler = (0, import_react38.useCallback)(
|
|
11601
11613
|
(event) => {
|
|
11602
11614
|
switch (event.key) {
|
|
11603
11615
|
case "ArrowDown":
|
|
@@ -11706,7 +11718,7 @@ var SelectContent = (0, import_react39.forwardRef)(function SelectContent2({
|
|
|
11706
11718
|
|
|
11707
11719
|
// src/components/user-interaction/Select/Select.tsx
|
|
11708
11720
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
11709
|
-
var Select = (0,
|
|
11721
|
+
var Select = (0, import_react39.forwardRef)(function Select2({ children, contentPanelProps, buttonProps, ...props }, ref) {
|
|
11710
11722
|
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(SelectRoot, { ...props, children: [
|
|
11711
11723
|
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
|
|
11712
11724
|
SelectButton,
|
|
@@ -11782,20 +11794,20 @@ function runParticleAlongPath(path, durationMs, signal, onFrame) {
|
|
|
11782
11794
|
}
|
|
11783
11795
|
var ProcessModelTraceReplay = ({ graph, className }) => {
|
|
11784
11796
|
const translation = useHightideTranslation();
|
|
11785
|
-
const pathPrefix = (0,
|
|
11786
|
-
const hostRef = (0,
|
|
11787
|
-
const traceIndexRef = (0,
|
|
11788
|
-
const playbackRef = (0,
|
|
11789
|
-
const playbackLoopLockRef = (0,
|
|
11790
|
-
const [speedMult, setSpeedMult] = (0,
|
|
11791
|
-
const [isPlaying, setIsPlaying] = (0,
|
|
11792
|
-
const [activeNodeId, setActiveNodeId] = (0,
|
|
11793
|
-
const [visitedNodeIds, setVisitedNodeIds] = (0,
|
|
11794
|
-
const [edgeReplayHighlight, setEdgeReplayHighlight] = (0,
|
|
11795
|
-
const [replayParticle, setReplayParticle] = (0,
|
|
11796
|
-
const [logLines, setLogLines] = (0,
|
|
11797
|
-
const [logPlaceholder, setLogPlaceholder] = (0,
|
|
11798
|
-
const getPath = (0,
|
|
11797
|
+
const pathPrefix = (0, import_react40.useId)().replace(/:/g, "");
|
|
11798
|
+
const hostRef = (0, import_react40.useRef)(null);
|
|
11799
|
+
const traceIndexRef = (0, import_react40.useRef)(0);
|
|
11800
|
+
const playbackRef = (0, import_react40.useRef)(null);
|
|
11801
|
+
const playbackLoopLockRef = (0, import_react40.useRef)(false);
|
|
11802
|
+
const [speedMult, setSpeedMult] = (0, import_react40.useState)(2);
|
|
11803
|
+
const [isPlaying, setIsPlaying] = (0, import_react40.useState)(false);
|
|
11804
|
+
const [activeNodeId, setActiveNodeId] = (0, import_react40.useState)();
|
|
11805
|
+
const [visitedNodeIds, setVisitedNodeIds] = (0, import_react40.useState)(/* @__PURE__ */ new Set());
|
|
11806
|
+
const [edgeReplayHighlight, setEdgeReplayHighlight] = (0, import_react40.useState)(null);
|
|
11807
|
+
const [replayParticle, setReplayParticle] = (0, import_react40.useState)(null);
|
|
11808
|
+
const [logLines, setLogLines] = (0, import_react40.useState)([]);
|
|
11809
|
+
const [logPlaceholder, setLogPlaceholder] = (0, import_react40.useState)(true);
|
|
11810
|
+
const getPath = (0, import_react40.useCallback)(
|
|
11799
11811
|
(from, to) => {
|
|
11800
11812
|
const root = hostRef.current;
|
|
11801
11813
|
if (!root) {
|
|
@@ -11810,7 +11822,7 @@ var ProcessModelTraceReplay = ({ graph, className }) => {
|
|
|
11810
11822
|
},
|
|
11811
11823
|
[pathPrefix]
|
|
11812
11824
|
);
|
|
11813
|
-
const addLog = (0,
|
|
11825
|
+
const addLog = (0, import_react40.useCallback)((text) => {
|
|
11814
11826
|
setLogPlaceholder(false);
|
|
11815
11827
|
const time = (/* @__PURE__ */ new Date()).toLocaleTimeString("en", { hour: "2-digit", minute: "2-digit", second: "2-digit" });
|
|
11816
11828
|
setLogLines((prev) => [
|
|
@@ -11818,20 +11830,20 @@ var ProcessModelTraceReplay = ({ graph, className }) => {
|
|
|
11818
11830
|
{ id: `${Date.now()}-${Math.random().toString(36).slice(2)}`, time, text }
|
|
11819
11831
|
]);
|
|
11820
11832
|
}, []);
|
|
11821
|
-
const getLabel = (0,
|
|
11833
|
+
const getLabel = (0, import_react40.useCallback)(
|
|
11822
11834
|
(id) => {
|
|
11823
11835
|
const n = graph.nodes.find((x) => x.id === id);
|
|
11824
11836
|
return n ? `${n.label} (${n.count})` : id;
|
|
11825
11837
|
},
|
|
11826
11838
|
[graph.nodes]
|
|
11827
11839
|
);
|
|
11828
|
-
const stopPlayback = (0,
|
|
11840
|
+
const stopPlayback = (0, import_react40.useCallback)(() => {
|
|
11829
11841
|
playbackRef.current?.abort();
|
|
11830
11842
|
playbackRef.current = null;
|
|
11831
11843
|
setIsPlaying(false);
|
|
11832
11844
|
setReplayParticle(null);
|
|
11833
11845
|
}, []);
|
|
11834
|
-
const resetReplay = (0,
|
|
11846
|
+
const resetReplay = (0, import_react40.useCallback)(() => {
|
|
11835
11847
|
stopPlayback();
|
|
11836
11848
|
traceIndexRef.current = 0;
|
|
11837
11849
|
setActiveNodeId(void 0);
|
|
@@ -11840,14 +11852,14 @@ var ProcessModelTraceReplay = ({ graph, className }) => {
|
|
|
11840
11852
|
setLogLines([]);
|
|
11841
11853
|
setLogPlaceholder(true);
|
|
11842
11854
|
}, [stopPlayback]);
|
|
11843
|
-
const awaitDoubleRaf = (0,
|
|
11855
|
+
const awaitDoubleRaf = (0, import_react40.useCallback)(() => {
|
|
11844
11856
|
return new Promise((resolve2) => {
|
|
11845
11857
|
requestAnimationFrame(() => {
|
|
11846
11858
|
requestAnimationFrame(() => resolve2());
|
|
11847
11859
|
});
|
|
11848
11860
|
});
|
|
11849
11861
|
}, []);
|
|
11850
|
-
const runTraceOnce = (0,
|
|
11862
|
+
const runTraceOnce = (0, import_react40.useCallback)(
|
|
11851
11863
|
async (trace, signal) => {
|
|
11852
11864
|
await awaitDoubleRaf();
|
|
11853
11865
|
if (signal.aborted) {
|
|
@@ -11900,7 +11912,7 @@ var ProcessModelTraceReplay = ({ graph, className }) => {
|
|
|
11900
11912
|
},
|
|
11901
11913
|
[addLog, awaitDoubleRaf, getLabel, getPath, speedMult]
|
|
11902
11914
|
);
|
|
11903
|
-
const startPlayback = (0,
|
|
11915
|
+
const startPlayback = (0, import_react40.useCallback)(async () => {
|
|
11904
11916
|
if (!graph.traces.length || playbackLoopLockRef.current) {
|
|
11905
11917
|
return;
|
|
11906
11918
|
}
|
|
@@ -11931,10 +11943,10 @@ var ProcessModelTraceReplay = ({ graph, className }) => {
|
|
|
11931
11943
|
setReplayParticle(null);
|
|
11932
11944
|
}
|
|
11933
11945
|
}, [graph.traces, runTraceOnce, speedMult, stopPlayback]);
|
|
11934
|
-
(0,
|
|
11946
|
+
(0, import_react40.useEffect)(() => {
|
|
11935
11947
|
resetReplay();
|
|
11936
11948
|
}, [graph, resetReplay]);
|
|
11937
|
-
(0,
|
|
11949
|
+
(0, import_react40.useEffect)(() => () => {
|
|
11938
11950
|
playbackRef.current?.abort();
|
|
11939
11951
|
}, []);
|
|
11940
11952
|
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { "data-name": "process-model-trace-replay", className: (0, import_clsx9.default)("process-model-trace-replay", className), children: [
|
|
@@ -12263,9 +12275,9 @@ function getProcessModelLibraryEntry(id) {
|
|
|
12263
12275
|
}
|
|
12264
12276
|
|
|
12265
12277
|
// src/components/form/FieldLayout.tsx
|
|
12266
|
-
var
|
|
12278
|
+
var import_react41 = require("react");
|
|
12267
12279
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
12268
|
-
var FormFieldLayout = (0,
|
|
12280
|
+
var FormFieldLayout = (0, import_react41.forwardRef)(function FormFieldLayout2({
|
|
12269
12281
|
children,
|
|
12270
12282
|
ids: idOverwrites = {},
|
|
12271
12283
|
required = false,
|
|
@@ -12280,8 +12292,8 @@ var FormFieldLayout = (0, import_react42.forwardRef)(function FormFieldLayout2({
|
|
|
12280
12292
|
showRequiredIndicator = true,
|
|
12281
12293
|
...props
|
|
12282
12294
|
}, ref) {
|
|
12283
|
-
const generatedId = (0,
|
|
12284
|
-
const ids = (0,
|
|
12295
|
+
const generatedId = (0, import_react41.useId)();
|
|
12296
|
+
const ids = (0, import_react41.useMemo)(() => ({
|
|
12285
12297
|
input: idOverwrites.input ?? `form-field-input-${generatedId}`,
|
|
12286
12298
|
error: idOverwrites.error ?? `form-field-error-${generatedId}`,
|
|
12287
12299
|
label: idOverwrites.label ?? `form-field-label-${generatedId}`,
|
|
@@ -12292,14 +12304,14 @@ var FormFieldLayout = (0, import_react42.forwardRef)(function FormFieldLayout2({
|
|
|
12292
12304
|
invalidDescription ? ids.error : void 0
|
|
12293
12305
|
].filter(Boolean).join(" ");
|
|
12294
12306
|
const invalid = !!invalidDescription;
|
|
12295
|
-
const inputAriaAttributes = (0,
|
|
12307
|
+
const inputAriaAttributes = (0, import_react41.useMemo)(() => ({
|
|
12296
12308
|
"aria-required": required,
|
|
12297
12309
|
"aria-describedby": describedBy,
|
|
12298
12310
|
"aria-labelledby": label ? ids.label : void 0,
|
|
12299
12311
|
"aria-invalid": invalid,
|
|
12300
12312
|
"aria-errormessage": invalid ? ids.error : void 0
|
|
12301
12313
|
}), [describedBy, ids.error, ids.label, invalid, label, required]);
|
|
12302
|
-
const state = (0,
|
|
12314
|
+
const state = (0, import_react41.useMemo)(() => ({
|
|
12303
12315
|
disabled,
|
|
12304
12316
|
invalid,
|
|
12305
12317
|
readOnly,
|
|
@@ -12358,47 +12370,47 @@ var FormFieldLayout = (0, import_react42.forwardRef)(function FormFieldLayout2({
|
|
|
12358
12370
|
});
|
|
12359
12371
|
|
|
12360
12372
|
// src/components/form/FormContext.tsx
|
|
12361
|
-
var
|
|
12373
|
+
var import_react42 = require("react");
|
|
12362
12374
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
12363
|
-
var FormContext = (0,
|
|
12375
|
+
var FormContext = (0, import_react42.createContext)(null);
|
|
12364
12376
|
var FormProvider = ({ children, state }) => {
|
|
12365
12377
|
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(FormContext.Provider, { value: state, children });
|
|
12366
12378
|
};
|
|
12367
12379
|
function useForm() {
|
|
12368
|
-
const ctx = (0,
|
|
12380
|
+
const ctx = (0, import_react42.useContext)(FormContext);
|
|
12369
12381
|
if (!ctx) throw new Error("FormContext is only available inside a <Form>");
|
|
12370
12382
|
return ctx;
|
|
12371
12383
|
}
|
|
12372
12384
|
function useFormField(key, { triggerUpdate = true, validationBehaviour = "touched" }) {
|
|
12373
|
-
const context = (0,
|
|
12374
|
-
const subscribe = (0,
|
|
12385
|
+
const context = (0, import_react42.useContext)(FormContext);
|
|
12386
|
+
const subscribe = (0, import_react42.useCallback)((cb) => {
|
|
12375
12387
|
if (!context) return () => {
|
|
12376
12388
|
};
|
|
12377
12389
|
return context.store.subscribe(key, cb);
|
|
12378
12390
|
}, [context, key]);
|
|
12379
|
-
const subscribeAll = (0,
|
|
12391
|
+
const subscribeAll = (0, import_react42.useCallback)((cb) => {
|
|
12380
12392
|
if (!context) return () => {
|
|
12381
12393
|
};
|
|
12382
12394
|
return context.store.subscribe("ALL", cb);
|
|
12383
12395
|
}, [context]);
|
|
12384
|
-
const value = (0,
|
|
12396
|
+
const value = (0, import_react42.useSyncExternalStore)(
|
|
12385
12397
|
subscribe,
|
|
12386
12398
|
() => context ? context.store.getValue(key) : void 0
|
|
12387
12399
|
);
|
|
12388
|
-
const error = (0,
|
|
12400
|
+
const error = (0, import_react42.useSyncExternalStore)(
|
|
12389
12401
|
subscribe,
|
|
12390
12402
|
() => context ? context.store.getError(key) : void 0
|
|
12391
12403
|
);
|
|
12392
|
-
const touched = (0,
|
|
12404
|
+
const touched = (0, import_react42.useSyncExternalStore)(
|
|
12393
12405
|
subscribe,
|
|
12394
12406
|
() => context ? context.store.getTouched(key) : void 0
|
|
12395
12407
|
);
|
|
12396
|
-
const hasTriedSubmitting = (0,
|
|
12408
|
+
const hasTriedSubmitting = (0, import_react42.useSyncExternalStore)(
|
|
12397
12409
|
subscribeAll,
|
|
12398
12410
|
() => context ? context.store.getHasTriedSubmitting() : void 0
|
|
12399
12411
|
);
|
|
12400
12412
|
const isShowingErrors = validationBehaviour === "always" || validationBehaviour === "touched" && (touched ?? false) || validationBehaviour === "submit" && (hasTriedSubmitting ?? false);
|
|
12401
|
-
const getDataProps = (0,
|
|
12413
|
+
const getDataProps = (0, import_react42.useCallback)(() => {
|
|
12402
12414
|
return {
|
|
12403
12415
|
value,
|
|
12404
12416
|
onValueChange: (val) => context?.store.setValue(key, val),
|
|
@@ -12421,18 +12433,18 @@ function useFormField(key, { triggerUpdate = true, validationBehaviour = "touche
|
|
|
12421
12433
|
};
|
|
12422
12434
|
}
|
|
12423
12435
|
function useFormObserver({ formStore } = {}) {
|
|
12424
|
-
const context = (0,
|
|
12436
|
+
const context = (0, import_react42.useContext)(FormContext);
|
|
12425
12437
|
const store = formStore ?? context?.store;
|
|
12426
|
-
const subscribe = (0,
|
|
12438
|
+
const subscribe = (0, import_react42.useCallback)((cb) => {
|
|
12427
12439
|
if (!store) return () => {
|
|
12428
12440
|
};
|
|
12429
12441
|
return store.subscribe("ALL", cb);
|
|
12430
12442
|
}, [store]);
|
|
12431
|
-
const values = (0,
|
|
12432
|
-
const errors = (0,
|
|
12433
|
-
const touched = (0,
|
|
12434
|
-
const hasErrors = (0,
|
|
12435
|
-
const hasTriedSubmitting = (0,
|
|
12443
|
+
const values = (0, import_react42.useSyncExternalStore)(subscribe, () => store ? store.getAllValues() : void 0);
|
|
12444
|
+
const errors = (0, import_react42.useSyncExternalStore)(subscribe, () => store ? store.getErrors() : void 0);
|
|
12445
|
+
const touched = (0, import_react42.useSyncExternalStore)(subscribe, () => store ? store.getAllTouched() : void 0);
|
|
12446
|
+
const hasErrors = (0, import_react42.useSyncExternalStore)(subscribe, () => store ? store.getHasError() : void 0);
|
|
12447
|
+
const hasTriedSubmitting = (0, import_react42.useSyncExternalStore)(subscribe, () => store ? store.getHasTriedSubmitting() : void 0);
|
|
12436
12448
|
if (!store) return null;
|
|
12437
12449
|
return {
|
|
12438
12450
|
store,
|
|
@@ -12444,16 +12456,16 @@ function useFormObserver({ formStore } = {}) {
|
|
|
12444
12456
|
};
|
|
12445
12457
|
}
|
|
12446
12458
|
function useFormObserverKey({ formStore, formKey }) {
|
|
12447
|
-
const context = (0,
|
|
12459
|
+
const context = (0, import_react42.useContext)(FormContext);
|
|
12448
12460
|
const store = formStore ?? context?.store;
|
|
12449
|
-
const subscribe = (0,
|
|
12461
|
+
const subscribe = (0, import_react42.useCallback)((cb) => {
|
|
12450
12462
|
if (!store) return () => {
|
|
12451
12463
|
};
|
|
12452
12464
|
return store.subscribe(formKey, cb);
|
|
12453
12465
|
}, [store, formKey]);
|
|
12454
|
-
const value = (0,
|
|
12455
|
-
const error = (0,
|
|
12456
|
-
const touched = (0,
|
|
12466
|
+
const value = (0, import_react42.useSyncExternalStore)(subscribe, () => store ? store.getValue(formKey) : void 0);
|
|
12467
|
+
const error = (0, import_react42.useSyncExternalStore)(subscribe, () => store ? store.getError(formKey) : void 0);
|
|
12468
|
+
const touched = (0, import_react42.useSyncExternalStore)(subscribe, () => store ? store.getTouched(formKey) : void 0);
|
|
12457
12469
|
if (!store) return null;
|
|
12458
12470
|
return {
|
|
12459
12471
|
store,
|
|
@@ -12679,7 +12691,7 @@ var FormStore = class {
|
|
|
12679
12691
|
};
|
|
12680
12692
|
|
|
12681
12693
|
// src/components/form/useCreateForm.tsx
|
|
12682
|
-
var
|
|
12694
|
+
var import_react43 = require("react");
|
|
12683
12695
|
function useCreateForm({
|
|
12684
12696
|
onFormSubmit,
|
|
12685
12697
|
onFormError,
|
|
@@ -12697,23 +12709,23 @@ function useCreateForm({
|
|
|
12697
12709
|
const onValueChangeStable = useEventCallbackStabilizer(onValueChange);
|
|
12698
12710
|
const onUpdateStable = useEventCallbackStabilizer(onUpdate);
|
|
12699
12711
|
const onValidUpdateStable = useEventCallbackStabilizer(onValidUpdate);
|
|
12700
|
-
const storeRef = (0,
|
|
12712
|
+
const storeRef = (0, import_react43.useRef)(
|
|
12701
12713
|
new FormStore({
|
|
12702
12714
|
initialValues,
|
|
12703
12715
|
hasTriedSubmitting,
|
|
12704
12716
|
validators
|
|
12705
12717
|
})
|
|
12706
12718
|
);
|
|
12707
|
-
(0,
|
|
12719
|
+
(0, import_react43.useEffect)(() => {
|
|
12708
12720
|
storeRef.current.changeValidators(validators);
|
|
12709
12721
|
}, [validators]);
|
|
12710
|
-
const fieldRefs = (0,
|
|
12711
|
-
const registerRef = (0,
|
|
12722
|
+
const fieldRefs = (0, import_react43.useRef)({});
|
|
12723
|
+
const registerRef = (0, import_react43.useCallback)((key) => {
|
|
12712
12724
|
return (el) => {
|
|
12713
12725
|
fieldRefs.current[key] = el;
|
|
12714
12726
|
};
|
|
12715
12727
|
}, []);
|
|
12716
|
-
(0,
|
|
12728
|
+
(0, import_react43.useEffect)(() => {
|
|
12717
12729
|
const handleUpdate = (event) => {
|
|
12718
12730
|
if (event.type === "onSubmit") {
|
|
12719
12731
|
if (event.hasErrors) {
|
|
@@ -12764,7 +12776,7 @@ function useCreateForm({
|
|
|
12764
12776
|
unsubscribe();
|
|
12765
12777
|
};
|
|
12766
12778
|
}, [onFormErrorStable, onFormSubmitStable, onUpdateStable, onValidUpdateStable, onValueChangeStable, scrollOptions, scrollToElements]);
|
|
12767
|
-
const callbacks = (0,
|
|
12779
|
+
const callbacks = (0, import_react43.useMemo)(() => ({
|
|
12768
12780
|
reset: () => storeRef.current.reset(),
|
|
12769
12781
|
submit: () => storeRef.current.submit(),
|
|
12770
12782
|
update: (updater, triggerUpdate = false) => {
|
|
@@ -12784,20 +12796,20 @@ function useCreateForm({
|
|
|
12784
12796
|
}
|
|
12785
12797
|
|
|
12786
12798
|
// src/components/layout/Carousel.tsx
|
|
12787
|
-
var
|
|
12799
|
+
var import_react50 = require("react");
|
|
12788
12800
|
var import_clsx10 = __toESM(require("clsx"));
|
|
12789
12801
|
var import_lucide_react7 = require("lucide-react");
|
|
12790
12802
|
|
|
12791
12803
|
// src/components/user-interaction/IconButton.tsx
|
|
12792
|
-
var
|
|
12804
|
+
var import_react49 = require("react");
|
|
12793
12805
|
|
|
12794
12806
|
// src/components/user-interaction/Tooltip.tsx
|
|
12807
|
+
var import_react45 = require("react");
|
|
12795
12808
|
var import_react46 = require("react");
|
|
12796
12809
|
var import_react47 = require("react");
|
|
12797
|
-
var import_react48 = require("react");
|
|
12798
12810
|
|
|
12799
12811
|
// src/hooks/useTransitionState.ts
|
|
12800
|
-
var
|
|
12812
|
+
var import_react44 = require("react");
|
|
12801
12813
|
var reducer = (state, action) => {
|
|
12802
12814
|
switch (action) {
|
|
12803
12815
|
case "open":
|
|
@@ -12823,18 +12835,18 @@ var useTransitionState = ({
|
|
|
12823
12835
|
ref,
|
|
12824
12836
|
timeout: initialTimeout = 1e3
|
|
12825
12837
|
}) => {
|
|
12826
|
-
const [state, dispatch] = (0,
|
|
12827
|
-
const timer = (0,
|
|
12828
|
-
const hasAnimation = (0,
|
|
12829
|
-
const [timeout] = (0,
|
|
12830
|
-
(0,
|
|
12838
|
+
const [state, dispatch] = (0, import_react44.useReducer)(reducer, initialState);
|
|
12839
|
+
const timer = (0, import_react44.useRef)(void 0);
|
|
12840
|
+
const hasAnimation = (0, import_react44.useRef)(false);
|
|
12841
|
+
const [timeout] = (0, import_react44.useState)(initialTimeout);
|
|
12842
|
+
(0, import_react44.useEffect)(() => {
|
|
12831
12843
|
if (isOpen && (state !== "opened" && state !== "opening")) {
|
|
12832
12844
|
dispatch("open");
|
|
12833
12845
|
} else if (!isOpen && (state !== "closed" && state !== "closing")) {
|
|
12834
12846
|
dispatch("close");
|
|
12835
12847
|
}
|
|
12836
12848
|
}, [isOpen, state]);
|
|
12837
|
-
(0,
|
|
12849
|
+
(0, import_react44.useEffect)(() => {
|
|
12838
12850
|
if (state === "opening" || state === "closing") {
|
|
12839
12851
|
if (timer.current) {
|
|
12840
12852
|
clearTimeout(timer.current);
|
|
@@ -12850,7 +12862,7 @@ var useTransitionState = ({
|
|
|
12850
12862
|
}
|
|
12851
12863
|
}
|
|
12852
12864
|
}, [state, timeout]);
|
|
12853
|
-
(0,
|
|
12865
|
+
(0, import_react44.useLayoutEffect)(() => {
|
|
12854
12866
|
if (state === "opening" || state === "closing") {
|
|
12855
12867
|
let element = ref?.current;
|
|
12856
12868
|
if (!element && ref) {
|
|
@@ -12872,14 +12884,14 @@ var useTransitionState = ({
|
|
|
12872
12884
|
}
|
|
12873
12885
|
}
|
|
12874
12886
|
}, [ref, state]);
|
|
12875
|
-
const onStart = (0,
|
|
12887
|
+
const onStart = (0, import_react44.useCallback)(() => {
|
|
12876
12888
|
hasAnimation.current = true;
|
|
12877
12889
|
}, []);
|
|
12878
|
-
const onEnd = (0,
|
|
12890
|
+
const onEnd = (0, import_react44.useCallback)(() => {
|
|
12879
12891
|
dispatch("finished");
|
|
12880
12892
|
hasAnimation.current = false;
|
|
12881
12893
|
}, []);
|
|
12882
|
-
(0,
|
|
12894
|
+
(0, import_react44.useEffect)(() => {
|
|
12883
12895
|
if (ref?.current && (state === "opening" || state === "closing")) {
|
|
12884
12896
|
const element = ref.current;
|
|
12885
12897
|
element.addEventListener("animationstart", onStart);
|
|
@@ -12903,11 +12915,11 @@ var useTransitionState = ({
|
|
|
12903
12915
|
};
|
|
12904
12916
|
|
|
12905
12917
|
// src/components/user-interaction/Tooltip.tsx
|
|
12906
|
-
var
|
|
12918
|
+
var import_react48 = require("react");
|
|
12907
12919
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
12908
|
-
var TooltipContext = (0,
|
|
12920
|
+
var TooltipContext = (0, import_react48.createContext)(null);
|
|
12909
12921
|
var useTooltip = () => {
|
|
12910
|
-
const context = (0,
|
|
12922
|
+
const context = (0, import_react45.useContext)(TooltipContext);
|
|
12911
12923
|
if (!context) {
|
|
12912
12924
|
throw new Error("useTooltip must be used within a TooltipContext.Provider or TooltipRoot");
|
|
12913
12925
|
}
|
|
@@ -12920,20 +12932,20 @@ var TooltipRoot = ({
|
|
|
12920
12932
|
appearDelay: appearOverwrite,
|
|
12921
12933
|
disabled = false
|
|
12922
12934
|
}) => {
|
|
12923
|
-
const generatedId = "tooltip-" + (0,
|
|
12924
|
-
const [tooltipId, setTooltipId] = (0,
|
|
12925
|
-
const [isShown, setIsShown] = (0,
|
|
12926
|
-
const timeoutRef = (0,
|
|
12935
|
+
const generatedId = "tooltip-" + (0, import_react46.useId)();
|
|
12936
|
+
const [tooltipId, setTooltipId] = (0, import_react47.useState)(generatedId);
|
|
12937
|
+
const [isShown, setIsShown] = (0, import_react47.useState)(isInitiallyShown);
|
|
12938
|
+
const timeoutRef = (0, import_react47.useRef)(void 0);
|
|
12927
12939
|
const { config } = useHightideConfig();
|
|
12928
|
-
const appearDelay = (0,
|
|
12940
|
+
const appearDelay = (0, import_react47.useMemo)(
|
|
12929
12941
|
() => appearOverwrite ?? config.tooltip.appearDelay,
|
|
12930
12942
|
[appearOverwrite, config.tooltip.appearDelay]
|
|
12931
12943
|
);
|
|
12932
|
-
const triggerRef = (0,
|
|
12933
|
-
(0,
|
|
12944
|
+
const triggerRef = (0, import_react47.useRef)(null);
|
|
12945
|
+
(0, import_react45.useEffect)(() => {
|
|
12934
12946
|
onIsShownChange?.(isShown);
|
|
12935
12947
|
}, [isShown, onIsShownChange]);
|
|
12936
|
-
const openWithDelay = (0,
|
|
12948
|
+
const openWithDelay = (0, import_react47.useCallback)(() => {
|
|
12937
12949
|
if (timeoutRef.current || isShown) return;
|
|
12938
12950
|
if (appearDelay < 0) {
|
|
12939
12951
|
setIsShown(true);
|
|
@@ -12944,14 +12956,14 @@ var TooltipRoot = ({
|
|
|
12944
12956
|
setIsShown(true);
|
|
12945
12957
|
}, appearDelay);
|
|
12946
12958
|
}, [appearDelay, isShown]);
|
|
12947
|
-
const close2 = (0,
|
|
12959
|
+
const close2 = (0, import_react47.useCallback)(() => {
|
|
12948
12960
|
if (timeoutRef.current) {
|
|
12949
12961
|
clearTimeout(timeoutRef.current);
|
|
12950
12962
|
timeoutRef.current = void 0;
|
|
12951
12963
|
}
|
|
12952
12964
|
setIsShown(false);
|
|
12953
12965
|
}, []);
|
|
12954
|
-
(0,
|
|
12966
|
+
(0, import_react45.useEffect)(() => {
|
|
12955
12967
|
if (!isShown) return;
|
|
12956
12968
|
const closeOnBlur = () => close2();
|
|
12957
12969
|
const closeOnScroll = () => close2();
|
|
@@ -12962,7 +12974,7 @@ var TooltipRoot = ({
|
|
|
12962
12974
|
window.removeEventListener("scroll", closeOnScroll, true);
|
|
12963
12975
|
};
|
|
12964
12976
|
}, [isShown, close2]);
|
|
12965
|
-
(0,
|
|
12977
|
+
(0, import_react45.useEffect)(() => {
|
|
12966
12978
|
if (disabled) {
|
|
12967
12979
|
setIsShown(false);
|
|
12968
12980
|
if (timeoutRef.current) {
|
|
@@ -12971,7 +12983,7 @@ var TooltipRoot = ({
|
|
|
12971
12983
|
}
|
|
12972
12984
|
}
|
|
12973
12985
|
}, [disabled]);
|
|
12974
|
-
const contextValue = (0,
|
|
12986
|
+
const contextValue = (0, import_react47.useMemo)(() => ({
|
|
12975
12987
|
tooltip: {
|
|
12976
12988
|
id: tooltipId,
|
|
12977
12989
|
setId: setTooltipId
|
|
@@ -12995,7 +13007,7 @@ var TooltipRoot = ({
|
|
|
12995
13007
|
}), [tooltipId, openWithDelay, close2, isShown, disabled]);
|
|
12996
13008
|
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(TooltipContext.Provider, { value: contextValue, children });
|
|
12997
13009
|
};
|
|
12998
|
-
var TooltipDisplay = (0,
|
|
13010
|
+
var TooltipDisplay = (0, import_react45.forwardRef)(function TooltipAnchoredFloatingContainer({
|
|
12999
13011
|
children,
|
|
13000
13012
|
alignment = "bottom",
|
|
13001
13013
|
disabled: disabledOverwrite,
|
|
@@ -13005,30 +13017,30 @@ var TooltipDisplay = (0, import_react46.forwardRef)(function TooltipAnchoredFloa
|
|
|
13005
13017
|
...props
|
|
13006
13018
|
}, forwardRef36) {
|
|
13007
13019
|
const { config } = useHightideConfig();
|
|
13008
|
-
const tooltipContext = (0,
|
|
13020
|
+
const tooltipContext = (0, import_react45.useContext)(TooltipContext);
|
|
13009
13021
|
const disabled = disabledOverwrite ?? tooltipContext?.disabled;
|
|
13010
13022
|
const isShown = isShownOverwrite ?? tooltipContext?.isShown;
|
|
13011
13023
|
const anchor = anchorOverwrite ?? tooltipContext?.trigger.ref;
|
|
13012
13024
|
const id = tooltipContext?.tooltip.id ?? props.id;
|
|
13013
|
-
(0,
|
|
13025
|
+
(0, import_react45.useEffect)(() => {
|
|
13014
13026
|
if (!tooltipContext || !props.id) return;
|
|
13015
13027
|
tooltipContext?.tooltip.setId(props.id);
|
|
13016
13028
|
}, [props.id, tooltipContext]);
|
|
13017
|
-
const isAnimated = (0,
|
|
13029
|
+
const isAnimated = (0, import_react47.useMemo)(
|
|
13018
13030
|
() => isAnimatedOverwrite ?? config.tooltip.isAnimated,
|
|
13019
13031
|
[isAnimatedOverwrite, config.tooltip.isAnimated]
|
|
13020
13032
|
);
|
|
13021
|
-
const container = (0,
|
|
13022
|
-
(0,
|
|
13033
|
+
const container = (0, import_react47.useRef)(null);
|
|
13034
|
+
(0, import_react45.useImperativeHandle)(forwardRef36, () => container.current);
|
|
13023
13035
|
const isActive = !disabled && isShown;
|
|
13024
13036
|
const { isVisible, transitionState } = useTransitionState(
|
|
13025
|
-
(0,
|
|
13037
|
+
(0, import_react47.useMemo)(() => ({ isOpen: isShown, ref: container }), [isShown])
|
|
13026
13038
|
);
|
|
13027
|
-
const verticalAlignment = (0,
|
|
13039
|
+
const verticalAlignment = (0, import_react47.useMemo)(
|
|
13028
13040
|
() => alignment === "top" ? "beforeStart" : alignment === "bottom" ? "afterEnd" : "center",
|
|
13029
13041
|
[alignment]
|
|
13030
13042
|
);
|
|
13031
|
-
const horizontalAlignment = (0,
|
|
13043
|
+
const horizontalAlignment = (0, import_react47.useMemo)(
|
|
13032
13044
|
() => alignment === "left" ? "beforeStart" : alignment === "right" ? "afterEnd" : "center",
|
|
13033
13045
|
[alignment]
|
|
13034
13046
|
);
|
|
@@ -13116,7 +13128,7 @@ var Tooltip = ({
|
|
|
13116
13128
|
|
|
13117
13129
|
// src/components/user-interaction/IconButton.tsx
|
|
13118
13130
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
13119
|
-
var IconButtonBase = (0,
|
|
13131
|
+
var IconButtonBase = (0, import_react49.forwardRef)(function IconButtonBase2({
|
|
13120
13132
|
children,
|
|
13121
13133
|
size = "md",
|
|
13122
13134
|
color = "primary",
|
|
@@ -13143,14 +13155,14 @@ var IconButtonBase = (0, import_react50.forwardRef)(function IconButtonBase2({
|
|
|
13143
13155
|
}
|
|
13144
13156
|
);
|
|
13145
13157
|
});
|
|
13146
|
-
var IconButtonTooltipTrigger = (0,
|
|
13158
|
+
var IconButtonTooltipTrigger = (0, import_react49.forwardRef)(function IconButtonTooltipTrigger2({
|
|
13147
13159
|
disabled,
|
|
13148
13160
|
...props
|
|
13149
13161
|
}, ref) {
|
|
13150
13162
|
const { trigger: { ref: triggerRef, props: tooltipTriggerProps } } = useTooltip();
|
|
13151
|
-
const innerRef = (0,
|
|
13152
|
-
(0,
|
|
13153
|
-
(0,
|
|
13163
|
+
const innerRef = (0, import_react49.useRef)(null);
|
|
13164
|
+
(0, import_react49.useImperativeHandle)(ref, () => innerRef.current);
|
|
13165
|
+
(0, import_react49.useImperativeHandle)(triggerRef, () => innerRef.current);
|
|
13154
13166
|
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
13155
13167
|
IconButtonBase,
|
|
13156
13168
|
{
|
|
@@ -13199,7 +13211,7 @@ var IconButtonTooltipTrigger = (0, import_react50.forwardRef)(function IconButto
|
|
|
13199
13211
|
}
|
|
13200
13212
|
);
|
|
13201
13213
|
});
|
|
13202
|
-
var IconButton = (0,
|
|
13214
|
+
var IconButton = (0, import_react49.forwardRef)(function IconButton2({
|
|
13203
13215
|
tooltip,
|
|
13204
13216
|
tooltipProps,
|
|
13205
13217
|
"aria-label": ariaLabel,
|
|
@@ -13235,9 +13247,9 @@ var IconButton = (0, import_react50.forwardRef)(function IconButton2({
|
|
|
13235
13247
|
|
|
13236
13248
|
// src/components/layout/Carousel.tsx
|
|
13237
13249
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
13238
|
-
var CarouselContext = (0,
|
|
13250
|
+
var CarouselContext = (0, import_react50.createContext)(null);
|
|
13239
13251
|
var useCarouselContext = () => {
|
|
13240
|
-
const context = (0,
|
|
13252
|
+
const context = (0, import_react50.useContext)(CarouselContext);
|
|
13241
13253
|
if (!context) {
|
|
13242
13254
|
console.error("useCarouselContext must be used within CarouselContext");
|
|
13243
13255
|
}
|
|
@@ -13248,7 +13260,7 @@ function CarouselTabs({
|
|
|
13248
13260
|
}) {
|
|
13249
13261
|
const translation = useHightideTranslation();
|
|
13250
13262
|
const { id, slideCount, currentIndex, isLooping } = useCarouselContext();
|
|
13251
|
-
const tabRefs = (0,
|
|
13263
|
+
const tabRefs = (0, import_react50.useRef)([]);
|
|
13252
13264
|
const handleKeyDown = (event, index) => {
|
|
13253
13265
|
let newIndex = index;
|
|
13254
13266
|
if (event.key === "ArrowRight") {
|
|
@@ -13301,7 +13313,7 @@ function CarouselTabs({
|
|
|
13301
13313
|
}
|
|
13302
13314
|
);
|
|
13303
13315
|
}
|
|
13304
|
-
var CarouselSlide = (0,
|
|
13316
|
+
var CarouselSlide = (0, import_react50.forwardRef)(
|
|
13305
13317
|
function CarouselSlide2({
|
|
13306
13318
|
index,
|
|
13307
13319
|
isSelected,
|
|
@@ -13347,17 +13359,17 @@ var Carousel = ({
|
|
|
13347
13359
|
}) => {
|
|
13348
13360
|
const translation = useHightideTranslation();
|
|
13349
13361
|
const onSlideChangedStable = useEventCallbackStabilizer(onSlideChanged);
|
|
13350
|
-
const slideRefs = (0,
|
|
13351
|
-
const [currentIndex, setCurrentIndex] = (0,
|
|
13352
|
-
const [hasFocus, setHasFocus] = (0,
|
|
13353
|
-
const [dragState, setDragState] = (0,
|
|
13362
|
+
const slideRefs = (0, import_react50.useRef)([]);
|
|
13363
|
+
const [currentIndex, setCurrentIndex] = (0, import_react50.useState)(0);
|
|
13364
|
+
const [hasFocus, setHasFocus] = (0, import_react50.useState)(false);
|
|
13365
|
+
const [dragState, setDragState] = (0, import_react50.useState)();
|
|
13354
13366
|
const isPaused = hasFocus;
|
|
13355
|
-
const carouselContainerRef = (0,
|
|
13356
|
-
const [disableClick, setDisableClick] = (0,
|
|
13357
|
-
const timeOut = (0,
|
|
13358
|
-
const length = (0,
|
|
13367
|
+
const carouselContainerRef = (0, import_react50.useRef)(null);
|
|
13368
|
+
const [disableClick, setDisableClick] = (0, import_react50.useState)(false);
|
|
13369
|
+
const timeOut = (0, import_react50.useRef)(void 0);
|
|
13370
|
+
const length = (0, import_react50.useMemo)(() => children.length, [children]);
|
|
13359
13371
|
const paddingItemCount = 3;
|
|
13360
|
-
const generatedId = "carousel" + (0,
|
|
13372
|
+
const generatedId = "carousel" + (0, import_react50.useId)();
|
|
13361
13373
|
const id = props.id ?? generatedId;
|
|
13362
13374
|
if (isAutoPlaying && !isLooping) {
|
|
13363
13375
|
console.error("When isAutoLooping is true, isLooping should also be true");
|
|
@@ -13366,7 +13378,7 @@ var Carousel = ({
|
|
|
13366
13378
|
autoLoopingTimeOut = Math.max(0, autoLoopingTimeOut);
|
|
13367
13379
|
animationTime = Math.max(100, animationTime);
|
|
13368
13380
|
autoLoopAnimationTime = Math.max(200, autoLoopAnimationTime);
|
|
13369
|
-
(0,
|
|
13381
|
+
(0, import_react50.useEffect)(() => {
|
|
13370
13382
|
const carousel = carouselContainerRef.current;
|
|
13371
13383
|
if (carousel) {
|
|
13372
13384
|
let onFocus = function() {
|
|
@@ -13389,7 +13401,7 @@ var Carousel = ({
|
|
|
13389
13401
|
const canGoLeft = () => {
|
|
13390
13402
|
return isLooping || currentIndex !== 0;
|
|
13391
13403
|
};
|
|
13392
|
-
const canGoRight = (0,
|
|
13404
|
+
const canGoRight = (0, import_react50.useCallback)(() => {
|
|
13393
13405
|
return isLooping || currentIndex !== length - 1;
|
|
13394
13406
|
}, [currentIndex, isLooping, length]);
|
|
13395
13407
|
const left = () => {
|
|
@@ -13397,12 +13409,12 @@ var Carousel = ({
|
|
|
13397
13409
|
setCurrentIndex((currentIndex + length - 1) % length);
|
|
13398
13410
|
}
|
|
13399
13411
|
};
|
|
13400
|
-
const right = (0,
|
|
13412
|
+
const right = (0, import_react50.useCallback)(() => {
|
|
13401
13413
|
if (canGoRight()) {
|
|
13402
13414
|
setCurrentIndex((currentIndex + length + 1) % length);
|
|
13403
13415
|
}
|
|
13404
13416
|
}, [canGoRight, currentIndex, length]);
|
|
13405
|
-
(0,
|
|
13417
|
+
(0, import_react50.useEffect)(() => {
|
|
13406
13418
|
if (!timeOut.current && !isPaused) {
|
|
13407
13419
|
if (autoLoopingTimeOut > 0) {
|
|
13408
13420
|
timeOut.current = setTimeout(() => {
|
|
@@ -13454,10 +13466,10 @@ var Carousel = ({
|
|
|
13454
13466
|
}
|
|
13455
13467
|
setDragState(void 0);
|
|
13456
13468
|
};
|
|
13457
|
-
(0,
|
|
13469
|
+
(0, import_react50.useEffect)(() => {
|
|
13458
13470
|
setDisableClick(!dragState);
|
|
13459
13471
|
}, [dragState]);
|
|
13460
|
-
(0,
|
|
13472
|
+
(0, import_react50.useEffect)(() => {
|
|
13461
13473
|
onSlideChangedStable(currentIndex);
|
|
13462
13474
|
}, [currentIndex, onSlideChangedStable]);
|
|
13463
13475
|
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CarouselContext.Provider, { value: { id, currentIndex, slideCount: length, isLooping }, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
|
|
@@ -13593,20 +13605,20 @@ var DividerInserter = ({
|
|
|
13593
13605
|
};
|
|
13594
13606
|
|
|
13595
13607
|
// src/components/layout/Expandable.tsx
|
|
13608
|
+
var import_react51 = require("react");
|
|
13596
13609
|
var import_react52 = require("react");
|
|
13597
13610
|
var import_react53 = require("react");
|
|
13598
|
-
var import_react54 = require("react");
|
|
13599
13611
|
var import_clsx11 = __toESM(require("clsx"));
|
|
13600
13612
|
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
13601
|
-
var ExpandableContext = (0,
|
|
13613
|
+
var ExpandableContext = (0, import_react53.createContext)(null);
|
|
13602
13614
|
function useExpandableContext() {
|
|
13603
|
-
const context = (0,
|
|
13615
|
+
const context = (0, import_react53.useContext)(ExpandableContext);
|
|
13604
13616
|
if (!context) {
|
|
13605
13617
|
throw new Error("Expandable components must be used within an ExpandableRoot");
|
|
13606
13618
|
}
|
|
13607
13619
|
return context;
|
|
13608
13620
|
}
|
|
13609
|
-
var ExpandableRoot = (0,
|
|
13621
|
+
var ExpandableRoot = (0, import_react53.forwardRef)(function ExpandableRoot2({
|
|
13610
13622
|
children,
|
|
13611
13623
|
id: providedId,
|
|
13612
13624
|
isExpanded: controlledExpanded,
|
|
@@ -13616,8 +13628,8 @@ var ExpandableRoot = (0, import_react54.forwardRef)(function ExpandableRoot2({
|
|
|
13616
13628
|
allowContainerToggle = false,
|
|
13617
13629
|
...props
|
|
13618
13630
|
}, ref) {
|
|
13619
|
-
const generatedId = (0,
|
|
13620
|
-
const [ids, setIds] = (0,
|
|
13631
|
+
const generatedId = (0, import_react53.useId)();
|
|
13632
|
+
const [ids, setIds] = (0, import_react52.useState)({
|
|
13621
13633
|
root: providedId ?? `expandable-${generatedId}-root`,
|
|
13622
13634
|
header: `expandable-${generatedId}-header`,
|
|
13623
13635
|
content: `expandable-${generatedId}-content`
|
|
@@ -13627,12 +13639,12 @@ var ExpandableRoot = (0, import_react54.forwardRef)(function ExpandableRoot2({
|
|
|
13627
13639
|
onValueChange: onExpandedChange,
|
|
13628
13640
|
defaultValue: isInitialExpanded
|
|
13629
13641
|
});
|
|
13630
|
-
const toggle = (0,
|
|
13642
|
+
const toggle = (0, import_react53.useCallback)(() => {
|
|
13631
13643
|
if (!disabled) {
|
|
13632
13644
|
setIsExpanded(!isExpanded);
|
|
13633
13645
|
}
|
|
13634
13646
|
}, [disabled, isExpanded, setIsExpanded]);
|
|
13635
|
-
const contextValue = (0,
|
|
13647
|
+
const contextValue = (0, import_react53.useMemo)(() => ({
|
|
13636
13648
|
isExpanded,
|
|
13637
13649
|
toggle,
|
|
13638
13650
|
setIsExpanded,
|
|
@@ -13660,13 +13672,13 @@ var ExpandableRoot = (0, import_react54.forwardRef)(function ExpandableRoot2({
|
|
|
13660
13672
|
}
|
|
13661
13673
|
) });
|
|
13662
13674
|
});
|
|
13663
|
-
var ExpandableHeader = (0,
|
|
13675
|
+
var ExpandableHeader = (0, import_react53.forwardRef)(function ExpandableHeader2({
|
|
13664
13676
|
children,
|
|
13665
13677
|
isUsingDefaultIcon = true,
|
|
13666
13678
|
...props
|
|
13667
13679
|
}, ref) {
|
|
13668
13680
|
const { isExpanded, toggle, ids, setIds, disabled } = useExpandableContext();
|
|
13669
|
-
(0,
|
|
13681
|
+
(0, import_react51.useEffect)(() => {
|
|
13670
13682
|
if (props.id) {
|
|
13671
13683
|
setIds((prevState) => ({ ...prevState, header: props.id }));
|
|
13672
13684
|
}
|
|
@@ -13695,15 +13707,15 @@ var ExpandableHeader = (0, import_react54.forwardRef)(function ExpandableHeader2
|
|
|
13695
13707
|
}
|
|
13696
13708
|
);
|
|
13697
13709
|
});
|
|
13698
|
-
var ExpandableContent = (0,
|
|
13710
|
+
var ExpandableContent = (0, import_react53.forwardRef)(function ExpandableContent2({
|
|
13699
13711
|
children,
|
|
13700
13712
|
forceMount = false,
|
|
13701
13713
|
...props
|
|
13702
13714
|
}, forwardedRef) {
|
|
13703
13715
|
const { isExpanded, ids, setIds } = useExpandableContext();
|
|
13704
|
-
const ref = (0,
|
|
13705
|
-
(0,
|
|
13706
|
-
(0,
|
|
13716
|
+
const ref = (0, import_react51.useRef)(null);
|
|
13717
|
+
(0, import_react51.useImperativeHandle)(forwardedRef, () => ref.current, [ref]);
|
|
13718
|
+
(0, import_react51.useEffect)(() => {
|
|
13707
13719
|
if (props.id) {
|
|
13708
13720
|
setIds((prevState) => ({ ...prevState, content: props.id }));
|
|
13709
13721
|
}
|
|
@@ -13722,7 +13734,7 @@ var ExpandableContent = (0, import_react54.forwardRef)(function ExpandableConten
|
|
|
13722
13734
|
}
|
|
13723
13735
|
);
|
|
13724
13736
|
});
|
|
13725
|
-
var Expandable = (0,
|
|
13737
|
+
var Expandable = (0, import_react53.forwardRef)(function Expandable2({
|
|
13726
13738
|
children,
|
|
13727
13739
|
trigger,
|
|
13728
13740
|
triggerProps,
|
|
@@ -13761,7 +13773,7 @@ var FAQSection = ({
|
|
|
13761
13773
|
};
|
|
13762
13774
|
|
|
13763
13775
|
// src/components/layout/InifiniteScroll.tsx
|
|
13764
|
-
var
|
|
13776
|
+
var import_react54 = require("react");
|
|
13765
13777
|
var import_clsx12 = __toESM(require("clsx"));
|
|
13766
13778
|
var import_lucide_react8 = require("lucide-react");
|
|
13767
13779
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
@@ -13781,10 +13793,10 @@ function InfiniteScroll({
|
|
|
13781
13793
|
if (itemCount < 1) {
|
|
13782
13794
|
throw new Error("InfiniteScroll: itemCount > 0 must hold");
|
|
13783
13795
|
}
|
|
13784
|
-
const items = (0,
|
|
13785
|
-
const containerRef = (0,
|
|
13786
|
-
const snapshotRef = (0,
|
|
13787
|
-
const [windowState, setWindowState] = (0,
|
|
13796
|
+
const items = (0, import_react54.useMemo)(() => range(itemCount), [itemCount]);
|
|
13797
|
+
const containerRef = (0, import_react54.useRef)(null);
|
|
13798
|
+
const snapshotRef = (0, import_react54.useRef)({ scrollHeight: 0, scrollTop: 0, fromTop: false });
|
|
13799
|
+
const [windowState, setWindowState] = (0, import_react54.useState)(() => {
|
|
13788
13800
|
let index = initialIndex;
|
|
13789
13801
|
if (index < 0) {
|
|
13790
13802
|
index = 0;
|
|
@@ -13796,14 +13808,14 @@ function InfiniteScroll({
|
|
|
13796
13808
|
end: Math.min(items.length, safeStart + bufferSize)
|
|
13797
13809
|
};
|
|
13798
13810
|
});
|
|
13799
|
-
const addToStart = (0,
|
|
13811
|
+
const addToStart = (0, import_react54.useCallback)((amount = stepSize) => {
|
|
13800
13812
|
setWindowState((prev) => {
|
|
13801
13813
|
const newStart = Math.max(0, prev.start - amount);
|
|
13802
13814
|
const newEnd = Math.min(items.length, newStart + bufferSize);
|
|
13803
13815
|
return { start: newStart, end: newEnd };
|
|
13804
13816
|
});
|
|
13805
13817
|
}, [bufferSize, items.length, stepSize]);
|
|
13806
|
-
const addToEnd = (0,
|
|
13818
|
+
const addToEnd = (0, import_react54.useCallback)((amount = stepSize) => {
|
|
13807
13819
|
setWindowState((prev) => {
|
|
13808
13820
|
const newEnd = Math.min(items.length, prev.end + amount);
|
|
13809
13821
|
const newStart = Math.max(0, newEnd - bufferSize);
|
|
@@ -13820,7 +13832,7 @@ function InfiniteScroll({
|
|
|
13820
13832
|
addToEnd();
|
|
13821
13833
|
}
|
|
13822
13834
|
};
|
|
13823
|
-
(0,
|
|
13835
|
+
(0, import_react54.useLayoutEffect)(() => {
|
|
13824
13836
|
const container = containerRef.current;
|
|
13825
13837
|
if (!container || !snapshotRef.current.fromTop) return;
|
|
13826
13838
|
const heightDifference = container.scrollHeight - snapshotRef.current.scrollHeight;
|
|
@@ -13829,7 +13841,7 @@ function InfiniteScroll({
|
|
|
13829
13841
|
}
|
|
13830
13842
|
snapshotRef.current.fromTop = false;
|
|
13831
13843
|
}, [windowState]);
|
|
13832
|
-
const visibleItems = (0,
|
|
13844
|
+
const visibleItems = (0, import_react54.useMemo)(
|
|
13833
13845
|
() => items.slice(windowState.start, windowState.end),
|
|
13834
13846
|
[items, windowState]
|
|
13835
13847
|
);
|
|
@@ -14082,8 +14094,8 @@ var MarkdownInterpreter = ({ text, className }) => {
|
|
|
14082
14094
|
};
|
|
14083
14095
|
|
|
14084
14096
|
// src/components/layout/TabSwitcher.tsx
|
|
14097
|
+
var import_react55 = require("react");
|
|
14085
14098
|
var import_react56 = require("react");
|
|
14086
|
-
var import_react57 = require("react");
|
|
14087
14099
|
var import_clsx13 = __toESM(require("clsx"));
|
|
14088
14100
|
var import_react_dom2 = require("react-dom");
|
|
14089
14101
|
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
@@ -14097,9 +14109,9 @@ function sortByDomOrder(infos) {
|
|
|
14097
14109
|
return elA.compareDocumentPosition(elB) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
|
|
14098
14110
|
});
|
|
14099
14111
|
}
|
|
14100
|
-
var TabContext = (0,
|
|
14112
|
+
var TabContext = (0, import_react56.createContext)(null);
|
|
14101
14113
|
function useTabContext() {
|
|
14102
|
-
const context = (0,
|
|
14114
|
+
const context = (0, import_react56.useContext)(TabContext);
|
|
14103
14115
|
if (!context) throw new Error("useTabContext must be used inside a <TabView>");
|
|
14104
14116
|
return context;
|
|
14105
14117
|
}
|
|
@@ -14109,9 +14121,9 @@ function TabSwitcher({ children, activeId: controlledActiveId, onActiveIdChange,
|
|
|
14109
14121
|
defaultValue: initialActiveId ?? null,
|
|
14110
14122
|
onValueChange: onActiveIdChange
|
|
14111
14123
|
});
|
|
14112
|
-
const [tabInfos, setTabInfos] = (0,
|
|
14113
|
-
const [portalState, setPortalState] = (0,
|
|
14114
|
-
const subscribe = (0,
|
|
14124
|
+
const [tabInfos, setTabInfos] = (0, import_react55.useState)([]);
|
|
14125
|
+
const [portalState, setPortalState] = (0, import_react55.useState)(null);
|
|
14126
|
+
const subscribe = (0, import_react55.useCallback)((info) => {
|
|
14115
14127
|
const id = info.id;
|
|
14116
14128
|
setTabInfos((prevState) => {
|
|
14117
14129
|
const existingIndex = prevState.findIndex((t) => t.id === id);
|
|
@@ -14124,7 +14136,7 @@ function TabSwitcher({ children, activeId: controlledActiveId, onActiveIdChange,
|
|
|
14124
14136
|
});
|
|
14125
14137
|
};
|
|
14126
14138
|
}, []);
|
|
14127
|
-
(0,
|
|
14139
|
+
(0, import_react56.useEffect)(() => {
|
|
14128
14140
|
const active = tabInfos.find((value) => value.id === activeId);
|
|
14129
14141
|
if (!active || !active.disabled) return;
|
|
14130
14142
|
const firstEnabled = tabInfos.find((value) => !value.disabled);
|
|
@@ -14134,10 +14146,10 @@ function TabSwitcher({ children, activeId: controlledActiveId, onActiveIdChange,
|
|
|
14134
14146
|
setActiveId(null);
|
|
14135
14147
|
}
|
|
14136
14148
|
}, [activeId, setActiveId, tabInfos]);
|
|
14137
|
-
const registerPortal = (0,
|
|
14149
|
+
const registerPortal = (0, import_react55.useCallback)((state) => {
|
|
14138
14150
|
setPortalState(state);
|
|
14139
14151
|
}, []);
|
|
14140
|
-
const changeActiveId = (0,
|
|
14152
|
+
const changeActiveId = (0, import_react55.useCallback)((activeId2) => {
|
|
14141
14153
|
const info = tabInfos.find((value) => value.id === activeId2);
|
|
14142
14154
|
if (info && info.disabled) return;
|
|
14143
14155
|
setActiveId(activeId2);
|
|
@@ -14172,7 +14184,7 @@ function TabSwitcher({ children, activeId: controlledActiveId, onActiveIdChange,
|
|
|
14172
14184
|
function TabList({ ...props }) {
|
|
14173
14185
|
const { tabs } = useTabContext();
|
|
14174
14186
|
const { infos, activeId, setActiveId: setActive } = tabs;
|
|
14175
|
-
const refs = (0,
|
|
14187
|
+
const refs = (0, import_react56.useRef)({});
|
|
14176
14188
|
const onKeyDown = (e) => {
|
|
14177
14189
|
const idx = infos.findIndex((tab) => tab.id === activeId);
|
|
14178
14190
|
if (idx === -1) return;
|
|
@@ -14225,12 +14237,12 @@ function TabList({ ...props }) {
|
|
|
14225
14237
|
);
|
|
14226
14238
|
}
|
|
14227
14239
|
function TabView({ ...props }) {
|
|
14228
|
-
const generated = (0,
|
|
14240
|
+
const generated = (0, import_react55.useId)();
|
|
14229
14241
|
const id = props.id ?? "tab-view-" + generated;
|
|
14230
14242
|
const { portal } = useTabContext();
|
|
14231
14243
|
const { setPortal } = portal;
|
|
14232
|
-
const ref = (0,
|
|
14233
|
-
(0,
|
|
14244
|
+
const ref = (0, import_react56.useRef)(null);
|
|
14245
|
+
(0, import_react56.useEffect)(() => {
|
|
14234
14246
|
setPortal({ id, ref });
|
|
14235
14247
|
return () => setPortal(null);
|
|
14236
14248
|
}, [id, setPortal]);
|
|
@@ -14247,15 +14259,15 @@ function TabView({ ...props }) {
|
|
|
14247
14259
|
function TabPanel({ label, forceMount = false, disabled = false, initiallyActive = false, ...props }) {
|
|
14248
14260
|
const { tabs, portal } = useTabContext();
|
|
14249
14261
|
const { subscribe, activeId, setActiveId } = tabs;
|
|
14250
|
-
const generatedId = (0,
|
|
14262
|
+
const generatedId = (0, import_react55.useId)();
|
|
14251
14263
|
const id = props.id ?? "tab-panel-" + generatedId;
|
|
14252
14264
|
const labelId = "tab-list-button-" + generatedId;
|
|
14253
|
-
const ref = (0,
|
|
14254
|
-
(0,
|
|
14265
|
+
const ref = (0, import_react56.useRef)(null);
|
|
14266
|
+
(0, import_react56.useEffect)(() => {
|
|
14255
14267
|
return subscribe({ id, label, labelId, disabled, ref });
|
|
14256
14268
|
}, [id, label, labelId, disabled, subscribe]);
|
|
14257
|
-
const [hasAnnouncedIntialliyActive, setHasAnnouncedIntialliyActive] = (0,
|
|
14258
|
-
(0,
|
|
14269
|
+
const [hasAnnouncedIntialliyActive, setHasAnnouncedIntialliyActive] = (0, import_react55.useState)(false);
|
|
14270
|
+
(0, import_react56.useEffect)(() => {
|
|
14259
14271
|
if (!hasAnnouncedIntialliyActive) {
|
|
14260
14272
|
if (initiallyActive) {
|
|
14261
14273
|
setActiveId(id);
|
|
@@ -14397,14 +14409,14 @@ var VerticalDivider = ({
|
|
|
14397
14409
|
|
|
14398
14410
|
// src/components/layout/app/AppPage.tsx
|
|
14399
14411
|
var import_clsx15 = __toESM(require("clsx"));
|
|
14400
|
-
var
|
|
14412
|
+
var import_react60 = require("react");
|
|
14401
14413
|
var import_lucide_react10 = require("lucide-react");
|
|
14402
14414
|
|
|
14403
14415
|
// src/components/layout/navigation/navigation-menus/NavigationContext.tsx
|
|
14404
|
-
var
|
|
14416
|
+
var import_react58 = require("react");
|
|
14405
14417
|
|
|
14406
14418
|
// src/hooks/useTreeNavigation.ts
|
|
14407
|
-
var
|
|
14419
|
+
var import_react57 = require("react");
|
|
14408
14420
|
function buildTreeIndex(nodes) {
|
|
14409
14421
|
const byId = /* @__PURE__ */ new Map();
|
|
14410
14422
|
const walk = (nodeList, parentId, parentPath) => {
|
|
@@ -14488,32 +14500,32 @@ function useTreeNavigation({
|
|
|
14488
14500
|
initialActiveId,
|
|
14489
14501
|
onlyOneExpandedTree = false
|
|
14490
14502
|
}) {
|
|
14491
|
-
const index = (0,
|
|
14503
|
+
const index = (0, import_react57.useMemo)(() => buildTreeIndex(nodes), [nodes]);
|
|
14492
14504
|
const [activeId, setActiveId] = useControlledState({
|
|
14493
14505
|
value: controlledActiveId,
|
|
14494
14506
|
onValueChange: onActiveIdChange,
|
|
14495
14507
|
defaultValue: initialActiveId ?? null
|
|
14496
14508
|
});
|
|
14497
|
-
const resolvedActiveId = (0,
|
|
14509
|
+
const resolvedActiveId = (0, import_react57.useMemo)(() => {
|
|
14498
14510
|
if (activeId == null) return null;
|
|
14499
14511
|
if (index.byId.has(activeId)) return activeId;
|
|
14500
14512
|
return null;
|
|
14501
14513
|
}, [activeId, index]);
|
|
14502
|
-
const [expandedIds, setExpandedIds] = (0,
|
|
14503
|
-
(0,
|
|
14514
|
+
const [expandedIds, setExpandedIds] = (0, import_react57.useState)(() => /* @__PURE__ */ new Set());
|
|
14515
|
+
(0, import_react57.useEffect)(() => {
|
|
14504
14516
|
if (resolvedActiveId == null) return;
|
|
14505
14517
|
const entry = index.byId.get(resolvedActiveId);
|
|
14506
14518
|
if (entry == null) return;
|
|
14507
14519
|
setExpandedIds((prev) => syncExpansionForActive(prev, entry.path, onlyOneExpandedTree, index));
|
|
14508
14520
|
}, [resolvedActiveId, onlyOneExpandedTree, index]);
|
|
14509
|
-
const items = (0,
|
|
14521
|
+
const items = (0, import_react57.useMemo)(() => {
|
|
14510
14522
|
return flattenVisibleItems(nodes, expandedIds);
|
|
14511
14523
|
}, [nodes, expandedIds]);
|
|
14512
|
-
const activeItem = (0,
|
|
14524
|
+
const activeItem = (0, import_react57.useMemo)(() => {
|
|
14513
14525
|
if (resolvedActiveId == null) return null;
|
|
14514
14526
|
return items.find((item) => item.id === resolvedActiveId) ?? null;
|
|
14515
14527
|
}, [items, resolvedActiveId]);
|
|
14516
|
-
const navigateTo = (0,
|
|
14528
|
+
const navigateTo = (0, import_react57.useCallback)((id) => {
|
|
14517
14529
|
const entry = index.byId.get(id);
|
|
14518
14530
|
if (entry == null) {
|
|
14519
14531
|
console.warn(`Attempted to navigate to node ${id} that does not exist`);
|
|
@@ -14525,7 +14537,7 @@ function useTreeNavigation({
|
|
|
14525
14537
|
return next2;
|
|
14526
14538
|
});
|
|
14527
14539
|
}, [index, onlyOneExpandedTree, setActiveId]);
|
|
14528
|
-
const expand = (0,
|
|
14540
|
+
const expand = (0, import_react57.useCallback)((id, options) => {
|
|
14529
14541
|
const entry = index.byId.get(id);
|
|
14530
14542
|
if (entry == null || entry.node.items.length === 0) return;
|
|
14531
14543
|
if (options?.isFocusing) {
|
|
@@ -14538,7 +14550,7 @@ function useTreeNavigation({
|
|
|
14538
14550
|
return pruneExpandedIds(next2, activePath, onlyOneExpandedTree, index);
|
|
14539
14551
|
});
|
|
14540
14552
|
}, [index, onlyOneExpandedTree, resolvedActiveId, setActiveId]);
|
|
14541
|
-
const collapse = (0,
|
|
14553
|
+
const collapse = (0, import_react57.useCallback)((id, options) => {
|
|
14542
14554
|
if (!options?.isFocusing && resolvedActiveId != null) {
|
|
14543
14555
|
const activeEntry = index.byId.get(resolvedActiveId);
|
|
14544
14556
|
if (activeEntry != null && isAncestorOf(id, activeEntry.path)) return;
|
|
@@ -14556,7 +14568,7 @@ function useTreeNavigation({
|
|
|
14556
14568
|
return next2;
|
|
14557
14569
|
});
|
|
14558
14570
|
}, [index, resolvedActiveId, setActiveId]);
|
|
14559
|
-
const toggleExpansion = (0,
|
|
14571
|
+
const toggleExpansion = (0, import_react57.useCallback)((id, options) => {
|
|
14560
14572
|
const entry = index.byId.get(id);
|
|
14561
14573
|
if (entry == null || entry.node.items.length === 0) return;
|
|
14562
14574
|
if (options?.isFocusing) {
|
|
@@ -14586,7 +14598,7 @@ function useTreeNavigation({
|
|
|
14586
14598
|
expand(id);
|
|
14587
14599
|
}
|
|
14588
14600
|
}, [index, expandedIds, expand, collapse, onlyOneExpandedTree, setActiveId]);
|
|
14589
|
-
const next = (0,
|
|
14601
|
+
const next = (0, import_react57.useCallback)(() => {
|
|
14590
14602
|
if (items.length === 0) return;
|
|
14591
14603
|
if (resolvedActiveId == null) {
|
|
14592
14604
|
navigateTo(items[0].id);
|
|
@@ -14599,7 +14611,7 @@ function useTreeNavigation({
|
|
|
14599
14611
|
return;
|
|
14600
14612
|
}
|
|
14601
14613
|
}, [items, resolvedActiveId, navigateTo]);
|
|
14602
|
-
const previous = (0,
|
|
14614
|
+
const previous = (0, import_react57.useCallback)(() => {
|
|
14603
14615
|
if (items.length === 0) return;
|
|
14604
14616
|
if (resolvedActiveId == null) {
|
|
14605
14617
|
navigateTo(items[items.length - 1].id);
|
|
@@ -14612,15 +14624,15 @@ function useTreeNavigation({
|
|
|
14612
14624
|
return;
|
|
14613
14625
|
}
|
|
14614
14626
|
}, [items, resolvedActiveId, navigateTo]);
|
|
14615
|
-
const first = (0,
|
|
14627
|
+
const first = (0, import_react57.useCallback)(() => {
|
|
14616
14628
|
if (items.length === 0) return;
|
|
14617
14629
|
navigateTo(items[0].id);
|
|
14618
14630
|
}, [items, navigateTo]);
|
|
14619
|
-
const last = (0,
|
|
14631
|
+
const last = (0, import_react57.useCallback)(() => {
|
|
14620
14632
|
if (items.length === 0) return;
|
|
14621
14633
|
navigateTo(items[items.length - 1].id);
|
|
14622
14634
|
}, [items, navigateTo]);
|
|
14623
|
-
return (0,
|
|
14635
|
+
return (0, import_react57.useMemo)(() => ({
|
|
14624
14636
|
items,
|
|
14625
14637
|
activeItem,
|
|
14626
14638
|
navigateTo,
|
|
@@ -14636,15 +14648,15 @@ function useTreeNavigation({
|
|
|
14636
14648
|
|
|
14637
14649
|
// src/components/layout/navigation/navigation-menus/NavigationContext.tsx
|
|
14638
14650
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
14639
|
-
var NavigationContext = (0,
|
|
14651
|
+
var NavigationContext = (0, import_react58.createContext)(null);
|
|
14640
14652
|
function NavigationProvider({
|
|
14641
14653
|
children,
|
|
14642
14654
|
...options
|
|
14643
14655
|
}) {
|
|
14644
14656
|
const navigation = useTreeNavigation(options);
|
|
14645
|
-
const itemRefs = (0,
|
|
14657
|
+
const itemRefs = (0, import_react58.useRef)(/* @__PURE__ */ new Map());
|
|
14646
14658
|
const focusedId = navigation.activeItem?.id ?? navigation.items[0]?.id ?? null;
|
|
14647
|
-
const itemStateById = (0,
|
|
14659
|
+
const itemStateById = (0, import_react58.useMemo)(() => {
|
|
14648
14660
|
const map = /* @__PURE__ */ new Map();
|
|
14649
14661
|
for (const item of navigation.items) {
|
|
14650
14662
|
map.set(item.id, {
|
|
@@ -14655,21 +14667,21 @@ function NavigationProvider({
|
|
|
14655
14667
|
}
|
|
14656
14668
|
return map;
|
|
14657
14669
|
}, [navigation.items, focusedId]);
|
|
14658
|
-
const getItemState = (0,
|
|
14670
|
+
const getItemState = (0, import_react58.useCallback)((id) => {
|
|
14659
14671
|
return itemStateById.get(id) ?? null;
|
|
14660
14672
|
}, [itemStateById]);
|
|
14661
|
-
const registerItemRef = (0,
|
|
14673
|
+
const registerItemRef = (0, import_react58.useCallback)((id, element) => {
|
|
14662
14674
|
if (element == null) {
|
|
14663
14675
|
itemRefs.current.delete(id);
|
|
14664
14676
|
return;
|
|
14665
14677
|
}
|
|
14666
14678
|
itemRefs.current.set(id, element);
|
|
14667
14679
|
}, []);
|
|
14668
|
-
(0,
|
|
14680
|
+
(0, import_react58.useEffect)(() => {
|
|
14669
14681
|
if (focusedId == null) return;
|
|
14670
14682
|
itemRefs.current.get(focusedId)?.focus();
|
|
14671
14683
|
}, [focusedId]);
|
|
14672
|
-
const value = (0,
|
|
14684
|
+
const value = (0, import_react58.useMemo)(() => ({
|
|
14673
14685
|
activeItem: navigation.activeItem,
|
|
14674
14686
|
focusedId,
|
|
14675
14687
|
items: navigation.items,
|
|
@@ -14701,7 +14713,7 @@ function NavigationProvider({
|
|
|
14701
14713
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(NavigationContext.Provider, { value, children });
|
|
14702
14714
|
}
|
|
14703
14715
|
function useNavigationContext() {
|
|
14704
|
-
const context = (0,
|
|
14716
|
+
const context = (0, import_react58.useContext)(NavigationContext);
|
|
14705
14717
|
if (context == null) {
|
|
14706
14718
|
throw new Error("useNavigationContext must be used within NavigationProvider");
|
|
14707
14719
|
}
|
|
@@ -14713,10 +14725,10 @@ function useNavigationItem(id) {
|
|
|
14713
14725
|
if (state == null) {
|
|
14714
14726
|
throw new Error(`useNavigationItem could not resolve state for id "${id}"`);
|
|
14715
14727
|
}
|
|
14716
|
-
const ref = (0,
|
|
14728
|
+
const ref = (0, import_react58.useCallback)((element) => {
|
|
14717
14729
|
context.registerItemRef(id, element);
|
|
14718
14730
|
}, [context, id]);
|
|
14719
|
-
return (0,
|
|
14731
|
+
return (0, import_react58.useMemo)(() => ({
|
|
14720
14732
|
...state,
|
|
14721
14733
|
ref,
|
|
14722
14734
|
navigateTo: context.navigateTo,
|
|
@@ -14742,7 +14754,7 @@ function useNavigationItem(id) {
|
|
|
14742
14754
|
}
|
|
14743
14755
|
|
|
14744
14756
|
// src/components/layout/navigation/navigation-menus/VerticalNavigationItem.tsx
|
|
14745
|
-
var
|
|
14757
|
+
var import_react59 = require("react");
|
|
14746
14758
|
var import_lucide_react9 = require("lucide-react");
|
|
14747
14759
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
14748
14760
|
function VerticalNavigationItem({
|
|
@@ -14753,7 +14765,7 @@ function VerticalNavigationItem({
|
|
|
14753
14765
|
items,
|
|
14754
14766
|
depth = 0
|
|
14755
14767
|
}) {
|
|
14756
|
-
const headerRef = (0,
|
|
14768
|
+
const headerRef = (0, import_react59.useRef)(null);
|
|
14757
14769
|
const {
|
|
14758
14770
|
expanded,
|
|
14759
14771
|
isFocused,
|
|
@@ -14770,7 +14782,7 @@ function VerticalNavigationItem({
|
|
|
14770
14782
|
} = useNavigationItem(id);
|
|
14771
14783
|
const hasChildren = items != null && items.length > 0;
|
|
14772
14784
|
const firstChildId = hasChildren ? items[0]?.id : void 0;
|
|
14773
|
-
const handleKeyDown = (0,
|
|
14785
|
+
const handleKeyDown = (0, import_react59.useCallback)((event) => {
|
|
14774
14786
|
if (!isFocused || event.target !== event.currentTarget) return;
|
|
14775
14787
|
if (event.key === "ArrowRight") {
|
|
14776
14788
|
if (!hasChildren) return;
|
|
@@ -14824,10 +14836,10 @@ function VerticalNavigationItem({
|
|
|
14824
14836
|
window.location.assign(url);
|
|
14825
14837
|
}
|
|
14826
14838
|
}, [collapse, expand, expanded, external, first, firstChildId, hasChildren, id, isFocused, last, navigateTo, next, path, previous, toggleExpansion, url]);
|
|
14827
|
-
const handleHeaderActivate = (0,
|
|
14839
|
+
const handleHeaderActivate = (0, import_react59.useCallback)(() => {
|
|
14828
14840
|
toggleExpansion(id, { isFocusing: true });
|
|
14829
14841
|
}, [id, toggleExpansion]);
|
|
14830
|
-
const handleLeafActivate = (0,
|
|
14842
|
+
const handleLeafActivate = (0, import_react59.useCallback)((event) => {
|
|
14831
14843
|
if (event.target.closest('[data-name="vertical-navigation-item-link"]')) return;
|
|
14832
14844
|
navigateTo(id);
|
|
14833
14845
|
}, [id, navigateTo]);
|
|
@@ -14930,10 +14942,10 @@ function VerticalNavigationTree({
|
|
|
14930
14942
|
|
|
14931
14943
|
// src/components/layout/app/AppPage.tsx
|
|
14932
14944
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
14933
|
-
var AppSidebar = ({ isOpen, onClose, children, ...props }) => {
|
|
14945
|
+
var AppSidebar = ({ isOpen = false, onClose, children, ...props }) => {
|
|
14934
14946
|
const translation = useHightideTranslation();
|
|
14935
14947
|
const { zIndex } = useOverlayRegistry({ isActive: isOpen });
|
|
14936
|
-
const ref = (0,
|
|
14948
|
+
const ref = (0, import_react60.useRef)(null);
|
|
14937
14949
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
14938
14950
|
isOpen && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
14939
14951
|
"div",
|
|
@@ -15000,11 +15012,11 @@ var AppPageSidebarWithNavigation = ({
|
|
|
15000
15012
|
};
|
|
15001
15013
|
var AppPage = ({ children, headerActions, sidebarProps, ...props }) => {
|
|
15002
15014
|
const translation = useHightideTranslation();
|
|
15003
|
-
const [isSidebarOpen, setIsSidebarOpen] = (0,
|
|
15004
|
-
const toNavigationItems = (0,
|
|
15015
|
+
const [isSidebarOpen, setIsSidebarOpen] = (0, import_react60.useState)(false);
|
|
15016
|
+
const toNavigationItems = (0, import_react60.useCallback)((items) => {
|
|
15005
15017
|
return items?.map((item) => ({
|
|
15006
15018
|
id: item.id,
|
|
15007
|
-
label: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className:
|
|
15019
|
+
label: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { className: "app-page-navigation-item-label", "data-acitve": item.isActive ? "" : void 0, children: [
|
|
15008
15020
|
item.icon && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "size-5", children: item.icon }),
|
|
15009
15021
|
item.label
|
|
15010
15022
|
] }),
|
|
@@ -15013,7 +15025,7 @@ var AppPage = ({ children, headerActions, sidebarProps, ...props }) => {
|
|
|
15013
15025
|
items: toNavigationItems(item.items)
|
|
15014
15026
|
})) ?? void 0;
|
|
15015
15027
|
}, []);
|
|
15016
|
-
const navigationItems = (0,
|
|
15028
|
+
const navigationItems = (0, import_react60.useMemo)(() => toNavigationItems(
|
|
15017
15029
|
sidebarProps.items
|
|
15018
15030
|
), [sidebarProps.items, toNavigationItems]);
|
|
15019
15031
|
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
|
|
@@ -15059,14 +15071,14 @@ var AppPage = ({ children, headerActions, sidebarProps, ...props }) => {
|
|
|
15059
15071
|
};
|
|
15060
15072
|
|
|
15061
15073
|
// src/components/layout/dialog/Dialog.tsx
|
|
15062
|
-
var
|
|
15074
|
+
var import_react62 = require("react");
|
|
15063
15075
|
var import_lucide_react11 = require("lucide-react");
|
|
15064
15076
|
|
|
15065
15077
|
// src/components/layout/dialog/DialogContext.tsx
|
|
15066
|
-
var
|
|
15067
|
-
var DialogContext = (0,
|
|
15078
|
+
var import_react61 = require("react");
|
|
15079
|
+
var DialogContext = (0, import_react61.createContext)(null);
|
|
15068
15080
|
function useDialogContext() {
|
|
15069
|
-
const context = (0,
|
|
15081
|
+
const context = (0, import_react61.useContext)(DialogContext);
|
|
15070
15082
|
if (!context) {
|
|
15071
15083
|
throw new Error("useDialogContext must be used within a <DialogContext.Provider>");
|
|
15072
15084
|
}
|
|
@@ -15075,7 +15087,7 @@ function useDialogContext() {
|
|
|
15075
15087
|
|
|
15076
15088
|
// src/components/layout/dialog/Dialog.tsx
|
|
15077
15089
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
15078
|
-
var Dialog = (0,
|
|
15090
|
+
var Dialog = (0, import_react62.forwardRef)(function Dialog2({
|
|
15079
15091
|
children,
|
|
15080
15092
|
isOpen: isOpenOverwrite,
|
|
15081
15093
|
titleElement,
|
|
@@ -15088,24 +15100,24 @@ var Dialog = (0, import_react63.forwardRef)(function Dialog2({
|
|
|
15088
15100
|
...props
|
|
15089
15101
|
}, forwardedRef) {
|
|
15090
15102
|
const translation = useHightideTranslation();
|
|
15091
|
-
const generatedId = (0,
|
|
15092
|
-
const ids = (0,
|
|
15103
|
+
const generatedId = (0, import_react62.useId)();
|
|
15104
|
+
const ids = (0, import_react62.useMemo)(() => ({
|
|
15093
15105
|
container: `dialog-container-${generatedId}`,
|
|
15094
15106
|
background: `dialog-background-${generatedId}`,
|
|
15095
15107
|
content: props.id ?? `dialog-content-${generatedId}`,
|
|
15096
15108
|
title: `dialog-title-${generatedId}`,
|
|
15097
15109
|
description: `dialog-description-${generatedId}`
|
|
15098
15110
|
}), [generatedId, props.id]);
|
|
15099
|
-
const containerRef = (0,
|
|
15100
|
-
const context = (0,
|
|
15111
|
+
const containerRef = (0, import_react62.useRef)(null);
|
|
15112
|
+
const context = (0, import_react62.useContext)(DialogContext);
|
|
15101
15113
|
const isOpen = isOpenOverwrite ?? context?.isOpen ?? false;
|
|
15102
15114
|
const isModal = isModalOverwrite ?? context?.isModal ?? true;
|
|
15103
15115
|
const { refAssignment, isPresent, ref } = usePresenceRef({
|
|
15104
15116
|
isOpen
|
|
15105
15117
|
});
|
|
15106
|
-
(0,
|
|
15118
|
+
(0, import_react62.useImperativeHandle)(forwardedRef, () => ref.current, [ref]);
|
|
15107
15119
|
const onCloseStable = useEventCallbackStabilizer(onClose);
|
|
15108
|
-
const onCloseWrapper = (0,
|
|
15120
|
+
const onCloseWrapper = (0, import_react62.useCallback)(() => {
|
|
15109
15121
|
if (!isModal) return;
|
|
15110
15122
|
onCloseStable();
|
|
15111
15123
|
context?.setIsOpen(false);
|
|
@@ -15189,10 +15201,10 @@ var Dialog = (0, import_react63.forwardRef)(function Dialog2({
|
|
|
15189
15201
|
});
|
|
15190
15202
|
|
|
15191
15203
|
// src/components/layout/dialog/DialogOpener.tsx
|
|
15192
|
-
var
|
|
15204
|
+
var import_react63 = require("react");
|
|
15193
15205
|
function DialogOpenerWrapper({ children }) {
|
|
15194
15206
|
const context = useDialogContext();
|
|
15195
|
-
const bag = (0,
|
|
15207
|
+
const bag = (0, import_react63.useMemo)(() => ({
|
|
15196
15208
|
open: () => context.setIsOpen(true),
|
|
15197
15209
|
close: () => context.setIsOpen(false),
|
|
15198
15210
|
toggleOpen: () => context.setIsOpen((prev) => !prev),
|
|
@@ -15370,13 +15382,13 @@ var import_lucide_react12 = require("lucide-react");
|
|
|
15370
15382
|
var import_clsx18 = __toESM(require("clsx"));
|
|
15371
15383
|
|
|
15372
15384
|
// src/global-contexts/ThemeContext.tsx
|
|
15373
|
-
var
|
|
15385
|
+
var import_react64 = require("react");
|
|
15374
15386
|
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
15375
15387
|
var themes = ["light", "dark", "system"];
|
|
15376
15388
|
var ThemeUtil = {
|
|
15377
15389
|
themes
|
|
15378
15390
|
};
|
|
15379
|
-
var ThemeContext = (0,
|
|
15391
|
+
var ThemeContext = (0, import_react64.createContext)(null);
|
|
15380
15392
|
var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
15381
15393
|
const {
|
|
15382
15394
|
value: storedTheme,
|
|
@@ -15384,8 +15396,8 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
15384
15396
|
deleteValue: deleteStoredTheme
|
|
15385
15397
|
} = useStorage({ key: "theme", defaultValue: "system" });
|
|
15386
15398
|
const { config } = useHightideConfig();
|
|
15387
|
-
const [themePreference, setThemePreference] = (0,
|
|
15388
|
-
const resolvedTheme = (0,
|
|
15399
|
+
const [themePreference, setThemePreference] = (0, import_react64.useState)("system");
|
|
15400
|
+
const resolvedTheme = (0, import_react64.useMemo)(() => {
|
|
15389
15401
|
if (theme && theme !== "system") {
|
|
15390
15402
|
return theme;
|
|
15391
15403
|
}
|
|
@@ -15397,7 +15409,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
15397
15409
|
}
|
|
15398
15410
|
return initialTheme ?? config.theme.initialTheme;
|
|
15399
15411
|
}, [config.theme.initialTheme, initialTheme, storedTheme, theme, themePreference]);
|
|
15400
|
-
(0,
|
|
15412
|
+
(0, import_react64.useEffect)(() => {
|
|
15401
15413
|
if (!theme) return;
|
|
15402
15414
|
if (theme === "system") {
|
|
15403
15415
|
deleteStoredTheme();
|
|
@@ -15405,18 +15417,18 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
15405
15417
|
setStoredTheme(theme);
|
|
15406
15418
|
}
|
|
15407
15419
|
}, [theme, deleteStoredTheme, setStoredTheme]);
|
|
15408
|
-
(0,
|
|
15420
|
+
(0, import_react64.useEffect)(() => {
|
|
15409
15421
|
document.documentElement.setAttribute("data-theme", resolvedTheme);
|
|
15410
15422
|
}, [resolvedTheme]);
|
|
15411
|
-
const getPreference = (0,
|
|
15423
|
+
const getPreference = (0, import_react64.useCallback)(() => {
|
|
15412
15424
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
15413
15425
|
const prefersLight = window.matchMedia("(prefers-color-scheme: light)").matches;
|
|
15414
15426
|
setThemePreference(prefersDark ? "dark" : prefersLight ? "light" : "system");
|
|
15415
15427
|
}, []);
|
|
15416
|
-
(0,
|
|
15428
|
+
(0, import_react64.useEffect)(() => {
|
|
15417
15429
|
getPreference();
|
|
15418
15430
|
}, [getPreference]);
|
|
15419
|
-
(0,
|
|
15431
|
+
(0, import_react64.useEffect)(() => {
|
|
15420
15432
|
const darkQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
15421
15433
|
const lightQuery = window.matchMedia("(prefers-color-scheme: light)");
|
|
15422
15434
|
const noPrefQuery = window.matchMedia("(prefers-color-scheme: no-preference)");
|
|
@@ -15447,7 +15459,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
15447
15459
|
);
|
|
15448
15460
|
};
|
|
15449
15461
|
var useTheme = () => {
|
|
15450
|
-
const context = (0,
|
|
15462
|
+
const context = (0, import_react64.useContext)(ThemeContext);
|
|
15451
15463
|
if (!context) {
|
|
15452
15464
|
throw new Error("useTheme must be used within ThemeContext. Try adding a ThemeProvider around your app.");
|
|
15453
15465
|
}
|
|
@@ -15527,16 +15539,16 @@ var ThemeDialog = ({
|
|
|
15527
15539
|
};
|
|
15528
15540
|
|
|
15529
15541
|
// src/components/layout/drawer/Drawer.tsx
|
|
15530
|
-
var
|
|
15542
|
+
var import_react67 = require("react");
|
|
15531
15543
|
|
|
15532
15544
|
// src/components/layout/drawer/DrawerContent.tsx
|
|
15533
|
-
var
|
|
15545
|
+
var import_react66 = require("react");
|
|
15534
15546
|
|
|
15535
15547
|
// src/components/layout/drawer/DrawerContext.tsx
|
|
15536
|
-
var
|
|
15537
|
-
var DrawerContext = (0,
|
|
15548
|
+
var import_react65 = require("react");
|
|
15549
|
+
var DrawerContext = (0, import_react65.createContext)(null);
|
|
15538
15550
|
function useDrawerContext() {
|
|
15539
|
-
const context = (0,
|
|
15551
|
+
const context = (0, import_react65.useContext)(DrawerContext);
|
|
15540
15552
|
if (!context) {
|
|
15541
15553
|
throw new Error("useDrawerContext must be used within a <DrawerRoot>");
|
|
15542
15554
|
}
|
|
@@ -15545,7 +15557,7 @@ function useDrawerContext() {
|
|
|
15545
15557
|
|
|
15546
15558
|
// src/components/layout/drawer/DrawerContent.tsx
|
|
15547
15559
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
15548
|
-
var DrawerContent = (0,
|
|
15560
|
+
var DrawerContent = (0, import_react66.forwardRef)(function DrawerContent2({
|
|
15549
15561
|
children,
|
|
15550
15562
|
alignment = "left",
|
|
15551
15563
|
containerClassName,
|
|
@@ -15554,14 +15566,14 @@ var DrawerContent = (0, import_react67.forwardRef)(function DrawerContent2({
|
|
|
15554
15566
|
...props
|
|
15555
15567
|
}, forwardedRef) {
|
|
15556
15568
|
const { isOpen } = useDrawerContext();
|
|
15557
|
-
const generatedId = (0,
|
|
15558
|
-
const ids = (0,
|
|
15569
|
+
const generatedId = (0, import_react66.useId)();
|
|
15570
|
+
const ids = (0, import_react66.useMemo)(() => ({
|
|
15559
15571
|
container: `dialog-container-${generatedId}`,
|
|
15560
15572
|
background: `dialog-background-${generatedId}`,
|
|
15561
15573
|
content: props.id ?? `dialog-content-${generatedId}`
|
|
15562
15574
|
}), [generatedId, props.id]);
|
|
15563
|
-
const ref = (0,
|
|
15564
|
-
(0,
|
|
15575
|
+
const ref = (0, import_react66.useRef)(null);
|
|
15576
|
+
(0, import_react66.useImperativeHandle)(forwardedRef, () => ref.current, [ref]);
|
|
15565
15577
|
const { isVisible, transitionState } = useTransitionState({ isOpen, ref });
|
|
15566
15578
|
useFocusTrap({
|
|
15567
15579
|
container: ref,
|
|
@@ -15569,7 +15581,7 @@ var DrawerContent = (0, import_react67.forwardRef)(function DrawerContent2({
|
|
|
15569
15581
|
});
|
|
15570
15582
|
const { zIndex, tagPositions, tagItemCounts } = useOverlayRegistry({
|
|
15571
15583
|
isActive: isVisible,
|
|
15572
|
-
tags: (0,
|
|
15584
|
+
tags: (0, import_react66.useMemo)(() => ["drawer"], [])
|
|
15573
15585
|
});
|
|
15574
15586
|
const depth = tagPositions && tagItemCounts ? (tagItemCounts["drawer"] ?? 0) - (tagPositions["drawer"] ?? 0) : 0;
|
|
15575
15587
|
const { setOpen } = useDrawerContext();
|
|
@@ -15664,7 +15676,7 @@ function DrawerRoot({
|
|
|
15664
15676
|
|
|
15665
15677
|
// src/components/layout/drawer/Drawer.tsx
|
|
15666
15678
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
15667
|
-
var Drawer = (0,
|
|
15679
|
+
var Drawer = (0, import_react67.forwardRef)(function Drawer2({
|
|
15668
15680
|
children,
|
|
15669
15681
|
isOpen = true,
|
|
15670
15682
|
alignment = "left",
|
|
@@ -15722,7 +15734,7 @@ var ErrorComponent = ({
|
|
|
15722
15734
|
};
|
|
15723
15735
|
|
|
15724
15736
|
// src/components/layout/loading/LoadingAndErrorComponent.tsx
|
|
15725
|
-
var
|
|
15737
|
+
var import_react68 = require("react");
|
|
15726
15738
|
|
|
15727
15739
|
// src/components/layout/loading/LoadingContainer.tsx
|
|
15728
15740
|
var import_clsx20 = require("clsx");
|
|
@@ -15743,8 +15755,8 @@ var LoadingAndErrorComponent = ({
|
|
|
15743
15755
|
minimumLoadingDuration = 200,
|
|
15744
15756
|
className
|
|
15745
15757
|
}) => {
|
|
15746
|
-
const [isInMinimumLoading, setIsInMinimumLoading] = (0,
|
|
15747
|
-
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0,
|
|
15758
|
+
const [isInMinimumLoading, setIsInMinimumLoading] = (0, import_react68.useState)(false);
|
|
15759
|
+
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0, import_react68.useState)(false);
|
|
15748
15760
|
if (minimumLoadingDuration && !isInMinimumLoading && !hasUsedMinimumLoading) {
|
|
15749
15761
|
setIsInMinimumLoading(true);
|
|
15750
15762
|
setTimeout(() => {
|
|
@@ -15807,8 +15819,8 @@ var BreadCrumbs = ({ crumbs }) => {
|
|
|
15807
15819
|
|
|
15808
15820
|
// src/components/layout/navigation/Navigation.tsx
|
|
15809
15821
|
var import_lucide_react15 = require("lucide-react");
|
|
15822
|
+
var import_react69 = require("react");
|
|
15810
15823
|
var import_react70 = require("react");
|
|
15811
|
-
var import_react71 = require("react");
|
|
15812
15824
|
var import_link2 = __toESM(require_link2());
|
|
15813
15825
|
var import_clsx23 = __toESM(require("clsx"));
|
|
15814
15826
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
@@ -15821,10 +15833,10 @@ var NavigationItemWithSubItem = ({
|
|
|
15821
15833
|
horizontalAlignment = "center",
|
|
15822
15834
|
...options
|
|
15823
15835
|
}) => {
|
|
15824
|
-
const [isOpen, setOpen] = (0,
|
|
15825
|
-
const containerRef = (0,
|
|
15826
|
-
const triggerRef = (0,
|
|
15827
|
-
const id = (0,
|
|
15836
|
+
const [isOpen, setOpen] = (0, import_react70.useState)(false);
|
|
15837
|
+
const containerRef = (0, import_react70.useRef)(null);
|
|
15838
|
+
const triggerRef = (0, import_react70.useRef)(null);
|
|
15839
|
+
const id = (0, import_react70.useId)();
|
|
15828
15840
|
const style = useAnchoredPosition({
|
|
15829
15841
|
active: isOpen,
|
|
15830
15842
|
container: containerRef,
|
|
@@ -15832,7 +15844,7 @@ var NavigationItemWithSubItem = ({
|
|
|
15832
15844
|
horizontalAlignment,
|
|
15833
15845
|
...options
|
|
15834
15846
|
});
|
|
15835
|
-
const onBlur = (0,
|
|
15847
|
+
const onBlur = (0, import_react70.useCallback)((event) => {
|
|
15836
15848
|
const nextFocus = event.relatedTarget;
|
|
15837
15849
|
if (!containerRef.current?.contains(nextFocus) && !triggerRef.current?.contains(nextFocus)) {
|
|
15838
15850
|
setOpen(false);
|
|
@@ -15898,10 +15910,10 @@ var NavigationItemList = ({ items, ...restProps }) => {
|
|
|
15898
15910
|
};
|
|
15899
15911
|
var Navigation = ({ ...props }) => {
|
|
15900
15912
|
const translation = useHightideTranslation();
|
|
15901
|
-
const [isMobileOpen, setIsMobileOpen] = (0,
|
|
15902
|
-
const id = (0,
|
|
15903
|
-
const menuRef = (0,
|
|
15904
|
-
(0,
|
|
15913
|
+
const [isMobileOpen, setIsMobileOpen] = (0, import_react70.useState)(false);
|
|
15914
|
+
const id = (0, import_react70.useId)();
|
|
15915
|
+
const menuRef = (0, import_react70.useRef)(null);
|
|
15916
|
+
(0, import_react69.useEffect)(() => {
|
|
15905
15917
|
menuRef.current?.focus();
|
|
15906
15918
|
}, [isMobileOpen]);
|
|
15907
15919
|
const { zIndex } = useOverlayRegistry({ isActive: isMobileOpen });
|
|
@@ -15969,7 +15981,7 @@ var Navigation = ({ ...props }) => {
|
|
|
15969
15981
|
// src/components/layout/navigation/Pagination.tsx
|
|
15970
15982
|
var import_lucide_react16 = require("lucide-react");
|
|
15971
15983
|
var import_clsx24 = __toESM(require("clsx"));
|
|
15972
|
-
var
|
|
15984
|
+
var import_react71 = require("react");
|
|
15973
15985
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
15974
15986
|
var Pagination = ({
|
|
15975
15987
|
pageIndex,
|
|
@@ -15978,11 +15990,11 @@ var Pagination = ({
|
|
|
15978
15990
|
...props
|
|
15979
15991
|
}) => {
|
|
15980
15992
|
const translation = useHightideTranslation();
|
|
15981
|
-
const [value, setValue] = (0,
|
|
15993
|
+
const [value, setValue] = (0, import_react71.useState)((pageIndex + 1).toString());
|
|
15982
15994
|
const noPages = pageCount === 0;
|
|
15983
15995
|
const onFirstPage = pageIndex === 0 && !noPages;
|
|
15984
15996
|
const onLastPage = pageIndex === pageCount - 1;
|
|
15985
|
-
(0,
|
|
15997
|
+
(0, import_react71.useEffect)(() => {
|
|
15986
15998
|
if (noPages) {
|
|
15987
15999
|
setValue("0");
|
|
15988
16000
|
} else {
|
|
@@ -16176,18 +16188,18 @@ var StepperBar = ({
|
|
|
16176
16188
|
};
|
|
16177
16189
|
|
|
16178
16190
|
// src/components/layout/popup/PopUpOpener.tsx
|
|
16179
|
-
var
|
|
16191
|
+
var import_react72 = require("react");
|
|
16180
16192
|
function PopUpOpener({ children }) {
|
|
16181
16193
|
const context = usePopUpContext();
|
|
16182
16194
|
const { setTriggerRef } = context;
|
|
16183
|
-
const ref = (0,
|
|
16184
|
-
(0,
|
|
16195
|
+
const ref = (0, import_react72.useRef)(null);
|
|
16196
|
+
(0, import_react72.useEffect)(() => {
|
|
16185
16197
|
setTriggerRef(ref);
|
|
16186
16198
|
return () => {
|
|
16187
16199
|
setTriggerRef(null);
|
|
16188
16200
|
};
|
|
16189
16201
|
}, [setTriggerRef]);
|
|
16190
|
-
const bag = (0,
|
|
16202
|
+
const bag = (0, import_react72.useMemo)(() => ({
|
|
16191
16203
|
open: () => context.setIsOpen(true),
|
|
16192
16204
|
close: () => context.setIsOpen(false),
|
|
16193
16205
|
toggleOpen: () => context.setIsOpen((prev) => !prev),
|
|
@@ -16205,7 +16217,7 @@ function PopUpOpener({ children }) {
|
|
|
16205
16217
|
}
|
|
16206
16218
|
|
|
16207
16219
|
// src/components/layout/popup/PopUpRoot.tsx
|
|
16208
|
-
var
|
|
16220
|
+
var import_react73 = require("react");
|
|
16209
16221
|
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
16210
16222
|
function PopUpRoot({
|
|
16211
16223
|
children,
|
|
@@ -16215,17 +16227,17 @@ function PopUpRoot({
|
|
|
16215
16227
|
popUpId: popUpIdOverwrite,
|
|
16216
16228
|
triggerId: triggerIdOverwrite
|
|
16217
16229
|
}) {
|
|
16218
|
-
const generatedPopUpId = (0,
|
|
16219
|
-
const generatedTriggerId = (0,
|
|
16230
|
+
const generatedPopUpId = (0, import_react73.useId)();
|
|
16231
|
+
const generatedTriggerId = (0, import_react73.useId)();
|
|
16220
16232
|
const [isOpen, setIsOpen] = useControlledState({
|
|
16221
16233
|
value: controlledIsOpen,
|
|
16222
16234
|
onValueChange: onIsOpenChange,
|
|
16223
16235
|
defaultValue: initialIsOpen
|
|
16224
16236
|
});
|
|
16225
|
-
const [triggerRef, setTriggerRef] = (0,
|
|
16226
|
-
const popUpId = (0,
|
|
16227
|
-
const triggerId = (0,
|
|
16228
|
-
const contextValue = (0,
|
|
16237
|
+
const [triggerRef, setTriggerRef] = (0, import_react73.useState)(null);
|
|
16238
|
+
const popUpId = (0, import_react73.useMemo)(() => popUpIdOverwrite ?? `pop-up-${generatedPopUpId}`, [popUpIdOverwrite, generatedPopUpId]);
|
|
16239
|
+
const triggerId = (0, import_react73.useMemo)(() => triggerIdOverwrite ?? `pop-up-trigger-${generatedTriggerId}`, [triggerIdOverwrite, generatedTriggerId]);
|
|
16240
|
+
const contextValue = (0, import_react73.useMemo)(() => ({
|
|
16229
16241
|
isOpen,
|
|
16230
16242
|
setIsOpen,
|
|
16231
16243
|
popUpId,
|
|
@@ -16412,31 +16424,31 @@ var FillerCell = ({ ...props }) => {
|
|
|
16412
16424
|
};
|
|
16413
16425
|
|
|
16414
16426
|
// src/components/layout/table/TableProvider.tsx
|
|
16415
|
-
var
|
|
16427
|
+
var import_react76 = require("react");
|
|
16416
16428
|
|
|
16417
16429
|
// src/components/layout/table/TableContext.tsx
|
|
16418
|
-
var
|
|
16419
|
-
var TableStateWithoutSizingContext = (0,
|
|
16430
|
+
var import_react74 = require("react");
|
|
16431
|
+
var TableStateWithoutSizingContext = (0, import_react74.createContext)(null);
|
|
16420
16432
|
var useTableStateWithoutSizingContext = () => {
|
|
16421
|
-
const context = (0,
|
|
16433
|
+
const context = (0, import_react74.useContext)(TableStateWithoutSizingContext);
|
|
16422
16434
|
if (!context) throw new Error("useTableStateWithoutSizingContext must be used within a <TableStateWithoutSizingContext.Provider> like <TableStateWithoutSizing>");
|
|
16423
16435
|
return context;
|
|
16424
16436
|
};
|
|
16425
|
-
var TableStateContext = (0,
|
|
16437
|
+
var TableStateContext = (0, import_react74.createContext)(null);
|
|
16426
16438
|
var useTableStateContext = () => {
|
|
16427
|
-
const context = (0,
|
|
16439
|
+
const context = (0, import_react74.useContext)(TableStateContext);
|
|
16428
16440
|
if (!context) throw new Error("useTableStateContext must be used within a <TableStateContext.Provider> like <TableState>");
|
|
16429
16441
|
return context;
|
|
16430
16442
|
};
|
|
16431
|
-
var TableContainerContext = (0,
|
|
16443
|
+
var TableContainerContext = (0, import_react74.createContext)(null);
|
|
16432
16444
|
var useTableContainerContext = () => {
|
|
16433
|
-
const context = (0,
|
|
16445
|
+
const context = (0, import_react74.useContext)(TableContainerContext);
|
|
16434
16446
|
if (!context) throw new Error("useTableContainerContext must be used within a <TableContainerContext.Provider> like <TableContainer>");
|
|
16435
16447
|
return context;
|
|
16436
16448
|
};
|
|
16437
|
-
var TableColumnDefinitionContext = (0,
|
|
16449
|
+
var TableColumnDefinitionContext = (0, import_react74.createContext)(null);
|
|
16438
16450
|
var useTableColumnDefinitionContext = () => {
|
|
16439
|
-
const context = (0,
|
|
16451
|
+
const context = (0, import_react74.useContext)(TableColumnDefinitionContext);
|
|
16440
16452
|
if (!context) throw new Error("useTableColumnDefinitionContext must be used within a <TableColumnDefinitionContext.Provider> like <TableColumnDefinition>");
|
|
16441
16453
|
return context;
|
|
16442
16454
|
};
|
|
@@ -16615,7 +16627,7 @@ var FilterOperatorUtils = {
|
|
|
16615
16627
|
};
|
|
16616
16628
|
|
|
16617
16629
|
// src/components/user-interaction/data/filter-function.ts
|
|
16618
|
-
var
|
|
16630
|
+
var import_react75 = require("react");
|
|
16619
16631
|
|
|
16620
16632
|
// src/utils/date.ts
|
|
16621
16633
|
var timesInSeconds = {
|
|
@@ -17286,7 +17298,7 @@ function tagToLabel(tags, value) {
|
|
|
17286
17298
|
function useFilterValueTranslation() {
|
|
17287
17299
|
const translation = useHightideTranslation();
|
|
17288
17300
|
const { locale } = useLocale();
|
|
17289
|
-
return (0,
|
|
17301
|
+
return (0, import_react75.useCallback)((value, options) => {
|
|
17290
17302
|
const p = value.parameter;
|
|
17291
17303
|
const tags = options?.tags;
|
|
17292
17304
|
const dateFormat = value.dataType === "dateTime" ? "dateTime" : "date";
|
|
@@ -17488,9 +17500,9 @@ var TableProvider = ({
|
|
|
17488
17500
|
}) => {
|
|
17489
17501
|
const onRowClickStable = useEventCallbackStabilizer(onRowClick);
|
|
17490
17502
|
const onFillerRowClickStable = useEventCallbackStabilizer(onFillerRowClick);
|
|
17491
|
-
const [registeredColumns, setRegisteredColumns] = (0,
|
|
17492
|
-
const containerRef = (0,
|
|
17493
|
-
const [, setTableState] = (0,
|
|
17503
|
+
const [registeredColumns, setRegisteredColumns] = (0, import_react76.useState)([]);
|
|
17504
|
+
const containerRef = (0, import_react76.useRef)(null);
|
|
17505
|
+
const [, setTableState] = (0, import_react76.useState)({
|
|
17494
17506
|
columnSizing: {},
|
|
17495
17507
|
columnOrder: [],
|
|
17496
17508
|
columnFilters: [],
|
|
@@ -17515,16 +17527,16 @@ var TableProvider = ({
|
|
|
17515
17527
|
pageSize: 10
|
|
17516
17528
|
}
|
|
17517
17529
|
});
|
|
17518
|
-
const [targetWidth, setTargetWidth] = (0,
|
|
17519
|
-
(0,
|
|
17530
|
+
const [targetWidth, setTargetWidth] = (0, import_react76.useState)(void 0);
|
|
17531
|
+
(0, import_react76.useLayoutEffect)(() => {
|
|
17520
17532
|
const width = containerRef.current?.getBoundingClientRect().width;
|
|
17521
17533
|
setTargetWidth(width !== void 0 ? Math.floor(width) : void 0);
|
|
17522
17534
|
}, [containerRef]);
|
|
17523
|
-
useWindowResizeObserver((0,
|
|
17535
|
+
useWindowResizeObserver((0, import_react76.useCallback)(() => {
|
|
17524
17536
|
const width = containerRef.current?.getBoundingClientRect().width;
|
|
17525
17537
|
setTargetWidth(width !== void 0 ? Math.floor(width) : void 0);
|
|
17526
17538
|
}, [containerRef]));
|
|
17527
|
-
const registerColumn = (0,
|
|
17539
|
+
const registerColumn = (0, import_react76.useCallback)((column) => {
|
|
17528
17540
|
setRegisteredColumns((prev) => {
|
|
17529
17541
|
return [...prev, column];
|
|
17530
17542
|
});
|
|
@@ -17534,7 +17546,7 @@ var TableProvider = ({
|
|
|
17534
17546
|
});
|
|
17535
17547
|
};
|
|
17536
17548
|
}, []);
|
|
17537
|
-
const columns = (0,
|
|
17549
|
+
const columns = (0, import_react76.useMemo)(() => {
|
|
17538
17550
|
const contextColumns = Array.from(registeredColumns.values());
|
|
17539
17551
|
if (columnsProp) {
|
|
17540
17552
|
return [...contextColumns, ...columnsProp];
|
|
@@ -17551,7 +17563,7 @@ var TableProvider = ({
|
|
|
17551
17563
|
defaultColumn: {
|
|
17552
17564
|
minSize: 60,
|
|
17553
17565
|
maxSize: 800,
|
|
17554
|
-
cell: (0,
|
|
17566
|
+
cell: (0, import_react76.useCallback)(({ cell }) => {
|
|
17555
17567
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(TableCell, { children: String(cell.getValue()) });
|
|
17556
17568
|
}, []),
|
|
17557
17569
|
enableResizing: true,
|
|
@@ -17592,7 +17604,7 @@ var TableProvider = ({
|
|
|
17592
17604
|
});
|
|
17593
17605
|
const pagination = table.getState().pagination;
|
|
17594
17606
|
const pageCount = table.getPageCount();
|
|
17595
|
-
(0,
|
|
17607
|
+
(0, import_react76.useEffect)(() => {
|
|
17596
17608
|
if (pageCount === -1) {
|
|
17597
17609
|
return;
|
|
17598
17610
|
}
|
|
@@ -17600,20 +17612,20 @@ var TableProvider = ({
|
|
|
17600
17612
|
table.setPageIndex(pageCount - 1);
|
|
17601
17613
|
}
|
|
17602
17614
|
}, [table, pagination.pageIndex, pageCount]);
|
|
17603
|
-
(0,
|
|
17615
|
+
(0, import_react76.useEffect)(() => {
|
|
17604
17616
|
table.setColumnOrder((prev) => [...prev]);
|
|
17605
17617
|
}, [table, columns]);
|
|
17606
17618
|
const columnVisibility = table.getState().columnVisibility;
|
|
17607
17619
|
const columnOrder = table.getState().columnOrder;
|
|
17608
17620
|
const columnPinning = table.getState().columnPinning;
|
|
17609
|
-
(0,
|
|
17621
|
+
(0, import_react76.useEffect)(() => {
|
|
17610
17622
|
table.setColumnSizing((prev) => ({ ...prev }));
|
|
17611
17623
|
}, [table, targetWidth, columnVisibility, columnOrder, columnPinning]);
|
|
17612
|
-
const tableColumnDefinitionContextValue = (0,
|
|
17624
|
+
const tableColumnDefinitionContextValue = (0, import_react76.useMemo)(() => ({
|
|
17613
17625
|
table,
|
|
17614
17626
|
registerColumn
|
|
17615
17627
|
}), [table, registerColumn]);
|
|
17616
|
-
const tableContainerContextValue = (0,
|
|
17628
|
+
const tableContainerContextValue = (0, import_react76.useMemo)(() => ({
|
|
17617
17629
|
table,
|
|
17618
17630
|
containerRef
|
|
17619
17631
|
}), [table, containerRef]);
|
|
@@ -17622,7 +17634,7 @@ var TableProvider = ({
|
|
|
17622
17634
|
return rest;
|
|
17623
17635
|
})();
|
|
17624
17636
|
const rowModel = table.getRowModel();
|
|
17625
|
-
const tableStateWithoutSizingContextValue = (0,
|
|
17637
|
+
const tableStateWithoutSizingContextValue = (0, import_react76.useMemo)(() => ({
|
|
17626
17638
|
table,
|
|
17627
17639
|
isUsingFillerRows,
|
|
17628
17640
|
fillerRowCell,
|
|
@@ -17665,7 +17677,7 @@ var TableProvider = ({
|
|
|
17665
17677
|
]);
|
|
17666
17678
|
const columnSizing = table.getState().columnSizing;
|
|
17667
17679
|
const columnSizingInfo = table.getState().columnSizingInfo;
|
|
17668
|
-
const tableStateContextValue = (0,
|
|
17680
|
+
const tableStateContextValue = (0, import_react76.useMemo)(() => ({
|
|
17669
17681
|
...tableStateWithoutSizingContextValue,
|
|
17670
17682
|
sizeVars: ColumnSizeUtil.toSizeVars(columnSizing),
|
|
17671
17683
|
columnSizingInfo,
|
|
@@ -17676,10 +17688,10 @@ var TableProvider = ({
|
|
|
17676
17688
|
|
|
17677
17689
|
// src/components/layout/table/TableBody.tsx
|
|
17678
17690
|
var import_react_table2 = require("@tanstack/react-table");
|
|
17679
|
-
var
|
|
17691
|
+
var import_react77 = __toESM(require("react"));
|
|
17680
17692
|
var import_clsx26 = __toESM(require("clsx"));
|
|
17681
17693
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
17682
|
-
var TableBody =
|
|
17694
|
+
var TableBody = import_react77.default.memo(function TableBodyVisual() {
|
|
17683
17695
|
const { table, isUsingFillerRows, fillerRowCell, onRowClick, onFillerRowClick } = useTableStateWithoutSizingContext();
|
|
17684
17696
|
const rows = table.getRowModel().rows;
|
|
17685
17697
|
const columnOrder = table.getState().columnOrder;
|
|
@@ -17777,20 +17789,20 @@ var TableSortButton = ({
|
|
|
17777
17789
|
|
|
17778
17790
|
// src/components/layout/table/TableFilterButton.tsx
|
|
17779
17791
|
var import_lucide_react25 = require("lucide-react");
|
|
17780
|
-
var
|
|
17792
|
+
var import_react94 = require("react");
|
|
17781
17793
|
var import_react_table3 = require("@tanstack/react-table");
|
|
17782
17794
|
|
|
17783
17795
|
// src/components/user-interaction/data/FilterPopUp.tsx
|
|
17784
17796
|
var import_lucide_react24 = require("lucide-react");
|
|
17785
|
-
var
|
|
17797
|
+
var import_react93 = require("react");
|
|
17786
17798
|
|
|
17787
17799
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
17788
|
-
var
|
|
17800
|
+
var import_react84 = require("react");
|
|
17789
17801
|
var import_lucide_react22 = require("lucide-react");
|
|
17790
17802
|
var import_clsx31 = __toESM(require("clsx"));
|
|
17791
17803
|
|
|
17792
17804
|
// src/components/user-interaction/date/TimePicker.tsx
|
|
17793
|
-
var
|
|
17805
|
+
var import_react78 = require("react");
|
|
17794
17806
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
17795
17807
|
var TimePicker = ({
|
|
17796
17808
|
value: controlledValue,
|
|
@@ -17811,11 +17823,11 @@ var TimePicker = ({
|
|
|
17811
17823
|
onValueChange,
|
|
17812
17824
|
defaultValue: initialValue
|
|
17813
17825
|
});
|
|
17814
|
-
const minuteRef = (0,
|
|
17815
|
-
const hourRef = (0,
|
|
17826
|
+
const minuteRef = (0, import_react78.useRef)(null);
|
|
17827
|
+
const hourRef = (0, import_react78.useRef)(null);
|
|
17816
17828
|
const isPM = value.getHours() > 11;
|
|
17817
17829
|
const hours = is24HourFormat ? range(24) : range(12);
|
|
17818
|
-
const minutes = (0,
|
|
17830
|
+
const minutes = (0, import_react78.useMemo)(() => {
|
|
17819
17831
|
const full = range(60);
|
|
17820
17832
|
switch (minuteIncrement) {
|
|
17821
17833
|
case "5min":
|
|
@@ -17828,7 +17840,7 @@ var TimePicker = ({
|
|
|
17828
17840
|
return full.filter((value2) => value2 % 30 === 0);
|
|
17829
17841
|
}
|
|
17830
17842
|
}, [minuteIncrement]);
|
|
17831
|
-
const seconds = (0,
|
|
17843
|
+
const seconds = (0, import_react78.useMemo)(() => {
|
|
17832
17844
|
const full = range(60);
|
|
17833
17845
|
switch (secondIncrement) {
|
|
17834
17846
|
case "1s":
|
|
@@ -17843,7 +17855,7 @@ var TimePicker = ({
|
|
|
17843
17855
|
return full.filter((value2) => value2 % 30 === 0);
|
|
17844
17856
|
}
|
|
17845
17857
|
}, [secondIncrement]);
|
|
17846
|
-
const milliseconds = (0,
|
|
17858
|
+
const milliseconds = (0, import_react78.useMemo)(() => {
|
|
17847
17859
|
const full = range(1e3);
|
|
17848
17860
|
switch (millisecondIncrement) {
|
|
17849
17861
|
case "1ms":
|
|
@@ -17864,17 +17876,17 @@ var TimePicker = ({
|
|
|
17864
17876
|
return full.filter((value2) => value2 % 500 === 0);
|
|
17865
17877
|
}
|
|
17866
17878
|
}, [millisecondIncrement]);
|
|
17867
|
-
const closestMinute = (0,
|
|
17868
|
-
const closestSecond = (0,
|
|
17869
|
-
const closestMillisecond = (0,
|
|
17879
|
+
const closestMinute = (0, import_react78.useMemo)(() => closestMatch(minutes, (item1, item2) => Math.abs(item1 - value.getMinutes()) < Math.abs(item2 - value.getMinutes())), [minutes, value]);
|
|
17880
|
+
const closestSecond = (0, import_react78.useMemo)(() => closestMatch(seconds, (item1, item2) => Math.abs(item1 - value.getSeconds()) < Math.abs(item2 - value.getSeconds())), [seconds, value]);
|
|
17881
|
+
const closestMillisecond = (0, import_react78.useMemo)(() => closestMatch(milliseconds, (item1, item2) => Math.abs(item1 - value.getMilliseconds()) < Math.abs(item2 - value.getMilliseconds())), [milliseconds, value]);
|
|
17870
17882
|
const hour = value.getHours();
|
|
17871
|
-
(0,
|
|
17883
|
+
(0, import_react78.useEffect)(() => {
|
|
17872
17884
|
minuteRef.current?.scrollIntoView({
|
|
17873
17885
|
behavior: "smooth",
|
|
17874
17886
|
block: "nearest"
|
|
17875
17887
|
});
|
|
17876
17888
|
}, [closestMinute]);
|
|
17877
|
-
(0,
|
|
17889
|
+
(0, import_react78.useEffect)(() => {
|
|
17878
17890
|
hourRef.current?.scrollIntoView({
|
|
17879
17891
|
behavior: "smooth",
|
|
17880
17892
|
block: "nearest"
|
|
@@ -17973,12 +17985,12 @@ var TimePicker = ({
|
|
|
17973
17985
|
};
|
|
17974
17986
|
|
|
17975
17987
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
17976
|
-
var
|
|
17988
|
+
var import_react81 = require("react");
|
|
17977
17989
|
var import_lucide_react21 = require("lucide-react");
|
|
17978
17990
|
var import_clsx29 = __toESM(require("clsx"));
|
|
17979
17991
|
|
|
17980
17992
|
// src/components/user-interaction/date/DayPicker.tsx
|
|
17981
|
-
var
|
|
17993
|
+
var import_react79 = require("react");
|
|
17982
17994
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
17983
17995
|
var DayPicker = ({
|
|
17984
17996
|
displayedMonth: controlledDisplayedMonth,
|
|
@@ -18007,33 +18019,33 @@ var DayPicker = ({
|
|
|
18007
18019
|
});
|
|
18008
18020
|
const month = displayedMonth.getMonth();
|
|
18009
18021
|
const weeks = DateUtils.weeksForCalenderMonth(displayedMonth, weekStart);
|
|
18010
|
-
const selectedButtonRef = (0,
|
|
18011
|
-
const isValueInDisplayedWeeks = (0,
|
|
18022
|
+
const selectedButtonRef = (0, import_react79.useRef)(null);
|
|
18023
|
+
const isValueInDisplayedWeeks = (0, import_react79.useMemo)(
|
|
18012
18024
|
() => !!value && weeks.some((week) => week.some((d) => DateUtils.equalDate(value, d))),
|
|
18013
18025
|
[value, weeks]
|
|
18014
18026
|
);
|
|
18015
|
-
const firstDayOfMonth = (0,
|
|
18027
|
+
const firstDayOfMonth = (0, import_react79.useCallback)(
|
|
18016
18028
|
(date) => new Date(date.getFullYear(), date.getMonth(), 1),
|
|
18017
18029
|
[]
|
|
18018
18030
|
);
|
|
18019
18031
|
const focusTargetDate = value && isValueInDisplayedWeeks ? value : firstDayOfMonth(displayedMonth);
|
|
18020
|
-
(0,
|
|
18032
|
+
(0, import_react79.useEffect)(() => {
|
|
18021
18033
|
selectedButtonRef.current?.focus();
|
|
18022
18034
|
}, [focusTargetDate]);
|
|
18023
|
-
const end = (0,
|
|
18035
|
+
const end = (0, import_react79.useMemo)(() => {
|
|
18024
18036
|
if (!providedEnd) return;
|
|
18025
18037
|
return new Date(providedEnd.getFullYear(), providedEnd.getMonth(), providedEnd.getDate());
|
|
18026
18038
|
}, [providedEnd]);
|
|
18027
|
-
const start = (0,
|
|
18039
|
+
const start = (0, import_react79.useMemo)(() => {
|
|
18028
18040
|
if (!providedStart) return;
|
|
18029
18041
|
return new Date(providedStart.getFullYear(), providedStart.getMonth(), providedStart.getDate());
|
|
18030
18042
|
}, [providedStart]);
|
|
18031
|
-
const clampToRange = (0,
|
|
18043
|
+
const clampToRange = (0, import_react79.useCallback)((date) => {
|
|
18032
18044
|
if (start && date < start) return start;
|
|
18033
18045
|
if (end && date > end) return end;
|
|
18034
18046
|
return date;
|
|
18035
18047
|
}, [start, end]);
|
|
18036
|
-
const navigateTo = (0,
|
|
18048
|
+
const navigateTo = (0, import_react79.useCallback)((candidate) => {
|
|
18037
18049
|
const clamped = clampToRange(candidate);
|
|
18038
18050
|
if (!DateUtils.between(clamped, start, end)) return;
|
|
18039
18051
|
setValue(clamped);
|
|
@@ -18042,7 +18054,7 @@ var DayPicker = ({
|
|
|
18042
18054
|
setDisplayedMonth(firstDayOfMonth(clamped));
|
|
18043
18055
|
}
|
|
18044
18056
|
}, [clampToRange, start, end, setValue, onEditComplete, displayedMonth, setDisplayedMonth, firstDayOfMonth]);
|
|
18045
|
-
const onKeyDown = (0,
|
|
18057
|
+
const onKeyDown = (0, import_react79.useCallback)(
|
|
18046
18058
|
(event) => {
|
|
18047
18059
|
PropsUtil.aria.navigate({
|
|
18048
18060
|
left: () => focusTargetDate && navigateTo(DateUtils.subtractDuration(focusTargetDate, { days: 1 })),
|
|
@@ -18099,10 +18111,10 @@ var DayPicker = ({
|
|
|
18099
18111
|
};
|
|
18100
18112
|
|
|
18101
18113
|
// src/components/user-interaction/date/YearMonthPicker.tsx
|
|
18102
|
-
var
|
|
18114
|
+
var import_react80 = require("react");
|
|
18103
18115
|
var import_clsx28 = __toESM(require("clsx"));
|
|
18104
18116
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
18105
|
-
var YearRow = (0,
|
|
18117
|
+
var YearRow = (0, import_react80.memo)(function YearRow2({
|
|
18106
18118
|
year,
|
|
18107
18119
|
selectedMonthIndex,
|
|
18108
18120
|
minTimestamp,
|
|
@@ -18110,15 +18122,15 @@ var YearRow = (0, import_react81.memo)(function YearRow2({
|
|
|
18110
18122
|
monthNames,
|
|
18111
18123
|
onSelect
|
|
18112
18124
|
}) {
|
|
18113
|
-
const ref = (0,
|
|
18125
|
+
const ref = (0, import_react80.useRef)(null);
|
|
18114
18126
|
const isSelectedYear = selectedMonthIndex !== void 0;
|
|
18115
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
18116
|
-
(0,
|
|
18127
|
+
const [isExpanded, setIsExpanded] = (0, import_react80.useState)(false);
|
|
18128
|
+
(0, import_react80.useEffect)(() => {
|
|
18117
18129
|
if (isSelectedYear) {
|
|
18118
18130
|
ref.current?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
18119
18131
|
}
|
|
18120
18132
|
}, [isSelectedYear]);
|
|
18121
|
-
const monthGrid = (0,
|
|
18133
|
+
const monthGrid = (0, import_react80.useMemo)(() => equalSizeGroups([...DateUtils.monthsList], 3), []);
|
|
18122
18134
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
18123
18135
|
ExpandableRoot,
|
|
18124
18136
|
{
|
|
@@ -18173,23 +18185,23 @@ var YearMonthPicker = ({
|
|
|
18173
18185
|
defaultValue: initialValue
|
|
18174
18186
|
});
|
|
18175
18187
|
const onEditCompleteStable = useEventCallbackStabilizer(onEditComplete);
|
|
18176
|
-
const monthNames = (0,
|
|
18188
|
+
const monthNames = (0, import_react80.useMemo)(() => {
|
|
18177
18189
|
const formatter = new Intl.DateTimeFormat(locale, { month: "short" });
|
|
18178
18190
|
return Array.from({ length: 12 }, (_, i) => formatter.format(new Date(2e3, i, 1)));
|
|
18179
18191
|
}, [locale]);
|
|
18180
|
-
const years = (0,
|
|
18192
|
+
const years = (0, import_react80.useMemo)(
|
|
18181
18193
|
() => range([start.getFullYear(), end.getFullYear()], { exclusiveEnd: false }),
|
|
18182
18194
|
[start, end]
|
|
18183
18195
|
);
|
|
18184
|
-
const minTimestamp = (0,
|
|
18196
|
+
const minTimestamp = (0, import_react80.useMemo)(() => {
|
|
18185
18197
|
if (!start) return;
|
|
18186
18198
|
return new Date(start.getFullYear(), start.getMonth(), 1).getTime();
|
|
18187
18199
|
}, [start]);
|
|
18188
|
-
const maxTimestamp = (0,
|
|
18200
|
+
const maxTimestamp = (0, import_react80.useMemo)(() => {
|
|
18189
18201
|
if (!end) return;
|
|
18190
18202
|
return new Date(end.getFullYear(), end.getMonth() + 1, 0).getTime();
|
|
18191
18203
|
}, [end]);
|
|
18192
|
-
const handleSelect = (0,
|
|
18204
|
+
const handleSelect = (0, import_react80.useCallback)((newDate) => {
|
|
18193
18205
|
setValue(newDate);
|
|
18194
18206
|
onEditCompleteStable(newDate);
|
|
18195
18207
|
}, [onEditCompleteStable, setValue]);
|
|
@@ -18242,8 +18254,8 @@ var DatePicker = ({
|
|
|
18242
18254
|
onValueChange,
|
|
18243
18255
|
defaultValue: initialValue
|
|
18244
18256
|
});
|
|
18245
|
-
const [displayedMonth, setDisplayedMonth] = (0,
|
|
18246
|
-
const [displayMode, setDisplayMode] = (0,
|
|
18257
|
+
const [displayedMonth, setDisplayedMonth] = (0, import_react81.useState)(new Date(value.getFullYear(), value.getMonth(), 1));
|
|
18258
|
+
const [displayMode, setDisplayMode] = (0, import_react81.useState)(initialDisplay);
|
|
18247
18259
|
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: (0, import_clsx29.default)("flex-col-3", className), children: [
|
|
18248
18260
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "flex-row-2 items-center justify-between", children: [
|
|
18249
18261
|
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
@@ -18405,7 +18417,7 @@ var DateTimePicker = ({
|
|
|
18405
18417
|
};
|
|
18406
18418
|
|
|
18407
18419
|
// src/components/user-interaction/date/DateTimePickerDialog.tsx
|
|
18408
|
-
var
|
|
18420
|
+
var import_react82 = require("react");
|
|
18409
18421
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
18410
18422
|
var DateTimePickerDialog = ({
|
|
18411
18423
|
initialValue = null,
|
|
@@ -18433,8 +18445,8 @@ var DateTimePickerDialog = ({
|
|
|
18433
18445
|
onValueChange,
|
|
18434
18446
|
defaultValue: initialValue
|
|
18435
18447
|
});
|
|
18436
|
-
const [pickerState, setPickerState] = (0,
|
|
18437
|
-
(0,
|
|
18448
|
+
const [pickerState, setPickerState] = (0, import_react82.useState)(state ?? /* @__PURE__ */ new Date());
|
|
18449
|
+
(0, import_react82.useEffect)(() => {
|
|
18438
18450
|
setPickerState(state ?? /* @__PURE__ */ new Date());
|
|
18439
18451
|
}, [state]);
|
|
18440
18452
|
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
@@ -18508,7 +18520,7 @@ var DateTimePickerDialog = ({
|
|
|
18508
18520
|
};
|
|
18509
18521
|
|
|
18510
18522
|
// src/components/user-interaction/input/DateTimeField.tsx
|
|
18511
|
-
var
|
|
18523
|
+
var import_react83 = require("react");
|
|
18512
18524
|
var import_clsx30 = __toESM(require("clsx"));
|
|
18513
18525
|
|
|
18514
18526
|
// src/components/user-interaction/input/dateTimeSegments.ts
|
|
@@ -18785,7 +18797,7 @@ var formatSegment = (type, values, buffer, locale) => {
|
|
|
18785
18797
|
// src/components/user-interaction/input/DateTimeField.tsx
|
|
18786
18798
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
18787
18799
|
var advanceKeys = [".", ":", "/", ",", "-", " "];
|
|
18788
|
-
var DateTimeField = (0,
|
|
18800
|
+
var DateTimeField = (0, import_react83.forwardRef)(function DateTimeField2({
|
|
18789
18801
|
value: controlledValue,
|
|
18790
18802
|
initialValue = null,
|
|
18791
18803
|
onValueChange,
|
|
@@ -18810,20 +18822,20 @@ var DateTimeField = (0, import_react84.forwardRef)(function DateTimeField2({
|
|
|
18810
18822
|
defaultValue: initialValue
|
|
18811
18823
|
});
|
|
18812
18824
|
const is24Hour = is24HourFormat ?? contextIs24HourFormat ?? true;
|
|
18813
|
-
const layout = (0,
|
|
18825
|
+
const layout = (0, import_react83.useMemo)(
|
|
18814
18826
|
() => buildSegmentLayout({ locale, mode, precision, is24HourFormat: is24Hour }),
|
|
18815
18827
|
[locale, mode, precision, is24Hour]
|
|
18816
18828
|
);
|
|
18817
|
-
const editableTypes = (0,
|
|
18818
|
-
const [editState, setEditState] = (0,
|
|
18829
|
+
const editableTypes = (0, import_react83.useMemo)(() => editableTypesOf(layout), [layout]);
|
|
18830
|
+
const [editState, setEditState] = (0, import_react83.useState)(() => ({
|
|
18819
18831
|
values: value ? decomposeDate(value, layout, is24Hour) : {},
|
|
18820
18832
|
buffer: null
|
|
18821
18833
|
}));
|
|
18822
|
-
const [focusedType, setFocusedType] = (0,
|
|
18823
|
-
const editStateRef = (0,
|
|
18834
|
+
const [focusedType, setFocusedType] = (0, import_react83.useState)(null);
|
|
18835
|
+
const editStateRef = (0, import_react83.useRef)(editState);
|
|
18824
18836
|
editStateRef.current = editState;
|
|
18825
|
-
const segmentRefs = (0,
|
|
18826
|
-
const segmentRefCallbacks = (0,
|
|
18837
|
+
const segmentRefs = (0, import_react83.useRef)(/* @__PURE__ */ new Map());
|
|
18838
|
+
const segmentRefCallbacks = (0, import_react83.useRef)(/* @__PURE__ */ new Map());
|
|
18827
18839
|
const registerSegment = (type) => {
|
|
18828
18840
|
const existing = segmentRefCallbacks.current.get(type);
|
|
18829
18841
|
if (existing) {
|
|
@@ -18839,7 +18851,7 @@ var DateTimeField = (0, import_react84.forwardRef)(function DateTimeField2({
|
|
|
18839
18851
|
segmentRefCallbacks.current.set(type, callback);
|
|
18840
18852
|
return callback;
|
|
18841
18853
|
};
|
|
18842
|
-
(0,
|
|
18854
|
+
(0, import_react83.useEffect)(() => {
|
|
18843
18855
|
if (editStateRef.current.buffer) {
|
|
18844
18856
|
return;
|
|
18845
18857
|
}
|
|
@@ -18867,7 +18879,7 @@ var DateTimeField = (0, import_react84.forwardRef)(function DateTimeField2({
|
|
|
18867
18879
|
const focusType = (type) => {
|
|
18868
18880
|
setFocusedType(type);
|
|
18869
18881
|
};
|
|
18870
|
-
(0,
|
|
18882
|
+
(0, import_react83.useLayoutEffect)(() => {
|
|
18871
18883
|
if (focusedType === null) {
|
|
18872
18884
|
return;
|
|
18873
18885
|
}
|
|
@@ -19032,7 +19044,7 @@ var DateTimeField = (0, import_react84.forwardRef)(function DateTimeField2({
|
|
|
19032
19044
|
|
|
19033
19045
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
19034
19046
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
19035
|
-
var DateTimeInput = (0,
|
|
19047
|
+
var DateTimeInput = (0, import_react84.forwardRef)(function DateTimeInput2({
|
|
19036
19048
|
id: inputId,
|
|
19037
19049
|
value,
|
|
19038
19050
|
initialValue = null,
|
|
@@ -19065,34 +19077,34 @@ var DateTimeInput = (0, import_react85.forwardRef)(function DateTimeInput2({
|
|
|
19065
19077
|
const translation = useHightideTranslation();
|
|
19066
19078
|
const { timeZone: contextTimeZone } = useLocale();
|
|
19067
19079
|
const timeZone = timeZoneOverride ?? contextTimeZone;
|
|
19068
|
-
const [isOpen, setIsOpen] = (0,
|
|
19080
|
+
const [isOpen, setIsOpen] = (0, import_react84.useState)(false);
|
|
19069
19081
|
const [state, setState] = useControlledState({
|
|
19070
19082
|
value,
|
|
19071
19083
|
onValueChange,
|
|
19072
19084
|
defaultValue: initialValue
|
|
19073
19085
|
});
|
|
19074
|
-
const [dialogValue, setDialogValue] = (0,
|
|
19075
|
-
const changeOpenWrapper = (0,
|
|
19086
|
+
const [dialogValue, setDialogValue] = (0, import_react84.useState)(state);
|
|
19087
|
+
const changeOpenWrapper = (0, import_react84.useCallback)((isOpen2) => {
|
|
19076
19088
|
onDialogOpeningChange?.(isOpen2);
|
|
19077
19089
|
setIsOpen(isOpen2);
|
|
19078
19090
|
}, [onDialogOpeningChange]);
|
|
19079
|
-
const toZoned = (0,
|
|
19080
|
-
const fromZoned = (0,
|
|
19081
|
-
const generatedId = (0,
|
|
19082
|
-
const ids = (0,
|
|
19091
|
+
const toZoned = (0, import_react84.useCallback)((date) => DateUtils.toZonedDate(date, timeZone), [timeZone]);
|
|
19092
|
+
const fromZoned = (0, import_react84.useCallback)((date) => DateUtils.fromZonedDate(date, timeZone), [timeZone]);
|
|
19093
|
+
const generatedId = (0, import_react84.useId)();
|
|
19094
|
+
const ids = (0, import_react84.useMemo)(() => ({
|
|
19083
19095
|
input: inputId ?? `date-time-input-${generatedId}`,
|
|
19084
19096
|
popup: `date-time-input-popup-${generatedId}`,
|
|
19085
19097
|
label: `date-time-input-label-${generatedId}`
|
|
19086
19098
|
}), [generatedId, inputId]);
|
|
19087
|
-
const controlRef = (0,
|
|
19088
|
-
const fieldRef = (0,
|
|
19089
|
-
(0,
|
|
19090
|
-
(0,
|
|
19099
|
+
const controlRef = (0, import_react84.useRef)(null);
|
|
19100
|
+
const fieldRef = (0, import_react84.useRef)(null);
|
|
19101
|
+
(0, import_react84.useImperativeHandle)(forwardedRef, () => controlRef.current);
|
|
19102
|
+
(0, import_react84.useEffect)(() => {
|
|
19091
19103
|
if (readOnly || disabled) {
|
|
19092
19104
|
changeOpenWrapper(false);
|
|
19093
19105
|
}
|
|
19094
19106
|
}, [changeOpenWrapper, readOnly, disabled]);
|
|
19095
|
-
(0,
|
|
19107
|
+
(0, import_react84.useEffect)(() => {
|
|
19096
19108
|
if (isOpen) {
|
|
19097
19109
|
setDialogValue(state);
|
|
19098
19110
|
}
|
|
@@ -19226,25 +19238,25 @@ var DateTimeInput = (0, import_react85.forwardRef)(function DateTimeInput2({
|
|
|
19226
19238
|
});
|
|
19227
19239
|
|
|
19228
19240
|
// src/components/user-interaction/MultiSelect/MultiSelect.tsx
|
|
19229
|
-
var
|
|
19241
|
+
var import_react92 = require("react");
|
|
19230
19242
|
|
|
19231
19243
|
// src/components/user-interaction/MultiSelect/MultiSelectRoot.tsx
|
|
19232
|
-
var
|
|
19244
|
+
var import_react88 = require("react");
|
|
19233
19245
|
|
|
19234
19246
|
// src/components/user-interaction/MultiSelect/MultiSelectContext.tsx
|
|
19235
|
-
var
|
|
19236
|
-
var MultiSelectContext = (0,
|
|
19247
|
+
var import_react85 = require("react");
|
|
19248
|
+
var MultiSelectContext = (0, import_react85.createContext)(null);
|
|
19237
19249
|
function useMultiSelectContext() {
|
|
19238
|
-
const ctx = (0,
|
|
19250
|
+
const ctx = (0, import_react85.useContext)(MultiSelectContext);
|
|
19239
19251
|
if (!ctx) throw new Error("useMultiSelectContext must be used within MultiSelectRoot");
|
|
19240
19252
|
return ctx;
|
|
19241
19253
|
}
|
|
19242
19254
|
|
|
19243
19255
|
// src/components/user-interaction/MultiSelect/useMultiSelect.ts
|
|
19244
|
-
var
|
|
19256
|
+
var import_react87 = require("react");
|
|
19245
19257
|
|
|
19246
19258
|
// src/hooks/useMultiSelection.ts
|
|
19247
|
-
var
|
|
19259
|
+
var import_react86 = require("react");
|
|
19248
19260
|
function useMultiSelection({
|
|
19249
19261
|
options: optionsList,
|
|
19250
19262
|
value,
|
|
@@ -19258,8 +19270,8 @@ function useMultiSelection({
|
|
|
19258
19270
|
defaultValue: [...initialSelection],
|
|
19259
19271
|
isControlled
|
|
19260
19272
|
});
|
|
19261
|
-
const isSelected = (0,
|
|
19262
|
-
const toggleSelection = (0,
|
|
19273
|
+
const isSelected = (0, import_react86.useCallback)((id) => selection.includes(id), [selection]);
|
|
19274
|
+
const toggleSelection = (0, import_react86.useCallback)(
|
|
19263
19275
|
(id) => {
|
|
19264
19276
|
const option = optionsList.find((o) => o.id === id);
|
|
19265
19277
|
if (!option || option.disabled) return;
|
|
@@ -19267,11 +19279,11 @@ function useMultiSelection({
|
|
|
19267
19279
|
},
|
|
19268
19280
|
[optionsList, setSelection]
|
|
19269
19281
|
);
|
|
19270
|
-
const setSelectionValue = (0,
|
|
19282
|
+
const setSelectionValue = (0, import_react86.useCallback)(
|
|
19271
19283
|
(next) => setSelection(Array.from(next)),
|
|
19272
19284
|
[setSelection]
|
|
19273
19285
|
);
|
|
19274
|
-
return (0,
|
|
19286
|
+
return (0, import_react86.useMemo)(
|
|
19275
19287
|
() => ({
|
|
19276
19288
|
selection,
|
|
19277
19289
|
setSelection: setSelectionValue,
|
|
@@ -19293,9 +19305,9 @@ function useMultiSelect({
|
|
|
19293
19305
|
initialIsOpen = false,
|
|
19294
19306
|
typeAheadResetMs = 500
|
|
19295
19307
|
}) {
|
|
19296
|
-
const [isOpen, setIsOpen] = (0,
|
|
19297
|
-
const [searchQuery, setSearchQuery] = (0,
|
|
19298
|
-
const selectionOptions = (0,
|
|
19308
|
+
const [isOpen, setIsOpen] = (0, import_react87.useState)(initialIsOpen);
|
|
19309
|
+
const [searchQuery, setSearchQuery] = (0, import_react87.useState)("");
|
|
19310
|
+
const selectionOptions = (0, import_react87.useMemo)(
|
|
19299
19311
|
() => options.map((o) => ({ id: o.id, disabled: o.disabled })),
|
|
19300
19312
|
[options]
|
|
19301
19313
|
);
|
|
@@ -19311,13 +19323,13 @@ function useMultiSelect({
|
|
|
19311
19323
|
const { searchResult: visibleOptions } = useSearch({
|
|
19312
19324
|
items: options,
|
|
19313
19325
|
searchQuery,
|
|
19314
|
-
toTags: (0,
|
|
19326
|
+
toTags: (0, import_react87.useCallback)((o) => [o.label ?? ""], [])
|
|
19315
19327
|
});
|
|
19316
|
-
const visibleOptionIds = (0,
|
|
19328
|
+
const visibleOptionIds = (0, import_react87.useMemo)(
|
|
19317
19329
|
() => visibleOptions.map((o) => o.id),
|
|
19318
19330
|
[visibleOptions]
|
|
19319
19331
|
);
|
|
19320
|
-
const enabledOptions = (0,
|
|
19332
|
+
const enabledOptions = (0, import_react87.useMemo)(
|
|
19321
19333
|
() => visibleOptions.filter((o) => !o.disabled),
|
|
19322
19334
|
[visibleOptions]
|
|
19323
19335
|
);
|
|
@@ -19330,7 +19342,7 @@ function useMultiSelect({
|
|
|
19330
19342
|
options: enabledOptions,
|
|
19331
19343
|
resetTimer: typeAheadResetMs,
|
|
19332
19344
|
toString: (o) => o.label ?? "",
|
|
19333
|
-
onResultChange: (0,
|
|
19345
|
+
onResultChange: (0, import_react87.useCallback)(
|
|
19334
19346
|
(option) => {
|
|
19335
19347
|
if (option) listNav.highlight(option.id);
|
|
19336
19348
|
},
|
|
@@ -19338,14 +19350,14 @@ function useMultiSelect({
|
|
|
19338
19350
|
)
|
|
19339
19351
|
});
|
|
19340
19352
|
const { reset: typeAheadReset, addToTypeAhead } = typeAhead;
|
|
19341
|
-
(0,
|
|
19353
|
+
(0, import_react87.useEffect)(() => {
|
|
19342
19354
|
if (!isOpen) typeAheadReset();
|
|
19343
19355
|
}, [isOpen, typeAheadReset]);
|
|
19344
|
-
const highlightItem = (0,
|
|
19356
|
+
const highlightItem = (0, import_react87.useCallback)((id) => {
|
|
19345
19357
|
if (!enabledOptions.some((o) => o.id === id)) return;
|
|
19346
19358
|
listNavHighlight(id);
|
|
19347
19359
|
}, [enabledOptions, listNavHighlight]);
|
|
19348
|
-
const toggleSelectionValue = (0,
|
|
19360
|
+
const toggleSelectionValue = (0, import_react87.useCallback)((id, newIsSelected) => {
|
|
19349
19361
|
const next = newIsSelected ?? !isSelected(id);
|
|
19350
19362
|
if (next) {
|
|
19351
19363
|
toggleSelection(id);
|
|
@@ -19354,7 +19366,7 @@ function useMultiSelect({
|
|
|
19354
19366
|
}
|
|
19355
19367
|
highlightItem(id);
|
|
19356
19368
|
}, [toggleSelection, setSelection, highlightItem, isSelected, selection]);
|
|
19357
|
-
const setIsOpenWrapper = (0,
|
|
19369
|
+
const setIsOpenWrapper = (0, import_react87.useCallback)(
|
|
19358
19370
|
(open, behavior) => {
|
|
19359
19371
|
setIsOpen(open);
|
|
19360
19372
|
behavior = behavior ?? "first";
|
|
@@ -19385,13 +19397,13 @@ function useMultiSelect({
|
|
|
19385
19397
|
enabledOptions
|
|
19386
19398
|
]
|
|
19387
19399
|
);
|
|
19388
|
-
const toggleOpenWrapper = (0,
|
|
19400
|
+
const toggleOpenWrapper = (0, import_react87.useCallback)(
|
|
19389
19401
|
(behavior) => {
|
|
19390
19402
|
setIsOpenWrapper(!isOpen, behavior);
|
|
19391
19403
|
},
|
|
19392
19404
|
[isOpen, setIsOpenWrapper]
|
|
19393
19405
|
);
|
|
19394
|
-
const state = (0,
|
|
19406
|
+
const state = (0, import_react87.useMemo)(
|
|
19395
19407
|
() => ({
|
|
19396
19408
|
value: [...selection],
|
|
19397
19409
|
highlightedId: listNav.highlightedId,
|
|
@@ -19407,11 +19419,11 @@ function useMultiSelect({
|
|
|
19407
19419
|
options
|
|
19408
19420
|
]
|
|
19409
19421
|
);
|
|
19410
|
-
const computedState = (0,
|
|
19422
|
+
const computedState = (0, import_react87.useMemo)(
|
|
19411
19423
|
() => ({ visibleOptionIds }),
|
|
19412
19424
|
[visibleOptionIds]
|
|
19413
19425
|
);
|
|
19414
|
-
const actions = (0,
|
|
19426
|
+
const actions = (0, import_react87.useMemo)(
|
|
19415
19427
|
() => ({
|
|
19416
19428
|
setIsOpen: setIsOpenWrapper,
|
|
19417
19429
|
toggleOpen: toggleOpenWrapper,
|
|
@@ -19440,7 +19452,7 @@ function useMultiSelect({
|
|
|
19440
19452
|
addToTypeAhead
|
|
19441
19453
|
]
|
|
19442
19454
|
);
|
|
19443
|
-
return (0,
|
|
19455
|
+
return (0, import_react87.useMemo)(
|
|
19444
19456
|
() => ({
|
|
19445
19457
|
...state,
|
|
19446
19458
|
...computedState,
|
|
@@ -19468,16 +19480,16 @@ function MultiSelectRoot({
|
|
|
19468
19480
|
readOnly = false,
|
|
19469
19481
|
required = false
|
|
19470
19482
|
}) {
|
|
19471
|
-
const [triggerRef, setTriggerRef] = (0,
|
|
19472
|
-
const [options, setOptions] = (0,
|
|
19473
|
-
const generatedId = (0,
|
|
19474
|
-
const [ids, setIds] = (0,
|
|
19483
|
+
const [triggerRef, setTriggerRef] = (0, import_react88.useState)(null);
|
|
19484
|
+
const [options, setOptions] = (0, import_react88.useState)([]);
|
|
19485
|
+
const generatedId = (0, import_react88.useId)();
|
|
19486
|
+
const [ids, setIds] = (0, import_react88.useState)({
|
|
19475
19487
|
trigger: "multi-select-" + generatedId,
|
|
19476
19488
|
content: "multi-select-content-" + generatedId,
|
|
19477
19489
|
listbox: "multi-select-listbox-" + generatedId,
|
|
19478
19490
|
searchInput: "multi-select-search-" + generatedId
|
|
19479
19491
|
});
|
|
19480
|
-
const registerOption = (0,
|
|
19492
|
+
const registerOption = (0, import_react88.useCallback)((item) => {
|
|
19481
19493
|
setOptions((prev) => {
|
|
19482
19494
|
const next = prev.filter((o) => o.id !== item.id);
|
|
19483
19495
|
next.push(item);
|
|
@@ -19486,12 +19498,12 @@ function MultiSelectRoot({
|
|
|
19486
19498
|
});
|
|
19487
19499
|
return () => setOptions((prev) => prev.filter((o) => o.id !== item.id));
|
|
19488
19500
|
}, []);
|
|
19489
|
-
const registerTrigger = (0,
|
|
19501
|
+
const registerTrigger = (0, import_react88.useCallback)((ref) => {
|
|
19490
19502
|
setTriggerRef(ref);
|
|
19491
19503
|
return () => setTriggerRef(null);
|
|
19492
19504
|
}, []);
|
|
19493
|
-
const compare = (0,
|
|
19494
|
-
const idToOptionMap = (0,
|
|
19505
|
+
const compare = (0, import_react88.useMemo)(() => compareFunction ?? Object.is, [compareFunction]);
|
|
19506
|
+
const idToOptionMap = (0, import_react88.useMemo)(
|
|
19495
19507
|
() => options.reduce(
|
|
19496
19508
|
(acc, o) => {
|
|
19497
19509
|
acc[o.id] = o;
|
|
@@ -19501,22 +19513,22 @@ function MultiSelectRoot({
|
|
|
19501
19513
|
),
|
|
19502
19514
|
[options]
|
|
19503
19515
|
);
|
|
19504
|
-
const mappedValueIds = (0,
|
|
19516
|
+
const mappedValueIds = (0, import_react88.useMemo)(() => {
|
|
19505
19517
|
if (value == null) return void 0;
|
|
19506
19518
|
return value.map((v) => options.find((o) => compare(o.value, v))?.id).filter((id) => id !== void 0);
|
|
19507
19519
|
}, [options, value, compare]);
|
|
19508
|
-
const mappedInitialValueIds = (0,
|
|
19520
|
+
const mappedInitialValueIds = (0, import_react88.useMemo)(() => {
|
|
19509
19521
|
if (initialValue == null) return [];
|
|
19510
19522
|
return initialValue.map((v) => options.find((o) => compare(o.value, v))?.id).filter((id) => id !== void 0);
|
|
19511
19523
|
}, [options, initialValue, compare]);
|
|
19512
|
-
const onValueChangeStable = (0,
|
|
19524
|
+
const onValueChangeStable = (0, import_react88.useCallback)(
|
|
19513
19525
|
(ids2) => {
|
|
19514
19526
|
const values = ids2.map((id) => idToOptionMap[id]?.value).filter((v) => v != null);
|
|
19515
19527
|
onValueChange?.(values);
|
|
19516
19528
|
},
|
|
19517
19529
|
[idToOptionMap, onValueChange]
|
|
19518
19530
|
);
|
|
19519
|
-
const onEditCompleteStable = (0,
|
|
19531
|
+
const onEditCompleteStable = (0, import_react88.useCallback)(
|
|
19520
19532
|
(ids2) => {
|
|
19521
19533
|
const values = ids2.map((id) => idToOptionMap[id]?.value).filter((v) => v != null);
|
|
19522
19534
|
onEditComplete?.(values);
|
|
@@ -19533,12 +19545,12 @@ function MultiSelectRoot({
|
|
|
19533
19545
|
onClose
|
|
19534
19546
|
});
|
|
19535
19547
|
const { setSearchQuery } = state;
|
|
19536
|
-
(0,
|
|
19548
|
+
(0, import_react88.useEffect)(() => {
|
|
19537
19549
|
if (showSearch === false) {
|
|
19538
19550
|
setSearchQuery("");
|
|
19539
19551
|
}
|
|
19540
19552
|
}, [showSearch, setSearchQuery]);
|
|
19541
|
-
const contextValue = (0,
|
|
19553
|
+
const contextValue = (0, import_react88.useMemo)(() => {
|
|
19542
19554
|
const valueT = state.value.map((id) => idToOptionMap[id]?.value).filter((v) => v != null);
|
|
19543
19555
|
return {
|
|
19544
19556
|
invalid,
|
|
@@ -19609,16 +19621,16 @@ function MultiSelectRoot({
|
|
|
19609
19621
|
}
|
|
19610
19622
|
|
|
19611
19623
|
// src/components/user-interaction/MultiSelect/MultiSelectButton.tsx
|
|
19612
|
-
var
|
|
19624
|
+
var import_react90 = require("react");
|
|
19613
19625
|
|
|
19614
19626
|
// src/components/user-interaction/MultiSelect/MultiSelectOption.tsx
|
|
19615
19627
|
var import_clsx32 = __toESM(require("clsx"));
|
|
19616
19628
|
var import_lucide_react23 = require("lucide-react");
|
|
19617
|
-
var
|
|
19629
|
+
var import_react89 = require("react");
|
|
19618
19630
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
19619
|
-
var MultiSelectOptionDisplayContext = (0,
|
|
19631
|
+
var MultiSelectOptionDisplayContext = (0, import_react89.createContext)(null);
|
|
19620
19632
|
function useMultiSelectOptionDisplayLocation() {
|
|
19621
|
-
const context = (0,
|
|
19633
|
+
const context = (0, import_react89.useContext)(MultiSelectOptionDisplayContext);
|
|
19622
19634
|
if (!context) {
|
|
19623
19635
|
throw new Error(
|
|
19624
19636
|
"useMultiSelectOptionDisplayLocation must be used within a MultiSelectOptionDisplayContext"
|
|
@@ -19626,7 +19638,7 @@ function useMultiSelectOptionDisplayLocation() {
|
|
|
19626
19638
|
}
|
|
19627
19639
|
return context;
|
|
19628
19640
|
}
|
|
19629
|
-
var MultiSelectOption = (0,
|
|
19641
|
+
var MultiSelectOption = (0, import_react89.forwardRef)(function MultiSelectOption2({
|
|
19630
19642
|
children,
|
|
19631
19643
|
label,
|
|
19632
19644
|
value,
|
|
@@ -19636,12 +19648,12 @@ var MultiSelectOption = (0, import_react90.forwardRef)(function MultiSelectOptio
|
|
|
19636
19648
|
}, ref) {
|
|
19637
19649
|
const context = useMultiSelectContext();
|
|
19638
19650
|
const { registerOption } = context;
|
|
19639
|
-
const itemRef = (0,
|
|
19651
|
+
const itemRef = (0, import_react89.useRef)(null);
|
|
19640
19652
|
const display = children ?? label;
|
|
19641
19653
|
const iconAppearanceResolved = iconAppearance ?? context.config.iconAppearance;
|
|
19642
|
-
const generatedId = (0,
|
|
19654
|
+
const generatedId = (0, import_react89.useId)();
|
|
19643
19655
|
const optionId = props?.id ?? "multi-select-option-" + generatedId;
|
|
19644
|
-
(0,
|
|
19656
|
+
(0, import_react89.useEffect)(() => {
|
|
19645
19657
|
return registerOption({
|
|
19646
19658
|
id: optionId,
|
|
19647
19659
|
value,
|
|
@@ -19709,7 +19721,7 @@ var MultiSelectOption = (0, import_react90.forwardRef)(function MultiSelectOptio
|
|
|
19709
19721
|
|
|
19710
19722
|
// src/components/user-interaction/MultiSelect/MultiSelectButton.tsx
|
|
19711
19723
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
19712
|
-
var MultiSelectButton = (0,
|
|
19724
|
+
var MultiSelectButton = (0, import_react90.forwardRef)(function MultiSelectButton2({
|
|
19713
19725
|
id,
|
|
19714
19726
|
placeholder,
|
|
19715
19727
|
disabled: disabledOverride,
|
|
@@ -19722,12 +19734,12 @@ var MultiSelectButton = (0, import_react91.forwardRef)(function MultiSelectButto
|
|
|
19722
19734
|
const { config, layout } = context;
|
|
19723
19735
|
const { setIds } = config;
|
|
19724
19736
|
const { registerTrigger } = layout;
|
|
19725
|
-
(0,
|
|
19737
|
+
(0, import_react90.useEffect)(() => {
|
|
19726
19738
|
if (id) setIds((prev) => ({ ...prev, trigger: id }));
|
|
19727
19739
|
}, [id, setIds]);
|
|
19728
|
-
const innerRef = (0,
|
|
19729
|
-
(0,
|
|
19730
|
-
(0,
|
|
19740
|
+
const innerRef = (0, import_react90.useRef)(null);
|
|
19741
|
+
(0, import_react90.useImperativeHandle)(ref, () => innerRef.current);
|
|
19742
|
+
(0, import_react90.useEffect)(() => {
|
|
19731
19743
|
const unregister = registerTrigger(innerRef);
|
|
19732
19744
|
return () => unregister();
|
|
19733
19745
|
}, [registerTrigger]);
|
|
@@ -19795,23 +19807,23 @@ var MultiSelectButton = (0, import_react91.forwardRef)(function MultiSelectButto
|
|
|
19795
19807
|
});
|
|
19796
19808
|
|
|
19797
19809
|
// src/components/user-interaction/MultiSelect/MultiSelectContent.tsx
|
|
19798
|
-
var
|
|
19810
|
+
var import_react91 = require("react");
|
|
19799
19811
|
var import_clsx33 = __toESM(require("clsx"));
|
|
19800
19812
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
19801
|
-
var MultiSelectContent = (0,
|
|
19813
|
+
var MultiSelectContent = (0, import_react91.forwardRef)(function MultiSelectContent2({ id, options, showSearch: showSearchOverride, searchInputProps, ...props }, ref) {
|
|
19802
19814
|
const translation = useHightideTranslation();
|
|
19803
|
-
const innerRef = (0,
|
|
19804
|
-
const searchInputRef = (0,
|
|
19805
|
-
(0,
|
|
19815
|
+
const innerRef = (0, import_react91.useRef)(null);
|
|
19816
|
+
const searchInputRef = (0, import_react91.useRef)(null);
|
|
19817
|
+
(0, import_react91.useImperativeHandle)(ref, () => innerRef.current);
|
|
19806
19818
|
const context = useMultiSelectContext();
|
|
19807
19819
|
const { config, highlightNext, highlightPrevious, highlightFirst, highlightLast, highlightedId, handleTypeaheadKey, toggleSelection } = context;
|
|
19808
19820
|
const { setIds } = config;
|
|
19809
|
-
(0,
|
|
19821
|
+
(0, import_react91.useEffect)(() => {
|
|
19810
19822
|
if (id) setIds((prev) => ({ ...prev, content: id }));
|
|
19811
19823
|
}, [id, setIds]);
|
|
19812
19824
|
const showSearch = showSearchOverride ?? context.search.hasSearch;
|
|
19813
19825
|
const listboxAriaLabel = showSearch ? translation("searchResults") : void 0;
|
|
19814
|
-
const keyHandler = (0,
|
|
19826
|
+
const keyHandler = (0, import_react91.useCallback)(
|
|
19815
19827
|
(event) => {
|
|
19816
19828
|
switch (event.key) {
|
|
19817
19829
|
case "ArrowDown":
|
|
@@ -19925,7 +19937,7 @@ var MultiSelectContent = (0, import_react92.forwardRef)(function MultiSelectCont
|
|
|
19925
19937
|
|
|
19926
19938
|
// src/components/user-interaction/MultiSelect/MultiSelect.tsx
|
|
19927
19939
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
19928
|
-
var MultiSelect = (0,
|
|
19940
|
+
var MultiSelect = (0, import_react92.forwardRef)(
|
|
19929
19941
|
function MultiSelect2({ children, contentPanelProps, buttonProps, ...props }, ref) {
|
|
19930
19942
|
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(MultiSelectRoot, { ...props, children: [
|
|
19931
19943
|
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(MultiSelectButton, { ref, ...buttonProps }),
|
|
@@ -19951,7 +19963,7 @@ var FilterOperatorLabel = ({ operator }) => {
|
|
|
19951
19963
|
|
|
19952
19964
|
// src/components/user-interaction/data/FilterPopUp.tsx
|
|
19953
19965
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
19954
|
-
var FilterBasePopUp = (0,
|
|
19966
|
+
var FilterBasePopUp = (0, import_react93.forwardRef)(function FilterBasePopUp2({
|
|
19955
19967
|
children,
|
|
19956
19968
|
name,
|
|
19957
19969
|
operator,
|
|
@@ -19963,11 +19975,11 @@ var FilterBasePopUp = (0, import_react94.forwardRef)(function FilterBasePopUp2({
|
|
|
19963
19975
|
...props
|
|
19964
19976
|
}, ref) {
|
|
19965
19977
|
const translation = useHightideTranslation();
|
|
19966
|
-
const operators = (0,
|
|
19978
|
+
const operators = (0, import_react93.useMemo)(() => {
|
|
19967
19979
|
if (!operatorOverrides || operatorOverrides.length === 0) return allowedOperators;
|
|
19968
19980
|
return allowedOperators.filter((op) => operatorOverrides.includes(op));
|
|
19969
19981
|
}, [allowedOperators, operatorOverrides]);
|
|
19970
|
-
(0,
|
|
19982
|
+
(0, import_react93.useEffect)(() => {
|
|
19971
19983
|
if (operators.length === 0) {
|
|
19972
19984
|
onRemove();
|
|
19973
19985
|
}
|
|
@@ -20028,7 +20040,7 @@ var FilterBasePopUp = (0, import_react94.forwardRef)(function FilterBasePopUp2({
|
|
|
20028
20040
|
}
|
|
20029
20041
|
);
|
|
20030
20042
|
});
|
|
20031
|
-
var TextFilterPopUp = (0,
|
|
20043
|
+
var TextFilterPopUp = (0, import_react93.forwardRef)(function TextFilterPopUp2({
|
|
20032
20044
|
name,
|
|
20033
20045
|
value,
|
|
20034
20046
|
onValueChange,
|
|
@@ -20036,12 +20048,12 @@ var TextFilterPopUp = (0, import_react94.forwardRef)(function TextFilterPopUp2({
|
|
|
20036
20048
|
...props
|
|
20037
20049
|
}, ref) {
|
|
20038
20050
|
const translation = useHightideTranslation();
|
|
20039
|
-
const id = (0,
|
|
20051
|
+
const id = (0, import_react93.useId)();
|
|
20040
20052
|
const ids = {
|
|
20041
20053
|
search: `text-filter-search-${id}`,
|
|
20042
20054
|
caseSensitive: `text-filter-case-sensitive-${id}`
|
|
20043
20055
|
};
|
|
20044
|
-
const operator = (0,
|
|
20056
|
+
const operator = (0, import_react93.useMemo)(() => {
|
|
20045
20057
|
const suggestion = value?.operator ?? "contains";
|
|
20046
20058
|
if (!FilterOperatorUtils.typeCheck.text(suggestion)) {
|
|
20047
20059
|
return "contains";
|
|
@@ -20083,7 +20095,7 @@ var TextFilterPopUp = (0, import_react94.forwardRef)(function TextFilterPopUp2({
|
|
|
20083
20095
|
}
|
|
20084
20096
|
);
|
|
20085
20097
|
});
|
|
20086
|
-
var NumberFilterPopUp = (0,
|
|
20098
|
+
var NumberFilterPopUp = (0, import_react93.forwardRef)(function NumberFilterPopUp2({
|
|
20087
20099
|
name,
|
|
20088
20100
|
value,
|
|
20089
20101
|
onValueChange,
|
|
@@ -20091,13 +20103,13 @@ var NumberFilterPopUp = (0, import_react94.forwardRef)(function NumberFilterPopU
|
|
|
20091
20103
|
...props
|
|
20092
20104
|
}, ref) {
|
|
20093
20105
|
const translation = useHightideTranslation();
|
|
20094
|
-
const id = (0,
|
|
20106
|
+
const id = (0, import_react93.useId)();
|
|
20095
20107
|
const ids = {
|
|
20096
20108
|
min: `number-filter-min-${id}`,
|
|
20097
20109
|
max: `number-filter-max-${id}`,
|
|
20098
20110
|
compareValue: `number-filter-compare-value-${id}`
|
|
20099
20111
|
};
|
|
20100
|
-
const operator = (0,
|
|
20112
|
+
const operator = (0, import_react93.useMemo)(() => {
|
|
20101
20113
|
const suggestion = value?.operator ?? "between";
|
|
20102
20114
|
if (!FilterOperatorUtils.typeCheck.number(suggestion)) {
|
|
20103
20115
|
return "between";
|
|
@@ -20186,7 +20198,7 @@ var NumberFilterPopUp = (0, import_react94.forwardRef)(function NumberFilterPopU
|
|
|
20186
20198
|
}
|
|
20187
20199
|
);
|
|
20188
20200
|
});
|
|
20189
|
-
var DateFilterPopUp = (0,
|
|
20201
|
+
var DateFilterPopUp = (0, import_react93.forwardRef)(function DateFilterPopUp2({
|
|
20190
20202
|
name,
|
|
20191
20203
|
value,
|
|
20192
20204
|
onValueChange,
|
|
@@ -20194,13 +20206,13 @@ var DateFilterPopUp = (0, import_react94.forwardRef)(function DateFilterPopUp2({
|
|
|
20194
20206
|
...props
|
|
20195
20207
|
}, ref) {
|
|
20196
20208
|
const translation = useHightideTranslation();
|
|
20197
|
-
const id = (0,
|
|
20209
|
+
const id = (0, import_react93.useId)();
|
|
20198
20210
|
const ids = {
|
|
20199
20211
|
startDate: `date-filter-start-date-${id}`,
|
|
20200
20212
|
endDate: `date-filter-end-date-${id}`,
|
|
20201
20213
|
compareDate: `date-filter-compare-date-${id}`
|
|
20202
20214
|
};
|
|
20203
|
-
const operator = (0,
|
|
20215
|
+
const operator = (0, import_react93.useMemo)(() => {
|
|
20204
20216
|
const suggestion = value?.operator ?? "between";
|
|
20205
20217
|
if (!FilterOperatorUtils.typeCheck.date(suggestion)) {
|
|
20206
20218
|
return "between";
|
|
@@ -20208,8 +20220,8 @@ var DateFilterPopUp = (0, import_react94.forwardRef)(function DateFilterPopUp2({
|
|
|
20208
20220
|
return suggestion;
|
|
20209
20221
|
}, [value]);
|
|
20210
20222
|
const parameter = value?.parameter ?? {};
|
|
20211
|
-
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0,
|
|
20212
|
-
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0,
|
|
20223
|
+
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0, import_react93.useState)(null);
|
|
20224
|
+
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0, import_react93.useState)(null);
|
|
20213
20225
|
const needsRangeInput = operator === "between" || operator === "notBetween";
|
|
20214
20226
|
const needsParameterInput = operator !== "isUndefined" && operator !== "isNotUndefined";
|
|
20215
20227
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
@@ -20328,7 +20340,7 @@ var DateFilterPopUp = (0, import_react94.forwardRef)(function DateFilterPopUp2({
|
|
|
20328
20340
|
}
|
|
20329
20341
|
);
|
|
20330
20342
|
});
|
|
20331
|
-
var DatetimeFilterPopUp = (0,
|
|
20343
|
+
var DatetimeFilterPopUp = (0, import_react93.forwardRef)(function DatetimeFilterPopUp2({
|
|
20332
20344
|
name,
|
|
20333
20345
|
value,
|
|
20334
20346
|
onValueChange,
|
|
@@ -20336,13 +20348,13 @@ var DatetimeFilterPopUp = (0, import_react94.forwardRef)(function DatetimeFilter
|
|
|
20336
20348
|
...props
|
|
20337
20349
|
}, ref) {
|
|
20338
20350
|
const translation = useHightideTranslation();
|
|
20339
|
-
const id = (0,
|
|
20351
|
+
const id = (0, import_react93.useId)();
|
|
20340
20352
|
const ids = {
|
|
20341
20353
|
startDate: `datetime-filter-start-date-${id}`,
|
|
20342
20354
|
endDate: `datetime-filter-end-date-${id}`,
|
|
20343
20355
|
compareDate: `datetime-filter-compare-date-${id}`
|
|
20344
20356
|
};
|
|
20345
|
-
const operator = (0,
|
|
20357
|
+
const operator = (0, import_react93.useMemo)(() => {
|
|
20346
20358
|
const suggestion = value?.operator ?? "between";
|
|
20347
20359
|
if (!FilterOperatorUtils.typeCheck.datetime(suggestion)) {
|
|
20348
20360
|
return "between";
|
|
@@ -20350,8 +20362,8 @@ var DatetimeFilterPopUp = (0, import_react94.forwardRef)(function DatetimeFilter
|
|
|
20350
20362
|
return suggestion;
|
|
20351
20363
|
}, [value]);
|
|
20352
20364
|
const parameter = value?.parameter ?? {};
|
|
20353
|
-
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0,
|
|
20354
|
-
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0,
|
|
20365
|
+
const [temporaryMinDateValue, setTemporaryMinDateValue] = (0, import_react93.useState)(null);
|
|
20366
|
+
const [temporaryMaxDateValue, setTemporaryMaxDateValue] = (0, import_react93.useState)(null);
|
|
20355
20367
|
const needsRangeInput = operator === "between" || operator === "notBetween";
|
|
20356
20368
|
const needsParameterInput = operator !== "isUndefined" && operator !== "isNotUndefined";
|
|
20357
20369
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
@@ -20470,14 +20482,14 @@ var DatetimeFilterPopUp = (0, import_react94.forwardRef)(function DatetimeFilter
|
|
|
20470
20482
|
}
|
|
20471
20483
|
);
|
|
20472
20484
|
});
|
|
20473
|
-
var BooleanFilterPopUp = (0,
|
|
20485
|
+
var BooleanFilterPopUp = (0, import_react93.forwardRef)(function BooleanFilterPopUp2({
|
|
20474
20486
|
name,
|
|
20475
20487
|
value,
|
|
20476
20488
|
onValueChange,
|
|
20477
20489
|
onRemove,
|
|
20478
20490
|
...props
|
|
20479
20491
|
}, ref) {
|
|
20480
|
-
const operator = (0,
|
|
20492
|
+
const operator = (0, import_react93.useMemo)(() => {
|
|
20481
20493
|
const suggestion = value?.operator ?? "isTrue";
|
|
20482
20494
|
if (!FilterOperatorUtils.typeCheck.boolean(suggestion)) {
|
|
20483
20495
|
return "isTrue";
|
|
@@ -20498,7 +20510,7 @@ var BooleanFilterPopUp = (0, import_react94.forwardRef)(function BooleanFilterPo
|
|
|
20498
20510
|
}
|
|
20499
20511
|
);
|
|
20500
20512
|
});
|
|
20501
|
-
var TagsFilterPopUp = (0,
|
|
20513
|
+
var TagsFilterPopUp = (0, import_react93.forwardRef)(function TagsFilterPopUp2({
|
|
20502
20514
|
name,
|
|
20503
20515
|
value,
|
|
20504
20516
|
onValueChange,
|
|
@@ -20507,7 +20519,7 @@ var TagsFilterPopUp = (0, import_react94.forwardRef)(function TagsFilterPopUp2({
|
|
|
20507
20519
|
...props
|
|
20508
20520
|
}, ref) {
|
|
20509
20521
|
const translation = useHightideTranslation();
|
|
20510
|
-
const operator = (0,
|
|
20522
|
+
const operator = (0, import_react93.useMemo)(() => {
|
|
20511
20523
|
const suggestion = value?.operator ?? "contains";
|
|
20512
20524
|
if (!FilterOperatorUtils.typeCheck.tags(suggestion)) {
|
|
20513
20525
|
return "contains";
|
|
@@ -20552,7 +20564,7 @@ var TagsFilterPopUp = (0, import_react94.forwardRef)(function TagsFilterPopUp2({
|
|
|
20552
20564
|
}
|
|
20553
20565
|
);
|
|
20554
20566
|
});
|
|
20555
|
-
var TagsSingleFilterPopUp = (0,
|
|
20567
|
+
var TagsSingleFilterPopUp = (0, import_react93.forwardRef)(function TagsSingleFilterPopUp2({
|
|
20556
20568
|
name,
|
|
20557
20569
|
value,
|
|
20558
20570
|
onValueChange,
|
|
@@ -20561,7 +20573,7 @@ var TagsSingleFilterPopUp = (0, import_react94.forwardRef)(function TagsSingleFi
|
|
|
20561
20573
|
...props
|
|
20562
20574
|
}, ref) {
|
|
20563
20575
|
const translation = useHightideTranslation();
|
|
20564
|
-
const operator = (0,
|
|
20576
|
+
const operator = (0, import_react93.useMemo)(() => {
|
|
20565
20577
|
const suggestion = value?.operator ?? "contains";
|
|
20566
20578
|
if (!FilterOperatorUtils.typeCheck.tagsSingle(suggestion)) {
|
|
20567
20579
|
return "contains";
|
|
@@ -20623,8 +20635,8 @@ var TagsSingleFilterPopUp = (0, import_react94.forwardRef)(function TagsSingleFi
|
|
|
20623
20635
|
}
|
|
20624
20636
|
);
|
|
20625
20637
|
});
|
|
20626
|
-
var GenericFilterPopUp = (0,
|
|
20627
|
-
const operator = (0,
|
|
20638
|
+
var GenericFilterPopUp = (0, import_react93.forwardRef)(function GenericFilterPopUp2({ name, value, onValueChange, ...props }, ref) {
|
|
20639
|
+
const operator = (0, import_react93.useMemo)(() => {
|
|
20628
20640
|
const suggestion = value?.operator ?? "isNotUndefined";
|
|
20629
20641
|
if (!FilterOperatorUtils.typeCheck.unknownType(suggestion)) {
|
|
20630
20642
|
return "isNotUndefined";
|
|
@@ -20644,7 +20656,7 @@ var GenericFilterPopUp = (0, import_react94.forwardRef)(function GenericFilterPo
|
|
|
20644
20656
|
}
|
|
20645
20657
|
);
|
|
20646
20658
|
});
|
|
20647
|
-
var FilterPopUp = (0,
|
|
20659
|
+
var FilterPopUp = (0, import_react93.forwardRef)(function FilterPopUp2({
|
|
20648
20660
|
name,
|
|
20649
20661
|
value,
|
|
20650
20662
|
onValueChange,
|
|
@@ -20681,18 +20693,18 @@ var TableFilterButton = ({
|
|
|
20681
20693
|
const translation = useHightideTranslation();
|
|
20682
20694
|
const column = header.column;
|
|
20683
20695
|
const columnFilterValue = column.getFilterValue();
|
|
20684
|
-
const [filterValue, setFilterValue] = (0,
|
|
20696
|
+
const [filterValue, setFilterValue] = (0, import_react94.useState)(columnFilterValue);
|
|
20685
20697
|
const hasFilter = !!filterValue;
|
|
20686
|
-
const anchorRef = (0,
|
|
20687
|
-
const containerRef = (0,
|
|
20688
|
-
const [isOpen, setIsOpen] = (0,
|
|
20689
|
-
const id = (0,
|
|
20690
|
-
const ids = (0,
|
|
20698
|
+
const anchorRef = (0, import_react94.useRef)(null);
|
|
20699
|
+
const containerRef = (0, import_react94.useRef)(null);
|
|
20700
|
+
const [isOpen, setIsOpen] = (0, import_react94.useState)(false);
|
|
20701
|
+
const id = (0, import_react94.useId)();
|
|
20702
|
+
const ids = (0, import_react94.useMemo)(() => ({
|
|
20691
20703
|
button: `table-filter-button-${id}`,
|
|
20692
20704
|
popup: `table-filter-popup-${id}`,
|
|
20693
20705
|
label: `table-filter-label-${id}`
|
|
20694
20706
|
}), [id]);
|
|
20695
|
-
(0,
|
|
20707
|
+
(0, import_react94.useEffect)(() => {
|
|
20696
20708
|
setFilterValue(columnFilterValue);
|
|
20697
20709
|
}, [columnFilterValue]);
|
|
20698
20710
|
const isTagsFilter = filterType === "multiTags" || filterType === "singleTag";
|
|
@@ -20753,7 +20765,7 @@ var TableFilterButton = ({
|
|
|
20753
20765
|
};
|
|
20754
20766
|
|
|
20755
20767
|
// src/components/layout/table/TableHeader.tsx
|
|
20756
|
-
var
|
|
20768
|
+
var import_react95 = require("react");
|
|
20757
20769
|
|
|
20758
20770
|
// src/components/user-interaction/data/data-types.tsx
|
|
20759
20771
|
var import_lucide_react26 = require("lucide-react");
|
|
@@ -20817,7 +20829,7 @@ var DataTypeUtils = {
|
|
|
20817
20829
|
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
20818
20830
|
var TableHeader = ({ isSticky = false }) => {
|
|
20819
20831
|
const { table } = useTableStateWithoutSizingContext();
|
|
20820
|
-
const handleResizeMove = (0,
|
|
20832
|
+
const handleResizeMove = (0, import_react95.useCallback)((e) => {
|
|
20821
20833
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
20822
20834
|
const currentX = "touches" in e ? e.touches[0].clientX : e.clientX;
|
|
20823
20835
|
const deltaOffset = currentX - (table.getState().columnSizingInfo.startOffset ?? 0);
|
|
@@ -20833,7 +20845,7 @@ var TableHeader = ({ isSticky = false }) => {
|
|
|
20833
20845
|
deltaOffset
|
|
20834
20846
|
}));
|
|
20835
20847
|
}, [table]);
|
|
20836
|
-
const handleResizeEnd = (0,
|
|
20848
|
+
const handleResizeEnd = (0, import_react95.useCallback)(() => {
|
|
20837
20849
|
if (!table.getState().columnSizingInfo.isResizingColumn) return;
|
|
20838
20850
|
const newWidth = (table.getState().columnSizingInfo.startSize ?? 0) + (table.getState().columnSizingInfo.deltaOffset ?? 0);
|
|
20839
20851
|
table.setColumnSizing((prev) => {
|
|
@@ -20851,7 +20863,7 @@ var TableHeader = ({ isSticky = false }) => {
|
|
|
20851
20863
|
startSize: null
|
|
20852
20864
|
});
|
|
20853
20865
|
}, [table]);
|
|
20854
|
-
(0,
|
|
20866
|
+
(0, import_react95.useEffect)(() => {
|
|
20855
20867
|
window.addEventListener("pointermove", handleResizeMove);
|
|
20856
20868
|
window.addEventListener("pointerup", handleResizeEnd);
|
|
20857
20869
|
return () => {
|
|
@@ -20950,7 +20962,7 @@ var TableHeader = ({ isSticky = false }) => {
|
|
|
20950
20962
|
};
|
|
20951
20963
|
|
|
20952
20964
|
// src/components/layout/table/VirtualizedTableBody.tsx
|
|
20953
|
-
var
|
|
20965
|
+
var import_react96 = require("react");
|
|
20954
20966
|
var import_react_table5 = require("@tanstack/react-table");
|
|
20955
20967
|
var import_react_virtual = require("@tanstack/react-virtual");
|
|
20956
20968
|
var import_clsx36 = __toESM(require("clsx"));
|
|
@@ -20963,11 +20975,11 @@ var VirtualizedTableBody = ({
|
|
|
20963
20975
|
const { table, onRowClick } = useTableStateWithoutSizingContext();
|
|
20964
20976
|
const { containerRef } = useTableContainerContext();
|
|
20965
20977
|
const rows = table.getRowModel().rows;
|
|
20966
|
-
const bodyRef = (0,
|
|
20967
|
-
const [isMounted, setIsMounted] = (0,
|
|
20968
|
-
const [scrollMargin, setScrollMargin] = (0,
|
|
20969
|
-
(0,
|
|
20970
|
-
(0,
|
|
20978
|
+
const bodyRef = (0, import_react96.useRef)(null);
|
|
20979
|
+
const [isMounted, setIsMounted] = (0, import_react96.useState)(false);
|
|
20980
|
+
const [scrollMargin, setScrollMargin] = (0, import_react96.useState)(0);
|
|
20981
|
+
(0, import_react96.useEffect)(() => setIsMounted(true), []);
|
|
20982
|
+
(0, import_react96.useEffect)(() => {
|
|
20971
20983
|
if (scroll !== "window") return;
|
|
20972
20984
|
const element = bodyRef.current;
|
|
20973
20985
|
if (!element || typeof window === "undefined") return;
|
|
@@ -21099,7 +21111,7 @@ var TablePagination = ({ allowChangingPageSize = true, pageSizeOptions, ...props
|
|
|
21099
21111
|
|
|
21100
21112
|
// src/components/user-interaction/Checkbox.tsx
|
|
21101
21113
|
var import_lucide_react27 = require("lucide-react");
|
|
21102
|
-
var
|
|
21114
|
+
var import_react97 = require("react");
|
|
21103
21115
|
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
21104
21116
|
var Checkbox = ({
|
|
21105
21117
|
value: controlledValue,
|
|
@@ -21118,7 +21130,7 @@ var Checkbox = ({
|
|
|
21118
21130
|
}) => {
|
|
21119
21131
|
const onEditCompleteStable = useEventCallbackStabilizer(onEditComplete);
|
|
21120
21132
|
const onValueChangeStable = useEventCallbackStabilizer(onValueChange);
|
|
21121
|
-
const onChangeWrapper = (0,
|
|
21133
|
+
const onChangeWrapper = (0, import_react97.useCallback)((value2) => {
|
|
21122
21134
|
onValueChangeStable(value2);
|
|
21123
21135
|
onEditCompleteStable(value2);
|
|
21124
21136
|
}, [onValueChangeStable, onEditCompleteStable]);
|
|
@@ -21163,7 +21175,7 @@ var Checkbox = ({
|
|
|
21163
21175
|
};
|
|
21164
21176
|
|
|
21165
21177
|
// src/components/layout/table/TableWithSelectionProvider.tsx
|
|
21166
|
-
var
|
|
21178
|
+
var import_react98 = require("react");
|
|
21167
21179
|
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
21168
21180
|
var TableWithSelectionProvider = ({
|
|
21169
21181
|
children,
|
|
@@ -21176,7 +21188,7 @@ var TableWithSelectionProvider = ({
|
|
|
21176
21188
|
...props
|
|
21177
21189
|
}) => {
|
|
21178
21190
|
const translation = useHightideTranslation();
|
|
21179
|
-
const columnDef = (0,
|
|
21191
|
+
const columnDef = (0, import_react98.useMemo)(() => [
|
|
21180
21192
|
{
|
|
21181
21193
|
id: selectionRowId,
|
|
21182
21194
|
header: ({ table }) => {
|
|
@@ -21219,7 +21231,7 @@ var TableWithSelectionProvider = ({
|
|
|
21219
21231
|
TableProvider,
|
|
21220
21232
|
{
|
|
21221
21233
|
...props,
|
|
21222
|
-
fillerRowCell: (0,
|
|
21234
|
+
fillerRowCell: (0, import_react98.useCallback)((columnId, table) => {
|
|
21223
21235
|
if (columnId === selectionRowId) {
|
|
21224
21236
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Checkbox, { value: false, disabled: true });
|
|
21225
21237
|
}
|
|
@@ -21237,7 +21249,7 @@ var TableWithSelectionProvider = ({
|
|
|
21237
21249
|
rowSelection,
|
|
21238
21250
|
...state
|
|
21239
21251
|
},
|
|
21240
|
-
onRowClick: (0,
|
|
21252
|
+
onRowClick: (0, import_react98.useCallback)((row, table) => {
|
|
21241
21253
|
if (!disableClickRowClickSelection) {
|
|
21242
21254
|
row.toggleSelected();
|
|
21243
21255
|
}
|
|
@@ -21279,7 +21291,7 @@ var TableWithSelection = ({
|
|
|
21279
21291
|
};
|
|
21280
21292
|
|
|
21281
21293
|
// src/components/layout/table/TableColumn.tsx
|
|
21282
|
-
var
|
|
21294
|
+
var import_react99 = require("react");
|
|
21283
21295
|
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
21284
21296
|
var TableColumnComponent = ({
|
|
21285
21297
|
filterType,
|
|
@@ -21291,11 +21303,11 @@ var TableColumnComponent = ({
|
|
|
21291
21303
|
"TableColumn: For filterType === multiTags or singleTag, filterData.tags must be set.",
|
|
21292
21304
|
(filterType === "multiTags" || filterType === "singleTag") && props.meta?.filterData?.tags === void 0
|
|
21293
21305
|
);
|
|
21294
|
-
const [column] = (0,
|
|
21306
|
+
const [column] = (0, import_react99.useState)({
|
|
21295
21307
|
...props,
|
|
21296
21308
|
filterFn
|
|
21297
21309
|
});
|
|
21298
|
-
(0,
|
|
21310
|
+
(0, import_react99.useEffect)(() => {
|
|
21299
21311
|
const unsubscribe = registerColumn(column);
|
|
21300
21312
|
return () => {
|
|
21301
21313
|
unsubscribe();
|
|
@@ -21303,27 +21315,27 @@ var TableColumnComponent = ({
|
|
|
21303
21315
|
}, [registerColumn, column]);
|
|
21304
21316
|
return null;
|
|
21305
21317
|
};
|
|
21306
|
-
var TableColumnFactory = () => (0,
|
|
21318
|
+
var TableColumnFactory = () => (0, import_react99.memo)(
|
|
21307
21319
|
TableColumnComponent,
|
|
21308
21320
|
(prevProps, nextProps) => {
|
|
21309
21321
|
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;
|
|
21310
21322
|
}
|
|
21311
21323
|
);
|
|
21312
21324
|
var TableColumn = (props) => {
|
|
21313
|
-
const TableColumnComponent2 = (0,
|
|
21325
|
+
const TableColumnComponent2 = (0, import_react99.useMemo)(() => TableColumnFactory(), []);
|
|
21314
21326
|
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(TableColumnComponent2, { ...props });
|
|
21315
21327
|
};
|
|
21316
21328
|
|
|
21317
21329
|
// src/components/layout/table/TableColumnSwitcher.tsx
|
|
21318
|
-
var
|
|
21330
|
+
var import_react100 = require("react");
|
|
21319
21331
|
var import_lucide_react28 = require("lucide-react");
|
|
21320
21332
|
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
21321
21333
|
var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
21322
21334
|
const { table } = useTableStateWithoutSizingContext();
|
|
21323
21335
|
const translation = useHightideTranslation();
|
|
21324
|
-
const containerRef = (0,
|
|
21325
|
-
const generatedId = (0,
|
|
21326
|
-
const ids = (0,
|
|
21336
|
+
const containerRef = (0, import_react100.useRef)(null);
|
|
21337
|
+
const generatedId = (0, import_react100.useId)();
|
|
21338
|
+
const ids = (0, import_react100.useMemo)(() => ({
|
|
21327
21339
|
popup: props.id ?? `table-column-picker-popup-${generatedId}`,
|
|
21328
21340
|
label: `table-column-picker-label-${generatedId}`
|
|
21329
21341
|
}), [generatedId, props.id]);
|
|
@@ -21332,7 +21344,7 @@ var TableColumnSwitcherPopUp = ({ ...props }) => {
|
|
|
21332
21344
|
const tableState = table.getState();
|
|
21333
21345
|
const columnOrder = tableState.columnOrder;
|
|
21334
21346
|
const columnPinning = tableState.columnPinning;
|
|
21335
|
-
const columns = (0,
|
|
21347
|
+
const columns = (0, import_react100.useMemo)(() => {
|
|
21336
21348
|
const allColumns = table.getAllColumns();
|
|
21337
21349
|
const leftPinned = [];
|
|
21338
21350
|
const unpinned = [];
|
|
@@ -21590,16 +21602,16 @@ var TableColumnSwitcher = ({ buttonProps, ...props }) => {
|
|
|
21590
21602
|
};
|
|
21591
21603
|
|
|
21592
21604
|
// src/components/user-interaction/Combobox/Combobox.tsx
|
|
21593
|
-
var
|
|
21605
|
+
var import_react106 = require("react");
|
|
21594
21606
|
|
|
21595
21607
|
// src/components/user-interaction/Combobox/ComboboxRoot.tsx
|
|
21596
|
-
var
|
|
21608
|
+
var import_react103 = require("react");
|
|
21597
21609
|
|
|
21598
21610
|
// src/components/user-interaction/Combobox/ComboboxContext.tsx
|
|
21599
|
-
var
|
|
21600
|
-
var ComboboxContext = (0,
|
|
21611
|
+
var import_react101 = require("react");
|
|
21612
|
+
var ComboboxContext = (0, import_react101.createContext)(null);
|
|
21601
21613
|
function useComboboxContext() {
|
|
21602
|
-
const ctx = (0,
|
|
21614
|
+
const ctx = (0, import_react101.useContext)(ComboboxContext);
|
|
21603
21615
|
if (ctx == null) {
|
|
21604
21616
|
throw new Error("useComboboxContext must be used within ComboboxRoot");
|
|
21605
21617
|
}
|
|
@@ -21607,7 +21619,7 @@ function useComboboxContext() {
|
|
|
21607
21619
|
}
|
|
21608
21620
|
|
|
21609
21621
|
// src/components/user-interaction/Combobox/useCombobox.ts
|
|
21610
|
-
var
|
|
21622
|
+
var import_react102 = require("react");
|
|
21611
21623
|
function useCombobox({
|
|
21612
21624
|
options,
|
|
21613
21625
|
searchQuery: controlledSearchQuery,
|
|
@@ -21622,36 +21634,36 @@ function useCombobox({
|
|
|
21622
21634
|
const { searchResult: visibleOptions } = useSearch({
|
|
21623
21635
|
items: options,
|
|
21624
21636
|
searchQuery: searchQuery ?? "",
|
|
21625
|
-
toTags: (0,
|
|
21637
|
+
toTags: (0, import_react102.useCallback)((o) => [o.label], [])
|
|
21626
21638
|
});
|
|
21627
|
-
const visibleOptionIds = (0,
|
|
21639
|
+
const visibleOptionIds = (0, import_react102.useMemo)(
|
|
21628
21640
|
() => visibleOptions.map((o) => o.id),
|
|
21629
21641
|
[visibleOptions]
|
|
21630
21642
|
);
|
|
21631
|
-
const enabledOptionIds = (0,
|
|
21643
|
+
const enabledOptionIds = (0, import_react102.useMemo)(
|
|
21632
21644
|
() => visibleOptions.filter((o) => !o.disabled).map((o) => o.id),
|
|
21633
21645
|
[visibleOptions]
|
|
21634
21646
|
);
|
|
21635
21647
|
const listNav = useListNavigation({ options: enabledOptionIds });
|
|
21636
|
-
const highlightItem = (0,
|
|
21648
|
+
const highlightItem = (0, import_react102.useCallback)(
|
|
21637
21649
|
(id) => {
|
|
21638
21650
|
if (!enabledOptionIds.includes(id)) return;
|
|
21639
21651
|
listNav.highlight(id);
|
|
21640
21652
|
},
|
|
21641
21653
|
[enabledOptionIds, listNav]
|
|
21642
21654
|
);
|
|
21643
|
-
const state = (0,
|
|
21655
|
+
const state = (0, import_react102.useMemo)(
|
|
21644
21656
|
() => ({
|
|
21645
21657
|
searchQuery: searchQuery ?? "",
|
|
21646
21658
|
highlightedId: listNav.highlightedId
|
|
21647
21659
|
}),
|
|
21648
21660
|
[searchQuery, listNav.highlightedId]
|
|
21649
21661
|
);
|
|
21650
|
-
const computedState = (0,
|
|
21662
|
+
const computedState = (0, import_react102.useMemo)(
|
|
21651
21663
|
() => ({ visibleOptionIds }),
|
|
21652
21664
|
[visibleOptionIds]
|
|
21653
21665
|
);
|
|
21654
|
-
const actions = (0,
|
|
21666
|
+
const actions = (0, import_react102.useMemo)(
|
|
21655
21667
|
() => ({
|
|
21656
21668
|
setSearchQuery,
|
|
21657
21669
|
highlightFirst: listNav.first,
|
|
@@ -21662,7 +21674,7 @@ function useCombobox({
|
|
|
21662
21674
|
}),
|
|
21663
21675
|
[setSearchQuery, listNav.first, listNav.last, listNav.next, listNav.previous, highlightItem]
|
|
21664
21676
|
);
|
|
21665
|
-
return (0,
|
|
21677
|
+
return (0, import_react102.useMemo)(
|
|
21666
21678
|
() => ({
|
|
21667
21679
|
...state,
|
|
21668
21680
|
...computedState,
|
|
@@ -21679,14 +21691,14 @@ function ComboboxRoot({
|
|
|
21679
21691
|
onItemClick,
|
|
21680
21692
|
...hookProps
|
|
21681
21693
|
}) {
|
|
21682
|
-
const [options, setOptions] = (0,
|
|
21683
|
-
const [listRef, setListRef] = (0,
|
|
21684
|
-
const generatedId = (0,
|
|
21685
|
-
const [ids, setIds] = (0,
|
|
21694
|
+
const [options, setOptions] = (0, import_react103.useState)([]);
|
|
21695
|
+
const [listRef, setListRef] = (0, import_react103.useState)(null);
|
|
21696
|
+
const generatedId = (0, import_react103.useId)();
|
|
21697
|
+
const [ids, setIds] = (0, import_react103.useState)({
|
|
21686
21698
|
trigger: `combobox-${generatedId}`,
|
|
21687
21699
|
listbox: `combobox-${generatedId}-listbox`
|
|
21688
21700
|
});
|
|
21689
|
-
const registerOption = (0,
|
|
21701
|
+
const registerOption = (0, import_react103.useCallback)(
|
|
21690
21702
|
(option) => {
|
|
21691
21703
|
setOptions((prev) => {
|
|
21692
21704
|
const next = prev.filter((o) => o.id !== option.id);
|
|
@@ -21698,11 +21710,11 @@ function ComboboxRoot({
|
|
|
21698
21710
|
},
|
|
21699
21711
|
[]
|
|
21700
21712
|
);
|
|
21701
|
-
const registerList = (0,
|
|
21713
|
+
const registerList = (0, import_react103.useCallback)((ref) => {
|
|
21702
21714
|
setListRef(() => ref);
|
|
21703
21715
|
return () => setListRef(null);
|
|
21704
21716
|
}, []);
|
|
21705
|
-
const hookOptions = (0,
|
|
21717
|
+
const hookOptions = (0, import_react103.useMemo)(
|
|
21706
21718
|
() => options.map((o) => ({
|
|
21707
21719
|
id: o.id,
|
|
21708
21720
|
label: o.label,
|
|
@@ -21711,38 +21723,38 @@ function ComboboxRoot({
|
|
|
21711
21723
|
[options]
|
|
21712
21724
|
);
|
|
21713
21725
|
const state = useCombobox({ ...hookProps, options: hookOptions });
|
|
21714
|
-
const idToOptionMap = (0,
|
|
21726
|
+
const idToOptionMap = (0, import_react103.useMemo)(() => {
|
|
21715
21727
|
return options.reduce((acc, o) => {
|
|
21716
21728
|
acc[o.id] = o;
|
|
21717
21729
|
return acc;
|
|
21718
21730
|
}, {});
|
|
21719
21731
|
}, [options]);
|
|
21720
|
-
const selectOption = (0,
|
|
21732
|
+
const selectOption = (0, import_react103.useCallback)(
|
|
21721
21733
|
(id) => {
|
|
21722
21734
|
const option = idToOptionMap[id];
|
|
21723
21735
|
if (option) onItemClick?.(option.value);
|
|
21724
21736
|
},
|
|
21725
21737
|
[idToOptionMap, onItemClick]
|
|
21726
21738
|
);
|
|
21727
|
-
const config = (0,
|
|
21739
|
+
const config = (0, import_react103.useMemo)(
|
|
21728
21740
|
() => ({ ids, setIds }),
|
|
21729
21741
|
[ids, setIds]
|
|
21730
21742
|
);
|
|
21731
|
-
const layout = (0,
|
|
21743
|
+
const layout = (0, import_react103.useMemo)(
|
|
21732
21744
|
() => ({
|
|
21733
21745
|
listRef: listRef ?? { current: null },
|
|
21734
21746
|
registerList
|
|
21735
21747
|
}),
|
|
21736
21748
|
[listRef, registerList]
|
|
21737
21749
|
);
|
|
21738
|
-
const search = (0,
|
|
21750
|
+
const search = (0, import_react103.useMemo)(
|
|
21739
21751
|
() => ({
|
|
21740
21752
|
searchQuery: state.searchQuery,
|
|
21741
21753
|
setSearchQuery: state.setSearchQuery
|
|
21742
21754
|
}),
|
|
21743
21755
|
[state.searchQuery, state.setSearchQuery]
|
|
21744
21756
|
);
|
|
21745
|
-
const contextValue = (0,
|
|
21757
|
+
const contextValue = (0, import_react103.useMemo)(
|
|
21746
21758
|
() => ({
|
|
21747
21759
|
highlightedId: state.highlightedId,
|
|
21748
21760
|
options,
|
|
@@ -21780,14 +21792,14 @@ function ComboboxRoot({
|
|
|
21780
21792
|
}
|
|
21781
21793
|
|
|
21782
21794
|
// src/components/user-interaction/Combobox/ComboboxInput.tsx
|
|
21783
|
-
var
|
|
21795
|
+
var import_react104 = require("react");
|
|
21784
21796
|
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
21785
|
-
var ComboboxInput = (0,
|
|
21797
|
+
var ComboboxInput = (0, import_react104.forwardRef)(
|
|
21786
21798
|
function ComboboxInput2(props, ref) {
|
|
21787
21799
|
const translation = useHightideTranslation();
|
|
21788
21800
|
const context = useComboboxContext();
|
|
21789
21801
|
const { highlightNext, highlightPrevious, highlightFirst, highlightLast, highlightedId, selectOption } = context;
|
|
21790
|
-
const handleKeyDown = (0,
|
|
21802
|
+
const handleKeyDown = (0, import_react104.useCallback)(
|
|
21791
21803
|
(event) => {
|
|
21792
21804
|
props.onKeyDown?.(event);
|
|
21793
21805
|
switch (event.key) {
|
|
@@ -21839,17 +21851,17 @@ var ComboboxInput = (0, import_react105.forwardRef)(
|
|
|
21839
21851
|
);
|
|
21840
21852
|
|
|
21841
21853
|
// src/components/user-interaction/Combobox/ComboboxList.tsx
|
|
21842
|
-
var
|
|
21854
|
+
var import_react105 = require("react");
|
|
21843
21855
|
var import_clsx39 = __toESM(require("clsx"));
|
|
21844
21856
|
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
21845
|
-
var ComboboxList = (0,
|
|
21857
|
+
var ComboboxList = (0, import_react105.forwardRef)(
|
|
21846
21858
|
function ComboboxList2({ children, ...props }, ref) {
|
|
21847
21859
|
const translation = useHightideTranslation();
|
|
21848
21860
|
const context = useComboboxContext();
|
|
21849
21861
|
const { layout } = context;
|
|
21850
21862
|
const { registerList } = layout;
|
|
21851
|
-
const innerRef = (0,
|
|
21852
|
-
(0,
|
|
21863
|
+
const innerRef = (0, import_react105.useRef)(null);
|
|
21864
|
+
(0, import_react105.useEffect)(() => {
|
|
21853
21865
|
return registerList(innerRef);
|
|
21854
21866
|
}, [registerList]);
|
|
21855
21867
|
const setRefs = (node) => {
|
|
@@ -21891,7 +21903,7 @@ var ComboboxList = (0, import_react106.forwardRef)(
|
|
|
21891
21903
|
|
|
21892
21904
|
// src/components/user-interaction/Combobox/Combobox.tsx
|
|
21893
21905
|
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
21894
|
-
var Combobox = (0,
|
|
21906
|
+
var Combobox = (0, import_react106.forwardRef)(function Combobox2({
|
|
21895
21907
|
children,
|
|
21896
21908
|
onItemClick,
|
|
21897
21909
|
searchQuery,
|
|
@@ -21916,10 +21928,10 @@ var Combobox = (0, import_react107.forwardRef)(function Combobox2({
|
|
|
21916
21928
|
});
|
|
21917
21929
|
|
|
21918
21930
|
// src/components/user-interaction/Combobox/ComboboxOption.tsx
|
|
21919
|
-
var
|
|
21931
|
+
var import_react107 = require("react");
|
|
21920
21932
|
var import_clsx40 = __toESM(require("clsx"));
|
|
21921
21933
|
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
21922
|
-
var ComboboxOption = (0,
|
|
21934
|
+
var ComboboxOption = (0, import_react107.forwardRef)(function ComboboxOption2({
|
|
21923
21935
|
children,
|
|
21924
21936
|
value,
|
|
21925
21937
|
label,
|
|
@@ -21930,11 +21942,11 @@ var ComboboxOption = (0, import_react108.forwardRef)(function ComboboxOption2({
|
|
|
21930
21942
|
}, ref) {
|
|
21931
21943
|
const context = useComboboxContext();
|
|
21932
21944
|
const { registerOption } = context;
|
|
21933
|
-
const itemRef = (0,
|
|
21934
|
-
const generatedId = (0,
|
|
21945
|
+
const itemRef = (0, import_react107.useRef)(null);
|
|
21946
|
+
const generatedId = (0, import_react107.useId)();
|
|
21935
21947
|
const optionId = idProp ?? `combobox-option-${generatedId}`;
|
|
21936
21948
|
const resolvedDisplay = children ?? label;
|
|
21937
|
-
(0,
|
|
21949
|
+
(0, import_react107.useEffect)(() => {
|
|
21938
21950
|
return registerOption({
|
|
21939
21951
|
id: optionId,
|
|
21940
21952
|
value,
|
|
@@ -21944,7 +21956,7 @@ var ComboboxOption = (0, import_react108.forwardRef)(function ComboboxOption2({
|
|
|
21944
21956
|
ref: itemRef
|
|
21945
21957
|
});
|
|
21946
21958
|
}, [optionId, value, label, resolvedDisplay, disabled, registerOption]);
|
|
21947
|
-
(0,
|
|
21959
|
+
(0, import_react107.useEffect)(() => {
|
|
21948
21960
|
if (context.highlightedId === optionId) {
|
|
21949
21961
|
itemRef.current?.scrollIntoView?.({ behavior: "smooth", block: "nearest" });
|
|
21950
21962
|
}
|
|
@@ -21990,7 +22002,7 @@ var ComboboxOption = (0, import_react108.forwardRef)(function ComboboxOption2({
|
|
|
21990
22002
|
ComboboxOption.displayName = "ComboboxOption";
|
|
21991
22003
|
|
|
21992
22004
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
21993
|
-
var
|
|
22005
|
+
var import_react108 = require("react");
|
|
21994
22006
|
var import_clsx41 = require("clsx");
|
|
21995
22007
|
|
|
21996
22008
|
// src/utils/writeToClipboard.ts
|
|
@@ -22013,7 +22025,7 @@ var CopyToClipboardWrapper = ({
|
|
|
22013
22025
|
...props
|
|
22014
22026
|
}) => {
|
|
22015
22027
|
const translation = useHightideTranslation();
|
|
22016
|
-
const [isShowingConfirmation, setIsShowingConfirmation] = (0,
|
|
22028
|
+
const [isShowingConfirmation, setIsShowingConfirmation] = (0, import_react108.useState)(false);
|
|
22017
22029
|
return /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(
|
|
22018
22030
|
TooltipRoot,
|
|
22019
22031
|
{
|
|
@@ -22062,7 +22074,7 @@ var CopyToClipboardWrapper = ({
|
|
|
22062
22074
|
};
|
|
22063
22075
|
|
|
22064
22076
|
// src/components/user-interaction/Menu.tsx
|
|
22065
|
-
var
|
|
22077
|
+
var import_react109 = require("react");
|
|
22066
22078
|
var import_clsx42 = __toESM(require("clsx"));
|
|
22067
22079
|
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
22068
22080
|
var MenuItem = ({
|
|
@@ -22088,8 +22100,8 @@ var Menu = ({
|
|
|
22088
22100
|
disabled = false,
|
|
22089
22101
|
...props
|
|
22090
22102
|
}) => {
|
|
22091
|
-
const triggerRef = (0,
|
|
22092
|
-
const [isOpen, setIsOpen] = (0,
|
|
22103
|
+
const triggerRef = (0, import_react109.useRef)(null);
|
|
22104
|
+
const [isOpen, setIsOpen] = (0, import_react109.useState)(false);
|
|
22093
22105
|
const bag = {
|
|
22094
22106
|
isOpen,
|
|
22095
22107
|
close: () => setIsOpen(false),
|
|
@@ -22097,7 +22109,7 @@ var Menu = ({
|
|
|
22097
22109
|
disabled
|
|
22098
22110
|
};
|
|
22099
22111
|
return /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(import_jsx_runtime103.Fragment, { children: [
|
|
22100
|
-
trigger(bag, (0,
|
|
22112
|
+
trigger(bag, (0, import_react109.useCallback)((el) => triggerRef.current = el, [])),
|
|
22101
22113
|
/* @__PURE__ */ (0, import_jsx_runtime103.jsx)(
|
|
22102
22114
|
PopUp,
|
|
22103
22115
|
{
|
|
@@ -22119,21 +22131,21 @@ var Menu = ({
|
|
|
22119
22131
|
};
|
|
22120
22132
|
|
|
22121
22133
|
// src/components/user-interaction/MultiSelect/MultiSelectChipDisplay.tsx
|
|
22122
|
-
var
|
|
22134
|
+
var import_react110 = require("react");
|
|
22123
22135
|
var import_lucide_react30 = require("lucide-react");
|
|
22124
22136
|
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
22125
|
-
var MultiSelectChipDisplayButton = (0,
|
|
22137
|
+
var MultiSelectChipDisplayButton = (0, import_react110.forwardRef)(function MultiSelectChipDisplayButton2({ id, ...props }, ref) {
|
|
22126
22138
|
const translation = useHightideTranslation();
|
|
22127
22139
|
const context = useMultiSelectContext();
|
|
22128
22140
|
const { config, layout } = context;
|
|
22129
22141
|
const { setIds } = config;
|
|
22130
22142
|
const { registerTrigger } = layout;
|
|
22131
|
-
(0,
|
|
22143
|
+
(0, import_react110.useEffect)(() => {
|
|
22132
22144
|
if (id) setIds((prev) => ({ ...prev, trigger: id }));
|
|
22133
22145
|
}, [id, setIds]);
|
|
22134
|
-
const innerRef = (0,
|
|
22135
|
-
(0,
|
|
22136
|
-
(0,
|
|
22146
|
+
const innerRef = (0, import_react110.useRef)(null);
|
|
22147
|
+
(0, import_react110.useImperativeHandle)(ref, () => innerRef.current);
|
|
22148
|
+
(0, import_react110.useEffect)(() => {
|
|
22137
22149
|
const unregister = registerTrigger(innerRef);
|
|
22138
22150
|
return () => unregister();
|
|
22139
22151
|
}, [registerTrigger]);
|
|
@@ -22217,7 +22229,7 @@ var MultiSelectChipDisplayButton = (0, import_react111.forwardRef)(function Mult
|
|
|
22217
22229
|
}
|
|
22218
22230
|
);
|
|
22219
22231
|
});
|
|
22220
|
-
var MultiSelectChipDisplay = (0,
|
|
22232
|
+
var MultiSelectChipDisplay = (0, import_react110.forwardRef)(
|
|
22221
22233
|
function MultiSelectChipDisplay2({
|
|
22222
22234
|
children,
|
|
22223
22235
|
contentPanelProps,
|
|
@@ -22232,7 +22244,7 @@ var MultiSelectChipDisplay = (0, import_react111.forwardRef)(
|
|
|
22232
22244
|
);
|
|
22233
22245
|
|
|
22234
22246
|
// src/components/user-interaction/ScrollPicker.tsx
|
|
22235
|
-
var
|
|
22247
|
+
var import_react111 = require("react");
|
|
22236
22248
|
var import_clsx43 = __toESM(require("clsx"));
|
|
22237
22249
|
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
22238
22250
|
var up = 1;
|
|
@@ -22253,7 +22265,7 @@ var ScrollPicker = ({
|
|
|
22253
22265
|
transition,
|
|
22254
22266
|
items,
|
|
22255
22267
|
lastTimeStamp
|
|
22256
|
-
}, setAnimation] = (0,
|
|
22268
|
+
}, setAnimation] = (0, import_react111.useState)({
|
|
22257
22269
|
targetIndex: selectedIndex,
|
|
22258
22270
|
currentIndex: disabled ? selectedIndex : 0,
|
|
22259
22271
|
velocity: 0,
|
|
@@ -22269,7 +22281,7 @@ var ScrollPicker = ({
|
|
|
22269
22281
|
const itemHeight = 40;
|
|
22270
22282
|
const distance = 8;
|
|
22271
22283
|
const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
|
|
22272
|
-
const getDirection = (0,
|
|
22284
|
+
const getDirection = (0, import_react111.useCallback)((targetIndex, currentIndex2, transition2, length) => {
|
|
22273
22285
|
if (targetIndex === currentIndex2) {
|
|
22274
22286
|
return transition2 > 0 ? up : down;
|
|
22275
22287
|
}
|
|
@@ -22279,7 +22291,7 @@ var ScrollPicker = ({
|
|
|
22279
22291
|
}
|
|
22280
22292
|
return distanceForward >= length / 2 ? down : up;
|
|
22281
22293
|
}, []);
|
|
22282
|
-
const animate = (0,
|
|
22294
|
+
const animate = (0, import_react111.useCallback)((timestamp, startTime) => {
|
|
22283
22295
|
setAnimation((prevState) => {
|
|
22284
22296
|
const {
|
|
22285
22297
|
targetIndex,
|
|
@@ -22352,7 +22364,7 @@ var ScrollPicker = ({
|
|
|
22352
22364
|
};
|
|
22353
22365
|
});
|
|
22354
22366
|
}, [disabled, getDirection, onChange]);
|
|
22355
|
-
(0,
|
|
22367
|
+
(0, import_react111.useEffect)(() => {
|
|
22356
22368
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
22357
22369
|
});
|
|
22358
22370
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -22430,7 +22442,7 @@ var ScrollPicker = ({
|
|
|
22430
22442
|
};
|
|
22431
22443
|
|
|
22432
22444
|
// src/components/user-interaction/Switch.tsx
|
|
22433
|
-
var
|
|
22445
|
+
var import_react112 = require("react");
|
|
22434
22446
|
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
22435
22447
|
var Switch = ({
|
|
22436
22448
|
value: controlledValue,
|
|
@@ -22445,7 +22457,7 @@ var Switch = ({
|
|
|
22445
22457
|
}) => {
|
|
22446
22458
|
const onEditCompleteStable = useEventCallbackStabilizer(onEditComplete);
|
|
22447
22459
|
const onValueChangeStable = useEventCallbackStabilizer(onValueChange);
|
|
22448
|
-
const onChangeWrapper = (0,
|
|
22460
|
+
const onChangeWrapper = (0, import_react112.useCallback)((value2) => {
|
|
22449
22461
|
onValueChangeStable(!value2);
|
|
22450
22462
|
onEditCompleteStable(!value2);
|
|
22451
22463
|
}, [onValueChangeStable, onEditCompleteStable]);
|
|
@@ -22485,10 +22497,10 @@ var Switch = ({
|
|
|
22485
22497
|
};
|
|
22486
22498
|
|
|
22487
22499
|
// src/components/user-interaction/Textarea.tsx
|
|
22488
|
-
var
|
|
22500
|
+
var import_react113 = require("react");
|
|
22489
22501
|
var import_clsx44 = __toESM(require("clsx"));
|
|
22490
22502
|
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
22491
|
-
var Textarea = (0,
|
|
22503
|
+
var Textarea = (0, import_react113.forwardRef)(function Textarea2({
|
|
22492
22504
|
value: controlledValue,
|
|
22493
22505
|
initialValue,
|
|
22494
22506
|
invalid = false,
|
|
@@ -22504,7 +22516,7 @@ var Textarea = (0, import_react114.forwardRef)(function Textarea2({
|
|
|
22504
22516
|
});
|
|
22505
22517
|
const { restartTimer, clearTimer } = useDelay(saveDelayOptions);
|
|
22506
22518
|
const onEditCompleteStable = useEventCallbackStabilizer(onEditComplete);
|
|
22507
|
-
const onEditCompleteWrapper = (0,
|
|
22519
|
+
const onEditCompleteWrapper = (0, import_react113.useCallback)((text) => {
|
|
22508
22520
|
onEditCompleteStable(text);
|
|
22509
22521
|
clearTimer();
|
|
22510
22522
|
}, [onEditCompleteStable, clearTimer]);
|
|
@@ -22542,7 +22554,7 @@ var TextareaWithHeadline = ({
|
|
|
22542
22554
|
containerClassName,
|
|
22543
22555
|
...props
|
|
22544
22556
|
}) => {
|
|
22545
|
-
const genId = (0,
|
|
22557
|
+
const genId = (0, import_react113.useId)();
|
|
22546
22558
|
const usedId = id ?? genId;
|
|
22547
22559
|
return /* @__PURE__ */ (0, import_jsx_runtime107.jsxs)(
|
|
22548
22560
|
"div",
|
|
@@ -22574,20 +22586,20 @@ var TextareaWithHeadline = ({
|
|
|
22574
22586
|
};
|
|
22575
22587
|
|
|
22576
22588
|
// src/components/user-interaction/data/FilterList.tsx
|
|
22577
|
-
var
|
|
22589
|
+
var import_react114 = require("react");
|
|
22578
22590
|
var import_lucide_react31 = require("lucide-react");
|
|
22579
22591
|
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
22580
22592
|
var FilterList = ({ value, onValueChange, availableItems }) => {
|
|
22581
22593
|
const translation = useHightideTranslation();
|
|
22582
22594
|
const filterValueToLabel = useFilterValueTranslation();
|
|
22583
|
-
const activeIds = (0,
|
|
22584
|
-
const inactiveItems = (0,
|
|
22585
|
-
const itemRecord = (0,
|
|
22595
|
+
const activeIds = (0, import_react114.useMemo)(() => value.map((item) => item.id), [value]);
|
|
22596
|
+
const inactiveItems = (0, import_react114.useMemo)(() => availableItems.filter((item) => !activeIds.includes(item.id)).sort((a, b) => a.label.localeCompare(b.label)), [availableItems, activeIds]);
|
|
22597
|
+
const itemRecord = (0, import_react114.useMemo)(() => availableItems.reduce((acc, item) => {
|
|
22586
22598
|
acc[item.id] = item;
|
|
22587
22599
|
return acc;
|
|
22588
22600
|
}, {}), [availableItems]);
|
|
22589
|
-
const [editState, setEditState] = (0,
|
|
22590
|
-
const valueWithEditState = (0,
|
|
22601
|
+
const [editState, setEditState] = (0, import_react114.useState)(void 0);
|
|
22602
|
+
const valueWithEditState = (0, import_react114.useMemo)(() => {
|
|
22591
22603
|
let foundEditValue = false;
|
|
22592
22604
|
for (const item of value) {
|
|
22593
22605
|
if (item.id === editState?.id) {
|
|
@@ -22695,18 +22707,18 @@ var FilterList = ({ value, onValueChange, availableItems }) => {
|
|
|
22695
22707
|
};
|
|
22696
22708
|
|
|
22697
22709
|
// src/components/user-interaction/data/SortingList.tsx
|
|
22698
|
-
var
|
|
22710
|
+
var import_react115 = require("react");
|
|
22699
22711
|
var import_lucide_react32 = require("lucide-react");
|
|
22700
22712
|
var import_clsx45 = __toESM(require("clsx"));
|
|
22701
22713
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
22702
22714
|
var SortingList = ({ sorting, onSortingChange, availableItems }) => {
|
|
22703
22715
|
const translation = useHightideTranslation();
|
|
22704
|
-
const activeIds = (0,
|
|
22705
|
-
const inactiveItems = (0,
|
|
22716
|
+
const activeIds = (0, import_react115.useMemo)(() => sorting.map((item) => item.id), [sorting]);
|
|
22717
|
+
const inactiveItems = (0, import_react115.useMemo)(
|
|
22706
22718
|
() => availableItems.filter((item) => !activeIds.includes(item.id)).sort((a, b) => a.label.localeCompare(b.label)),
|
|
22707
22719
|
[availableItems, activeIds]
|
|
22708
22720
|
);
|
|
22709
|
-
const itemRecord = (0,
|
|
22721
|
+
const itemRecord = (0, import_react115.useMemo)(
|
|
22710
22722
|
() => availableItems.reduce(
|
|
22711
22723
|
(acc, item) => {
|
|
22712
22724
|
acc[item.id] = item;
|
|
@@ -22884,10 +22896,10 @@ var TimeDisplay = ({
|
|
|
22884
22896
|
};
|
|
22885
22897
|
|
|
22886
22898
|
// src/components/user-interaction/input/FlexibleDateTimeInput.tsx
|
|
22887
|
-
var
|
|
22899
|
+
var import_react116 = require("react");
|
|
22888
22900
|
var import_lucide_react33 = require("lucide-react");
|
|
22889
22901
|
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
22890
|
-
var FlexibleDateTimeInput = (0,
|
|
22902
|
+
var FlexibleDateTimeInput = (0, import_react116.forwardRef)(function FlexibleDateTimeInput2({
|
|
22891
22903
|
defaultMode = "date",
|
|
22892
22904
|
value: controlledValue,
|
|
22893
22905
|
initialValue,
|
|
@@ -22909,7 +22921,7 @@ var FlexibleDateTimeInput = (0, import_react117.forwardRef)(function FlexibleDat
|
|
|
22909
22921
|
const zoned = (date) => DateUtils.toZonedDate(date, timeZone);
|
|
22910
22922
|
const unzoned = (date) => DateUtils.fromZonedDate(date, timeZone);
|
|
22911
22923
|
const hasFixedTime = (date) => DateUtils.sameTime(zoned(date), fixedTime, true, true);
|
|
22912
|
-
const [mode, setMode] = (0,
|
|
22924
|
+
const [mode, setMode] = (0, import_react116.useState)(() => {
|
|
22913
22925
|
if (value && !hasFixedTime(value)) {
|
|
22914
22926
|
return "dateTime";
|
|
22915
22927
|
}
|
|
@@ -22954,11 +22966,11 @@ var FlexibleDateTimeInput = (0, import_react117.forwardRef)(function FlexibleDat
|
|
|
22954
22966
|
});
|
|
22955
22967
|
|
|
22956
22968
|
// src/components/user-interaction/input/InsideLabelInput.tsx
|
|
22969
|
+
var import_react117 = require("react");
|
|
22957
22970
|
var import_react118 = require("react");
|
|
22958
|
-
var import_react119 = require("react");
|
|
22959
22971
|
var import_clsx46 = __toESM(require("clsx"));
|
|
22960
22972
|
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
22961
|
-
var InsideLabelInput = (0,
|
|
22973
|
+
var InsideLabelInput = (0, import_react118.forwardRef)(function InsideLabelInput2({
|
|
22962
22974
|
id: customId,
|
|
22963
22975
|
value: controlledValue,
|
|
22964
22976
|
initialValue,
|
|
@@ -22971,8 +22983,8 @@ var InsideLabelInput = (0, import_react119.forwardRef)(function InsideLabelInput
|
|
|
22971
22983
|
onValueChange,
|
|
22972
22984
|
defaultValue: initialValue
|
|
22973
22985
|
});
|
|
22974
|
-
const [isFocused, setIsFocused] = (0,
|
|
22975
|
-
const generatedId = (0,
|
|
22986
|
+
const [isFocused, setIsFocused] = (0, import_react118.useState)(false);
|
|
22987
|
+
const generatedId = (0, import_react117.useId)();
|
|
22976
22988
|
const id = customId ?? generatedId;
|
|
22977
22989
|
return /* @__PURE__ */ (0, import_jsx_runtime112.jsxs)("div", { className: (0, import_clsx46.default)("relative"), children: [
|
|
22978
22990
|
/* @__PURE__ */ (0, import_jsx_runtime112.jsx)(
|
|
@@ -23061,11 +23073,11 @@ var SearchBar = ({
|
|
|
23061
23073
|
};
|
|
23062
23074
|
|
|
23063
23075
|
// src/components/user-interaction/input/ToggleableInput.tsx
|
|
23064
|
-
var
|
|
23076
|
+
var import_react119 = require("react");
|
|
23065
23077
|
var import_lucide_react35 = require("lucide-react");
|
|
23066
23078
|
var import_clsx48 = __toESM(require("clsx"));
|
|
23067
23079
|
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
23068
|
-
var ToggleableInput = (0,
|
|
23080
|
+
var ToggleableInput = (0, import_react119.forwardRef)(function ToggleableInput2({
|
|
23069
23081
|
value: controlledValue,
|
|
23070
23082
|
initialValue,
|
|
23071
23083
|
onValueChange,
|
|
@@ -23078,10 +23090,10 @@ var ToggleableInput = (0, import_react120.forwardRef)(function ToggleableInput2(
|
|
|
23078
23090
|
onValueChange,
|
|
23079
23091
|
defaultValue: initialValue
|
|
23080
23092
|
});
|
|
23081
|
-
const [isEditing, setIsEditing] = (0,
|
|
23082
|
-
const innerRef = (0,
|
|
23083
|
-
(0,
|
|
23084
|
-
(0,
|
|
23093
|
+
const [isEditing, setIsEditing] = (0, import_react119.useState)(initialState !== "display");
|
|
23094
|
+
const innerRef = (0, import_react119.useRef)(null);
|
|
23095
|
+
(0, import_react119.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
23096
|
+
(0, import_react119.useEffect)(() => {
|
|
23085
23097
|
if (isEditing) {
|
|
23086
23098
|
innerRef.current?.focus();
|
|
23087
23099
|
}
|
|
@@ -23516,9 +23528,9 @@ var TextProperty = ({
|
|
|
23516
23528
|
|
|
23517
23529
|
// src/components/utils/Polymorphic.tsx
|
|
23518
23530
|
var import_react_slot = require("@radix-ui/react-slot");
|
|
23519
|
-
var
|
|
23531
|
+
var import_react120 = require("react");
|
|
23520
23532
|
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
23521
|
-
var PolymorphicSlot = (0,
|
|
23533
|
+
var PolymorphicSlot = (0, import_react120.forwardRef)(function PolymorphicSlot2({
|
|
23522
23534
|
children,
|
|
23523
23535
|
asChild,
|
|
23524
23536
|
defaultComponent = "div",
|
|
@@ -23529,16 +23541,16 @@ var PolymorphicSlot = (0, import_react121.forwardRef)(function PolymorphicSlot2(
|
|
|
23529
23541
|
});
|
|
23530
23542
|
|
|
23531
23543
|
// src/components/utils/Transition.tsx
|
|
23532
|
-
var
|
|
23544
|
+
var import_react121 = require("react");
|
|
23533
23545
|
function Transition({
|
|
23534
23546
|
children,
|
|
23535
23547
|
show,
|
|
23536
23548
|
includeAnimation = true
|
|
23537
23549
|
}) {
|
|
23538
|
-
const [isOpen, setIsOpen] = (0,
|
|
23539
|
-
const [isTransitioning, setIsTransitioning] = (0,
|
|
23550
|
+
const [isOpen, setIsOpen] = (0, import_react121.useState)(show);
|
|
23551
|
+
const [isTransitioning, setIsTransitioning] = (0, import_react121.useState)(!isOpen);
|
|
23540
23552
|
const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
|
|
23541
|
-
(0,
|
|
23553
|
+
(0, import_react121.useEffect)(() => {
|
|
23542
23554
|
setIsOpen(show);
|
|
23543
23555
|
setIsTransitioning(true);
|
|
23544
23556
|
}, [show]);
|
|
@@ -23574,7 +23586,7 @@ var HightideProvider = ({
|
|
|
23574
23586
|
};
|
|
23575
23587
|
|
|
23576
23588
|
// src/hooks/focus/useFocusGuards.ts
|
|
23577
|
-
var
|
|
23589
|
+
var import_react122 = require("react");
|
|
23578
23590
|
var selectorName = "data-hw-focus-guard";
|
|
23579
23591
|
function FocusGuard() {
|
|
23580
23592
|
const element = document.createElement("div");
|
|
@@ -23612,7 +23624,7 @@ var FocusGuardsService = class _FocusGuardsService {
|
|
|
23612
23624
|
}
|
|
23613
23625
|
};
|
|
23614
23626
|
var useFocusGuards = () => {
|
|
23615
|
-
(0,
|
|
23627
|
+
(0, import_react122.useEffect)(() => {
|
|
23616
23628
|
FocusGuardsService.getInstance().add();
|
|
23617
23629
|
return () => {
|
|
23618
23630
|
FocusGuardsService.getInstance().remove();
|
|
@@ -23621,10 +23633,10 @@ var useFocusGuards = () => {
|
|
|
23621
23633
|
};
|
|
23622
23634
|
|
|
23623
23635
|
// src/hooks/focus/useFocusOnceVisible.ts
|
|
23624
|
-
var
|
|
23636
|
+
var import_react123 = __toESM(require("react"));
|
|
23625
23637
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
23626
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
23627
|
-
(0,
|
|
23638
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react123.default.useState(false);
|
|
23639
|
+
(0, import_react123.useEffect)(() => {
|
|
23628
23640
|
if (disable || hasUsedFocus) {
|
|
23629
23641
|
return;
|
|
23630
23642
|
}
|
|
@@ -23644,11 +23656,11 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
23644
23656
|
};
|
|
23645
23657
|
|
|
23646
23658
|
// src/hooks/focus/useIsMounted.ts
|
|
23647
|
-
var
|
|
23659
|
+
var import_react124 = require("react");
|
|
23648
23660
|
var isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
23649
|
-
var useIsomorphicEffect = isClient ?
|
|
23661
|
+
var useIsomorphicEffect = isClient ? import_react124.useLayoutEffect : import_react124.useEffect;
|
|
23650
23662
|
var useIsMounted = () => {
|
|
23651
|
-
const [isMounted, setIsMounted] = (0,
|
|
23663
|
+
const [isMounted, setIsMounted] = (0, import_react124.useState)(false);
|
|
23652
23664
|
useIsomorphicEffect(() => {
|
|
23653
23665
|
setIsMounted(true);
|
|
23654
23666
|
return () => {
|
|
@@ -23659,10 +23671,10 @@ var useIsMounted = () => {
|
|
|
23659
23671
|
};
|
|
23660
23672
|
|
|
23661
23673
|
// src/hooks/useHandleRefs.ts
|
|
23662
|
-
var
|
|
23674
|
+
var import_react125 = require("react");
|
|
23663
23675
|
function useHandleRefs(handleRef) {
|
|
23664
|
-
const refs = (0,
|
|
23665
|
-
(0,
|
|
23676
|
+
const refs = (0, import_react125.useRef)([]);
|
|
23677
|
+
(0, import_react125.useEffect)(() => {
|
|
23666
23678
|
refs.current = Object.keys(handleRef?.current ?? {}).map(
|
|
23667
23679
|
() => ({ current: null })
|
|
23668
23680
|
);
|
|
@@ -23675,10 +23687,10 @@ function useHandleRefs(handleRef) {
|
|
|
23675
23687
|
}
|
|
23676
23688
|
|
|
23677
23689
|
// src/hooks/useLogUnstableDependencies.ts
|
|
23678
|
-
var
|
|
23690
|
+
var import_react126 = __toESM(require("react"));
|
|
23679
23691
|
function useLogUnstableDependencies(name, value) {
|
|
23680
|
-
const prev =
|
|
23681
|
-
|
|
23692
|
+
const prev = import_react126.default.useRef(null);
|
|
23693
|
+
import_react126.default.useEffect(() => {
|
|
23682
23694
|
if (!prev.current) {
|
|
23683
23695
|
prev.current = value;
|
|
23684
23696
|
return;
|
|
@@ -23700,10 +23712,10 @@ function useLogUnstableDependencies(name, value) {
|
|
|
23700
23712
|
}
|
|
23701
23713
|
|
|
23702
23714
|
// src/hooks/useOverwritableState.ts
|
|
23703
|
-
var
|
|
23715
|
+
var import_react127 = require("react");
|
|
23704
23716
|
var useOverwritableState = (overwriteValue, onChange) => {
|
|
23705
|
-
const [state, setState] = (0,
|
|
23706
|
-
(0,
|
|
23717
|
+
const [state, setState] = (0, import_react127.useState)(overwriteValue);
|
|
23718
|
+
(0, import_react127.useEffect)(() => {
|
|
23707
23719
|
setState(overwriteValue);
|
|
23708
23720
|
}, [overwriteValue]);
|
|
23709
23721
|
const onChangeWrapper = (action) => {
|
|
@@ -23715,9 +23727,204 @@ var useOverwritableState = (overwriteValue, onChange) => {
|
|
|
23715
23727
|
};
|
|
23716
23728
|
|
|
23717
23729
|
// src/hooks/useRerender.ts
|
|
23718
|
-
var
|
|
23730
|
+
var import_react128 = require("react");
|
|
23719
23731
|
var useRerender = () => {
|
|
23720
|
-
return (0,
|
|
23732
|
+
return (0, import_react128.useReducer)(() => ({}), {})[1];
|
|
23733
|
+
};
|
|
23734
|
+
|
|
23735
|
+
// src/hooks/useSwipeGesture.ts
|
|
23736
|
+
var import_react129 = require("react");
|
|
23737
|
+
var useSwipeGesture = ({
|
|
23738
|
+
elementRef,
|
|
23739
|
+
inputMode = "touch",
|
|
23740
|
+
onSwipe,
|
|
23741
|
+
startRegion,
|
|
23742
|
+
threshold = 50,
|
|
23743
|
+
crossAxisThreshold = 100,
|
|
23744
|
+
maxSwipeTime = 100
|
|
23745
|
+
}) => {
|
|
23746
|
+
const onSwipeRef = (0, import_react129.useRef)(onSwipe);
|
|
23747
|
+
const startRegionRef = (0, import_react129.useRef)(startRegion);
|
|
23748
|
+
const thresholdRef = (0, import_react129.useRef)(threshold);
|
|
23749
|
+
const crossAxisThresholdRef = (0, import_react129.useRef)(crossAxisThreshold);
|
|
23750
|
+
const maxSwipeTimeRef = (0, import_react129.useRef)(maxSwipeTime);
|
|
23751
|
+
const gestureStartRef = (0, import_react129.useRef)(null);
|
|
23752
|
+
const gestureEndRef = (0, import_react129.useRef)(null);
|
|
23753
|
+
const isScrollingRef = (0, import_react129.useRef)(false);
|
|
23754
|
+
const isMouseDownRef = (0, import_react129.useRef)(false);
|
|
23755
|
+
(0, import_react129.useEffect)(() => {
|
|
23756
|
+
onSwipeRef.current = onSwipe;
|
|
23757
|
+
startRegionRef.current = startRegion;
|
|
23758
|
+
thresholdRef.current = threshold;
|
|
23759
|
+
crossAxisThresholdRef.current = crossAxisThreshold;
|
|
23760
|
+
maxSwipeTimeRef.current = maxSwipeTime;
|
|
23761
|
+
}, [onSwipe, startRegion, threshold, crossAxisThreshold, maxSwipeTime]);
|
|
23762
|
+
const isWithinStartRegion = (x, y) => {
|
|
23763
|
+
const region = startRegionRef.current;
|
|
23764
|
+
if (!region) return true;
|
|
23765
|
+
if (region.minX !== void 0 && x < region.minX) return false;
|
|
23766
|
+
if (region.maxX !== void 0 && x > region.maxX) return false;
|
|
23767
|
+
if (region.minY !== void 0 && y < region.minY) return false;
|
|
23768
|
+
if (region.maxY !== void 0 && y > region.maxY) return false;
|
|
23769
|
+
return true;
|
|
23770
|
+
};
|
|
23771
|
+
const findScrollableParent = (element) => {
|
|
23772
|
+
if (!element) return null;
|
|
23773
|
+
const table = element.closest("table") || element.closest('[role="table"]');
|
|
23774
|
+
if (table) {
|
|
23775
|
+
let parent = table.parentElement;
|
|
23776
|
+
while (parent) {
|
|
23777
|
+
const style = window.getComputedStyle(parent);
|
|
23778
|
+
if (style.overflow === "auto" || style.overflow === "scroll" || style.overflowY === "auto" || style.overflowY === "scroll" || style.overflowX === "auto" || style.overflowX === "scroll") {
|
|
23779
|
+
return parent;
|
|
23780
|
+
}
|
|
23781
|
+
parent = parent.parentElement;
|
|
23782
|
+
}
|
|
23783
|
+
return table;
|
|
23784
|
+
}
|
|
23785
|
+
let current = element;
|
|
23786
|
+
while (current) {
|
|
23787
|
+
const style = window.getComputedStyle(current);
|
|
23788
|
+
if (style.overflow === "auto" || style.overflow === "scroll" || style.overflowY === "auto" || style.overflowY === "scroll" || style.overflowX === "auto" || style.overflowX === "scroll") {
|
|
23789
|
+
return current;
|
|
23790
|
+
}
|
|
23791
|
+
current = current.parentElement;
|
|
23792
|
+
}
|
|
23793
|
+
return null;
|
|
23794
|
+
};
|
|
23795
|
+
(0, import_react129.useEffect)(() => {
|
|
23796
|
+
const element = elementRef?.current ?? null;
|
|
23797
|
+
const target = element ?? window;
|
|
23798
|
+
const listenTouch = inputMode === "touch" || inputMode === "both";
|
|
23799
|
+
const listenMouse = inputMode === "mouse" || inputMode === "both";
|
|
23800
|
+
const onGestureStart = (x, y, eventTarget) => {
|
|
23801
|
+
console.log("onGestureStart", x, y);
|
|
23802
|
+
if (!isWithinStartRegion(x, y)) return;
|
|
23803
|
+
const scrollableParent = findScrollableParent(eventTarget);
|
|
23804
|
+
gestureEndRef.current = null;
|
|
23805
|
+
gestureStartRef.current = {
|
|
23806
|
+
x,
|
|
23807
|
+
y,
|
|
23808
|
+
scrollY: scrollableParent?.scrollTop ?? window.scrollY,
|
|
23809
|
+
time: performance.now()
|
|
23810
|
+
};
|
|
23811
|
+
isScrollingRef.current = !!scrollableParent;
|
|
23812
|
+
};
|
|
23813
|
+
const onGestureMove = (x, y, eventTarget) => {
|
|
23814
|
+
console.log("onGestureMove", x, y);
|
|
23815
|
+
const scrollableParent = findScrollableParent(eventTarget);
|
|
23816
|
+
const currentScrollY = scrollableParent?.scrollTop ?? window.scrollY;
|
|
23817
|
+
gestureEndRef.current = {
|
|
23818
|
+
x,
|
|
23819
|
+
y,
|
|
23820
|
+
scrollY: currentScrollY,
|
|
23821
|
+
time: performance.now()
|
|
23822
|
+
};
|
|
23823
|
+
if (gestureStartRef.current && Math.abs(currentScrollY - gestureStartRef.current.scrollY) > 5) {
|
|
23824
|
+
isScrollingRef.current = true;
|
|
23825
|
+
}
|
|
23826
|
+
};
|
|
23827
|
+
const resolveSwipeDirection = (start, end) => {
|
|
23828
|
+
const deltaX = end.x - start.x;
|
|
23829
|
+
const deltaY = end.y - start.y;
|
|
23830
|
+
const absX = Math.abs(deltaX);
|
|
23831
|
+
const absY = Math.abs(deltaY);
|
|
23832
|
+
const minDistance = thresholdRef.current;
|
|
23833
|
+
const maxCrossAxis = crossAxisThresholdRef.current;
|
|
23834
|
+
if (absX < minDistance && absY < minDistance) {
|
|
23835
|
+
return null;
|
|
23836
|
+
}
|
|
23837
|
+
if (absX >= absY && absX >= minDistance && absY <= maxCrossAxis) {
|
|
23838
|
+
return deltaX > 0 ? "leftToRight" : "rightToLeft";
|
|
23839
|
+
}
|
|
23840
|
+
if (absY > absX && absY >= minDistance && absX <= maxCrossAxis) {
|
|
23841
|
+
return deltaY > 0 ? "topToBottom" : "bottomToTop";
|
|
23842
|
+
}
|
|
23843
|
+
return null;
|
|
23844
|
+
};
|
|
23845
|
+
const onGestureEnd = () => {
|
|
23846
|
+
const start = gestureStartRef.current;
|
|
23847
|
+
const end = gestureEndRef.current;
|
|
23848
|
+
if (!start || !end) {
|
|
23849
|
+
gestureStartRef.current = null;
|
|
23850
|
+
gestureEndRef.current = null;
|
|
23851
|
+
isScrollingRef.current = false;
|
|
23852
|
+
return;
|
|
23853
|
+
}
|
|
23854
|
+
if (isScrollingRef.current || Math.abs(start.scrollY - end.scrollY) > 5) {
|
|
23855
|
+
gestureStartRef.current = null;
|
|
23856
|
+
gestureEndRef.current = null;
|
|
23857
|
+
isScrollingRef.current = false;
|
|
23858
|
+
return;
|
|
23859
|
+
}
|
|
23860
|
+
const maxSwipeTime2 = maxSwipeTimeRef.current;
|
|
23861
|
+
if (maxSwipeTime2 !== void 0 && end.time - start.time > maxSwipeTime2) {
|
|
23862
|
+
gestureStartRef.current = null;
|
|
23863
|
+
gestureEndRef.current = null;
|
|
23864
|
+
isScrollingRef.current = false;
|
|
23865
|
+
return;
|
|
23866
|
+
}
|
|
23867
|
+
const direction = resolveSwipeDirection(start, end);
|
|
23868
|
+
if (direction && onSwipeRef.current) {
|
|
23869
|
+
onSwipeRef.current({ direction });
|
|
23870
|
+
}
|
|
23871
|
+
gestureStartRef.current = null;
|
|
23872
|
+
gestureEndRef.current = null;
|
|
23873
|
+
isScrollingRef.current = false;
|
|
23874
|
+
};
|
|
23875
|
+
const onTouchStart = (e) => {
|
|
23876
|
+
if (!e.touches[0]) return;
|
|
23877
|
+
onGestureStart(e.touches[0].clientX, e.touches[0].clientY, e.target);
|
|
23878
|
+
};
|
|
23879
|
+
const onTouchMove = (e) => {
|
|
23880
|
+
if (!e.touches[0]) return;
|
|
23881
|
+
onGestureMove(e.touches[0].clientX, e.touches[0].clientY, e.target);
|
|
23882
|
+
};
|
|
23883
|
+
const onTouchEnd = () => {
|
|
23884
|
+
onGestureEnd();
|
|
23885
|
+
};
|
|
23886
|
+
const onMouseMove = (e) => {
|
|
23887
|
+
if (!isMouseDownRef.current) return;
|
|
23888
|
+
onGestureMove(e.clientX, e.clientY, e.target);
|
|
23889
|
+
};
|
|
23890
|
+
const onMouseUp = () => {
|
|
23891
|
+
if (!isMouseDownRef.current) return;
|
|
23892
|
+
isMouseDownRef.current = false;
|
|
23893
|
+
window.removeEventListener("mousemove", onMouseMove);
|
|
23894
|
+
window.removeEventListener("mouseup", onMouseUp);
|
|
23895
|
+
onGestureEnd();
|
|
23896
|
+
};
|
|
23897
|
+
const onMouseDown = (e) => {
|
|
23898
|
+
if (e.button !== 0) return;
|
|
23899
|
+
if (!isWithinStartRegion(e.clientX, e.clientY)) return;
|
|
23900
|
+
isMouseDownRef.current = true;
|
|
23901
|
+
onGestureStart(e.clientX, e.clientY, e.target);
|
|
23902
|
+
window.addEventListener("mousemove", onMouseMove);
|
|
23903
|
+
window.addEventListener("mouseup", onMouseUp);
|
|
23904
|
+
};
|
|
23905
|
+
const passiveOptions = { passive: true };
|
|
23906
|
+
if (listenTouch) {
|
|
23907
|
+
target.addEventListener("touchstart", onTouchStart, passiveOptions);
|
|
23908
|
+
target.addEventListener("touchmove", onTouchMove, passiveOptions);
|
|
23909
|
+
target.addEventListener("touchend", onTouchEnd, passiveOptions);
|
|
23910
|
+
}
|
|
23911
|
+
if (listenMouse) {
|
|
23912
|
+
target.addEventListener("mousedown", onMouseDown);
|
|
23913
|
+
}
|
|
23914
|
+
return () => {
|
|
23915
|
+
if (listenTouch) {
|
|
23916
|
+
target.removeEventListener("touchstart", onTouchStart);
|
|
23917
|
+
target.removeEventListener("touchmove", onTouchMove);
|
|
23918
|
+
target.removeEventListener("touchend", onTouchEnd);
|
|
23919
|
+
}
|
|
23920
|
+
if (listenMouse) {
|
|
23921
|
+
target.removeEventListener("mousedown", onMouseDown);
|
|
23922
|
+
window.removeEventListener("mousemove", onMouseMove);
|
|
23923
|
+
window.removeEventListener("mouseup", onMouseUp);
|
|
23924
|
+
}
|
|
23925
|
+
};
|
|
23926
|
+
}, [elementRef, inputMode]);
|
|
23927
|
+
return elementRef;
|
|
23721
23928
|
};
|
|
23722
23929
|
|
|
23723
23930
|
// src/hooks/useUpdatingDateString.ts
|
|
@@ -24382,6 +24589,7 @@ var PromiseUtils = {
|
|
|
24382
24589
|
useSelectOptionDisplayLocation,
|
|
24383
24590
|
useSingleSelection,
|
|
24384
24591
|
useStorage,
|
|
24592
|
+
useSwipeGesture,
|
|
24385
24593
|
useTabContext,
|
|
24386
24594
|
useTableColumnDefinitionContext,
|
|
24387
24595
|
useTableContainerContext,
|