@helpwave/hightide 0.6.2 → 0.6.3
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 +346 -204
- package/dist/index.d.ts +346 -204
- package/dist/index.js +877 -743
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +764 -645
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -7251,7 +7251,7 @@ function useForm() {
|
|
|
7251
7251
|
if (!ctx) throw new Error("FormContext is only available inside a <Form>");
|
|
7252
7252
|
return ctx;
|
|
7253
7253
|
}
|
|
7254
|
-
function useFormField(key) {
|
|
7254
|
+
function useFormField(key, { triggerUpdate = true }) {
|
|
7255
7255
|
const context = useContext(FormContext);
|
|
7256
7256
|
const subscribe = useCallback2((cb) => {
|
|
7257
7257
|
if (!context) return () => {
|
|
@@ -7266,20 +7266,31 @@ function useFormField(key) {
|
|
|
7266
7266
|
subscribe,
|
|
7267
7267
|
() => context ? context.store.getError(key) : void 0
|
|
7268
7268
|
);
|
|
7269
|
+
const getDataProps = useCallback2(() => {
|
|
7270
|
+
return {
|
|
7271
|
+
value: context ? context.store.getValue(key) : void 0,
|
|
7272
|
+
onValueChange: (val) => context?.store.setValue(key, val),
|
|
7273
|
+
onEditComplete: (val) => {
|
|
7274
|
+
context?.store.setTouched(key);
|
|
7275
|
+
context?.store.setValue(key, val, triggerUpdate);
|
|
7276
|
+
}
|
|
7277
|
+
};
|
|
7278
|
+
}, [context, key, triggerUpdate]);
|
|
7269
7279
|
if (!context) return null;
|
|
7270
|
-
const { registerRef
|
|
7280
|
+
const { registerRef } = context;
|
|
7271
7281
|
return {
|
|
7282
|
+
store: context.store,
|
|
7272
7283
|
value,
|
|
7273
7284
|
error,
|
|
7274
|
-
dataProps: getDataProps(
|
|
7285
|
+
dataProps: getDataProps(),
|
|
7275
7286
|
registerRef: registerRef(key)
|
|
7276
7287
|
};
|
|
7277
7288
|
}
|
|
7278
7289
|
|
|
7279
7290
|
// src/components/form/FormField.tsx
|
|
7280
7291
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
7281
|
-
var FormField = ({ children, name: name2, ...props }) => {
|
|
7282
|
-
const formField = useFormField(name2);
|
|
7292
|
+
var FormField = ({ children, name: name2, triggerUpdateOnEditComplete, ...props }) => {
|
|
7293
|
+
const formField = useFormField(name2, { triggerUpdate: triggerUpdateOnEditComplete });
|
|
7283
7294
|
if (!formField) {
|
|
7284
7295
|
throw new Error("<FormField> can only be used inside a FormContext try wrapping your app in a <FormProvider>");
|
|
7285
7296
|
}
|
|
@@ -7290,7 +7301,10 @@ var FormField = ({ children, name: name2, ...props }) => {
|
|
|
7290
7301
|
...formFieldLayoutBag.ariaAttributes,
|
|
7291
7302
|
ref: formField.registerRef
|
|
7292
7303
|
},
|
|
7293
|
-
interactionStates: formFieldLayoutBag.interactionStates
|
|
7304
|
+
interactionStates: formFieldLayoutBag.interactionStates,
|
|
7305
|
+
other: {
|
|
7306
|
+
updateValue: (value) => formField.store.setValue(name2, value, true)
|
|
7307
|
+
}
|
|
7294
7308
|
}) });
|
|
7295
7309
|
};
|
|
7296
7310
|
|
|
@@ -7299,6 +7313,7 @@ var FormStore = class {
|
|
|
7299
7313
|
constructor({
|
|
7300
7314
|
initialValues,
|
|
7301
7315
|
hasTriedSubmitting,
|
|
7316
|
+
submittingTouchesAll = true,
|
|
7302
7317
|
validators = {},
|
|
7303
7318
|
validationBehaviour = "touched"
|
|
7304
7319
|
}) {
|
|
@@ -7306,9 +7321,16 @@ var FormStore = class {
|
|
|
7306
7321
|
this.errors = {};
|
|
7307
7322
|
this.touched = {};
|
|
7308
7323
|
this.listeners = /* @__PURE__ */ new Map();
|
|
7324
|
+
this.submittingTouchesAll = false;
|
|
7309
7325
|
this.initialValues = initialValues;
|
|
7310
7326
|
this.values = { ...initialValues };
|
|
7311
7327
|
this.hasTriedSubmitting = hasTriedSubmitting;
|
|
7328
|
+
this.submittingTouchesAll = submittingTouchesAll;
|
|
7329
|
+
if (this.submittingTouchesAll && this.hasTriedSubmitting) {
|
|
7330
|
+
Object.keys(this.initialValues).forEach((key) => {
|
|
7331
|
+
this.touched[key] = true;
|
|
7332
|
+
});
|
|
7333
|
+
}
|
|
7312
7334
|
this.validators = validators;
|
|
7313
7335
|
this.validationBehaviour = validationBehaviour;
|
|
7314
7336
|
this.validateAll();
|
|
@@ -7320,14 +7342,37 @@ var FormStore = class {
|
|
|
7320
7342
|
getAllValues() {
|
|
7321
7343
|
return { ...this.values };
|
|
7322
7344
|
}
|
|
7323
|
-
setValue(key, value) {
|
|
7324
|
-
if (this.values[key]
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7345
|
+
setValue(key, value, triggerUpdate = false) {
|
|
7346
|
+
if (this.values[key] !== value) {
|
|
7347
|
+
this.values[key] = value;
|
|
7348
|
+
this.validate(key);
|
|
7349
|
+
this.notify({ type: "onChange", key, value, values: this.values });
|
|
7350
|
+
}
|
|
7351
|
+
if (triggerUpdate) {
|
|
7352
|
+
this.notify({
|
|
7353
|
+
type: "onUpdate",
|
|
7354
|
+
key: "ALL",
|
|
7355
|
+
updatedKeys: [key],
|
|
7356
|
+
update: { [key]: value },
|
|
7357
|
+
values: this.values,
|
|
7358
|
+
hasErrors: this.getHasError(),
|
|
7359
|
+
errors: this.getErrors()
|
|
7360
|
+
});
|
|
7361
|
+
}
|
|
7328
7362
|
}
|
|
7329
|
-
setValues(values) {
|
|
7363
|
+
setValues(values, triggerUpdate = false) {
|
|
7330
7364
|
Object.keys(values).forEach((key) => this.setValue(key, values[key]));
|
|
7365
|
+
if (triggerUpdate) {
|
|
7366
|
+
this.notify({
|
|
7367
|
+
type: "onUpdate",
|
|
7368
|
+
key: "ALL",
|
|
7369
|
+
updatedKeys: Object.keys(values),
|
|
7370
|
+
update: { ...values },
|
|
7371
|
+
values: this.values,
|
|
7372
|
+
hasErrors: this.getHasError(),
|
|
7373
|
+
errors: this.getErrors()
|
|
7374
|
+
});
|
|
7375
|
+
}
|
|
7331
7376
|
}
|
|
7332
7377
|
// Touched
|
|
7333
7378
|
getTouched(key) {
|
|
@@ -7337,6 +7382,7 @@ var FormStore = class {
|
|
|
7337
7382
|
if (this.touched[key] === isTouched) return;
|
|
7338
7383
|
this.touched[key] = isTouched;
|
|
7339
7384
|
this.validate(key);
|
|
7385
|
+
this.notify({ type: "onTouched", key, value: this.values[key], values: { ...this.values } });
|
|
7340
7386
|
}
|
|
7341
7387
|
// Error and Validation
|
|
7342
7388
|
getHasError() {
|
|
@@ -7355,7 +7401,7 @@ var FormStore = class {
|
|
|
7355
7401
|
} else {
|
|
7356
7402
|
this.errors[key] = error;
|
|
7357
7403
|
}
|
|
7358
|
-
this.notify({ type: "onError", key, value: this.values[key], error });
|
|
7404
|
+
this.notify({ type: "onError", key, value: this.values[key], error, values: { ...this.values } });
|
|
7359
7405
|
}
|
|
7360
7406
|
changeValidationBehavoir(validationBehaviour) {
|
|
7361
7407
|
if (validationBehaviour === this.validationBehaviour) return;
|
|
@@ -7404,35 +7450,30 @@ var FormStore = class {
|
|
|
7404
7450
|
// Form
|
|
7405
7451
|
submit() {
|
|
7406
7452
|
this.hasTriedSubmitting = true;
|
|
7407
|
-
|
|
7408
|
-
this.
|
|
7409
|
-
|
|
7410
|
-
|
|
7411
|
-
const hasErrors = Object.keys(this.errors).length > 0;
|
|
7412
|
-
if (hasErrors) {
|
|
7413
|
-
this.notify({
|
|
7414
|
-
type: "submitError",
|
|
7415
|
-
key: "ALL",
|
|
7416
|
-
errors: this.errors,
|
|
7417
|
-
values: this.values
|
|
7418
|
-
});
|
|
7419
|
-
} else {
|
|
7420
|
-
this.notify({
|
|
7421
|
-
type: "submit",
|
|
7422
|
-
key: "ALL",
|
|
7423
|
-
values: this.values
|
|
7453
|
+
if (this.submittingTouchesAll) {
|
|
7454
|
+
Object.keys(this.initialValues).forEach((k) => {
|
|
7455
|
+
this.touched[k] = true;
|
|
7456
|
+
this.validate(k);
|
|
7424
7457
|
});
|
|
7425
7458
|
}
|
|
7459
|
+
const hasErrors = Object.keys(this.errors).length > 0;
|
|
7460
|
+
this.notify({
|
|
7461
|
+
type: "onSubmit",
|
|
7462
|
+
key: "ALL",
|
|
7463
|
+
hasErrors,
|
|
7464
|
+
errors: { ...this.errors },
|
|
7465
|
+
values: { ...this.values }
|
|
7466
|
+
});
|
|
7426
7467
|
}
|
|
7427
7468
|
reset() {
|
|
7428
7469
|
this.values = { ...this.initialValues };
|
|
7429
7470
|
this.hasTriedSubmitting = false;
|
|
7430
7471
|
this.touched = {};
|
|
7431
7472
|
Object.keys(this.initialValues).forEach((key) => {
|
|
7432
|
-
this.notify({ type: "onChange", key, value: this.values[key] });
|
|
7473
|
+
this.notify({ type: "onChange", key, value: this.values[key], values: { ...this.values } });
|
|
7433
7474
|
});
|
|
7434
7475
|
this.validateAll();
|
|
7435
|
-
this.notify({ type: "reset", key: "ALL", values: this.values, errors: this.errors });
|
|
7476
|
+
this.notify({ type: "reset", key: "ALL", values: { ...this.values }, errors: { ...this.errors } });
|
|
7436
7477
|
}
|
|
7437
7478
|
};
|
|
7438
7479
|
|
|
@@ -7442,6 +7483,8 @@ function useCreateForm({
|
|
|
7442
7483
|
onFormSubmit,
|
|
7443
7484
|
onFormError,
|
|
7444
7485
|
onValueChange,
|
|
7486
|
+
onUpdate,
|
|
7487
|
+
onValidUpdate,
|
|
7445
7488
|
initialValues,
|
|
7446
7489
|
hasTriedSubmitting,
|
|
7447
7490
|
validators,
|
|
@@ -7471,22 +7514,24 @@ function useCreateForm({
|
|
|
7471
7514
|
}, []);
|
|
7472
7515
|
useEffect3(() => {
|
|
7473
7516
|
const handleUpdate = (event) => {
|
|
7474
|
-
if (event.type === "
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7517
|
+
if (event.type === "onSubmit") {
|
|
7518
|
+
if (event.hasErrors) {
|
|
7519
|
+
onFormError?.(event.values, event.errors);
|
|
7520
|
+
if (scrollToElements) {
|
|
7521
|
+
const errorInputs = Object.keys(event.errors).filter((key) => event.errors[key]).map((key) => fieldRefs.current[key]).filter((el) => el !== null && el !== void 0);
|
|
7522
|
+
if (errorInputs.length > 0) {
|
|
7523
|
+
errorInputs.sort((a, b) => {
|
|
7524
|
+
const position = a.compareDocumentPosition(b);
|
|
7525
|
+
if (position & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
|
|
7526
|
+
if (position & Node.DOCUMENT_POSITION_PRECEDING) return 1;
|
|
7527
|
+
return 0;
|
|
7528
|
+
});
|
|
7529
|
+
errorInputs[0].scrollIntoView(scrollOptions);
|
|
7530
|
+
errorInputs[0].focus();
|
|
7531
|
+
}
|
|
7489
7532
|
}
|
|
7533
|
+
} else {
|
|
7534
|
+
onFormSubmit(event.values);
|
|
7490
7535
|
}
|
|
7491
7536
|
} else if (event.type === "reset") {
|
|
7492
7537
|
if (scrollToElements) {
|
|
@@ -7506,23 +7551,18 @@ function useCreateForm({
|
|
|
7506
7551
|
}
|
|
7507
7552
|
} else if (event.type === "onChange") {
|
|
7508
7553
|
onValueChange?.(storeRef.current.getAllValues());
|
|
7554
|
+
} else if (event.type === "onUpdate") {
|
|
7555
|
+
onUpdate?.(event.updatedKeys, event.update);
|
|
7556
|
+
if (!event.hasErrors) {
|
|
7557
|
+
onValidUpdate?.(event.updatedKeys, event.update);
|
|
7558
|
+
}
|
|
7509
7559
|
}
|
|
7510
7560
|
};
|
|
7511
7561
|
const unsubscribe = storeRef.current.subscribe("ALL", handleUpdate);
|
|
7512
7562
|
return () => {
|
|
7513
7563
|
unsubscribe();
|
|
7514
7564
|
};
|
|
7515
|
-
}, [onFormError, onFormSubmit, onValueChange, scrollOptions, scrollToElements]);
|
|
7516
|
-
const getDataProps = useCallback3((key) => {
|
|
7517
|
-
return {
|
|
7518
|
-
value: storeRef.current.getValue(key),
|
|
7519
|
-
onValueChange: (val) => storeRef.current.setValue(key, val),
|
|
7520
|
-
onEditComplete: (val) => {
|
|
7521
|
-
storeRef.current.setValue(key, val);
|
|
7522
|
-
storeRef.current.setTouched(key);
|
|
7523
|
-
}
|
|
7524
|
-
};
|
|
7525
|
-
}, []);
|
|
7565
|
+
}, [onFormError, onFormSubmit, onUpdate, onValidUpdate, onValueChange, scrollOptions, scrollToElements]);
|
|
7526
7566
|
const callbacks = useMemo3(() => ({
|
|
7527
7567
|
reset: () => storeRef.current.reset(),
|
|
7528
7568
|
submit: () => storeRef.current.submit(),
|
|
@@ -7543,7 +7583,6 @@ function useCreateForm({
|
|
|
7543
7583
|
return {
|
|
7544
7584
|
store: storeRef.current,
|
|
7545
7585
|
...callbacks,
|
|
7546
|
-
getDataProps,
|
|
7547
7586
|
registerRef
|
|
7548
7587
|
};
|
|
7549
7588
|
}
|
|
@@ -9311,7 +9350,6 @@ var Expandable = forwardRef4(function Expandable2({
|
|
|
9311
9350
|
children,
|
|
9312
9351
|
id,
|
|
9313
9352
|
label,
|
|
9314
|
-
icon,
|
|
9315
9353
|
isExpanded,
|
|
9316
9354
|
onChange,
|
|
9317
9355
|
clickOnlyOnHeader = true,
|
|
@@ -9321,8 +9359,6 @@ var Expandable = forwardRef4(function Expandable2({
|
|
|
9321
9359
|
contentClassName,
|
|
9322
9360
|
contentExpandedClassName
|
|
9323
9361
|
}, ref) {
|
|
9324
|
-
const defaultIcon = useCallback8((expanded) => /* @__PURE__ */ jsx20(ExpansionIcon, { isExpanded: expanded }), []);
|
|
9325
|
-
const iconBuilder = icon ?? defaultIcon;
|
|
9326
9362
|
return /* @__PURE__ */ jsxs9(
|
|
9327
9363
|
ExpandableRoot,
|
|
9328
9364
|
{
|
|
@@ -9334,10 +9370,7 @@ var Expandable = forwardRef4(function Expandable2({
|
|
|
9334
9370
|
allowContainerToggle: !clickOnlyOnHeader,
|
|
9335
9371
|
className,
|
|
9336
9372
|
children: [
|
|
9337
|
-
/* @__PURE__ */
|
|
9338
|
-
label,
|
|
9339
|
-
/* @__PURE__ */ jsx20(ExpandableContext.Consumer, { children: (ctx) => iconBuilder(ctx?.isExpanded ?? false) })
|
|
9340
|
-
] }),
|
|
9373
|
+
/* @__PURE__ */ jsx20(ExpandableHeader, { className: headerClassName, children: label }),
|
|
9341
9374
|
/* @__PURE__ */ jsx20(ExpandableContext.Consumer, { children: (ctx) => /* @__PURE__ */ jsx20(
|
|
9342
9375
|
ExpandableContent,
|
|
9343
9376
|
{
|
|
@@ -9525,9 +9558,9 @@ var FloatingContainer = forwardRef5(function FloatingContainer2({
|
|
|
9525
9558
|
screenPadding = 16,
|
|
9526
9559
|
gap = 4,
|
|
9527
9560
|
...props
|
|
9528
|
-
},
|
|
9561
|
+
}, forwardRef16) {
|
|
9529
9562
|
const innerRef = useRef6(null);
|
|
9530
|
-
useImperativeHandle(
|
|
9563
|
+
useImperativeHandle(forwardRef16, () => innerRef.current);
|
|
9531
9564
|
const position = useFloatingElement({
|
|
9532
9565
|
active: !props.hidden,
|
|
9533
9566
|
containerRef: innerRef,
|
|
@@ -10865,23 +10898,9 @@ var InputDialog = ({
|
|
|
10865
10898
|
);
|
|
10866
10899
|
};
|
|
10867
10900
|
|
|
10868
|
-
// src/components/user-interaction/
|
|
10869
|
-
import {
|
|
10870
|
-
|
|
10871
|
-
forwardRef as forwardRef8,
|
|
10872
|
-
useCallback as useCallback14,
|
|
10873
|
-
useContext as useContext8,
|
|
10874
|
-
useEffect as useEffect17,
|
|
10875
|
-
useId as useId9,
|
|
10876
|
-
useImperativeHandle as useImperativeHandle3,
|
|
10877
|
-
useMemo as useMemo12,
|
|
10878
|
-
useRef as useRef12,
|
|
10879
|
-
useState as useState19
|
|
10880
|
-
} from "react";
|
|
10881
|
-
import clsx13 from "clsx";
|
|
10882
|
-
import { CheckIcon, Plus, XIcon } from "lucide-react";
|
|
10883
|
-
import { createPortal as createPortal5 } from "react-dom";
|
|
10884
|
-
import { jsx as jsx34, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
10901
|
+
// src/components/user-interaction/select/SelectContext.tsx
|
|
10902
|
+
import { createContext as createContext8, useCallback as useCallback14, useContext as useContext8, useEffect as useEffect17, useId as useId9, useMemo as useMemo12, useRef as useRef12, useState as useState19 } from "react";
|
|
10903
|
+
import { jsx as jsx34 } from "react/jsx-runtime";
|
|
10885
10904
|
var defaultToggleOpenOptions = {
|
|
10886
10905
|
highlightStartPositionBehavior: "first"
|
|
10887
10906
|
};
|
|
@@ -10889,28 +10908,34 @@ var SelectContext = createContext8(null);
|
|
|
10889
10908
|
function useSelectContext() {
|
|
10890
10909
|
const ctx = useContext8(SelectContext);
|
|
10891
10910
|
if (!ctx) {
|
|
10892
|
-
throw new Error("
|
|
10911
|
+
throw new Error("useSelectContext must be used within a SelectRoot or MultiSelectRoot");
|
|
10893
10912
|
}
|
|
10894
10913
|
return ctx;
|
|
10895
10914
|
}
|
|
10896
|
-
var
|
|
10915
|
+
var PrimitveSelectRoot = ({
|
|
10897
10916
|
children,
|
|
10898
10917
|
id,
|
|
10899
10918
|
value,
|
|
10900
10919
|
onValueChange,
|
|
10901
10920
|
values,
|
|
10902
10921
|
onValuesChange,
|
|
10903
|
-
|
|
10922
|
+
onClose,
|
|
10923
|
+
initialIsOpen = false,
|
|
10904
10924
|
disabled = false,
|
|
10925
|
+
readOnly = false,
|
|
10926
|
+
required = false,
|
|
10905
10927
|
invalid = false,
|
|
10906
10928
|
isMultiSelect = false,
|
|
10907
10929
|
iconAppearance = "left"
|
|
10908
10930
|
}) => {
|
|
10909
10931
|
const triggerRef = useRef12(null);
|
|
10910
10932
|
const generatedId = useId9();
|
|
10911
|
-
const
|
|
10933
|
+
const [ids, setIds] = useState19({
|
|
10934
|
+
trigger: id ?? (isMultiSelect ? "multi-select-" + generatedId : "select-" + generatedId),
|
|
10935
|
+
content: isMultiSelect ? "multi-select-content-" + generatedId : "select-content-" + generatedId
|
|
10936
|
+
});
|
|
10912
10937
|
const [internalState, setInternalState] = useState19({
|
|
10913
|
-
isOpen,
|
|
10938
|
+
isOpen: initialIsOpen,
|
|
10914
10939
|
options: []
|
|
10915
10940
|
});
|
|
10916
10941
|
const selectedValues = useMemo12(
|
|
@@ -10923,9 +10948,10 @@ var SelectRoot = ({
|
|
|
10923
10948
|
);
|
|
10924
10949
|
const state = {
|
|
10925
10950
|
...internalState,
|
|
10926
|
-
id: usedId,
|
|
10927
10951
|
disabled,
|
|
10928
10952
|
invalid,
|
|
10953
|
+
readOnly,
|
|
10954
|
+
required,
|
|
10929
10955
|
value: selectedValues,
|
|
10930
10956
|
selectedOptions
|
|
10931
10957
|
};
|
|
@@ -11003,7 +11029,7 @@ var SelectRoot = ({
|
|
|
11003
11029
|
const unregisterTrigger = useCallback14(() => {
|
|
11004
11030
|
triggerRef.current = null;
|
|
11005
11031
|
}, []);
|
|
11006
|
-
const toggleOpen = (
|
|
11032
|
+
const toggleOpen = (isOpen, toggleOpenOptions) => {
|
|
11007
11033
|
const { highlightStartPositionBehavior } = { ...defaultToggleOpenOptions, ...toggleOpenOptions };
|
|
11008
11034
|
let firstSelectedValue;
|
|
11009
11035
|
let firstEnabledValue;
|
|
@@ -11019,11 +11045,15 @@ var SelectRoot = ({
|
|
|
11019
11045
|
}
|
|
11020
11046
|
}
|
|
11021
11047
|
}
|
|
11048
|
+
const newIsOpen = isOpen ?? !internalState.isOpen;
|
|
11022
11049
|
setInternalState((prevState) => ({
|
|
11023
11050
|
...prevState,
|
|
11024
|
-
isOpen:
|
|
11051
|
+
isOpen: newIsOpen,
|
|
11025
11052
|
highlightedValue: firstSelectedValue ?? firstEnabledValue
|
|
11026
11053
|
}));
|
|
11054
|
+
if (!newIsOpen) {
|
|
11055
|
+
onClose?.();
|
|
11056
|
+
}
|
|
11027
11057
|
};
|
|
11028
11058
|
const moveHighlightedIndex = (delta) => {
|
|
11029
11059
|
let highlightedIndex = state.options.findIndex((value2) => value2.value === internalState.highlightedValue);
|
|
@@ -11056,6 +11086,8 @@ var SelectRoot = ({
|
|
|
11056
11086
|
}
|
|
11057
11087
|
}, [internalState.highlightedValue]);
|
|
11058
11088
|
const contextValue = {
|
|
11089
|
+
ids,
|
|
11090
|
+
setIds,
|
|
11059
11091
|
state,
|
|
11060
11092
|
config,
|
|
11061
11093
|
item: {
|
|
@@ -11074,14 +11106,52 @@ var SelectRoot = ({
|
|
|
11074
11106
|
};
|
|
11075
11107
|
return /* @__PURE__ */ jsx34(SelectContext.Provider, { value: contextValue, children });
|
|
11076
11108
|
};
|
|
11109
|
+
var SelectRoot = ({ value, onValueChange, onEditComplete, ...props }) => {
|
|
11110
|
+
return /* @__PURE__ */ jsx34(
|
|
11111
|
+
PrimitveSelectRoot,
|
|
11112
|
+
{
|
|
11113
|
+
...props,
|
|
11114
|
+
isMultiSelect: false,
|
|
11115
|
+
value,
|
|
11116
|
+
onValueChange: (value2) => {
|
|
11117
|
+
onValueChange?.(value2);
|
|
11118
|
+
onEditComplete?.(value2);
|
|
11119
|
+
}
|
|
11120
|
+
}
|
|
11121
|
+
);
|
|
11122
|
+
};
|
|
11123
|
+
var MultiSelectRoot = ({ value, onValueChange, onEditComplete, ...props }) => {
|
|
11124
|
+
return /* @__PURE__ */ jsx34(
|
|
11125
|
+
PrimitveSelectRoot,
|
|
11126
|
+
{
|
|
11127
|
+
...props,
|
|
11128
|
+
isMultiSelect: true,
|
|
11129
|
+
values: value,
|
|
11130
|
+
onValuesChange: (values) => {
|
|
11131
|
+
onValueChange?.(values);
|
|
11132
|
+
},
|
|
11133
|
+
onClose: () => {
|
|
11134
|
+
onEditComplete?.(value);
|
|
11135
|
+
props.onClose?.();
|
|
11136
|
+
}
|
|
11137
|
+
}
|
|
11138
|
+
);
|
|
11139
|
+
};
|
|
11140
|
+
|
|
11141
|
+
// src/components/user-interaction/select/SelectComponents.tsx
|
|
11142
|
+
import { forwardRef as forwardRef8, useEffect as useEffect18, useImperativeHandle as useImperativeHandle3, useRef as useRef13 } from "react";
|
|
11143
|
+
import clsx13 from "clsx";
|
|
11144
|
+
import { CheckIcon } from "lucide-react";
|
|
11145
|
+
import { createPortal as createPortal5 } from "react-dom";
|
|
11146
|
+
import { jsx as jsx35, jsxs as jsxs17 } from "react/jsx-runtime";
|
|
11077
11147
|
var SelectOption = forwardRef8(
|
|
11078
11148
|
function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
|
|
11079
11149
|
const { state, config, item, trigger } = useSelectContext();
|
|
11080
11150
|
const { register, unregister, toggleSelection, highlightItem } = item;
|
|
11081
|
-
const itemRef =
|
|
11151
|
+
const itemRef = useRef13(null);
|
|
11082
11152
|
iconAppearance ??= config.iconAppearance;
|
|
11083
11153
|
const label = children ?? value;
|
|
11084
|
-
|
|
11154
|
+
useEffect18(() => {
|
|
11085
11155
|
register({
|
|
11086
11156
|
value,
|
|
11087
11157
|
label,
|
|
@@ -11131,7 +11201,7 @@ var SelectOption = forwardRef8(
|
|
|
11131
11201
|
}
|
|
11132
11202
|
},
|
|
11133
11203
|
children: [
|
|
11134
|
-
iconAppearance === "left" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */
|
|
11204
|
+
iconAppearance === "left" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ jsx35(
|
|
11135
11205
|
CheckIcon,
|
|
11136
11206
|
{
|
|
11137
11207
|
className: clsx13("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
@@ -11139,7 +11209,7 @@ var SelectOption = forwardRef8(
|
|
|
11139
11209
|
}
|
|
11140
11210
|
),
|
|
11141
11211
|
label,
|
|
11142
|
-
iconAppearance === "right" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */
|
|
11212
|
+
iconAppearance === "right" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ jsx35(
|
|
11143
11213
|
CheckIcon,
|
|
11144
11214
|
{
|
|
11145
11215
|
className: clsx13("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
@@ -11151,13 +11221,26 @@ var SelectOption = forwardRef8(
|
|
|
11151
11221
|
);
|
|
11152
11222
|
}
|
|
11153
11223
|
);
|
|
11154
|
-
var SelectButton = forwardRef8(function SelectButton2({
|
|
11224
|
+
var SelectButton = forwardRef8(function SelectButton2({
|
|
11225
|
+
id,
|
|
11226
|
+
placeholder,
|
|
11227
|
+
selectedDisplay,
|
|
11228
|
+
...props
|
|
11229
|
+
}, ref) {
|
|
11155
11230
|
const translation = useHightideTranslation();
|
|
11156
|
-
const { state, trigger } = useSelectContext();
|
|
11231
|
+
const { state, trigger, setIds, ids } = useSelectContext();
|
|
11157
11232
|
const { register, unregister, toggleOpen } = trigger;
|
|
11158
|
-
|
|
11233
|
+
useEffect18(() => {
|
|
11234
|
+
if (id) {
|
|
11235
|
+
setIds((prev) => ({
|
|
11236
|
+
...prev,
|
|
11237
|
+
trigger: id
|
|
11238
|
+
}));
|
|
11239
|
+
}
|
|
11240
|
+
}, [id, setIds]);
|
|
11241
|
+
const innerRef = useRef13(null);
|
|
11159
11242
|
useImperativeHandle3(ref, () => innerRef.current);
|
|
11160
|
-
|
|
11243
|
+
useEffect18(() => {
|
|
11161
11244
|
register(innerRef);
|
|
11162
11245
|
return () => unregister();
|
|
11163
11246
|
}, [register, unregister]);
|
|
@@ -11169,7 +11252,7 @@ var SelectButton = forwardRef8(function SelectButton2({ placeholder, selectedDis
|
|
|
11169
11252
|
{
|
|
11170
11253
|
...props,
|
|
11171
11254
|
ref: innerRef,
|
|
11172
|
-
id:
|
|
11255
|
+
id: ids.trigger,
|
|
11173
11256
|
disabled,
|
|
11174
11257
|
type: "button",
|
|
11175
11258
|
onClick: (event) => {
|
|
@@ -11199,29 +11282,188 @@ var SelectButton = forwardRef8(function SelectButton2({ placeholder, selectedDis
|
|
|
11199
11282
|
"aria-disabled": disabled,
|
|
11200
11283
|
"aria-haspopup": "listbox",
|
|
11201
11284
|
"aria-expanded": state.isOpen,
|
|
11202
|
-
"aria-controls": state.isOpen ?
|
|
11285
|
+
"aria-controls": state.isOpen ? ids.content : void 0,
|
|
11203
11286
|
children: [
|
|
11204
|
-
hasValue ? selectedDisplay?.(state.value) ?? /* @__PURE__ */
|
|
11287
|
+
hasValue ? selectedDisplay?.(state.value) ?? /* @__PURE__ */ jsx35("div", { className: clsx13("flex flex-wrap gap-x-1 gap-y-2"), children: state.selectedOptions.map(({ value, label }, index) => /* @__PURE__ */ jsxs17("span", { className: "flex-row-0", children: [
|
|
11205
11288
|
label,
|
|
11206
|
-
index < state.value.length - 1 && /* @__PURE__ */
|
|
11289
|
+
index < state.value.length - 1 && /* @__PURE__ */ jsx35("span", { children: "," })
|
|
11207
11290
|
] }, value)) }) : placeholder ?? translation("clickToSelect"),
|
|
11208
|
-
/* @__PURE__ */
|
|
11291
|
+
/* @__PURE__ */ jsx35(ExpansionIcon, { isExpanded: state.isOpen })
|
|
11209
11292
|
]
|
|
11210
11293
|
}
|
|
11211
11294
|
);
|
|
11212
11295
|
});
|
|
11213
|
-
var
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11296
|
+
var SelectContent = forwardRef8(function SelectContent2({
|
|
11297
|
+
id,
|
|
11298
|
+
alignment,
|
|
11299
|
+
orientation = "vertical",
|
|
11300
|
+
containerClassName,
|
|
11301
|
+
...props
|
|
11302
|
+
}, ref) {
|
|
11303
|
+
const innerRef = useRef13(null);
|
|
11217
11304
|
useImperativeHandle3(ref, () => innerRef.current);
|
|
11218
|
-
|
|
11305
|
+
const { trigger, state, config, item, ids, setIds } = useSelectContext();
|
|
11306
|
+
useEffect18(() => {
|
|
11307
|
+
if (id) {
|
|
11308
|
+
setIds((prev) => ({
|
|
11309
|
+
...prev,
|
|
11310
|
+
content: id
|
|
11311
|
+
}));
|
|
11312
|
+
}
|
|
11313
|
+
}, [id, setIds]);
|
|
11314
|
+
const position = useFloatingElement({
|
|
11315
|
+
active: state.isOpen,
|
|
11316
|
+
anchorRef: trigger.ref,
|
|
11317
|
+
containerRef: innerRef,
|
|
11318
|
+
...alignment
|
|
11319
|
+
});
|
|
11320
|
+
useFocusTrap({
|
|
11321
|
+
container: innerRef,
|
|
11322
|
+
active: state.isOpen && !!position
|
|
11323
|
+
});
|
|
11324
|
+
const { zIndex } = useOverlayRegistry({ isActive: state.isOpen });
|
|
11325
|
+
return createPortal5(
|
|
11326
|
+
/* @__PURE__ */ jsxs17(
|
|
11327
|
+
"div",
|
|
11328
|
+
{
|
|
11329
|
+
id: ids.content,
|
|
11330
|
+
className: clsx13("fixed inset-0 w-screen h-screen", containerClassName),
|
|
11331
|
+
style: { zIndex },
|
|
11332
|
+
hidden: !state.isOpen,
|
|
11333
|
+
children: [
|
|
11334
|
+
/* @__PURE__ */ jsx35(
|
|
11335
|
+
"div",
|
|
11336
|
+
{
|
|
11337
|
+
onClick: () => trigger.toggleOpen(false),
|
|
11338
|
+
className: clsx13("fixed inset-0 w-screen h-screen")
|
|
11339
|
+
}
|
|
11340
|
+
),
|
|
11341
|
+
/* @__PURE__ */ jsx35(
|
|
11342
|
+
"ul",
|
|
11343
|
+
{
|
|
11344
|
+
...props,
|
|
11345
|
+
ref: innerRef,
|
|
11346
|
+
onKeyDown: (event) => {
|
|
11347
|
+
switch (event.key) {
|
|
11348
|
+
case "Escape":
|
|
11349
|
+
trigger.toggleOpen(false);
|
|
11350
|
+
event.preventDefault();
|
|
11351
|
+
event.stopPropagation();
|
|
11352
|
+
break;
|
|
11353
|
+
case match(orientation, {
|
|
11354
|
+
vertical: "ArrowDown",
|
|
11355
|
+
horizontal: "ArrowUp"
|
|
11356
|
+
}):
|
|
11357
|
+
item.moveHighlightedIndex(1);
|
|
11358
|
+
event.preventDefault();
|
|
11359
|
+
break;
|
|
11360
|
+
case match(orientation, {
|
|
11361
|
+
vertical: "ArrowUp",
|
|
11362
|
+
horizontal: "ArrowDown"
|
|
11363
|
+
}):
|
|
11364
|
+
item.moveHighlightedIndex(-1);
|
|
11365
|
+
event.preventDefault();
|
|
11366
|
+
break;
|
|
11367
|
+
case "Home":
|
|
11368
|
+
event.preventDefault();
|
|
11369
|
+
break;
|
|
11370
|
+
case "End":
|
|
11371
|
+
event.preventDefault();
|
|
11372
|
+
break;
|
|
11373
|
+
case "Enter":
|
|
11374
|
+
// Fall through
|
|
11375
|
+
case " ":
|
|
11376
|
+
if (state.highlightedValue) {
|
|
11377
|
+
item.toggleSelection(state.highlightedValue);
|
|
11378
|
+
if (!config.isMultiSelect) {
|
|
11379
|
+
trigger.toggleOpen(false);
|
|
11380
|
+
}
|
|
11381
|
+
event.preventDefault();
|
|
11382
|
+
}
|
|
11383
|
+
break;
|
|
11384
|
+
}
|
|
11385
|
+
},
|
|
11386
|
+
className: clsx13("flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-outline-within overflow-auto", props.className),
|
|
11387
|
+
style: {
|
|
11388
|
+
opacity: position ? void 0 : 0,
|
|
11389
|
+
position: "fixed",
|
|
11390
|
+
...position
|
|
11391
|
+
},
|
|
11392
|
+
role: "listbox",
|
|
11393
|
+
"aria-multiselectable": config.isMultiSelect,
|
|
11394
|
+
"aria-orientation": orientation,
|
|
11395
|
+
tabIndex: position ? 0 : void 0,
|
|
11396
|
+
children: props.children
|
|
11397
|
+
}
|
|
11398
|
+
)
|
|
11399
|
+
]
|
|
11400
|
+
}
|
|
11401
|
+
),
|
|
11402
|
+
document.body
|
|
11403
|
+
);
|
|
11404
|
+
});
|
|
11405
|
+
var MultiSelectOption = SelectOption;
|
|
11406
|
+
var MultiSelectContent = SelectContent;
|
|
11407
|
+
var MultiSelectButton = SelectButton;
|
|
11408
|
+
|
|
11409
|
+
// src/components/user-interaction/select/MultiSelect.tsx
|
|
11410
|
+
import { forwardRef as forwardRef9 } from "react";
|
|
11411
|
+
import { jsx as jsx36, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
11412
|
+
var MultiSelect = forwardRef9(function MultiSelect2({
|
|
11413
|
+
children,
|
|
11414
|
+
contentPanelProps,
|
|
11415
|
+
buttonProps,
|
|
11416
|
+
...props
|
|
11417
|
+
}, ref) {
|
|
11418
|
+
return /* @__PURE__ */ jsxs18(MultiSelectRoot, { ...props, children: [
|
|
11419
|
+
/* @__PURE__ */ jsx36(MultiSelectButton, { ref, ...buttonProps }),
|
|
11420
|
+
/* @__PURE__ */ jsx36(MultiSelectContent, { ...contentPanelProps, children })
|
|
11421
|
+
] });
|
|
11422
|
+
});
|
|
11423
|
+
var MultiSelectUncontrolled = forwardRef9(function MultiSelectUncontrolled2({
|
|
11424
|
+
value: initialValue,
|
|
11425
|
+
onValueChange,
|
|
11426
|
+
...props
|
|
11427
|
+
}, ref) {
|
|
11428
|
+
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
11429
|
+
return /* @__PURE__ */ jsx36(
|
|
11430
|
+
MultiSelect,
|
|
11431
|
+
{
|
|
11432
|
+
...props,
|
|
11433
|
+
ref,
|
|
11434
|
+
value,
|
|
11435
|
+
onValueChange: setValue
|
|
11436
|
+
}
|
|
11437
|
+
);
|
|
11438
|
+
});
|
|
11439
|
+
|
|
11440
|
+
// src/components/user-interaction/select/MultiSelectChipDisplay.tsx
|
|
11441
|
+
import { forwardRef as forwardRef10, useEffect as useEffect19, useImperativeHandle as useImperativeHandle4, useRef as useRef14 } from "react";
|
|
11442
|
+
import { XIcon, Plus } from "lucide-react";
|
|
11443
|
+
import { jsx as jsx37, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
11444
|
+
var MultiSelectChipDisplayButton = forwardRef10(function MultiSelectChipDisplayButton2({
|
|
11445
|
+
id,
|
|
11446
|
+
...props
|
|
11447
|
+
}, ref) {
|
|
11448
|
+
const { state, trigger, item, ids, setIds } = useSelectContext();
|
|
11449
|
+
const { register, unregister, toggleOpen } = trigger;
|
|
11450
|
+
useEffect19(() => {
|
|
11451
|
+
if (id) {
|
|
11452
|
+
setIds((prev) => ({
|
|
11453
|
+
...prev,
|
|
11454
|
+
trigger: id
|
|
11455
|
+
}));
|
|
11456
|
+
}
|
|
11457
|
+
}, [id, setIds]);
|
|
11458
|
+
const innerRef = useRef14(null);
|
|
11459
|
+
useImperativeHandle4(ref, () => innerRef.current);
|
|
11460
|
+
useEffect19(() => {
|
|
11219
11461
|
register(innerRef);
|
|
11220
11462
|
return () => unregister();
|
|
11221
11463
|
}, [register, unregister]);
|
|
11222
11464
|
const disabled = !!props?.disabled || !!state.disabled;
|
|
11223
11465
|
const invalid = state.invalid;
|
|
11224
|
-
return /* @__PURE__ */
|
|
11466
|
+
return /* @__PURE__ */ jsxs19(
|
|
11225
11467
|
"div",
|
|
11226
11468
|
{
|
|
11227
11469
|
...props,
|
|
@@ -11237,9 +11479,9 @@ var SelectChipDisplay = forwardRef8(function SelectChipDisplay2({ ...props }, re
|
|
|
11237
11479
|
"aria-invalid": invalid,
|
|
11238
11480
|
"aria-disabled": disabled,
|
|
11239
11481
|
children: [
|
|
11240
|
-
state.selectedOptions.map(({ value, label }) => /* @__PURE__ */
|
|
11482
|
+
state.selectedOptions.map(({ value, label }) => /* @__PURE__ */ jsxs19(Chip, { className: "gap-x-2", children: [
|
|
11241
11483
|
label,
|
|
11242
|
-
/* @__PURE__ */
|
|
11484
|
+
/* @__PURE__ */ jsx37(
|
|
11243
11485
|
Button,
|
|
11244
11486
|
{
|
|
11245
11487
|
onClick: () => {
|
|
@@ -11250,14 +11492,14 @@ var SelectChipDisplay = forwardRef8(function SelectChipDisplay2({ ...props }, re
|
|
|
11250
11492
|
coloringStyle: "text",
|
|
11251
11493
|
layout: "icon",
|
|
11252
11494
|
className: "flex-row-0 items-center",
|
|
11253
|
-
children: /* @__PURE__ */
|
|
11495
|
+
children: /* @__PURE__ */ jsx37(XIcon, { className: "size-5" })
|
|
11254
11496
|
}
|
|
11255
11497
|
)
|
|
11256
11498
|
] }, value)),
|
|
11257
|
-
/* @__PURE__ */
|
|
11499
|
+
/* @__PURE__ */ jsx37(
|
|
11258
11500
|
Button,
|
|
11259
11501
|
{
|
|
11260
|
-
id:
|
|
11502
|
+
id: ids.trigger,
|
|
11261
11503
|
onClick: (event) => {
|
|
11262
11504
|
event.stopPropagation();
|
|
11263
11505
|
toggleOpen();
|
|
@@ -11278,149 +11520,34 @@ var SelectChipDisplay = forwardRef8(function SelectChipDisplay2({ ...props }, re
|
|
|
11278
11520
|
"aria-disabled": disabled,
|
|
11279
11521
|
"aria-haspopup": "listbox",
|
|
11280
11522
|
"aria-expanded": state.isOpen,
|
|
11281
|
-
"aria-controls": state.isOpen ?
|
|
11523
|
+
"aria-controls": state.isOpen ? ids.content : void 0,
|
|
11282
11524
|
className: "size-9",
|
|
11283
|
-
children: /* @__PURE__ */
|
|
11525
|
+
children: /* @__PURE__ */ jsx37(Plus, {})
|
|
11284
11526
|
}
|
|
11285
11527
|
)
|
|
11286
11528
|
]
|
|
11287
11529
|
}
|
|
11288
11530
|
);
|
|
11289
11531
|
});
|
|
11290
|
-
var
|
|
11291
|
-
function SelectContent2({
|
|
11292
|
-
alignment,
|
|
11293
|
-
orientation = "vertical",
|
|
11294
|
-
containerClassName,
|
|
11295
|
-
...props
|
|
11296
|
-
}, ref) {
|
|
11297
|
-
const innerRef = useRef12(null);
|
|
11298
|
-
useImperativeHandle3(ref, () => innerRef.current);
|
|
11299
|
-
const { trigger, state, config, item } = useSelectContext();
|
|
11300
|
-
const position = useFloatingElement({
|
|
11301
|
-
active: state.isOpen,
|
|
11302
|
-
anchorRef: trigger.ref,
|
|
11303
|
-
containerRef: innerRef,
|
|
11304
|
-
...alignment
|
|
11305
|
-
});
|
|
11306
|
-
useFocusTrap({
|
|
11307
|
-
container: innerRef,
|
|
11308
|
-
active: state.isOpen && !!position
|
|
11309
|
-
});
|
|
11310
|
-
const { zIndex } = useOverlayRegistry({ isActive: state.isOpen });
|
|
11311
|
-
return createPortal5(
|
|
11312
|
-
/* @__PURE__ */ jsxs17(
|
|
11313
|
-
"div",
|
|
11314
|
-
{
|
|
11315
|
-
id: `select-container-${state.id}`,
|
|
11316
|
-
className: clsx13("fixed inset-0 w-screen h-screen", containerClassName),
|
|
11317
|
-
style: { zIndex },
|
|
11318
|
-
hidden: !state.isOpen,
|
|
11319
|
-
children: [
|
|
11320
|
-
/* @__PURE__ */ jsx34(
|
|
11321
|
-
"div",
|
|
11322
|
-
{
|
|
11323
|
-
id: `select-background-${state.id}`,
|
|
11324
|
-
onClick: () => trigger.toggleOpen(false),
|
|
11325
|
-
className: clsx13("fixed inset-0 w-screen h-screen")
|
|
11326
|
-
}
|
|
11327
|
-
),
|
|
11328
|
-
/* @__PURE__ */ jsx34(
|
|
11329
|
-
"ul",
|
|
11330
|
-
{
|
|
11331
|
-
...props,
|
|
11332
|
-
id: `${state.id}-listbox`,
|
|
11333
|
-
ref: innerRef,
|
|
11334
|
-
onKeyDown: (event) => {
|
|
11335
|
-
switch (event.key) {
|
|
11336
|
-
case "Escape":
|
|
11337
|
-
trigger.toggleOpen(false);
|
|
11338
|
-
event.preventDefault();
|
|
11339
|
-
event.stopPropagation();
|
|
11340
|
-
break;
|
|
11341
|
-
case match(orientation, {
|
|
11342
|
-
vertical: "ArrowDown",
|
|
11343
|
-
horizontal: "ArrowUp"
|
|
11344
|
-
}):
|
|
11345
|
-
item.moveHighlightedIndex(1);
|
|
11346
|
-
event.preventDefault();
|
|
11347
|
-
break;
|
|
11348
|
-
case match(orientation, {
|
|
11349
|
-
vertical: "ArrowUp",
|
|
11350
|
-
horizontal: "ArrowDown"
|
|
11351
|
-
}):
|
|
11352
|
-
item.moveHighlightedIndex(-1);
|
|
11353
|
-
event.preventDefault();
|
|
11354
|
-
break;
|
|
11355
|
-
case "Home":
|
|
11356
|
-
event.preventDefault();
|
|
11357
|
-
break;
|
|
11358
|
-
case "End":
|
|
11359
|
-
event.preventDefault();
|
|
11360
|
-
break;
|
|
11361
|
-
case "Enter":
|
|
11362
|
-
// Fall through
|
|
11363
|
-
case " ":
|
|
11364
|
-
if (state.highlightedValue) {
|
|
11365
|
-
item.toggleSelection(state.highlightedValue);
|
|
11366
|
-
if (!config.isMultiSelect) {
|
|
11367
|
-
trigger.toggleOpen(false);
|
|
11368
|
-
}
|
|
11369
|
-
event.preventDefault();
|
|
11370
|
-
}
|
|
11371
|
-
break;
|
|
11372
|
-
}
|
|
11373
|
-
},
|
|
11374
|
-
className: clsx13("flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-outline-within overflow-auto", props.className),
|
|
11375
|
-
style: {
|
|
11376
|
-
opacity: position ? void 0 : 0,
|
|
11377
|
-
position: "fixed",
|
|
11378
|
-
...position
|
|
11379
|
-
},
|
|
11380
|
-
role: "listbox",
|
|
11381
|
-
"aria-multiselectable": config.isMultiSelect,
|
|
11382
|
-
"aria-orientation": orientation,
|
|
11383
|
-
tabIndex: position ? 0 : void 0,
|
|
11384
|
-
children: props.children
|
|
11385
|
-
}
|
|
11386
|
-
)
|
|
11387
|
-
]
|
|
11388
|
-
}
|
|
11389
|
-
),
|
|
11390
|
-
document.body
|
|
11391
|
-
);
|
|
11392
|
-
}
|
|
11393
|
-
);
|
|
11394
|
-
var Select = forwardRef8(function Select2({
|
|
11532
|
+
var MultiSelectChipDisplay = forwardRef10(function MultiSelectChipDisplay2({
|
|
11395
11533
|
children,
|
|
11396
11534
|
contentPanelProps,
|
|
11397
|
-
|
|
11535
|
+
chipDisplayProps,
|
|
11398
11536
|
...props
|
|
11399
11537
|
}, ref) {
|
|
11400
|
-
return /* @__PURE__ */
|
|
11401
|
-
/* @__PURE__ */
|
|
11402
|
-
|
|
11403
|
-
{
|
|
11404
|
-
ref,
|
|
11405
|
-
...buttonProps,
|
|
11406
|
-
selectedDisplay: (values) => {
|
|
11407
|
-
const value = values[0];
|
|
11408
|
-
if (!buttonProps?.selectedDisplay) return void 0;
|
|
11409
|
-
return buttonProps.selectedDisplay(value);
|
|
11410
|
-
}
|
|
11411
|
-
}
|
|
11412
|
-
),
|
|
11413
|
-
/* @__PURE__ */ jsx34(SelectContent, { ...contentPanelProps, children })
|
|
11538
|
+
return /* @__PURE__ */ jsxs19(MultiSelectRoot, { ...props, children: [
|
|
11539
|
+
/* @__PURE__ */ jsx37(MultiSelectChipDisplayButton, { ref, ...chipDisplayProps }),
|
|
11540
|
+
/* @__PURE__ */ jsx37(MultiSelectContent, { ...contentPanelProps, children })
|
|
11414
11541
|
] });
|
|
11415
11542
|
});
|
|
11416
|
-
var
|
|
11543
|
+
var MultiSelectChipDisplayUncontrolled = forwardRef10(function MultiSelectChipDisplayUncontrolled2({
|
|
11417
11544
|
value: initialValue,
|
|
11418
11545
|
onValueChange,
|
|
11419
11546
|
...props
|
|
11420
11547
|
}, ref) {
|
|
11421
11548
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
11422
|
-
return /* @__PURE__ */
|
|
11423
|
-
|
|
11549
|
+
return /* @__PURE__ */ jsx37(
|
|
11550
|
+
MultiSelectChipDisplay,
|
|
11424
11551
|
{
|
|
11425
11552
|
...props,
|
|
11426
11553
|
ref,
|
|
@@ -11429,56 +11556,42 @@ var SelectUncontrolled = forwardRef8(function SelectUncontrolled2({
|
|
|
11429
11556
|
}
|
|
11430
11557
|
);
|
|
11431
11558
|
});
|
|
11432
|
-
|
|
11559
|
+
|
|
11560
|
+
// src/components/user-interaction/select/Select.tsx
|
|
11561
|
+
import {
|
|
11562
|
+
forwardRef as forwardRef11
|
|
11563
|
+
} from "react";
|
|
11564
|
+
import { jsx as jsx38, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
11565
|
+
var Select = forwardRef11(function Select2({
|
|
11433
11566
|
children,
|
|
11434
|
-
value,
|
|
11435
|
-
onValueChange,
|
|
11436
11567
|
contentPanelProps,
|
|
11437
11568
|
buttonProps,
|
|
11438
11569
|
...props
|
|
11439
11570
|
}, ref) {
|
|
11440
|
-
return /* @__PURE__ */
|
|
11441
|
-
/* @__PURE__ */
|
|
11442
|
-
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11447
|
-
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
{
|
|
11454
|
-
...props,
|
|
11455
|
-
ref,
|
|
11456
|
-
value,
|
|
11457
|
-
onValueChange: setValue
|
|
11458
|
-
}
|
|
11459
|
-
);
|
|
11460
|
-
});
|
|
11461
|
-
var MultiSelectChipDisplay = forwardRef8(function MultiSelectChipDisplay2({
|
|
11462
|
-
children,
|
|
11463
|
-
value,
|
|
11464
|
-
onValueChange,
|
|
11465
|
-
contentPanelProps,
|
|
11466
|
-
chipDisplayProps,
|
|
11467
|
-
...props
|
|
11468
|
-
}, ref) {
|
|
11469
|
-
return /* @__PURE__ */ jsxs17(SelectRoot, { ...props, values: value, onValuesChange: onValueChange, isMultiSelect: true, children: [
|
|
11470
|
-
/* @__PURE__ */ jsx34(SelectChipDisplay, { ref, ...chipDisplayProps }),
|
|
11471
|
-
/* @__PURE__ */ jsx34(SelectContent, { ...contentPanelProps, children })
|
|
11571
|
+
return /* @__PURE__ */ jsxs20(SelectRoot, { ...props, children: [
|
|
11572
|
+
/* @__PURE__ */ jsx38(
|
|
11573
|
+
SelectButton,
|
|
11574
|
+
{
|
|
11575
|
+
ref,
|
|
11576
|
+
...buttonProps,
|
|
11577
|
+
selectedDisplay: (values) => {
|
|
11578
|
+
const value = values[0];
|
|
11579
|
+
if (!buttonProps?.selectedDisplay) return void 0;
|
|
11580
|
+
return buttonProps.selectedDisplay(value);
|
|
11581
|
+
}
|
|
11582
|
+
}
|
|
11583
|
+
),
|
|
11584
|
+
/* @__PURE__ */ jsx38(SelectContent, { ...contentPanelProps, children })
|
|
11472
11585
|
] });
|
|
11473
11586
|
});
|
|
11474
|
-
var
|
|
11587
|
+
var SelectUncontrolled = forwardRef11(function SelectUncontrolled2({
|
|
11475
11588
|
value: initialValue,
|
|
11476
11589
|
onValueChange,
|
|
11477
11590
|
...props
|
|
11478
11591
|
}, ref) {
|
|
11479
11592
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
11480
|
-
return /* @__PURE__ */
|
|
11481
|
-
|
|
11593
|
+
return /* @__PURE__ */ jsx38(
|
|
11594
|
+
Select,
|
|
11482
11595
|
{
|
|
11483
11596
|
...props,
|
|
11484
11597
|
ref,
|
|
@@ -11489,7 +11602,7 @@ var MultiSelectChipDisplayUncontrolled = forwardRef8(function MultiSelectChipDis
|
|
|
11489
11602
|
});
|
|
11490
11603
|
|
|
11491
11604
|
// src/components/layout/dialog/LanguageDialog.tsx
|
|
11492
|
-
import { jsx as
|
|
11605
|
+
import { jsx as jsx39, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
11493
11606
|
var LanguageDialog = ({
|
|
11494
11607
|
onClose,
|
|
11495
11608
|
titleOverwrite,
|
|
@@ -11498,15 +11611,15 @@ var LanguageDialog = ({
|
|
|
11498
11611
|
}) => {
|
|
11499
11612
|
const { locale, setLocale } = useLocale();
|
|
11500
11613
|
const translation = useHightideTranslation();
|
|
11501
|
-
return /* @__PURE__ */
|
|
11614
|
+
return /* @__PURE__ */ jsx39(
|
|
11502
11615
|
Dialog,
|
|
11503
11616
|
{
|
|
11504
11617
|
titleElement: titleOverwrite ?? translation("language"),
|
|
11505
11618
|
description: descriptionOverwrite ?? translation("chooseLanguage"),
|
|
11506
11619
|
onClose,
|
|
11507
11620
|
...props,
|
|
11508
|
-
children: /* @__PURE__ */
|
|
11509
|
-
/* @__PURE__ */
|
|
11621
|
+
children: /* @__PURE__ */ jsxs21("div", { className: "w-64", children: [
|
|
11622
|
+
/* @__PURE__ */ jsx39(
|
|
11510
11623
|
Select,
|
|
11511
11624
|
{
|
|
11512
11625
|
value: locale,
|
|
@@ -11514,10 +11627,10 @@ var LanguageDialog = ({
|
|
|
11514
11627
|
buttonProps: {
|
|
11515
11628
|
selectedDisplay: (locale2) => LocalizationUtil.languagesLocalNames[locale2]
|
|
11516
11629
|
},
|
|
11517
|
-
children: LocalizationUtil.locals.map((local) => /* @__PURE__ */
|
|
11630
|
+
children: LocalizationUtil.locals.map((local) => /* @__PURE__ */ jsx39(SelectOption, { value: local, children: LocalizationUtil.languagesLocalNames[local] }, local))
|
|
11518
11631
|
}
|
|
11519
11632
|
),
|
|
11520
|
-
/* @__PURE__ */
|
|
11633
|
+
/* @__PURE__ */ jsx39("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ jsx39(Button, { color: "positive", onClick: onClose, children: translation("done") }) })
|
|
11521
11634
|
] })
|
|
11522
11635
|
}
|
|
11523
11636
|
);
|
|
@@ -11528,8 +11641,8 @@ import { MonitorCog, MoonIcon, SunIcon } from "lucide-react";
|
|
|
11528
11641
|
import clsx14 from "clsx";
|
|
11529
11642
|
|
|
11530
11643
|
// src/contexts/ThemeContext.tsx
|
|
11531
|
-
import { createContext as createContext9, useCallback as useCallback15, useContext as useContext9, useEffect as
|
|
11532
|
-
import { jsx as
|
|
11644
|
+
import { createContext as createContext9, useCallback as useCallback15, useContext as useContext9, useEffect as useEffect20, useMemo as useMemo13, useState as useState20 } from "react";
|
|
11645
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
11533
11646
|
var themes = ["light", "dark", "system"];
|
|
11534
11647
|
var ThemeUtil = {
|
|
11535
11648
|
themes
|
|
@@ -11555,7 +11668,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11555
11668
|
}
|
|
11556
11669
|
return initialTheme ?? config.theme.initialTheme;
|
|
11557
11670
|
}, [config.theme.initialTheme, initialTheme, storedTheme, theme, themePreference]);
|
|
11558
|
-
|
|
11671
|
+
useEffect20(() => {
|
|
11559
11672
|
if (!theme) return;
|
|
11560
11673
|
if (theme === "system") {
|
|
11561
11674
|
deleteStoredTheme();
|
|
@@ -11563,7 +11676,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11563
11676
|
setStoredTheme(theme);
|
|
11564
11677
|
}
|
|
11565
11678
|
}, [theme]);
|
|
11566
|
-
|
|
11679
|
+
useEffect20(() => {
|
|
11567
11680
|
document.documentElement.setAttribute("data-theme", resolvedTheme);
|
|
11568
11681
|
}, [resolvedTheme]);
|
|
11569
11682
|
const getPreference = useCallback15(() => {
|
|
@@ -11571,10 +11684,10 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11571
11684
|
const prefersLight = window.matchMedia("(prefers-color-scheme: light)").matches;
|
|
11572
11685
|
setThemePreference(prefersDark ? "dark" : prefersLight ? "light" : "system");
|
|
11573
11686
|
}, []);
|
|
11574
|
-
|
|
11687
|
+
useEffect20(() => {
|
|
11575
11688
|
getPreference();
|
|
11576
11689
|
}, [getPreference]);
|
|
11577
|
-
|
|
11690
|
+
useEffect20(() => {
|
|
11578
11691
|
const darkQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
11579
11692
|
const lightQuery = window.matchMedia("(prefers-color-scheme: light)");
|
|
11580
11693
|
const noPrefQuery = window.matchMedia("(prefers-color-scheme: no-preference)");
|
|
@@ -11587,7 +11700,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11587
11700
|
noPrefQuery.removeEventListener("change", getPreference);
|
|
11588
11701
|
};
|
|
11589
11702
|
}, [getPreference]);
|
|
11590
|
-
return /* @__PURE__ */
|
|
11703
|
+
return /* @__PURE__ */ jsx40(
|
|
11591
11704
|
ThemeContext.Provider,
|
|
11592
11705
|
{
|
|
11593
11706
|
value: {
|
|
@@ -11613,14 +11726,14 @@ var useTheme = () => {
|
|
|
11613
11726
|
};
|
|
11614
11727
|
|
|
11615
11728
|
// src/components/layout/dialog/ThemeDialog.tsx
|
|
11616
|
-
import { jsx as
|
|
11729
|
+
import { jsx as jsx41, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
11617
11730
|
var ThemeIcon = ({ theme, className }) => {
|
|
11618
11731
|
if (theme === "dark") {
|
|
11619
|
-
return /* @__PURE__ */
|
|
11732
|
+
return /* @__PURE__ */ jsx41(MoonIcon, { className: clsx14("w-4 h-4", className) });
|
|
11620
11733
|
} else if (theme === "light") {
|
|
11621
|
-
return /* @__PURE__ */
|
|
11734
|
+
return /* @__PURE__ */ jsx41(SunIcon, { className: clsx14("w-4 h-4", className) });
|
|
11622
11735
|
} else {
|
|
11623
|
-
return /* @__PURE__ */
|
|
11736
|
+
return /* @__PURE__ */ jsx41(MonitorCog, { className: clsx14("w-4 h-4", className) });
|
|
11624
11737
|
}
|
|
11625
11738
|
};
|
|
11626
11739
|
var ThemeDialog = ({
|
|
@@ -11631,34 +11744,34 @@ var ThemeDialog = ({
|
|
|
11631
11744
|
}) => {
|
|
11632
11745
|
const { theme, setTheme } = useTheme();
|
|
11633
11746
|
const translation = useHightideTranslation();
|
|
11634
|
-
return /* @__PURE__ */
|
|
11747
|
+
return /* @__PURE__ */ jsx41(
|
|
11635
11748
|
Dialog,
|
|
11636
11749
|
{
|
|
11637
11750
|
titleElement: titleOverwrite ?? translation("pThemes", { count: 1 }),
|
|
11638
11751
|
description: descriptionOverwrite ?? translation("chooseTheme"),
|
|
11639
11752
|
onClose,
|
|
11640
11753
|
...props,
|
|
11641
|
-
children: /* @__PURE__ */
|
|
11642
|
-
/* @__PURE__ */
|
|
11754
|
+
children: /* @__PURE__ */ jsxs22("div", { className: "w-64", children: [
|
|
11755
|
+
/* @__PURE__ */ jsx41(
|
|
11643
11756
|
Select,
|
|
11644
11757
|
{
|
|
11645
11758
|
value: theme,
|
|
11646
11759
|
onValueChange: (theme2) => setTheme(theme2),
|
|
11647
11760
|
iconAppearance: "right",
|
|
11648
11761
|
buttonProps: {
|
|
11649
|
-
selectedDisplay: (value) => /* @__PURE__ */
|
|
11650
|
-
/* @__PURE__ */
|
|
11762
|
+
selectedDisplay: (value) => /* @__PURE__ */ jsxs22("div", { className: "flex-row-2 items-center", children: [
|
|
11763
|
+
/* @__PURE__ */ jsx41(ThemeIcon, { theme }),
|
|
11651
11764
|
translation("sThemeMode", { theme: value })
|
|
11652
11765
|
] }),
|
|
11653
11766
|
className: "min-w-32"
|
|
11654
11767
|
},
|
|
11655
|
-
children: ThemeUtil.themes.map((theme2) => /* @__PURE__ */
|
|
11656
|
-
/* @__PURE__ */
|
|
11768
|
+
children: ThemeUtil.themes.map((theme2) => /* @__PURE__ */ jsx41(SelectOption, { value: theme2, className: "gap-x-6 justify-between", children: /* @__PURE__ */ jsxs22("div", { className: "flex-row-2 items-center", children: [
|
|
11769
|
+
/* @__PURE__ */ jsx41(ThemeIcon, { theme: theme2 }),
|
|
11657
11770
|
translation("sThemeMode", { theme: theme2 })
|
|
11658
11771
|
] }) }, theme2))
|
|
11659
11772
|
}
|
|
11660
11773
|
),
|
|
11661
|
-
/* @__PURE__ */
|
|
11774
|
+
/* @__PURE__ */ jsx41("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ jsx41(Button, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
|
|
11662
11775
|
] })
|
|
11663
11776
|
}
|
|
11664
11777
|
);
|
|
@@ -11667,14 +11780,14 @@ var ThemeDialog = ({
|
|
|
11667
11780
|
// src/components/layout/loading/ErrorComponent.tsx
|
|
11668
11781
|
import { AlertOctagon } from "lucide-react";
|
|
11669
11782
|
import clsx15 from "clsx";
|
|
11670
|
-
import { jsx as
|
|
11783
|
+
import { jsx as jsx42, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
11671
11784
|
var ErrorComponent = ({
|
|
11672
11785
|
errorText,
|
|
11673
11786
|
classname
|
|
11674
11787
|
}) => {
|
|
11675
11788
|
const translation = useHightideTranslation();
|
|
11676
|
-
return /* @__PURE__ */
|
|
11677
|
-
/* @__PURE__ */
|
|
11789
|
+
return /* @__PURE__ */ jsxs23("div", { className: clsx15("flex-col-4 items-center justify-center w-full h-24", classname), children: [
|
|
11790
|
+
/* @__PURE__ */ jsx42(AlertOctagon, { size: 64, className: "text-warning" }),
|
|
11678
11791
|
errorText ?? `${translation("errorOccurred")} :(`
|
|
11679
11792
|
] });
|
|
11680
11793
|
};
|
|
@@ -11684,14 +11797,14 @@ import { useState as useState21 } from "react";
|
|
|
11684
11797
|
|
|
11685
11798
|
// src/components/layout/loading/LoadingContainer.tsx
|
|
11686
11799
|
import { clsx as clsx16 } from "clsx";
|
|
11687
|
-
import { jsx as
|
|
11800
|
+
import { jsx as jsx43 } from "react/jsx-runtime";
|
|
11688
11801
|
var LoadingContainer = ({ className }) => {
|
|
11689
|
-
return /* @__PURE__ */
|
|
11802
|
+
return /* @__PURE__ */ jsx43("div", { className: clsx16("relative overflow-hidden shimmer bg-disabled/30 rounded-md", className) });
|
|
11690
11803
|
};
|
|
11691
11804
|
|
|
11692
11805
|
// src/components/layout/loading/LoadingAndErrorComponent.tsx
|
|
11693
11806
|
import { clsx as clsx17 } from "clsx";
|
|
11694
|
-
import { Fragment as Fragment5, jsx as
|
|
11807
|
+
import { Fragment as Fragment5, jsx as jsx44 } from "react/jsx-runtime";
|
|
11695
11808
|
var LoadingAndErrorComponent = ({
|
|
11696
11809
|
children,
|
|
11697
11810
|
isLoading = false,
|
|
@@ -11711,33 +11824,33 @@ var LoadingAndErrorComponent = ({
|
|
|
11711
11824
|
}, minimumLoadingDuration);
|
|
11712
11825
|
}
|
|
11713
11826
|
if (isLoading || minimumLoadingDuration && isInMinimumLoading) {
|
|
11714
|
-
return /* @__PURE__ */
|
|
11827
|
+
return /* @__PURE__ */ jsx44(Fragment5, { children: loadingComponent ?? /* @__PURE__ */ jsx44(LoadingContainer, { className: clsx17(className) }) });
|
|
11715
11828
|
}
|
|
11716
11829
|
if (hasError) {
|
|
11717
|
-
return /* @__PURE__ */
|
|
11830
|
+
return /* @__PURE__ */ jsx44(Fragment5, { children: errorComponent ?? /* @__PURE__ */ jsx44(LoadingContainer, { className: clsx17("bg-negative", className) }) });
|
|
11718
11831
|
}
|
|
11719
|
-
return /* @__PURE__ */
|
|
11832
|
+
return /* @__PURE__ */ jsx44(Fragment5, { children });
|
|
11720
11833
|
};
|
|
11721
11834
|
|
|
11722
11835
|
// src/components/layout/loading/LoadingAnimation.tsx
|
|
11723
11836
|
import clsx18 from "clsx";
|
|
11724
|
-
import { jsx as
|
|
11837
|
+
import { jsx as jsx45, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
11725
11838
|
var LoadingAnimation = ({
|
|
11726
11839
|
loadingText,
|
|
11727
11840
|
classname
|
|
11728
11841
|
}) => {
|
|
11729
11842
|
const translation = useHightideTranslation();
|
|
11730
|
-
return /* @__PURE__ */
|
|
11731
|
-
/* @__PURE__ */
|
|
11843
|
+
return /* @__PURE__ */ jsxs24("div", { className: clsx18("flex-col-2 items-center justify-center w-full h-24", classname), children: [
|
|
11844
|
+
/* @__PURE__ */ jsx45(HelpwaveLogo, { animate: "loading" }),
|
|
11732
11845
|
loadingText ?? `${translation("loading")}...`
|
|
11733
11846
|
] });
|
|
11734
11847
|
};
|
|
11735
11848
|
|
|
11736
11849
|
// src/components/layout/navigation/BreadCrumbs.tsx
|
|
11737
11850
|
var import_link = __toESM(require_link2());
|
|
11738
|
-
import { jsx as
|
|
11851
|
+
import { jsx as jsx46, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
11739
11852
|
var BreadCrumbLink = ({ ...props }) => {
|
|
11740
|
-
return /* @__PURE__ */
|
|
11853
|
+
return /* @__PURE__ */ jsx46(
|
|
11741
11854
|
import_link.default,
|
|
11742
11855
|
{
|
|
11743
11856
|
...props,
|
|
@@ -11746,29 +11859,29 @@ var BreadCrumbLink = ({ ...props }) => {
|
|
|
11746
11859
|
);
|
|
11747
11860
|
};
|
|
11748
11861
|
var BreadCrumbDivider = () => {
|
|
11749
|
-
return /* @__PURE__ */
|
|
11862
|
+
return /* @__PURE__ */ jsx46("span", { "data-name": "breadcrumb-divider", children: "/" });
|
|
11750
11863
|
};
|
|
11751
11864
|
var BreadCrumbGroup = ({ children, divider, ...props }) => {
|
|
11752
11865
|
const items = ArrayUtil.resolveSingleOrArray(children);
|
|
11753
|
-
return /* @__PURE__ */
|
|
11866
|
+
return /* @__PURE__ */ jsx46("ul", { ...props, "data-name": props["data-name"] ?? "breadcrumb", children: items.map((item, index) => {
|
|
11754
11867
|
const isLast = index === items.length - 1;
|
|
11755
|
-
return /* @__PURE__ */
|
|
11868
|
+
return /* @__PURE__ */ jsxs25("li", { "data-name": "breadcrumb-item", children: [
|
|
11756
11869
|
item,
|
|
11757
|
-
!isLast && divider !== null && (divider ?? /* @__PURE__ */
|
|
11870
|
+
!isLast && divider !== null && (divider ?? /* @__PURE__ */ jsx46(BreadCrumbDivider, {}))
|
|
11758
11871
|
] }, index);
|
|
11759
11872
|
}) });
|
|
11760
11873
|
};
|
|
11761
11874
|
var BreadCrumbs = ({ crumbs }) => {
|
|
11762
|
-
return /* @__PURE__ */
|
|
11875
|
+
return /* @__PURE__ */ jsx46(BreadCrumbGroup, { children: crumbs.map(({ href, label }, index) => /* @__PURE__ */ jsx46(BreadCrumbLink, { href, children: label }, index)) });
|
|
11763
11876
|
};
|
|
11764
11877
|
|
|
11765
11878
|
// src/components/layout/navigation/Navigation.tsx
|
|
11766
11879
|
var import_link2 = __toESM(require_link2());
|
|
11767
11880
|
import { Menu as MenuIcon, XIcon as XIcon2 } from "lucide-react";
|
|
11768
|
-
import { useEffect as
|
|
11769
|
-
import { useCallback as useCallback16, useId as useId10, useRef as
|
|
11881
|
+
import { useEffect as useEffect21 } from "react";
|
|
11882
|
+
import { useCallback as useCallback16, useId as useId10, useRef as useRef15, useState as useState22 } from "react";
|
|
11770
11883
|
import clsx19 from "clsx";
|
|
11771
|
-
import { Fragment as Fragment6, jsx as
|
|
11884
|
+
import { Fragment as Fragment6, jsx as jsx47, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
11772
11885
|
function isSubItem(item) {
|
|
11773
11886
|
return "items" in item && Array.isArray(item.items);
|
|
11774
11887
|
}
|
|
@@ -11779,8 +11892,8 @@ var NavigationItemWithSubItem = ({
|
|
|
11779
11892
|
...options
|
|
11780
11893
|
}) => {
|
|
11781
11894
|
const [isOpen, setOpen] = useState22(false);
|
|
11782
|
-
const containerRef =
|
|
11783
|
-
const triggerRef =
|
|
11895
|
+
const containerRef = useRef15(null);
|
|
11896
|
+
const triggerRef = useRef15(null);
|
|
11784
11897
|
const id = useId10();
|
|
11785
11898
|
const style = useFloatingElement({
|
|
11786
11899
|
active: isOpen,
|
|
@@ -11796,8 +11909,8 @@ var NavigationItemWithSubItem = ({
|
|
|
11796
11909
|
}
|
|
11797
11910
|
}, []);
|
|
11798
11911
|
const { zIndex } = useOverlayRegistry();
|
|
11799
|
-
return /* @__PURE__ */
|
|
11800
|
-
/* @__PURE__ */
|
|
11912
|
+
return /* @__PURE__ */ jsxs26(Fragment6, { children: [
|
|
11913
|
+
/* @__PURE__ */ jsxs26(
|
|
11801
11914
|
"button",
|
|
11802
11915
|
{
|
|
11803
11916
|
id: "navigation-" + id,
|
|
@@ -11813,11 +11926,11 @@ var NavigationItemWithSubItem = ({
|
|
|
11813
11926
|
"aria-controls": "navigation-items-" + id,
|
|
11814
11927
|
children: [
|
|
11815
11928
|
label,
|
|
11816
|
-
/* @__PURE__ */
|
|
11929
|
+
/* @__PURE__ */ jsx47(ExpansionIcon, { isExpanded: isOpen })
|
|
11817
11930
|
]
|
|
11818
11931
|
}
|
|
11819
11932
|
),
|
|
11820
|
-
/* @__PURE__ */
|
|
11933
|
+
/* @__PURE__ */ jsx47(
|
|
11821
11934
|
"ul",
|
|
11822
11935
|
{
|
|
11823
11936
|
id: "navigation-items-" + id,
|
|
@@ -11836,7 +11949,7 @@ var NavigationItemWithSubItem = ({
|
|
|
11836
11949
|
{ "opacity-0": !style }
|
|
11837
11950
|
),
|
|
11838
11951
|
style: { ...style, zIndex },
|
|
11839
|
-
children: items.map(({ link, label: label2, external }, index) => /* @__PURE__ */
|
|
11952
|
+
children: items.map(({ link, label: label2, external }, index) => /* @__PURE__ */ jsx47("li", { children: /* @__PURE__ */ jsx47(
|
|
11840
11953
|
import_link2.default,
|
|
11841
11954
|
{
|
|
11842
11955
|
href: link,
|
|
@@ -11850,25 +11963,25 @@ var NavigationItemWithSubItem = ({
|
|
|
11850
11963
|
] });
|
|
11851
11964
|
};
|
|
11852
11965
|
var NavigationItemList = ({ items, ...restProps }) => {
|
|
11853
|
-
return /* @__PURE__ */
|
|
11966
|
+
return /* @__PURE__ */ jsx47("ul", { ...restProps, className: clsx19("flex-row-6 items-center", restProps.className), children: items.map((item, index) => /* @__PURE__ */ jsx47("li", { children: isSubItem(item) ? /* @__PURE__ */ jsx47(NavigationItemWithSubItem, { ...item }) : /* @__PURE__ */ jsx47(import_link2.default, { href: item.link, target: item.external ? "_blank" : void 0, className: "link", children: item.label }) }, index)) });
|
|
11854
11967
|
};
|
|
11855
11968
|
var Navigation = ({ ...props }) => {
|
|
11856
11969
|
const [isMobileOpen, setIsMobileOpen] = useState22(false);
|
|
11857
11970
|
const id = useId10();
|
|
11858
|
-
const menuRef =
|
|
11859
|
-
|
|
11971
|
+
const menuRef = useRef15(null);
|
|
11972
|
+
useEffect21(() => {
|
|
11860
11973
|
menuRef.current?.focus();
|
|
11861
11974
|
}, [isMobileOpen]);
|
|
11862
11975
|
const { zIndex } = useOverlayRegistry({ isActive: isMobileOpen });
|
|
11863
|
-
return /* @__PURE__ */
|
|
11864
|
-
/* @__PURE__ */
|
|
11976
|
+
return /* @__PURE__ */ jsxs26("nav", { children: [
|
|
11977
|
+
/* @__PURE__ */ jsx47(
|
|
11865
11978
|
NavigationItemList,
|
|
11866
11979
|
{
|
|
11867
11980
|
...props,
|
|
11868
11981
|
className: clsx19("hidden", { "desktop:flex": !isMobileOpen }, props.className)
|
|
11869
11982
|
}
|
|
11870
11983
|
),
|
|
11871
|
-
/* @__PURE__ */
|
|
11984
|
+
/* @__PURE__ */ jsx47(
|
|
11872
11985
|
Button,
|
|
11873
11986
|
{
|
|
11874
11987
|
layout: "icon",
|
|
@@ -11879,10 +11992,10 @@ var Navigation = ({ ...props }) => {
|
|
|
11879
11992
|
"aria-haspopup": "true",
|
|
11880
11993
|
"aria-expanded": isMobileOpen,
|
|
11881
11994
|
"aria-controls": "navigation-menu-" + id,
|
|
11882
|
-
children: /* @__PURE__ */
|
|
11995
|
+
children: /* @__PURE__ */ jsx47(MenuIcon, { className: "w-6 h-6" })
|
|
11883
11996
|
}
|
|
11884
11997
|
),
|
|
11885
|
-
/* @__PURE__ */
|
|
11998
|
+
/* @__PURE__ */ jsxs26(
|
|
11886
11999
|
"div",
|
|
11887
12000
|
{
|
|
11888
12001
|
id: "navigation-menu-" + id,
|
|
@@ -11904,17 +12017,17 @@ var Navigation = ({ ...props }) => {
|
|
|
11904
12017
|
),
|
|
11905
12018
|
style: { zIndex },
|
|
11906
12019
|
children: [
|
|
11907
|
-
/* @__PURE__ */
|
|
12020
|
+
/* @__PURE__ */ jsx47(
|
|
11908
12021
|
Button,
|
|
11909
12022
|
{
|
|
11910
12023
|
layout: "icon",
|
|
11911
12024
|
coloringStyle: "text",
|
|
11912
12025
|
color: "neutral",
|
|
11913
12026
|
onClick: () => setIsMobileOpen(false),
|
|
11914
|
-
children: /* @__PURE__ */
|
|
12027
|
+
children: /* @__PURE__ */ jsx47(XIcon2, {})
|
|
11915
12028
|
}
|
|
11916
12029
|
),
|
|
11917
|
-
/* @__PURE__ */
|
|
12030
|
+
/* @__PURE__ */ jsx47(NavigationItemList, { ...props, className: clsx19("flex-col-8", props.className) })
|
|
11918
12031
|
]
|
|
11919
12032
|
}
|
|
11920
12033
|
)
|
|
@@ -11924,8 +12037,8 @@ var Navigation = ({ ...props }) => {
|
|
|
11924
12037
|
// src/components/layout/navigation/Pagination.tsx
|
|
11925
12038
|
import { ChevronFirst, ChevronLast, ChevronLeft as ChevronLeft2, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
11926
12039
|
import clsx20 from "clsx";
|
|
11927
|
-
import { useEffect as
|
|
11928
|
-
import { jsx as
|
|
12040
|
+
import { useEffect as useEffect22, useState as useState23 } from "react";
|
|
12041
|
+
import { jsx as jsx48, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
11929
12042
|
var Pagination = ({
|
|
11930
12043
|
pageIndex,
|
|
11931
12044
|
pageCount,
|
|
@@ -11938,7 +12051,7 @@ var Pagination = ({
|
|
|
11938
12051
|
const noPages = pageCount === 0;
|
|
11939
12052
|
const onFirstPage = pageIndex === 0 && !noPages;
|
|
11940
12053
|
const onLastPage = pageIndex === pageCount - 1;
|
|
11941
|
-
|
|
12054
|
+
useEffect22(() => {
|
|
11942
12055
|
if (noPages) {
|
|
11943
12056
|
setValue("0");
|
|
11944
12057
|
} else {
|
|
@@ -11948,8 +12061,8 @@ var Pagination = ({
|
|
|
11948
12061
|
const changePage = (page) => {
|
|
11949
12062
|
onPageChanged(page);
|
|
11950
12063
|
};
|
|
11951
|
-
return /* @__PURE__ */
|
|
11952
|
-
/* @__PURE__ */
|
|
12064
|
+
return /* @__PURE__ */ jsxs27("div", { className: clsx20("flex-row-1", className), style, children: [
|
|
12065
|
+
/* @__PURE__ */ jsx48(
|
|
11953
12066
|
Button,
|
|
11954
12067
|
{
|
|
11955
12068
|
layout: "icon",
|
|
@@ -11957,10 +12070,10 @@ var Pagination = ({
|
|
|
11957
12070
|
color: "neutral",
|
|
11958
12071
|
onClick: () => changePage(0),
|
|
11959
12072
|
disabled: onFirstPage || noPages,
|
|
11960
|
-
children: /* @__PURE__ */
|
|
12073
|
+
children: /* @__PURE__ */ jsx48(ChevronFirst, {})
|
|
11961
12074
|
}
|
|
11962
12075
|
),
|
|
11963
|
-
/* @__PURE__ */
|
|
12076
|
+
/* @__PURE__ */ jsx48(
|
|
11964
12077
|
Button,
|
|
11965
12078
|
{
|
|
11966
12079
|
layout: "icon",
|
|
@@ -11968,11 +12081,11 @@ var Pagination = ({
|
|
|
11968
12081
|
color: "neutral",
|
|
11969
12082
|
onClick: () => changePage(pageIndex - 1),
|
|
11970
12083
|
disabled: onFirstPage || noPages,
|
|
11971
|
-
children: /* @__PURE__ */
|
|
12084
|
+
children: /* @__PURE__ */ jsx48(ChevronLeft2, {})
|
|
11972
12085
|
}
|
|
11973
12086
|
),
|
|
11974
|
-
/* @__PURE__ */
|
|
11975
|
-
/* @__PURE__ */
|
|
12087
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex-row-2 min-w-56 items-center justify-center mx-2 text-center", children: [
|
|
12088
|
+
/* @__PURE__ */ jsx48(
|
|
11976
12089
|
Input,
|
|
11977
12090
|
{
|
|
11978
12091
|
value,
|
|
@@ -11996,8 +12109,8 @@ var Pagination = ({
|
|
|
11996
12109
|
editCompleteOptions: { delay: 800 }
|
|
11997
12110
|
}
|
|
11998
12111
|
),
|
|
11999
|
-
/* @__PURE__ */
|
|
12000
|
-
/* @__PURE__ */
|
|
12112
|
+
/* @__PURE__ */ jsx48("span", { className: "select-none w-10", children: translation("of") }),
|
|
12113
|
+
/* @__PURE__ */ jsx48(
|
|
12001
12114
|
"span",
|
|
12002
12115
|
{
|
|
12003
12116
|
className: "flex-row-2 w-24 items-center justify-center select-none h-10 bg-input-background text-input-text rounded-md font-bold",
|
|
@@ -12005,7 +12118,7 @@ var Pagination = ({
|
|
|
12005
12118
|
}
|
|
12006
12119
|
)
|
|
12007
12120
|
] }),
|
|
12008
|
-
/* @__PURE__ */
|
|
12121
|
+
/* @__PURE__ */ jsx48(
|
|
12009
12122
|
Button,
|
|
12010
12123
|
{
|
|
12011
12124
|
layout: "icon",
|
|
@@ -12013,10 +12126,10 @@ var Pagination = ({
|
|
|
12013
12126
|
color: "neutral",
|
|
12014
12127
|
onClick: () => changePage(pageIndex + 1),
|
|
12015
12128
|
disabled: onLastPage || noPages,
|
|
12016
|
-
children: /* @__PURE__ */
|
|
12129
|
+
children: /* @__PURE__ */ jsx48(ChevronRight2, {})
|
|
12017
12130
|
}
|
|
12018
12131
|
),
|
|
12019
|
-
/* @__PURE__ */
|
|
12132
|
+
/* @__PURE__ */ jsx48(
|
|
12020
12133
|
Button,
|
|
12021
12134
|
{
|
|
12022
12135
|
layout: "icon",
|
|
@@ -12024,7 +12137,7 @@ var Pagination = ({
|
|
|
12024
12137
|
color: "neutral",
|
|
12025
12138
|
onClick: () => changePage(pageCount - 1),
|
|
12026
12139
|
disabled: onLastPage || noPages,
|
|
12027
|
-
children: /* @__PURE__ */
|
|
12140
|
+
children: /* @__PURE__ */ jsx48(ChevronLast, {})
|
|
12028
12141
|
}
|
|
12029
12142
|
)
|
|
12030
12143
|
] });
|
|
@@ -12033,7 +12146,7 @@ var Pagination = ({
|
|
|
12033
12146
|
// src/components/layout/navigation/StepperBar.tsx
|
|
12034
12147
|
import { Check, ChevronLeft as ChevronLeft3, ChevronRight as ChevronRight3 } from "lucide-react";
|
|
12035
12148
|
import clsx21 from "clsx";
|
|
12036
|
-
import { jsx as
|
|
12149
|
+
import { jsx as jsx49, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
12037
12150
|
var defaultState = {
|
|
12038
12151
|
currentStep: 0,
|
|
12039
12152
|
seenSteps: /* @__PURE__ */ new Set([0])
|
|
@@ -12055,12 +12168,12 @@ var StepperBar = ({
|
|
|
12055
12168
|
seenSteps.add(newStep);
|
|
12056
12169
|
onChange({ currentStep: newStep, seenSteps });
|
|
12057
12170
|
};
|
|
12058
|
-
return /* @__PURE__ */
|
|
12171
|
+
return /* @__PURE__ */ jsxs28(
|
|
12059
12172
|
"div",
|
|
12060
12173
|
{
|
|
12061
12174
|
className: clsx21("flex-row-2 justify-between", className),
|
|
12062
12175
|
children: [
|
|
12063
|
-
/* @__PURE__ */
|
|
12176
|
+
/* @__PURE__ */ jsx49("div", { className: "flex-row-2 flex-[2] justify-start", children: /* @__PURE__ */ jsxs28(
|
|
12064
12177
|
Button,
|
|
12065
12178
|
{
|
|
12066
12179
|
disabled: currentStep === 0 || disabledSteps.has(currentStep),
|
|
@@ -12069,14 +12182,14 @@ var StepperBar = ({
|
|
|
12069
12182
|
},
|
|
12070
12183
|
className: "flex-row-1 items-center justify-center",
|
|
12071
12184
|
children: [
|
|
12072
|
-
/* @__PURE__ */
|
|
12185
|
+
/* @__PURE__ */ jsx49(ChevronLeft3, { size: 14 }),
|
|
12073
12186
|
translation("back")
|
|
12074
12187
|
]
|
|
12075
12188
|
}
|
|
12076
12189
|
) }),
|
|
12077
|
-
/* @__PURE__ */
|
|
12190
|
+
/* @__PURE__ */ jsx49("div", { className: "flex-row-2 flex-[5] justify-center items-center", children: showDots && dots.map((value, index) => {
|
|
12078
12191
|
const seen = seenSteps.has(index);
|
|
12079
|
-
return /* @__PURE__ */
|
|
12192
|
+
return /* @__PURE__ */ jsx49(
|
|
12080
12193
|
"div",
|
|
12081
12194
|
{
|
|
12082
12195
|
onClick: () => seen && update(index),
|
|
@@ -12096,7 +12209,7 @@ var StepperBar = ({
|
|
|
12096
12209
|
index
|
|
12097
12210
|
);
|
|
12098
12211
|
}) }),
|
|
12099
|
-
currentStep !== numberOfSteps && /* @__PURE__ */
|
|
12212
|
+
currentStep !== numberOfSteps && /* @__PURE__ */ jsx49("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ jsxs28(
|
|
12100
12213
|
Button,
|
|
12101
12214
|
{
|
|
12102
12215
|
onClick: () => update(currentStep + 1),
|
|
@@ -12104,18 +12217,18 @@ var StepperBar = ({
|
|
|
12104
12217
|
disabled: disabledSteps.has(currentStep),
|
|
12105
12218
|
children: [
|
|
12106
12219
|
translation("next"),
|
|
12107
|
-
/* @__PURE__ */
|
|
12220
|
+
/* @__PURE__ */ jsx49(ChevronRight3, { size: 14 })
|
|
12108
12221
|
]
|
|
12109
12222
|
}
|
|
12110
12223
|
) }),
|
|
12111
|
-
currentStep === numberOfSteps && /* @__PURE__ */
|
|
12224
|
+
currentStep === numberOfSteps && /* @__PURE__ */ jsx49("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ jsxs28(
|
|
12112
12225
|
Button,
|
|
12113
12226
|
{
|
|
12114
12227
|
disabled: disabledSteps.has(currentStep),
|
|
12115
12228
|
onClick: onFinish,
|
|
12116
12229
|
className: "flex-row-1 items-center justify-center",
|
|
12117
12230
|
children: [
|
|
12118
|
-
/* @__PURE__ */
|
|
12231
|
+
/* @__PURE__ */ jsx49(Check, { size: 14 }),
|
|
12119
12232
|
finishText ?? translation("confirm")
|
|
12120
12233
|
]
|
|
12121
12234
|
}
|
|
@@ -12126,7 +12239,7 @@ var StepperBar = ({
|
|
|
12126
12239
|
};
|
|
12127
12240
|
var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
|
|
12128
12241
|
const [usedState, setUsedState] = useOverwritableState(state, onChange);
|
|
12129
|
-
return /* @__PURE__ */
|
|
12242
|
+
return /* @__PURE__ */ jsx49(
|
|
12130
12243
|
StepperBar,
|
|
12131
12244
|
{
|
|
12132
12245
|
...props,
|
|
@@ -12138,14 +12251,14 @@ var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
|
|
|
12138
12251
|
|
|
12139
12252
|
// src/components/layout/table/FillerCell.tsx
|
|
12140
12253
|
import { Minus } from "lucide-react";
|
|
12141
|
-
import { jsx as
|
|
12254
|
+
import { jsx as jsx50 } from "react/jsx-runtime";
|
|
12142
12255
|
var FillerCell = ({ ...props }) => {
|
|
12143
|
-
return /* @__PURE__ */
|
|
12256
|
+
return /* @__PURE__ */ jsx50(
|
|
12144
12257
|
"div",
|
|
12145
12258
|
{
|
|
12146
12259
|
...props,
|
|
12147
12260
|
"data-name": PropsUtil.dataAttributes.name("table-filler-cell"),
|
|
12148
|
-
children: /* @__PURE__ */
|
|
12261
|
+
children: /* @__PURE__ */ jsx50(Minus, { className: "max-w-4 max-h-4" })
|
|
12149
12262
|
}
|
|
12150
12263
|
);
|
|
12151
12264
|
};
|
|
@@ -12165,7 +12278,7 @@ var TableFilters = {
|
|
|
12165
12278
|
};
|
|
12166
12279
|
|
|
12167
12280
|
// src/components/layout/table/Table.tsx
|
|
12168
|
-
import { useCallback as useCallback20, useEffect as
|
|
12281
|
+
import { useCallback as useCallback20, useEffect as useEffect28, useMemo as useMemo15, useRef as useRef18, useState as useState28 } from "react";
|
|
12169
12282
|
import clsx26 from "clsx";
|
|
12170
12283
|
import {
|
|
12171
12284
|
flexRender,
|
|
@@ -12178,18 +12291,18 @@ import {
|
|
|
12178
12291
|
|
|
12179
12292
|
// src/components/layout/table/TableCell.tsx
|
|
12180
12293
|
import { clsx as clsx22 } from "clsx";
|
|
12181
|
-
import { jsx as
|
|
12294
|
+
import { jsx as jsx51 } from "react/jsx-runtime";
|
|
12182
12295
|
var TableCell = ({
|
|
12183
12296
|
children,
|
|
12184
12297
|
className
|
|
12185
12298
|
}) => {
|
|
12186
|
-
return /* @__PURE__ */
|
|
12299
|
+
return /* @__PURE__ */ jsx51("span", { className: clsx22("block max-w-full overflow-ellipsis truncate", className), children });
|
|
12187
12300
|
};
|
|
12188
12301
|
|
|
12189
12302
|
// src/hooks/useResizeCallbackWrapper.ts
|
|
12190
|
-
import { useEffect as
|
|
12303
|
+
import { useEffect as useEffect23 } from "react";
|
|
12191
12304
|
var useResizeCallbackWrapper = (callback) => {
|
|
12192
|
-
|
|
12305
|
+
useEffect23(() => {
|
|
12193
12306
|
window.addEventListener("resize", callback);
|
|
12194
12307
|
return () => {
|
|
12195
12308
|
window.removeEventListener("resize", callback);
|
|
@@ -12202,10 +12315,10 @@ import { ChevronDown as ChevronDown3, ChevronsUpDown, ChevronUp as ChevronUp2 }
|
|
|
12202
12315
|
import clsx24 from "clsx";
|
|
12203
12316
|
|
|
12204
12317
|
// src/components/user-interaction/Tooltip.tsx
|
|
12205
|
-
import { useCallback as useCallback17, useMemo as useMemo14, useRef as
|
|
12318
|
+
import { useCallback as useCallback17, useMemo as useMemo14, useRef as useRef16, useState as useState24 } from "react";
|
|
12206
12319
|
import { clsx as clsx23 } from "clsx";
|
|
12207
12320
|
import { createPortal as createPortal6 } from "react-dom";
|
|
12208
|
-
import { jsx as
|
|
12321
|
+
import { jsx as jsx52, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
12209
12322
|
var Tooltip = ({
|
|
12210
12323
|
tooltip,
|
|
12211
12324
|
children,
|
|
@@ -12229,9 +12342,9 @@ var Tooltip = ({
|
|
|
12229
12342
|
() => disappearDelayOverwrite ?? config.tooltip.disappearDelay,
|
|
12230
12343
|
[config.tooltip.disappearDelay, disappearDelayOverwrite]
|
|
12231
12344
|
);
|
|
12232
|
-
const anchorRef =
|
|
12233
|
-
const containerRef =
|
|
12234
|
-
const triangleRef =
|
|
12345
|
+
const anchorRef = useRef16(null);
|
|
12346
|
+
const containerRef = useRef16(null);
|
|
12347
|
+
const triangleRef = useRef16(null);
|
|
12235
12348
|
const isActive = !disabled && state.isShown;
|
|
12236
12349
|
const { isVisible, transitionState, callbacks } = useTransitionState(
|
|
12237
12350
|
useMemo14(() => ({ isOpen: isActive }), [isActive])
|
|
@@ -12302,7 +12415,7 @@ var Tooltip = ({
|
|
|
12302
12415
|
};
|
|
12303
12416
|
});
|
|
12304
12417
|
}, [disappearDelay]);
|
|
12305
|
-
return /* @__PURE__ */
|
|
12418
|
+
return /* @__PURE__ */ jsxs29(
|
|
12306
12419
|
"div",
|
|
12307
12420
|
{
|
|
12308
12421
|
ref: anchorRef,
|
|
@@ -12311,9 +12424,9 @@ var Tooltip = ({
|
|
|
12311
12424
|
onPointerLeave: onLeave,
|
|
12312
12425
|
children: [
|
|
12313
12426
|
children,
|
|
12314
|
-
/* @__PURE__ */
|
|
12427
|
+
/* @__PURE__ */ jsxs29(Visibility, { isVisible: isActive || isVisible, children: [
|
|
12315
12428
|
createPortal6(
|
|
12316
|
-
/* @__PURE__ */
|
|
12429
|
+
/* @__PURE__ */ jsx52(
|
|
12317
12430
|
"div",
|
|
12318
12431
|
{
|
|
12319
12432
|
ref: containerRef,
|
|
@@ -12329,7 +12442,7 @@ var Tooltip = ({
|
|
|
12329
12442
|
document.body
|
|
12330
12443
|
),
|
|
12331
12444
|
createPortal6(
|
|
12332
|
-
/* @__PURE__ */
|
|
12445
|
+
/* @__PURE__ */ jsx52(
|
|
12333
12446
|
"div",
|
|
12334
12447
|
{
|
|
12335
12448
|
ref: triangleRef,
|
|
@@ -12348,7 +12461,7 @@ var Tooltip = ({
|
|
|
12348
12461
|
};
|
|
12349
12462
|
|
|
12350
12463
|
// src/components/layout/table/TableSortButton.tsx
|
|
12351
|
-
import { jsx as
|
|
12464
|
+
import { jsx as jsx53, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
12352
12465
|
var TableSortButton = ({
|
|
12353
12466
|
sortDirection,
|
|
12354
12467
|
invert = false,
|
|
@@ -12360,16 +12473,16 @@ var TableSortButton = ({
|
|
|
12360
12473
|
}) => {
|
|
12361
12474
|
const translation = useHightideTranslation();
|
|
12362
12475
|
const { sortingsCount, index } = sortingIndexDisplay;
|
|
12363
|
-
let icon = /* @__PURE__ */
|
|
12476
|
+
let icon = /* @__PURE__ */ jsx53(ChevronsUpDown, { className: "size-4" });
|
|
12364
12477
|
if (sortDirection) {
|
|
12365
12478
|
let usedSortDirection = sortDirection;
|
|
12366
12479
|
if (invert) {
|
|
12367
12480
|
usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
|
|
12368
12481
|
}
|
|
12369
|
-
icon = usedSortDirection === "asc" ? /* @__PURE__ */
|
|
12482
|
+
icon = usedSortDirection === "asc" ? /* @__PURE__ */ jsx53(ChevronUp2, { className: "size-4" }) : /* @__PURE__ */ jsx53(ChevronDown3, { className: "size-4" });
|
|
12370
12483
|
}
|
|
12371
12484
|
const hasSortingIndex = !!sortingIndexDisplay && sortingsCount > 1 && index > 0;
|
|
12372
|
-
return /* @__PURE__ */
|
|
12485
|
+
return /* @__PURE__ */ jsx53(Tooltip, { tooltip: translation("rSortingOrderAfter", { otherSortings: index - 1 }), disabled: !hasSortingIndex, children: /* @__PURE__ */ jsxs30(
|
|
12373
12486
|
Button,
|
|
12374
12487
|
{
|
|
12375
12488
|
layout: hasSortingIndex ? "default" : "icon",
|
|
@@ -12378,7 +12491,7 @@ var TableSortButton = ({
|
|
|
12378
12491
|
className: clsx24("relative", className),
|
|
12379
12492
|
...props,
|
|
12380
12493
|
children: [
|
|
12381
|
-
/* @__PURE__ */
|
|
12494
|
+
/* @__PURE__ */ jsx53(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ jsx53(
|
|
12382
12495
|
"div",
|
|
12383
12496
|
{
|
|
12384
12497
|
className: clsx24("absolute bottom-0 right-1/2 translate-x-1/2 translate-y-2/3 z-1 primary coloring-solid rounded-full h-4 w-5 text-sm"),
|
|
@@ -12395,7 +12508,7 @@ var TableSortButton = ({
|
|
|
12395
12508
|
import { FilterIcon } from "lucide-react";
|
|
12396
12509
|
|
|
12397
12510
|
// src/components/user-interaction/Menu.tsx
|
|
12398
|
-
import { useCallback as useCallback18, useEffect as
|
|
12511
|
+
import { useCallback as useCallback18, useEffect as useEffect26, useRef as useRef17, useState as useState26 } from "react";
|
|
12399
12512
|
import clsx25 from "clsx";
|
|
12400
12513
|
|
|
12401
12514
|
// src/utils/bagFunctions.ts
|
|
@@ -12467,7 +12580,7 @@ var usePopoverPosition = (trigger, options) => {
|
|
|
12467
12580
|
};
|
|
12468
12581
|
|
|
12469
12582
|
// src/hooks/useHoverState.ts
|
|
12470
|
-
import { useEffect as
|
|
12583
|
+
import { useEffect as useEffect24, useState as useState25 } from "react";
|
|
12471
12584
|
var defaultUseHoverStateProps = {
|
|
12472
12585
|
closingDelay: 200,
|
|
12473
12586
|
isDisabled: false
|
|
@@ -12491,14 +12604,14 @@ var useHoverState = (props = void 0) => {
|
|
|
12491
12604
|
setIsHovered(false);
|
|
12492
12605
|
}, closingDelay));
|
|
12493
12606
|
};
|
|
12494
|
-
|
|
12607
|
+
useEffect24(() => {
|
|
12495
12608
|
if (timer) {
|
|
12496
12609
|
return () => {
|
|
12497
12610
|
clearTimeout(timer);
|
|
12498
12611
|
};
|
|
12499
12612
|
}
|
|
12500
12613
|
});
|
|
12501
|
-
|
|
12614
|
+
useEffect24(() => {
|
|
12502
12615
|
if (timer) {
|
|
12503
12616
|
clearTimeout(timer);
|
|
12504
12617
|
}
|
|
@@ -12511,9 +12624,9 @@ var useHoverState = (props = void 0) => {
|
|
|
12511
12624
|
};
|
|
12512
12625
|
|
|
12513
12626
|
// src/hooks/useOutsideClick.ts
|
|
12514
|
-
import { useEffect as
|
|
12627
|
+
import { useEffect as useEffect25 } from "react";
|
|
12515
12628
|
var useOutsideClick = (refs, handler) => {
|
|
12516
|
-
|
|
12629
|
+
useEffect25(() => {
|
|
12517
12630
|
const listener = (event) => {
|
|
12518
12631
|
if (event.target === null) return;
|
|
12519
12632
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -12531,14 +12644,14 @@ var useOutsideClick = (refs, handler) => {
|
|
|
12531
12644
|
};
|
|
12532
12645
|
|
|
12533
12646
|
// src/components/user-interaction/Menu.tsx
|
|
12534
|
-
import { Fragment as Fragment7, jsx as
|
|
12647
|
+
import { Fragment as Fragment7, jsx as jsx54, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
12535
12648
|
var MenuItem = ({
|
|
12536
12649
|
children,
|
|
12537
12650
|
onClick,
|
|
12538
12651
|
alignment = "left",
|
|
12539
12652
|
isDisabled = false,
|
|
12540
12653
|
className
|
|
12541
|
-
}) => /* @__PURE__ */
|
|
12654
|
+
}) => /* @__PURE__ */ jsx54(
|
|
12542
12655
|
"div",
|
|
12543
12656
|
{
|
|
12544
12657
|
className: clsx25("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
|
|
@@ -12571,8 +12684,8 @@ var Menu = ({
|
|
|
12571
12684
|
menuClassName = ""
|
|
12572
12685
|
}) => {
|
|
12573
12686
|
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
12574
|
-
const triggerRef =
|
|
12575
|
-
const menuRef =
|
|
12687
|
+
const triggerRef = useRef17(null);
|
|
12688
|
+
const menuRef = useRef17(null);
|
|
12576
12689
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
12577
12690
|
const [isHidden, setIsHidden] = useState26(true);
|
|
12578
12691
|
const bag = {
|
|
@@ -12585,7 +12698,7 @@ var Menu = ({
|
|
|
12585
12698
|
triggerRef.current?.getBoundingClientRect(),
|
|
12586
12699
|
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
12587
12700
|
);
|
|
12588
|
-
|
|
12701
|
+
useEffect26(() => {
|
|
12589
12702
|
if (!isOpen) return;
|
|
12590
12703
|
const triggerEl = triggerRef.current;
|
|
12591
12704
|
if (!triggerEl) return;
|
|
@@ -12602,7 +12715,7 @@ var Menu = ({
|
|
|
12602
12715
|
window.removeEventListener("resize", close3);
|
|
12603
12716
|
};
|
|
12604
12717
|
}, [isOpen, setIsOpen]);
|
|
12605
|
-
|
|
12718
|
+
useEffect26(() => {
|
|
12606
12719
|
if (isOpen) {
|
|
12607
12720
|
setIsHidden(false);
|
|
12608
12721
|
}
|
|
@@ -12610,9 +12723,9 @@ var Menu = ({
|
|
|
12610
12723
|
const { zIndex } = useOverlayRegistry({
|
|
12611
12724
|
isActive: isOpen
|
|
12612
12725
|
});
|
|
12613
|
-
return /* @__PURE__ */
|
|
12726
|
+
return /* @__PURE__ */ jsxs31(Fragment7, { children: [
|
|
12614
12727
|
trigger(bag, useCallback18((el) => triggerRef.current = el, [])),
|
|
12615
|
-
createPortal7(/* @__PURE__ */
|
|
12728
|
+
createPortal7(/* @__PURE__ */ jsx54(
|
|
12616
12729
|
"div",
|
|
12617
12730
|
{
|
|
12618
12731
|
ref: menuRef,
|
|
@@ -12642,8 +12755,8 @@ var Menu = ({
|
|
|
12642
12755
|
};
|
|
12643
12756
|
|
|
12644
12757
|
// src/components/layout/table/TableFilterButton.tsx
|
|
12645
|
-
import { useEffect as
|
|
12646
|
-
import { Fragment as Fragment8, jsx as
|
|
12758
|
+
import { useEffect as useEffect27, useState as useState27 } from "react";
|
|
12759
|
+
import { Fragment as Fragment8, jsx as jsx55, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
12647
12760
|
var TableFilterButton = ({
|
|
12648
12761
|
filterType,
|
|
12649
12762
|
column
|
|
@@ -12652,24 +12765,24 @@ var TableFilterButton = ({
|
|
|
12652
12765
|
const columnFilterValue = column.getFilterValue();
|
|
12653
12766
|
const [filterValue, setFilterValue] = useState27(columnFilterValue);
|
|
12654
12767
|
const hasFilter = !!filterValue;
|
|
12655
|
-
|
|
12768
|
+
useEffect27(() => {
|
|
12656
12769
|
setFilterValue(columnFilterValue);
|
|
12657
12770
|
}, [columnFilterValue]);
|
|
12658
|
-
return /* @__PURE__ */
|
|
12771
|
+
return /* @__PURE__ */ jsx55(
|
|
12659
12772
|
Menu,
|
|
12660
12773
|
{
|
|
12661
|
-
trigger: ({ toggleOpen }, ref) => /* @__PURE__ */
|
|
12662
|
-
/* @__PURE__ */
|
|
12774
|
+
trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ jsxs32("div", { ref, className: "relative", children: [
|
|
12775
|
+
/* @__PURE__ */ jsx55(
|
|
12663
12776
|
Button,
|
|
12664
12777
|
{
|
|
12665
12778
|
layout: "icon",
|
|
12666
12779
|
color: "neutral",
|
|
12667
12780
|
size: "xs",
|
|
12668
12781
|
onClick: toggleOpen,
|
|
12669
|
-
children: /* @__PURE__ */
|
|
12782
|
+
children: /* @__PURE__ */ jsx55(FilterIcon, { className: "size-4" })
|
|
12670
12783
|
}
|
|
12671
12784
|
),
|
|
12672
|
-
hasFilter && /* @__PURE__ */
|
|
12785
|
+
hasFilter && /* @__PURE__ */ jsx55(
|
|
12673
12786
|
"div",
|
|
12674
12787
|
{
|
|
12675
12788
|
className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-primary pointer-events-none",
|
|
@@ -12677,9 +12790,9 @@ var TableFilterButton = ({
|
|
|
12677
12790
|
}
|
|
12678
12791
|
)
|
|
12679
12792
|
] }),
|
|
12680
|
-
children: ({ close: close3 }) => /* @__PURE__ */
|
|
12681
|
-
/* @__PURE__ */
|
|
12682
|
-
filterType === "text" && /* @__PURE__ */
|
|
12793
|
+
children: ({ close: close3 }) => /* @__PURE__ */ jsxs32("div", { className: "flex-col-1 p-2 items-start font-normal text-menu-text", children: [
|
|
12794
|
+
/* @__PURE__ */ jsx55("h4", { className: "typography-label-md-semibold", children: translation("filter") }),
|
|
12795
|
+
filterType === "text" && /* @__PURE__ */ jsx55(
|
|
12683
12796
|
Input,
|
|
12684
12797
|
{
|
|
12685
12798
|
value: filterValue ?? "",
|
|
@@ -12689,8 +12802,8 @@ var TableFilterButton = ({
|
|
|
12689
12802
|
className: "h-10"
|
|
12690
12803
|
}
|
|
12691
12804
|
),
|
|
12692
|
-
filterType === "range" && /* @__PURE__ */
|
|
12693
|
-
/* @__PURE__ */
|
|
12805
|
+
filterType === "range" && /* @__PURE__ */ jsxs32("div", { className: "flex-row-2 items-center", children: [
|
|
12806
|
+
/* @__PURE__ */ jsx55(
|
|
12694
12807
|
Input,
|
|
12695
12808
|
{
|
|
12696
12809
|
value: filterValue?.[0].toString() ?? "",
|
|
@@ -12703,8 +12816,8 @@ var TableFilterButton = ({
|
|
|
12703
12816
|
className: "h-10 input-indicator-hidden w-40"
|
|
12704
12817
|
}
|
|
12705
12818
|
),
|
|
12706
|
-
/* @__PURE__ */
|
|
12707
|
-
/* @__PURE__ */
|
|
12819
|
+
/* @__PURE__ */ jsx55("span", { className: "font-bold", children: "-" }),
|
|
12820
|
+
/* @__PURE__ */ jsx55(
|
|
12708
12821
|
Input,
|
|
12709
12822
|
{
|
|
12710
12823
|
value: filterValue?.[1].toString() ?? "",
|
|
@@ -12718,8 +12831,8 @@ var TableFilterButton = ({
|
|
|
12718
12831
|
}
|
|
12719
12832
|
)
|
|
12720
12833
|
] }),
|
|
12721
|
-
filterType === "dateRange" && /* @__PURE__ */
|
|
12722
|
-
/* @__PURE__ */
|
|
12834
|
+
filterType === "dateRange" && /* @__PURE__ */ jsxs32(Fragment8, { children: [
|
|
12835
|
+
/* @__PURE__ */ jsx55(
|
|
12723
12836
|
Input,
|
|
12724
12837
|
{
|
|
12725
12838
|
value: filterValue?.[0] ? filterValue?.[0].toISOString().slice(0, 16) : "",
|
|
@@ -12732,7 +12845,7 @@ var TableFilterButton = ({
|
|
|
12732
12845
|
className: "h-10 w-50"
|
|
12733
12846
|
}
|
|
12734
12847
|
),
|
|
12735
|
-
/* @__PURE__ */
|
|
12848
|
+
/* @__PURE__ */ jsx55(
|
|
12736
12849
|
Input,
|
|
12737
12850
|
{
|
|
12738
12851
|
value: filterValue?.[1] ? filterValue?.[1].toISOString().slice(0, 16) : "",
|
|
@@ -12746,12 +12859,12 @@ var TableFilterButton = ({
|
|
|
12746
12859
|
}
|
|
12747
12860
|
)
|
|
12748
12861
|
] }),
|
|
12749
|
-
/* @__PURE__ */
|
|
12750
|
-
hasFilter && /* @__PURE__ */
|
|
12862
|
+
/* @__PURE__ */ jsxs32("div", { className: "flex-row-2 justify-end w-full", children: [
|
|
12863
|
+
hasFilter && /* @__PURE__ */ jsx55(Button, { color: "negative", size: "sm", onClick: () => {
|
|
12751
12864
|
column.setFilterValue(void 0);
|
|
12752
12865
|
close3();
|
|
12753
12866
|
}, children: translation("remove") }),
|
|
12754
|
-
/* @__PURE__ */
|
|
12867
|
+
/* @__PURE__ */ jsx55(Button, { size: "sm", onClick: () => {
|
|
12755
12868
|
column.setFilterValue(filterValue);
|
|
12756
12869
|
close3();
|
|
12757
12870
|
}, children: translation("apply") })
|
|
@@ -12764,7 +12877,7 @@ var TableFilterButton = ({
|
|
|
12764
12877
|
// src/components/user-interaction/Checkbox.tsx
|
|
12765
12878
|
import { Check as Check2, Minus as Minus2 } from "lucide-react";
|
|
12766
12879
|
import { useCallback as useCallback19 } from "react";
|
|
12767
|
-
import { jsx as
|
|
12880
|
+
import { jsx as jsx56, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
12768
12881
|
var Checkbox = ({
|
|
12769
12882
|
value = false,
|
|
12770
12883
|
indeterminate = false,
|
|
@@ -12782,7 +12895,7 @@ var Checkbox = ({
|
|
|
12782
12895
|
onValueChange?.(!value);
|
|
12783
12896
|
onEditComplete?.(!value);
|
|
12784
12897
|
}, [onEditComplete, onValueChange, value]);
|
|
12785
|
-
return /* @__PURE__ */
|
|
12898
|
+
return /* @__PURE__ */ jsxs33(
|
|
12786
12899
|
"div",
|
|
12787
12900
|
{
|
|
12788
12901
|
...props,
|
|
@@ -12809,8 +12922,8 @@ var Checkbox = ({
|
|
|
12809
12922
|
"aria-checked": indeterminate ? "mixed" : value,
|
|
12810
12923
|
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
12811
12924
|
children: [
|
|
12812
|
-
/* @__PURE__ */
|
|
12813
|
-
/* @__PURE__ */
|
|
12925
|
+
/* @__PURE__ */ jsx56(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ jsx56(Minus2, { "data-name": "checkbox-indicator", "aria-hidden": true }) }),
|
|
12926
|
+
/* @__PURE__ */ jsx56(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ jsx56(Check2, { "data-name": "checkbox-indicator", "aria-hidden": true }) })
|
|
12814
12927
|
]
|
|
12815
12928
|
}
|
|
12816
12929
|
);
|
|
@@ -12821,7 +12934,7 @@ var CheckboxUncontrolled = ({
|
|
|
12821
12934
|
...props
|
|
12822
12935
|
}) => {
|
|
12823
12936
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
12824
|
-
return /* @__PURE__ */
|
|
12937
|
+
return /* @__PURE__ */ jsx56(
|
|
12825
12938
|
Checkbox,
|
|
12826
12939
|
{
|
|
12827
12940
|
...props,
|
|
@@ -12832,7 +12945,7 @@ var CheckboxUncontrolled = ({
|
|
|
12832
12945
|
};
|
|
12833
12946
|
|
|
12834
12947
|
// src/components/layout/table/Table.tsx
|
|
12835
|
-
import { jsx as
|
|
12948
|
+
import { jsx as jsx57, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
12836
12949
|
var Table = ({
|
|
12837
12950
|
data,
|
|
12838
12951
|
fillerRow,
|
|
@@ -12846,8 +12959,8 @@ var Table = ({
|
|
|
12846
12959
|
columns,
|
|
12847
12960
|
...tableOptions
|
|
12848
12961
|
}) => {
|
|
12849
|
-
const ref =
|
|
12850
|
-
const tableRef =
|
|
12962
|
+
const ref = useRef18(null);
|
|
12963
|
+
const tableRef = useRef18(null);
|
|
12851
12964
|
const [columnSizing, setColumnSizing] = useState28(columns.reduce((previousValue, currentValue) => {
|
|
12852
12965
|
return {
|
|
12853
12966
|
...previousValue,
|
|
@@ -12952,7 +13065,7 @@ var Table = ({
|
|
|
12952
13065
|
minSize: 60,
|
|
12953
13066
|
maxSize: 700,
|
|
12954
13067
|
cell: ({ cell }) => {
|
|
12955
|
-
return /* @__PURE__ */
|
|
13068
|
+
return /* @__PURE__ */ jsx57(TableCell, { children: cell.getValue() });
|
|
12956
13069
|
},
|
|
12957
13070
|
...defaultColumn
|
|
12958
13071
|
},
|
|
@@ -13001,7 +13114,7 @@ var Table = ({
|
|
|
13001
13114
|
...tableOptions
|
|
13002
13115
|
});
|
|
13003
13116
|
const [hasInitializedSizing, setHasInitializedSizing] = useState28(false);
|
|
13004
|
-
|
|
13117
|
+
useEffect28(() => {
|
|
13005
13118
|
if (!hasInitializedSizing && ref.current) {
|
|
13006
13119
|
setHasInitializedSizing(true);
|
|
13007
13120
|
table.setColumnSizing(updateColumnSizes(columnSizing));
|
|
@@ -13011,7 +13124,7 @@ var Table = ({
|
|
|
13011
13124
|
table.setColumnSizing(updateColumnSizes);
|
|
13012
13125
|
}, [updateColumnSizes]));
|
|
13013
13126
|
const pageCount = table.getPageCount();
|
|
13014
|
-
|
|
13127
|
+
useEffect28(() => {
|
|
13015
13128
|
const totalPages = pageCount;
|
|
13016
13129
|
if (totalPages === 0) {
|
|
13017
13130
|
if (pagination.pageIndex !== 0) {
|
|
@@ -13037,8 +13150,8 @@ var Table = ({
|
|
|
13037
13150
|
}
|
|
13038
13151
|
return colSizes;
|
|
13039
13152
|
}, [table.getState().columnSizingInfo, table.getState().columnSizing]);
|
|
13040
|
-
return /* @__PURE__ */
|
|
13041
|
-
/* @__PURE__ */
|
|
13153
|
+
return /* @__PURE__ */ jsxs34("div", { ref, "data-name": PropsUtil.dataAttributes.name("table-container"), className, children: [
|
|
13154
|
+
/* @__PURE__ */ jsx57("div", { "data-name": PropsUtil.dataAttributes.name("table-scroll-wrapper"), className: tableContainerClassName, children: /* @__PURE__ */ jsxs34(
|
|
13042
13155
|
"table",
|
|
13043
13156
|
{
|
|
13044
13157
|
ref: tableRef,
|
|
@@ -13049,7 +13162,7 @@ var Table = ({
|
|
|
13049
13162
|
},
|
|
13050
13163
|
className: tableClassName,
|
|
13051
13164
|
children: [
|
|
13052
|
-
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */
|
|
13165
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx57("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ jsx57(
|
|
13053
13166
|
"col",
|
|
13054
13167
|
{
|
|
13055
13168
|
style: {
|
|
@@ -13060,16 +13173,16 @@ var Table = ({
|
|
|
13060
13173
|
},
|
|
13061
13174
|
header.id
|
|
13062
13175
|
)) }, headerGroup.id)),
|
|
13063
|
-
/* @__PURE__ */
|
|
13064
|
-
return /* @__PURE__ */
|
|
13176
|
+
/* @__PURE__ */ jsx57("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ jsx57("tr", { "data-name": PropsUtil.dataAttributes.name("table-header-row"), className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
|
|
13177
|
+
return /* @__PURE__ */ jsxs34(
|
|
13065
13178
|
"th",
|
|
13066
13179
|
{
|
|
13067
13180
|
colSpan: header.colSpan,
|
|
13068
13181
|
"data-name": PropsUtil.dataAttributes.name("table-header-cell"),
|
|
13069
13182
|
className: clsx26("group/table-header-cell", header.column.columnDef.meta?.className),
|
|
13070
13183
|
children: [
|
|
13071
|
-
/* @__PURE__ */
|
|
13072
|
-
/* @__PURE__ */
|
|
13184
|
+
/* @__PURE__ */ jsx57(Visibility, { isVisible: !header.isPlaceholder, children: /* @__PURE__ */ jsxs34("div", { className: "flex-row-1 items-center", children: [
|
|
13185
|
+
/* @__PURE__ */ jsx57(Visibility, { isVisible: header.column.getCanSort(), children: /* @__PURE__ */ jsx57(
|
|
13073
13186
|
TableSortButton,
|
|
13074
13187
|
{
|
|
13075
13188
|
sortDirection: header.column.getIsSorted(),
|
|
@@ -13095,7 +13208,7 @@ var Table = ({
|
|
|
13095
13208
|
}
|
|
13096
13209
|
}
|
|
13097
13210
|
) }),
|
|
13098
|
-
/* @__PURE__ */
|
|
13211
|
+
/* @__PURE__ */ jsx57(Visibility, { isVisible: header.column.getCanFilter() && !!header.column.columnDef.meta?.filterType, children: /* @__PURE__ */ jsx57(
|
|
13099
13212
|
TableFilterButton,
|
|
13100
13213
|
{
|
|
13101
13214
|
column: header.column,
|
|
@@ -13107,7 +13220,7 @@ var Table = ({
|
|
|
13107
13220
|
header.getContext()
|
|
13108
13221
|
)
|
|
13109
13222
|
] }) }),
|
|
13110
|
-
/* @__PURE__ */
|
|
13223
|
+
/* @__PURE__ */ jsx57(Visibility, { isVisible: header.column.getCanResize(), children: /* @__PURE__ */ jsx57(
|
|
13111
13224
|
"div",
|
|
13112
13225
|
{
|
|
13113
13226
|
onPointerDown: header.getResizeHandler(),
|
|
@@ -13128,16 +13241,16 @@ var Table = ({
|
|
|
13128
13241
|
header.id
|
|
13129
13242
|
);
|
|
13130
13243
|
}) }, headerGroup.id)) }),
|
|
13131
|
-
/* @__PURE__ */
|
|
13244
|
+
/* @__PURE__ */ jsxs34("tbody", { children: [
|
|
13132
13245
|
table.getRowModel().rows.map((row) => {
|
|
13133
|
-
return /* @__PURE__ */
|
|
13246
|
+
return /* @__PURE__ */ jsx57(
|
|
13134
13247
|
"tr",
|
|
13135
13248
|
{
|
|
13136
13249
|
onClick: () => onRowClick?.(row, table),
|
|
13137
13250
|
"data-name": "table-body-row",
|
|
13138
13251
|
className: BagFunctionUtil.resolve(table.options.meta?.bodyRowClassName, row.original),
|
|
13139
13252
|
children: row.getVisibleCells().map((cell) => {
|
|
13140
|
-
return /* @__PURE__ */
|
|
13253
|
+
return /* @__PURE__ */ jsx57("td", { "data-name": "table-body-cell", children: flexRender(
|
|
13141
13254
|
cell.column.columnDef.cell,
|
|
13142
13255
|
cell.getContext()
|
|
13143
13256
|
) }, cell.id);
|
|
@@ -13147,15 +13260,15 @@ var Table = ({
|
|
|
13147
13260
|
);
|
|
13148
13261
|
}),
|
|
13149
13262
|
range(table.getState().pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
|
|
13150
|
-
return /* @__PURE__ */
|
|
13151
|
-
return /* @__PURE__ */
|
|
13263
|
+
return /* @__PURE__ */ jsx57("tr", { children: columns.map((column) => {
|
|
13264
|
+
return /* @__PURE__ */ jsx57("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ jsx57(FillerCell, {}) }, column.id);
|
|
13152
13265
|
}) }, "filler-row-" + index);
|
|
13153
13266
|
})
|
|
13154
13267
|
] })
|
|
13155
13268
|
]
|
|
13156
13269
|
}
|
|
13157
13270
|
) }),
|
|
13158
|
-
/* @__PURE__ */
|
|
13271
|
+
/* @__PURE__ */ jsx57("div", { className: "flex-row-2 justify-center", children: /* @__PURE__ */ jsx57(
|
|
13159
13272
|
Pagination,
|
|
13160
13273
|
{
|
|
13161
13274
|
pageIndex: table.getState().pagination.pageIndex,
|
|
@@ -13167,7 +13280,7 @@ var Table = ({
|
|
|
13167
13280
|
};
|
|
13168
13281
|
var TableUncontrolled = ({ data, ...props }) => {
|
|
13169
13282
|
const [usedDate] = useOverwritableState(data);
|
|
13170
|
-
return /* @__PURE__ */
|
|
13283
|
+
return /* @__PURE__ */ jsx57(
|
|
13171
13284
|
Table,
|
|
13172
13285
|
{
|
|
13173
13286
|
...props,
|
|
@@ -13191,7 +13304,7 @@ var TableWithSelection = ({
|
|
|
13191
13304
|
{
|
|
13192
13305
|
id: selectionRowId,
|
|
13193
13306
|
header: ({ table }) => {
|
|
13194
|
-
return /* @__PURE__ */
|
|
13307
|
+
return /* @__PURE__ */ jsx57(
|
|
13195
13308
|
Checkbox,
|
|
13196
13309
|
{
|
|
13197
13310
|
value: table.getIsAllRowsSelected(),
|
|
@@ -13204,7 +13317,7 @@ var TableWithSelection = ({
|
|
|
13204
13317
|
);
|
|
13205
13318
|
},
|
|
13206
13319
|
cell: ({ row }) => {
|
|
13207
|
-
return /* @__PURE__ */
|
|
13320
|
+
return /* @__PURE__ */ jsx57(
|
|
13208
13321
|
Checkbox,
|
|
13209
13322
|
{
|
|
13210
13323
|
disabled: !row.getCanSelect(),
|
|
@@ -13222,15 +13335,15 @@ var TableWithSelection = ({
|
|
|
13222
13335
|
...columns
|
|
13223
13336
|
];
|
|
13224
13337
|
}, [columns, selectionRowId]);
|
|
13225
|
-
return /* @__PURE__ */
|
|
13338
|
+
return /* @__PURE__ */ jsx57(
|
|
13226
13339
|
Table,
|
|
13227
13340
|
{
|
|
13228
13341
|
columns: columnsWithSelection,
|
|
13229
13342
|
fillerRow: (columnId, table) => {
|
|
13230
13343
|
if (columnId === selectionRowId) {
|
|
13231
|
-
return /* @__PURE__ */
|
|
13344
|
+
return /* @__PURE__ */ jsx57(Checkbox, { value: false, disabled: true, className: "max-w-6" });
|
|
13232
13345
|
}
|
|
13233
|
-
return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */
|
|
13346
|
+
return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ jsx57(FillerCell, {});
|
|
13234
13347
|
},
|
|
13235
13348
|
state: {
|
|
13236
13349
|
rowSelection,
|
|
@@ -13265,7 +13378,7 @@ var writeToClipboard = (text) => {
|
|
|
13265
13378
|
|
|
13266
13379
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
13267
13380
|
import { CheckIcon as CheckIcon2, Copy } from "lucide-react";
|
|
13268
|
-
import { jsx as
|
|
13381
|
+
import { jsx as jsx58, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
13269
13382
|
var CopyToClipboardWrapper = ({
|
|
13270
13383
|
children,
|
|
13271
13384
|
textToCopy,
|
|
@@ -13296,7 +13409,7 @@ var CopyToClipboardWrapper = ({
|
|
|
13296
13409
|
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
13297
13410
|
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
13298
13411
|
};
|
|
13299
|
-
return /* @__PURE__ */
|
|
13412
|
+
return /* @__PURE__ */ jsxs35(
|
|
13300
13413
|
"div",
|
|
13301
13414
|
{
|
|
13302
13415
|
className: clsx27("relative inline-block cursor-copy", containerClassName),
|
|
@@ -13314,7 +13427,7 @@ var CopyToClipboardWrapper = ({
|
|
|
13314
13427
|
},
|
|
13315
13428
|
children: [
|
|
13316
13429
|
children,
|
|
13317
|
-
/* @__PURE__ */
|
|
13430
|
+
/* @__PURE__ */ jsxs35(
|
|
13318
13431
|
"div",
|
|
13319
13432
|
{
|
|
13320
13433
|
className: clsx27(
|
|
@@ -13329,15 +13442,15 @@ var CopyToClipboardWrapper = ({
|
|
|
13329
13442
|
opacity: isShowingIndication || isShowingConfirmation ? 1 : 0
|
|
13330
13443
|
},
|
|
13331
13444
|
children: [
|
|
13332
|
-
isShowingConfirmation && /* @__PURE__ */
|
|
13333
|
-
/* @__PURE__ */
|
|
13445
|
+
isShowingConfirmation && /* @__PURE__ */ jsxs35("div", { className: "flex-row-1", children: [
|
|
13446
|
+
/* @__PURE__ */ jsx58(CheckIcon2, { size: 16, className: "text-positive" }),
|
|
13334
13447
|
translation("copied")
|
|
13335
13448
|
] }),
|
|
13336
|
-
isShowingIndication && /* @__PURE__ */
|
|
13337
|
-
/* @__PURE__ */
|
|
13449
|
+
isShowingIndication && /* @__PURE__ */ jsxs35("div", { className: "flex-row-1 text-description", children: [
|
|
13450
|
+
/* @__PURE__ */ jsx58(Copy, { size: 16 }),
|
|
13338
13451
|
translation("clickToCopy")
|
|
13339
13452
|
] }),
|
|
13340
|
-
/* @__PURE__ */
|
|
13453
|
+
/* @__PURE__ */ jsx58(
|
|
13341
13454
|
"div",
|
|
13342
13455
|
{
|
|
13343
13456
|
className: clsx27(`absolute w-0 h-0`, triangleClasses[position]),
|
|
@@ -13353,9 +13466,9 @@ var CopyToClipboardWrapper = ({
|
|
|
13353
13466
|
};
|
|
13354
13467
|
|
|
13355
13468
|
// src/components/user-interaction/ScrollPicker.tsx
|
|
13356
|
-
import { useCallback as useCallback21, useEffect as
|
|
13469
|
+
import { useCallback as useCallback21, useEffect as useEffect29, useState as useState30 } from "react";
|
|
13357
13470
|
import clsx28 from "clsx";
|
|
13358
|
-
import { jsx as
|
|
13471
|
+
import { jsx as jsx59, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
13359
13472
|
var up = 1;
|
|
13360
13473
|
var down = -1;
|
|
13361
13474
|
var ScrollPicker = ({
|
|
@@ -13473,7 +13586,7 @@ var ScrollPicker = ({
|
|
|
13473
13586
|
};
|
|
13474
13587
|
});
|
|
13475
13588
|
}, [disabled, getDirection, onChange]);
|
|
13476
|
-
|
|
13589
|
+
useEffect29(() => {
|
|
13477
13590
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
13478
13591
|
});
|
|
13479
13592
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -13494,7 +13607,7 @@ var ScrollPicker = ({
|
|
|
13494
13607
|
}
|
|
13495
13608
|
return clamp(1 - opacityValue / max);
|
|
13496
13609
|
};
|
|
13497
|
-
return /* @__PURE__ */
|
|
13610
|
+
return /* @__PURE__ */ jsx59(
|
|
13498
13611
|
"div",
|
|
13499
13612
|
{
|
|
13500
13613
|
className: "relative overflow-hidden",
|
|
@@ -13505,15 +13618,15 @@ var ScrollPicker = ({
|
|
|
13505
13618
|
setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + deltaY }));
|
|
13506
13619
|
}
|
|
13507
13620
|
},
|
|
13508
|
-
children: /* @__PURE__ */
|
|
13509
|
-
/* @__PURE__ */
|
|
13621
|
+
children: /* @__PURE__ */ jsxs36("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
|
|
13622
|
+
/* @__PURE__ */ jsx59(
|
|
13510
13623
|
"div",
|
|
13511
13624
|
{
|
|
13512
13625
|
className: "absolute z-[1] top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-full min-w-[40px] border border-divider/50 border-y-2 border-x-0 ",
|
|
13513
13626
|
style: { height: `${itemHeight}px` }
|
|
13514
13627
|
}
|
|
13515
13628
|
),
|
|
13516
|
-
/* @__PURE__ */
|
|
13629
|
+
/* @__PURE__ */ jsx59(
|
|
13517
13630
|
"div",
|
|
13518
13631
|
{
|
|
13519
13632
|
className: "flex-col-2 select-none",
|
|
@@ -13521,7 +13634,7 @@ var ScrollPicker = ({
|
|
|
13521
13634
|
transform: `translateY(${-transition * (distance + itemHeight)}px)`,
|
|
13522
13635
|
columnGap: `${distance}px`
|
|
13523
13636
|
},
|
|
13524
|
-
children: shownItems.map(({ name: name2, index }, arrayIndex) => /* @__PURE__ */
|
|
13637
|
+
children: shownItems.map(({ name: name2, index }, arrayIndex) => /* @__PURE__ */ jsx59(
|
|
13525
13638
|
"div",
|
|
13526
13639
|
{
|
|
13527
13640
|
className: clsx28(
|
|
@@ -13551,10 +13664,10 @@ var ScrollPicker = ({
|
|
|
13551
13664
|
};
|
|
13552
13665
|
|
|
13553
13666
|
// src/components/user-interaction/Textarea.tsx
|
|
13554
|
-
import { forwardRef as
|
|
13667
|
+
import { forwardRef as forwardRef12, useId as useId11 } from "react";
|
|
13555
13668
|
import clsx29 from "clsx";
|
|
13556
|
-
import { jsx as
|
|
13557
|
-
var Textarea =
|
|
13669
|
+
import { jsx as jsx60, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
13670
|
+
var Textarea = forwardRef12(function Textarea2({
|
|
13558
13671
|
invalid = false,
|
|
13559
13672
|
onValueChange,
|
|
13560
13673
|
onEditComplete,
|
|
@@ -13566,7 +13679,7 @@ var Textarea = forwardRef9(function Textarea2({
|
|
|
13566
13679
|
onEditComplete?.(text);
|
|
13567
13680
|
clearTimer();
|
|
13568
13681
|
};
|
|
13569
|
-
return /* @__PURE__ */
|
|
13682
|
+
return /* @__PURE__ */ jsx60(
|
|
13570
13683
|
"textarea",
|
|
13571
13684
|
{
|
|
13572
13685
|
...props,
|
|
@@ -13596,7 +13709,7 @@ var TextareaUncontrolled = ({
|
|
|
13596
13709
|
...props
|
|
13597
13710
|
}) => {
|
|
13598
13711
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
13599
|
-
return /* @__PURE__ */
|
|
13712
|
+
return /* @__PURE__ */ jsx60(
|
|
13600
13713
|
Textarea,
|
|
13601
13714
|
{
|
|
13602
13715
|
...props,
|
|
@@ -13616,7 +13729,7 @@ var TextareaWithHeadline = ({
|
|
|
13616
13729
|
}) => {
|
|
13617
13730
|
const genId = useId11();
|
|
13618
13731
|
const usedId = id ?? genId;
|
|
13619
|
-
return /* @__PURE__ */
|
|
13732
|
+
return /* @__PURE__ */ jsxs37(
|
|
13620
13733
|
"div",
|
|
13621
13734
|
{
|
|
13622
13735
|
className: clsx29(
|
|
@@ -13628,8 +13741,8 @@ var TextareaWithHeadline = ({
|
|
|
13628
13741
|
containerClassName
|
|
13629
13742
|
),
|
|
13630
13743
|
children: [
|
|
13631
|
-
headline && /* @__PURE__ */
|
|
13632
|
-
/* @__PURE__ */
|
|
13744
|
+
headline && /* @__PURE__ */ jsx60("label", { ...headlineProps, htmlFor: usedId, className: clsx29("typography-lable-md text-label", headlineProps.className), children: headline }),
|
|
13745
|
+
/* @__PURE__ */ jsx60(
|
|
13633
13746
|
Textarea,
|
|
13634
13747
|
{
|
|
13635
13748
|
...props,
|
|
@@ -13824,7 +13937,7 @@ import clsx31 from "clsx";
|
|
|
13824
13937
|
|
|
13825
13938
|
// src/components/user-interaction/date/DayPicker.tsx
|
|
13826
13939
|
import { useMemo as useMemo16 } from "react";
|
|
13827
|
-
import { jsx as
|
|
13940
|
+
import { jsx as jsx61, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
13828
13941
|
var DayPicker = ({
|
|
13829
13942
|
displayedMonth,
|
|
13830
13943
|
value,
|
|
@@ -13847,14 +13960,14 @@ var DayPicker = ({
|
|
|
13847
13960
|
if (!providedStart) return;
|
|
13848
13961
|
return new Date(providedStart.getFullYear(), providedStart.getMonth(), providedStart.getDate());
|
|
13849
13962
|
}, [providedStart]);
|
|
13850
|
-
return /* @__PURE__ */
|
|
13851
|
-
/* @__PURE__ */
|
|
13852
|
-
weeks.map((week, index) => /* @__PURE__ */
|
|
13963
|
+
return /* @__PURE__ */ jsxs38("div", { className, "data-name": "day-picker-container", children: [
|
|
13964
|
+
/* @__PURE__ */ jsx61("div", { "data-name": "day-picker-header-row", children: weeks[0].map((weekDay, index) => /* @__PURE__ */ jsx61("div", { "data-name": "day-picker-header-item", children: new Intl.DateTimeFormat(locale, { weekday: "long" }).format(weekDay).substring(0, 2) }, index)) }),
|
|
13965
|
+
weeks.map((week, index) => /* @__PURE__ */ jsx61("div", { "data-name": "day-picker-body-row", children: week.map((date) => {
|
|
13853
13966
|
const isSelected = !!value && DateUtils.equalDate(value, date);
|
|
13854
13967
|
const isToday = DateUtils.equalDate(/* @__PURE__ */ new Date(), date);
|
|
13855
13968
|
const isSameMonth = date.getMonth() === month;
|
|
13856
13969
|
const isDayValid = isInTimeSpan(date, start, end);
|
|
13857
|
-
return /* @__PURE__ */
|
|
13970
|
+
return /* @__PURE__ */ jsx61(
|
|
13858
13971
|
"button",
|
|
13859
13972
|
{
|
|
13860
13973
|
disabled: !isDayValid,
|
|
@@ -13888,7 +14001,7 @@ var DayPickerUncontrolled = ({
|
|
|
13888
14001
|
...props
|
|
13889
14002
|
}) => {
|
|
13890
14003
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
13891
|
-
return /* @__PURE__ */
|
|
14004
|
+
return /* @__PURE__ */ jsx61(
|
|
13892
14005
|
DayPicker,
|
|
13893
14006
|
{
|
|
13894
14007
|
value,
|
|
@@ -13899,9 +14012,9 @@ var DayPickerUncontrolled = ({
|
|
|
13899
14012
|
};
|
|
13900
14013
|
|
|
13901
14014
|
// src/components/user-interaction/date/YearMonthPicker.tsx
|
|
13902
|
-
import { memo, useCallback as useCallback22, useEffect as
|
|
14015
|
+
import { memo, useCallback as useCallback22, useEffect as useEffect30, useLayoutEffect as useLayoutEffect3, useMemo as useMemo17, useRef as useRef19, useState as useState31 } from "react";
|
|
13903
14016
|
import clsx30 from "clsx";
|
|
13904
|
-
import { jsx as
|
|
14017
|
+
import { jsx as jsx62, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
13905
14018
|
var YearRow = memo(function YearRow2({
|
|
13906
14019
|
year,
|
|
13907
14020
|
selectedMonthIndex,
|
|
@@ -13910,31 +14023,31 @@ var YearRow = memo(function YearRow2({
|
|
|
13910
14023
|
monthNames,
|
|
13911
14024
|
onSelect
|
|
13912
14025
|
}) {
|
|
13913
|
-
const ref =
|
|
14026
|
+
const ref = useRef19(null);
|
|
13914
14027
|
const isSelectedYear = selectedMonthIndex !== void 0;
|
|
13915
14028
|
const [isExpanded, setIsExpanded] = useState31(false);
|
|
13916
|
-
|
|
14029
|
+
useEffect30(() => {
|
|
13917
14030
|
if (isSelectedYear) {
|
|
13918
14031
|
ref.current?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
13919
14032
|
}
|
|
13920
14033
|
}, [isSelectedYear]);
|
|
13921
14034
|
const monthGrid = useMemo17(() => equalSizeGroups([...DateUtils.monthsList], 3), []);
|
|
13922
|
-
return /* @__PURE__ */
|
|
14035
|
+
return /* @__PURE__ */ jsxs39(
|
|
13923
14036
|
ExpandableRoot,
|
|
13924
14037
|
{
|
|
13925
14038
|
ref: isSelectedYear ? ref : void 0,
|
|
13926
14039
|
isExpanded,
|
|
13927
14040
|
onExpandedChange: setIsExpanded,
|
|
13928
14041
|
children: [
|
|
13929
|
-
/* @__PURE__ */
|
|
13930
|
-
/* @__PURE__ */
|
|
14042
|
+
/* @__PURE__ */ jsx62(ExpandableHeader, { className: clsx30("px-2", { "text-primary font-bold": isSelectedYear }), children: year }),
|
|
14043
|
+
/* @__PURE__ */ jsx62(ExpandableContent, { className: "gap-y-1 px-2 expadable-content-h-39", children: isExpanded && monthGrid.map((group, groupIdx) => /* @__PURE__ */ jsx62("div", { className: "flex-row-1", children: group.map((month) => {
|
|
13931
14044
|
const monthIndex = DateUtils.monthsList.indexOf(month);
|
|
13932
14045
|
const currentTimestamp = new Date(year, monthIndex).getTime();
|
|
13933
14046
|
const isAfterStart = minTimestamp === void 0 || currentTimestamp >= minTimestamp;
|
|
13934
14047
|
const isBeforeEnd = maxTimestamp === void 0 || currentTimestamp <= maxTimestamp;
|
|
13935
14048
|
const isValid = isAfterStart && isBeforeEnd;
|
|
13936
14049
|
const isSelectedMonth = monthIndex === selectedMonthIndex;
|
|
13937
|
-
return /* @__PURE__ */
|
|
14050
|
+
return /* @__PURE__ */ jsx62(
|
|
13938
14051
|
Button,
|
|
13939
14052
|
{
|
|
13940
14053
|
disabled: !isValid,
|
|
@@ -13982,7 +14095,7 @@ var YearMonthPicker = ({
|
|
|
13982
14095
|
if (!end) return;
|
|
13983
14096
|
return new Date(end.getFullYear(), end.getMonth() + 1, 0).getTime();
|
|
13984
14097
|
}, [end]);
|
|
13985
|
-
const callbackRefs =
|
|
14098
|
+
const callbackRefs = useRef19({ onValueChange, onEditComplete });
|
|
13986
14099
|
useLayoutEffect3(() => {
|
|
13987
14100
|
callbackRefs.current = { onValueChange, onEditComplete };
|
|
13988
14101
|
});
|
|
@@ -13991,7 +14104,7 @@ var YearMonthPicker = ({
|
|
|
13991
14104
|
onValueChange2?.(newDate);
|
|
13992
14105
|
onEditComplete2?.(newDate);
|
|
13993
14106
|
}, []);
|
|
13994
|
-
return /* @__PURE__ */
|
|
14107
|
+
return /* @__PURE__ */ jsx62(
|
|
13995
14108
|
InfiniteScroll,
|
|
13996
14109
|
{
|
|
13997
14110
|
itemCount: years.length,
|
|
@@ -14001,7 +14114,7 @@ var YearMonthPicker = ({
|
|
|
14001
14114
|
const year = years[index];
|
|
14002
14115
|
const isSelectedYear = value.getFullYear() === year;
|
|
14003
14116
|
const selectedMonthIndex = isSelectedYear ? value.getMonth() : void 0;
|
|
14004
|
-
return /* @__PURE__ */
|
|
14117
|
+
return /* @__PURE__ */ jsx62(
|
|
14005
14118
|
YearRow,
|
|
14006
14119
|
{
|
|
14007
14120
|
year,
|
|
@@ -14023,7 +14136,7 @@ var YearMonthPickerUncontrolled = ({
|
|
|
14023
14136
|
...props
|
|
14024
14137
|
}) => {
|
|
14025
14138
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14026
|
-
return /* @__PURE__ */
|
|
14139
|
+
return /* @__PURE__ */ jsx62(
|
|
14027
14140
|
YearMonthPicker,
|
|
14028
14141
|
{
|
|
14029
14142
|
value,
|
|
@@ -14034,7 +14147,7 @@ var YearMonthPickerUncontrolled = ({
|
|
|
14034
14147
|
};
|
|
14035
14148
|
|
|
14036
14149
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
14037
|
-
import { jsx as
|
|
14150
|
+
import { jsx as jsx63, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
14038
14151
|
var DatePicker = ({
|
|
14039
14152
|
value = /* @__PURE__ */ new Date(),
|
|
14040
14153
|
start,
|
|
@@ -14050,9 +14163,9 @@ var DatePicker = ({
|
|
|
14050
14163
|
const { locale } = useLocale();
|
|
14051
14164
|
const [displayedMonth, setDisplayedMonth] = useState32(new Date(value.getFullYear(), value.getMonth(), 1));
|
|
14052
14165
|
const [displayMode, setDisplayMode] = useState32(initialDisplay);
|
|
14053
|
-
return /* @__PURE__ */
|
|
14054
|
-
/* @__PURE__ */
|
|
14055
|
-
/* @__PURE__ */
|
|
14166
|
+
return /* @__PURE__ */ jsxs40("div", { className: clsx31("flex-col-3", className), children: [
|
|
14167
|
+
/* @__PURE__ */ jsxs40("div", { className: "flex-row-2 items-center justify-between", children: [
|
|
14168
|
+
/* @__PURE__ */ jsxs40(
|
|
14056
14169
|
Button,
|
|
14057
14170
|
{
|
|
14058
14171
|
size: "sm",
|
|
@@ -14063,12 +14176,12 @@ var DatePicker = ({
|
|
|
14063
14176
|
onClick: () => setDisplayMode(displayMode === "day" ? "yearMonth" : "day"),
|
|
14064
14177
|
children: [
|
|
14065
14178
|
`${new Intl.DateTimeFormat(LocalizationUtil.localToLanguage(locale), { month: "long" }).format(displayedMonth)} ${displayedMonth.getFullYear()}`,
|
|
14066
|
-
/* @__PURE__ */
|
|
14179
|
+
/* @__PURE__ */ jsx63(ChevronDown4, { size: 16 })
|
|
14067
14180
|
]
|
|
14068
14181
|
}
|
|
14069
14182
|
),
|
|
14070
|
-
displayMode === "day" && /* @__PURE__ */
|
|
14071
|
-
/* @__PURE__ */
|
|
14183
|
+
displayMode === "day" && /* @__PURE__ */ jsxs40("div", { className: "flex-row-2 justify-end", children: [
|
|
14184
|
+
/* @__PURE__ */ jsx63(
|
|
14072
14185
|
Button,
|
|
14073
14186
|
{
|
|
14074
14187
|
size: "sm",
|
|
@@ -14079,10 +14192,10 @@ var DatePicker = ({
|
|
|
14079
14192
|
onValueChange(newDate);
|
|
14080
14193
|
setDisplayedMonth(newDate);
|
|
14081
14194
|
},
|
|
14082
|
-
children: /* @__PURE__ */
|
|
14195
|
+
children: /* @__PURE__ */ jsx63(Calendar, { className: "size-5" })
|
|
14083
14196
|
}
|
|
14084
14197
|
),
|
|
14085
|
-
/* @__PURE__ */
|
|
14198
|
+
/* @__PURE__ */ jsx63(
|
|
14086
14199
|
Button,
|
|
14087
14200
|
{
|
|
14088
14201
|
size: "sm",
|
|
@@ -14090,10 +14203,10 @@ var DatePicker = ({
|
|
|
14090
14203
|
onClick: () => {
|
|
14091
14204
|
setDisplayedMonth(subtractDuration(displayedMonth, { months: 1 }));
|
|
14092
14205
|
},
|
|
14093
|
-
children: /* @__PURE__ */
|
|
14206
|
+
children: /* @__PURE__ */ jsx63(ArrowUp, { size: 20 })
|
|
14094
14207
|
}
|
|
14095
14208
|
),
|
|
14096
|
-
/* @__PURE__ */
|
|
14209
|
+
/* @__PURE__ */ jsx63(
|
|
14097
14210
|
Button,
|
|
14098
14211
|
{
|
|
14099
14212
|
size: "sm",
|
|
@@ -14101,12 +14214,12 @@ var DatePicker = ({
|
|
|
14101
14214
|
onClick: () => {
|
|
14102
14215
|
setDisplayedMonth(addDuration(displayedMonth, { months: 1 }));
|
|
14103
14216
|
},
|
|
14104
|
-
children: /* @__PURE__ */
|
|
14217
|
+
children: /* @__PURE__ */ jsx63(ArrowDown, { size: 20 })
|
|
14105
14218
|
}
|
|
14106
14219
|
)
|
|
14107
14220
|
] })
|
|
14108
14221
|
] }),
|
|
14109
|
-
displayMode === "yearMonth" ? /* @__PURE__ */
|
|
14222
|
+
displayMode === "yearMonth" ? /* @__PURE__ */ jsx63(
|
|
14110
14223
|
YearMonthPicker,
|
|
14111
14224
|
{
|
|
14112
14225
|
...yearMonthPickerProps,
|
|
@@ -14123,7 +14236,7 @@ var DatePicker = ({
|
|
|
14123
14236
|
},
|
|
14124
14237
|
className: "h-60 max-h-60"
|
|
14125
14238
|
}
|
|
14126
|
-
) : /* @__PURE__ */
|
|
14239
|
+
) : /* @__PURE__ */ jsx63(
|
|
14127
14240
|
DayPicker,
|
|
14128
14241
|
{
|
|
14129
14242
|
...dayPickerProps,
|
|
@@ -14145,7 +14258,7 @@ var DatePickerUncontrolled = ({
|
|
|
14145
14258
|
...props
|
|
14146
14259
|
}) => {
|
|
14147
14260
|
const [date, setDate] = useOverwritableState(value, onValueChange);
|
|
14148
|
-
return /* @__PURE__ */
|
|
14261
|
+
return /* @__PURE__ */ jsx63(
|
|
14149
14262
|
DatePicker,
|
|
14150
14263
|
{
|
|
14151
14264
|
...props,
|
|
@@ -14159,8 +14272,8 @@ var DatePickerUncontrolled = ({
|
|
|
14159
14272
|
import clsx32 from "clsx";
|
|
14160
14273
|
|
|
14161
14274
|
// src/components/user-interaction/date/TimePicker.tsx
|
|
14162
|
-
import { useEffect as
|
|
14163
|
-
import { jsx as
|
|
14275
|
+
import { useEffect as useEffect31, useRef as useRef20 } from "react";
|
|
14276
|
+
import { jsx as jsx64, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
14164
14277
|
var TimePicker = ({
|
|
14165
14278
|
value = /* @__PURE__ */ new Date(),
|
|
14166
14279
|
onValueChange,
|
|
@@ -14169,8 +14282,8 @@ var TimePicker = ({
|
|
|
14169
14282
|
minuteIncrement = "5min",
|
|
14170
14283
|
className
|
|
14171
14284
|
}) => {
|
|
14172
|
-
const minuteRef =
|
|
14173
|
-
const hourRef =
|
|
14285
|
+
const minuteRef = useRef20(null);
|
|
14286
|
+
const hourRef = useRef20(null);
|
|
14174
14287
|
const isPM = value.getHours() > 11;
|
|
14175
14288
|
const hours = is24HourFormat ? range(24) : range(12);
|
|
14176
14289
|
let minutes = range(60);
|
|
@@ -14190,13 +14303,13 @@ var TimePicker = ({
|
|
|
14190
14303
|
}
|
|
14191
14304
|
const closestMinute = closestMatch(minutes, (item1, item2) => Math.abs(item1 - value.getMinutes()) < Math.abs(item2 - value.getMinutes()));
|
|
14192
14305
|
const hour = value.getHours();
|
|
14193
|
-
|
|
14306
|
+
useEffect31(() => {
|
|
14194
14307
|
minuteRef.current?.scrollIntoView({
|
|
14195
14308
|
behavior: "smooth",
|
|
14196
14309
|
block: "nearest"
|
|
14197
14310
|
});
|
|
14198
14311
|
}, [closestMinute]);
|
|
14199
|
-
|
|
14312
|
+
useEffect31(() => {
|
|
14200
14313
|
hourRef.current?.scrollIntoView({
|
|
14201
14314
|
behavior: "smooth",
|
|
14202
14315
|
block: "nearest"
|
|
@@ -14208,10 +14321,10 @@ var TimePicker = ({
|
|
|
14208
14321
|
onValueChange?.(newDate);
|
|
14209
14322
|
onEditComplete?.(newDate);
|
|
14210
14323
|
};
|
|
14211
|
-
return /* @__PURE__ */
|
|
14212
|
-
/* @__PURE__ */
|
|
14324
|
+
return /* @__PURE__ */ jsxs41("div", { "data-name": "time-picker-container", className, children: [
|
|
14325
|
+
/* @__PURE__ */ jsx64("div", { "data-name": "time-picker-value-column", children: hours.map((hour2) => {
|
|
14213
14326
|
const isSelected = hour2 === value.getHours() - (!is24HourFormat && isPM ? 12 : 0);
|
|
14214
|
-
return /* @__PURE__ */
|
|
14327
|
+
return /* @__PURE__ */ jsx64(
|
|
14215
14328
|
Button,
|
|
14216
14329
|
{
|
|
14217
14330
|
size: "sm",
|
|
@@ -14223,9 +14336,9 @@ var TimePicker = ({
|
|
|
14223
14336
|
hour2
|
|
14224
14337
|
);
|
|
14225
14338
|
}) }),
|
|
14226
|
-
/* @__PURE__ */
|
|
14339
|
+
/* @__PURE__ */ jsx64("div", { "data-name": "time-picker-value-column", children: minutes.map((minute) => {
|
|
14227
14340
|
const isSelected = minute === closestMinute;
|
|
14228
|
-
return /* @__PURE__ */
|
|
14341
|
+
return /* @__PURE__ */ jsx64(
|
|
14229
14342
|
Button,
|
|
14230
14343
|
{
|
|
14231
14344
|
size: "sm",
|
|
@@ -14237,8 +14350,8 @@ var TimePicker = ({
|
|
|
14237
14350
|
minute + minuteIncrement
|
|
14238
14351
|
);
|
|
14239
14352
|
}) }),
|
|
14240
|
-
!is24HourFormat && /* @__PURE__ */
|
|
14241
|
-
/* @__PURE__ */
|
|
14353
|
+
!is24HourFormat && /* @__PURE__ */ jsxs41("div", { "data-name": "time-picker-value-column", children: [
|
|
14354
|
+
/* @__PURE__ */ jsx64(
|
|
14242
14355
|
Button,
|
|
14243
14356
|
{
|
|
14244
14357
|
size: "sm",
|
|
@@ -14247,7 +14360,7 @@ var TimePicker = ({
|
|
|
14247
14360
|
children: "AM"
|
|
14248
14361
|
}
|
|
14249
14362
|
),
|
|
14250
|
-
/* @__PURE__ */
|
|
14363
|
+
/* @__PURE__ */ jsx64(
|
|
14251
14364
|
Button,
|
|
14252
14365
|
{
|
|
14253
14366
|
size: "sm",
|
|
@@ -14265,7 +14378,7 @@ var TimePickerUncontrolled = ({
|
|
|
14265
14378
|
...props
|
|
14266
14379
|
}) => {
|
|
14267
14380
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14268
|
-
return /* @__PURE__ */
|
|
14381
|
+
return /* @__PURE__ */ jsx64(
|
|
14269
14382
|
TimePicker,
|
|
14270
14383
|
{
|
|
14271
14384
|
...props,
|
|
@@ -14276,7 +14389,7 @@ var TimePickerUncontrolled = ({
|
|
|
14276
14389
|
};
|
|
14277
14390
|
|
|
14278
14391
|
// src/components/user-interaction/date/DateTimePicker.tsx
|
|
14279
|
-
import { jsx as
|
|
14392
|
+
import { jsx as jsx65, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
14280
14393
|
var DateTimePicker = ({
|
|
14281
14394
|
value = /* @__PURE__ */ new Date(),
|
|
14282
14395
|
start,
|
|
@@ -14295,7 +14408,7 @@ var DateTimePicker = ({
|
|
|
14295
14408
|
let dateDisplay;
|
|
14296
14409
|
let timeDisplay;
|
|
14297
14410
|
if (useDate) {
|
|
14298
|
-
dateDisplay = /* @__PURE__ */
|
|
14411
|
+
dateDisplay = /* @__PURE__ */ jsx65(
|
|
14299
14412
|
DatePicker,
|
|
14300
14413
|
{
|
|
14301
14414
|
...datePickerProps,
|
|
@@ -14311,7 +14424,7 @@ var DateTimePicker = ({
|
|
|
14311
14424
|
);
|
|
14312
14425
|
}
|
|
14313
14426
|
if (useTime) {
|
|
14314
|
-
timeDisplay = /* @__PURE__ */
|
|
14427
|
+
timeDisplay = /* @__PURE__ */ jsx65(
|
|
14315
14428
|
TimePicker,
|
|
14316
14429
|
{
|
|
14317
14430
|
...timePickerProps,
|
|
@@ -14324,14 +14437,14 @@ var DateTimePicker = ({
|
|
|
14324
14437
|
}
|
|
14325
14438
|
);
|
|
14326
14439
|
}
|
|
14327
|
-
return /* @__PURE__ */
|
|
14440
|
+
return /* @__PURE__ */ jsxs42("div", { className: "flex-row-2 min-h-71 max-h-71", children: [
|
|
14328
14441
|
dateDisplay,
|
|
14329
14442
|
timeDisplay
|
|
14330
14443
|
] });
|
|
14331
14444
|
};
|
|
14332
14445
|
var DateTimePickerUncontrolled = ({ value: initialValue, onValueChange, ...props }) => {
|
|
14333
14446
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14334
|
-
return /* @__PURE__ */
|
|
14447
|
+
return /* @__PURE__ */ jsx65(
|
|
14335
14448
|
DateTimePicker,
|
|
14336
14449
|
{
|
|
14337
14450
|
...props,
|
|
@@ -14342,7 +14455,7 @@ var DateTimePickerUncontrolled = ({ value: initialValue, onValueChange, ...props
|
|
|
14342
14455
|
};
|
|
14343
14456
|
|
|
14344
14457
|
// src/components/user-interaction/date/TimeDisplay.tsx
|
|
14345
|
-
import { jsx as
|
|
14458
|
+
import { jsx as jsx66 } from "react/jsx-runtime";
|
|
14346
14459
|
var TimeDisplay = ({
|
|
14347
14460
|
date,
|
|
14348
14461
|
mode = "daysFromToday"
|
|
@@ -14379,15 +14492,15 @@ var TimeDisplay = ({
|
|
|
14379
14492
|
} else {
|
|
14380
14493
|
fullString = `${date.getDate()}. ${monthToTranslation[date.getMonth()]} ${date.getFullYear()}`;
|
|
14381
14494
|
}
|
|
14382
|
-
return /* @__PURE__ */
|
|
14495
|
+
return /* @__PURE__ */ jsx66("span", { children: fullString });
|
|
14383
14496
|
};
|
|
14384
14497
|
|
|
14385
14498
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
14386
|
-
import { useEffect as
|
|
14499
|
+
import { useEffect as useEffect32, useMemo as useMemo18, useRef as useRef21, useState as useState33 } from "react";
|
|
14387
14500
|
import { createPortal as createPortal8 } from "react-dom";
|
|
14388
14501
|
import { CalendarIcon } from "lucide-react";
|
|
14389
14502
|
import clsx33 from "clsx";
|
|
14390
|
-
import { Fragment as Fragment9, jsx as
|
|
14503
|
+
import { Fragment as Fragment9, jsx as jsx67, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
14391
14504
|
var DateTimeInput = ({
|
|
14392
14505
|
value,
|
|
14393
14506
|
onValueChange,
|
|
@@ -14401,8 +14514,8 @@ var DateTimeInput = ({
|
|
|
14401
14514
|
const translation = useHightideTranslation();
|
|
14402
14515
|
const { locale } = useLocale();
|
|
14403
14516
|
const [isOpen, setIsOpen] = useState33(false);
|
|
14404
|
-
const anchorRef =
|
|
14405
|
-
const containerRef =
|
|
14517
|
+
const anchorRef = useRef21(null);
|
|
14518
|
+
const containerRef = useRef21(null);
|
|
14406
14519
|
const position = useFloatingElement({
|
|
14407
14520
|
active: isOpen,
|
|
14408
14521
|
anchorRef,
|
|
@@ -14417,14 +14530,14 @@ var DateTimeInput = ({
|
|
|
14417
14530
|
});
|
|
14418
14531
|
const { zIndex } = useOverlayRegistry({ isActive: isOpen });
|
|
14419
14532
|
const isReadOnly = useMemo18(() => props.readOnly || props.disabled, [props.readOnly, props.disabled]);
|
|
14420
|
-
|
|
14533
|
+
useEffect32(() => {
|
|
14421
14534
|
if (isReadOnly) {
|
|
14422
14535
|
setIsOpen(false);
|
|
14423
14536
|
}
|
|
14424
14537
|
}, [isReadOnly]);
|
|
14425
|
-
return /* @__PURE__ */
|
|
14426
|
-
/* @__PURE__ */
|
|
14427
|
-
/* @__PURE__ */
|
|
14538
|
+
return /* @__PURE__ */ jsxs43(Fragment9, { children: [
|
|
14539
|
+
/* @__PURE__ */ jsxs43("div", { ...containerProps, ref: anchorRef, className: clsx33("relative w-full", containerProps?.className), children: [
|
|
14540
|
+
/* @__PURE__ */ jsx67(
|
|
14428
14541
|
Input,
|
|
14429
14542
|
{
|
|
14430
14543
|
...props,
|
|
@@ -14442,7 +14555,7 @@ var DateTimeInput = ({
|
|
|
14442
14555
|
)
|
|
14443
14556
|
}
|
|
14444
14557
|
),
|
|
14445
|
-
/* @__PURE__ */
|
|
14558
|
+
/* @__PURE__ */ jsx67(
|
|
14446
14559
|
Button,
|
|
14447
14560
|
{
|
|
14448
14561
|
coloringStyle: "text",
|
|
@@ -14452,12 +14565,12 @@ var DateTimeInput = ({
|
|
|
14452
14565
|
className: "absolute right-1 top-1/2 -translate-y-1/2",
|
|
14453
14566
|
disabled: isReadOnly,
|
|
14454
14567
|
onClick: () => setIsOpen((prevState) => !prevState),
|
|
14455
|
-
children: /* @__PURE__ */
|
|
14568
|
+
children: /* @__PURE__ */ jsx67(CalendarIcon, { className: "size-5" })
|
|
14456
14569
|
}
|
|
14457
14570
|
)
|
|
14458
14571
|
] }),
|
|
14459
|
-
/* @__PURE__ */
|
|
14460
|
-
/* @__PURE__ */
|
|
14572
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: isOpen, children: createPortal8(
|
|
14573
|
+
/* @__PURE__ */ jsxs43(
|
|
14461
14574
|
"div",
|
|
14462
14575
|
{
|
|
14463
14576
|
ref: containerRef,
|
|
@@ -14468,7 +14581,7 @@ var DateTimeInput = ({
|
|
|
14468
14581
|
opacity: position ? void 0 : 0
|
|
14469
14582
|
},
|
|
14470
14583
|
children: [
|
|
14471
|
-
/* @__PURE__ */
|
|
14584
|
+
/* @__PURE__ */ jsx67(
|
|
14472
14585
|
DateTimePicker,
|
|
14473
14586
|
{
|
|
14474
14587
|
...pickerProps,
|
|
@@ -14478,8 +14591,8 @@ var DateTimeInput = ({
|
|
|
14478
14591
|
onEditComplete
|
|
14479
14592
|
}
|
|
14480
14593
|
),
|
|
14481
|
-
/* @__PURE__ */
|
|
14482
|
-
/* @__PURE__ */
|
|
14594
|
+
/* @__PURE__ */ jsxs43("div", { className: "flex-row-2 justify-end", children: [
|
|
14595
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !!onRemove && !!value, children: /* @__PURE__ */ jsx67(
|
|
14483
14596
|
Button,
|
|
14484
14597
|
{
|
|
14485
14598
|
size: "md",
|
|
@@ -14492,7 +14605,7 @@ var DateTimeInput = ({
|
|
|
14492
14605
|
children: translation("clear")
|
|
14493
14606
|
}
|
|
14494
14607
|
) }),
|
|
14495
|
-
/* @__PURE__ */
|
|
14608
|
+
/* @__PURE__ */ jsx67(Visibility, { isVisible: !value, children: /* @__PURE__ */ jsx67(
|
|
14496
14609
|
Button,
|
|
14497
14610
|
{
|
|
14498
14611
|
size: "md",
|
|
@@ -14502,7 +14615,7 @@ var DateTimeInput = ({
|
|
|
14502
14615
|
children: translation("cancel")
|
|
14503
14616
|
}
|
|
14504
14617
|
) }),
|
|
14505
|
-
/* @__PURE__ */
|
|
14618
|
+
/* @__PURE__ */ jsx67(
|
|
14506
14619
|
Button,
|
|
14507
14620
|
{
|
|
14508
14621
|
size: "md",
|
|
@@ -14527,7 +14640,7 @@ var DateTimeInputUncontrolled = ({
|
|
|
14527
14640
|
...props
|
|
14528
14641
|
}) => {
|
|
14529
14642
|
const [value, setValue] = useOverwritableState(initialValue);
|
|
14530
|
-
return /* @__PURE__ */
|
|
14643
|
+
return /* @__PURE__ */ jsx67(
|
|
14531
14644
|
DateTimeInput,
|
|
14532
14645
|
{
|
|
14533
14646
|
...props,
|
|
@@ -14546,10 +14659,10 @@ var DateTimeInputUncontrolled = ({
|
|
|
14546
14659
|
|
|
14547
14660
|
// src/components/user-interaction/input/InsideLabelInput.tsx
|
|
14548
14661
|
import { useId as useId12 } from "react";
|
|
14549
|
-
import { forwardRef as
|
|
14662
|
+
import { forwardRef as forwardRef13, useState as useState34 } from "react";
|
|
14550
14663
|
import clsx34 from "clsx";
|
|
14551
|
-
import { jsx as
|
|
14552
|
-
var InsideLabelInput =
|
|
14664
|
+
import { jsx as jsx68, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
14665
|
+
var InsideLabelInput = forwardRef13(function InsideLabelInput2({
|
|
14553
14666
|
id: customId,
|
|
14554
14667
|
label,
|
|
14555
14668
|
...props
|
|
@@ -14558,8 +14671,8 @@ var InsideLabelInput = forwardRef10(function InsideLabelInput2({
|
|
|
14558
14671
|
const [isFocused, setIsFocused] = useState34(false);
|
|
14559
14672
|
const generatedId = useId12();
|
|
14560
14673
|
const id = customId ?? generatedId;
|
|
14561
|
-
return /* @__PURE__ */
|
|
14562
|
-
/* @__PURE__ */
|
|
14674
|
+
return /* @__PURE__ */ jsxs44("div", { className: clsx34("relative"), children: [
|
|
14675
|
+
/* @__PURE__ */ jsx68(
|
|
14563
14676
|
Input,
|
|
14564
14677
|
{
|
|
14565
14678
|
...props,
|
|
@@ -14577,7 +14690,7 @@ var InsideLabelInput = forwardRef10(function InsideLabelInput2({
|
|
|
14577
14690
|
}
|
|
14578
14691
|
}
|
|
14579
14692
|
),
|
|
14580
|
-
/* @__PURE__ */
|
|
14693
|
+
/* @__PURE__ */ jsx68(
|
|
14581
14694
|
"label",
|
|
14582
14695
|
{
|
|
14583
14696
|
id: id + "-label",
|
|
@@ -14599,7 +14712,7 @@ var InsideLabelInputUncontrolled = ({
|
|
|
14599
14712
|
...props
|
|
14600
14713
|
}) => {
|
|
14601
14714
|
const [value, setValue] = useOverwritableState(initialValue, props.onValueChange);
|
|
14602
|
-
return /* @__PURE__ */
|
|
14715
|
+
return /* @__PURE__ */ jsx68(
|
|
14603
14716
|
InsideLabelInput,
|
|
14604
14717
|
{
|
|
14605
14718
|
...props,
|
|
@@ -14612,7 +14725,7 @@ var InsideLabelInputUncontrolled = ({
|
|
|
14612
14725
|
// src/components/user-interaction/input/SearchBar.tsx
|
|
14613
14726
|
import { Search } from "lucide-react";
|
|
14614
14727
|
import { clsx as clsx35 } from "clsx";
|
|
14615
|
-
import { jsx as
|
|
14728
|
+
import { jsx as jsx69, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
14616
14729
|
var SearchBar = ({
|
|
14617
14730
|
value: initialValue,
|
|
14618
14731
|
onSearch,
|
|
@@ -14623,8 +14736,8 @@ var SearchBar = ({
|
|
|
14623
14736
|
}) => {
|
|
14624
14737
|
const translation = useHightideTranslation();
|
|
14625
14738
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14626
|
-
return /* @__PURE__ */
|
|
14627
|
-
/* @__PURE__ */
|
|
14739
|
+
return /* @__PURE__ */ jsxs45("div", { ...containerProps, className: clsx35("relative", containerProps?.className), children: [
|
|
14740
|
+
/* @__PURE__ */ jsx69(
|
|
14628
14741
|
InputUncontrolled,
|
|
14629
14742
|
{
|
|
14630
14743
|
...inputProps,
|
|
@@ -14635,7 +14748,7 @@ var SearchBar = ({
|
|
|
14635
14748
|
className: clsx35("pr-10 w-full", inputProps.className)
|
|
14636
14749
|
}
|
|
14637
14750
|
),
|
|
14638
|
-
/* @__PURE__ */
|
|
14751
|
+
/* @__PURE__ */ jsx69(
|
|
14639
14752
|
Button,
|
|
14640
14753
|
{
|
|
14641
14754
|
...searchButtonProps,
|
|
@@ -14645,33 +14758,33 @@ var SearchBar = ({
|
|
|
14645
14758
|
coloringStyle: "text",
|
|
14646
14759
|
onClick: () => onSearch(value),
|
|
14647
14760
|
className: clsx35("absolute right-1 top-1/2 -translate-y-1/2", searchButtonProps?.className),
|
|
14648
|
-
children: /* @__PURE__ */
|
|
14761
|
+
children: /* @__PURE__ */ jsx69(Search, { className: "w-full h-full" })
|
|
14649
14762
|
}
|
|
14650
14763
|
)
|
|
14651
14764
|
] });
|
|
14652
14765
|
};
|
|
14653
14766
|
|
|
14654
14767
|
// src/components/user-interaction/input/ToggleableInput.tsx
|
|
14655
|
-
import { forwardRef as
|
|
14768
|
+
import { forwardRef as forwardRef14, useEffect as useEffect33, useImperativeHandle as useImperativeHandle5, useRef as useRef22, useState as useState35 } from "react";
|
|
14656
14769
|
import { Pencil } from "lucide-react";
|
|
14657
14770
|
import clsx36 from "clsx";
|
|
14658
|
-
import { jsx as
|
|
14659
|
-
var ToggleableInput =
|
|
14771
|
+
import { jsx as jsx70, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
14772
|
+
var ToggleableInput = forwardRef14(function ToggleableInput2({
|
|
14660
14773
|
value,
|
|
14661
14774
|
initialState = "display",
|
|
14662
14775
|
editCompleteOptions,
|
|
14663
14776
|
...props
|
|
14664
14777
|
}, forwardedRef) {
|
|
14665
14778
|
const [isEditing, setIsEditing] = useState35(initialState !== "display");
|
|
14666
|
-
const innerRef =
|
|
14667
|
-
|
|
14668
|
-
|
|
14779
|
+
const innerRef = useRef22(null);
|
|
14780
|
+
useImperativeHandle5(forwardedRef, () => innerRef.current);
|
|
14781
|
+
useEffect33(() => {
|
|
14669
14782
|
if (isEditing) {
|
|
14670
14783
|
innerRef.current?.focus();
|
|
14671
14784
|
}
|
|
14672
14785
|
}, [isEditing]);
|
|
14673
|
-
return /* @__PURE__ */
|
|
14674
|
-
/* @__PURE__ */
|
|
14786
|
+
return /* @__PURE__ */ jsxs46("div", { className: clsx36("relative flex-row-2", { "flex-1": isEditing }), children: [
|
|
14787
|
+
/* @__PURE__ */ jsx70(
|
|
14675
14788
|
Input,
|
|
14676
14789
|
{
|
|
14677
14790
|
...props,
|
|
@@ -14697,9 +14810,9 @@ var ToggleableInput = forwardRef11(function ToggleableInput2({
|
|
|
14697
14810
|
})
|
|
14698
14811
|
}
|
|
14699
14812
|
),
|
|
14700
|
-
!isEditing && /* @__PURE__ */
|
|
14701
|
-
/* @__PURE__ */
|
|
14702
|
-
/* @__PURE__ */
|
|
14813
|
+
!isEditing && /* @__PURE__ */ jsxs46("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
|
|
14814
|
+
/* @__PURE__ */ jsx70("span", { className: clsx36(" truncate"), children: value }),
|
|
14815
|
+
/* @__PURE__ */ jsx70(Pencil, { className: clsx36(`size-force-4`, { "text-transparent": isEditing }) })
|
|
14703
14816
|
] })
|
|
14704
14817
|
] });
|
|
14705
14818
|
});
|
|
@@ -14709,7 +14822,7 @@ var ToggleableInputUncontrolled = ({
|
|
|
14709
14822
|
...restProps
|
|
14710
14823
|
}) => {
|
|
14711
14824
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14712
|
-
return /* @__PURE__ */
|
|
14825
|
+
return /* @__PURE__ */ jsx70(
|
|
14713
14826
|
ToggleableInput,
|
|
14714
14827
|
{
|
|
14715
14828
|
value,
|
|
@@ -14724,7 +14837,7 @@ import { Check as Check3 } from "lucide-react";
|
|
|
14724
14837
|
|
|
14725
14838
|
// src/components/user-interaction/properties/PropertyBase.tsx
|
|
14726
14839
|
import { AlertTriangle, Trash, X as X3 } from "lucide-react";
|
|
14727
|
-
import { jsx as
|
|
14840
|
+
import { jsx as jsx71, jsxs as jsxs47 } from "react/jsx-runtime";
|
|
14728
14841
|
var PropertyBase = ({
|
|
14729
14842
|
name: name2,
|
|
14730
14843
|
children,
|
|
@@ -14743,29 +14856,29 @@ var PropertyBase = ({
|
|
|
14743
14856
|
const isClearEnabled = allowClear && !readOnly;
|
|
14744
14857
|
const isRemoveEnabled = allowRemove && !readOnly;
|
|
14745
14858
|
const showActionsContainer = isClearEnabled || isRemoveEnabled;
|
|
14746
|
-
return /* @__PURE__ */
|
|
14859
|
+
return /* @__PURE__ */ jsxs47(
|
|
14747
14860
|
"div",
|
|
14748
14861
|
{
|
|
14749
14862
|
className: className ? `group/property ${className}` : "group/property",
|
|
14750
14863
|
"data-name": "property-root",
|
|
14751
14864
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14752
14865
|
children: [
|
|
14753
|
-
/* @__PURE__ */
|
|
14866
|
+
/* @__PURE__ */ jsxs47(
|
|
14754
14867
|
"div",
|
|
14755
14868
|
{
|
|
14756
14869
|
className,
|
|
14757
14870
|
"data-name": "property-title",
|
|
14758
14871
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14759
14872
|
children: [
|
|
14760
|
-
/* @__PURE__ */
|
|
14761
|
-
/* @__PURE__ */
|
|
14762
|
-
/* @__PURE__ */
|
|
14873
|
+
/* @__PURE__ */ jsx71(Tooltip, { tooltip: name2, containerClassName: "min-w-0", children: /* @__PURE__ */ jsxs47("div", { className: "flex-row-1 items-center", children: [
|
|
14874
|
+
/* @__PURE__ */ jsx71("div", { "data-name": "property-title-icon", children: icon }),
|
|
14875
|
+
/* @__PURE__ */ jsx71("span", { "data-name": "property-title-text", children: name2 })
|
|
14763
14876
|
] }) }),
|
|
14764
|
-
invalid && /* @__PURE__ */
|
|
14877
|
+
invalid && /* @__PURE__ */ jsx71(AlertTriangle, { className: "size-force-6" })
|
|
14765
14878
|
]
|
|
14766
14879
|
}
|
|
14767
14880
|
),
|
|
14768
|
-
/* @__PURE__ */
|
|
14881
|
+
/* @__PURE__ */ jsxs47(
|
|
14769
14882
|
"div",
|
|
14770
14883
|
{
|
|
14771
14884
|
className,
|
|
@@ -14773,8 +14886,8 @@ var PropertyBase = ({
|
|
|
14773
14886
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14774
14887
|
children: [
|
|
14775
14888
|
children({ required, hasValue, invalid }),
|
|
14776
|
-
showActionsContainer && /* @__PURE__ */
|
|
14777
|
-
isClearEnabled && /* @__PURE__ */
|
|
14889
|
+
showActionsContainer && /* @__PURE__ */ jsxs47("div", { "data-name": "property-actions", children: [
|
|
14890
|
+
isClearEnabled && /* @__PURE__ */ jsx71(Tooltip, { tooltip: translation("clearValue"), children: /* @__PURE__ */ jsx71(
|
|
14778
14891
|
Button,
|
|
14779
14892
|
{
|
|
14780
14893
|
onClick: onValueClear,
|
|
@@ -14783,10 +14896,10 @@ var PropertyBase = ({
|
|
|
14783
14896
|
coloringStyle: "text",
|
|
14784
14897
|
layout: "icon",
|
|
14785
14898
|
size: "sm",
|
|
14786
|
-
children: /* @__PURE__ */
|
|
14899
|
+
children: /* @__PURE__ */ jsx71(X3, { className: "size-force-5" })
|
|
14787
14900
|
}
|
|
14788
14901
|
) }),
|
|
14789
|
-
isRemoveEnabled && /* @__PURE__ */
|
|
14902
|
+
isRemoveEnabled && /* @__PURE__ */ jsx71(Tooltip, { tooltip: translation("removeProperty"), children: /* @__PURE__ */ jsx71(
|
|
14790
14903
|
Button,
|
|
14791
14904
|
{
|
|
14792
14905
|
onClick: onRemove,
|
|
@@ -14794,7 +14907,7 @@ var PropertyBase = ({
|
|
|
14794
14907
|
coloringStyle: "text",
|
|
14795
14908
|
layout: "icon",
|
|
14796
14909
|
size: "sm",
|
|
14797
|
-
children: /* @__PURE__ */
|
|
14910
|
+
children: /* @__PURE__ */ jsx71(Trash, { className: "size-force-5" })
|
|
14798
14911
|
}
|
|
14799
14912
|
) })
|
|
14800
14913
|
] })
|
|
@@ -14807,7 +14920,7 @@ var PropertyBase = ({
|
|
|
14807
14920
|
};
|
|
14808
14921
|
|
|
14809
14922
|
// src/components/user-interaction/properties/CheckboxProperty.tsx
|
|
14810
|
-
import { jsx as
|
|
14923
|
+
import { jsx as jsx72, jsxs as jsxs48 } from "react/jsx-runtime";
|
|
14811
14924
|
var CheckboxProperty = ({
|
|
14812
14925
|
value,
|
|
14813
14926
|
onValueChange,
|
|
@@ -14816,15 +14929,15 @@ var CheckboxProperty = ({
|
|
|
14816
14929
|
...baseProps
|
|
14817
14930
|
}) => {
|
|
14818
14931
|
const translation = useHightideTranslation();
|
|
14819
|
-
return /* @__PURE__ */
|
|
14932
|
+
return /* @__PURE__ */ jsx72(
|
|
14820
14933
|
PropertyBase,
|
|
14821
14934
|
{
|
|
14822
14935
|
...baseProps,
|
|
14823
14936
|
hasValue: value !== void 0,
|
|
14824
14937
|
readOnly,
|
|
14825
|
-
icon: /* @__PURE__ */
|
|
14826
|
-
children: () => /* @__PURE__ */
|
|
14827
|
-
/* @__PURE__ */
|
|
14938
|
+
icon: /* @__PURE__ */ jsx72(Check3, { size: 24 }),
|
|
14939
|
+
children: () => /* @__PURE__ */ jsxs48("div", { className: "flex-row-2 items-center", children: [
|
|
14940
|
+
/* @__PURE__ */ jsx72(
|
|
14828
14941
|
Button,
|
|
14829
14942
|
{
|
|
14830
14943
|
color: value ? "positive" : "neutral",
|
|
@@ -14837,7 +14950,7 @@ var CheckboxProperty = ({
|
|
|
14837
14950
|
children: translation("yes")
|
|
14838
14951
|
}
|
|
14839
14952
|
),
|
|
14840
|
-
/* @__PURE__ */
|
|
14953
|
+
/* @__PURE__ */ jsx72(
|
|
14841
14954
|
Button,
|
|
14842
14955
|
{
|
|
14843
14956
|
color: !value && value !== void 0 ? "negative" : "neutral",
|
|
@@ -14857,7 +14970,7 @@ var CheckboxProperty = ({
|
|
|
14857
14970
|
|
|
14858
14971
|
// src/components/user-interaction/properties/DateProperty.tsx
|
|
14859
14972
|
import { CalendarDays } from "lucide-react";
|
|
14860
|
-
import { jsx as
|
|
14973
|
+
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
14861
14974
|
var DateProperty = ({
|
|
14862
14975
|
value,
|
|
14863
14976
|
onValueChange,
|
|
@@ -14867,13 +14980,13 @@ var DateProperty = ({
|
|
|
14867
14980
|
...baseProps
|
|
14868
14981
|
}) => {
|
|
14869
14982
|
const hasValue = !!value;
|
|
14870
|
-
return /* @__PURE__ */
|
|
14983
|
+
return /* @__PURE__ */ jsx73(
|
|
14871
14984
|
PropertyBase,
|
|
14872
14985
|
{
|
|
14873
14986
|
...baseProps,
|
|
14874
14987
|
hasValue,
|
|
14875
|
-
icon: /* @__PURE__ */
|
|
14876
|
-
children: ({ invalid }) => /* @__PURE__ */
|
|
14988
|
+
icon: /* @__PURE__ */ jsx73(CalendarDays, { size: 24 }),
|
|
14989
|
+
children: ({ invalid }) => /* @__PURE__ */ jsx73(
|
|
14877
14990
|
DateTimeInput,
|
|
14878
14991
|
{
|
|
14879
14992
|
value,
|
|
@@ -14891,7 +15004,7 @@ var DateProperty = ({
|
|
|
14891
15004
|
|
|
14892
15005
|
// src/components/user-interaction/properties/MultiSelectProperty.tsx
|
|
14893
15006
|
import { List } from "lucide-react";
|
|
14894
|
-
import { jsx as
|
|
15007
|
+
import { jsx as jsx74 } from "react/jsx-runtime";
|
|
14895
15008
|
var MultiSelectProperty = ({
|
|
14896
15009
|
children,
|
|
14897
15010
|
value,
|
|
@@ -14900,18 +15013,18 @@ var MultiSelectProperty = ({
|
|
|
14900
15013
|
...props
|
|
14901
15014
|
}) => {
|
|
14902
15015
|
const hasValue = value.length > 0;
|
|
14903
|
-
return /* @__PURE__ */
|
|
15016
|
+
return /* @__PURE__ */ jsx74(
|
|
14904
15017
|
PropertyBase,
|
|
14905
15018
|
{
|
|
14906
15019
|
...props,
|
|
14907
15020
|
hasValue,
|
|
14908
|
-
icon: /* @__PURE__ */
|
|
14909
|
-
children: ({ invalid }) => /* @__PURE__ */
|
|
15021
|
+
icon: /* @__PURE__ */ jsx74(List, { size: 24 }),
|
|
15022
|
+
children: ({ invalid }) => /* @__PURE__ */ jsx74(
|
|
14910
15023
|
"div",
|
|
14911
15024
|
{
|
|
14912
15025
|
"data-name": "property-input-wrapper",
|
|
14913
15026
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14914
|
-
children: /* @__PURE__ */
|
|
15027
|
+
children: /* @__PURE__ */ jsx74(
|
|
14915
15028
|
MultiSelectChipDisplay,
|
|
14916
15029
|
{
|
|
14917
15030
|
value,
|
|
@@ -14937,7 +15050,7 @@ var MultiSelectProperty = ({
|
|
|
14937
15050
|
|
|
14938
15051
|
// src/components/user-interaction/properties/NumberProperty.tsx
|
|
14939
15052
|
import { Binary } from "lucide-react";
|
|
14940
|
-
import { jsx as
|
|
15053
|
+
import { jsx as jsx75, jsxs as jsxs49 } from "react/jsx-runtime";
|
|
14941
15054
|
var NumberProperty = ({
|
|
14942
15055
|
value,
|
|
14943
15056
|
onRemove,
|
|
@@ -14949,20 +15062,20 @@ var NumberProperty = ({
|
|
|
14949
15062
|
}) => {
|
|
14950
15063
|
const translation = useHightideTranslation();
|
|
14951
15064
|
const hasValue = value !== void 0;
|
|
14952
|
-
return /* @__PURE__ */
|
|
15065
|
+
return /* @__PURE__ */ jsx75(
|
|
14953
15066
|
PropertyBase,
|
|
14954
15067
|
{
|
|
14955
15068
|
...baseProps,
|
|
14956
15069
|
onRemove,
|
|
14957
15070
|
hasValue,
|
|
14958
|
-
icon: /* @__PURE__ */
|
|
14959
|
-
children: ({ invalid }) => /* @__PURE__ */
|
|
15071
|
+
icon: /* @__PURE__ */ jsx75(Binary, { size: 24 }),
|
|
15072
|
+
children: ({ invalid }) => /* @__PURE__ */ jsxs49(
|
|
14960
15073
|
"div",
|
|
14961
15074
|
{
|
|
14962
15075
|
"data-name": "property-input-wrapper",
|
|
14963
15076
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14964
15077
|
children: [
|
|
14965
|
-
/* @__PURE__ */
|
|
15078
|
+
/* @__PURE__ */ jsx75(
|
|
14966
15079
|
Input,
|
|
14967
15080
|
{
|
|
14968
15081
|
className: "w-full pr-8",
|
|
@@ -14990,7 +15103,7 @@ var NumberProperty = ({
|
|
|
14990
15103
|
}
|
|
14991
15104
|
}
|
|
14992
15105
|
),
|
|
14993
|
-
suffix && /* @__PURE__ */
|
|
15106
|
+
suffix && /* @__PURE__ */ jsx75(
|
|
14994
15107
|
"span",
|
|
14995
15108
|
{
|
|
14996
15109
|
"data-name": "property-suffix",
|
|
@@ -15007,7 +15120,7 @@ var NumberProperty = ({
|
|
|
15007
15120
|
|
|
15008
15121
|
// src/components/user-interaction/properties/SelectProperty.tsx
|
|
15009
15122
|
import { List as List2 } from "lucide-react";
|
|
15010
|
-
import { jsx as
|
|
15123
|
+
import { jsx as jsx76 } from "react/jsx-runtime";
|
|
15011
15124
|
var SingleSelectProperty = ({
|
|
15012
15125
|
children,
|
|
15013
15126
|
value,
|
|
@@ -15016,18 +15129,18 @@ var SingleSelectProperty = ({
|
|
|
15016
15129
|
...props
|
|
15017
15130
|
}) => {
|
|
15018
15131
|
const hasValue = value !== void 0;
|
|
15019
|
-
return /* @__PURE__ */
|
|
15132
|
+
return /* @__PURE__ */ jsx76(
|
|
15020
15133
|
PropertyBase,
|
|
15021
15134
|
{
|
|
15022
15135
|
...props,
|
|
15023
15136
|
hasValue,
|
|
15024
|
-
icon: /* @__PURE__ */
|
|
15025
|
-
children: ({ invalid }) => /* @__PURE__ */
|
|
15137
|
+
icon: /* @__PURE__ */ jsx76(List2, { size: 24 }),
|
|
15138
|
+
children: ({ invalid }) => /* @__PURE__ */ jsx76(
|
|
15026
15139
|
"div",
|
|
15027
15140
|
{
|
|
15028
15141
|
"data-name": "property-input-wrapper",
|
|
15029
15142
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
15030
|
-
children: /* @__PURE__ */
|
|
15143
|
+
children: /* @__PURE__ */ jsx76(
|
|
15031
15144
|
Select,
|
|
15032
15145
|
{
|
|
15033
15146
|
value,
|
|
@@ -15050,7 +15163,7 @@ var SingleSelectProperty = ({
|
|
|
15050
15163
|
|
|
15051
15164
|
// src/components/user-interaction/properties/TextProperty.tsx
|
|
15052
15165
|
import { Text } from "lucide-react";
|
|
15053
|
-
import { jsx as
|
|
15166
|
+
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
15054
15167
|
var TextProperty = ({
|
|
15055
15168
|
value,
|
|
15056
15169
|
readOnly,
|
|
@@ -15061,14 +15174,14 @@ var TextProperty = ({
|
|
|
15061
15174
|
}) => {
|
|
15062
15175
|
const translation = useHightideTranslation();
|
|
15063
15176
|
const hasValue = value !== void 0;
|
|
15064
|
-
return /* @__PURE__ */
|
|
15177
|
+
return /* @__PURE__ */ jsx77(
|
|
15065
15178
|
PropertyBase,
|
|
15066
15179
|
{
|
|
15067
15180
|
...baseProps,
|
|
15068
15181
|
onRemove,
|
|
15069
15182
|
hasValue,
|
|
15070
|
-
icon: /* @__PURE__ */
|
|
15071
|
-
children: ({ invalid }) => /* @__PURE__ */
|
|
15183
|
+
icon: /* @__PURE__ */ jsx77(Text, { size: 24 }),
|
|
15184
|
+
children: ({ invalid }) => /* @__PURE__ */ jsx77(
|
|
15072
15185
|
Textarea,
|
|
15073
15186
|
{
|
|
15074
15187
|
className: "w-full",
|
|
@@ -15099,24 +15212,24 @@ var TextProperty = ({
|
|
|
15099
15212
|
};
|
|
15100
15213
|
|
|
15101
15214
|
// src/components/utils/FocusTrap.tsx
|
|
15102
|
-
import { useRef as
|
|
15103
|
-
import { useImperativeHandle as
|
|
15104
|
-
import { forwardRef as
|
|
15105
|
-
import { jsx as
|
|
15106
|
-
var FocusTrap =
|
|
15215
|
+
import { useRef as useRef23 } from "react";
|
|
15216
|
+
import { useImperativeHandle as useImperativeHandle6 } from "react";
|
|
15217
|
+
import { forwardRef as forwardRef15 } from "react";
|
|
15218
|
+
import { jsx as jsx78 } from "react/jsx-runtime";
|
|
15219
|
+
var FocusTrap = forwardRef15(function FocusTrap2({
|
|
15107
15220
|
active = true,
|
|
15108
15221
|
initialFocus,
|
|
15109
15222
|
focusFirst = false,
|
|
15110
15223
|
...props
|
|
15111
15224
|
}, forwardedRef) {
|
|
15112
|
-
const innerRef =
|
|
15113
|
-
|
|
15225
|
+
const innerRef = useRef23(null);
|
|
15226
|
+
useImperativeHandle6(forwardedRef, () => innerRef.current);
|
|
15114
15227
|
useFocusTrap({ container: innerRef, active, initialFocus, focusFirst });
|
|
15115
|
-
return /* @__PURE__ */
|
|
15228
|
+
return /* @__PURE__ */ jsx78("div", { ref: innerRef, ...props });
|
|
15116
15229
|
});
|
|
15117
15230
|
|
|
15118
15231
|
// src/components/utils/Transition.tsx
|
|
15119
|
-
import { useEffect as
|
|
15232
|
+
import { useEffect as useEffect34, useState as useState36 } from "react";
|
|
15120
15233
|
function Transition({
|
|
15121
15234
|
children,
|
|
15122
15235
|
show,
|
|
@@ -15125,7 +15238,7 @@ function Transition({
|
|
|
15125
15238
|
const [isOpen, setIsOpen] = useState36(show);
|
|
15126
15239
|
const [isTransitioning, setIsTransitioning] = useState36(!isOpen);
|
|
15127
15240
|
const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
|
|
15128
|
-
|
|
15241
|
+
useEffect34(() => {
|
|
15129
15242
|
setIsOpen(show);
|
|
15130
15243
|
setIsTransitioning(true);
|
|
15131
15244
|
}, [show]);
|
|
@@ -15150,18 +15263,18 @@ function Transition({
|
|
|
15150
15263
|
}
|
|
15151
15264
|
|
|
15152
15265
|
// src/contexts/HightideProvider.tsx
|
|
15153
|
-
import { jsx as
|
|
15266
|
+
import { jsx as jsx79 } from "react/jsx-runtime";
|
|
15154
15267
|
var HightideProvider = ({
|
|
15155
15268
|
children,
|
|
15156
15269
|
theme,
|
|
15157
15270
|
locale,
|
|
15158
15271
|
config
|
|
15159
15272
|
}) => {
|
|
15160
|
-
return /* @__PURE__ */
|
|
15273
|
+
return /* @__PURE__ */ jsx79(LocaleProvider, { ...locale, children: /* @__PURE__ */ jsx79(ThemeProvider, { ...theme, children: /* @__PURE__ */ jsx79(HightideConfigProvider, { ...config, children }) }) });
|
|
15161
15274
|
};
|
|
15162
15275
|
|
|
15163
15276
|
// src/hooks/focus/useFocusGuards.ts
|
|
15164
|
-
import { useEffect as
|
|
15277
|
+
import { useEffect as useEffect35 } from "react";
|
|
15165
15278
|
var selectorName = "data-hw-focus-guard";
|
|
15166
15279
|
function FocusGuard() {
|
|
15167
15280
|
const element = document.createElement("div");
|
|
@@ -15199,7 +15312,7 @@ var FocusGuardsService = class _FocusGuardsService {
|
|
|
15199
15312
|
}
|
|
15200
15313
|
};
|
|
15201
15314
|
var useFocusGuards = () => {
|
|
15202
|
-
|
|
15315
|
+
useEffect35(() => {
|
|
15203
15316
|
FocusGuardsService.getInstance().add();
|
|
15204
15317
|
return () => {
|
|
15205
15318
|
FocusGuardsService.getInstance().remove();
|
|
@@ -15208,10 +15321,10 @@ var useFocusGuards = () => {
|
|
|
15208
15321
|
};
|
|
15209
15322
|
|
|
15210
15323
|
// src/hooks/focus/useFocusOnceVisible.ts
|
|
15211
|
-
import
|
|
15324
|
+
import React5, { useEffect as useEffect36 } from "react";
|
|
15212
15325
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
15213
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
15214
|
-
|
|
15326
|
+
const [hasUsedFocus, setHasUsedFocus] = React5.useState(false);
|
|
15327
|
+
useEffect36(() => {
|
|
15215
15328
|
if (disable || hasUsedFocus) {
|
|
15216
15329
|
return;
|
|
15217
15330
|
}
|
|
@@ -15237,7 +15350,7 @@ var useRerender = () => {
|
|
|
15237
15350
|
};
|
|
15238
15351
|
|
|
15239
15352
|
// src/hooks/useSearch.ts
|
|
15240
|
-
import { useCallback as useCallback23, useEffect as
|
|
15353
|
+
import { useCallback as useCallback23, useEffect as useEffect37, useMemo as useMemo19, useState as useState37 } from "react";
|
|
15241
15354
|
|
|
15242
15355
|
// src/utils/simpleSearch.ts
|
|
15243
15356
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -15286,7 +15399,7 @@ var useSearch = ({
|
|
|
15286
15399
|
}
|
|
15287
15400
|
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
15288
15401
|
}, [searchTags, list, search, searchMapping]);
|
|
15289
|
-
|
|
15402
|
+
useEffect37(() => {
|
|
15290
15403
|
if (isSearchInstant) {
|
|
15291
15404
|
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
15292
15405
|
}
|
|
@@ -15712,9 +15825,14 @@ export {
|
|
|
15712
15825
|
MenuItem,
|
|
15713
15826
|
MultiSearchWithMapping,
|
|
15714
15827
|
MultiSelect,
|
|
15828
|
+
MultiSelectButton,
|
|
15715
15829
|
MultiSelectChipDisplay,
|
|
15830
|
+
MultiSelectChipDisplayButton,
|
|
15716
15831
|
MultiSelectChipDisplayUncontrolled,
|
|
15832
|
+
MultiSelectContent,
|
|
15833
|
+
MultiSelectOption,
|
|
15717
15834
|
MultiSelectProperty,
|
|
15835
|
+
MultiSelectRoot,
|
|
15718
15836
|
MultiSelectUncontrolled,
|
|
15719
15837
|
MultiSubjectSearchWithMapping,
|
|
15720
15838
|
Navigation,
|
|
@@ -15732,8 +15850,8 @@ export {
|
|
|
15732
15850
|
SearchBar,
|
|
15733
15851
|
Select,
|
|
15734
15852
|
SelectButton,
|
|
15735
|
-
SelectChipDisplay,
|
|
15736
15853
|
SelectContent,
|
|
15854
|
+
SelectContext,
|
|
15737
15855
|
SelectOption,
|
|
15738
15856
|
SelectRoot,
|
|
15739
15857
|
SelectUncontrolled,
|
|
@@ -15822,6 +15940,7 @@ export {
|
|
|
15822
15940
|
useRerender,
|
|
15823
15941
|
useResizeCallbackWrapper,
|
|
15824
15942
|
useSearch,
|
|
15943
|
+
useSelectContext,
|
|
15825
15944
|
useTabContext,
|
|
15826
15945
|
useTheme,
|
|
15827
15946
|
useTransitionState,
|