@helpwave/hightide 0.6.1 → 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 +349 -204
- package/dist/index.d.ts +349 -204
- package/dist/index.js +884 -745
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +771 -647
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6323,9 +6323,14 @@ __export(index_exports, {
|
|
|
6323
6323
|
MenuItem: () => MenuItem,
|
|
6324
6324
|
MultiSearchWithMapping: () => MultiSearchWithMapping,
|
|
6325
6325
|
MultiSelect: () => MultiSelect,
|
|
6326
|
+
MultiSelectButton: () => MultiSelectButton,
|
|
6326
6327
|
MultiSelectChipDisplay: () => MultiSelectChipDisplay,
|
|
6328
|
+
MultiSelectChipDisplayButton: () => MultiSelectChipDisplayButton,
|
|
6327
6329
|
MultiSelectChipDisplayUncontrolled: () => MultiSelectChipDisplayUncontrolled,
|
|
6330
|
+
MultiSelectContent: () => MultiSelectContent,
|
|
6331
|
+
MultiSelectOption: () => MultiSelectOption,
|
|
6328
6332
|
MultiSelectProperty: () => MultiSelectProperty,
|
|
6333
|
+
MultiSelectRoot: () => MultiSelectRoot,
|
|
6329
6334
|
MultiSelectUncontrolled: () => MultiSelectUncontrolled,
|
|
6330
6335
|
MultiSubjectSearchWithMapping: () => MultiSubjectSearchWithMapping,
|
|
6331
6336
|
Navigation: () => Navigation,
|
|
@@ -6343,8 +6348,8 @@ __export(index_exports, {
|
|
|
6343
6348
|
SearchBar: () => SearchBar,
|
|
6344
6349
|
Select: () => Select,
|
|
6345
6350
|
SelectButton: () => SelectButton,
|
|
6346
|
-
SelectChipDisplay: () => SelectChipDisplay,
|
|
6347
6351
|
SelectContent: () => SelectContent,
|
|
6352
|
+
SelectContext: () => SelectContext,
|
|
6348
6353
|
SelectOption: () => SelectOption,
|
|
6349
6354
|
SelectRoot: () => SelectRoot,
|
|
6350
6355
|
SelectUncontrolled: () => SelectUncontrolled,
|
|
@@ -6433,6 +6438,7 @@ __export(index_exports, {
|
|
|
6433
6438
|
useRerender: () => useRerender,
|
|
6434
6439
|
useResizeCallbackWrapper: () => useResizeCallbackWrapper,
|
|
6435
6440
|
useSearch: () => useSearch,
|
|
6441
|
+
useSelectContext: () => useSelectContext,
|
|
6436
6442
|
useTabContext: () => useTabContext,
|
|
6437
6443
|
useTheme: () => useTheme,
|
|
6438
6444
|
useTransitionState: () => useTransitionState,
|
|
@@ -7457,7 +7463,7 @@ function useForm() {
|
|
|
7457
7463
|
if (!ctx) throw new Error("FormContext is only available inside a <Form>");
|
|
7458
7464
|
return ctx;
|
|
7459
7465
|
}
|
|
7460
|
-
function useFormField(key) {
|
|
7466
|
+
function useFormField(key, { triggerUpdate = true }) {
|
|
7461
7467
|
const context = (0, import_react6.useContext)(FormContext);
|
|
7462
7468
|
const subscribe = (0, import_react6.useCallback)((cb) => {
|
|
7463
7469
|
if (!context) return () => {
|
|
@@ -7472,20 +7478,31 @@ function useFormField(key) {
|
|
|
7472
7478
|
subscribe,
|
|
7473
7479
|
() => context ? context.store.getError(key) : void 0
|
|
7474
7480
|
);
|
|
7481
|
+
const getDataProps = (0, import_react6.useCallback)(() => {
|
|
7482
|
+
return {
|
|
7483
|
+
value: context ? context.store.getValue(key) : void 0,
|
|
7484
|
+
onValueChange: (val) => context?.store.setValue(key, val),
|
|
7485
|
+
onEditComplete: (val) => {
|
|
7486
|
+
context?.store.setTouched(key);
|
|
7487
|
+
context?.store.setValue(key, val, triggerUpdate);
|
|
7488
|
+
}
|
|
7489
|
+
};
|
|
7490
|
+
}, [context, key, triggerUpdate]);
|
|
7475
7491
|
if (!context) return null;
|
|
7476
|
-
const { registerRef
|
|
7492
|
+
const { registerRef } = context;
|
|
7477
7493
|
return {
|
|
7494
|
+
store: context.store,
|
|
7478
7495
|
value,
|
|
7479
7496
|
error,
|
|
7480
|
-
dataProps: getDataProps(
|
|
7497
|
+
dataProps: getDataProps(),
|
|
7481
7498
|
registerRef: registerRef(key)
|
|
7482
7499
|
};
|
|
7483
7500
|
}
|
|
7484
7501
|
|
|
7485
7502
|
// src/components/form/FormField.tsx
|
|
7486
7503
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
7487
|
-
var FormField = ({ children, name: name2, ...props }) => {
|
|
7488
|
-
const formField = useFormField(name2);
|
|
7504
|
+
var FormField = ({ children, name: name2, triggerUpdateOnEditComplete, ...props }) => {
|
|
7505
|
+
const formField = useFormField(name2, { triggerUpdate: triggerUpdateOnEditComplete });
|
|
7489
7506
|
if (!formField) {
|
|
7490
7507
|
throw new Error("<FormField> can only be used inside a FormContext try wrapping your app in a <FormProvider>");
|
|
7491
7508
|
}
|
|
@@ -7496,7 +7513,10 @@ var FormField = ({ children, name: name2, ...props }) => {
|
|
|
7496
7513
|
...formFieldLayoutBag.ariaAttributes,
|
|
7497
7514
|
ref: formField.registerRef
|
|
7498
7515
|
},
|
|
7499
|
-
interactionStates: formFieldLayoutBag.interactionStates
|
|
7516
|
+
interactionStates: formFieldLayoutBag.interactionStates,
|
|
7517
|
+
other: {
|
|
7518
|
+
updateValue: (value) => formField.store.setValue(name2, value, true)
|
|
7519
|
+
}
|
|
7500
7520
|
}) });
|
|
7501
7521
|
};
|
|
7502
7522
|
|
|
@@ -7505,6 +7525,7 @@ var FormStore = class {
|
|
|
7505
7525
|
constructor({
|
|
7506
7526
|
initialValues,
|
|
7507
7527
|
hasTriedSubmitting,
|
|
7528
|
+
submittingTouchesAll = true,
|
|
7508
7529
|
validators = {},
|
|
7509
7530
|
validationBehaviour = "touched"
|
|
7510
7531
|
}) {
|
|
@@ -7512,9 +7533,16 @@ var FormStore = class {
|
|
|
7512
7533
|
this.errors = {};
|
|
7513
7534
|
this.touched = {};
|
|
7514
7535
|
this.listeners = /* @__PURE__ */ new Map();
|
|
7536
|
+
this.submittingTouchesAll = false;
|
|
7515
7537
|
this.initialValues = initialValues;
|
|
7516
7538
|
this.values = { ...initialValues };
|
|
7517
7539
|
this.hasTriedSubmitting = hasTriedSubmitting;
|
|
7540
|
+
this.submittingTouchesAll = submittingTouchesAll;
|
|
7541
|
+
if (this.submittingTouchesAll && this.hasTriedSubmitting) {
|
|
7542
|
+
Object.keys(this.initialValues).forEach((key) => {
|
|
7543
|
+
this.touched[key] = true;
|
|
7544
|
+
});
|
|
7545
|
+
}
|
|
7518
7546
|
this.validators = validators;
|
|
7519
7547
|
this.validationBehaviour = validationBehaviour;
|
|
7520
7548
|
this.validateAll();
|
|
@@ -7526,14 +7554,37 @@ var FormStore = class {
|
|
|
7526
7554
|
getAllValues() {
|
|
7527
7555
|
return { ...this.values };
|
|
7528
7556
|
}
|
|
7529
|
-
setValue(key, value) {
|
|
7530
|
-
if (this.values[key]
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
|
|
7557
|
+
setValue(key, value, triggerUpdate = false) {
|
|
7558
|
+
if (this.values[key] !== value) {
|
|
7559
|
+
this.values[key] = value;
|
|
7560
|
+
this.validate(key);
|
|
7561
|
+
this.notify({ type: "onChange", key, value, values: this.values });
|
|
7562
|
+
}
|
|
7563
|
+
if (triggerUpdate) {
|
|
7564
|
+
this.notify({
|
|
7565
|
+
type: "onUpdate",
|
|
7566
|
+
key: "ALL",
|
|
7567
|
+
updatedKeys: [key],
|
|
7568
|
+
update: { [key]: value },
|
|
7569
|
+
values: this.values,
|
|
7570
|
+
hasErrors: this.getHasError(),
|
|
7571
|
+
errors: this.getErrors()
|
|
7572
|
+
});
|
|
7573
|
+
}
|
|
7534
7574
|
}
|
|
7535
|
-
setValues(values) {
|
|
7575
|
+
setValues(values, triggerUpdate = false) {
|
|
7536
7576
|
Object.keys(values).forEach((key) => this.setValue(key, values[key]));
|
|
7577
|
+
if (triggerUpdate) {
|
|
7578
|
+
this.notify({
|
|
7579
|
+
type: "onUpdate",
|
|
7580
|
+
key: "ALL",
|
|
7581
|
+
updatedKeys: Object.keys(values),
|
|
7582
|
+
update: { ...values },
|
|
7583
|
+
values: this.values,
|
|
7584
|
+
hasErrors: this.getHasError(),
|
|
7585
|
+
errors: this.getErrors()
|
|
7586
|
+
});
|
|
7587
|
+
}
|
|
7537
7588
|
}
|
|
7538
7589
|
// Touched
|
|
7539
7590
|
getTouched(key) {
|
|
@@ -7543,11 +7594,15 @@ var FormStore = class {
|
|
|
7543
7594
|
if (this.touched[key] === isTouched) return;
|
|
7544
7595
|
this.touched[key] = isTouched;
|
|
7545
7596
|
this.validate(key);
|
|
7597
|
+
this.notify({ type: "onTouched", key, value: this.values[key], values: { ...this.values } });
|
|
7546
7598
|
}
|
|
7547
7599
|
// Error and Validation
|
|
7548
7600
|
getHasError() {
|
|
7549
7601
|
return Object.values(this.errors).some((value) => value !== void 0 && value !== null);
|
|
7550
7602
|
}
|
|
7603
|
+
getErrors() {
|
|
7604
|
+
return { ...this.errors };
|
|
7605
|
+
}
|
|
7551
7606
|
getError(key) {
|
|
7552
7607
|
return this.errors[key];
|
|
7553
7608
|
}
|
|
@@ -7558,7 +7613,7 @@ var FormStore = class {
|
|
|
7558
7613
|
} else {
|
|
7559
7614
|
this.errors[key] = error;
|
|
7560
7615
|
}
|
|
7561
|
-
this.notify({ type: "onError", key, value: this.values[key], error });
|
|
7616
|
+
this.notify({ type: "onError", key, value: this.values[key], error, values: { ...this.values } });
|
|
7562
7617
|
}
|
|
7563
7618
|
changeValidationBehavoir(validationBehaviour) {
|
|
7564
7619
|
if (validationBehaviour === this.validationBehaviour) return;
|
|
@@ -7607,35 +7662,30 @@ var FormStore = class {
|
|
|
7607
7662
|
// Form
|
|
7608
7663
|
submit() {
|
|
7609
7664
|
this.hasTriedSubmitting = true;
|
|
7610
|
-
|
|
7611
|
-
this.
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
const hasErrors = Object.keys(this.errors).length > 0;
|
|
7615
|
-
if (hasErrors) {
|
|
7616
|
-
this.notify({
|
|
7617
|
-
type: "submitError",
|
|
7618
|
-
key: "ALL",
|
|
7619
|
-
errors: this.errors,
|
|
7620
|
-
values: this.values
|
|
7621
|
-
});
|
|
7622
|
-
} else {
|
|
7623
|
-
this.notify({
|
|
7624
|
-
type: "submit",
|
|
7625
|
-
key: "ALL",
|
|
7626
|
-
values: this.values
|
|
7665
|
+
if (this.submittingTouchesAll) {
|
|
7666
|
+
Object.keys(this.initialValues).forEach((k) => {
|
|
7667
|
+
this.touched[k] = true;
|
|
7668
|
+
this.validate(k);
|
|
7627
7669
|
});
|
|
7628
7670
|
}
|
|
7671
|
+
const hasErrors = Object.keys(this.errors).length > 0;
|
|
7672
|
+
this.notify({
|
|
7673
|
+
type: "onSubmit",
|
|
7674
|
+
key: "ALL",
|
|
7675
|
+
hasErrors,
|
|
7676
|
+
errors: { ...this.errors },
|
|
7677
|
+
values: { ...this.values }
|
|
7678
|
+
});
|
|
7629
7679
|
}
|
|
7630
7680
|
reset() {
|
|
7631
7681
|
this.values = { ...this.initialValues };
|
|
7632
7682
|
this.hasTriedSubmitting = false;
|
|
7633
7683
|
this.touched = {};
|
|
7634
7684
|
Object.keys(this.initialValues).forEach((key) => {
|
|
7635
|
-
this.notify({ type: "onChange", key, value: this.values[key] });
|
|
7685
|
+
this.notify({ type: "onChange", key, value: this.values[key], values: { ...this.values } });
|
|
7636
7686
|
});
|
|
7637
7687
|
this.validateAll();
|
|
7638
|
-
this.notify({ type: "reset", key: "ALL", values: this.values, errors: this.errors });
|
|
7688
|
+
this.notify({ type: "reset", key: "ALL", values: { ...this.values }, errors: { ...this.errors } });
|
|
7639
7689
|
}
|
|
7640
7690
|
};
|
|
7641
7691
|
|
|
@@ -7645,6 +7695,8 @@ function useCreateForm({
|
|
|
7645
7695
|
onFormSubmit,
|
|
7646
7696
|
onFormError,
|
|
7647
7697
|
onValueChange,
|
|
7698
|
+
onUpdate,
|
|
7699
|
+
onValidUpdate,
|
|
7648
7700
|
initialValues,
|
|
7649
7701
|
hasTriedSubmitting,
|
|
7650
7702
|
validators,
|
|
@@ -7674,22 +7726,24 @@ function useCreateForm({
|
|
|
7674
7726
|
}, []);
|
|
7675
7727
|
(0, import_react7.useEffect)(() => {
|
|
7676
7728
|
const handleUpdate = (event) => {
|
|
7677
|
-
if (event.type === "
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7729
|
+
if (event.type === "onSubmit") {
|
|
7730
|
+
if (event.hasErrors) {
|
|
7731
|
+
onFormError?.(event.values, event.errors);
|
|
7732
|
+
if (scrollToElements) {
|
|
7733
|
+
const errorInputs = Object.keys(event.errors).filter((key) => event.errors[key]).map((key) => fieldRefs.current[key]).filter((el) => el !== null && el !== void 0);
|
|
7734
|
+
if (errorInputs.length > 0) {
|
|
7735
|
+
errorInputs.sort((a, b) => {
|
|
7736
|
+
const position = a.compareDocumentPosition(b);
|
|
7737
|
+
if (position & Node.DOCUMENT_POSITION_FOLLOWING) return -1;
|
|
7738
|
+
if (position & Node.DOCUMENT_POSITION_PRECEDING) return 1;
|
|
7739
|
+
return 0;
|
|
7740
|
+
});
|
|
7741
|
+
errorInputs[0].scrollIntoView(scrollOptions);
|
|
7742
|
+
errorInputs[0].focus();
|
|
7743
|
+
}
|
|
7692
7744
|
}
|
|
7745
|
+
} else {
|
|
7746
|
+
onFormSubmit(event.values);
|
|
7693
7747
|
}
|
|
7694
7748
|
} else if (event.type === "reset") {
|
|
7695
7749
|
if (scrollToElements) {
|
|
@@ -7709,23 +7763,18 @@ function useCreateForm({
|
|
|
7709
7763
|
}
|
|
7710
7764
|
} else if (event.type === "onChange") {
|
|
7711
7765
|
onValueChange?.(storeRef.current.getAllValues());
|
|
7766
|
+
} else if (event.type === "onUpdate") {
|
|
7767
|
+
onUpdate?.(event.updatedKeys, event.update);
|
|
7768
|
+
if (!event.hasErrors) {
|
|
7769
|
+
onValidUpdate?.(event.updatedKeys, event.update);
|
|
7770
|
+
}
|
|
7712
7771
|
}
|
|
7713
7772
|
};
|
|
7714
7773
|
const unsubscribe = storeRef.current.subscribe("ALL", handleUpdate);
|
|
7715
7774
|
return () => {
|
|
7716
7775
|
unsubscribe();
|
|
7717
7776
|
};
|
|
7718
|
-
}, [onFormError, onFormSubmit, onValueChange, scrollOptions, scrollToElements]);
|
|
7719
|
-
const getDataProps = (0, import_react7.useCallback)((key) => {
|
|
7720
|
-
return {
|
|
7721
|
-
value: storeRef.current.getValue(key),
|
|
7722
|
-
onValueChange: (val) => storeRef.current.setValue(key, val),
|
|
7723
|
-
onEditComplete: (val) => {
|
|
7724
|
-
storeRef.current.setValue(key, val);
|
|
7725
|
-
storeRef.current.setTouched(key);
|
|
7726
|
-
}
|
|
7727
|
-
};
|
|
7728
|
-
}, []);
|
|
7777
|
+
}, [onFormError, onFormSubmit, onUpdate, onValidUpdate, onValueChange, scrollOptions, scrollToElements]);
|
|
7729
7778
|
const callbacks = (0, import_react7.useMemo)(() => ({
|
|
7730
7779
|
reset: () => storeRef.current.reset(),
|
|
7731
7780
|
submit: () => storeRef.current.submit(),
|
|
@@ -7738,13 +7787,14 @@ function useCreateForm({
|
|
|
7738
7787
|
},
|
|
7739
7788
|
validateAll: () => storeRef.current.validateAll(),
|
|
7740
7789
|
getError: (key) => storeRef.current.getError(key),
|
|
7741
|
-
|
|
7742
|
-
|
|
7790
|
+
getErrors: () => storeRef.current.getErrors(),
|
|
7791
|
+
getIsValid: () => !storeRef.current.getHasError(),
|
|
7792
|
+
getValue: (key) => storeRef.current.getValue(key),
|
|
7793
|
+
getValues: () => storeRef.current.getAllValues()
|
|
7743
7794
|
}), []);
|
|
7744
7795
|
return {
|
|
7745
7796
|
store: storeRef.current,
|
|
7746
7797
|
...callbacks,
|
|
7747
|
-
getDataProps,
|
|
7748
7798
|
registerRef
|
|
7749
7799
|
};
|
|
7750
7800
|
}
|
|
@@ -9502,7 +9552,6 @@ var Expandable = (0, import_react21.forwardRef)(function Expandable2({
|
|
|
9502
9552
|
children,
|
|
9503
9553
|
id,
|
|
9504
9554
|
label,
|
|
9505
|
-
icon,
|
|
9506
9555
|
isExpanded,
|
|
9507
9556
|
onChange,
|
|
9508
9557
|
clickOnlyOnHeader = true,
|
|
@@ -9512,8 +9561,6 @@ var Expandable = (0, import_react21.forwardRef)(function Expandable2({
|
|
|
9512
9561
|
contentClassName,
|
|
9513
9562
|
contentExpandedClassName
|
|
9514
9563
|
}, ref) {
|
|
9515
|
-
const defaultIcon = (0, import_react21.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
|
|
9516
|
-
const iconBuilder = icon ?? defaultIcon;
|
|
9517
9564
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
9518
9565
|
ExpandableRoot,
|
|
9519
9566
|
{
|
|
@@ -9525,10 +9572,7 @@ var Expandable = (0, import_react21.forwardRef)(function Expandable2({
|
|
|
9525
9572
|
allowContainerToggle: !clickOnlyOnHeader,
|
|
9526
9573
|
className,
|
|
9527
9574
|
children: [
|
|
9528
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.
|
|
9529
|
-
label,
|
|
9530
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExpandableContext.Consumer, { children: (ctx) => iconBuilder(ctx?.isExpanded ?? false) })
|
|
9531
|
-
] }),
|
|
9575
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExpandableHeader, { className: headerClassName, children: label }),
|
|
9532
9576
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExpandableContext.Consumer, { children: (ctx) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
9533
9577
|
ExpandableContent,
|
|
9534
9578
|
{
|
|
@@ -9716,9 +9760,9 @@ var FloatingContainer = (0, import_react23.forwardRef)(function FloatingContaine
|
|
|
9716
9760
|
screenPadding = 16,
|
|
9717
9761
|
gap = 4,
|
|
9718
9762
|
...props
|
|
9719
|
-
},
|
|
9763
|
+
}, forwardRef16) {
|
|
9720
9764
|
const innerRef = (0, import_react23.useRef)(null);
|
|
9721
|
-
(0, import_react23.useImperativeHandle)(
|
|
9765
|
+
(0, import_react23.useImperativeHandle)(forwardRef16, () => innerRef.current);
|
|
9722
9766
|
const position = useFloatingElement({
|
|
9723
9767
|
active: !props.hidden,
|
|
9724
9768
|
containerRef: innerRef,
|
|
@@ -11050,11 +11094,8 @@ var InputDialog = ({
|
|
|
11050
11094
|
);
|
|
11051
11095
|
};
|
|
11052
11096
|
|
|
11053
|
-
// src/components/user-interaction/
|
|
11097
|
+
// src/components/user-interaction/select/SelectContext.tsx
|
|
11054
11098
|
var import_react34 = require("react");
|
|
11055
|
-
var import_clsx13 = __toESM(require("clsx"));
|
|
11056
|
-
var import_lucide_react7 = require("lucide-react");
|
|
11057
|
-
var import_react_dom5 = require("react-dom");
|
|
11058
11099
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
11059
11100
|
var defaultToggleOpenOptions = {
|
|
11060
11101
|
highlightStartPositionBehavior: "first"
|
|
@@ -11063,28 +11104,34 @@ var SelectContext = (0, import_react34.createContext)(null);
|
|
|
11063
11104
|
function useSelectContext() {
|
|
11064
11105
|
const ctx = (0, import_react34.useContext)(SelectContext);
|
|
11065
11106
|
if (!ctx) {
|
|
11066
|
-
throw new Error("
|
|
11107
|
+
throw new Error("useSelectContext must be used within a SelectRoot or MultiSelectRoot");
|
|
11067
11108
|
}
|
|
11068
11109
|
return ctx;
|
|
11069
11110
|
}
|
|
11070
|
-
var
|
|
11111
|
+
var PrimitveSelectRoot = ({
|
|
11071
11112
|
children,
|
|
11072
11113
|
id,
|
|
11073
11114
|
value,
|
|
11074
11115
|
onValueChange,
|
|
11075
11116
|
values,
|
|
11076
11117
|
onValuesChange,
|
|
11077
|
-
|
|
11118
|
+
onClose,
|
|
11119
|
+
initialIsOpen = false,
|
|
11078
11120
|
disabled = false,
|
|
11121
|
+
readOnly = false,
|
|
11122
|
+
required = false,
|
|
11079
11123
|
invalid = false,
|
|
11080
11124
|
isMultiSelect = false,
|
|
11081
11125
|
iconAppearance = "left"
|
|
11082
11126
|
}) => {
|
|
11083
11127
|
const triggerRef = (0, import_react34.useRef)(null);
|
|
11084
11128
|
const generatedId = (0, import_react34.useId)();
|
|
11085
|
-
const
|
|
11129
|
+
const [ids, setIds] = (0, import_react34.useState)({
|
|
11130
|
+
trigger: id ?? (isMultiSelect ? "multi-select-" + generatedId : "select-" + generatedId),
|
|
11131
|
+
content: isMultiSelect ? "multi-select-content-" + generatedId : "select-content-" + generatedId
|
|
11132
|
+
});
|
|
11086
11133
|
const [internalState, setInternalState] = (0, import_react34.useState)({
|
|
11087
|
-
isOpen,
|
|
11134
|
+
isOpen: initialIsOpen,
|
|
11088
11135
|
options: []
|
|
11089
11136
|
});
|
|
11090
11137
|
const selectedValues = (0, import_react34.useMemo)(
|
|
@@ -11097,9 +11144,10 @@ var SelectRoot = ({
|
|
|
11097
11144
|
);
|
|
11098
11145
|
const state = {
|
|
11099
11146
|
...internalState,
|
|
11100
|
-
id: usedId,
|
|
11101
11147
|
disabled,
|
|
11102
11148
|
invalid,
|
|
11149
|
+
readOnly,
|
|
11150
|
+
required,
|
|
11103
11151
|
value: selectedValues,
|
|
11104
11152
|
selectedOptions
|
|
11105
11153
|
};
|
|
@@ -11177,7 +11225,7 @@ var SelectRoot = ({
|
|
|
11177
11225
|
const unregisterTrigger = (0, import_react34.useCallback)(() => {
|
|
11178
11226
|
triggerRef.current = null;
|
|
11179
11227
|
}, []);
|
|
11180
|
-
const toggleOpen = (
|
|
11228
|
+
const toggleOpen = (isOpen, toggleOpenOptions) => {
|
|
11181
11229
|
const { highlightStartPositionBehavior } = { ...defaultToggleOpenOptions, ...toggleOpenOptions };
|
|
11182
11230
|
let firstSelectedValue;
|
|
11183
11231
|
let firstEnabledValue;
|
|
@@ -11193,11 +11241,15 @@ var SelectRoot = ({
|
|
|
11193
11241
|
}
|
|
11194
11242
|
}
|
|
11195
11243
|
}
|
|
11244
|
+
const newIsOpen = isOpen ?? !internalState.isOpen;
|
|
11196
11245
|
setInternalState((prevState) => ({
|
|
11197
11246
|
...prevState,
|
|
11198
|
-
isOpen:
|
|
11247
|
+
isOpen: newIsOpen,
|
|
11199
11248
|
highlightedValue: firstSelectedValue ?? firstEnabledValue
|
|
11200
11249
|
}));
|
|
11250
|
+
if (!newIsOpen) {
|
|
11251
|
+
onClose?.();
|
|
11252
|
+
}
|
|
11201
11253
|
};
|
|
11202
11254
|
const moveHighlightedIndex = (delta) => {
|
|
11203
11255
|
let highlightedIndex = state.options.findIndex((value2) => value2.value === internalState.highlightedValue);
|
|
@@ -11230,6 +11282,8 @@ var SelectRoot = ({
|
|
|
11230
11282
|
}
|
|
11231
11283
|
}, [internalState.highlightedValue]);
|
|
11232
11284
|
const contextValue = {
|
|
11285
|
+
ids,
|
|
11286
|
+
setIds,
|
|
11233
11287
|
state,
|
|
11234
11288
|
config,
|
|
11235
11289
|
item: {
|
|
@@ -11248,14 +11302,52 @@ var SelectRoot = ({
|
|
|
11248
11302
|
};
|
|
11249
11303
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectContext.Provider, { value: contextValue, children });
|
|
11250
11304
|
};
|
|
11251
|
-
var
|
|
11305
|
+
var SelectRoot = ({ value, onValueChange, onEditComplete, ...props }) => {
|
|
11306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11307
|
+
PrimitveSelectRoot,
|
|
11308
|
+
{
|
|
11309
|
+
...props,
|
|
11310
|
+
isMultiSelect: false,
|
|
11311
|
+
value,
|
|
11312
|
+
onValueChange: (value2) => {
|
|
11313
|
+
onValueChange?.(value2);
|
|
11314
|
+
onEditComplete?.(value2);
|
|
11315
|
+
}
|
|
11316
|
+
}
|
|
11317
|
+
);
|
|
11318
|
+
};
|
|
11319
|
+
var MultiSelectRoot = ({ value, onValueChange, onEditComplete, ...props }) => {
|
|
11320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11321
|
+
PrimitveSelectRoot,
|
|
11322
|
+
{
|
|
11323
|
+
...props,
|
|
11324
|
+
isMultiSelect: true,
|
|
11325
|
+
values: value,
|
|
11326
|
+
onValuesChange: (values) => {
|
|
11327
|
+
onValueChange?.(values);
|
|
11328
|
+
},
|
|
11329
|
+
onClose: () => {
|
|
11330
|
+
onEditComplete?.(value);
|
|
11331
|
+
props.onClose?.();
|
|
11332
|
+
}
|
|
11333
|
+
}
|
|
11334
|
+
);
|
|
11335
|
+
};
|
|
11336
|
+
|
|
11337
|
+
// src/components/user-interaction/select/SelectComponents.tsx
|
|
11338
|
+
var import_react35 = require("react");
|
|
11339
|
+
var import_clsx13 = __toESM(require("clsx"));
|
|
11340
|
+
var import_lucide_react7 = require("lucide-react");
|
|
11341
|
+
var import_react_dom5 = require("react-dom");
|
|
11342
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
11343
|
+
var SelectOption = (0, import_react35.forwardRef)(
|
|
11252
11344
|
function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
|
|
11253
11345
|
const { state, config, item, trigger } = useSelectContext();
|
|
11254
11346
|
const { register, unregister, toggleSelection, highlightItem } = item;
|
|
11255
|
-
const itemRef = (0,
|
|
11347
|
+
const itemRef = (0, import_react35.useRef)(null);
|
|
11256
11348
|
iconAppearance ??= config.iconAppearance;
|
|
11257
11349
|
const label = children ?? value;
|
|
11258
|
-
(0,
|
|
11350
|
+
(0, import_react35.useEffect)(() => {
|
|
11259
11351
|
register({
|
|
11260
11352
|
value,
|
|
11261
11353
|
label,
|
|
@@ -11266,7 +11358,7 @@ var SelectOption = (0, import_react34.forwardRef)(
|
|
|
11266
11358
|
}, [value, disabled, register, unregister, children, label]);
|
|
11267
11359
|
const isHighlighted = state.highlightedValue === value;
|
|
11268
11360
|
const isSelected = state.value.includes(value);
|
|
11269
|
-
return /* @__PURE__ */ (0,
|
|
11361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
11270
11362
|
"li",
|
|
11271
11363
|
{
|
|
11272
11364
|
...restProps,
|
|
@@ -11305,7 +11397,7 @@ var SelectOption = (0, import_react34.forwardRef)(
|
|
|
11305
11397
|
}
|
|
11306
11398
|
},
|
|
11307
11399
|
children: [
|
|
11308
|
-
iconAppearance === "left" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0,
|
|
11400
|
+
iconAppearance === "left" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11309
11401
|
import_lucide_react7.CheckIcon,
|
|
11310
11402
|
{
|
|
11311
11403
|
className: (0, import_clsx13.default)("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
@@ -11313,7 +11405,7 @@ var SelectOption = (0, import_react34.forwardRef)(
|
|
|
11313
11405
|
}
|
|
11314
11406
|
),
|
|
11315
11407
|
label,
|
|
11316
|
-
iconAppearance === "right" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0,
|
|
11408
|
+
iconAppearance === "right" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11317
11409
|
import_lucide_react7.CheckIcon,
|
|
11318
11410
|
{
|
|
11319
11411
|
className: (0, import_clsx13.default)("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
@@ -11325,25 +11417,38 @@ var SelectOption = (0, import_react34.forwardRef)(
|
|
|
11325
11417
|
);
|
|
11326
11418
|
}
|
|
11327
11419
|
);
|
|
11328
|
-
var SelectButton = (0,
|
|
11420
|
+
var SelectButton = (0, import_react35.forwardRef)(function SelectButton2({
|
|
11421
|
+
id,
|
|
11422
|
+
placeholder,
|
|
11423
|
+
selectedDisplay,
|
|
11424
|
+
...props
|
|
11425
|
+
}, ref) {
|
|
11329
11426
|
const translation = useHightideTranslation();
|
|
11330
|
-
const { state, trigger } = useSelectContext();
|
|
11427
|
+
const { state, trigger, setIds, ids } = useSelectContext();
|
|
11331
11428
|
const { register, unregister, toggleOpen } = trigger;
|
|
11332
|
-
|
|
11333
|
-
|
|
11334
|
-
|
|
11429
|
+
(0, import_react35.useEffect)(() => {
|
|
11430
|
+
if (id) {
|
|
11431
|
+
setIds((prev) => ({
|
|
11432
|
+
...prev,
|
|
11433
|
+
trigger: id
|
|
11434
|
+
}));
|
|
11435
|
+
}
|
|
11436
|
+
}, [id, setIds]);
|
|
11437
|
+
const innerRef = (0, import_react35.useRef)(null);
|
|
11438
|
+
(0, import_react35.useImperativeHandle)(ref, () => innerRef.current);
|
|
11439
|
+
(0, import_react35.useEffect)(() => {
|
|
11335
11440
|
register(innerRef);
|
|
11336
11441
|
return () => unregister();
|
|
11337
11442
|
}, [register, unregister]);
|
|
11338
11443
|
const disabled = !!props?.disabled || !!state.disabled;
|
|
11339
11444
|
const invalid = state.invalid;
|
|
11340
11445
|
const hasValue = state.value.length > 0;
|
|
11341
|
-
return /* @__PURE__ */ (0,
|
|
11446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
11342
11447
|
"button",
|
|
11343
11448
|
{
|
|
11344
11449
|
...props,
|
|
11345
11450
|
ref: innerRef,
|
|
11346
|
-
id:
|
|
11451
|
+
id: ids.trigger,
|
|
11347
11452
|
disabled,
|
|
11348
11453
|
type: "button",
|
|
11349
11454
|
onClick: (event) => {
|
|
@@ -11373,29 +11478,188 @@ var SelectButton = (0, import_react34.forwardRef)(function SelectButton2({ place
|
|
|
11373
11478
|
"aria-disabled": disabled,
|
|
11374
11479
|
"aria-haspopup": "listbox",
|
|
11375
11480
|
"aria-expanded": state.isOpen,
|
|
11376
|
-
"aria-controls": state.isOpen ?
|
|
11481
|
+
"aria-controls": state.isOpen ? ids.content : void 0,
|
|
11377
11482
|
children: [
|
|
11378
|
-
hasValue ? selectedDisplay?.(state.value) ?? /* @__PURE__ */ (0,
|
|
11483
|
+
hasValue ? selectedDisplay?.(state.value) ?? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: (0, import_clsx13.default)("flex flex-wrap gap-x-1 gap-y-2"), children: state.selectedOptions.map(({ value, label }, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "flex-row-0", children: [
|
|
11379
11484
|
label,
|
|
11380
|
-
index < state.value.length - 1 && /* @__PURE__ */ (0,
|
|
11485
|
+
index < state.value.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "," })
|
|
11381
11486
|
] }, value)) }) : placeholder ?? translation("clickToSelect"),
|
|
11382
|
-
/* @__PURE__ */ (0,
|
|
11487
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ExpansionIcon, { isExpanded: state.isOpen })
|
|
11383
11488
|
]
|
|
11384
11489
|
}
|
|
11385
11490
|
);
|
|
11386
11491
|
});
|
|
11387
|
-
var
|
|
11388
|
-
|
|
11492
|
+
var SelectContent = (0, import_react35.forwardRef)(function SelectContent2({
|
|
11493
|
+
id,
|
|
11494
|
+
alignment,
|
|
11495
|
+
orientation = "vertical",
|
|
11496
|
+
containerClassName,
|
|
11497
|
+
...props
|
|
11498
|
+
}, ref) {
|
|
11499
|
+
const innerRef = (0, import_react35.useRef)(null);
|
|
11500
|
+
(0, import_react35.useImperativeHandle)(ref, () => innerRef.current);
|
|
11501
|
+
const { trigger, state, config, item, ids, setIds } = useSelectContext();
|
|
11502
|
+
(0, import_react35.useEffect)(() => {
|
|
11503
|
+
if (id) {
|
|
11504
|
+
setIds((prev) => ({
|
|
11505
|
+
...prev,
|
|
11506
|
+
content: id
|
|
11507
|
+
}));
|
|
11508
|
+
}
|
|
11509
|
+
}, [id, setIds]);
|
|
11510
|
+
const position = useFloatingElement({
|
|
11511
|
+
active: state.isOpen,
|
|
11512
|
+
anchorRef: trigger.ref,
|
|
11513
|
+
containerRef: innerRef,
|
|
11514
|
+
...alignment
|
|
11515
|
+
});
|
|
11516
|
+
useFocusTrap({
|
|
11517
|
+
container: innerRef,
|
|
11518
|
+
active: state.isOpen && !!position
|
|
11519
|
+
});
|
|
11520
|
+
const { zIndex } = useOverlayRegistry({ isActive: state.isOpen });
|
|
11521
|
+
return (0, import_react_dom5.createPortal)(
|
|
11522
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
11523
|
+
"div",
|
|
11524
|
+
{
|
|
11525
|
+
id: ids.content,
|
|
11526
|
+
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen", containerClassName),
|
|
11527
|
+
style: { zIndex },
|
|
11528
|
+
hidden: !state.isOpen,
|
|
11529
|
+
children: [
|
|
11530
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11531
|
+
"div",
|
|
11532
|
+
{
|
|
11533
|
+
onClick: () => trigger.toggleOpen(false),
|
|
11534
|
+
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen")
|
|
11535
|
+
}
|
|
11536
|
+
),
|
|
11537
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11538
|
+
"ul",
|
|
11539
|
+
{
|
|
11540
|
+
...props,
|
|
11541
|
+
ref: innerRef,
|
|
11542
|
+
onKeyDown: (event) => {
|
|
11543
|
+
switch (event.key) {
|
|
11544
|
+
case "Escape":
|
|
11545
|
+
trigger.toggleOpen(false);
|
|
11546
|
+
event.preventDefault();
|
|
11547
|
+
event.stopPropagation();
|
|
11548
|
+
break;
|
|
11549
|
+
case match(orientation, {
|
|
11550
|
+
vertical: "ArrowDown",
|
|
11551
|
+
horizontal: "ArrowUp"
|
|
11552
|
+
}):
|
|
11553
|
+
item.moveHighlightedIndex(1);
|
|
11554
|
+
event.preventDefault();
|
|
11555
|
+
break;
|
|
11556
|
+
case match(orientation, {
|
|
11557
|
+
vertical: "ArrowUp",
|
|
11558
|
+
horizontal: "ArrowDown"
|
|
11559
|
+
}):
|
|
11560
|
+
item.moveHighlightedIndex(-1);
|
|
11561
|
+
event.preventDefault();
|
|
11562
|
+
break;
|
|
11563
|
+
case "Home":
|
|
11564
|
+
event.preventDefault();
|
|
11565
|
+
break;
|
|
11566
|
+
case "End":
|
|
11567
|
+
event.preventDefault();
|
|
11568
|
+
break;
|
|
11569
|
+
case "Enter":
|
|
11570
|
+
// Fall through
|
|
11571
|
+
case " ":
|
|
11572
|
+
if (state.highlightedValue) {
|
|
11573
|
+
item.toggleSelection(state.highlightedValue);
|
|
11574
|
+
if (!config.isMultiSelect) {
|
|
11575
|
+
trigger.toggleOpen(false);
|
|
11576
|
+
}
|
|
11577
|
+
event.preventDefault();
|
|
11578
|
+
}
|
|
11579
|
+
break;
|
|
11580
|
+
}
|
|
11581
|
+
},
|
|
11582
|
+
className: (0, import_clsx13.default)("flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-outline-within overflow-auto", props.className),
|
|
11583
|
+
style: {
|
|
11584
|
+
opacity: position ? void 0 : 0,
|
|
11585
|
+
position: "fixed",
|
|
11586
|
+
...position
|
|
11587
|
+
},
|
|
11588
|
+
role: "listbox",
|
|
11589
|
+
"aria-multiselectable": config.isMultiSelect,
|
|
11590
|
+
"aria-orientation": orientation,
|
|
11591
|
+
tabIndex: position ? 0 : void 0,
|
|
11592
|
+
children: props.children
|
|
11593
|
+
}
|
|
11594
|
+
)
|
|
11595
|
+
]
|
|
11596
|
+
}
|
|
11597
|
+
),
|
|
11598
|
+
document.body
|
|
11599
|
+
);
|
|
11600
|
+
});
|
|
11601
|
+
var MultiSelectOption = SelectOption;
|
|
11602
|
+
var MultiSelectContent = SelectContent;
|
|
11603
|
+
var MultiSelectButton = SelectButton;
|
|
11604
|
+
|
|
11605
|
+
// src/components/user-interaction/select/MultiSelect.tsx
|
|
11606
|
+
var import_react36 = require("react");
|
|
11607
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
11608
|
+
var MultiSelect = (0, import_react36.forwardRef)(function MultiSelect2({
|
|
11609
|
+
children,
|
|
11610
|
+
contentPanelProps,
|
|
11611
|
+
buttonProps,
|
|
11612
|
+
...props
|
|
11613
|
+
}, ref) {
|
|
11614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(MultiSelectRoot, { ...props, children: [
|
|
11615
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MultiSelectButton, { ref, ...buttonProps }),
|
|
11616
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MultiSelectContent, { ...contentPanelProps, children })
|
|
11617
|
+
] });
|
|
11618
|
+
});
|
|
11619
|
+
var MultiSelectUncontrolled = (0, import_react36.forwardRef)(function MultiSelectUncontrolled2({
|
|
11620
|
+
value: initialValue,
|
|
11621
|
+
onValueChange,
|
|
11622
|
+
...props
|
|
11623
|
+
}, ref) {
|
|
11624
|
+
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
11625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11626
|
+
MultiSelect,
|
|
11627
|
+
{
|
|
11628
|
+
...props,
|
|
11629
|
+
ref,
|
|
11630
|
+
value,
|
|
11631
|
+
onValueChange: setValue
|
|
11632
|
+
}
|
|
11633
|
+
);
|
|
11634
|
+
});
|
|
11635
|
+
|
|
11636
|
+
// src/components/user-interaction/select/MultiSelectChipDisplay.tsx
|
|
11637
|
+
var import_react37 = require("react");
|
|
11638
|
+
var import_lucide_react8 = require("lucide-react");
|
|
11639
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
11640
|
+
var MultiSelectChipDisplayButton = (0, import_react37.forwardRef)(function MultiSelectChipDisplayButton2({
|
|
11641
|
+
id,
|
|
11642
|
+
...props
|
|
11643
|
+
}, ref) {
|
|
11644
|
+
const { state, trigger, item, ids, setIds } = useSelectContext();
|
|
11389
11645
|
const { register, unregister, toggleOpen } = trigger;
|
|
11390
|
-
|
|
11391
|
-
|
|
11392
|
-
|
|
11646
|
+
(0, import_react37.useEffect)(() => {
|
|
11647
|
+
if (id) {
|
|
11648
|
+
setIds((prev) => ({
|
|
11649
|
+
...prev,
|
|
11650
|
+
trigger: id
|
|
11651
|
+
}));
|
|
11652
|
+
}
|
|
11653
|
+
}, [id, setIds]);
|
|
11654
|
+
const innerRef = (0, import_react37.useRef)(null);
|
|
11655
|
+
(0, import_react37.useImperativeHandle)(ref, () => innerRef.current);
|
|
11656
|
+
(0, import_react37.useEffect)(() => {
|
|
11393
11657
|
register(innerRef);
|
|
11394
11658
|
return () => unregister();
|
|
11395
11659
|
}, [register, unregister]);
|
|
11396
11660
|
const disabled = !!props?.disabled || !!state.disabled;
|
|
11397
11661
|
const invalid = state.invalid;
|
|
11398
|
-
return /* @__PURE__ */ (0,
|
|
11662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
11399
11663
|
"div",
|
|
11400
11664
|
{
|
|
11401
11665
|
...props,
|
|
@@ -11411,9 +11675,9 @@ var SelectChipDisplay = (0, import_react34.forwardRef)(function SelectChipDispla
|
|
|
11411
11675
|
"aria-invalid": invalid,
|
|
11412
11676
|
"aria-disabled": disabled,
|
|
11413
11677
|
children: [
|
|
11414
|
-
state.selectedOptions.map(({ value, label }) => /* @__PURE__ */ (0,
|
|
11678
|
+
state.selectedOptions.map(({ value, label }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Chip, { className: "gap-x-2", children: [
|
|
11415
11679
|
label,
|
|
11416
|
-
/* @__PURE__ */ (0,
|
|
11680
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11417
11681
|
Button,
|
|
11418
11682
|
{
|
|
11419
11683
|
onClick: () => {
|
|
@@ -11424,14 +11688,14 @@ var SelectChipDisplay = (0, import_react34.forwardRef)(function SelectChipDispla
|
|
|
11424
11688
|
coloringStyle: "text",
|
|
11425
11689
|
layout: "icon",
|
|
11426
11690
|
className: "flex-row-0 items-center",
|
|
11427
|
-
children: /* @__PURE__ */ (0,
|
|
11691
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react8.XIcon, { className: "size-5" })
|
|
11428
11692
|
}
|
|
11429
11693
|
)
|
|
11430
11694
|
] }, value)),
|
|
11431
|
-
/* @__PURE__ */ (0,
|
|
11695
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11432
11696
|
Button,
|
|
11433
11697
|
{
|
|
11434
|
-
id:
|
|
11698
|
+
id: ids.trigger,
|
|
11435
11699
|
onClick: (event) => {
|
|
11436
11700
|
event.stopPropagation();
|
|
11437
11701
|
toggleOpen();
|
|
@@ -11452,149 +11716,34 @@ var SelectChipDisplay = (0, import_react34.forwardRef)(function SelectChipDispla
|
|
|
11452
11716
|
"aria-disabled": disabled,
|
|
11453
11717
|
"aria-haspopup": "listbox",
|
|
11454
11718
|
"aria-expanded": state.isOpen,
|
|
11455
|
-
"aria-controls": state.isOpen ?
|
|
11719
|
+
"aria-controls": state.isOpen ? ids.content : void 0,
|
|
11456
11720
|
className: "size-9",
|
|
11457
|
-
children: /* @__PURE__ */ (0,
|
|
11721
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react8.Plus, {})
|
|
11458
11722
|
}
|
|
11459
11723
|
)
|
|
11460
11724
|
]
|
|
11461
11725
|
}
|
|
11462
11726
|
);
|
|
11463
11727
|
});
|
|
11464
|
-
var
|
|
11465
|
-
function SelectContent2({
|
|
11466
|
-
alignment,
|
|
11467
|
-
orientation = "vertical",
|
|
11468
|
-
containerClassName,
|
|
11469
|
-
...props
|
|
11470
|
-
}, ref) {
|
|
11471
|
-
const innerRef = (0, import_react34.useRef)(null);
|
|
11472
|
-
(0, import_react34.useImperativeHandle)(ref, () => innerRef.current);
|
|
11473
|
-
const { trigger, state, config, item } = useSelectContext();
|
|
11474
|
-
const position = useFloatingElement({
|
|
11475
|
-
active: state.isOpen,
|
|
11476
|
-
anchorRef: trigger.ref,
|
|
11477
|
-
containerRef: innerRef,
|
|
11478
|
-
...alignment
|
|
11479
|
-
});
|
|
11480
|
-
useFocusTrap({
|
|
11481
|
-
container: innerRef,
|
|
11482
|
-
active: state.isOpen && !!position
|
|
11483
|
-
});
|
|
11484
|
-
const { zIndex } = useOverlayRegistry({ isActive: state.isOpen });
|
|
11485
|
-
return (0, import_react_dom5.createPortal)(
|
|
11486
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
11487
|
-
"div",
|
|
11488
|
-
{
|
|
11489
|
-
id: `select-container-${state.id}`,
|
|
11490
|
-
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen", containerClassName),
|
|
11491
|
-
style: { zIndex },
|
|
11492
|
-
hidden: !state.isOpen,
|
|
11493
|
-
children: [
|
|
11494
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11495
|
-
"div",
|
|
11496
|
-
{
|
|
11497
|
-
id: `select-background-${state.id}`,
|
|
11498
|
-
onClick: () => trigger.toggleOpen(false),
|
|
11499
|
-
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen")
|
|
11500
|
-
}
|
|
11501
|
-
),
|
|
11502
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11503
|
-
"ul",
|
|
11504
|
-
{
|
|
11505
|
-
...props,
|
|
11506
|
-
id: `${state.id}-listbox`,
|
|
11507
|
-
ref: innerRef,
|
|
11508
|
-
onKeyDown: (event) => {
|
|
11509
|
-
switch (event.key) {
|
|
11510
|
-
case "Escape":
|
|
11511
|
-
trigger.toggleOpen(false);
|
|
11512
|
-
event.preventDefault();
|
|
11513
|
-
event.stopPropagation();
|
|
11514
|
-
break;
|
|
11515
|
-
case match(orientation, {
|
|
11516
|
-
vertical: "ArrowDown",
|
|
11517
|
-
horizontal: "ArrowUp"
|
|
11518
|
-
}):
|
|
11519
|
-
item.moveHighlightedIndex(1);
|
|
11520
|
-
event.preventDefault();
|
|
11521
|
-
break;
|
|
11522
|
-
case match(orientation, {
|
|
11523
|
-
vertical: "ArrowUp",
|
|
11524
|
-
horizontal: "ArrowDown"
|
|
11525
|
-
}):
|
|
11526
|
-
item.moveHighlightedIndex(-1);
|
|
11527
|
-
event.preventDefault();
|
|
11528
|
-
break;
|
|
11529
|
-
case "Home":
|
|
11530
|
-
event.preventDefault();
|
|
11531
|
-
break;
|
|
11532
|
-
case "End":
|
|
11533
|
-
event.preventDefault();
|
|
11534
|
-
break;
|
|
11535
|
-
case "Enter":
|
|
11536
|
-
// Fall through
|
|
11537
|
-
case " ":
|
|
11538
|
-
if (state.highlightedValue) {
|
|
11539
|
-
item.toggleSelection(state.highlightedValue);
|
|
11540
|
-
if (!config.isMultiSelect) {
|
|
11541
|
-
trigger.toggleOpen(false);
|
|
11542
|
-
}
|
|
11543
|
-
event.preventDefault();
|
|
11544
|
-
}
|
|
11545
|
-
break;
|
|
11546
|
-
}
|
|
11547
|
-
},
|
|
11548
|
-
className: (0, import_clsx13.default)("flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-outline-within overflow-auto", props.className),
|
|
11549
|
-
style: {
|
|
11550
|
-
opacity: position ? void 0 : 0,
|
|
11551
|
-
position: "fixed",
|
|
11552
|
-
...position
|
|
11553
|
-
},
|
|
11554
|
-
role: "listbox",
|
|
11555
|
-
"aria-multiselectable": config.isMultiSelect,
|
|
11556
|
-
"aria-orientation": orientation,
|
|
11557
|
-
tabIndex: position ? 0 : void 0,
|
|
11558
|
-
children: props.children
|
|
11559
|
-
}
|
|
11560
|
-
)
|
|
11561
|
-
]
|
|
11562
|
-
}
|
|
11563
|
-
),
|
|
11564
|
-
document.body
|
|
11565
|
-
);
|
|
11566
|
-
}
|
|
11567
|
-
);
|
|
11568
|
-
var Select = (0, import_react34.forwardRef)(function Select2({
|
|
11728
|
+
var MultiSelectChipDisplay = (0, import_react37.forwardRef)(function MultiSelectChipDisplay2({
|
|
11569
11729
|
children,
|
|
11570
11730
|
contentPanelProps,
|
|
11571
|
-
|
|
11731
|
+
chipDisplayProps,
|
|
11572
11732
|
...props
|
|
11573
11733
|
}, ref) {
|
|
11574
|
-
return /* @__PURE__ */ (0,
|
|
11575
|
-
/* @__PURE__ */ (0,
|
|
11576
|
-
|
|
11577
|
-
{
|
|
11578
|
-
ref,
|
|
11579
|
-
...buttonProps,
|
|
11580
|
-
selectedDisplay: (values) => {
|
|
11581
|
-
const value = values[0];
|
|
11582
|
-
if (!buttonProps?.selectedDisplay) return void 0;
|
|
11583
|
-
return buttonProps.selectedDisplay(value);
|
|
11584
|
-
}
|
|
11585
|
-
}
|
|
11586
|
-
),
|
|
11587
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
11734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(MultiSelectRoot, { ...props, children: [
|
|
11735
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MultiSelectChipDisplayButton, { ref, ...chipDisplayProps }),
|
|
11736
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MultiSelectContent, { ...contentPanelProps, children })
|
|
11588
11737
|
] });
|
|
11589
11738
|
});
|
|
11590
|
-
var
|
|
11739
|
+
var MultiSelectChipDisplayUncontrolled = (0, import_react37.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
|
|
11591
11740
|
value: initialValue,
|
|
11592
11741
|
onValueChange,
|
|
11593
11742
|
...props
|
|
11594
11743
|
}, ref) {
|
|
11595
11744
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
11596
|
-
return /* @__PURE__ */ (0,
|
|
11597
|
-
|
|
11745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11746
|
+
MultiSelectChipDisplay,
|
|
11598
11747
|
{
|
|
11599
11748
|
...props,
|
|
11600
11749
|
ref,
|
|
@@ -11603,56 +11752,40 @@ var SelectUncontrolled = (0, import_react34.forwardRef)(function SelectUncontrol
|
|
|
11603
11752
|
}
|
|
11604
11753
|
);
|
|
11605
11754
|
});
|
|
11606
|
-
|
|
11755
|
+
|
|
11756
|
+
// src/components/user-interaction/select/Select.tsx
|
|
11757
|
+
var import_react38 = require("react");
|
|
11758
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
11759
|
+
var Select = (0, import_react38.forwardRef)(function Select2({
|
|
11607
11760
|
children,
|
|
11608
|
-
value,
|
|
11609
|
-
onValueChange,
|
|
11610
11761
|
contentPanelProps,
|
|
11611
11762
|
buttonProps,
|
|
11612
11763
|
...props
|
|
11613
11764
|
}, ref) {
|
|
11614
|
-
return /* @__PURE__ */ (0,
|
|
11615
|
-
/* @__PURE__ */ (0,
|
|
11616
|
-
|
|
11765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(SelectRoot, { ...props, children: [
|
|
11766
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
11767
|
+
SelectButton,
|
|
11768
|
+
{
|
|
11769
|
+
ref,
|
|
11770
|
+
...buttonProps,
|
|
11771
|
+
selectedDisplay: (values) => {
|
|
11772
|
+
const value = values[0];
|
|
11773
|
+
if (!buttonProps?.selectedDisplay) return void 0;
|
|
11774
|
+
return buttonProps.selectedDisplay(value);
|
|
11775
|
+
}
|
|
11776
|
+
}
|
|
11777
|
+
),
|
|
11778
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
11617
11779
|
] });
|
|
11618
11780
|
});
|
|
11619
|
-
var
|
|
11781
|
+
var SelectUncontrolled = (0, import_react38.forwardRef)(function SelectUncontrolled2({
|
|
11620
11782
|
value: initialValue,
|
|
11621
11783
|
onValueChange,
|
|
11622
11784
|
...props
|
|
11623
11785
|
}, ref) {
|
|
11624
11786
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
11625
|
-
return /* @__PURE__ */ (0,
|
|
11626
|
-
|
|
11627
|
-
{
|
|
11628
|
-
...props,
|
|
11629
|
-
ref,
|
|
11630
|
-
value,
|
|
11631
|
-
onValueChange: setValue
|
|
11632
|
-
}
|
|
11633
|
-
);
|
|
11634
|
-
});
|
|
11635
|
-
var MultiSelectChipDisplay = (0, import_react34.forwardRef)(function MultiSelectChipDisplay2({
|
|
11636
|
-
children,
|
|
11637
|
-
value,
|
|
11638
|
-
onValueChange,
|
|
11639
|
-
contentPanelProps,
|
|
11640
|
-
chipDisplayProps,
|
|
11641
|
-
...props
|
|
11642
|
-
}, ref) {
|
|
11643
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(SelectRoot, { ...props, values: value, onValuesChange: onValueChange, isMultiSelect: true, children: [
|
|
11644
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectChipDisplay, { ref, ...chipDisplayProps }),
|
|
11645
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
11646
|
-
] });
|
|
11647
|
-
});
|
|
11648
|
-
var MultiSelectChipDisplayUncontrolled = (0, import_react34.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
|
|
11649
|
-
value: initialValue,
|
|
11650
|
-
onValueChange,
|
|
11651
|
-
...props
|
|
11652
|
-
}, ref) {
|
|
11653
|
-
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
11654
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11655
|
-
MultiSelectChipDisplay,
|
|
11787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
11788
|
+
Select,
|
|
11656
11789
|
{
|
|
11657
11790
|
...props,
|
|
11658
11791
|
ref,
|
|
@@ -11663,7 +11796,7 @@ var MultiSelectChipDisplayUncontrolled = (0, import_react34.forwardRef)(function
|
|
|
11663
11796
|
});
|
|
11664
11797
|
|
|
11665
11798
|
// src/components/layout/dialog/LanguageDialog.tsx
|
|
11666
|
-
var
|
|
11799
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
11667
11800
|
var LanguageDialog = ({
|
|
11668
11801
|
onClose,
|
|
11669
11802
|
titleOverwrite,
|
|
@@ -11672,15 +11805,15 @@ var LanguageDialog = ({
|
|
|
11672
11805
|
}) => {
|
|
11673
11806
|
const { locale, setLocale } = useLocale();
|
|
11674
11807
|
const translation = useHightideTranslation();
|
|
11675
|
-
return /* @__PURE__ */ (0,
|
|
11808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11676
11809
|
Dialog,
|
|
11677
11810
|
{
|
|
11678
11811
|
titleElement: titleOverwrite ?? translation("language"),
|
|
11679
11812
|
description: descriptionOverwrite ?? translation("chooseLanguage"),
|
|
11680
11813
|
onClose,
|
|
11681
11814
|
...props,
|
|
11682
|
-
children: /* @__PURE__ */ (0,
|
|
11683
|
-
/* @__PURE__ */ (0,
|
|
11815
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "w-64", children: [
|
|
11816
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11684
11817
|
Select,
|
|
11685
11818
|
{
|
|
11686
11819
|
value: locale,
|
|
@@ -11688,27 +11821,27 @@ var LanguageDialog = ({
|
|
|
11688
11821
|
buttonProps: {
|
|
11689
11822
|
selectedDisplay: (locale2) => LocalizationUtil.languagesLocalNames[locale2]
|
|
11690
11823
|
},
|
|
11691
|
-
children: LocalizationUtil.locals.map((local) => /* @__PURE__ */ (0,
|
|
11824
|
+
children: LocalizationUtil.locals.map((local) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SelectOption, { value: local, children: LocalizationUtil.languagesLocalNames[local] }, local))
|
|
11692
11825
|
}
|
|
11693
11826
|
),
|
|
11694
|
-
/* @__PURE__ */ (0,
|
|
11827
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button, { color: "positive", onClick: onClose, children: translation("done") }) })
|
|
11695
11828
|
] })
|
|
11696
11829
|
}
|
|
11697
11830
|
);
|
|
11698
11831
|
};
|
|
11699
11832
|
|
|
11700
11833
|
// src/components/layout/dialog/ThemeDialog.tsx
|
|
11701
|
-
var
|
|
11834
|
+
var import_lucide_react9 = require("lucide-react");
|
|
11702
11835
|
var import_clsx14 = __toESM(require("clsx"));
|
|
11703
11836
|
|
|
11704
11837
|
// src/contexts/ThemeContext.tsx
|
|
11705
|
-
var
|
|
11706
|
-
var
|
|
11838
|
+
var import_react39 = require("react");
|
|
11839
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
11707
11840
|
var themes = ["light", "dark", "system"];
|
|
11708
11841
|
var ThemeUtil = {
|
|
11709
11842
|
themes
|
|
11710
11843
|
};
|
|
11711
|
-
var ThemeContext = (0,
|
|
11844
|
+
var ThemeContext = (0, import_react39.createContext)(null);
|
|
11712
11845
|
var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
11713
11846
|
const {
|
|
11714
11847
|
value: storedTheme,
|
|
@@ -11716,8 +11849,8 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11716
11849
|
deleteValue: deleteStoredTheme
|
|
11717
11850
|
} = useLocalStorage("theme", "system");
|
|
11718
11851
|
const { config } = useHightideConfig();
|
|
11719
|
-
const [themePreference, setThemePreference] = (0,
|
|
11720
|
-
const resolvedTheme = (0,
|
|
11852
|
+
const [themePreference, setThemePreference] = (0, import_react39.useState)("system");
|
|
11853
|
+
const resolvedTheme = (0, import_react39.useMemo)(() => {
|
|
11721
11854
|
if (theme && theme !== "system") {
|
|
11722
11855
|
return theme;
|
|
11723
11856
|
}
|
|
@@ -11729,7 +11862,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11729
11862
|
}
|
|
11730
11863
|
return initialTheme ?? config.theme.initialTheme;
|
|
11731
11864
|
}, [config.theme.initialTheme, initialTheme, storedTheme, theme, themePreference]);
|
|
11732
|
-
(0,
|
|
11865
|
+
(0, import_react39.useEffect)(() => {
|
|
11733
11866
|
if (!theme) return;
|
|
11734
11867
|
if (theme === "system") {
|
|
11735
11868
|
deleteStoredTheme();
|
|
@@ -11737,18 +11870,18 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11737
11870
|
setStoredTheme(theme);
|
|
11738
11871
|
}
|
|
11739
11872
|
}, [theme]);
|
|
11740
|
-
(0,
|
|
11873
|
+
(0, import_react39.useEffect)(() => {
|
|
11741
11874
|
document.documentElement.setAttribute("data-theme", resolvedTheme);
|
|
11742
11875
|
}, [resolvedTheme]);
|
|
11743
|
-
const getPreference = (0,
|
|
11876
|
+
const getPreference = (0, import_react39.useCallback)(() => {
|
|
11744
11877
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
11745
11878
|
const prefersLight = window.matchMedia("(prefers-color-scheme: light)").matches;
|
|
11746
11879
|
setThemePreference(prefersDark ? "dark" : prefersLight ? "light" : "system");
|
|
11747
11880
|
}, []);
|
|
11748
|
-
(0,
|
|
11881
|
+
(0, import_react39.useEffect)(() => {
|
|
11749
11882
|
getPreference();
|
|
11750
11883
|
}, [getPreference]);
|
|
11751
|
-
(0,
|
|
11884
|
+
(0, import_react39.useEffect)(() => {
|
|
11752
11885
|
const darkQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
11753
11886
|
const lightQuery = window.matchMedia("(prefers-color-scheme: light)");
|
|
11754
11887
|
const noPrefQuery = window.matchMedia("(prefers-color-scheme: no-preference)");
|
|
@@ -11761,7 +11894,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11761
11894
|
noPrefQuery.removeEventListener("change", getPreference);
|
|
11762
11895
|
};
|
|
11763
11896
|
}, [getPreference]);
|
|
11764
|
-
return /* @__PURE__ */ (0,
|
|
11897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11765
11898
|
ThemeContext.Provider,
|
|
11766
11899
|
{
|
|
11767
11900
|
value: {
|
|
@@ -11779,7 +11912,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11779
11912
|
);
|
|
11780
11913
|
};
|
|
11781
11914
|
var useTheme = () => {
|
|
11782
|
-
const context = (0,
|
|
11915
|
+
const context = (0, import_react39.useContext)(ThemeContext);
|
|
11783
11916
|
if (!context) {
|
|
11784
11917
|
throw new Error("useTheme must be used within ThemeContext. Try adding a ThemeProvider around your app.");
|
|
11785
11918
|
}
|
|
@@ -11787,14 +11920,14 @@ var useTheme = () => {
|
|
|
11787
11920
|
};
|
|
11788
11921
|
|
|
11789
11922
|
// src/components/layout/dialog/ThemeDialog.tsx
|
|
11790
|
-
var
|
|
11923
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
11791
11924
|
var ThemeIcon = ({ theme, className }) => {
|
|
11792
11925
|
if (theme === "dark") {
|
|
11793
|
-
return /* @__PURE__ */ (0,
|
|
11926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react9.MoonIcon, { className: (0, import_clsx14.default)("w-4 h-4", className) });
|
|
11794
11927
|
} else if (theme === "light") {
|
|
11795
|
-
return /* @__PURE__ */ (0,
|
|
11928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react9.SunIcon, { className: (0, import_clsx14.default)("w-4 h-4", className) });
|
|
11796
11929
|
} else {
|
|
11797
|
-
return /* @__PURE__ */ (0,
|
|
11930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react9.MonitorCog, { className: (0, import_clsx14.default)("w-4 h-4", className) });
|
|
11798
11931
|
}
|
|
11799
11932
|
};
|
|
11800
11933
|
var ThemeDialog = ({
|
|
@@ -11805,67 +11938,67 @@ var ThemeDialog = ({
|
|
|
11805
11938
|
}) => {
|
|
11806
11939
|
const { theme, setTheme } = useTheme();
|
|
11807
11940
|
const translation = useHightideTranslation();
|
|
11808
|
-
return /* @__PURE__ */ (0,
|
|
11941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11809
11942
|
Dialog,
|
|
11810
11943
|
{
|
|
11811
11944
|
titleElement: titleOverwrite ?? translation("pThemes", { count: 1 }),
|
|
11812
11945
|
description: descriptionOverwrite ?? translation("chooseTheme"),
|
|
11813
11946
|
onClose,
|
|
11814
11947
|
...props,
|
|
11815
|
-
children: /* @__PURE__ */ (0,
|
|
11816
|
-
/* @__PURE__ */ (0,
|
|
11948
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "w-64", children: [
|
|
11949
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11817
11950
|
Select,
|
|
11818
11951
|
{
|
|
11819
11952
|
value: theme,
|
|
11820
11953
|
onValueChange: (theme2) => setTheme(theme2),
|
|
11821
11954
|
iconAppearance: "right",
|
|
11822
11955
|
buttonProps: {
|
|
11823
|
-
selectedDisplay: (value) => /* @__PURE__ */ (0,
|
|
11824
|
-
/* @__PURE__ */ (0,
|
|
11956
|
+
selectedDisplay: (value) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
11957
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ThemeIcon, { theme }),
|
|
11825
11958
|
translation("sThemeMode", { theme: value })
|
|
11826
11959
|
] }),
|
|
11827
11960
|
className: "min-w-32"
|
|
11828
11961
|
},
|
|
11829
|
-
children: ThemeUtil.themes.map((theme2) => /* @__PURE__ */ (0,
|
|
11830
|
-
/* @__PURE__ */ (0,
|
|
11962
|
+
children: ThemeUtil.themes.map((theme2) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SelectOption, { value: theme2, className: "gap-x-6 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
11963
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ThemeIcon, { theme: theme2 }),
|
|
11831
11964
|
translation("sThemeMode", { theme: theme2 })
|
|
11832
11965
|
] }) }, theme2))
|
|
11833
11966
|
}
|
|
11834
11967
|
),
|
|
11835
|
-
/* @__PURE__ */ (0,
|
|
11968
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Button, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
|
|
11836
11969
|
] })
|
|
11837
11970
|
}
|
|
11838
11971
|
);
|
|
11839
11972
|
};
|
|
11840
11973
|
|
|
11841
11974
|
// src/components/layout/loading/ErrorComponent.tsx
|
|
11842
|
-
var
|
|
11975
|
+
var import_lucide_react10 = require("lucide-react");
|
|
11843
11976
|
var import_clsx15 = __toESM(require("clsx"));
|
|
11844
|
-
var
|
|
11977
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
11845
11978
|
var ErrorComponent = ({
|
|
11846
11979
|
errorText,
|
|
11847
11980
|
classname
|
|
11848
11981
|
}) => {
|
|
11849
11982
|
const translation = useHightideTranslation();
|
|
11850
|
-
return /* @__PURE__ */ (0,
|
|
11851
|
-
/* @__PURE__ */ (0,
|
|
11983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: (0, import_clsx15.default)("flex-col-4 items-center justify-center w-full h-24", classname), children: [
|
|
11984
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react10.AlertOctagon, { size: 64, className: "text-warning" }),
|
|
11852
11985
|
errorText ?? `${translation("errorOccurred")} :(`
|
|
11853
11986
|
] });
|
|
11854
11987
|
};
|
|
11855
11988
|
|
|
11856
11989
|
// src/components/layout/loading/LoadingAndErrorComponent.tsx
|
|
11857
|
-
var
|
|
11990
|
+
var import_react40 = require("react");
|
|
11858
11991
|
|
|
11859
11992
|
// src/components/layout/loading/LoadingContainer.tsx
|
|
11860
11993
|
var import_clsx16 = require("clsx");
|
|
11861
|
-
var
|
|
11994
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
11862
11995
|
var LoadingContainer = ({ className }) => {
|
|
11863
|
-
return /* @__PURE__ */ (0,
|
|
11996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: (0, import_clsx16.clsx)("relative overflow-hidden shimmer bg-disabled/30 rounded-md", className) });
|
|
11864
11997
|
};
|
|
11865
11998
|
|
|
11866
11999
|
// src/components/layout/loading/LoadingAndErrorComponent.tsx
|
|
11867
12000
|
var import_clsx17 = require("clsx");
|
|
11868
|
-
var
|
|
12001
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
11869
12002
|
var LoadingAndErrorComponent = ({
|
|
11870
12003
|
children,
|
|
11871
12004
|
isLoading = false,
|
|
@@ -11875,8 +12008,8 @@ var LoadingAndErrorComponent = ({
|
|
|
11875
12008
|
minimumLoadingDuration = 200,
|
|
11876
12009
|
className
|
|
11877
12010
|
}) => {
|
|
11878
|
-
const [isInMinimumLoading, setIsInMinimumLoading] = (0,
|
|
11879
|
-
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0,
|
|
12011
|
+
const [isInMinimumLoading, setIsInMinimumLoading] = (0, import_react40.useState)(false);
|
|
12012
|
+
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0, import_react40.useState)(false);
|
|
11880
12013
|
if (minimumLoadingDuration && !isInMinimumLoading && !hasUsedMinimumLoading) {
|
|
11881
12014
|
setIsInMinimumLoading(true);
|
|
11882
12015
|
setTimeout(() => {
|
|
@@ -11885,33 +12018,33 @@ var LoadingAndErrorComponent = ({
|
|
|
11885
12018
|
}, minimumLoadingDuration);
|
|
11886
12019
|
}
|
|
11887
12020
|
if (isLoading || minimumLoadingDuration && isInMinimumLoading) {
|
|
11888
|
-
return /* @__PURE__ */ (0,
|
|
12021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_jsx_runtime44.Fragment, { children: loadingComponent ?? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(LoadingContainer, { className: (0, import_clsx17.clsx)(className) }) });
|
|
11889
12022
|
}
|
|
11890
12023
|
if (hasError) {
|
|
11891
|
-
return /* @__PURE__ */ (0,
|
|
12024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_jsx_runtime44.Fragment, { children: errorComponent ?? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(LoadingContainer, { className: (0, import_clsx17.clsx)("bg-negative", className) }) });
|
|
11892
12025
|
}
|
|
11893
|
-
return /* @__PURE__ */ (0,
|
|
12026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_jsx_runtime44.Fragment, { children });
|
|
11894
12027
|
};
|
|
11895
12028
|
|
|
11896
12029
|
// src/components/layout/loading/LoadingAnimation.tsx
|
|
11897
12030
|
var import_clsx18 = __toESM(require("clsx"));
|
|
11898
|
-
var
|
|
12031
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
11899
12032
|
var LoadingAnimation = ({
|
|
11900
12033
|
loadingText,
|
|
11901
12034
|
classname
|
|
11902
12035
|
}) => {
|
|
11903
12036
|
const translation = useHightideTranslation();
|
|
11904
|
-
return /* @__PURE__ */ (0,
|
|
11905
|
-
/* @__PURE__ */ (0,
|
|
12037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: (0, import_clsx18.default)("flex-col-2 items-center justify-center w-full h-24", classname), children: [
|
|
12038
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(HelpwaveLogo, { animate: "loading" }),
|
|
11906
12039
|
loadingText ?? `${translation("loading")}...`
|
|
11907
12040
|
] });
|
|
11908
12041
|
};
|
|
11909
12042
|
|
|
11910
12043
|
// src/components/layout/navigation/BreadCrumbs.tsx
|
|
11911
12044
|
var import_link = __toESM(require_link2());
|
|
11912
|
-
var
|
|
12045
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
11913
12046
|
var BreadCrumbLink = ({ ...props }) => {
|
|
11914
|
-
return /* @__PURE__ */ (0,
|
|
12047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11915
12048
|
import_link.default,
|
|
11916
12049
|
{
|
|
11917
12050
|
...props,
|
|
@@ -11920,29 +12053,29 @@ var BreadCrumbLink = ({ ...props }) => {
|
|
|
11920
12053
|
);
|
|
11921
12054
|
};
|
|
11922
12055
|
var BreadCrumbDivider = () => {
|
|
11923
|
-
return /* @__PURE__ */ (0,
|
|
12056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { "data-name": "breadcrumb-divider", children: "/" });
|
|
11924
12057
|
};
|
|
11925
12058
|
var BreadCrumbGroup = ({ children, divider, ...props }) => {
|
|
11926
12059
|
const items = ArrayUtil.resolveSingleOrArray(children);
|
|
11927
|
-
return /* @__PURE__ */ (0,
|
|
12060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("ul", { ...props, "data-name": props["data-name"] ?? "breadcrumb", children: items.map((item, index) => {
|
|
11928
12061
|
const isLast = index === items.length - 1;
|
|
11929
|
-
return /* @__PURE__ */ (0,
|
|
12062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("li", { "data-name": "breadcrumb-item", children: [
|
|
11930
12063
|
item,
|
|
11931
|
-
!isLast && divider !== null && (divider ?? /* @__PURE__ */ (0,
|
|
12064
|
+
!isLast && divider !== null && (divider ?? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(BreadCrumbDivider, {}))
|
|
11932
12065
|
] }, index);
|
|
11933
12066
|
}) });
|
|
11934
12067
|
};
|
|
11935
12068
|
var BreadCrumbs = ({ crumbs }) => {
|
|
11936
|
-
return /* @__PURE__ */ (0,
|
|
12069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(BreadCrumbGroup, { children: crumbs.map(({ href, label }, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(BreadCrumbLink, { href, children: label }, index)) });
|
|
11937
12070
|
};
|
|
11938
12071
|
|
|
11939
12072
|
// src/components/layout/navigation/Navigation.tsx
|
|
11940
|
-
var
|
|
11941
|
-
var
|
|
11942
|
-
var
|
|
12073
|
+
var import_lucide_react11 = require("lucide-react");
|
|
12074
|
+
var import_react41 = require("react");
|
|
12075
|
+
var import_react42 = require("react");
|
|
11943
12076
|
var import_link2 = __toESM(require_link2());
|
|
11944
12077
|
var import_clsx19 = __toESM(require("clsx"));
|
|
11945
|
-
var
|
|
12078
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
11946
12079
|
function isSubItem(item) {
|
|
11947
12080
|
return "items" in item && Array.isArray(item.items);
|
|
11948
12081
|
}
|
|
@@ -11952,10 +12085,10 @@ var NavigationItemWithSubItem = ({
|
|
|
11952
12085
|
horizontalAlignment = "center",
|
|
11953
12086
|
...options
|
|
11954
12087
|
}) => {
|
|
11955
|
-
const [isOpen, setOpen] = (0,
|
|
11956
|
-
const containerRef = (0,
|
|
11957
|
-
const triggerRef = (0,
|
|
11958
|
-
const id = (0,
|
|
12088
|
+
const [isOpen, setOpen] = (0, import_react42.useState)(false);
|
|
12089
|
+
const containerRef = (0, import_react42.useRef)(null);
|
|
12090
|
+
const triggerRef = (0, import_react42.useRef)(null);
|
|
12091
|
+
const id = (0, import_react42.useId)();
|
|
11959
12092
|
const style = useFloatingElement({
|
|
11960
12093
|
active: isOpen,
|
|
11961
12094
|
containerRef,
|
|
@@ -11963,15 +12096,15 @@ var NavigationItemWithSubItem = ({
|
|
|
11963
12096
|
horizontalAlignment,
|
|
11964
12097
|
...options
|
|
11965
12098
|
});
|
|
11966
|
-
const onBlur = (0,
|
|
12099
|
+
const onBlur = (0, import_react42.useCallback)((event) => {
|
|
11967
12100
|
const nextFocus = event.relatedTarget;
|
|
11968
12101
|
if (!containerRef.current?.contains(nextFocus) && !triggerRef.current?.contains(nextFocus)) {
|
|
11969
12102
|
setOpen(false);
|
|
11970
12103
|
}
|
|
11971
12104
|
}, []);
|
|
11972
12105
|
const { zIndex } = useOverlayRegistry();
|
|
11973
|
-
return /* @__PURE__ */ (0,
|
|
11974
|
-
/* @__PURE__ */ (0,
|
|
12106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
12107
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
11975
12108
|
"button",
|
|
11976
12109
|
{
|
|
11977
12110
|
id: "navigation-" + id,
|
|
@@ -11987,11 +12120,11 @@ var NavigationItemWithSubItem = ({
|
|
|
11987
12120
|
"aria-controls": "navigation-items-" + id,
|
|
11988
12121
|
children: [
|
|
11989
12122
|
label,
|
|
11990
|
-
/* @__PURE__ */ (0,
|
|
12123
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ExpansionIcon, { isExpanded: isOpen })
|
|
11991
12124
|
]
|
|
11992
12125
|
}
|
|
11993
12126
|
),
|
|
11994
|
-
/* @__PURE__ */ (0,
|
|
12127
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
11995
12128
|
"ul",
|
|
11996
12129
|
{
|
|
11997
12130
|
id: "navigation-items-" + id,
|
|
@@ -12010,7 +12143,7 @@ var NavigationItemWithSubItem = ({
|
|
|
12010
12143
|
{ "opacity-0": !style }
|
|
12011
12144
|
),
|
|
12012
12145
|
style: { ...style, zIndex },
|
|
12013
|
-
children: items.map(({ link, label: label2, external }, index) => /* @__PURE__ */ (0,
|
|
12146
|
+
children: items.map(({ link, label: label2, external }, index) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12014
12147
|
import_link2.default,
|
|
12015
12148
|
{
|
|
12016
12149
|
href: link,
|
|
@@ -12024,25 +12157,25 @@ var NavigationItemWithSubItem = ({
|
|
|
12024
12157
|
] });
|
|
12025
12158
|
};
|
|
12026
12159
|
var NavigationItemList = ({ items, ...restProps }) => {
|
|
12027
|
-
return /* @__PURE__ */ (0,
|
|
12160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("ul", { ...restProps, className: (0, import_clsx19.default)("flex-row-6 items-center", restProps.className), children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("li", { children: isSubItem(item) ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NavigationItemWithSubItem, { ...item }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_link2.default, { href: item.link, target: item.external ? "_blank" : void 0, className: "link", children: item.label }) }, index)) });
|
|
12028
12161
|
};
|
|
12029
12162
|
var Navigation = ({ ...props }) => {
|
|
12030
|
-
const [isMobileOpen, setIsMobileOpen] = (0,
|
|
12031
|
-
const id = (0,
|
|
12032
|
-
const menuRef = (0,
|
|
12033
|
-
(0,
|
|
12163
|
+
const [isMobileOpen, setIsMobileOpen] = (0, import_react42.useState)(false);
|
|
12164
|
+
const id = (0, import_react42.useId)();
|
|
12165
|
+
const menuRef = (0, import_react42.useRef)(null);
|
|
12166
|
+
(0, import_react41.useEffect)(() => {
|
|
12034
12167
|
menuRef.current?.focus();
|
|
12035
12168
|
}, [isMobileOpen]);
|
|
12036
12169
|
const { zIndex } = useOverlayRegistry({ isActive: isMobileOpen });
|
|
12037
|
-
return /* @__PURE__ */ (0,
|
|
12038
|
-
/* @__PURE__ */ (0,
|
|
12170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("nav", { children: [
|
|
12171
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12039
12172
|
NavigationItemList,
|
|
12040
12173
|
{
|
|
12041
12174
|
...props,
|
|
12042
12175
|
className: (0, import_clsx19.default)("hidden", { "desktop:flex": !isMobileOpen }, props.className)
|
|
12043
12176
|
}
|
|
12044
12177
|
),
|
|
12045
|
-
/* @__PURE__ */ (0,
|
|
12178
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12046
12179
|
Button,
|
|
12047
12180
|
{
|
|
12048
12181
|
layout: "icon",
|
|
@@ -12053,10 +12186,10 @@ var Navigation = ({ ...props }) => {
|
|
|
12053
12186
|
"aria-haspopup": "true",
|
|
12054
12187
|
"aria-expanded": isMobileOpen,
|
|
12055
12188
|
"aria-controls": "navigation-menu-" + id,
|
|
12056
|
-
children: /* @__PURE__ */ (0,
|
|
12189
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react11.Menu, { className: "w-6 h-6" })
|
|
12057
12190
|
}
|
|
12058
12191
|
),
|
|
12059
|
-
/* @__PURE__ */ (0,
|
|
12192
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
12060
12193
|
"div",
|
|
12061
12194
|
{
|
|
12062
12195
|
id: "navigation-menu-" + id,
|
|
@@ -12078,17 +12211,17 @@ var Navigation = ({ ...props }) => {
|
|
|
12078
12211
|
),
|
|
12079
12212
|
style: { zIndex },
|
|
12080
12213
|
children: [
|
|
12081
|
-
/* @__PURE__ */ (0,
|
|
12214
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12082
12215
|
Button,
|
|
12083
12216
|
{
|
|
12084
12217
|
layout: "icon",
|
|
12085
12218
|
coloringStyle: "text",
|
|
12086
12219
|
color: "neutral",
|
|
12087
12220
|
onClick: () => setIsMobileOpen(false),
|
|
12088
|
-
children: /* @__PURE__ */ (0,
|
|
12221
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react11.XIcon, {})
|
|
12089
12222
|
}
|
|
12090
12223
|
),
|
|
12091
|
-
/* @__PURE__ */ (0,
|
|
12224
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NavigationItemList, { ...props, className: (0, import_clsx19.default)("flex-col-8", props.className) })
|
|
12092
12225
|
]
|
|
12093
12226
|
}
|
|
12094
12227
|
)
|
|
@@ -12096,10 +12229,10 @@ var Navigation = ({ ...props }) => {
|
|
|
12096
12229
|
};
|
|
12097
12230
|
|
|
12098
12231
|
// src/components/layout/navigation/Pagination.tsx
|
|
12099
|
-
var
|
|
12232
|
+
var import_lucide_react12 = require("lucide-react");
|
|
12100
12233
|
var import_clsx20 = __toESM(require("clsx"));
|
|
12101
|
-
var
|
|
12102
|
-
var
|
|
12234
|
+
var import_react43 = require("react");
|
|
12235
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
12103
12236
|
var Pagination = ({
|
|
12104
12237
|
pageIndex,
|
|
12105
12238
|
pageCount,
|
|
@@ -12108,11 +12241,11 @@ var Pagination = ({
|
|
|
12108
12241
|
style
|
|
12109
12242
|
}) => {
|
|
12110
12243
|
const translation = useHightideTranslation();
|
|
12111
|
-
const [value, setValue] = (0,
|
|
12244
|
+
const [value, setValue] = (0, import_react43.useState)((pageIndex + 1).toString());
|
|
12112
12245
|
const noPages = pageCount === 0;
|
|
12113
12246
|
const onFirstPage = pageIndex === 0 && !noPages;
|
|
12114
12247
|
const onLastPage = pageIndex === pageCount - 1;
|
|
12115
|
-
(0,
|
|
12248
|
+
(0, import_react43.useEffect)(() => {
|
|
12116
12249
|
if (noPages) {
|
|
12117
12250
|
setValue("0");
|
|
12118
12251
|
} else {
|
|
@@ -12122,8 +12255,8 @@ var Pagination = ({
|
|
|
12122
12255
|
const changePage = (page) => {
|
|
12123
12256
|
onPageChanged(page);
|
|
12124
12257
|
};
|
|
12125
|
-
return /* @__PURE__ */ (0,
|
|
12126
|
-
/* @__PURE__ */ (0,
|
|
12258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: (0, import_clsx20.default)("flex-row-1", className), style, children: [
|
|
12259
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12127
12260
|
Button,
|
|
12128
12261
|
{
|
|
12129
12262
|
layout: "icon",
|
|
@@ -12131,10 +12264,10 @@ var Pagination = ({
|
|
|
12131
12264
|
color: "neutral",
|
|
12132
12265
|
onClick: () => changePage(0),
|
|
12133
12266
|
disabled: onFirstPage || noPages,
|
|
12134
|
-
children: /* @__PURE__ */ (0,
|
|
12267
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react12.ChevronFirst, {})
|
|
12135
12268
|
}
|
|
12136
12269
|
),
|
|
12137
|
-
/* @__PURE__ */ (0,
|
|
12270
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12138
12271
|
Button,
|
|
12139
12272
|
{
|
|
12140
12273
|
layout: "icon",
|
|
@@ -12142,11 +12275,11 @@ var Pagination = ({
|
|
|
12142
12275
|
color: "neutral",
|
|
12143
12276
|
onClick: () => changePage(pageIndex - 1),
|
|
12144
12277
|
disabled: onFirstPage || noPages,
|
|
12145
|
-
children: /* @__PURE__ */ (0,
|
|
12278
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react12.ChevronLeft, {})
|
|
12146
12279
|
}
|
|
12147
12280
|
),
|
|
12148
|
-
/* @__PURE__ */ (0,
|
|
12149
|
-
/* @__PURE__ */ (0,
|
|
12281
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex-row-2 min-w-56 items-center justify-center mx-2 text-center", children: [
|
|
12282
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12150
12283
|
Input,
|
|
12151
12284
|
{
|
|
12152
12285
|
value,
|
|
@@ -12170,8 +12303,8 @@ var Pagination = ({
|
|
|
12170
12303
|
editCompleteOptions: { delay: 800 }
|
|
12171
12304
|
}
|
|
12172
12305
|
),
|
|
12173
|
-
/* @__PURE__ */ (0,
|
|
12174
|
-
/* @__PURE__ */ (0,
|
|
12306
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "select-none w-10", children: translation("of") }),
|
|
12307
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12175
12308
|
"span",
|
|
12176
12309
|
{
|
|
12177
12310
|
className: "flex-row-2 w-24 items-center justify-center select-none h-10 bg-input-background text-input-text rounded-md font-bold",
|
|
@@ -12179,7 +12312,7 @@ var Pagination = ({
|
|
|
12179
12312
|
}
|
|
12180
12313
|
)
|
|
12181
12314
|
] }),
|
|
12182
|
-
/* @__PURE__ */ (0,
|
|
12315
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12183
12316
|
Button,
|
|
12184
12317
|
{
|
|
12185
12318
|
layout: "icon",
|
|
@@ -12187,10 +12320,10 @@ var Pagination = ({
|
|
|
12187
12320
|
color: "neutral",
|
|
12188
12321
|
onClick: () => changePage(pageIndex + 1),
|
|
12189
12322
|
disabled: onLastPage || noPages,
|
|
12190
|
-
children: /* @__PURE__ */ (0,
|
|
12323
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react12.ChevronRight, {})
|
|
12191
12324
|
}
|
|
12192
12325
|
),
|
|
12193
|
-
/* @__PURE__ */ (0,
|
|
12326
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12194
12327
|
Button,
|
|
12195
12328
|
{
|
|
12196
12329
|
layout: "icon",
|
|
@@ -12198,16 +12331,16 @@ var Pagination = ({
|
|
|
12198
12331
|
color: "neutral",
|
|
12199
12332
|
onClick: () => changePage(pageCount - 1),
|
|
12200
12333
|
disabled: onLastPage || noPages,
|
|
12201
|
-
children: /* @__PURE__ */ (0,
|
|
12334
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react12.ChevronLast, {})
|
|
12202
12335
|
}
|
|
12203
12336
|
)
|
|
12204
12337
|
] });
|
|
12205
12338
|
};
|
|
12206
12339
|
|
|
12207
12340
|
// src/components/layout/navigation/StepperBar.tsx
|
|
12208
|
-
var
|
|
12341
|
+
var import_lucide_react13 = require("lucide-react");
|
|
12209
12342
|
var import_clsx21 = __toESM(require("clsx"));
|
|
12210
|
-
var
|
|
12343
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
12211
12344
|
var defaultState = {
|
|
12212
12345
|
currentStep: 0,
|
|
12213
12346
|
seenSteps: /* @__PURE__ */ new Set([0])
|
|
@@ -12229,12 +12362,12 @@ var StepperBar = ({
|
|
|
12229
12362
|
seenSteps.add(newStep);
|
|
12230
12363
|
onChange({ currentStep: newStep, seenSteps });
|
|
12231
12364
|
};
|
|
12232
|
-
return /* @__PURE__ */ (0,
|
|
12365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12233
12366
|
"div",
|
|
12234
12367
|
{
|
|
12235
12368
|
className: (0, import_clsx21.default)("flex-row-2 justify-between", className),
|
|
12236
12369
|
children: [
|
|
12237
|
-
/* @__PURE__ */ (0,
|
|
12370
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex-row-2 flex-[2] justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12238
12371
|
Button,
|
|
12239
12372
|
{
|
|
12240
12373
|
disabled: currentStep === 0 || disabledSteps.has(currentStep),
|
|
@@ -12243,14 +12376,14 @@ var StepperBar = ({
|
|
|
12243
12376
|
},
|
|
12244
12377
|
className: "flex-row-1 items-center justify-center",
|
|
12245
12378
|
children: [
|
|
12246
|
-
/* @__PURE__ */ (0,
|
|
12379
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react13.ChevronLeft, { size: 14 }),
|
|
12247
12380
|
translation("back")
|
|
12248
12381
|
]
|
|
12249
12382
|
}
|
|
12250
12383
|
) }),
|
|
12251
|
-
/* @__PURE__ */ (0,
|
|
12384
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex-row-2 flex-[5] justify-center items-center", children: showDots && dots.map((value, index) => {
|
|
12252
12385
|
const seen = seenSteps.has(index);
|
|
12253
|
-
return /* @__PURE__ */ (0,
|
|
12386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12254
12387
|
"div",
|
|
12255
12388
|
{
|
|
12256
12389
|
onClick: () => seen && update(index),
|
|
@@ -12270,7 +12403,7 @@ var StepperBar = ({
|
|
|
12270
12403
|
index
|
|
12271
12404
|
);
|
|
12272
12405
|
}) }),
|
|
12273
|
-
currentStep !== numberOfSteps && /* @__PURE__ */ (0,
|
|
12406
|
+
currentStep !== numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12274
12407
|
Button,
|
|
12275
12408
|
{
|
|
12276
12409
|
onClick: () => update(currentStep + 1),
|
|
@@ -12278,18 +12411,18 @@ var StepperBar = ({
|
|
|
12278
12411
|
disabled: disabledSteps.has(currentStep),
|
|
12279
12412
|
children: [
|
|
12280
12413
|
translation("next"),
|
|
12281
|
-
/* @__PURE__ */ (0,
|
|
12414
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react13.ChevronRight, { size: 14 })
|
|
12282
12415
|
]
|
|
12283
12416
|
}
|
|
12284
12417
|
) }),
|
|
12285
|
-
currentStep === numberOfSteps && /* @__PURE__ */ (0,
|
|
12418
|
+
currentStep === numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12286
12419
|
Button,
|
|
12287
12420
|
{
|
|
12288
12421
|
disabled: disabledSteps.has(currentStep),
|
|
12289
12422
|
onClick: onFinish,
|
|
12290
12423
|
className: "flex-row-1 items-center justify-center",
|
|
12291
12424
|
children: [
|
|
12292
|
-
/* @__PURE__ */ (0,
|
|
12425
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react13.Check, { size: 14 }),
|
|
12293
12426
|
finishText ?? translation("confirm")
|
|
12294
12427
|
]
|
|
12295
12428
|
}
|
|
@@ -12300,7 +12433,7 @@ var StepperBar = ({
|
|
|
12300
12433
|
};
|
|
12301
12434
|
var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
|
|
12302
12435
|
const [usedState, setUsedState] = useOverwritableState(state, onChange);
|
|
12303
|
-
return /* @__PURE__ */ (0,
|
|
12436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12304
12437
|
StepperBar,
|
|
12305
12438
|
{
|
|
12306
12439
|
...props,
|
|
@@ -12311,15 +12444,15 @@ var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
|
|
|
12311
12444
|
};
|
|
12312
12445
|
|
|
12313
12446
|
// src/components/layout/table/FillerCell.tsx
|
|
12314
|
-
var
|
|
12315
|
-
var
|
|
12447
|
+
var import_lucide_react14 = require("lucide-react");
|
|
12448
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
12316
12449
|
var FillerCell = ({ ...props }) => {
|
|
12317
|
-
return /* @__PURE__ */ (0,
|
|
12450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12318
12451
|
"div",
|
|
12319
12452
|
{
|
|
12320
12453
|
...props,
|
|
12321
12454
|
"data-name": PropsUtil.dataAttributes.name("table-filler-cell"),
|
|
12322
|
-
children: /* @__PURE__ */ (0,
|
|
12455
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react14.Minus, { className: "max-w-4 max-h-4" })
|
|
12323
12456
|
}
|
|
12324
12457
|
);
|
|
12325
12458
|
};
|
|
@@ -12339,24 +12472,24 @@ var TableFilters = {
|
|
|
12339
12472
|
};
|
|
12340
12473
|
|
|
12341
12474
|
// src/components/layout/table/Table.tsx
|
|
12342
|
-
var
|
|
12475
|
+
var import_react51 = require("react");
|
|
12343
12476
|
var import_clsx26 = __toESM(require("clsx"));
|
|
12344
12477
|
var import_react_table = require("@tanstack/react-table");
|
|
12345
12478
|
|
|
12346
12479
|
// src/components/layout/table/TableCell.tsx
|
|
12347
12480
|
var import_clsx22 = require("clsx");
|
|
12348
|
-
var
|
|
12481
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
12349
12482
|
var TableCell = ({
|
|
12350
12483
|
children,
|
|
12351
12484
|
className
|
|
12352
12485
|
}) => {
|
|
12353
|
-
return /* @__PURE__ */ (0,
|
|
12486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: (0, import_clsx22.clsx)("block max-w-full overflow-ellipsis truncate", className), children });
|
|
12354
12487
|
};
|
|
12355
12488
|
|
|
12356
12489
|
// src/hooks/useResizeCallbackWrapper.ts
|
|
12357
|
-
var
|
|
12490
|
+
var import_react44 = require("react");
|
|
12358
12491
|
var useResizeCallbackWrapper = (callback) => {
|
|
12359
|
-
(0,
|
|
12492
|
+
(0, import_react44.useEffect)(() => {
|
|
12360
12493
|
window.addEventListener("resize", callback);
|
|
12361
12494
|
return () => {
|
|
12362
12495
|
window.removeEventListener("resize", callback);
|
|
@@ -12365,14 +12498,14 @@ var useResizeCallbackWrapper = (callback) => {
|
|
|
12365
12498
|
};
|
|
12366
12499
|
|
|
12367
12500
|
// src/components/layout/table/TableSortButton.tsx
|
|
12368
|
-
var
|
|
12501
|
+
var import_lucide_react15 = require("lucide-react");
|
|
12369
12502
|
var import_clsx24 = __toESM(require("clsx"));
|
|
12370
12503
|
|
|
12371
12504
|
// src/components/user-interaction/Tooltip.tsx
|
|
12372
|
-
var
|
|
12505
|
+
var import_react45 = require("react");
|
|
12373
12506
|
var import_clsx23 = require("clsx");
|
|
12374
12507
|
var import_react_dom6 = require("react-dom");
|
|
12375
|
-
var
|
|
12508
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
12376
12509
|
var Tooltip = ({
|
|
12377
12510
|
tooltip,
|
|
12378
12511
|
children,
|
|
@@ -12383,52 +12516,52 @@ var Tooltip = ({
|
|
|
12383
12516
|
position = "bottom",
|
|
12384
12517
|
disabled = false
|
|
12385
12518
|
}) => {
|
|
12386
|
-
const [state, setState] = (0,
|
|
12519
|
+
const [state, setState] = (0, import_react45.useState)({
|
|
12387
12520
|
isShown: false,
|
|
12388
12521
|
timer: null
|
|
12389
12522
|
});
|
|
12390
12523
|
const { config } = useHightideConfig();
|
|
12391
|
-
const appearDelay = (0,
|
|
12524
|
+
const appearDelay = (0, import_react45.useMemo)(
|
|
12392
12525
|
() => appearDelayOverwrite ?? config.tooltip.appearDelay,
|
|
12393
12526
|
[config.tooltip.appearDelay, appearDelayOverwrite]
|
|
12394
12527
|
);
|
|
12395
|
-
const disappearDelay = (0,
|
|
12528
|
+
const disappearDelay = (0, import_react45.useMemo)(
|
|
12396
12529
|
() => disappearDelayOverwrite ?? config.tooltip.disappearDelay,
|
|
12397
12530
|
[config.tooltip.disappearDelay, disappearDelayOverwrite]
|
|
12398
12531
|
);
|
|
12399
|
-
const anchorRef = (0,
|
|
12400
|
-
const containerRef = (0,
|
|
12401
|
-
const triangleRef = (0,
|
|
12532
|
+
const anchorRef = (0, import_react45.useRef)(null);
|
|
12533
|
+
const containerRef = (0, import_react45.useRef)(null);
|
|
12534
|
+
const triangleRef = (0, import_react45.useRef)(null);
|
|
12402
12535
|
const isActive = !disabled && state.isShown;
|
|
12403
12536
|
const { isVisible, transitionState, callbacks } = useTransitionState(
|
|
12404
|
-
(0,
|
|
12537
|
+
(0, import_react45.useMemo)(() => ({ isOpen: isActive }), [isActive])
|
|
12405
12538
|
);
|
|
12406
|
-
const verticalAlignment = (0,
|
|
12539
|
+
const verticalAlignment = (0, import_react45.useMemo)(
|
|
12407
12540
|
() => position === "top" ? "beforeStart" : position === "bottom" ? "afterEnd" : "center",
|
|
12408
12541
|
[position]
|
|
12409
12542
|
);
|
|
12410
|
-
const horizontalAlignment = (0,
|
|
12543
|
+
const horizontalAlignment = (0, import_react45.useMemo)(
|
|
12411
12544
|
() => position === "left" ? "beforeStart" : position === "right" ? "afterEnd" : "center",
|
|
12412
12545
|
[position]
|
|
12413
12546
|
);
|
|
12414
|
-
const css = useFloatingElement((0,
|
|
12547
|
+
const css = useFloatingElement((0, import_react45.useMemo)(() => ({
|
|
12415
12548
|
active: isActive || isVisible,
|
|
12416
12549
|
anchorRef,
|
|
12417
12550
|
containerRef,
|
|
12418
12551
|
horizontalAlignment,
|
|
12419
12552
|
verticalAlignment
|
|
12420
12553
|
}), [horizontalAlignment, isActive, isVisible, verticalAlignment]));
|
|
12421
|
-
const cssTriangle = useFloatingElement((0,
|
|
12554
|
+
const cssTriangle = useFloatingElement((0, import_react45.useMemo)(() => ({
|
|
12422
12555
|
active: isActive || isVisible,
|
|
12423
12556
|
anchorRef,
|
|
12424
12557
|
containerRef: triangleRef,
|
|
12425
12558
|
horizontalAlignment,
|
|
12426
12559
|
verticalAlignment
|
|
12427
12560
|
}), [horizontalAlignment, isActive, isVisible, verticalAlignment]));
|
|
12428
|
-
const regsitryOptions = (0,
|
|
12561
|
+
const regsitryOptions = (0, import_react45.useMemo)(() => ({ isActive }), [isActive]);
|
|
12429
12562
|
const { zIndex } = useOverlayRegistry(regsitryOptions);
|
|
12430
12563
|
const { zIndex: zIndexTriangle } = useOverlayRegistry(regsitryOptions);
|
|
12431
|
-
const onEnter = (0,
|
|
12564
|
+
const onEnter = (0, import_react45.useCallback)(() => {
|
|
12432
12565
|
setState((prevState) => {
|
|
12433
12566
|
if (prevState.isShown) {
|
|
12434
12567
|
clearTimeout(prevState.timer);
|
|
@@ -12448,7 +12581,7 @@ var Tooltip = ({
|
|
|
12448
12581
|
};
|
|
12449
12582
|
});
|
|
12450
12583
|
}, [appearDelay]);
|
|
12451
|
-
const onLeave = (0,
|
|
12584
|
+
const onLeave = (0, import_react45.useCallback)(() => {
|
|
12452
12585
|
setState((prevState) => {
|
|
12453
12586
|
if (!prevState.isShown) {
|
|
12454
12587
|
clearTimeout(prevState.timer);
|
|
@@ -12469,7 +12602,7 @@ var Tooltip = ({
|
|
|
12469
12602
|
};
|
|
12470
12603
|
});
|
|
12471
12604
|
}, [disappearDelay]);
|
|
12472
|
-
return /* @__PURE__ */ (0,
|
|
12605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
12473
12606
|
"div",
|
|
12474
12607
|
{
|
|
12475
12608
|
ref: anchorRef,
|
|
@@ -12478,9 +12611,9 @@ var Tooltip = ({
|
|
|
12478
12611
|
onPointerLeave: onLeave,
|
|
12479
12612
|
children: [
|
|
12480
12613
|
children,
|
|
12481
|
-
/* @__PURE__ */ (0,
|
|
12614
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Visibility, { isVisible: isActive || isVisible, children: [
|
|
12482
12615
|
(0, import_react_dom6.createPortal)(
|
|
12483
|
-
/* @__PURE__ */ (0,
|
|
12616
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12484
12617
|
"div",
|
|
12485
12618
|
{
|
|
12486
12619
|
ref: containerRef,
|
|
@@ -12496,7 +12629,7 @@ var Tooltip = ({
|
|
|
12496
12629
|
document.body
|
|
12497
12630
|
),
|
|
12498
12631
|
(0, import_react_dom6.createPortal)(
|
|
12499
|
-
/* @__PURE__ */ (0,
|
|
12632
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12500
12633
|
"div",
|
|
12501
12634
|
{
|
|
12502
12635
|
ref: triangleRef,
|
|
@@ -12515,7 +12648,7 @@ var Tooltip = ({
|
|
|
12515
12648
|
};
|
|
12516
12649
|
|
|
12517
12650
|
// src/components/layout/table/TableSortButton.tsx
|
|
12518
|
-
var
|
|
12651
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
12519
12652
|
var TableSortButton = ({
|
|
12520
12653
|
sortDirection,
|
|
12521
12654
|
invert = false,
|
|
@@ -12527,16 +12660,16 @@ var TableSortButton = ({
|
|
|
12527
12660
|
}) => {
|
|
12528
12661
|
const translation = useHightideTranslation();
|
|
12529
12662
|
const { sortingsCount, index } = sortingIndexDisplay;
|
|
12530
|
-
let icon = /* @__PURE__ */ (0,
|
|
12663
|
+
let icon = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react15.ChevronsUpDown, { className: "size-4" });
|
|
12531
12664
|
if (sortDirection) {
|
|
12532
12665
|
let usedSortDirection = sortDirection;
|
|
12533
12666
|
if (invert) {
|
|
12534
12667
|
usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
|
|
12535
12668
|
}
|
|
12536
|
-
icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0,
|
|
12669
|
+
icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react15.ChevronUp, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react15.ChevronDown, { className: "size-4" });
|
|
12537
12670
|
}
|
|
12538
12671
|
const hasSortingIndex = !!sortingIndexDisplay && sortingsCount > 1 && index > 0;
|
|
12539
|
-
return /* @__PURE__ */ (0,
|
|
12672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Tooltip, { tooltip: translation("rSortingOrderAfter", { otherSortings: index - 1 }), disabled: !hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
12540
12673
|
Button,
|
|
12541
12674
|
{
|
|
12542
12675
|
layout: hasSortingIndex ? "default" : "icon",
|
|
@@ -12545,7 +12678,7 @@ var TableSortButton = ({
|
|
|
12545
12678
|
className: (0, import_clsx24.default)("relative", className),
|
|
12546
12679
|
...props,
|
|
12547
12680
|
children: [
|
|
12548
|
-
/* @__PURE__ */ (0,
|
|
12681
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12549
12682
|
"div",
|
|
12550
12683
|
{
|
|
12551
12684
|
className: (0, import_clsx24.default)("absolute bottom-0 right-1/2 translate-x-1/2 translate-y-2/3 z-1 primary coloring-solid rounded-full h-4 w-5 text-sm"),
|
|
@@ -12559,10 +12692,10 @@ var TableSortButton = ({
|
|
|
12559
12692
|
};
|
|
12560
12693
|
|
|
12561
12694
|
// src/components/layout/table/TableFilterButton.tsx
|
|
12562
|
-
var
|
|
12695
|
+
var import_lucide_react16 = require("lucide-react");
|
|
12563
12696
|
|
|
12564
12697
|
// src/components/user-interaction/Menu.tsx
|
|
12565
|
-
var
|
|
12698
|
+
var import_react48 = require("react");
|
|
12566
12699
|
var import_clsx25 = __toESM(require("clsx"));
|
|
12567
12700
|
|
|
12568
12701
|
// src/utils/bagFunctions.ts
|
|
@@ -12634,15 +12767,15 @@ var usePopoverPosition = (trigger, options) => {
|
|
|
12634
12767
|
};
|
|
12635
12768
|
|
|
12636
12769
|
// src/hooks/useHoverState.ts
|
|
12637
|
-
var
|
|
12770
|
+
var import_react46 = require("react");
|
|
12638
12771
|
var defaultUseHoverStateProps = {
|
|
12639
12772
|
closingDelay: 200,
|
|
12640
12773
|
isDisabled: false
|
|
12641
12774
|
};
|
|
12642
12775
|
var useHoverState = (props = void 0) => {
|
|
12643
12776
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
12644
|
-
const [isHovered, setIsHovered] = (0,
|
|
12645
|
-
const [timer, setTimer] = (0,
|
|
12777
|
+
const [isHovered, setIsHovered] = (0, import_react46.useState)(false);
|
|
12778
|
+
const [timer, setTimer] = (0, import_react46.useState)();
|
|
12646
12779
|
const onMouseEnter = () => {
|
|
12647
12780
|
if (isDisabled) {
|
|
12648
12781
|
return;
|
|
@@ -12658,14 +12791,14 @@ var useHoverState = (props = void 0) => {
|
|
|
12658
12791
|
setIsHovered(false);
|
|
12659
12792
|
}, closingDelay));
|
|
12660
12793
|
};
|
|
12661
|
-
(0,
|
|
12794
|
+
(0, import_react46.useEffect)(() => {
|
|
12662
12795
|
if (timer) {
|
|
12663
12796
|
return () => {
|
|
12664
12797
|
clearTimeout(timer);
|
|
12665
12798
|
};
|
|
12666
12799
|
}
|
|
12667
12800
|
});
|
|
12668
|
-
(0,
|
|
12801
|
+
(0, import_react46.useEffect)(() => {
|
|
12669
12802
|
if (timer) {
|
|
12670
12803
|
clearTimeout(timer);
|
|
12671
12804
|
}
|
|
@@ -12678,9 +12811,9 @@ var useHoverState = (props = void 0) => {
|
|
|
12678
12811
|
};
|
|
12679
12812
|
|
|
12680
12813
|
// src/hooks/useOutsideClick.ts
|
|
12681
|
-
var
|
|
12814
|
+
var import_react47 = require("react");
|
|
12682
12815
|
var useOutsideClick = (refs, handler) => {
|
|
12683
|
-
(0,
|
|
12816
|
+
(0, import_react47.useEffect)(() => {
|
|
12684
12817
|
const listener = (event) => {
|
|
12685
12818
|
if (event.target === null) return;
|
|
12686
12819
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -12698,14 +12831,14 @@ var useOutsideClick = (refs, handler) => {
|
|
|
12698
12831
|
};
|
|
12699
12832
|
|
|
12700
12833
|
// src/components/user-interaction/Menu.tsx
|
|
12701
|
-
var
|
|
12834
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
12702
12835
|
var MenuItem = ({
|
|
12703
12836
|
children,
|
|
12704
12837
|
onClick,
|
|
12705
12838
|
alignment = "left",
|
|
12706
12839
|
isDisabled = false,
|
|
12707
12840
|
className
|
|
12708
|
-
}) => /* @__PURE__ */ (0,
|
|
12841
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12709
12842
|
"div",
|
|
12710
12843
|
{
|
|
12711
12844
|
className: (0, import_clsx25.default)("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
|
|
@@ -12738,10 +12871,10 @@ var Menu = ({
|
|
|
12738
12871
|
menuClassName = ""
|
|
12739
12872
|
}) => {
|
|
12740
12873
|
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
12741
|
-
const triggerRef = (0,
|
|
12742
|
-
const menuRef = (0,
|
|
12874
|
+
const triggerRef = (0, import_react48.useRef)(null);
|
|
12875
|
+
const menuRef = (0, import_react48.useRef)(null);
|
|
12743
12876
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
12744
|
-
const [isHidden, setIsHidden] = (0,
|
|
12877
|
+
const [isHidden, setIsHidden] = (0, import_react48.useState)(true);
|
|
12745
12878
|
const bag = {
|
|
12746
12879
|
isOpen,
|
|
12747
12880
|
close: () => setIsOpen(false),
|
|
@@ -12752,7 +12885,7 @@ var Menu = ({
|
|
|
12752
12885
|
triggerRef.current?.getBoundingClientRect(),
|
|
12753
12886
|
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
12754
12887
|
);
|
|
12755
|
-
(0,
|
|
12888
|
+
(0, import_react48.useEffect)(() => {
|
|
12756
12889
|
if (!isOpen) return;
|
|
12757
12890
|
const triggerEl = triggerRef.current;
|
|
12758
12891
|
if (!triggerEl) return;
|
|
@@ -12769,7 +12902,7 @@ var Menu = ({
|
|
|
12769
12902
|
window.removeEventListener("resize", close3);
|
|
12770
12903
|
};
|
|
12771
12904
|
}, [isOpen, setIsOpen]);
|
|
12772
|
-
(0,
|
|
12905
|
+
(0, import_react48.useEffect)(() => {
|
|
12773
12906
|
if (isOpen) {
|
|
12774
12907
|
setIsHidden(false);
|
|
12775
12908
|
}
|
|
@@ -12777,9 +12910,9 @@ var Menu = ({
|
|
|
12777
12910
|
const { zIndex } = useOverlayRegistry({
|
|
12778
12911
|
isActive: isOpen
|
|
12779
12912
|
});
|
|
12780
|
-
return /* @__PURE__ */ (0,
|
|
12781
|
-
trigger(bag, (0,
|
|
12782
|
-
(0, import_react_dom7.createPortal)(/* @__PURE__ */ (0,
|
|
12913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
12914
|
+
trigger(bag, (0, import_react48.useCallback)((el) => triggerRef.current = el, [])),
|
|
12915
|
+
(0, import_react_dom7.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12783
12916
|
"div",
|
|
12784
12917
|
{
|
|
12785
12918
|
ref: menuRef,
|
|
@@ -12809,34 +12942,34 @@ var Menu = ({
|
|
|
12809
12942
|
};
|
|
12810
12943
|
|
|
12811
12944
|
// src/components/layout/table/TableFilterButton.tsx
|
|
12812
|
-
var
|
|
12813
|
-
var
|
|
12945
|
+
var import_react49 = require("react");
|
|
12946
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
12814
12947
|
var TableFilterButton = ({
|
|
12815
12948
|
filterType,
|
|
12816
12949
|
column
|
|
12817
12950
|
}) => {
|
|
12818
12951
|
const translation = useHightideTranslation();
|
|
12819
12952
|
const columnFilterValue = column.getFilterValue();
|
|
12820
|
-
const [filterValue, setFilterValue] = (0,
|
|
12953
|
+
const [filterValue, setFilterValue] = (0, import_react49.useState)(columnFilterValue);
|
|
12821
12954
|
const hasFilter = !!filterValue;
|
|
12822
|
-
(0,
|
|
12955
|
+
(0, import_react49.useEffect)(() => {
|
|
12823
12956
|
setFilterValue(columnFilterValue);
|
|
12824
12957
|
}, [columnFilterValue]);
|
|
12825
|
-
return /* @__PURE__ */ (0,
|
|
12958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12826
12959
|
Menu,
|
|
12827
12960
|
{
|
|
12828
|
-
trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ (0,
|
|
12829
|
-
/* @__PURE__ */ (0,
|
|
12961
|
+
trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { ref, className: "relative", children: [
|
|
12962
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12830
12963
|
Button,
|
|
12831
12964
|
{
|
|
12832
12965
|
layout: "icon",
|
|
12833
12966
|
color: "neutral",
|
|
12834
12967
|
size: "xs",
|
|
12835
12968
|
onClick: toggleOpen,
|
|
12836
|
-
children: /* @__PURE__ */ (0,
|
|
12969
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react16.FilterIcon, { className: "size-4" })
|
|
12837
12970
|
}
|
|
12838
12971
|
),
|
|
12839
|
-
hasFilter && /* @__PURE__ */ (0,
|
|
12972
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12840
12973
|
"div",
|
|
12841
12974
|
{
|
|
12842
12975
|
className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-primary pointer-events-none",
|
|
@@ -12844,9 +12977,9 @@ var TableFilterButton = ({
|
|
|
12844
12977
|
}
|
|
12845
12978
|
)
|
|
12846
12979
|
] }),
|
|
12847
|
-
children: ({ close: close3 }) => /* @__PURE__ */ (0,
|
|
12848
|
-
/* @__PURE__ */ (0,
|
|
12849
|
-
filterType === "text" && /* @__PURE__ */ (0,
|
|
12980
|
+
children: ({ close: close3 }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex-col-1 p-2 items-start font-normal text-menu-text", children: [
|
|
12981
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h4", { className: "typography-label-md-semibold", children: translation("filter") }),
|
|
12982
|
+
filterType === "text" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12850
12983
|
Input,
|
|
12851
12984
|
{
|
|
12852
12985
|
value: filterValue ?? "",
|
|
@@ -12856,8 +12989,8 @@ var TableFilterButton = ({
|
|
|
12856
12989
|
className: "h-10"
|
|
12857
12990
|
}
|
|
12858
12991
|
),
|
|
12859
|
-
filterType === "range" && /* @__PURE__ */ (0,
|
|
12860
|
-
/* @__PURE__ */ (0,
|
|
12992
|
+
filterType === "range" && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
12993
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12861
12994
|
Input,
|
|
12862
12995
|
{
|
|
12863
12996
|
value: filterValue?.[0].toString() ?? "",
|
|
@@ -12870,8 +13003,8 @@ var TableFilterButton = ({
|
|
|
12870
13003
|
className: "h-10 input-indicator-hidden w-40"
|
|
12871
13004
|
}
|
|
12872
13005
|
),
|
|
12873
|
-
/* @__PURE__ */ (0,
|
|
12874
|
-
/* @__PURE__ */ (0,
|
|
13006
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "font-bold", children: "-" }),
|
|
13007
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12875
13008
|
Input,
|
|
12876
13009
|
{
|
|
12877
13010
|
value: filterValue?.[1].toString() ?? "",
|
|
@@ -12885,8 +13018,8 @@ var TableFilterButton = ({
|
|
|
12885
13018
|
}
|
|
12886
13019
|
)
|
|
12887
13020
|
] }),
|
|
12888
|
-
filterType === "dateRange" && /* @__PURE__ */ (0,
|
|
12889
|
-
/* @__PURE__ */ (0,
|
|
13021
|
+
filterType === "dateRange" && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
13022
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12890
13023
|
Input,
|
|
12891
13024
|
{
|
|
12892
13025
|
value: filterValue?.[0] ? filterValue?.[0].toISOString().slice(0, 16) : "",
|
|
@@ -12899,7 +13032,7 @@ var TableFilterButton = ({
|
|
|
12899
13032
|
className: "h-10 w-50"
|
|
12900
13033
|
}
|
|
12901
13034
|
),
|
|
12902
|
-
/* @__PURE__ */ (0,
|
|
13035
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12903
13036
|
Input,
|
|
12904
13037
|
{
|
|
12905
13038
|
value: filterValue?.[1] ? filterValue?.[1].toISOString().slice(0, 16) : "",
|
|
@@ -12913,12 +13046,12 @@ var TableFilterButton = ({
|
|
|
12913
13046
|
}
|
|
12914
13047
|
)
|
|
12915
13048
|
] }),
|
|
12916
|
-
/* @__PURE__ */ (0,
|
|
12917
|
-
hasFilter && /* @__PURE__ */ (0,
|
|
13049
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex-row-2 justify-end w-full", children: [
|
|
13050
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Button, { color: "negative", size: "sm", onClick: () => {
|
|
12918
13051
|
column.setFilterValue(void 0);
|
|
12919
13052
|
close3();
|
|
12920
13053
|
}, children: translation("remove") }),
|
|
12921
|
-
/* @__PURE__ */ (0,
|
|
13054
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Button, { size: "sm", onClick: () => {
|
|
12922
13055
|
column.setFilterValue(filterValue);
|
|
12923
13056
|
close3();
|
|
12924
13057
|
}, children: translation("apply") })
|
|
@@ -12929,9 +13062,9 @@ var TableFilterButton = ({
|
|
|
12929
13062
|
};
|
|
12930
13063
|
|
|
12931
13064
|
// src/components/user-interaction/Checkbox.tsx
|
|
12932
|
-
var
|
|
12933
|
-
var
|
|
12934
|
-
var
|
|
13065
|
+
var import_lucide_react17 = require("lucide-react");
|
|
13066
|
+
var import_react50 = require("react");
|
|
13067
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
12935
13068
|
var Checkbox = ({
|
|
12936
13069
|
value = false,
|
|
12937
13070
|
indeterminate = false,
|
|
@@ -12945,11 +13078,11 @@ var Checkbox = ({
|
|
|
12945
13078
|
alwaysShowCheckIcon = false,
|
|
12946
13079
|
...props
|
|
12947
13080
|
}) => {
|
|
12948
|
-
const onChangeWrapper = (0,
|
|
13081
|
+
const onChangeWrapper = (0, import_react50.useCallback)(() => {
|
|
12949
13082
|
onValueChange?.(!value);
|
|
12950
13083
|
onEditComplete?.(!value);
|
|
12951
13084
|
}, [onEditComplete, onValueChange, value]);
|
|
12952
|
-
return /* @__PURE__ */ (0,
|
|
13085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
12953
13086
|
"div",
|
|
12954
13087
|
{
|
|
12955
13088
|
...props,
|
|
@@ -12976,8 +13109,8 @@ var Checkbox = ({
|
|
|
12976
13109
|
"aria-checked": indeterminate ? "mixed" : value,
|
|
12977
13110
|
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
12978
13111
|
children: [
|
|
12979
|
-
/* @__PURE__ */ (0,
|
|
12980
|
-
/* @__PURE__ */ (0,
|
|
13112
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react17.Minus, { "data-name": "checkbox-indicator", "aria-hidden": true }) }),
|
|
13113
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react17.Check, { "data-name": "checkbox-indicator", "aria-hidden": true }) })
|
|
12981
13114
|
]
|
|
12982
13115
|
}
|
|
12983
13116
|
);
|
|
@@ -12988,7 +13121,7 @@ var CheckboxUncontrolled = ({
|
|
|
12988
13121
|
...props
|
|
12989
13122
|
}) => {
|
|
12990
13123
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
12991
|
-
return /* @__PURE__ */ (0,
|
|
13124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12992
13125
|
Checkbox,
|
|
12993
13126
|
{
|
|
12994
13127
|
...props,
|
|
@@ -12999,7 +13132,7 @@ var CheckboxUncontrolled = ({
|
|
|
12999
13132
|
};
|
|
13000
13133
|
|
|
13001
13134
|
// src/components/layout/table/Table.tsx
|
|
13002
|
-
var
|
|
13135
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
13003
13136
|
var Table = ({
|
|
13004
13137
|
data,
|
|
13005
13138
|
fillerRow,
|
|
@@ -13013,22 +13146,22 @@ var Table = ({
|
|
|
13013
13146
|
columns,
|
|
13014
13147
|
...tableOptions
|
|
13015
13148
|
}) => {
|
|
13016
|
-
const ref = (0,
|
|
13017
|
-
const tableRef = (0,
|
|
13018
|
-
const [columnSizing, setColumnSizing] = (0,
|
|
13149
|
+
const ref = (0, import_react51.useRef)(null);
|
|
13150
|
+
const tableRef = (0, import_react51.useRef)(null);
|
|
13151
|
+
const [columnSizing, setColumnSizing] = (0, import_react51.useState)(columns.reduce((previousValue, currentValue) => {
|
|
13019
13152
|
return {
|
|
13020
13153
|
...previousValue,
|
|
13021
13154
|
[currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
|
|
13022
13155
|
};
|
|
13023
13156
|
}, {}));
|
|
13024
|
-
const [columnSizingInfo, setColumnSizingInfo] = (0,
|
|
13025
|
-
const [pagination, setPagination] = (0,
|
|
13157
|
+
const [columnSizingInfo, setColumnSizingInfo] = (0, import_react51.useState)();
|
|
13158
|
+
const [pagination, setPagination] = (0, import_react51.useState)({
|
|
13026
13159
|
pageSize: 10,
|
|
13027
13160
|
pageIndex: 0,
|
|
13028
13161
|
...initialState?.pagination
|
|
13029
13162
|
});
|
|
13030
|
-
const [columnFilters, setColumnFilters] = (0,
|
|
13031
|
-
const computedColumnMinWidths = (0,
|
|
13163
|
+
const [columnFilters, setColumnFilters] = (0, import_react51.useState)(initialState?.columnFilters);
|
|
13164
|
+
const computedColumnMinWidths = (0, import_react51.useMemo)(() => {
|
|
13032
13165
|
return columns.reduce((previousValue, column) => {
|
|
13033
13166
|
return {
|
|
13034
13167
|
...previousValue,
|
|
@@ -13037,7 +13170,7 @@ var Table = ({
|
|
|
13037
13170
|
};
|
|
13038
13171
|
}, {});
|
|
13039
13172
|
}, [columns, defaultColumn]);
|
|
13040
|
-
const computedColumnMaxWidths = (0,
|
|
13173
|
+
const computedColumnMaxWidths = (0, import_react51.useMemo)(() => {
|
|
13041
13174
|
return columns.reduce((previousValue, column) => {
|
|
13042
13175
|
return {
|
|
13043
13176
|
...previousValue,
|
|
@@ -13045,12 +13178,12 @@ var Table = ({
|
|
|
13045
13178
|
};
|
|
13046
13179
|
}, {});
|
|
13047
13180
|
}, [columns, defaultColumn]);
|
|
13048
|
-
const tableMinWidth = (0,
|
|
13181
|
+
const tableMinWidth = (0, import_react51.useMemo)(() => {
|
|
13049
13182
|
return columns.reduce((sum, column) => {
|
|
13050
13183
|
return sum + computedColumnMinWidths[column.id];
|
|
13051
13184
|
}, 0);
|
|
13052
13185
|
}, [columns, computedColumnMinWidths]);
|
|
13053
|
-
const updateColumnSizes = (0,
|
|
13186
|
+
const updateColumnSizes = (0, import_react51.useMemo)(() => {
|
|
13054
13187
|
return (previous) => {
|
|
13055
13188
|
const updateSizing = {
|
|
13056
13189
|
...columnSizing,
|
|
@@ -13119,7 +13252,7 @@ var Table = ({
|
|
|
13119
13252
|
minSize: 60,
|
|
13120
13253
|
maxSize: 700,
|
|
13121
13254
|
cell: ({ cell }) => {
|
|
13122
|
-
return /* @__PURE__ */ (0,
|
|
13255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TableCell, { children: cell.getValue() });
|
|
13123
13256
|
},
|
|
13124
13257
|
...defaultColumn
|
|
13125
13258
|
},
|
|
@@ -13167,18 +13300,18 @@ var Table = ({
|
|
|
13167
13300
|
columnResizeMode: "onChange",
|
|
13168
13301
|
...tableOptions
|
|
13169
13302
|
});
|
|
13170
|
-
const [hasInitializedSizing, setHasInitializedSizing] = (0,
|
|
13171
|
-
(0,
|
|
13303
|
+
const [hasInitializedSizing, setHasInitializedSizing] = (0, import_react51.useState)(false);
|
|
13304
|
+
(0, import_react51.useEffect)(() => {
|
|
13172
13305
|
if (!hasInitializedSizing && ref.current) {
|
|
13173
13306
|
setHasInitializedSizing(true);
|
|
13174
13307
|
table.setColumnSizing(updateColumnSizes(columnSizing));
|
|
13175
13308
|
}
|
|
13176
13309
|
}, [columnSizing, hasInitializedSizing]);
|
|
13177
|
-
useResizeCallbackWrapper((0,
|
|
13310
|
+
useResizeCallbackWrapper((0, import_react51.useCallback)(() => {
|
|
13178
13311
|
table.setColumnSizing(updateColumnSizes);
|
|
13179
13312
|
}, [updateColumnSizes]));
|
|
13180
13313
|
const pageCount = table.getPageCount();
|
|
13181
|
-
(0,
|
|
13314
|
+
(0, import_react51.useEffect)(() => {
|
|
13182
13315
|
const totalPages = pageCount;
|
|
13183
13316
|
if (totalPages === 0) {
|
|
13184
13317
|
if (pagination.pageIndex !== 0) {
|
|
@@ -13194,7 +13327,7 @@ var Table = ({
|
|
|
13194
13327
|
}));
|
|
13195
13328
|
}
|
|
13196
13329
|
}, [data, pageCount, pagination.pageSize, pagination.pageIndex]);
|
|
13197
|
-
const columnSizeVars = (0,
|
|
13330
|
+
const columnSizeVars = (0, import_react51.useMemo)(() => {
|
|
13198
13331
|
const headers = table.getFlatHeaders();
|
|
13199
13332
|
const colSizes = {};
|
|
13200
13333
|
for (let i = 0; i < headers.length; i++) {
|
|
@@ -13204,8 +13337,8 @@ var Table = ({
|
|
|
13204
13337
|
}
|
|
13205
13338
|
return colSizes;
|
|
13206
13339
|
}, [table.getState().columnSizingInfo, table.getState().columnSizing]);
|
|
13207
|
-
return /* @__PURE__ */ (0,
|
|
13208
|
-
/* @__PURE__ */ (0,
|
|
13340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { ref, "data-name": PropsUtil.dataAttributes.name("table-container"), className, children: [
|
|
13341
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { "data-name": PropsUtil.dataAttributes.name("table-scroll-wrapper"), className: tableContainerClassName, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
13209
13342
|
"table",
|
|
13210
13343
|
{
|
|
13211
13344
|
ref: tableRef,
|
|
@@ -13216,7 +13349,7 @@ var Table = ({
|
|
|
13216
13349
|
},
|
|
13217
13350
|
className: tableClassName,
|
|
13218
13351
|
children: [
|
|
13219
|
-
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0,
|
|
13352
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13220
13353
|
"col",
|
|
13221
13354
|
{
|
|
13222
13355
|
style: {
|
|
@@ -13227,16 +13360,16 @@ var Table = ({
|
|
|
13227
13360
|
},
|
|
13228
13361
|
header.id
|
|
13229
13362
|
)) }, headerGroup.id)),
|
|
13230
|
-
/* @__PURE__ */ (0,
|
|
13231
|
-
return /* @__PURE__ */ (0,
|
|
13363
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("tr", { "data-name": PropsUtil.dataAttributes.name("table-header-row"), className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
|
|
13364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
13232
13365
|
"th",
|
|
13233
13366
|
{
|
|
13234
13367
|
colSpan: header.colSpan,
|
|
13235
13368
|
"data-name": PropsUtil.dataAttributes.name("table-header-cell"),
|
|
13236
13369
|
className: (0, import_clsx26.default)("group/table-header-cell", header.column.columnDef.meta?.className),
|
|
13237
13370
|
children: [
|
|
13238
|
-
/* @__PURE__ */ (0,
|
|
13239
|
-
/* @__PURE__ */ (0,
|
|
13371
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Visibility, { isVisible: !header.isPlaceholder, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex-row-1 items-center", children: [
|
|
13372
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Visibility, { isVisible: header.column.getCanSort(), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13240
13373
|
TableSortButton,
|
|
13241
13374
|
{
|
|
13242
13375
|
sortDirection: header.column.getIsSorted(),
|
|
@@ -13262,7 +13395,7 @@ var Table = ({
|
|
|
13262
13395
|
}
|
|
13263
13396
|
}
|
|
13264
13397
|
) }),
|
|
13265
|
-
/* @__PURE__ */ (0,
|
|
13398
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Visibility, { isVisible: header.column.getCanFilter() && !!header.column.columnDef.meta?.filterType, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13266
13399
|
TableFilterButton,
|
|
13267
13400
|
{
|
|
13268
13401
|
column: header.column,
|
|
@@ -13274,7 +13407,7 @@ var Table = ({
|
|
|
13274
13407
|
header.getContext()
|
|
13275
13408
|
)
|
|
13276
13409
|
] }) }),
|
|
13277
|
-
/* @__PURE__ */ (0,
|
|
13410
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Visibility, { isVisible: header.column.getCanResize(), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13278
13411
|
"div",
|
|
13279
13412
|
{
|
|
13280
13413
|
onPointerDown: header.getResizeHandler(),
|
|
@@ -13295,16 +13428,16 @@ var Table = ({
|
|
|
13295
13428
|
header.id
|
|
13296
13429
|
);
|
|
13297
13430
|
}) }, headerGroup.id)) }),
|
|
13298
|
-
/* @__PURE__ */ (0,
|
|
13431
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("tbody", { children: [
|
|
13299
13432
|
table.getRowModel().rows.map((row) => {
|
|
13300
|
-
return /* @__PURE__ */ (0,
|
|
13433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13301
13434
|
"tr",
|
|
13302
13435
|
{
|
|
13303
13436
|
onClick: () => onRowClick?.(row, table),
|
|
13304
13437
|
"data-name": "table-body-row",
|
|
13305
13438
|
className: BagFunctionUtil.resolve(table.options.meta?.bodyRowClassName, row.original),
|
|
13306
13439
|
children: row.getVisibleCells().map((cell) => {
|
|
13307
|
-
return /* @__PURE__ */ (0,
|
|
13440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("td", { "data-name": "table-body-cell", children: (0, import_react_table.flexRender)(
|
|
13308
13441
|
cell.column.columnDef.cell,
|
|
13309
13442
|
cell.getContext()
|
|
13310
13443
|
) }, cell.id);
|
|
@@ -13314,15 +13447,15 @@ var Table = ({
|
|
|
13314
13447
|
);
|
|
13315
13448
|
}),
|
|
13316
13449
|
range(table.getState().pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
|
|
13317
|
-
return /* @__PURE__ */ (0,
|
|
13318
|
-
return /* @__PURE__ */ (0,
|
|
13450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("tr", { children: columns.map((column) => {
|
|
13451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FillerCell, {}) }, column.id);
|
|
13319
13452
|
}) }, "filler-row-" + index);
|
|
13320
13453
|
})
|
|
13321
13454
|
] })
|
|
13322
13455
|
]
|
|
13323
13456
|
}
|
|
13324
13457
|
) }),
|
|
13325
|
-
/* @__PURE__ */ (0,
|
|
13458
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex-row-2 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13326
13459
|
Pagination,
|
|
13327
13460
|
{
|
|
13328
13461
|
pageIndex: table.getState().pagination.pageIndex,
|
|
@@ -13334,7 +13467,7 @@ var Table = ({
|
|
|
13334
13467
|
};
|
|
13335
13468
|
var TableUncontrolled = ({ data, ...props }) => {
|
|
13336
13469
|
const [usedDate] = useOverwritableState(data);
|
|
13337
|
-
return /* @__PURE__ */ (0,
|
|
13470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13338
13471
|
Table,
|
|
13339
13472
|
{
|
|
13340
13473
|
...props,
|
|
@@ -13353,12 +13486,12 @@ var TableWithSelection = ({
|
|
|
13353
13486
|
meta,
|
|
13354
13487
|
...props
|
|
13355
13488
|
}) => {
|
|
13356
|
-
const columnsWithSelection = (0,
|
|
13489
|
+
const columnsWithSelection = (0, import_react51.useMemo)(() => {
|
|
13357
13490
|
return [
|
|
13358
13491
|
{
|
|
13359
13492
|
id: selectionRowId,
|
|
13360
13493
|
header: ({ table }) => {
|
|
13361
|
-
return /* @__PURE__ */ (0,
|
|
13494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13362
13495
|
Checkbox,
|
|
13363
13496
|
{
|
|
13364
13497
|
value: table.getIsAllRowsSelected(),
|
|
@@ -13371,7 +13504,7 @@ var TableWithSelection = ({
|
|
|
13371
13504
|
);
|
|
13372
13505
|
},
|
|
13373
13506
|
cell: ({ row }) => {
|
|
13374
|
-
return /* @__PURE__ */ (0,
|
|
13507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13375
13508
|
Checkbox,
|
|
13376
13509
|
{
|
|
13377
13510
|
disabled: !row.getCanSelect(),
|
|
@@ -13389,15 +13522,15 @@ var TableWithSelection = ({
|
|
|
13389
13522
|
...columns
|
|
13390
13523
|
];
|
|
13391
13524
|
}, [columns, selectionRowId]);
|
|
13392
|
-
return /* @__PURE__ */ (0,
|
|
13525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13393
13526
|
Table,
|
|
13394
13527
|
{
|
|
13395
13528
|
columns: columnsWithSelection,
|
|
13396
13529
|
fillerRow: (columnId, table) => {
|
|
13397
13530
|
if (columnId === selectionRowId) {
|
|
13398
|
-
return /* @__PURE__ */ (0,
|
|
13531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Checkbox, { value: false, disabled: true, className: "max-w-6" });
|
|
13399
13532
|
}
|
|
13400
|
-
return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ (0,
|
|
13533
|
+
return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FillerCell, {});
|
|
13401
13534
|
},
|
|
13402
13535
|
state: {
|
|
13403
13536
|
rowSelection,
|
|
@@ -13422,7 +13555,7 @@ var TableWithSelection = ({
|
|
|
13422
13555
|
};
|
|
13423
13556
|
|
|
13424
13557
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
13425
|
-
var
|
|
13558
|
+
var import_react52 = require("react");
|
|
13426
13559
|
var import_clsx27 = require("clsx");
|
|
13427
13560
|
|
|
13428
13561
|
// src/utils/writeToClipboard.ts
|
|
@@ -13431,8 +13564,8 @@ var writeToClipboard = (text) => {
|
|
|
13431
13564
|
};
|
|
13432
13565
|
|
|
13433
13566
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
13434
|
-
var
|
|
13435
|
-
var
|
|
13567
|
+
var import_lucide_react18 = require("lucide-react");
|
|
13568
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
13436
13569
|
var CopyToClipboardWrapper = ({
|
|
13437
13570
|
children,
|
|
13438
13571
|
textToCopy,
|
|
@@ -13442,8 +13575,8 @@ var CopyToClipboardWrapper = ({
|
|
|
13442
13575
|
zIndex = 10
|
|
13443
13576
|
}) => {
|
|
13444
13577
|
const translation = useHightideTranslation();
|
|
13445
|
-
const [isShowingIndication, setIsShowingIndication] = (0,
|
|
13446
|
-
const [isShowingConfirmation, setIsShowingConfirmation] = (0,
|
|
13578
|
+
const [isShowingIndication, setIsShowingIndication] = (0, import_react52.useState)(false);
|
|
13579
|
+
const [isShowingConfirmation, setIsShowingConfirmation] = (0, import_react52.useState)(false);
|
|
13447
13580
|
const positionClasses = {
|
|
13448
13581
|
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
13449
13582
|
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
@@ -13463,7 +13596,7 @@ var CopyToClipboardWrapper = ({
|
|
|
13463
13596
|
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
13464
13597
|
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
13465
13598
|
};
|
|
13466
|
-
return /* @__PURE__ */ (0,
|
|
13599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
13467
13600
|
"div",
|
|
13468
13601
|
{
|
|
13469
13602
|
className: (0, import_clsx27.clsx)("relative inline-block cursor-copy", containerClassName),
|
|
@@ -13481,7 +13614,7 @@ var CopyToClipboardWrapper = ({
|
|
|
13481
13614
|
},
|
|
13482
13615
|
children: [
|
|
13483
13616
|
children,
|
|
13484
|
-
/* @__PURE__ */ (0,
|
|
13617
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
13485
13618
|
"div",
|
|
13486
13619
|
{
|
|
13487
13620
|
className: (0, import_clsx27.clsx)(
|
|
@@ -13496,15 +13629,15 @@ var CopyToClipboardWrapper = ({
|
|
|
13496
13629
|
opacity: isShowingIndication || isShowingConfirmation ? 1 : 0
|
|
13497
13630
|
},
|
|
13498
13631
|
children: [
|
|
13499
|
-
isShowingConfirmation && /* @__PURE__ */ (0,
|
|
13500
|
-
/* @__PURE__ */ (0,
|
|
13632
|
+
isShowingConfirmation && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex-row-1", children: [
|
|
13633
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react18.CheckIcon, { size: 16, className: "text-positive" }),
|
|
13501
13634
|
translation("copied")
|
|
13502
13635
|
] }),
|
|
13503
|
-
isShowingIndication && /* @__PURE__ */ (0,
|
|
13504
|
-
/* @__PURE__ */ (0,
|
|
13636
|
+
isShowingIndication && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex-row-1 text-description", children: [
|
|
13637
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react18.Copy, { size: 16 }),
|
|
13505
13638
|
translation("clickToCopy")
|
|
13506
13639
|
] }),
|
|
13507
|
-
/* @__PURE__ */ (0,
|
|
13640
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13508
13641
|
"div",
|
|
13509
13642
|
{
|
|
13510
13643
|
className: (0, import_clsx27.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
|
|
@@ -13520,9 +13653,9 @@ var CopyToClipboardWrapper = ({
|
|
|
13520
13653
|
};
|
|
13521
13654
|
|
|
13522
13655
|
// src/components/user-interaction/ScrollPicker.tsx
|
|
13523
|
-
var
|
|
13656
|
+
var import_react53 = require("react");
|
|
13524
13657
|
var import_clsx28 = __toESM(require("clsx"));
|
|
13525
|
-
var
|
|
13658
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
13526
13659
|
var up = 1;
|
|
13527
13660
|
var down = -1;
|
|
13528
13661
|
var ScrollPicker = ({
|
|
@@ -13541,7 +13674,7 @@ var ScrollPicker = ({
|
|
|
13541
13674
|
transition,
|
|
13542
13675
|
items,
|
|
13543
13676
|
lastTimeStamp
|
|
13544
|
-
}, setAnimation] = (0,
|
|
13677
|
+
}, setAnimation] = (0, import_react53.useState)({
|
|
13545
13678
|
targetIndex: selectedIndex,
|
|
13546
13679
|
currentIndex: disabled ? selectedIndex : 0,
|
|
13547
13680
|
velocity: 0,
|
|
@@ -13557,7 +13690,7 @@ var ScrollPicker = ({
|
|
|
13557
13690
|
const itemHeight = 40;
|
|
13558
13691
|
const distance = 8;
|
|
13559
13692
|
const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
|
|
13560
|
-
const getDirection = (0,
|
|
13693
|
+
const getDirection = (0, import_react53.useCallback)((targetIndex, currentIndex2, transition2, length) => {
|
|
13561
13694
|
if (targetIndex === currentIndex2) {
|
|
13562
13695
|
return transition2 > 0 ? up : down;
|
|
13563
13696
|
}
|
|
@@ -13567,7 +13700,7 @@ var ScrollPicker = ({
|
|
|
13567
13700
|
}
|
|
13568
13701
|
return distanceForward >= length / 2 ? down : up;
|
|
13569
13702
|
}, []);
|
|
13570
|
-
const animate = (0,
|
|
13703
|
+
const animate = (0, import_react53.useCallback)((timestamp, startTime) => {
|
|
13571
13704
|
setAnimation((prevState) => {
|
|
13572
13705
|
const {
|
|
13573
13706
|
targetIndex,
|
|
@@ -13640,7 +13773,7 @@ var ScrollPicker = ({
|
|
|
13640
13773
|
};
|
|
13641
13774
|
});
|
|
13642
13775
|
}, [disabled, getDirection, onChange]);
|
|
13643
|
-
(0,
|
|
13776
|
+
(0, import_react53.useEffect)(() => {
|
|
13644
13777
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
13645
13778
|
});
|
|
13646
13779
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -13661,7 +13794,7 @@ var ScrollPicker = ({
|
|
|
13661
13794
|
}
|
|
13662
13795
|
return clamp(1 - opacityValue / max);
|
|
13663
13796
|
};
|
|
13664
|
-
return /* @__PURE__ */ (0,
|
|
13797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13665
13798
|
"div",
|
|
13666
13799
|
{
|
|
13667
13800
|
className: "relative overflow-hidden",
|
|
@@ -13672,15 +13805,15 @@ var ScrollPicker = ({
|
|
|
13672
13805
|
setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + deltaY }));
|
|
13673
13806
|
}
|
|
13674
13807
|
},
|
|
13675
|
-
children: /* @__PURE__ */ (0,
|
|
13676
|
-
/* @__PURE__ */ (0,
|
|
13808
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
|
|
13809
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13677
13810
|
"div",
|
|
13678
13811
|
{
|
|
13679
13812
|
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 ",
|
|
13680
13813
|
style: { height: `${itemHeight}px` }
|
|
13681
13814
|
}
|
|
13682
13815
|
),
|
|
13683
|
-
/* @__PURE__ */ (0,
|
|
13816
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13684
13817
|
"div",
|
|
13685
13818
|
{
|
|
13686
13819
|
className: "flex-col-2 select-none",
|
|
@@ -13688,7 +13821,7 @@ var ScrollPicker = ({
|
|
|
13688
13821
|
transform: `translateY(${-transition * (distance + itemHeight)}px)`,
|
|
13689
13822
|
columnGap: `${distance}px`
|
|
13690
13823
|
},
|
|
13691
|
-
children: shownItems.map(({ name: name2, index }, arrayIndex) => /* @__PURE__ */ (0,
|
|
13824
|
+
children: shownItems.map(({ name: name2, index }, arrayIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13692
13825
|
"div",
|
|
13693
13826
|
{
|
|
13694
13827
|
className: (0, import_clsx28.default)(
|
|
@@ -13718,10 +13851,10 @@ var ScrollPicker = ({
|
|
|
13718
13851
|
};
|
|
13719
13852
|
|
|
13720
13853
|
// src/components/user-interaction/Textarea.tsx
|
|
13721
|
-
var
|
|
13854
|
+
var import_react54 = require("react");
|
|
13722
13855
|
var import_clsx29 = __toESM(require("clsx"));
|
|
13723
|
-
var
|
|
13724
|
-
var Textarea = (0,
|
|
13856
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
13857
|
+
var Textarea = (0, import_react54.forwardRef)(function Textarea2({
|
|
13725
13858
|
invalid = false,
|
|
13726
13859
|
onValueChange,
|
|
13727
13860
|
onEditComplete,
|
|
@@ -13733,7 +13866,7 @@ var Textarea = (0, import_react50.forwardRef)(function Textarea2({
|
|
|
13733
13866
|
onEditComplete?.(text);
|
|
13734
13867
|
clearTimer();
|
|
13735
13868
|
};
|
|
13736
|
-
return /* @__PURE__ */ (0,
|
|
13869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13737
13870
|
"textarea",
|
|
13738
13871
|
{
|
|
13739
13872
|
...props,
|
|
@@ -13763,7 +13896,7 @@ var TextareaUncontrolled = ({
|
|
|
13763
13896
|
...props
|
|
13764
13897
|
}) => {
|
|
13765
13898
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
13766
|
-
return /* @__PURE__ */ (0,
|
|
13899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13767
13900
|
Textarea,
|
|
13768
13901
|
{
|
|
13769
13902
|
...props,
|
|
@@ -13781,9 +13914,9 @@ var TextareaWithHeadline = ({
|
|
|
13781
13914
|
containerClassName,
|
|
13782
13915
|
...props
|
|
13783
13916
|
}) => {
|
|
13784
|
-
const genId = (0,
|
|
13917
|
+
const genId = (0, import_react54.useId)();
|
|
13785
13918
|
const usedId = id ?? genId;
|
|
13786
|
-
return /* @__PURE__ */ (0,
|
|
13919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
13787
13920
|
"div",
|
|
13788
13921
|
{
|
|
13789
13922
|
className: (0, import_clsx29.default)(
|
|
@@ -13795,8 +13928,8 @@ var TextareaWithHeadline = ({
|
|
|
13795
13928
|
containerClassName
|
|
13796
13929
|
),
|
|
13797
13930
|
children: [
|
|
13798
|
-
headline && /* @__PURE__ */ (0,
|
|
13799
|
-
/* @__PURE__ */ (0,
|
|
13931
|
+
headline && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { ...headlineProps, htmlFor: usedId, className: (0, import_clsx29.default)("typography-lable-md text-label", headlineProps.className), children: headline }),
|
|
13932
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13800
13933
|
Textarea,
|
|
13801
13934
|
{
|
|
13802
13935
|
...props,
|
|
@@ -13813,8 +13946,8 @@ var TextareaWithHeadline = ({
|
|
|
13813
13946
|
};
|
|
13814
13947
|
|
|
13815
13948
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
13816
|
-
var
|
|
13817
|
-
var
|
|
13949
|
+
var import_react57 = require("react");
|
|
13950
|
+
var import_lucide_react19 = require("lucide-react");
|
|
13818
13951
|
|
|
13819
13952
|
// src/utils/date.ts
|
|
13820
13953
|
var monthsList = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
|
|
@@ -13990,8 +14123,8 @@ var DateUtils = {
|
|
|
13990
14123
|
var import_clsx31 = __toESM(require("clsx"));
|
|
13991
14124
|
|
|
13992
14125
|
// src/components/user-interaction/date/DayPicker.tsx
|
|
13993
|
-
var
|
|
13994
|
-
var
|
|
14126
|
+
var import_react55 = require("react");
|
|
14127
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
13995
14128
|
var DayPicker = ({
|
|
13996
14129
|
displayedMonth,
|
|
13997
14130
|
value,
|
|
@@ -14006,22 +14139,22 @@ var DayPicker = ({
|
|
|
14006
14139
|
const { locale } = useLocale();
|
|
14007
14140
|
const month = displayedMonth.getMonth();
|
|
14008
14141
|
const weeks = getWeeksForCalenderMonth(displayedMonth, weekStart);
|
|
14009
|
-
const end = (0,
|
|
14142
|
+
const end = (0, import_react55.useMemo)(() => {
|
|
14010
14143
|
if (!providedEnd) return;
|
|
14011
14144
|
return new Date(providedEnd.getFullYear(), providedEnd.getMonth(), providedEnd.getDate());
|
|
14012
14145
|
}, [providedEnd]);
|
|
14013
|
-
const start = (0,
|
|
14146
|
+
const start = (0, import_react55.useMemo)(() => {
|
|
14014
14147
|
if (!providedStart) return;
|
|
14015
14148
|
return new Date(providedStart.getFullYear(), providedStart.getMonth(), providedStart.getDate());
|
|
14016
14149
|
}, [providedStart]);
|
|
14017
|
-
return /* @__PURE__ */ (0,
|
|
14018
|
-
/* @__PURE__ */ (0,
|
|
14019
|
-
weeks.map((week, index) => /* @__PURE__ */ (0,
|
|
14150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className, "data-name": "day-picker-container", children: [
|
|
14151
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { "data-name": "day-picker-header-row", children: weeks[0].map((weekDay, index) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { "data-name": "day-picker-header-item", children: new Intl.DateTimeFormat(locale, { weekday: "long" }).format(weekDay).substring(0, 2) }, index)) }),
|
|
14152
|
+
weeks.map((week, index) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { "data-name": "day-picker-body-row", children: week.map((date) => {
|
|
14020
14153
|
const isSelected = !!value && DateUtils.equalDate(value, date);
|
|
14021
14154
|
const isToday = DateUtils.equalDate(/* @__PURE__ */ new Date(), date);
|
|
14022
14155
|
const isSameMonth = date.getMonth() === month;
|
|
14023
14156
|
const isDayValid = isInTimeSpan(date, start, end);
|
|
14024
|
-
return /* @__PURE__ */ (0,
|
|
14157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
14025
14158
|
"button",
|
|
14026
14159
|
{
|
|
14027
14160
|
disabled: !isDayValid,
|
|
@@ -14055,7 +14188,7 @@ var DayPickerUncontrolled = ({
|
|
|
14055
14188
|
...props
|
|
14056
14189
|
}) => {
|
|
14057
14190
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14058
|
-
return /* @__PURE__ */ (0,
|
|
14191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
14059
14192
|
DayPicker,
|
|
14060
14193
|
{
|
|
14061
14194
|
value,
|
|
@@ -14066,10 +14199,10 @@ var DayPickerUncontrolled = ({
|
|
|
14066
14199
|
};
|
|
14067
14200
|
|
|
14068
14201
|
// src/components/user-interaction/date/YearMonthPicker.tsx
|
|
14069
|
-
var
|
|
14202
|
+
var import_react56 = require("react");
|
|
14070
14203
|
var import_clsx30 = __toESM(require("clsx"));
|
|
14071
|
-
var
|
|
14072
|
-
var YearRow = (0,
|
|
14204
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
14205
|
+
var YearRow = (0, import_react56.memo)(function YearRow2({
|
|
14073
14206
|
year,
|
|
14074
14207
|
selectedMonthIndex,
|
|
14075
14208
|
minTimestamp,
|
|
@@ -14077,31 +14210,31 @@ var YearRow = (0, import_react52.memo)(function YearRow2({
|
|
|
14077
14210
|
monthNames,
|
|
14078
14211
|
onSelect
|
|
14079
14212
|
}) {
|
|
14080
|
-
const ref = (0,
|
|
14213
|
+
const ref = (0, import_react56.useRef)(null);
|
|
14081
14214
|
const isSelectedYear = selectedMonthIndex !== void 0;
|
|
14082
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
14083
|
-
(0,
|
|
14215
|
+
const [isExpanded, setIsExpanded] = (0, import_react56.useState)(false);
|
|
14216
|
+
(0, import_react56.useEffect)(() => {
|
|
14084
14217
|
if (isSelectedYear) {
|
|
14085
14218
|
ref.current?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
14086
14219
|
}
|
|
14087
14220
|
}, [isSelectedYear]);
|
|
14088
|
-
const monthGrid = (0,
|
|
14089
|
-
return /* @__PURE__ */ (0,
|
|
14221
|
+
const monthGrid = (0, import_react56.useMemo)(() => equalSizeGroups([...DateUtils.monthsList], 3), []);
|
|
14222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
14090
14223
|
ExpandableRoot,
|
|
14091
14224
|
{
|
|
14092
14225
|
ref: isSelectedYear ? ref : void 0,
|
|
14093
14226
|
isExpanded,
|
|
14094
14227
|
onExpandedChange: setIsExpanded,
|
|
14095
14228
|
children: [
|
|
14096
|
-
/* @__PURE__ */ (0,
|
|
14097
|
-
/* @__PURE__ */ (0,
|
|
14229
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ExpandableHeader, { className: (0, import_clsx30.default)("px-2", { "text-primary font-bold": isSelectedYear }), children: year }),
|
|
14230
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ExpandableContent, { className: "gap-y-1 px-2 expadable-content-h-39", children: isExpanded && monthGrid.map((group, groupIdx) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex-row-1", children: group.map((month) => {
|
|
14098
14231
|
const monthIndex = DateUtils.monthsList.indexOf(month);
|
|
14099
14232
|
const currentTimestamp = new Date(year, monthIndex).getTime();
|
|
14100
14233
|
const isAfterStart = minTimestamp === void 0 || currentTimestamp >= minTimestamp;
|
|
14101
14234
|
const isBeforeEnd = maxTimestamp === void 0 || currentTimestamp <= maxTimestamp;
|
|
14102
14235
|
const isValid = isAfterStart && isBeforeEnd;
|
|
14103
14236
|
const isSelectedMonth = monthIndex === selectedMonthIndex;
|
|
14104
|
-
return /* @__PURE__ */ (0,
|
|
14237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14105
14238
|
Button,
|
|
14106
14239
|
{
|
|
14107
14240
|
disabled: !isValid,
|
|
@@ -14133,32 +14266,32 @@ var YearMonthPicker = ({
|
|
|
14133
14266
|
className
|
|
14134
14267
|
}) => {
|
|
14135
14268
|
const { locale } = useLocale();
|
|
14136
|
-
const monthNames = (0,
|
|
14269
|
+
const monthNames = (0, import_react56.useMemo)(() => {
|
|
14137
14270
|
const formatter = new Intl.DateTimeFormat(locale, { month: "short" });
|
|
14138
14271
|
return Array.from({ length: 12 }, (_, i) => formatter.format(new Date(2e3, i, 1)));
|
|
14139
14272
|
}, [locale]);
|
|
14140
|
-
const years = (0,
|
|
14273
|
+
const years = (0, import_react56.useMemo)(
|
|
14141
14274
|
() => range([start.getFullYear(), end.getFullYear()], { exclusiveEnd: false }),
|
|
14142
14275
|
[start, end]
|
|
14143
14276
|
);
|
|
14144
|
-
const minTimestamp = (0,
|
|
14277
|
+
const minTimestamp = (0, import_react56.useMemo)(() => {
|
|
14145
14278
|
if (!start) return;
|
|
14146
14279
|
return new Date(start.getFullYear(), start.getMonth(), 1).getTime();
|
|
14147
14280
|
}, [start]);
|
|
14148
|
-
const maxTimestamp = (0,
|
|
14281
|
+
const maxTimestamp = (0, import_react56.useMemo)(() => {
|
|
14149
14282
|
if (!end) return;
|
|
14150
14283
|
return new Date(end.getFullYear(), end.getMonth() + 1, 0).getTime();
|
|
14151
14284
|
}, [end]);
|
|
14152
|
-
const callbackRefs = (0,
|
|
14153
|
-
(0,
|
|
14285
|
+
const callbackRefs = (0, import_react56.useRef)({ onValueChange, onEditComplete });
|
|
14286
|
+
(0, import_react56.useLayoutEffect)(() => {
|
|
14154
14287
|
callbackRefs.current = { onValueChange, onEditComplete };
|
|
14155
14288
|
});
|
|
14156
|
-
const handleSelect = (0,
|
|
14289
|
+
const handleSelect = (0, import_react56.useCallback)((newDate) => {
|
|
14157
14290
|
const { onValueChange: onValueChange2, onEditComplete: onEditComplete2 } = callbackRefs.current;
|
|
14158
14291
|
onValueChange2?.(newDate);
|
|
14159
14292
|
onEditComplete2?.(newDate);
|
|
14160
14293
|
}, []);
|
|
14161
|
-
return /* @__PURE__ */ (0,
|
|
14294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14162
14295
|
InfiniteScroll,
|
|
14163
14296
|
{
|
|
14164
14297
|
itemCount: years.length,
|
|
@@ -14168,7 +14301,7 @@ var YearMonthPicker = ({
|
|
|
14168
14301
|
const year = years[index];
|
|
14169
14302
|
const isSelectedYear = value.getFullYear() === year;
|
|
14170
14303
|
const selectedMonthIndex = isSelectedYear ? value.getMonth() : void 0;
|
|
14171
|
-
return /* @__PURE__ */ (0,
|
|
14304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14172
14305
|
YearRow,
|
|
14173
14306
|
{
|
|
14174
14307
|
year,
|
|
@@ -14190,7 +14323,7 @@ var YearMonthPickerUncontrolled = ({
|
|
|
14190
14323
|
...props
|
|
14191
14324
|
}) => {
|
|
14192
14325
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14193
|
-
return /* @__PURE__ */ (0,
|
|
14326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14194
14327
|
YearMonthPicker,
|
|
14195
14328
|
{
|
|
14196
14329
|
value,
|
|
@@ -14201,7 +14334,7 @@ var YearMonthPickerUncontrolled = ({
|
|
|
14201
14334
|
};
|
|
14202
14335
|
|
|
14203
14336
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
14204
|
-
var
|
|
14337
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
14205
14338
|
var DatePicker = ({
|
|
14206
14339
|
value = /* @__PURE__ */ new Date(),
|
|
14207
14340
|
start,
|
|
@@ -14215,11 +14348,11 @@ var DatePicker = ({
|
|
|
14215
14348
|
className
|
|
14216
14349
|
}) => {
|
|
14217
14350
|
const { locale } = useLocale();
|
|
14218
|
-
const [displayedMonth, setDisplayedMonth] = (0,
|
|
14219
|
-
const [displayMode, setDisplayMode] = (0,
|
|
14220
|
-
return /* @__PURE__ */ (0,
|
|
14221
|
-
/* @__PURE__ */ (0,
|
|
14222
|
-
/* @__PURE__ */ (0,
|
|
14351
|
+
const [displayedMonth, setDisplayedMonth] = (0, import_react57.useState)(new Date(value.getFullYear(), value.getMonth(), 1));
|
|
14352
|
+
const [displayMode, setDisplayMode] = (0, import_react57.useState)(initialDisplay);
|
|
14353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: (0, import_clsx31.default)("flex-col-3", className), children: [
|
|
14354
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex-row-2 items-center justify-between", children: [
|
|
14355
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
14223
14356
|
Button,
|
|
14224
14357
|
{
|
|
14225
14358
|
size: "sm",
|
|
@@ -14230,12 +14363,12 @@ var DatePicker = ({
|
|
|
14230
14363
|
onClick: () => setDisplayMode(displayMode === "day" ? "yearMonth" : "day"),
|
|
14231
14364
|
children: [
|
|
14232
14365
|
`${new Intl.DateTimeFormat(LocalizationUtil.localToLanguage(locale), { month: "long" }).format(displayedMonth)} ${displayedMonth.getFullYear()}`,
|
|
14233
|
-
/* @__PURE__ */ (0,
|
|
14366
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react19.ChevronDown, { size: 16 })
|
|
14234
14367
|
]
|
|
14235
14368
|
}
|
|
14236
14369
|
),
|
|
14237
|
-
displayMode === "day" && /* @__PURE__ */ (0,
|
|
14238
|
-
/* @__PURE__ */ (0,
|
|
14370
|
+
displayMode === "day" && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
14371
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14239
14372
|
Button,
|
|
14240
14373
|
{
|
|
14241
14374
|
size: "sm",
|
|
@@ -14246,10 +14379,10 @@ var DatePicker = ({
|
|
|
14246
14379
|
onValueChange(newDate);
|
|
14247
14380
|
setDisplayedMonth(newDate);
|
|
14248
14381
|
},
|
|
14249
|
-
children: /* @__PURE__ */ (0,
|
|
14382
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react19.Calendar, { className: "size-5" })
|
|
14250
14383
|
}
|
|
14251
14384
|
),
|
|
14252
|
-
/* @__PURE__ */ (0,
|
|
14385
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14253
14386
|
Button,
|
|
14254
14387
|
{
|
|
14255
14388
|
size: "sm",
|
|
@@ -14257,10 +14390,10 @@ var DatePicker = ({
|
|
|
14257
14390
|
onClick: () => {
|
|
14258
14391
|
setDisplayedMonth(subtractDuration(displayedMonth, { months: 1 }));
|
|
14259
14392
|
},
|
|
14260
|
-
children: /* @__PURE__ */ (0,
|
|
14393
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react19.ArrowUp, { size: 20 })
|
|
14261
14394
|
}
|
|
14262
14395
|
),
|
|
14263
|
-
/* @__PURE__ */ (0,
|
|
14396
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14264
14397
|
Button,
|
|
14265
14398
|
{
|
|
14266
14399
|
size: "sm",
|
|
@@ -14268,12 +14401,12 @@ var DatePicker = ({
|
|
|
14268
14401
|
onClick: () => {
|
|
14269
14402
|
setDisplayedMonth(addDuration(displayedMonth, { months: 1 }));
|
|
14270
14403
|
},
|
|
14271
|
-
children: /* @__PURE__ */ (0,
|
|
14404
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react19.ArrowDown, { size: 20 })
|
|
14272
14405
|
}
|
|
14273
14406
|
)
|
|
14274
14407
|
] })
|
|
14275
14408
|
] }),
|
|
14276
|
-
displayMode === "yearMonth" ? /* @__PURE__ */ (0,
|
|
14409
|
+
displayMode === "yearMonth" ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14277
14410
|
YearMonthPicker,
|
|
14278
14411
|
{
|
|
14279
14412
|
...yearMonthPickerProps,
|
|
@@ -14290,7 +14423,7 @@ var DatePicker = ({
|
|
|
14290
14423
|
},
|
|
14291
14424
|
className: "h-60 max-h-60"
|
|
14292
14425
|
}
|
|
14293
|
-
) : /* @__PURE__ */ (0,
|
|
14426
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14294
14427
|
DayPicker,
|
|
14295
14428
|
{
|
|
14296
14429
|
...dayPickerProps,
|
|
@@ -14312,7 +14445,7 @@ var DatePickerUncontrolled = ({
|
|
|
14312
14445
|
...props
|
|
14313
14446
|
}) => {
|
|
14314
14447
|
const [date, setDate] = useOverwritableState(value, onValueChange);
|
|
14315
|
-
return /* @__PURE__ */ (0,
|
|
14448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14316
14449
|
DatePicker,
|
|
14317
14450
|
{
|
|
14318
14451
|
...props,
|
|
@@ -14326,8 +14459,8 @@ var DatePickerUncontrolled = ({
|
|
|
14326
14459
|
var import_clsx32 = __toESM(require("clsx"));
|
|
14327
14460
|
|
|
14328
14461
|
// src/components/user-interaction/date/TimePicker.tsx
|
|
14329
|
-
var
|
|
14330
|
-
var
|
|
14462
|
+
var import_react58 = require("react");
|
|
14463
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
14331
14464
|
var TimePicker = ({
|
|
14332
14465
|
value = /* @__PURE__ */ new Date(),
|
|
14333
14466
|
onValueChange,
|
|
@@ -14336,8 +14469,8 @@ var TimePicker = ({
|
|
|
14336
14469
|
minuteIncrement = "5min",
|
|
14337
14470
|
className
|
|
14338
14471
|
}) => {
|
|
14339
|
-
const minuteRef = (0,
|
|
14340
|
-
const hourRef = (0,
|
|
14472
|
+
const minuteRef = (0, import_react58.useRef)(null);
|
|
14473
|
+
const hourRef = (0, import_react58.useRef)(null);
|
|
14341
14474
|
const isPM = value.getHours() > 11;
|
|
14342
14475
|
const hours = is24HourFormat ? range(24) : range(12);
|
|
14343
14476
|
let minutes = range(60);
|
|
@@ -14357,13 +14490,13 @@ var TimePicker = ({
|
|
|
14357
14490
|
}
|
|
14358
14491
|
const closestMinute = closestMatch(minutes, (item1, item2) => Math.abs(item1 - value.getMinutes()) < Math.abs(item2 - value.getMinutes()));
|
|
14359
14492
|
const hour = value.getHours();
|
|
14360
|
-
(0,
|
|
14493
|
+
(0, import_react58.useEffect)(() => {
|
|
14361
14494
|
minuteRef.current?.scrollIntoView({
|
|
14362
14495
|
behavior: "smooth",
|
|
14363
14496
|
block: "nearest"
|
|
14364
14497
|
});
|
|
14365
14498
|
}, [closestMinute]);
|
|
14366
|
-
(0,
|
|
14499
|
+
(0, import_react58.useEffect)(() => {
|
|
14367
14500
|
hourRef.current?.scrollIntoView({
|
|
14368
14501
|
behavior: "smooth",
|
|
14369
14502
|
block: "nearest"
|
|
@@ -14375,10 +14508,10 @@ var TimePicker = ({
|
|
|
14375
14508
|
onValueChange?.(newDate);
|
|
14376
14509
|
onEditComplete?.(newDate);
|
|
14377
14510
|
};
|
|
14378
|
-
return /* @__PURE__ */ (0,
|
|
14379
|
-
/* @__PURE__ */ (0,
|
|
14511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { "data-name": "time-picker-container", className, children: [
|
|
14512
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { "data-name": "time-picker-value-column", children: hours.map((hour2) => {
|
|
14380
14513
|
const isSelected = hour2 === value.getHours() - (!is24HourFormat && isPM ? 12 : 0);
|
|
14381
|
-
return /* @__PURE__ */ (0,
|
|
14514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14382
14515
|
Button,
|
|
14383
14516
|
{
|
|
14384
14517
|
size: "sm",
|
|
@@ -14390,9 +14523,9 @@ var TimePicker = ({
|
|
|
14390
14523
|
hour2
|
|
14391
14524
|
);
|
|
14392
14525
|
}) }),
|
|
14393
|
-
/* @__PURE__ */ (0,
|
|
14526
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { "data-name": "time-picker-value-column", children: minutes.map((minute) => {
|
|
14394
14527
|
const isSelected = minute === closestMinute;
|
|
14395
|
-
return /* @__PURE__ */ (0,
|
|
14528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14396
14529
|
Button,
|
|
14397
14530
|
{
|
|
14398
14531
|
size: "sm",
|
|
@@ -14404,8 +14537,8 @@ var TimePicker = ({
|
|
|
14404
14537
|
minute + minuteIncrement
|
|
14405
14538
|
);
|
|
14406
14539
|
}) }),
|
|
14407
|
-
!is24HourFormat && /* @__PURE__ */ (0,
|
|
14408
|
-
/* @__PURE__ */ (0,
|
|
14540
|
+
!is24HourFormat && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { "data-name": "time-picker-value-column", children: [
|
|
14541
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14409
14542
|
Button,
|
|
14410
14543
|
{
|
|
14411
14544
|
size: "sm",
|
|
@@ -14414,7 +14547,7 @@ var TimePicker = ({
|
|
|
14414
14547
|
children: "AM"
|
|
14415
14548
|
}
|
|
14416
14549
|
),
|
|
14417
|
-
/* @__PURE__ */ (0,
|
|
14550
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14418
14551
|
Button,
|
|
14419
14552
|
{
|
|
14420
14553
|
size: "sm",
|
|
@@ -14432,7 +14565,7 @@ var TimePickerUncontrolled = ({
|
|
|
14432
14565
|
...props
|
|
14433
14566
|
}) => {
|
|
14434
14567
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14435
|
-
return /* @__PURE__ */ (0,
|
|
14568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14436
14569
|
TimePicker,
|
|
14437
14570
|
{
|
|
14438
14571
|
...props,
|
|
@@ -14443,7 +14576,7 @@ var TimePickerUncontrolled = ({
|
|
|
14443
14576
|
};
|
|
14444
14577
|
|
|
14445
14578
|
// src/components/user-interaction/date/DateTimePicker.tsx
|
|
14446
|
-
var
|
|
14579
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
14447
14580
|
var DateTimePicker = ({
|
|
14448
14581
|
value = /* @__PURE__ */ new Date(),
|
|
14449
14582
|
start,
|
|
@@ -14462,7 +14595,7 @@ var DateTimePicker = ({
|
|
|
14462
14595
|
let dateDisplay;
|
|
14463
14596
|
let timeDisplay;
|
|
14464
14597
|
if (useDate) {
|
|
14465
|
-
dateDisplay = /* @__PURE__ */ (0,
|
|
14598
|
+
dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14466
14599
|
DatePicker,
|
|
14467
14600
|
{
|
|
14468
14601
|
...datePickerProps,
|
|
@@ -14478,7 +14611,7 @@ var DateTimePicker = ({
|
|
|
14478
14611
|
);
|
|
14479
14612
|
}
|
|
14480
14613
|
if (useTime) {
|
|
14481
|
-
timeDisplay = /* @__PURE__ */ (0,
|
|
14614
|
+
timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14482
14615
|
TimePicker,
|
|
14483
14616
|
{
|
|
14484
14617
|
...timePickerProps,
|
|
@@ -14491,14 +14624,14 @@ var DateTimePicker = ({
|
|
|
14491
14624
|
}
|
|
14492
14625
|
);
|
|
14493
14626
|
}
|
|
14494
|
-
return /* @__PURE__ */ (0,
|
|
14627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex-row-2 min-h-71 max-h-71", children: [
|
|
14495
14628
|
dateDisplay,
|
|
14496
14629
|
timeDisplay
|
|
14497
14630
|
] });
|
|
14498
14631
|
};
|
|
14499
14632
|
var DateTimePickerUncontrolled = ({ value: initialValue, onValueChange, ...props }) => {
|
|
14500
14633
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14501
|
-
return /* @__PURE__ */ (0,
|
|
14634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14502
14635
|
DateTimePicker,
|
|
14503
14636
|
{
|
|
14504
14637
|
...props,
|
|
@@ -14509,7 +14642,7 @@ var DateTimePickerUncontrolled = ({ value: initialValue, onValueChange, ...props
|
|
|
14509
14642
|
};
|
|
14510
14643
|
|
|
14511
14644
|
// src/components/user-interaction/date/TimeDisplay.tsx
|
|
14512
|
-
var
|
|
14645
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14513
14646
|
var TimeDisplay = ({
|
|
14514
14647
|
date,
|
|
14515
14648
|
mode = "daysFromToday"
|
|
@@ -14546,15 +14679,15 @@ var TimeDisplay = ({
|
|
|
14546
14679
|
} else {
|
|
14547
14680
|
fullString = `${date.getDate()}. ${monthToTranslation[date.getMonth()]} ${date.getFullYear()}`;
|
|
14548
14681
|
}
|
|
14549
|
-
return /* @__PURE__ */ (0,
|
|
14682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { children: fullString });
|
|
14550
14683
|
};
|
|
14551
14684
|
|
|
14552
14685
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
14553
|
-
var
|
|
14686
|
+
var import_react59 = require("react");
|
|
14554
14687
|
var import_react_dom8 = require("react-dom");
|
|
14555
|
-
var
|
|
14688
|
+
var import_lucide_react20 = require("lucide-react");
|
|
14556
14689
|
var import_clsx33 = __toESM(require("clsx"));
|
|
14557
|
-
var
|
|
14690
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
14558
14691
|
var DateTimeInput = ({
|
|
14559
14692
|
value,
|
|
14560
14693
|
onValueChange,
|
|
@@ -14567,9 +14700,9 @@ var DateTimeInput = ({
|
|
|
14567
14700
|
}) => {
|
|
14568
14701
|
const translation = useHightideTranslation();
|
|
14569
14702
|
const { locale } = useLocale();
|
|
14570
|
-
const [isOpen, setIsOpen] = (0,
|
|
14571
|
-
const anchorRef = (0,
|
|
14572
|
-
const containerRef = (0,
|
|
14703
|
+
const [isOpen, setIsOpen] = (0, import_react59.useState)(false);
|
|
14704
|
+
const anchorRef = (0, import_react59.useRef)(null);
|
|
14705
|
+
const containerRef = (0, import_react59.useRef)(null);
|
|
14573
14706
|
const position = useFloatingElement({
|
|
14574
14707
|
active: isOpen,
|
|
14575
14708
|
anchorRef,
|
|
@@ -14583,15 +14716,15 @@ var DateTimeInput = ({
|
|
|
14583
14716
|
onEditComplete(value);
|
|
14584
14717
|
});
|
|
14585
14718
|
const { zIndex } = useOverlayRegistry({ isActive: isOpen });
|
|
14586
|
-
const isReadOnly = (0,
|
|
14587
|
-
(0,
|
|
14719
|
+
const isReadOnly = (0, import_react59.useMemo)(() => props.readOnly || props.disabled, [props.readOnly, props.disabled]);
|
|
14720
|
+
(0, import_react59.useEffect)(() => {
|
|
14588
14721
|
if (isReadOnly) {
|
|
14589
14722
|
setIsOpen(false);
|
|
14590
14723
|
}
|
|
14591
14724
|
}, [isReadOnly]);
|
|
14592
|
-
return /* @__PURE__ */ (0,
|
|
14593
|
-
/* @__PURE__ */ (0,
|
|
14594
|
-
/* @__PURE__ */ (0,
|
|
14725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
14726
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { ...containerProps, ref: anchorRef, className: (0, import_clsx33.default)("relative w-full", containerProps?.className), children: [
|
|
14727
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14595
14728
|
Input,
|
|
14596
14729
|
{
|
|
14597
14730
|
...props,
|
|
@@ -14609,7 +14742,7 @@ var DateTimeInput = ({
|
|
|
14609
14742
|
)
|
|
14610
14743
|
}
|
|
14611
14744
|
),
|
|
14612
|
-
/* @__PURE__ */ (0,
|
|
14745
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14613
14746
|
Button,
|
|
14614
14747
|
{
|
|
14615
14748
|
coloringStyle: "text",
|
|
@@ -14619,12 +14752,12 @@ var DateTimeInput = ({
|
|
|
14619
14752
|
className: "absolute right-1 top-1/2 -translate-y-1/2",
|
|
14620
14753
|
disabled: isReadOnly,
|
|
14621
14754
|
onClick: () => setIsOpen((prevState) => !prevState),
|
|
14622
|
-
children: /* @__PURE__ */ (0,
|
|
14755
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react20.CalendarIcon, { className: "size-5" })
|
|
14623
14756
|
}
|
|
14624
14757
|
)
|
|
14625
14758
|
] }),
|
|
14626
|
-
/* @__PURE__ */ (0,
|
|
14627
|
-
/* @__PURE__ */ (0,
|
|
14759
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: isOpen, children: (0, import_react_dom8.createPortal)(
|
|
14760
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
14628
14761
|
"div",
|
|
14629
14762
|
{
|
|
14630
14763
|
ref: containerRef,
|
|
@@ -14635,7 +14768,7 @@ var DateTimeInput = ({
|
|
|
14635
14768
|
opacity: position ? void 0 : 0
|
|
14636
14769
|
},
|
|
14637
14770
|
children: [
|
|
14638
|
-
/* @__PURE__ */ (0,
|
|
14771
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14639
14772
|
DateTimePicker,
|
|
14640
14773
|
{
|
|
14641
14774
|
...pickerProps,
|
|
@@ -14645,8 +14778,8 @@ var DateTimeInput = ({
|
|
|
14645
14778
|
onEditComplete
|
|
14646
14779
|
}
|
|
14647
14780
|
),
|
|
14648
|
-
/* @__PURE__ */ (0,
|
|
14649
|
-
/* @__PURE__ */ (0,
|
|
14781
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
14782
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !!onRemove && !!value, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14650
14783
|
Button,
|
|
14651
14784
|
{
|
|
14652
14785
|
size: "md",
|
|
@@ -14659,7 +14792,7 @@ var DateTimeInput = ({
|
|
|
14659
14792
|
children: translation("clear")
|
|
14660
14793
|
}
|
|
14661
14794
|
) }),
|
|
14662
|
-
/* @__PURE__ */ (0,
|
|
14795
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !value, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14663
14796
|
Button,
|
|
14664
14797
|
{
|
|
14665
14798
|
size: "md",
|
|
@@ -14669,7 +14802,7 @@ var DateTimeInput = ({
|
|
|
14669
14802
|
children: translation("cancel")
|
|
14670
14803
|
}
|
|
14671
14804
|
) }),
|
|
14672
|
-
/* @__PURE__ */ (0,
|
|
14805
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14673
14806
|
Button,
|
|
14674
14807
|
{
|
|
14675
14808
|
size: "md",
|
|
@@ -14694,7 +14827,7 @@ var DateTimeInputUncontrolled = ({
|
|
|
14694
14827
|
...props
|
|
14695
14828
|
}) => {
|
|
14696
14829
|
const [value, setValue] = useOverwritableState(initialValue);
|
|
14697
|
-
return /* @__PURE__ */ (0,
|
|
14830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14698
14831
|
DateTimeInput,
|
|
14699
14832
|
{
|
|
14700
14833
|
...props,
|
|
@@ -14712,21 +14845,21 @@ var DateTimeInputUncontrolled = ({
|
|
|
14712
14845
|
};
|
|
14713
14846
|
|
|
14714
14847
|
// src/components/user-interaction/input/InsideLabelInput.tsx
|
|
14715
|
-
var
|
|
14716
|
-
var
|
|
14848
|
+
var import_react60 = require("react");
|
|
14849
|
+
var import_react61 = require("react");
|
|
14717
14850
|
var import_clsx34 = __toESM(require("clsx"));
|
|
14718
|
-
var
|
|
14719
|
-
var InsideLabelInput = (0,
|
|
14851
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
14852
|
+
var InsideLabelInput = (0, import_react61.forwardRef)(function InsideLabelInput2({
|
|
14720
14853
|
id: customId,
|
|
14721
14854
|
label,
|
|
14722
14855
|
...props
|
|
14723
14856
|
}, forwardedRef) {
|
|
14724
14857
|
const { value } = props;
|
|
14725
|
-
const [isFocused, setIsFocused] = (0,
|
|
14726
|
-
const generatedId = (0,
|
|
14858
|
+
const [isFocused, setIsFocused] = (0, import_react61.useState)(false);
|
|
14859
|
+
const generatedId = (0, import_react60.useId)();
|
|
14727
14860
|
const id = customId ?? generatedId;
|
|
14728
|
-
return /* @__PURE__ */ (0,
|
|
14729
|
-
/* @__PURE__ */ (0,
|
|
14861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: (0, import_clsx34.default)("relative"), children: [
|
|
14862
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
14730
14863
|
Input,
|
|
14731
14864
|
{
|
|
14732
14865
|
...props,
|
|
@@ -14744,7 +14877,7 @@ var InsideLabelInput = (0, import_react57.forwardRef)(function InsideLabelInput2
|
|
|
14744
14877
|
}
|
|
14745
14878
|
}
|
|
14746
14879
|
),
|
|
14747
|
-
/* @__PURE__ */ (0,
|
|
14880
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
14748
14881
|
"label",
|
|
14749
14882
|
{
|
|
14750
14883
|
id: id + "-label",
|
|
@@ -14766,7 +14899,7 @@ var InsideLabelInputUncontrolled = ({
|
|
|
14766
14899
|
...props
|
|
14767
14900
|
}) => {
|
|
14768
14901
|
const [value, setValue] = useOverwritableState(initialValue, props.onValueChange);
|
|
14769
|
-
return /* @__PURE__ */ (0,
|
|
14902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
14770
14903
|
InsideLabelInput,
|
|
14771
14904
|
{
|
|
14772
14905
|
...props,
|
|
@@ -14777,9 +14910,9 @@ var InsideLabelInputUncontrolled = ({
|
|
|
14777
14910
|
};
|
|
14778
14911
|
|
|
14779
14912
|
// src/components/user-interaction/input/SearchBar.tsx
|
|
14780
|
-
var
|
|
14913
|
+
var import_lucide_react21 = require("lucide-react");
|
|
14781
14914
|
var import_clsx35 = require("clsx");
|
|
14782
|
-
var
|
|
14915
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
14783
14916
|
var SearchBar = ({
|
|
14784
14917
|
value: initialValue,
|
|
14785
14918
|
onSearch,
|
|
@@ -14790,8 +14923,8 @@ var SearchBar = ({
|
|
|
14790
14923
|
}) => {
|
|
14791
14924
|
const translation = useHightideTranslation();
|
|
14792
14925
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14793
|
-
return /* @__PURE__ */ (0,
|
|
14794
|
-
/* @__PURE__ */ (0,
|
|
14926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { ...containerProps, className: (0, import_clsx35.clsx)("relative", containerProps?.className), children: [
|
|
14927
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
14795
14928
|
InputUncontrolled,
|
|
14796
14929
|
{
|
|
14797
14930
|
...inputProps,
|
|
@@ -14802,7 +14935,7 @@ var SearchBar = ({
|
|
|
14802
14935
|
className: (0, import_clsx35.clsx)("pr-10 w-full", inputProps.className)
|
|
14803
14936
|
}
|
|
14804
14937
|
),
|
|
14805
|
-
/* @__PURE__ */ (0,
|
|
14938
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
14806
14939
|
Button,
|
|
14807
14940
|
{
|
|
14808
14941
|
...searchButtonProps,
|
|
@@ -14812,33 +14945,33 @@ var SearchBar = ({
|
|
|
14812
14945
|
coloringStyle: "text",
|
|
14813
14946
|
onClick: () => onSearch(value),
|
|
14814
14947
|
className: (0, import_clsx35.clsx)("absolute right-1 top-1/2 -translate-y-1/2", searchButtonProps?.className),
|
|
14815
|
-
children: /* @__PURE__ */ (0,
|
|
14948
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react21.Search, { className: "w-full h-full" })
|
|
14816
14949
|
}
|
|
14817
14950
|
)
|
|
14818
14951
|
] });
|
|
14819
14952
|
};
|
|
14820
14953
|
|
|
14821
14954
|
// src/components/user-interaction/input/ToggleableInput.tsx
|
|
14822
|
-
var
|
|
14823
|
-
var
|
|
14955
|
+
var import_react62 = require("react");
|
|
14956
|
+
var import_lucide_react22 = require("lucide-react");
|
|
14824
14957
|
var import_clsx36 = __toESM(require("clsx"));
|
|
14825
|
-
var
|
|
14826
|
-
var ToggleableInput = (0,
|
|
14958
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
14959
|
+
var ToggleableInput = (0, import_react62.forwardRef)(function ToggleableInput2({
|
|
14827
14960
|
value,
|
|
14828
14961
|
initialState = "display",
|
|
14829
14962
|
editCompleteOptions,
|
|
14830
14963
|
...props
|
|
14831
14964
|
}, forwardedRef) {
|
|
14832
|
-
const [isEditing, setIsEditing] = (0,
|
|
14833
|
-
const innerRef = (0,
|
|
14834
|
-
(0,
|
|
14835
|
-
(0,
|
|
14965
|
+
const [isEditing, setIsEditing] = (0, import_react62.useState)(initialState !== "display");
|
|
14966
|
+
const innerRef = (0, import_react62.useRef)(null);
|
|
14967
|
+
(0, import_react62.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
14968
|
+
(0, import_react62.useEffect)(() => {
|
|
14836
14969
|
if (isEditing) {
|
|
14837
14970
|
innerRef.current?.focus();
|
|
14838
14971
|
}
|
|
14839
14972
|
}, [isEditing]);
|
|
14840
|
-
return /* @__PURE__ */ (0,
|
|
14841
|
-
/* @__PURE__ */ (0,
|
|
14973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: (0, import_clsx36.default)("relative flex-row-2", { "flex-1": isEditing }), children: [
|
|
14974
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
14842
14975
|
Input,
|
|
14843
14976
|
{
|
|
14844
14977
|
...props,
|
|
@@ -14864,9 +14997,9 @@ var ToggleableInput = (0, import_react58.forwardRef)(function ToggleableInput2({
|
|
|
14864
14997
|
})
|
|
14865
14998
|
}
|
|
14866
14999
|
),
|
|
14867
|
-
!isEditing && /* @__PURE__ */ (0,
|
|
14868
|
-
/* @__PURE__ */ (0,
|
|
14869
|
-
/* @__PURE__ */ (0,
|
|
15000
|
+
!isEditing && /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
|
|
15001
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: (0, import_clsx36.default)(" truncate"), children: value }),
|
|
15002
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_lucide_react22.Pencil, { className: (0, import_clsx36.default)(`size-force-4`, { "text-transparent": isEditing }) })
|
|
14870
15003
|
] })
|
|
14871
15004
|
] });
|
|
14872
15005
|
});
|
|
@@ -14876,7 +15009,7 @@ var ToggleableInputUncontrolled = ({
|
|
|
14876
15009
|
...restProps
|
|
14877
15010
|
}) => {
|
|
14878
15011
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14879
|
-
return /* @__PURE__ */ (0,
|
|
15012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
14880
15013
|
ToggleableInput,
|
|
14881
15014
|
{
|
|
14882
15015
|
value,
|
|
@@ -14887,11 +15020,11 @@ var ToggleableInputUncontrolled = ({
|
|
|
14887
15020
|
};
|
|
14888
15021
|
|
|
14889
15022
|
// src/components/user-interaction/properties/CheckboxProperty.tsx
|
|
14890
|
-
var
|
|
15023
|
+
var import_lucide_react24 = require("lucide-react");
|
|
14891
15024
|
|
|
14892
15025
|
// src/components/user-interaction/properties/PropertyBase.tsx
|
|
14893
|
-
var
|
|
14894
|
-
var
|
|
15026
|
+
var import_lucide_react23 = require("lucide-react");
|
|
15027
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
14895
15028
|
var PropertyBase = ({
|
|
14896
15029
|
name: name2,
|
|
14897
15030
|
children,
|
|
@@ -14910,29 +15043,29 @@ var PropertyBase = ({
|
|
|
14910
15043
|
const isClearEnabled = allowClear && !readOnly;
|
|
14911
15044
|
const isRemoveEnabled = allowRemove && !readOnly;
|
|
14912
15045
|
const showActionsContainer = isClearEnabled || isRemoveEnabled;
|
|
14913
|
-
return /* @__PURE__ */ (0,
|
|
15046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
14914
15047
|
"div",
|
|
14915
15048
|
{
|
|
14916
15049
|
className: className ? `group/property ${className}` : "group/property",
|
|
14917
15050
|
"data-name": "property-root",
|
|
14918
15051
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14919
15052
|
children: [
|
|
14920
|
-
/* @__PURE__ */ (0,
|
|
15053
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
14921
15054
|
"div",
|
|
14922
15055
|
{
|
|
14923
15056
|
className,
|
|
14924
15057
|
"data-name": "property-title",
|
|
14925
15058
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14926
15059
|
children: [
|
|
14927
|
-
/* @__PURE__ */ (0,
|
|
14928
|
-
/* @__PURE__ */ (0,
|
|
14929
|
-
/* @__PURE__ */ (0,
|
|
15060
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Tooltip, { tooltip: name2, containerClassName: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex-row-1 items-center", children: [
|
|
15061
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { "data-name": "property-title-icon", children: icon }),
|
|
15062
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { "data-name": "property-title-text", children: name2 })
|
|
14930
15063
|
] }) }),
|
|
14931
|
-
invalid && /* @__PURE__ */ (0,
|
|
15064
|
+
invalid && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react23.AlertTriangle, { className: "size-force-6" })
|
|
14932
15065
|
]
|
|
14933
15066
|
}
|
|
14934
15067
|
),
|
|
14935
|
-
/* @__PURE__ */ (0,
|
|
15068
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
14936
15069
|
"div",
|
|
14937
15070
|
{
|
|
14938
15071
|
className,
|
|
@@ -14940,8 +15073,8 @@ var PropertyBase = ({
|
|
|
14940
15073
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14941
15074
|
children: [
|
|
14942
15075
|
children({ required, hasValue, invalid }),
|
|
14943
|
-
showActionsContainer && /* @__PURE__ */ (0,
|
|
14944
|
-
isClearEnabled && /* @__PURE__ */ (0,
|
|
15076
|
+
showActionsContainer && /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { "data-name": "property-actions", children: [
|
|
15077
|
+
isClearEnabled && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Tooltip, { tooltip: translation("clearValue"), children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
14945
15078
|
Button,
|
|
14946
15079
|
{
|
|
14947
15080
|
onClick: onValueClear,
|
|
@@ -14950,10 +15083,10 @@ var PropertyBase = ({
|
|
|
14950
15083
|
coloringStyle: "text",
|
|
14951
15084
|
layout: "icon",
|
|
14952
15085
|
size: "sm",
|
|
14953
|
-
children: /* @__PURE__ */ (0,
|
|
15086
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react23.X, { className: "size-force-5" })
|
|
14954
15087
|
}
|
|
14955
15088
|
) }),
|
|
14956
|
-
isRemoveEnabled && /* @__PURE__ */ (0,
|
|
15089
|
+
isRemoveEnabled && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Tooltip, { tooltip: translation("removeProperty"), children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
14957
15090
|
Button,
|
|
14958
15091
|
{
|
|
14959
15092
|
onClick: onRemove,
|
|
@@ -14961,7 +15094,7 @@ var PropertyBase = ({
|
|
|
14961
15094
|
coloringStyle: "text",
|
|
14962
15095
|
layout: "icon",
|
|
14963
15096
|
size: "sm",
|
|
14964
|
-
children: /* @__PURE__ */ (0,
|
|
15097
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react23.Trash, { className: "size-force-5" })
|
|
14965
15098
|
}
|
|
14966
15099
|
) })
|
|
14967
15100
|
] })
|
|
@@ -14974,7 +15107,7 @@ var PropertyBase = ({
|
|
|
14974
15107
|
};
|
|
14975
15108
|
|
|
14976
15109
|
// src/components/user-interaction/properties/CheckboxProperty.tsx
|
|
14977
|
-
var
|
|
15110
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
14978
15111
|
var CheckboxProperty = ({
|
|
14979
15112
|
value,
|
|
14980
15113
|
onValueChange,
|
|
@@ -14983,15 +15116,15 @@ var CheckboxProperty = ({
|
|
|
14983
15116
|
...baseProps
|
|
14984
15117
|
}) => {
|
|
14985
15118
|
const translation = useHightideTranslation();
|
|
14986
|
-
return /* @__PURE__ */ (0,
|
|
15119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
14987
15120
|
PropertyBase,
|
|
14988
15121
|
{
|
|
14989
15122
|
...baseProps,
|
|
14990
15123
|
hasValue: value !== void 0,
|
|
14991
15124
|
readOnly,
|
|
14992
|
-
icon: /* @__PURE__ */ (0,
|
|
14993
|
-
children: () => /* @__PURE__ */ (0,
|
|
14994
|
-
/* @__PURE__ */ (0,
|
|
15125
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_lucide_react24.Check, { size: 24 }),
|
|
15126
|
+
children: () => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
15127
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
14995
15128
|
Button,
|
|
14996
15129
|
{
|
|
14997
15130
|
color: value ? "positive" : "neutral",
|
|
@@ -15004,7 +15137,7 @@ var CheckboxProperty = ({
|
|
|
15004
15137
|
children: translation("yes")
|
|
15005
15138
|
}
|
|
15006
15139
|
),
|
|
15007
|
-
/* @__PURE__ */ (0,
|
|
15140
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
15008
15141
|
Button,
|
|
15009
15142
|
{
|
|
15010
15143
|
color: !value && value !== void 0 ? "negative" : "neutral",
|
|
@@ -15023,8 +15156,8 @@ var CheckboxProperty = ({
|
|
|
15023
15156
|
};
|
|
15024
15157
|
|
|
15025
15158
|
// src/components/user-interaction/properties/DateProperty.tsx
|
|
15026
|
-
var
|
|
15027
|
-
var
|
|
15159
|
+
var import_lucide_react25 = require("lucide-react");
|
|
15160
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
15028
15161
|
var DateProperty = ({
|
|
15029
15162
|
value,
|
|
15030
15163
|
onValueChange,
|
|
@@ -15034,13 +15167,13 @@ var DateProperty = ({
|
|
|
15034
15167
|
...baseProps
|
|
15035
15168
|
}) => {
|
|
15036
15169
|
const hasValue = !!value;
|
|
15037
|
-
return /* @__PURE__ */ (0,
|
|
15170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
15038
15171
|
PropertyBase,
|
|
15039
15172
|
{
|
|
15040
15173
|
...baseProps,
|
|
15041
15174
|
hasValue,
|
|
15042
|
-
icon: /* @__PURE__ */ (0,
|
|
15043
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15175
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react25.CalendarDays, { size: 24 }),
|
|
15176
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
15044
15177
|
DateTimeInput,
|
|
15045
15178
|
{
|
|
15046
15179
|
value,
|
|
@@ -15057,8 +15190,8 @@ var DateProperty = ({
|
|
|
15057
15190
|
};
|
|
15058
15191
|
|
|
15059
15192
|
// src/components/user-interaction/properties/MultiSelectProperty.tsx
|
|
15060
|
-
var
|
|
15061
|
-
var
|
|
15193
|
+
var import_lucide_react26 = require("lucide-react");
|
|
15194
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
15062
15195
|
var MultiSelectProperty = ({
|
|
15063
15196
|
children,
|
|
15064
15197
|
value,
|
|
@@ -15067,18 +15200,18 @@ var MultiSelectProperty = ({
|
|
|
15067
15200
|
...props
|
|
15068
15201
|
}) => {
|
|
15069
15202
|
const hasValue = value.length > 0;
|
|
15070
|
-
return /* @__PURE__ */ (0,
|
|
15203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15071
15204
|
PropertyBase,
|
|
15072
15205
|
{
|
|
15073
15206
|
...props,
|
|
15074
15207
|
hasValue,
|
|
15075
|
-
icon: /* @__PURE__ */ (0,
|
|
15076
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15208
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react26.List, { size: 24 }),
|
|
15209
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15077
15210
|
"div",
|
|
15078
15211
|
{
|
|
15079
15212
|
"data-name": "property-input-wrapper",
|
|
15080
15213
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
15081
|
-
children: /* @__PURE__ */ (0,
|
|
15214
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15082
15215
|
MultiSelectChipDisplay,
|
|
15083
15216
|
{
|
|
15084
15217
|
value,
|
|
@@ -15103,8 +15236,8 @@ var MultiSelectProperty = ({
|
|
|
15103
15236
|
};
|
|
15104
15237
|
|
|
15105
15238
|
// src/components/user-interaction/properties/NumberProperty.tsx
|
|
15106
|
-
var
|
|
15107
|
-
var
|
|
15239
|
+
var import_lucide_react27 = require("lucide-react");
|
|
15240
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
15108
15241
|
var NumberProperty = ({
|
|
15109
15242
|
value,
|
|
15110
15243
|
onRemove,
|
|
@@ -15116,20 +15249,20 @@ var NumberProperty = ({
|
|
|
15116
15249
|
}) => {
|
|
15117
15250
|
const translation = useHightideTranslation();
|
|
15118
15251
|
const hasValue = value !== void 0;
|
|
15119
|
-
return /* @__PURE__ */ (0,
|
|
15252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15120
15253
|
PropertyBase,
|
|
15121
15254
|
{
|
|
15122
15255
|
...baseProps,
|
|
15123
15256
|
onRemove,
|
|
15124
15257
|
hasValue,
|
|
15125
|
-
icon: /* @__PURE__ */ (0,
|
|
15126
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15258
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react27.Binary, { size: 24 }),
|
|
15259
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
15127
15260
|
"div",
|
|
15128
15261
|
{
|
|
15129
15262
|
"data-name": "property-input-wrapper",
|
|
15130
15263
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
15131
15264
|
children: [
|
|
15132
|
-
/* @__PURE__ */ (0,
|
|
15265
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15133
15266
|
Input,
|
|
15134
15267
|
{
|
|
15135
15268
|
className: "w-full pr-8",
|
|
@@ -15157,7 +15290,7 @@ var NumberProperty = ({
|
|
|
15157
15290
|
}
|
|
15158
15291
|
}
|
|
15159
15292
|
),
|
|
15160
|
-
suffix && /* @__PURE__ */ (0,
|
|
15293
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15161
15294
|
"span",
|
|
15162
15295
|
{
|
|
15163
15296
|
"data-name": "property-suffix",
|
|
@@ -15173,8 +15306,8 @@ var NumberProperty = ({
|
|
|
15173
15306
|
};
|
|
15174
15307
|
|
|
15175
15308
|
// src/components/user-interaction/properties/SelectProperty.tsx
|
|
15176
|
-
var
|
|
15177
|
-
var
|
|
15309
|
+
var import_lucide_react28 = require("lucide-react");
|
|
15310
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
15178
15311
|
var SingleSelectProperty = ({
|
|
15179
15312
|
children,
|
|
15180
15313
|
value,
|
|
@@ -15183,18 +15316,18 @@ var SingleSelectProperty = ({
|
|
|
15183
15316
|
...props
|
|
15184
15317
|
}) => {
|
|
15185
15318
|
const hasValue = value !== void 0;
|
|
15186
|
-
return /* @__PURE__ */ (0,
|
|
15319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
15187
15320
|
PropertyBase,
|
|
15188
15321
|
{
|
|
15189
15322
|
...props,
|
|
15190
15323
|
hasValue,
|
|
15191
|
-
icon: /* @__PURE__ */ (0,
|
|
15192
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15324
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_lucide_react28.List, { size: 24 }),
|
|
15325
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
15193
15326
|
"div",
|
|
15194
15327
|
{
|
|
15195
15328
|
"data-name": "property-input-wrapper",
|
|
15196
15329
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
15197
|
-
children: /* @__PURE__ */ (0,
|
|
15330
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
15198
15331
|
Select,
|
|
15199
15332
|
{
|
|
15200
15333
|
value,
|
|
@@ -15216,8 +15349,8 @@ var SingleSelectProperty = ({
|
|
|
15216
15349
|
};
|
|
15217
15350
|
|
|
15218
15351
|
// src/components/user-interaction/properties/TextProperty.tsx
|
|
15219
|
-
var
|
|
15220
|
-
var
|
|
15352
|
+
var import_lucide_react29 = require("lucide-react");
|
|
15353
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
15221
15354
|
var TextProperty = ({
|
|
15222
15355
|
value,
|
|
15223
15356
|
readOnly,
|
|
@@ -15228,14 +15361,14 @@ var TextProperty = ({
|
|
|
15228
15361
|
}) => {
|
|
15229
15362
|
const translation = useHightideTranslation();
|
|
15230
15363
|
const hasValue = value !== void 0;
|
|
15231
|
-
return /* @__PURE__ */ (0,
|
|
15364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15232
15365
|
PropertyBase,
|
|
15233
15366
|
{
|
|
15234
15367
|
...baseProps,
|
|
15235
15368
|
onRemove,
|
|
15236
15369
|
hasValue,
|
|
15237
|
-
icon: /* @__PURE__ */ (0,
|
|
15238
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15370
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react29.Text, { size: 24 }),
|
|
15371
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15239
15372
|
Textarea,
|
|
15240
15373
|
{
|
|
15241
15374
|
className: "w-full",
|
|
@@ -15266,33 +15399,33 @@ var TextProperty = ({
|
|
|
15266
15399
|
};
|
|
15267
15400
|
|
|
15268
15401
|
// src/components/utils/FocusTrap.tsx
|
|
15269
|
-
var
|
|
15270
|
-
var
|
|
15271
|
-
var
|
|
15272
|
-
var
|
|
15273
|
-
var FocusTrap = (0,
|
|
15402
|
+
var import_react63 = require("react");
|
|
15403
|
+
var import_react64 = require("react");
|
|
15404
|
+
var import_react65 = require("react");
|
|
15405
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
15406
|
+
var FocusTrap = (0, import_react65.forwardRef)(function FocusTrap2({
|
|
15274
15407
|
active = true,
|
|
15275
15408
|
initialFocus,
|
|
15276
15409
|
focusFirst = false,
|
|
15277
15410
|
...props
|
|
15278
15411
|
}, forwardedRef) {
|
|
15279
|
-
const innerRef = (0,
|
|
15280
|
-
(0,
|
|
15412
|
+
const innerRef = (0, import_react63.useRef)(null);
|
|
15413
|
+
(0, import_react64.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
15281
15414
|
useFocusTrap({ container: innerRef, active, initialFocus, focusFirst });
|
|
15282
|
-
return /* @__PURE__ */ (0,
|
|
15415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { ref: innerRef, ...props });
|
|
15283
15416
|
});
|
|
15284
15417
|
|
|
15285
15418
|
// src/components/utils/Transition.tsx
|
|
15286
|
-
var
|
|
15419
|
+
var import_react66 = require("react");
|
|
15287
15420
|
function Transition({
|
|
15288
15421
|
children,
|
|
15289
15422
|
show,
|
|
15290
15423
|
includeAnimation = true
|
|
15291
15424
|
}) {
|
|
15292
|
-
const [isOpen, setIsOpen] = (0,
|
|
15293
|
-
const [isTransitioning, setIsTransitioning] = (0,
|
|
15425
|
+
const [isOpen, setIsOpen] = (0, import_react66.useState)(show);
|
|
15426
|
+
const [isTransitioning, setIsTransitioning] = (0, import_react66.useState)(!isOpen);
|
|
15294
15427
|
const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
|
|
15295
|
-
(0,
|
|
15428
|
+
(0, import_react66.useEffect)(() => {
|
|
15296
15429
|
setIsOpen(show);
|
|
15297
15430
|
setIsTransitioning(true);
|
|
15298
15431
|
}, [show]);
|
|
@@ -15317,18 +15450,18 @@ function Transition({
|
|
|
15317
15450
|
}
|
|
15318
15451
|
|
|
15319
15452
|
// src/contexts/HightideProvider.tsx
|
|
15320
|
-
var
|
|
15453
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
15321
15454
|
var HightideProvider = ({
|
|
15322
15455
|
children,
|
|
15323
15456
|
theme,
|
|
15324
15457
|
locale,
|
|
15325
15458
|
config
|
|
15326
15459
|
}) => {
|
|
15327
|
-
return /* @__PURE__ */ (0,
|
|
15460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(LocaleProvider, { ...locale, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ThemeProvider, { ...theme, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(HightideConfigProvider, { ...config, children }) }) });
|
|
15328
15461
|
};
|
|
15329
15462
|
|
|
15330
15463
|
// src/hooks/focus/useFocusGuards.ts
|
|
15331
|
-
var
|
|
15464
|
+
var import_react67 = require("react");
|
|
15332
15465
|
var selectorName = "data-hw-focus-guard";
|
|
15333
15466
|
function FocusGuard() {
|
|
15334
15467
|
const element = document.createElement("div");
|
|
@@ -15366,7 +15499,7 @@ var FocusGuardsService = class _FocusGuardsService {
|
|
|
15366
15499
|
}
|
|
15367
15500
|
};
|
|
15368
15501
|
var useFocusGuards = () => {
|
|
15369
|
-
(0,
|
|
15502
|
+
(0, import_react67.useEffect)(() => {
|
|
15370
15503
|
FocusGuardsService.getInstance().add();
|
|
15371
15504
|
return () => {
|
|
15372
15505
|
FocusGuardsService.getInstance().remove();
|
|
@@ -15375,10 +15508,10 @@ var useFocusGuards = () => {
|
|
|
15375
15508
|
};
|
|
15376
15509
|
|
|
15377
15510
|
// src/hooks/focus/useFocusOnceVisible.ts
|
|
15378
|
-
var
|
|
15511
|
+
var import_react68 = __toESM(require("react"));
|
|
15379
15512
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
15380
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
15381
|
-
(0,
|
|
15513
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react68.default.useState(false);
|
|
15514
|
+
(0, import_react68.useEffect)(() => {
|
|
15382
15515
|
if (disable || hasUsedFocus) {
|
|
15383
15516
|
return;
|
|
15384
15517
|
}
|
|
@@ -15398,13 +15531,13 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
15398
15531
|
};
|
|
15399
15532
|
|
|
15400
15533
|
// src/hooks/useRerender.ts
|
|
15401
|
-
var
|
|
15534
|
+
var import_react69 = require("react");
|
|
15402
15535
|
var useRerender = () => {
|
|
15403
|
-
return (0,
|
|
15536
|
+
return (0, import_react69.useReducer)(() => ({}), {})[1];
|
|
15404
15537
|
};
|
|
15405
15538
|
|
|
15406
15539
|
// src/hooks/useSearch.ts
|
|
15407
|
-
var
|
|
15540
|
+
var import_react70 = require("react");
|
|
15408
15541
|
|
|
15409
15542
|
// src/utils/simpleSearch.ts
|
|
15410
15543
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -15443,34 +15576,34 @@ var useSearch = ({
|
|
|
15443
15576
|
filter,
|
|
15444
15577
|
disabled = false
|
|
15445
15578
|
}) => {
|
|
15446
|
-
const [search, setSearch] = (0,
|
|
15447
|
-
const [result, setResult] = (0,
|
|
15448
|
-
const searchTags = (0,
|
|
15449
|
-
const updateSearch = (0,
|
|
15579
|
+
const [search, setSearch] = (0, import_react70.useState)(initialSearch ?? "");
|
|
15580
|
+
const [result, setResult] = (0, import_react70.useState)(list);
|
|
15581
|
+
const searchTags = (0, import_react70.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
15582
|
+
const updateSearch = (0, import_react70.useCallback)((newSearch) => {
|
|
15450
15583
|
const usedSearch = newSearch ?? search;
|
|
15451
15584
|
if (newSearch) {
|
|
15452
15585
|
setSearch(search);
|
|
15453
15586
|
}
|
|
15454
15587
|
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
15455
15588
|
}, [searchTags, list, search, searchMapping]);
|
|
15456
|
-
(0,
|
|
15589
|
+
(0, import_react70.useEffect)(() => {
|
|
15457
15590
|
if (isSearchInstant) {
|
|
15458
15591
|
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
15459
15592
|
}
|
|
15460
15593
|
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
15461
|
-
const filteredResult = (0,
|
|
15594
|
+
const filteredResult = (0, import_react70.useMemo)(() => {
|
|
15462
15595
|
if (!filter) {
|
|
15463
15596
|
return result;
|
|
15464
15597
|
}
|
|
15465
15598
|
return result.filter(filter);
|
|
15466
15599
|
}, [result, filter]);
|
|
15467
|
-
const sortedAndFilteredResult = (0,
|
|
15600
|
+
const sortedAndFilteredResult = (0, import_react70.useMemo)(() => {
|
|
15468
15601
|
if (!sortingFunction) {
|
|
15469
15602
|
return filteredResult;
|
|
15470
15603
|
}
|
|
15471
15604
|
return filteredResult.sort(sortingFunction);
|
|
15472
15605
|
}, [filteredResult, sortingFunction]);
|
|
15473
|
-
const usedResult = (0,
|
|
15606
|
+
const usedResult = (0, import_react70.useMemo)(() => {
|
|
15474
15607
|
if (!disabled) {
|
|
15475
15608
|
return sortedAndFilteredResult;
|
|
15476
15609
|
}
|
|
@@ -15492,7 +15625,7 @@ var validateEmail = (email) => {
|
|
|
15492
15625
|
};
|
|
15493
15626
|
|
|
15494
15627
|
// src/hooks/useValidators.ts
|
|
15495
|
-
var
|
|
15628
|
+
var import_react71 = require("react");
|
|
15496
15629
|
var notEmpty = (value) => {
|
|
15497
15630
|
if (!value) {
|
|
15498
15631
|
return "notEmpty";
|
|
@@ -15542,7 +15675,7 @@ var UseValidators = {
|
|
|
15542
15675
|
};
|
|
15543
15676
|
var useTranslatedValidators = () => {
|
|
15544
15677
|
const translation = useHightideTranslation();
|
|
15545
|
-
return (0,
|
|
15678
|
+
return (0, import_react71.useMemo)(() => ({
|
|
15546
15679
|
notEmpty: (value) => {
|
|
15547
15680
|
const result = notEmpty(value);
|
|
15548
15681
|
if (result) {
|
|
@@ -15880,9 +16013,14 @@ var PromiseUtils = {
|
|
|
15880
16013
|
MenuItem,
|
|
15881
16014
|
MultiSearchWithMapping,
|
|
15882
16015
|
MultiSelect,
|
|
16016
|
+
MultiSelectButton,
|
|
15883
16017
|
MultiSelectChipDisplay,
|
|
16018
|
+
MultiSelectChipDisplayButton,
|
|
15884
16019
|
MultiSelectChipDisplayUncontrolled,
|
|
16020
|
+
MultiSelectContent,
|
|
16021
|
+
MultiSelectOption,
|
|
15885
16022
|
MultiSelectProperty,
|
|
16023
|
+
MultiSelectRoot,
|
|
15886
16024
|
MultiSelectUncontrolled,
|
|
15887
16025
|
MultiSubjectSearchWithMapping,
|
|
15888
16026
|
Navigation,
|
|
@@ -15900,8 +16038,8 @@ var PromiseUtils = {
|
|
|
15900
16038
|
SearchBar,
|
|
15901
16039
|
Select,
|
|
15902
16040
|
SelectButton,
|
|
15903
|
-
SelectChipDisplay,
|
|
15904
16041
|
SelectContent,
|
|
16042
|
+
SelectContext,
|
|
15905
16043
|
SelectOption,
|
|
15906
16044
|
SelectRoot,
|
|
15907
16045
|
SelectUncontrolled,
|
|
@@ -15990,6 +16128,7 @@ var PromiseUtils = {
|
|
|
15990
16128
|
useRerender,
|
|
15991
16129
|
useResizeCallbackWrapper,
|
|
15992
16130
|
useSearch,
|
|
16131
|
+
useSelectContext,
|
|
15993
16132
|
useTabContext,
|
|
15994
16133
|
useTheme,
|
|
15995
16134
|
useTransitionState,
|