@helpwave/hightide 0.6.2 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +347 -209
- package/dist/index.d.ts +347 -209
- package/dist/index.js +979 -850
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +895 -781
- package/dist/index.mjs.map +1 -1
- package/dist/style/globals.css +20 -60
- package/dist/style/uncompiled/theme/components/tooltip.css +13 -4
- package/dist/style/uncompiled/utitlity/animation.css +0 -61
- 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,6 +7594,7 @@ 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() {
|
|
@@ -7561,7 +7613,7 @@ var FormStore = class {
|
|
|
7561
7613
|
} else {
|
|
7562
7614
|
this.errors[key] = error;
|
|
7563
7615
|
}
|
|
7564
|
-
this.notify({ type: "onError", key, value: this.values[key], error });
|
|
7616
|
+
this.notify({ type: "onError", key, value: this.values[key], error, values: { ...this.values } });
|
|
7565
7617
|
}
|
|
7566
7618
|
changeValidationBehavoir(validationBehaviour) {
|
|
7567
7619
|
if (validationBehaviour === this.validationBehaviour) return;
|
|
@@ -7610,35 +7662,30 @@ var FormStore = class {
|
|
|
7610
7662
|
// Form
|
|
7611
7663
|
submit() {
|
|
7612
7664
|
this.hasTriedSubmitting = true;
|
|
7613
|
-
|
|
7614
|
-
this.
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
const hasErrors = Object.keys(this.errors).length > 0;
|
|
7618
|
-
if (hasErrors) {
|
|
7619
|
-
this.notify({
|
|
7620
|
-
type: "submitError",
|
|
7621
|
-
key: "ALL",
|
|
7622
|
-
errors: this.errors,
|
|
7623
|
-
values: this.values
|
|
7624
|
-
});
|
|
7625
|
-
} else {
|
|
7626
|
-
this.notify({
|
|
7627
|
-
type: "submit",
|
|
7628
|
-
key: "ALL",
|
|
7629
|
-
values: this.values
|
|
7665
|
+
if (this.submittingTouchesAll) {
|
|
7666
|
+
Object.keys(this.initialValues).forEach((k) => {
|
|
7667
|
+
this.touched[k] = true;
|
|
7668
|
+
this.validate(k);
|
|
7630
7669
|
});
|
|
7631
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
|
+
});
|
|
7632
7679
|
}
|
|
7633
7680
|
reset() {
|
|
7634
7681
|
this.values = { ...this.initialValues };
|
|
7635
7682
|
this.hasTriedSubmitting = false;
|
|
7636
7683
|
this.touched = {};
|
|
7637
7684
|
Object.keys(this.initialValues).forEach((key) => {
|
|
7638
|
-
this.notify({ type: "onChange", key, value: this.values[key] });
|
|
7685
|
+
this.notify({ type: "onChange", key, value: this.values[key], values: { ...this.values } });
|
|
7639
7686
|
});
|
|
7640
7687
|
this.validateAll();
|
|
7641
|
-
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 } });
|
|
7642
7689
|
}
|
|
7643
7690
|
};
|
|
7644
7691
|
|
|
@@ -7648,6 +7695,8 @@ function useCreateForm({
|
|
|
7648
7695
|
onFormSubmit,
|
|
7649
7696
|
onFormError,
|
|
7650
7697
|
onValueChange,
|
|
7698
|
+
onUpdate,
|
|
7699
|
+
onValidUpdate,
|
|
7651
7700
|
initialValues,
|
|
7652
7701
|
hasTriedSubmitting,
|
|
7653
7702
|
validators,
|
|
@@ -7677,22 +7726,24 @@ function useCreateForm({
|
|
|
7677
7726
|
}, []);
|
|
7678
7727
|
(0, import_react7.useEffect)(() => {
|
|
7679
7728
|
const handleUpdate = (event) => {
|
|
7680
|
-
if (event.type === "
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
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
|
+
}
|
|
7695
7744
|
}
|
|
7745
|
+
} else {
|
|
7746
|
+
onFormSubmit(event.values);
|
|
7696
7747
|
}
|
|
7697
7748
|
} else if (event.type === "reset") {
|
|
7698
7749
|
if (scrollToElements) {
|
|
@@ -7712,23 +7763,18 @@ function useCreateForm({
|
|
|
7712
7763
|
}
|
|
7713
7764
|
} else if (event.type === "onChange") {
|
|
7714
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
|
+
}
|
|
7715
7771
|
}
|
|
7716
7772
|
};
|
|
7717
7773
|
const unsubscribe = storeRef.current.subscribe("ALL", handleUpdate);
|
|
7718
7774
|
return () => {
|
|
7719
7775
|
unsubscribe();
|
|
7720
7776
|
};
|
|
7721
|
-
}, [onFormError, onFormSubmit, onValueChange, scrollOptions, scrollToElements]);
|
|
7722
|
-
const getDataProps = (0, import_react7.useCallback)((key) => {
|
|
7723
|
-
return {
|
|
7724
|
-
value: storeRef.current.getValue(key),
|
|
7725
|
-
onValueChange: (val) => storeRef.current.setValue(key, val),
|
|
7726
|
-
onEditComplete: (val) => {
|
|
7727
|
-
storeRef.current.setValue(key, val);
|
|
7728
|
-
storeRef.current.setTouched(key);
|
|
7729
|
-
}
|
|
7730
|
-
};
|
|
7731
|
-
}, []);
|
|
7777
|
+
}, [onFormError, onFormSubmit, onUpdate, onValidUpdate, onValueChange, scrollOptions, scrollToElements]);
|
|
7732
7778
|
const callbacks = (0, import_react7.useMemo)(() => ({
|
|
7733
7779
|
reset: () => storeRef.current.reset(),
|
|
7734
7780
|
submit: () => storeRef.current.submit(),
|
|
@@ -7749,7 +7795,6 @@ function useCreateForm({
|
|
|
7749
7795
|
return {
|
|
7750
7796
|
store: storeRef.current,
|
|
7751
7797
|
...callbacks,
|
|
7752
|
-
getDataProps,
|
|
7753
7798
|
registerRef
|
|
7754
7799
|
};
|
|
7755
7800
|
}
|
|
@@ -8357,8 +8402,7 @@ var import_react9 = require("react");
|
|
|
8357
8402
|
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
8358
8403
|
var defaultConfig = {
|
|
8359
8404
|
tooltip: {
|
|
8360
|
-
appearDelay:
|
|
8361
|
-
disappearDelay: 400
|
|
8405
|
+
appearDelay: 400
|
|
8362
8406
|
},
|
|
8363
8407
|
theme: {
|
|
8364
8408
|
initialTheme: "light"
|
|
@@ -9507,7 +9551,6 @@ var Expandable = (0, import_react21.forwardRef)(function Expandable2({
|
|
|
9507
9551
|
children,
|
|
9508
9552
|
id,
|
|
9509
9553
|
label,
|
|
9510
|
-
icon,
|
|
9511
9554
|
isExpanded,
|
|
9512
9555
|
onChange,
|
|
9513
9556
|
clickOnlyOnHeader = true,
|
|
@@ -9517,8 +9560,6 @@ var Expandable = (0, import_react21.forwardRef)(function Expandable2({
|
|
|
9517
9560
|
contentClassName,
|
|
9518
9561
|
contentExpandedClassName
|
|
9519
9562
|
}, ref) {
|
|
9520
|
-
const defaultIcon = (0, import_react21.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
|
|
9521
|
-
const iconBuilder = icon ?? defaultIcon;
|
|
9522
9563
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
9523
9564
|
ExpandableRoot,
|
|
9524
9565
|
{
|
|
@@ -9530,10 +9571,7 @@ var Expandable = (0, import_react21.forwardRef)(function Expandable2({
|
|
|
9530
9571
|
allowContainerToggle: !clickOnlyOnHeader,
|
|
9531
9572
|
className,
|
|
9532
9573
|
children: [
|
|
9533
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.
|
|
9534
|
-
label,
|
|
9535
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExpandableContext.Consumer, { children: (ctx) => iconBuilder(ctx?.isExpanded ?? false) })
|
|
9536
|
-
] }),
|
|
9574
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExpandableHeader, { className: headerClassName, children: label }),
|
|
9537
9575
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExpandableContext.Consumer, { children: (ctx) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
9538
9576
|
ExpandableContent,
|
|
9539
9577
|
{
|
|
@@ -9721,9 +9759,9 @@ var FloatingContainer = (0, import_react23.forwardRef)(function FloatingContaine
|
|
|
9721
9759
|
screenPadding = 16,
|
|
9722
9760
|
gap = 4,
|
|
9723
9761
|
...props
|
|
9724
|
-
},
|
|
9762
|
+
}, forwardRef16) {
|
|
9725
9763
|
const innerRef = (0, import_react23.useRef)(null);
|
|
9726
|
-
(0, import_react23.useImperativeHandle)(
|
|
9764
|
+
(0, import_react23.useImperativeHandle)(forwardRef16, () => innerRef.current);
|
|
9727
9765
|
const position = useFloatingElement({
|
|
9728
9766
|
active: !props.hidden,
|
|
9729
9767
|
containerRef: innerRef,
|
|
@@ -11055,11 +11093,11 @@ var InputDialog = ({
|
|
|
11055
11093
|
);
|
|
11056
11094
|
};
|
|
11057
11095
|
|
|
11058
|
-
// src/components/user-interaction/Select.tsx
|
|
11096
|
+
// src/components/user-interaction/select/Select.tsx
|
|
11097
|
+
var import_react36 = require("react");
|
|
11098
|
+
|
|
11099
|
+
// src/components/user-interaction/select/SelectContext.tsx
|
|
11059
11100
|
var import_react34 = require("react");
|
|
11060
|
-
var import_clsx13 = __toESM(require("clsx"));
|
|
11061
|
-
var import_lucide_react7 = require("lucide-react");
|
|
11062
|
-
var import_react_dom5 = require("react-dom");
|
|
11063
11101
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
11064
11102
|
var defaultToggleOpenOptions = {
|
|
11065
11103
|
highlightStartPositionBehavior: "first"
|
|
@@ -11068,28 +11106,34 @@ var SelectContext = (0, import_react34.createContext)(null);
|
|
|
11068
11106
|
function useSelectContext() {
|
|
11069
11107
|
const ctx = (0, import_react34.useContext)(SelectContext);
|
|
11070
11108
|
if (!ctx) {
|
|
11071
|
-
throw new Error("
|
|
11109
|
+
throw new Error("useSelectContext must be used within a SelectRoot or MultiSelectRoot");
|
|
11072
11110
|
}
|
|
11073
11111
|
return ctx;
|
|
11074
11112
|
}
|
|
11075
|
-
var
|
|
11113
|
+
var PrimitveSelectRoot = ({
|
|
11076
11114
|
children,
|
|
11077
11115
|
id,
|
|
11078
11116
|
value,
|
|
11079
11117
|
onValueChange,
|
|
11080
11118
|
values,
|
|
11081
11119
|
onValuesChange,
|
|
11082
|
-
|
|
11120
|
+
onClose,
|
|
11121
|
+
initialIsOpen = false,
|
|
11083
11122
|
disabled = false,
|
|
11123
|
+
readOnly = false,
|
|
11124
|
+
required = false,
|
|
11084
11125
|
invalid = false,
|
|
11085
11126
|
isMultiSelect = false,
|
|
11086
11127
|
iconAppearance = "left"
|
|
11087
11128
|
}) => {
|
|
11088
11129
|
const triggerRef = (0, import_react34.useRef)(null);
|
|
11089
11130
|
const generatedId = (0, import_react34.useId)();
|
|
11090
|
-
const
|
|
11131
|
+
const [ids, setIds] = (0, import_react34.useState)({
|
|
11132
|
+
trigger: id ?? (isMultiSelect ? "multi-select-" + generatedId : "select-" + generatedId),
|
|
11133
|
+
content: isMultiSelect ? "multi-select-content-" + generatedId : "select-content-" + generatedId
|
|
11134
|
+
});
|
|
11091
11135
|
const [internalState, setInternalState] = (0, import_react34.useState)({
|
|
11092
|
-
isOpen,
|
|
11136
|
+
isOpen: initialIsOpen,
|
|
11093
11137
|
options: []
|
|
11094
11138
|
});
|
|
11095
11139
|
const selectedValues = (0, import_react34.useMemo)(
|
|
@@ -11102,9 +11146,10 @@ var SelectRoot = ({
|
|
|
11102
11146
|
);
|
|
11103
11147
|
const state = {
|
|
11104
11148
|
...internalState,
|
|
11105
|
-
id: usedId,
|
|
11106
11149
|
disabled,
|
|
11107
11150
|
invalid,
|
|
11151
|
+
readOnly,
|
|
11152
|
+
required,
|
|
11108
11153
|
value: selectedValues,
|
|
11109
11154
|
selectedOptions
|
|
11110
11155
|
};
|
|
@@ -11182,7 +11227,7 @@ var SelectRoot = ({
|
|
|
11182
11227
|
const unregisterTrigger = (0, import_react34.useCallback)(() => {
|
|
11183
11228
|
triggerRef.current = null;
|
|
11184
11229
|
}, []);
|
|
11185
|
-
const toggleOpen = (
|
|
11230
|
+
const toggleOpen = (isOpen, toggleOpenOptions) => {
|
|
11186
11231
|
const { highlightStartPositionBehavior } = { ...defaultToggleOpenOptions, ...toggleOpenOptions };
|
|
11187
11232
|
let firstSelectedValue;
|
|
11188
11233
|
let firstEnabledValue;
|
|
@@ -11198,11 +11243,15 @@ var SelectRoot = ({
|
|
|
11198
11243
|
}
|
|
11199
11244
|
}
|
|
11200
11245
|
}
|
|
11246
|
+
const newIsOpen = isOpen ?? !internalState.isOpen;
|
|
11201
11247
|
setInternalState((prevState) => ({
|
|
11202
11248
|
...prevState,
|
|
11203
|
-
isOpen:
|
|
11249
|
+
isOpen: newIsOpen,
|
|
11204
11250
|
highlightedValue: firstSelectedValue ?? firstEnabledValue
|
|
11205
11251
|
}));
|
|
11252
|
+
if (!newIsOpen) {
|
|
11253
|
+
onClose?.();
|
|
11254
|
+
}
|
|
11206
11255
|
};
|
|
11207
11256
|
const moveHighlightedIndex = (delta) => {
|
|
11208
11257
|
let highlightedIndex = state.options.findIndex((value2) => value2.value === internalState.highlightedValue);
|
|
@@ -11235,6 +11284,8 @@ var SelectRoot = ({
|
|
|
11235
11284
|
}
|
|
11236
11285
|
}, [internalState.highlightedValue]);
|
|
11237
11286
|
const contextValue = {
|
|
11287
|
+
ids,
|
|
11288
|
+
setIds,
|
|
11238
11289
|
state,
|
|
11239
11290
|
config,
|
|
11240
11291
|
item: {
|
|
@@ -11253,14 +11304,52 @@ var SelectRoot = ({
|
|
|
11253
11304
|
};
|
|
11254
11305
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectContext.Provider, { value: contextValue, children });
|
|
11255
11306
|
};
|
|
11256
|
-
var
|
|
11307
|
+
var SelectRoot = ({ value, onValueChange, onEditComplete, ...props }) => {
|
|
11308
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11309
|
+
PrimitveSelectRoot,
|
|
11310
|
+
{
|
|
11311
|
+
...props,
|
|
11312
|
+
isMultiSelect: false,
|
|
11313
|
+
value,
|
|
11314
|
+
onValueChange: (value2) => {
|
|
11315
|
+
onValueChange?.(value2);
|
|
11316
|
+
onEditComplete?.(value2);
|
|
11317
|
+
}
|
|
11318
|
+
}
|
|
11319
|
+
);
|
|
11320
|
+
};
|
|
11321
|
+
var MultiSelectRoot = ({ value, onValueChange, onEditComplete, ...props }) => {
|
|
11322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11323
|
+
PrimitveSelectRoot,
|
|
11324
|
+
{
|
|
11325
|
+
...props,
|
|
11326
|
+
isMultiSelect: true,
|
|
11327
|
+
values: value,
|
|
11328
|
+
onValuesChange: (values) => {
|
|
11329
|
+
onValueChange?.(values);
|
|
11330
|
+
},
|
|
11331
|
+
onClose: () => {
|
|
11332
|
+
onEditComplete?.(value);
|
|
11333
|
+
props.onClose?.();
|
|
11334
|
+
}
|
|
11335
|
+
}
|
|
11336
|
+
);
|
|
11337
|
+
};
|
|
11338
|
+
|
|
11339
|
+
// src/components/user-interaction/select/SelectComponents.tsx
|
|
11340
|
+
var import_react35 = require("react");
|
|
11341
|
+
var import_clsx13 = __toESM(require("clsx"));
|
|
11342
|
+
var import_lucide_react7 = require("lucide-react");
|
|
11343
|
+
var import_react_dom5 = require("react-dom");
|
|
11344
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
11345
|
+
var SelectOption = (0, import_react35.forwardRef)(
|
|
11257
11346
|
function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
|
|
11258
11347
|
const { state, config, item, trigger } = useSelectContext();
|
|
11259
11348
|
const { register, unregister, toggleSelection, highlightItem } = item;
|
|
11260
|
-
const itemRef = (0,
|
|
11349
|
+
const itemRef = (0, import_react35.useRef)(null);
|
|
11261
11350
|
iconAppearance ??= config.iconAppearance;
|
|
11262
11351
|
const label = children ?? value;
|
|
11263
|
-
(0,
|
|
11352
|
+
(0, import_react35.useEffect)(() => {
|
|
11264
11353
|
register({
|
|
11265
11354
|
value,
|
|
11266
11355
|
label,
|
|
@@ -11271,7 +11360,7 @@ var SelectOption = (0, import_react34.forwardRef)(
|
|
|
11271
11360
|
}, [value, disabled, register, unregister, children, label]);
|
|
11272
11361
|
const isHighlighted = state.highlightedValue === value;
|
|
11273
11362
|
const isSelected = state.value.includes(value);
|
|
11274
|
-
return /* @__PURE__ */ (0,
|
|
11363
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
11275
11364
|
"li",
|
|
11276
11365
|
{
|
|
11277
11366
|
...restProps,
|
|
@@ -11310,7 +11399,7 @@ var SelectOption = (0, import_react34.forwardRef)(
|
|
|
11310
11399
|
}
|
|
11311
11400
|
},
|
|
11312
11401
|
children: [
|
|
11313
|
-
iconAppearance === "left" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0,
|
|
11402
|
+
iconAppearance === "left" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11314
11403
|
import_lucide_react7.CheckIcon,
|
|
11315
11404
|
{
|
|
11316
11405
|
className: (0, import_clsx13.default)("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
@@ -11318,7 +11407,7 @@ var SelectOption = (0, import_react34.forwardRef)(
|
|
|
11318
11407
|
}
|
|
11319
11408
|
),
|
|
11320
11409
|
label,
|
|
11321
|
-
iconAppearance === "right" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0,
|
|
11410
|
+
iconAppearance === "right" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11322
11411
|
import_lucide_react7.CheckIcon,
|
|
11323
11412
|
{
|
|
11324
11413
|
className: (0, import_clsx13.default)("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
@@ -11330,25 +11419,38 @@ var SelectOption = (0, import_react34.forwardRef)(
|
|
|
11330
11419
|
);
|
|
11331
11420
|
}
|
|
11332
11421
|
);
|
|
11333
|
-
var SelectButton = (0,
|
|
11422
|
+
var SelectButton = (0, import_react35.forwardRef)(function SelectButton2({
|
|
11423
|
+
id,
|
|
11424
|
+
placeholder,
|
|
11425
|
+
selectedDisplay,
|
|
11426
|
+
...props
|
|
11427
|
+
}, ref) {
|
|
11334
11428
|
const translation = useHightideTranslation();
|
|
11335
|
-
const { state, trigger } = useSelectContext();
|
|
11429
|
+
const { state, trigger, setIds, ids } = useSelectContext();
|
|
11336
11430
|
const { register, unregister, toggleOpen } = trigger;
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
11431
|
+
(0, import_react35.useEffect)(() => {
|
|
11432
|
+
if (id) {
|
|
11433
|
+
setIds((prev) => ({
|
|
11434
|
+
...prev,
|
|
11435
|
+
trigger: id
|
|
11436
|
+
}));
|
|
11437
|
+
}
|
|
11438
|
+
}, [id, setIds]);
|
|
11439
|
+
const innerRef = (0, import_react35.useRef)(null);
|
|
11440
|
+
(0, import_react35.useImperativeHandle)(ref, () => innerRef.current);
|
|
11441
|
+
(0, import_react35.useEffect)(() => {
|
|
11340
11442
|
register(innerRef);
|
|
11341
11443
|
return () => unregister();
|
|
11342
11444
|
}, [register, unregister]);
|
|
11343
11445
|
const disabled = !!props?.disabled || !!state.disabled;
|
|
11344
11446
|
const invalid = state.invalid;
|
|
11345
11447
|
const hasValue = state.value.length > 0;
|
|
11346
|
-
return /* @__PURE__ */ (0,
|
|
11448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
11347
11449
|
"button",
|
|
11348
11450
|
{
|
|
11349
11451
|
...props,
|
|
11350
11452
|
ref: innerRef,
|
|
11351
|
-
id:
|
|
11453
|
+
id: ids.trigger,
|
|
11352
11454
|
disabled,
|
|
11353
11455
|
type: "button",
|
|
11354
11456
|
onClick: (event) => {
|
|
@@ -11378,206 +11480,140 @@ var SelectButton = (0, import_react34.forwardRef)(function SelectButton2({ place
|
|
|
11378
11480
|
"aria-disabled": disabled,
|
|
11379
11481
|
"aria-haspopup": "listbox",
|
|
11380
11482
|
"aria-expanded": state.isOpen,
|
|
11381
|
-
"aria-controls": state.isOpen ?
|
|
11483
|
+
"aria-controls": state.isOpen ? ids.content : void 0,
|
|
11382
11484
|
children: [
|
|
11383
|
-
hasValue ? selectedDisplay?.(state.value) ?? /* @__PURE__ */ (0,
|
|
11485
|
+
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: [
|
|
11384
11486
|
label,
|
|
11385
|
-
index < state.value.length - 1 && /* @__PURE__ */ (0,
|
|
11487
|
+
index < state.value.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "," })
|
|
11386
11488
|
] }, value)) }) : placeholder ?? translation("clickToSelect"),
|
|
11387
|
-
/* @__PURE__ */ (0,
|
|
11489
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ExpansionIcon, { isExpanded: state.isOpen })
|
|
11388
11490
|
]
|
|
11389
11491
|
}
|
|
11390
11492
|
);
|
|
11391
11493
|
});
|
|
11392
|
-
var
|
|
11393
|
-
|
|
11394
|
-
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
|
|
11401
|
-
const
|
|
11402
|
-
|
|
11403
|
-
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11408
|
-
|
|
11409
|
-
|
|
11410
|
-
|
|
11411
|
-
|
|
11412
|
-
|
|
11413
|
-
|
|
11414
|
-
|
|
11415
|
-
|
|
11416
|
-
|
|
11417
|
-
|
|
11418
|
-
|
|
11419
|
-
|
|
11420
|
-
|
|
11421
|
-
|
|
11422
|
-
|
|
11494
|
+
var SelectContent = (0, import_react35.forwardRef)(function SelectContent2({
|
|
11495
|
+
id,
|
|
11496
|
+
alignment,
|
|
11497
|
+
orientation = "vertical",
|
|
11498
|
+
containerClassName,
|
|
11499
|
+
...props
|
|
11500
|
+
}, ref) {
|
|
11501
|
+
const innerRef = (0, import_react35.useRef)(null);
|
|
11502
|
+
(0, import_react35.useImperativeHandle)(ref, () => innerRef.current);
|
|
11503
|
+
const { trigger, state, config, item, ids, setIds } = useSelectContext();
|
|
11504
|
+
(0, import_react35.useEffect)(() => {
|
|
11505
|
+
if (id) {
|
|
11506
|
+
setIds((prev) => ({
|
|
11507
|
+
...prev,
|
|
11508
|
+
content: id
|
|
11509
|
+
}));
|
|
11510
|
+
}
|
|
11511
|
+
}, [id, setIds]);
|
|
11512
|
+
const position = useFloatingElement({
|
|
11513
|
+
active: state.isOpen,
|
|
11514
|
+
anchorRef: trigger.ref,
|
|
11515
|
+
containerRef: innerRef,
|
|
11516
|
+
...alignment
|
|
11517
|
+
});
|
|
11518
|
+
useFocusTrap({
|
|
11519
|
+
container: innerRef,
|
|
11520
|
+
active: state.isOpen && !!position
|
|
11521
|
+
});
|
|
11522
|
+
const { zIndex } = useOverlayRegistry({ isActive: state.isOpen });
|
|
11523
|
+
return (0, import_react_dom5.createPortal)(
|
|
11524
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
11525
|
+
"div",
|
|
11526
|
+
{
|
|
11527
|
+
id: ids.content,
|
|
11528
|
+
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen", containerClassName),
|
|
11529
|
+
style: { zIndex },
|
|
11530
|
+
hidden: !state.isOpen,
|
|
11531
|
+
children: [
|
|
11532
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11533
|
+
"div",
|
|
11423
11534
|
{
|
|
11424
|
-
onClick: () =>
|
|
11425
|
-
|
|
11535
|
+
onClick: () => trigger.toggleOpen(false),
|
|
11536
|
+
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen")
|
|
11537
|
+
}
|
|
11538
|
+
),
|
|
11539
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11540
|
+
"ul",
|
|
11541
|
+
{
|
|
11542
|
+
...props,
|
|
11543
|
+
ref: innerRef,
|
|
11544
|
+
onKeyDown: (event) => {
|
|
11545
|
+
switch (event.key) {
|
|
11546
|
+
case "Escape":
|
|
11547
|
+
trigger.toggleOpen(false);
|
|
11548
|
+
event.preventDefault();
|
|
11549
|
+
event.stopPropagation();
|
|
11550
|
+
break;
|
|
11551
|
+
case match(orientation, {
|
|
11552
|
+
vertical: "ArrowDown",
|
|
11553
|
+
horizontal: "ArrowUp"
|
|
11554
|
+
}):
|
|
11555
|
+
item.moveHighlightedIndex(1);
|
|
11556
|
+
event.preventDefault();
|
|
11557
|
+
break;
|
|
11558
|
+
case match(orientation, {
|
|
11559
|
+
vertical: "ArrowUp",
|
|
11560
|
+
horizontal: "ArrowDown"
|
|
11561
|
+
}):
|
|
11562
|
+
item.moveHighlightedIndex(-1);
|
|
11563
|
+
event.preventDefault();
|
|
11564
|
+
break;
|
|
11565
|
+
case "Home":
|
|
11566
|
+
event.preventDefault();
|
|
11567
|
+
break;
|
|
11568
|
+
case "End":
|
|
11569
|
+
event.preventDefault();
|
|
11570
|
+
break;
|
|
11571
|
+
case "Enter":
|
|
11572
|
+
// Fall through
|
|
11573
|
+
case " ":
|
|
11574
|
+
if (state.highlightedValue) {
|
|
11575
|
+
item.toggleSelection(state.highlightedValue);
|
|
11576
|
+
if (!config.isMultiSelect) {
|
|
11577
|
+
trigger.toggleOpen(false);
|
|
11578
|
+
}
|
|
11579
|
+
event.preventDefault();
|
|
11580
|
+
}
|
|
11581
|
+
break;
|
|
11582
|
+
}
|
|
11426
11583
|
},
|
|
11427
|
-
|
|
11428
|
-
|
|
11429
|
-
|
|
11430
|
-
|
|
11431
|
-
|
|
11432
|
-
|
|
11584
|
+
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),
|
|
11585
|
+
style: {
|
|
11586
|
+
opacity: position ? void 0 : 0,
|
|
11587
|
+
position: "fixed",
|
|
11588
|
+
...position
|
|
11589
|
+
},
|
|
11590
|
+
role: "listbox",
|
|
11591
|
+
"aria-multiselectable": config.isMultiSelect,
|
|
11592
|
+
"aria-orientation": orientation,
|
|
11593
|
+
tabIndex: position ? 0 : void 0,
|
|
11594
|
+
children: props.children
|
|
11433
11595
|
}
|
|
11434
11596
|
)
|
|
11435
|
-
]
|
|
11436
|
-
|
|
11437
|
-
|
|
11438
|
-
|
|
11439
|
-
id: state.id,
|
|
11440
|
-
onClick: (event) => {
|
|
11441
|
-
event.stopPropagation();
|
|
11442
|
-
toggleOpen();
|
|
11443
|
-
},
|
|
11444
|
-
onKeyDown: (event) => {
|
|
11445
|
-
switch (event.key) {
|
|
11446
|
-
case "ArrowDown":
|
|
11447
|
-
toggleOpen(true, { highlightStartPositionBehavior: "first" });
|
|
11448
|
-
break;
|
|
11449
|
-
case "ArrowUp":
|
|
11450
|
-
toggleOpen(true, { highlightStartPositionBehavior: "last" });
|
|
11451
|
-
}
|
|
11452
|
-
},
|
|
11453
|
-
layout: "icon",
|
|
11454
|
-
size: "sm",
|
|
11455
|
-
color: "neutral",
|
|
11456
|
-
"aria-invalid": invalid,
|
|
11457
|
-
"aria-disabled": disabled,
|
|
11458
|
-
"aria-haspopup": "listbox",
|
|
11459
|
-
"aria-expanded": state.isOpen,
|
|
11460
|
-
"aria-controls": state.isOpen ? `${state.id}-listbox` : void 0,
|
|
11461
|
-
className: "size-9",
|
|
11462
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_lucide_react7.Plus, {})
|
|
11463
|
-
}
|
|
11464
|
-
)
|
|
11465
|
-
]
|
|
11466
|
-
}
|
|
11597
|
+
]
|
|
11598
|
+
}
|
|
11599
|
+
),
|
|
11600
|
+
document.body
|
|
11467
11601
|
);
|
|
11468
11602
|
});
|
|
11469
|
-
var
|
|
11470
|
-
|
|
11471
|
-
|
|
11472
|
-
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
|
|
11476
|
-
const innerRef = (0, import_react34.useRef)(null);
|
|
11477
|
-
(0, import_react34.useImperativeHandle)(ref, () => innerRef.current);
|
|
11478
|
-
const { trigger, state, config, item } = useSelectContext();
|
|
11479
|
-
const position = useFloatingElement({
|
|
11480
|
-
active: state.isOpen,
|
|
11481
|
-
anchorRef: trigger.ref,
|
|
11482
|
-
containerRef: innerRef,
|
|
11483
|
-
...alignment
|
|
11484
|
-
});
|
|
11485
|
-
useFocusTrap({
|
|
11486
|
-
container: innerRef,
|
|
11487
|
-
active: state.isOpen && !!position
|
|
11488
|
-
});
|
|
11489
|
-
const { zIndex } = useOverlayRegistry({ isActive: state.isOpen });
|
|
11490
|
-
return (0, import_react_dom5.createPortal)(
|
|
11491
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
11492
|
-
"div",
|
|
11493
|
-
{
|
|
11494
|
-
id: `select-container-${state.id}`,
|
|
11495
|
-
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen", containerClassName),
|
|
11496
|
-
style: { zIndex },
|
|
11497
|
-
hidden: !state.isOpen,
|
|
11498
|
-
children: [
|
|
11499
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11500
|
-
"div",
|
|
11501
|
-
{
|
|
11502
|
-
id: `select-background-${state.id}`,
|
|
11503
|
-
onClick: () => trigger.toggleOpen(false),
|
|
11504
|
-
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen")
|
|
11505
|
-
}
|
|
11506
|
-
),
|
|
11507
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11508
|
-
"ul",
|
|
11509
|
-
{
|
|
11510
|
-
...props,
|
|
11511
|
-
id: `${state.id}-listbox`,
|
|
11512
|
-
ref: innerRef,
|
|
11513
|
-
onKeyDown: (event) => {
|
|
11514
|
-
switch (event.key) {
|
|
11515
|
-
case "Escape":
|
|
11516
|
-
trigger.toggleOpen(false);
|
|
11517
|
-
event.preventDefault();
|
|
11518
|
-
event.stopPropagation();
|
|
11519
|
-
break;
|
|
11520
|
-
case match(orientation, {
|
|
11521
|
-
vertical: "ArrowDown",
|
|
11522
|
-
horizontal: "ArrowUp"
|
|
11523
|
-
}):
|
|
11524
|
-
item.moveHighlightedIndex(1);
|
|
11525
|
-
event.preventDefault();
|
|
11526
|
-
break;
|
|
11527
|
-
case match(orientation, {
|
|
11528
|
-
vertical: "ArrowUp",
|
|
11529
|
-
horizontal: "ArrowDown"
|
|
11530
|
-
}):
|
|
11531
|
-
item.moveHighlightedIndex(-1);
|
|
11532
|
-
event.preventDefault();
|
|
11533
|
-
break;
|
|
11534
|
-
case "Home":
|
|
11535
|
-
event.preventDefault();
|
|
11536
|
-
break;
|
|
11537
|
-
case "End":
|
|
11538
|
-
event.preventDefault();
|
|
11539
|
-
break;
|
|
11540
|
-
case "Enter":
|
|
11541
|
-
// Fall through
|
|
11542
|
-
case " ":
|
|
11543
|
-
if (state.highlightedValue) {
|
|
11544
|
-
item.toggleSelection(state.highlightedValue);
|
|
11545
|
-
if (!config.isMultiSelect) {
|
|
11546
|
-
trigger.toggleOpen(false);
|
|
11547
|
-
}
|
|
11548
|
-
event.preventDefault();
|
|
11549
|
-
}
|
|
11550
|
-
break;
|
|
11551
|
-
}
|
|
11552
|
-
},
|
|
11553
|
-
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),
|
|
11554
|
-
style: {
|
|
11555
|
-
opacity: position ? void 0 : 0,
|
|
11556
|
-
position: "fixed",
|
|
11557
|
-
...position
|
|
11558
|
-
},
|
|
11559
|
-
role: "listbox",
|
|
11560
|
-
"aria-multiselectable": config.isMultiSelect,
|
|
11561
|
-
"aria-orientation": orientation,
|
|
11562
|
-
tabIndex: position ? 0 : void 0,
|
|
11563
|
-
children: props.children
|
|
11564
|
-
}
|
|
11565
|
-
)
|
|
11566
|
-
]
|
|
11567
|
-
}
|
|
11568
|
-
),
|
|
11569
|
-
document.body
|
|
11570
|
-
);
|
|
11571
|
-
}
|
|
11572
|
-
);
|
|
11573
|
-
var Select = (0, import_react34.forwardRef)(function Select2({
|
|
11603
|
+
var MultiSelectOption = SelectOption;
|
|
11604
|
+
var MultiSelectContent = SelectContent;
|
|
11605
|
+
var MultiSelectButton = SelectButton;
|
|
11606
|
+
|
|
11607
|
+
// src/components/user-interaction/select/Select.tsx
|
|
11608
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
11609
|
+
var Select = (0, import_react36.forwardRef)(function Select2({
|
|
11574
11610
|
children,
|
|
11575
11611
|
contentPanelProps,
|
|
11576
11612
|
buttonProps,
|
|
11577
11613
|
...props
|
|
11578
11614
|
}, ref) {
|
|
11579
|
-
return /* @__PURE__ */ (0,
|
|
11580
|
-
/* @__PURE__ */ (0,
|
|
11615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(SelectRoot, { ...props, children: [
|
|
11616
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11581
11617
|
SelectButton,
|
|
11582
11618
|
{
|
|
11583
11619
|
ref,
|
|
@@ -11589,16 +11625,16 @@ var Select = (0, import_react34.forwardRef)(function Select2({
|
|
|
11589
11625
|
}
|
|
11590
11626
|
}
|
|
11591
11627
|
),
|
|
11592
|
-
/* @__PURE__ */ (0,
|
|
11628
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
11593
11629
|
] });
|
|
11594
11630
|
});
|
|
11595
|
-
var SelectUncontrolled = (0,
|
|
11631
|
+
var SelectUncontrolled = (0, import_react36.forwardRef)(function SelectUncontrolled2({
|
|
11596
11632
|
value: initialValue,
|
|
11597
11633
|
onValueChange,
|
|
11598
11634
|
...props
|
|
11599
11635
|
}, ref) {
|
|
11600
11636
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
11601
|
-
return /* @__PURE__ */ (0,
|
|
11637
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11602
11638
|
Select,
|
|
11603
11639
|
{
|
|
11604
11640
|
...props,
|
|
@@ -11608,84 +11644,26 @@ var SelectUncontrolled = (0, import_react34.forwardRef)(function SelectUncontrol
|
|
|
11608
11644
|
}
|
|
11609
11645
|
);
|
|
11610
11646
|
});
|
|
11611
|
-
|
|
11612
|
-
|
|
11613
|
-
|
|
11614
|
-
|
|
11615
|
-
|
|
11616
|
-
|
|
11617
|
-
|
|
11618
|
-
}, ref) {
|
|
11619
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(SelectRoot, { ...props, values: value, onValuesChange: onValueChange, isMultiSelect: true, children: [
|
|
11620
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectButton, { ref, ...buttonProps }),
|
|
11621
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
11622
|
-
] });
|
|
11623
|
-
});
|
|
11624
|
-
var MultiSelectUncontrolled = (0, import_react34.forwardRef)(function MultiSelectUncontrolled2({
|
|
11625
|
-
value: initialValue,
|
|
11626
|
-
onValueChange,
|
|
11627
|
-
...props
|
|
11628
|
-
}, ref) {
|
|
11629
|
-
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
11630
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11631
|
-
MultiSelect,
|
|
11632
|
-
{
|
|
11633
|
-
...props,
|
|
11634
|
-
ref,
|
|
11635
|
-
value,
|
|
11636
|
-
onValueChange: setValue
|
|
11637
|
-
}
|
|
11638
|
-
);
|
|
11639
|
-
});
|
|
11640
|
-
var MultiSelectChipDisplay = (0, import_react34.forwardRef)(function MultiSelectChipDisplay2({
|
|
11641
|
-
children,
|
|
11642
|
-
value,
|
|
11643
|
-
onValueChange,
|
|
11644
|
-
contentPanelProps,
|
|
11645
|
-
chipDisplayProps,
|
|
11646
|
-
...props
|
|
11647
|
-
}, ref) {
|
|
11648
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(SelectRoot, { ...props, values: value, onValuesChange: onValueChange, isMultiSelect: true, children: [
|
|
11649
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectChipDisplay, { ref, ...chipDisplayProps }),
|
|
11650
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
11651
|
-
] });
|
|
11652
|
-
});
|
|
11653
|
-
var MultiSelectChipDisplayUncontrolled = (0, import_react34.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
|
|
11654
|
-
value: initialValue,
|
|
11655
|
-
onValueChange,
|
|
11656
|
-
...props
|
|
11657
|
-
}, ref) {
|
|
11658
|
-
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
11659
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11660
|
-
MultiSelectChipDisplay,
|
|
11661
|
-
{
|
|
11662
|
-
...props,
|
|
11663
|
-
ref,
|
|
11664
|
-
value,
|
|
11665
|
-
onValueChange: setValue
|
|
11666
|
-
}
|
|
11667
|
-
);
|
|
11668
|
-
});
|
|
11669
|
-
|
|
11670
|
-
// src/components/layout/dialog/LanguageDialog.tsx
|
|
11671
|
-
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
11672
|
-
var LanguageDialog = ({
|
|
11673
|
-
onClose,
|
|
11674
|
-
titleOverwrite,
|
|
11675
|
-
descriptionOverwrite,
|
|
11647
|
+
|
|
11648
|
+
// src/components/layout/dialog/LanguageDialog.tsx
|
|
11649
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
11650
|
+
var LanguageDialog = ({
|
|
11651
|
+
onClose,
|
|
11652
|
+
titleOverwrite,
|
|
11653
|
+
descriptionOverwrite,
|
|
11676
11654
|
...props
|
|
11677
11655
|
}) => {
|
|
11678
11656
|
const { locale, setLocale } = useLocale();
|
|
11679
11657
|
const translation = useHightideTranslation();
|
|
11680
|
-
return /* @__PURE__ */ (0,
|
|
11658
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11681
11659
|
Dialog,
|
|
11682
11660
|
{
|
|
11683
11661
|
titleElement: titleOverwrite ?? translation("language"),
|
|
11684
11662
|
description: descriptionOverwrite ?? translation("chooseLanguage"),
|
|
11685
11663
|
onClose,
|
|
11686
11664
|
...props,
|
|
11687
|
-
children: /* @__PURE__ */ (0,
|
|
11688
|
-
/* @__PURE__ */ (0,
|
|
11665
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "w-64", children: [
|
|
11666
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11689
11667
|
Select,
|
|
11690
11668
|
{
|
|
11691
11669
|
value: locale,
|
|
@@ -11693,10 +11671,10 @@ var LanguageDialog = ({
|
|
|
11693
11671
|
buttonProps: {
|
|
11694
11672
|
selectedDisplay: (locale2) => LocalizationUtil.languagesLocalNames[locale2]
|
|
11695
11673
|
},
|
|
11696
|
-
children: LocalizationUtil.locals.map((local) => /* @__PURE__ */ (0,
|
|
11674
|
+
children: LocalizationUtil.locals.map((local) => /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(SelectOption, { value: local, children: LocalizationUtil.languagesLocalNames[local] }, local))
|
|
11697
11675
|
}
|
|
11698
11676
|
),
|
|
11699
|
-
/* @__PURE__ */ (0,
|
|
11677
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(Button, { color: "positive", onClick: onClose, children: translation("done") }) })
|
|
11700
11678
|
] })
|
|
11701
11679
|
}
|
|
11702
11680
|
);
|
|
@@ -11707,13 +11685,13 @@ var import_lucide_react8 = require("lucide-react");
|
|
|
11707
11685
|
var import_clsx14 = __toESM(require("clsx"));
|
|
11708
11686
|
|
|
11709
11687
|
// src/contexts/ThemeContext.tsx
|
|
11710
|
-
var
|
|
11711
|
-
var
|
|
11688
|
+
var import_react37 = require("react");
|
|
11689
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
11712
11690
|
var themes = ["light", "dark", "system"];
|
|
11713
11691
|
var ThemeUtil = {
|
|
11714
11692
|
themes
|
|
11715
11693
|
};
|
|
11716
|
-
var ThemeContext = (0,
|
|
11694
|
+
var ThemeContext = (0, import_react37.createContext)(null);
|
|
11717
11695
|
var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
11718
11696
|
const {
|
|
11719
11697
|
value: storedTheme,
|
|
@@ -11721,8 +11699,8 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11721
11699
|
deleteValue: deleteStoredTheme
|
|
11722
11700
|
} = useLocalStorage("theme", "system");
|
|
11723
11701
|
const { config } = useHightideConfig();
|
|
11724
|
-
const [themePreference, setThemePreference] = (0,
|
|
11725
|
-
const resolvedTheme = (0,
|
|
11702
|
+
const [themePreference, setThemePreference] = (0, import_react37.useState)("system");
|
|
11703
|
+
const resolvedTheme = (0, import_react37.useMemo)(() => {
|
|
11726
11704
|
if (theme && theme !== "system") {
|
|
11727
11705
|
return theme;
|
|
11728
11706
|
}
|
|
@@ -11734,7 +11712,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11734
11712
|
}
|
|
11735
11713
|
return initialTheme ?? config.theme.initialTheme;
|
|
11736
11714
|
}, [config.theme.initialTheme, initialTheme, storedTheme, theme, themePreference]);
|
|
11737
|
-
(0,
|
|
11715
|
+
(0, import_react37.useEffect)(() => {
|
|
11738
11716
|
if (!theme) return;
|
|
11739
11717
|
if (theme === "system") {
|
|
11740
11718
|
deleteStoredTheme();
|
|
@@ -11742,18 +11720,18 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11742
11720
|
setStoredTheme(theme);
|
|
11743
11721
|
}
|
|
11744
11722
|
}, [theme]);
|
|
11745
|
-
(0,
|
|
11723
|
+
(0, import_react37.useEffect)(() => {
|
|
11746
11724
|
document.documentElement.setAttribute("data-theme", resolvedTheme);
|
|
11747
11725
|
}, [resolvedTheme]);
|
|
11748
|
-
const getPreference = (0,
|
|
11726
|
+
const getPreference = (0, import_react37.useCallback)(() => {
|
|
11749
11727
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
11750
11728
|
const prefersLight = window.matchMedia("(prefers-color-scheme: light)").matches;
|
|
11751
11729
|
setThemePreference(prefersDark ? "dark" : prefersLight ? "light" : "system");
|
|
11752
11730
|
}, []);
|
|
11753
|
-
(0,
|
|
11731
|
+
(0, import_react37.useEffect)(() => {
|
|
11754
11732
|
getPreference();
|
|
11755
11733
|
}, [getPreference]);
|
|
11756
|
-
(0,
|
|
11734
|
+
(0, import_react37.useEffect)(() => {
|
|
11757
11735
|
const darkQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
11758
11736
|
const lightQuery = window.matchMedia("(prefers-color-scheme: light)");
|
|
11759
11737
|
const noPrefQuery = window.matchMedia("(prefers-color-scheme: no-preference)");
|
|
@@ -11766,7 +11744,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11766
11744
|
noPrefQuery.removeEventListener("change", getPreference);
|
|
11767
11745
|
};
|
|
11768
11746
|
}, [getPreference]);
|
|
11769
|
-
return /* @__PURE__ */ (0,
|
|
11747
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
11770
11748
|
ThemeContext.Provider,
|
|
11771
11749
|
{
|
|
11772
11750
|
value: {
|
|
@@ -11784,7 +11762,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11784
11762
|
);
|
|
11785
11763
|
};
|
|
11786
11764
|
var useTheme = () => {
|
|
11787
|
-
const context = (0,
|
|
11765
|
+
const context = (0, import_react37.useContext)(ThemeContext);
|
|
11788
11766
|
if (!context) {
|
|
11789
11767
|
throw new Error("useTheme must be used within ThemeContext. Try adding a ThemeProvider around your app.");
|
|
11790
11768
|
}
|
|
@@ -11792,14 +11770,14 @@ var useTheme = () => {
|
|
|
11792
11770
|
};
|
|
11793
11771
|
|
|
11794
11772
|
// src/components/layout/dialog/ThemeDialog.tsx
|
|
11795
|
-
var
|
|
11773
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
11796
11774
|
var ThemeIcon = ({ theme, className }) => {
|
|
11797
11775
|
if (theme === "dark") {
|
|
11798
|
-
return /* @__PURE__ */ (0,
|
|
11776
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react8.MoonIcon, { className: (0, import_clsx14.default)("w-4 h-4", className) });
|
|
11799
11777
|
} else if (theme === "light") {
|
|
11800
|
-
return /* @__PURE__ */ (0,
|
|
11778
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react8.SunIcon, { className: (0, import_clsx14.default)("w-4 h-4", className) });
|
|
11801
11779
|
} else {
|
|
11802
|
-
return /* @__PURE__ */ (0,
|
|
11780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_lucide_react8.MonitorCog, { className: (0, import_clsx14.default)("w-4 h-4", className) });
|
|
11803
11781
|
}
|
|
11804
11782
|
};
|
|
11805
11783
|
var ThemeDialog = ({
|
|
@@ -11810,34 +11788,34 @@ var ThemeDialog = ({
|
|
|
11810
11788
|
}) => {
|
|
11811
11789
|
const { theme, setTheme } = useTheme();
|
|
11812
11790
|
const translation = useHightideTranslation();
|
|
11813
|
-
return /* @__PURE__ */ (0,
|
|
11791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11814
11792
|
Dialog,
|
|
11815
11793
|
{
|
|
11816
11794
|
titleElement: titleOverwrite ?? translation("pThemes", { count: 1 }),
|
|
11817
11795
|
description: descriptionOverwrite ?? translation("chooseTheme"),
|
|
11818
11796
|
onClose,
|
|
11819
11797
|
...props,
|
|
11820
|
-
children: /* @__PURE__ */ (0,
|
|
11821
|
-
/* @__PURE__ */ (0,
|
|
11798
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "w-64", children: [
|
|
11799
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11822
11800
|
Select,
|
|
11823
11801
|
{
|
|
11824
11802
|
value: theme,
|
|
11825
11803
|
onValueChange: (theme2) => setTheme(theme2),
|
|
11826
11804
|
iconAppearance: "right",
|
|
11827
11805
|
buttonProps: {
|
|
11828
|
-
selectedDisplay: (value) => /* @__PURE__ */ (0,
|
|
11829
|
-
/* @__PURE__ */ (0,
|
|
11806
|
+
selectedDisplay: (value) => /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
11807
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ThemeIcon, { theme }),
|
|
11830
11808
|
translation("sThemeMode", { theme: value })
|
|
11831
11809
|
] }),
|
|
11832
11810
|
className: "min-w-32"
|
|
11833
11811
|
},
|
|
11834
|
-
children: ThemeUtil.themes.map((theme2) => /* @__PURE__ */ (0,
|
|
11835
|
-
/* @__PURE__ */ (0,
|
|
11812
|
+
children: ThemeUtil.themes.map((theme2) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SelectOption, { value: theme2, className: "gap-x-6 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
11813
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(ThemeIcon, { theme: theme2 }),
|
|
11836
11814
|
translation("sThemeMode", { theme: theme2 })
|
|
11837
11815
|
] }) }, theme2))
|
|
11838
11816
|
}
|
|
11839
11817
|
),
|
|
11840
|
-
/* @__PURE__ */ (0,
|
|
11818
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
|
|
11841
11819
|
] })
|
|
11842
11820
|
}
|
|
11843
11821
|
);
|
|
@@ -11846,31 +11824,31 @@ var ThemeDialog = ({
|
|
|
11846
11824
|
// src/components/layout/loading/ErrorComponent.tsx
|
|
11847
11825
|
var import_lucide_react9 = require("lucide-react");
|
|
11848
11826
|
var import_clsx15 = __toESM(require("clsx"));
|
|
11849
|
-
var
|
|
11827
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
11850
11828
|
var ErrorComponent = ({
|
|
11851
11829
|
errorText,
|
|
11852
11830
|
classname
|
|
11853
11831
|
}) => {
|
|
11854
11832
|
const translation = useHightideTranslation();
|
|
11855
|
-
return /* @__PURE__ */ (0,
|
|
11856
|
-
/* @__PURE__ */ (0,
|
|
11833
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: (0, import_clsx15.default)("flex-col-4 items-center justify-center w-full h-24", classname), children: [
|
|
11834
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_lucide_react9.AlertOctagon, { size: 64, className: "text-warning" }),
|
|
11857
11835
|
errorText ?? `${translation("errorOccurred")} :(`
|
|
11858
11836
|
] });
|
|
11859
11837
|
};
|
|
11860
11838
|
|
|
11861
11839
|
// src/components/layout/loading/LoadingAndErrorComponent.tsx
|
|
11862
|
-
var
|
|
11840
|
+
var import_react38 = require("react");
|
|
11863
11841
|
|
|
11864
11842
|
// src/components/layout/loading/LoadingContainer.tsx
|
|
11865
11843
|
var import_clsx16 = require("clsx");
|
|
11866
|
-
var
|
|
11844
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
11867
11845
|
var LoadingContainer = ({ className }) => {
|
|
11868
|
-
return /* @__PURE__ */ (0,
|
|
11846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: (0, import_clsx16.clsx)("relative overflow-hidden shimmer bg-disabled/30 rounded-md", className) });
|
|
11869
11847
|
};
|
|
11870
11848
|
|
|
11871
11849
|
// src/components/layout/loading/LoadingAndErrorComponent.tsx
|
|
11872
11850
|
var import_clsx17 = require("clsx");
|
|
11873
|
-
var
|
|
11851
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
11874
11852
|
var LoadingAndErrorComponent = ({
|
|
11875
11853
|
children,
|
|
11876
11854
|
isLoading = false,
|
|
@@ -11880,8 +11858,8 @@ var LoadingAndErrorComponent = ({
|
|
|
11880
11858
|
minimumLoadingDuration = 200,
|
|
11881
11859
|
className
|
|
11882
11860
|
}) => {
|
|
11883
|
-
const [isInMinimumLoading, setIsInMinimumLoading] = (0,
|
|
11884
|
-
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0,
|
|
11861
|
+
const [isInMinimumLoading, setIsInMinimumLoading] = (0, import_react38.useState)(false);
|
|
11862
|
+
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0, import_react38.useState)(false);
|
|
11885
11863
|
if (minimumLoadingDuration && !isInMinimumLoading && !hasUsedMinimumLoading) {
|
|
11886
11864
|
setIsInMinimumLoading(true);
|
|
11887
11865
|
setTimeout(() => {
|
|
@@ -11890,33 +11868,33 @@ var LoadingAndErrorComponent = ({
|
|
|
11890
11868
|
}, minimumLoadingDuration);
|
|
11891
11869
|
}
|
|
11892
11870
|
if (isLoading || minimumLoadingDuration && isInMinimumLoading) {
|
|
11893
|
-
return /* @__PURE__ */ (0,
|
|
11871
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, { children: loadingComponent ?? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(LoadingContainer, { className: (0, import_clsx17.clsx)(className) }) });
|
|
11894
11872
|
}
|
|
11895
11873
|
if (hasError) {
|
|
11896
|
-
return /* @__PURE__ */ (0,
|
|
11874
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, { children: errorComponent ?? /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(LoadingContainer, { className: (0, import_clsx17.clsx)("bg-negative", className) }) });
|
|
11897
11875
|
}
|
|
11898
|
-
return /* @__PURE__ */ (0,
|
|
11876
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_jsx_runtime42.Fragment, { children });
|
|
11899
11877
|
};
|
|
11900
11878
|
|
|
11901
11879
|
// src/components/layout/loading/LoadingAnimation.tsx
|
|
11902
11880
|
var import_clsx18 = __toESM(require("clsx"));
|
|
11903
|
-
var
|
|
11881
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
11904
11882
|
var LoadingAnimation = ({
|
|
11905
11883
|
loadingText,
|
|
11906
11884
|
classname
|
|
11907
11885
|
}) => {
|
|
11908
11886
|
const translation = useHightideTranslation();
|
|
11909
|
-
return /* @__PURE__ */ (0,
|
|
11910
|
-
/* @__PURE__ */ (0,
|
|
11887
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: (0, import_clsx18.default)("flex-col-2 items-center justify-center w-full h-24", classname), children: [
|
|
11888
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(HelpwaveLogo, { animate: "loading" }),
|
|
11911
11889
|
loadingText ?? `${translation("loading")}...`
|
|
11912
11890
|
] });
|
|
11913
11891
|
};
|
|
11914
11892
|
|
|
11915
11893
|
// src/components/layout/navigation/BreadCrumbs.tsx
|
|
11916
11894
|
var import_link = __toESM(require_link2());
|
|
11917
|
-
var
|
|
11895
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
11918
11896
|
var BreadCrumbLink = ({ ...props }) => {
|
|
11919
|
-
return /* @__PURE__ */ (0,
|
|
11897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
|
|
11920
11898
|
import_link.default,
|
|
11921
11899
|
{
|
|
11922
11900
|
...props,
|
|
@@ -11925,29 +11903,29 @@ var BreadCrumbLink = ({ ...props }) => {
|
|
|
11925
11903
|
);
|
|
11926
11904
|
};
|
|
11927
11905
|
var BreadCrumbDivider = () => {
|
|
11928
|
-
return /* @__PURE__ */ (0,
|
|
11906
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { "data-name": "breadcrumb-divider", children: "/" });
|
|
11929
11907
|
};
|
|
11930
11908
|
var BreadCrumbGroup = ({ children, divider, ...props }) => {
|
|
11931
11909
|
const items = ArrayUtil.resolveSingleOrArray(children);
|
|
11932
|
-
return /* @__PURE__ */ (0,
|
|
11910
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("ul", { ...props, "data-name": props["data-name"] ?? "breadcrumb", children: items.map((item, index) => {
|
|
11933
11911
|
const isLast = index === items.length - 1;
|
|
11934
|
-
return /* @__PURE__ */ (0,
|
|
11912
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("li", { "data-name": "breadcrumb-item", children: [
|
|
11935
11913
|
item,
|
|
11936
|
-
!isLast && divider !== null && (divider ?? /* @__PURE__ */ (0,
|
|
11914
|
+
!isLast && divider !== null && (divider ?? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(BreadCrumbDivider, {}))
|
|
11937
11915
|
] }, index);
|
|
11938
11916
|
}) });
|
|
11939
11917
|
};
|
|
11940
11918
|
var BreadCrumbs = ({ crumbs }) => {
|
|
11941
|
-
return /* @__PURE__ */ (0,
|
|
11919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(BreadCrumbGroup, { children: crumbs.map(({ href, label }, index) => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(BreadCrumbLink, { href, children: label }, index)) });
|
|
11942
11920
|
};
|
|
11943
11921
|
|
|
11944
11922
|
// src/components/layout/navigation/Navigation.tsx
|
|
11945
11923
|
var import_lucide_react10 = require("lucide-react");
|
|
11946
|
-
var
|
|
11947
|
-
var
|
|
11924
|
+
var import_react39 = require("react");
|
|
11925
|
+
var import_react40 = require("react");
|
|
11948
11926
|
var import_link2 = __toESM(require_link2());
|
|
11949
11927
|
var import_clsx19 = __toESM(require("clsx"));
|
|
11950
|
-
var
|
|
11928
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
11951
11929
|
function isSubItem(item) {
|
|
11952
11930
|
return "items" in item && Array.isArray(item.items);
|
|
11953
11931
|
}
|
|
@@ -11957,10 +11935,10 @@ var NavigationItemWithSubItem = ({
|
|
|
11957
11935
|
horizontalAlignment = "center",
|
|
11958
11936
|
...options
|
|
11959
11937
|
}) => {
|
|
11960
|
-
const [isOpen, setOpen] = (0,
|
|
11961
|
-
const containerRef = (0,
|
|
11962
|
-
const triggerRef = (0,
|
|
11963
|
-
const id = (0,
|
|
11938
|
+
const [isOpen, setOpen] = (0, import_react40.useState)(false);
|
|
11939
|
+
const containerRef = (0, import_react40.useRef)(null);
|
|
11940
|
+
const triggerRef = (0, import_react40.useRef)(null);
|
|
11941
|
+
const id = (0, import_react40.useId)();
|
|
11964
11942
|
const style = useFloatingElement({
|
|
11965
11943
|
active: isOpen,
|
|
11966
11944
|
containerRef,
|
|
@@ -11968,15 +11946,15 @@ var NavigationItemWithSubItem = ({
|
|
|
11968
11946
|
horizontalAlignment,
|
|
11969
11947
|
...options
|
|
11970
11948
|
});
|
|
11971
|
-
const onBlur = (0,
|
|
11949
|
+
const onBlur = (0, import_react40.useCallback)((event) => {
|
|
11972
11950
|
const nextFocus = event.relatedTarget;
|
|
11973
11951
|
if (!containerRef.current?.contains(nextFocus) && !triggerRef.current?.contains(nextFocus)) {
|
|
11974
11952
|
setOpen(false);
|
|
11975
11953
|
}
|
|
11976
11954
|
}, []);
|
|
11977
11955
|
const { zIndex } = useOverlayRegistry();
|
|
11978
|
-
return /* @__PURE__ */ (0,
|
|
11979
|
-
/* @__PURE__ */ (0,
|
|
11956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(import_jsx_runtime45.Fragment, { children: [
|
|
11957
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
11980
11958
|
"button",
|
|
11981
11959
|
{
|
|
11982
11960
|
id: "navigation-" + id,
|
|
@@ -11992,11 +11970,11 @@ var NavigationItemWithSubItem = ({
|
|
|
11992
11970
|
"aria-controls": "navigation-items-" + id,
|
|
11993
11971
|
children: [
|
|
11994
11972
|
label,
|
|
11995
|
-
/* @__PURE__ */ (0,
|
|
11973
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ExpansionIcon, { isExpanded: isOpen })
|
|
11996
11974
|
]
|
|
11997
11975
|
}
|
|
11998
11976
|
),
|
|
11999
|
-
/* @__PURE__ */ (0,
|
|
11977
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12000
11978
|
"ul",
|
|
12001
11979
|
{
|
|
12002
11980
|
id: "navigation-items-" + id,
|
|
@@ -12015,7 +11993,7 @@ var NavigationItemWithSubItem = ({
|
|
|
12015
11993
|
{ "opacity-0": !style }
|
|
12016
11994
|
),
|
|
12017
11995
|
style: { ...style, zIndex },
|
|
12018
|
-
children: items.map(({ link, label: label2, external }, index) => /* @__PURE__ */ (0,
|
|
11996
|
+
children: items.map(({ link, label: label2, external }, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12019
11997
|
import_link2.default,
|
|
12020
11998
|
{
|
|
12021
11999
|
href: link,
|
|
@@ -12029,25 +12007,25 @@ var NavigationItemWithSubItem = ({
|
|
|
12029
12007
|
] });
|
|
12030
12008
|
};
|
|
12031
12009
|
var NavigationItemList = ({ items, ...restProps }) => {
|
|
12032
|
-
return /* @__PURE__ */ (0,
|
|
12010
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("ul", { ...restProps, className: (0, import_clsx19.default)("flex-row-6 items-center", restProps.className), children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("li", { children: isSubItem(item) ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NavigationItemWithSubItem, { ...item }) : /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_link2.default, { href: item.link, target: item.external ? "_blank" : void 0, className: "link", children: item.label }) }, index)) });
|
|
12033
12011
|
};
|
|
12034
12012
|
var Navigation = ({ ...props }) => {
|
|
12035
|
-
const [isMobileOpen, setIsMobileOpen] = (0,
|
|
12036
|
-
const id = (0,
|
|
12037
|
-
const menuRef = (0,
|
|
12038
|
-
(0,
|
|
12013
|
+
const [isMobileOpen, setIsMobileOpen] = (0, import_react40.useState)(false);
|
|
12014
|
+
const id = (0, import_react40.useId)();
|
|
12015
|
+
const menuRef = (0, import_react40.useRef)(null);
|
|
12016
|
+
(0, import_react39.useEffect)(() => {
|
|
12039
12017
|
menuRef.current?.focus();
|
|
12040
12018
|
}, [isMobileOpen]);
|
|
12041
12019
|
const { zIndex } = useOverlayRegistry({ isActive: isMobileOpen });
|
|
12042
|
-
return /* @__PURE__ */ (0,
|
|
12043
|
-
/* @__PURE__ */ (0,
|
|
12020
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("nav", { children: [
|
|
12021
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12044
12022
|
NavigationItemList,
|
|
12045
12023
|
{
|
|
12046
12024
|
...props,
|
|
12047
12025
|
className: (0, import_clsx19.default)("hidden", { "desktop:flex": !isMobileOpen }, props.className)
|
|
12048
12026
|
}
|
|
12049
12027
|
),
|
|
12050
|
-
/* @__PURE__ */ (0,
|
|
12028
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12051
12029
|
Button,
|
|
12052
12030
|
{
|
|
12053
12031
|
layout: "icon",
|
|
@@ -12058,10 +12036,10 @@ var Navigation = ({ ...props }) => {
|
|
|
12058
12036
|
"aria-haspopup": "true",
|
|
12059
12037
|
"aria-expanded": isMobileOpen,
|
|
12060
12038
|
"aria-controls": "navigation-menu-" + id,
|
|
12061
|
-
children: /* @__PURE__ */ (0,
|
|
12039
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react10.Menu, { className: "w-6 h-6" })
|
|
12062
12040
|
}
|
|
12063
12041
|
),
|
|
12064
|
-
/* @__PURE__ */ (0,
|
|
12042
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(
|
|
12065
12043
|
"div",
|
|
12066
12044
|
{
|
|
12067
12045
|
id: "navigation-menu-" + id,
|
|
@@ -12083,17 +12061,17 @@ var Navigation = ({ ...props }) => {
|
|
|
12083
12061
|
),
|
|
12084
12062
|
style: { zIndex },
|
|
12085
12063
|
children: [
|
|
12086
|
-
/* @__PURE__ */ (0,
|
|
12064
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
|
|
12087
12065
|
Button,
|
|
12088
12066
|
{
|
|
12089
12067
|
layout: "icon",
|
|
12090
12068
|
coloringStyle: "text",
|
|
12091
12069
|
color: "neutral",
|
|
12092
12070
|
onClick: () => setIsMobileOpen(false),
|
|
12093
|
-
children: /* @__PURE__ */ (0,
|
|
12071
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_lucide_react10.XIcon, {})
|
|
12094
12072
|
}
|
|
12095
12073
|
),
|
|
12096
|
-
/* @__PURE__ */ (0,
|
|
12074
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(NavigationItemList, { ...props, className: (0, import_clsx19.default)("flex-col-8", props.className) })
|
|
12097
12075
|
]
|
|
12098
12076
|
}
|
|
12099
12077
|
)
|
|
@@ -12103,8 +12081,8 @@ var Navigation = ({ ...props }) => {
|
|
|
12103
12081
|
// src/components/layout/navigation/Pagination.tsx
|
|
12104
12082
|
var import_lucide_react11 = require("lucide-react");
|
|
12105
12083
|
var import_clsx20 = __toESM(require("clsx"));
|
|
12106
|
-
var
|
|
12107
|
-
var
|
|
12084
|
+
var import_react41 = require("react");
|
|
12085
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
12108
12086
|
var Pagination = ({
|
|
12109
12087
|
pageIndex,
|
|
12110
12088
|
pageCount,
|
|
@@ -12113,11 +12091,11 @@ var Pagination = ({
|
|
|
12113
12091
|
style
|
|
12114
12092
|
}) => {
|
|
12115
12093
|
const translation = useHightideTranslation();
|
|
12116
|
-
const [value, setValue] = (0,
|
|
12094
|
+
const [value, setValue] = (0, import_react41.useState)((pageIndex + 1).toString());
|
|
12117
12095
|
const noPages = pageCount === 0;
|
|
12118
12096
|
const onFirstPage = pageIndex === 0 && !noPages;
|
|
12119
12097
|
const onLastPage = pageIndex === pageCount - 1;
|
|
12120
|
-
(0,
|
|
12098
|
+
(0, import_react41.useEffect)(() => {
|
|
12121
12099
|
if (noPages) {
|
|
12122
12100
|
setValue("0");
|
|
12123
12101
|
} else {
|
|
@@ -12127,8 +12105,8 @@ var Pagination = ({
|
|
|
12127
12105
|
const changePage = (page) => {
|
|
12128
12106
|
onPageChanged(page);
|
|
12129
12107
|
};
|
|
12130
|
-
return /* @__PURE__ */ (0,
|
|
12131
|
-
/* @__PURE__ */ (0,
|
|
12108
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: (0, import_clsx20.default)("flex-row-1", className), style, children: [
|
|
12109
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12132
12110
|
Button,
|
|
12133
12111
|
{
|
|
12134
12112
|
layout: "icon",
|
|
@@ -12136,10 +12114,10 @@ var Pagination = ({
|
|
|
12136
12114
|
color: "neutral",
|
|
12137
12115
|
onClick: () => changePage(0),
|
|
12138
12116
|
disabled: onFirstPage || noPages,
|
|
12139
|
-
children: /* @__PURE__ */ (0,
|
|
12117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react11.ChevronFirst, {})
|
|
12140
12118
|
}
|
|
12141
12119
|
),
|
|
12142
|
-
/* @__PURE__ */ (0,
|
|
12120
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12143
12121
|
Button,
|
|
12144
12122
|
{
|
|
12145
12123
|
layout: "icon",
|
|
@@ -12147,11 +12125,11 @@ var Pagination = ({
|
|
|
12147
12125
|
color: "neutral",
|
|
12148
12126
|
onClick: () => changePage(pageIndex - 1),
|
|
12149
12127
|
disabled: onFirstPage || noPages,
|
|
12150
|
-
children: /* @__PURE__ */ (0,
|
|
12128
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react11.ChevronLeft, {})
|
|
12151
12129
|
}
|
|
12152
12130
|
),
|
|
12153
|
-
/* @__PURE__ */ (0,
|
|
12154
|
-
/* @__PURE__ */ (0,
|
|
12131
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { className: "flex-row-2 min-w-56 items-center justify-center mx-2 text-center", children: [
|
|
12132
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12155
12133
|
Input,
|
|
12156
12134
|
{
|
|
12157
12135
|
value,
|
|
@@ -12175,8 +12153,8 @@ var Pagination = ({
|
|
|
12175
12153
|
editCompleteOptions: { delay: 800 }
|
|
12176
12154
|
}
|
|
12177
12155
|
),
|
|
12178
|
-
/* @__PURE__ */ (0,
|
|
12179
|
-
/* @__PURE__ */ (0,
|
|
12156
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { className: "select-none w-10", children: translation("of") }),
|
|
12157
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12180
12158
|
"span",
|
|
12181
12159
|
{
|
|
12182
12160
|
className: "flex-row-2 w-24 items-center justify-center select-none h-10 bg-input-background text-input-text rounded-md font-bold",
|
|
@@ -12184,7 +12162,7 @@ var Pagination = ({
|
|
|
12184
12162
|
}
|
|
12185
12163
|
)
|
|
12186
12164
|
] }),
|
|
12187
|
-
/* @__PURE__ */ (0,
|
|
12165
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12188
12166
|
Button,
|
|
12189
12167
|
{
|
|
12190
12168
|
layout: "icon",
|
|
@@ -12192,10 +12170,10 @@ var Pagination = ({
|
|
|
12192
12170
|
color: "neutral",
|
|
12193
12171
|
onClick: () => changePage(pageIndex + 1),
|
|
12194
12172
|
disabled: onLastPage || noPages,
|
|
12195
|
-
children: /* @__PURE__ */ (0,
|
|
12173
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react11.ChevronRight, {})
|
|
12196
12174
|
}
|
|
12197
12175
|
),
|
|
12198
|
-
/* @__PURE__ */ (0,
|
|
12176
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
12199
12177
|
Button,
|
|
12200
12178
|
{
|
|
12201
12179
|
layout: "icon",
|
|
@@ -12203,7 +12181,7 @@ var Pagination = ({
|
|
|
12203
12181
|
color: "neutral",
|
|
12204
12182
|
onClick: () => changePage(pageCount - 1),
|
|
12205
12183
|
disabled: onLastPage || noPages,
|
|
12206
|
-
children: /* @__PURE__ */ (0,
|
|
12184
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_lucide_react11.ChevronLast, {})
|
|
12207
12185
|
}
|
|
12208
12186
|
)
|
|
12209
12187
|
] });
|
|
@@ -12212,7 +12190,7 @@ var Pagination = ({
|
|
|
12212
12190
|
// src/components/layout/navigation/StepperBar.tsx
|
|
12213
12191
|
var import_lucide_react12 = require("lucide-react");
|
|
12214
12192
|
var import_clsx21 = __toESM(require("clsx"));
|
|
12215
|
-
var
|
|
12193
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
12216
12194
|
var defaultState = {
|
|
12217
12195
|
currentStep: 0,
|
|
12218
12196
|
seenSteps: /* @__PURE__ */ new Set([0])
|
|
@@ -12234,12 +12212,12 @@ var StepperBar = ({
|
|
|
12234
12212
|
seenSteps.add(newStep);
|
|
12235
12213
|
onChange({ currentStep: newStep, seenSteps });
|
|
12236
12214
|
};
|
|
12237
|
-
return /* @__PURE__ */ (0,
|
|
12215
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
12238
12216
|
"div",
|
|
12239
12217
|
{
|
|
12240
12218
|
className: (0, import_clsx21.default)("flex-row-2 justify-between", className),
|
|
12241
12219
|
children: [
|
|
12242
|
-
/* @__PURE__ */ (0,
|
|
12220
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex-row-2 flex-[2] justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
12243
12221
|
Button,
|
|
12244
12222
|
{
|
|
12245
12223
|
disabled: currentStep === 0 || disabledSteps.has(currentStep),
|
|
@@ -12248,14 +12226,14 @@ var StepperBar = ({
|
|
|
12248
12226
|
},
|
|
12249
12227
|
className: "flex-row-1 items-center justify-center",
|
|
12250
12228
|
children: [
|
|
12251
|
-
/* @__PURE__ */ (0,
|
|
12229
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react12.ChevronLeft, { size: 14 }),
|
|
12252
12230
|
translation("back")
|
|
12253
12231
|
]
|
|
12254
12232
|
}
|
|
12255
12233
|
) }),
|
|
12256
|
-
/* @__PURE__ */ (0,
|
|
12234
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex-row-2 flex-[5] justify-center items-center", children: showDots && dots.map((value, index) => {
|
|
12257
12235
|
const seen = seenSteps.has(index);
|
|
12258
|
-
return /* @__PURE__ */ (0,
|
|
12236
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12259
12237
|
"div",
|
|
12260
12238
|
{
|
|
12261
12239
|
onClick: () => seen && update(index),
|
|
@@ -12275,7 +12253,7 @@ var StepperBar = ({
|
|
|
12275
12253
|
index
|
|
12276
12254
|
);
|
|
12277
12255
|
}) }),
|
|
12278
|
-
currentStep !== numberOfSteps && /* @__PURE__ */ (0,
|
|
12256
|
+
currentStep !== numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
12279
12257
|
Button,
|
|
12280
12258
|
{
|
|
12281
12259
|
onClick: () => update(currentStep + 1),
|
|
@@ -12283,18 +12261,18 @@ var StepperBar = ({
|
|
|
12283
12261
|
disabled: disabledSteps.has(currentStep),
|
|
12284
12262
|
children: [
|
|
12285
12263
|
translation("next"),
|
|
12286
|
-
/* @__PURE__ */ (0,
|
|
12264
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react12.ChevronRight, { size: 14 })
|
|
12287
12265
|
]
|
|
12288
12266
|
}
|
|
12289
12267
|
) }),
|
|
12290
|
-
currentStep === numberOfSteps && /* @__PURE__ */ (0,
|
|
12268
|
+
currentStep === numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
12291
12269
|
Button,
|
|
12292
12270
|
{
|
|
12293
12271
|
disabled: disabledSteps.has(currentStep),
|
|
12294
12272
|
onClick: onFinish,
|
|
12295
12273
|
className: "flex-row-1 items-center justify-center",
|
|
12296
12274
|
children: [
|
|
12297
|
-
/* @__PURE__ */ (0,
|
|
12275
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react12.Check, { size: 14 }),
|
|
12298
12276
|
finishText ?? translation("confirm")
|
|
12299
12277
|
]
|
|
12300
12278
|
}
|
|
@@ -12305,7 +12283,7 @@ var StepperBar = ({
|
|
|
12305
12283
|
};
|
|
12306
12284
|
var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
|
|
12307
12285
|
const [usedState, setUsedState] = useOverwritableState(state, onChange);
|
|
12308
|
-
return /* @__PURE__ */ (0,
|
|
12286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12309
12287
|
StepperBar,
|
|
12310
12288
|
{
|
|
12311
12289
|
...props,
|
|
@@ -12317,14 +12295,14 @@ var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
|
|
|
12317
12295
|
|
|
12318
12296
|
// src/components/layout/table/FillerCell.tsx
|
|
12319
12297
|
var import_lucide_react13 = require("lucide-react");
|
|
12320
|
-
var
|
|
12298
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
12321
12299
|
var FillerCell = ({ ...props }) => {
|
|
12322
|
-
return /* @__PURE__ */ (0,
|
|
12300
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12323
12301
|
"div",
|
|
12324
12302
|
{
|
|
12325
12303
|
...props,
|
|
12326
12304
|
"data-name": PropsUtil.dataAttributes.name("table-filler-cell"),
|
|
12327
|
-
children: /* @__PURE__ */ (0,
|
|
12305
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react13.Minus, { className: "max-w-4 max-h-4" })
|
|
12328
12306
|
}
|
|
12329
12307
|
);
|
|
12330
12308
|
};
|
|
@@ -12344,24 +12322,24 @@ var TableFilters = {
|
|
|
12344
12322
|
};
|
|
12345
12323
|
|
|
12346
12324
|
// src/components/layout/table/Table.tsx
|
|
12347
|
-
var
|
|
12325
|
+
var import_react51 = require("react");
|
|
12348
12326
|
var import_clsx26 = __toESM(require("clsx"));
|
|
12349
12327
|
var import_react_table = require("@tanstack/react-table");
|
|
12350
12328
|
|
|
12351
12329
|
// src/components/layout/table/TableCell.tsx
|
|
12352
12330
|
var import_clsx22 = require("clsx");
|
|
12353
|
-
var
|
|
12331
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
12354
12332
|
var TableCell = ({
|
|
12355
12333
|
children,
|
|
12356
12334
|
className
|
|
12357
12335
|
}) => {
|
|
12358
|
-
return /* @__PURE__ */ (0,
|
|
12336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { className: (0, import_clsx22.clsx)("block max-w-full overflow-ellipsis truncate", className), children });
|
|
12359
12337
|
};
|
|
12360
12338
|
|
|
12361
12339
|
// src/hooks/useResizeCallbackWrapper.ts
|
|
12362
|
-
var
|
|
12340
|
+
var import_react42 = require("react");
|
|
12363
12341
|
var useResizeCallbackWrapper = (callback) => {
|
|
12364
|
-
(0,
|
|
12342
|
+
(0, import_react42.useEffect)(() => {
|
|
12365
12343
|
window.addEventListener("resize", callback);
|
|
12366
12344
|
return () => {
|
|
12367
12345
|
window.removeEventListener("resize", callback);
|
|
@@ -12374,125 +12352,117 @@ var import_lucide_react14 = require("lucide-react");
|
|
|
12374
12352
|
var import_clsx24 = __toESM(require("clsx"));
|
|
12375
12353
|
|
|
12376
12354
|
// src/components/user-interaction/Tooltip.tsx
|
|
12377
|
-
var
|
|
12355
|
+
var import_react43 = require("react");
|
|
12356
|
+
var import_react44 = require("react");
|
|
12357
|
+
var import_react45 = require("react");
|
|
12378
12358
|
var import_clsx23 = require("clsx");
|
|
12379
12359
|
var import_react_dom6 = require("react-dom");
|
|
12380
|
-
var
|
|
12360
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
12381
12361
|
var Tooltip = ({
|
|
12382
12362
|
tooltip,
|
|
12383
12363
|
children,
|
|
12384
|
-
appearDelay:
|
|
12385
|
-
disappearDelay: disappearDelayOverwrite,
|
|
12364
|
+
appearDelay: appearOverwrite,
|
|
12386
12365
|
tooltipClassName,
|
|
12387
12366
|
containerClassName,
|
|
12388
12367
|
position = "bottom",
|
|
12389
12368
|
disabled = false
|
|
12390
12369
|
}) => {
|
|
12391
|
-
const
|
|
12392
|
-
|
|
12393
|
-
|
|
12394
|
-
});
|
|
12370
|
+
const id = (0, import_react44.useId)();
|
|
12371
|
+
const [open, setOpen] = (0, import_react45.useState)(false);
|
|
12372
|
+
const timeoutRef = (0, import_react45.useRef)(null);
|
|
12395
12373
|
const { config } = useHightideConfig();
|
|
12396
|
-
const appearDelay = (0,
|
|
12397
|
-
() =>
|
|
12398
|
-
[config.tooltip.appearDelay
|
|
12399
|
-
);
|
|
12400
|
-
const disappearDelay = (0, import_react41.useMemo)(
|
|
12401
|
-
() => disappearDelayOverwrite ?? config.tooltip.disappearDelay,
|
|
12402
|
-
[config.tooltip.disappearDelay, disappearDelayOverwrite]
|
|
12374
|
+
const appearDelay = (0, import_react45.useMemo)(
|
|
12375
|
+
() => appearOverwrite ?? config.tooltip.appearDelay,
|
|
12376
|
+
[appearOverwrite, config.tooltip.appearDelay]
|
|
12403
12377
|
);
|
|
12404
|
-
const anchorRef = (0,
|
|
12405
|
-
const containerRef = (0,
|
|
12406
|
-
const triangleRef = (0,
|
|
12407
|
-
const isActive = !disabled &&
|
|
12378
|
+
const anchorRef = (0, import_react45.useRef)(null);
|
|
12379
|
+
const containerRef = (0, import_react45.useRef)(null);
|
|
12380
|
+
const triangleRef = (0, import_react45.useRef)(null);
|
|
12381
|
+
const isActive = !disabled && open;
|
|
12408
12382
|
const { isVisible, transitionState, callbacks } = useTransitionState(
|
|
12409
|
-
(0,
|
|
12383
|
+
(0, import_react45.useMemo)(() => ({ isOpen: isActive }), [isActive])
|
|
12410
12384
|
);
|
|
12411
|
-
const verticalAlignment = (0,
|
|
12385
|
+
const verticalAlignment = (0, import_react45.useMemo)(
|
|
12412
12386
|
() => position === "top" ? "beforeStart" : position === "bottom" ? "afterEnd" : "center",
|
|
12413
12387
|
[position]
|
|
12414
12388
|
);
|
|
12415
|
-
const horizontalAlignment = (0,
|
|
12389
|
+
const horizontalAlignment = (0, import_react45.useMemo)(
|
|
12416
12390
|
() => position === "left" ? "beforeStart" : position === "right" ? "afterEnd" : "center",
|
|
12417
12391
|
[position]
|
|
12418
12392
|
);
|
|
12419
|
-
const css = useFloatingElement((0,
|
|
12393
|
+
const css = useFloatingElement((0, import_react45.useMemo)(() => ({
|
|
12420
12394
|
active: isActive || isVisible,
|
|
12421
12395
|
anchorRef,
|
|
12422
12396
|
containerRef,
|
|
12423
12397
|
horizontalAlignment,
|
|
12424
12398
|
verticalAlignment
|
|
12425
12399
|
}), [horizontalAlignment, isActive, isVisible, verticalAlignment]));
|
|
12426
|
-
const cssTriangle = useFloatingElement((0,
|
|
12400
|
+
const cssTriangle = useFloatingElement((0, import_react45.useMemo)(() => ({
|
|
12427
12401
|
active: isActive || isVisible,
|
|
12428
12402
|
anchorRef,
|
|
12429
12403
|
containerRef: triangleRef,
|
|
12430
12404
|
horizontalAlignment,
|
|
12431
12405
|
verticalAlignment
|
|
12432
12406
|
}), [horizontalAlignment, isActive, isVisible, verticalAlignment]));
|
|
12433
|
-
const regsitryOptions = (0,
|
|
12407
|
+
const regsitryOptions = (0, import_react45.useMemo)(() => ({ isActive }), [isActive]);
|
|
12434
12408
|
const { zIndex } = useOverlayRegistry(regsitryOptions);
|
|
12435
12409
|
const { zIndex: zIndexTriangle } = useOverlayRegistry(regsitryOptions);
|
|
12436
|
-
const
|
|
12437
|
-
|
|
12438
|
-
|
|
12439
|
-
|
|
12440
|
-
|
|
12441
|
-
|
|
12442
|
-
|
|
12443
|
-
|
|
12444
|
-
|
|
12445
|
-
|
|
12446
|
-
|
|
12447
|
-
|
|
12448
|
-
|
|
12449
|
-
|
|
12450
|
-
|
|
12451
|
-
|
|
12452
|
-
|
|
12453
|
-
|
|
12454
|
-
|
|
12455
|
-
|
|
12456
|
-
|
|
12457
|
-
|
|
12458
|
-
|
|
12459
|
-
|
|
12460
|
-
|
|
12461
|
-
|
|
12462
|
-
|
|
12463
|
-
|
|
12410
|
+
const openWithDelay = (0, import_react45.useCallback)(() => {
|
|
12411
|
+
if (timeoutRef.current || open) return;
|
|
12412
|
+
timeoutRef.current = window.setTimeout(() => {
|
|
12413
|
+
timeoutRef.current = null;
|
|
12414
|
+
setOpen(true);
|
|
12415
|
+
}, appearDelay);
|
|
12416
|
+
}, [appearDelay, open]);
|
|
12417
|
+
const close3 = (0, import_react45.useCallback)(() => {
|
|
12418
|
+
if (timeoutRef.current) {
|
|
12419
|
+
clearTimeout(timeoutRef.current);
|
|
12420
|
+
timeoutRef.current = null;
|
|
12421
|
+
}
|
|
12422
|
+
setOpen(false);
|
|
12423
|
+
}, []);
|
|
12424
|
+
(0, import_react43.useEffect)(() => {
|
|
12425
|
+
if (!open) return;
|
|
12426
|
+
const closeOnBlur = () => close3();
|
|
12427
|
+
const closeOnScroll = () => close3();
|
|
12428
|
+
window.addEventListener("blur", closeOnBlur);
|
|
12429
|
+
window.addEventListener("scroll", closeOnScroll, true);
|
|
12430
|
+
return () => {
|
|
12431
|
+
window.removeEventListener("blur", closeOnBlur);
|
|
12432
|
+
window.removeEventListener("scroll", closeOnScroll, true);
|
|
12433
|
+
};
|
|
12434
|
+
}, [open, close3]);
|
|
12435
|
+
(0, import_react43.useEffect)(() => {
|
|
12436
|
+
return () => {
|
|
12437
|
+
if (timeoutRef.current) {
|
|
12438
|
+
clearTimeout(timeoutRef.current);
|
|
12464
12439
|
}
|
|
12465
|
-
|
|
12466
|
-
|
|
12467
|
-
|
|
12468
|
-
timer: setTimeout(() => {
|
|
12469
|
-
setState((prevState2) => {
|
|
12470
|
-
clearTimeout(prevState2.timer);
|
|
12471
|
-
return { ...prevState2, isShown: false, timer: null };
|
|
12472
|
-
});
|
|
12473
|
-
}, disappearDelay)
|
|
12474
|
-
};
|
|
12475
|
-
});
|
|
12476
|
-
}, [disappearDelay]);
|
|
12477
|
-
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
|
|
12440
|
+
};
|
|
12441
|
+
}, []);
|
|
12442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
|
|
12478
12443
|
"div",
|
|
12479
12444
|
{
|
|
12480
12445
|
ref: anchorRef,
|
|
12481
12446
|
className: (0, import_clsx23.clsx)("relative inline-block", containerClassName),
|
|
12482
|
-
|
|
12483
|
-
|
|
12447
|
+
"aria-describedby": isVisible ? id : void 0,
|
|
12448
|
+
onPointerEnter: openWithDelay,
|
|
12449
|
+
onPointerLeave: close3,
|
|
12450
|
+
onPointerCancel: close3,
|
|
12451
|
+
onFocus: openWithDelay,
|
|
12452
|
+
onBlur: close3,
|
|
12484
12453
|
children: [
|
|
12485
12454
|
children,
|
|
12486
|
-
/* @__PURE__ */ (0,
|
|
12455
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(Visibility, { isVisible: isActive || isVisible, children: [
|
|
12487
12456
|
(0, import_react_dom6.createPortal)(
|
|
12488
|
-
/* @__PURE__ */ (0,
|
|
12457
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12489
12458
|
"div",
|
|
12490
12459
|
{
|
|
12491
12460
|
ref: containerRef,
|
|
12461
|
+
id,
|
|
12492
12462
|
...callbacks,
|
|
12493
|
-
onPointerEnter: onEnter,
|
|
12494
12463
|
"data-name": PropsUtil.dataAttributes.name("tooltip"),
|
|
12495
12464
|
"data-state": transitionState,
|
|
12465
|
+
role: "tooltip",
|
|
12496
12466
|
className: tooltipClassName,
|
|
12497
12467
|
style: { ...css, zIndex },
|
|
12498
12468
|
children: tooltip
|
|
@@ -12501,7 +12471,7 @@ var Tooltip = ({
|
|
|
12501
12471
|
document.body
|
|
12502
12472
|
),
|
|
12503
12473
|
(0, import_react_dom6.createPortal)(
|
|
12504
|
-
/* @__PURE__ */ (0,
|
|
12474
|
+
/* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12505
12475
|
"div",
|
|
12506
12476
|
{
|
|
12507
12477
|
ref: triangleRef,
|
|
@@ -12520,7 +12490,7 @@ var Tooltip = ({
|
|
|
12520
12490
|
};
|
|
12521
12491
|
|
|
12522
12492
|
// src/components/layout/table/TableSortButton.tsx
|
|
12523
|
-
var
|
|
12493
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
12524
12494
|
var TableSortButton = ({
|
|
12525
12495
|
sortDirection,
|
|
12526
12496
|
invert = false,
|
|
@@ -12532,16 +12502,16 @@ var TableSortButton = ({
|
|
|
12532
12502
|
}) => {
|
|
12533
12503
|
const translation = useHightideTranslation();
|
|
12534
12504
|
const { sortingsCount, index } = sortingIndexDisplay;
|
|
12535
|
-
let icon = /* @__PURE__ */ (0,
|
|
12505
|
+
let icon = /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react14.ChevronsUpDown, { className: "size-4" });
|
|
12536
12506
|
if (sortDirection) {
|
|
12537
12507
|
let usedSortDirection = sortDirection;
|
|
12538
12508
|
if (invert) {
|
|
12539
12509
|
usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
|
|
12540
12510
|
}
|
|
12541
|
-
icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0,
|
|
12511
|
+
icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react14.ChevronUp, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_lucide_react14.ChevronDown, { className: "size-4" });
|
|
12542
12512
|
}
|
|
12543
12513
|
const hasSortingIndex = !!sortingIndexDisplay && sortingsCount > 1 && index > 0;
|
|
12544
|
-
return /* @__PURE__ */ (0,
|
|
12514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Tooltip, { tooltip: translation("rSortingOrderAfter", { otherSortings: index - 1 }), disabled: !hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
|
|
12545
12515
|
Button,
|
|
12546
12516
|
{
|
|
12547
12517
|
layout: hasSortingIndex ? "default" : "icon",
|
|
@@ -12550,7 +12520,7 @@ var TableSortButton = ({
|
|
|
12550
12520
|
className: (0, import_clsx24.default)("relative", className),
|
|
12551
12521
|
...props,
|
|
12552
12522
|
children: [
|
|
12553
|
-
/* @__PURE__ */ (0,
|
|
12523
|
+
/* @__PURE__ */ (0, import_jsx_runtime51.jsx)(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
|
|
12554
12524
|
"div",
|
|
12555
12525
|
{
|
|
12556
12526
|
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"),
|
|
@@ -12567,7 +12537,7 @@ var TableSortButton = ({
|
|
|
12567
12537
|
var import_lucide_react15 = require("lucide-react");
|
|
12568
12538
|
|
|
12569
12539
|
// src/components/user-interaction/Menu.tsx
|
|
12570
|
-
var
|
|
12540
|
+
var import_react48 = require("react");
|
|
12571
12541
|
var import_clsx25 = __toESM(require("clsx"));
|
|
12572
12542
|
|
|
12573
12543
|
// src/utils/bagFunctions.ts
|
|
@@ -12639,15 +12609,15 @@ var usePopoverPosition = (trigger, options) => {
|
|
|
12639
12609
|
};
|
|
12640
12610
|
|
|
12641
12611
|
// src/hooks/useHoverState.ts
|
|
12642
|
-
var
|
|
12612
|
+
var import_react46 = require("react");
|
|
12643
12613
|
var defaultUseHoverStateProps = {
|
|
12644
12614
|
closingDelay: 200,
|
|
12645
12615
|
isDisabled: false
|
|
12646
12616
|
};
|
|
12647
12617
|
var useHoverState = (props = void 0) => {
|
|
12648
12618
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
12649
|
-
const [isHovered, setIsHovered] = (0,
|
|
12650
|
-
const [timer, setTimer] = (0,
|
|
12619
|
+
const [isHovered, setIsHovered] = (0, import_react46.useState)(false);
|
|
12620
|
+
const [timer, setTimer] = (0, import_react46.useState)();
|
|
12651
12621
|
const onMouseEnter = () => {
|
|
12652
12622
|
if (isDisabled) {
|
|
12653
12623
|
return;
|
|
@@ -12663,14 +12633,14 @@ var useHoverState = (props = void 0) => {
|
|
|
12663
12633
|
setIsHovered(false);
|
|
12664
12634
|
}, closingDelay));
|
|
12665
12635
|
};
|
|
12666
|
-
(0,
|
|
12636
|
+
(0, import_react46.useEffect)(() => {
|
|
12667
12637
|
if (timer) {
|
|
12668
12638
|
return () => {
|
|
12669
12639
|
clearTimeout(timer);
|
|
12670
12640
|
};
|
|
12671
12641
|
}
|
|
12672
12642
|
});
|
|
12673
|
-
(0,
|
|
12643
|
+
(0, import_react46.useEffect)(() => {
|
|
12674
12644
|
if (timer) {
|
|
12675
12645
|
clearTimeout(timer);
|
|
12676
12646
|
}
|
|
@@ -12683,9 +12653,9 @@ var useHoverState = (props = void 0) => {
|
|
|
12683
12653
|
};
|
|
12684
12654
|
|
|
12685
12655
|
// src/hooks/useOutsideClick.ts
|
|
12686
|
-
var
|
|
12656
|
+
var import_react47 = require("react");
|
|
12687
12657
|
var useOutsideClick = (refs, handler) => {
|
|
12688
|
-
(0,
|
|
12658
|
+
(0, import_react47.useEffect)(() => {
|
|
12689
12659
|
const listener = (event) => {
|
|
12690
12660
|
if (event.target === null) return;
|
|
12691
12661
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -12703,14 +12673,14 @@ var useOutsideClick = (refs, handler) => {
|
|
|
12703
12673
|
};
|
|
12704
12674
|
|
|
12705
12675
|
// src/components/user-interaction/Menu.tsx
|
|
12706
|
-
var
|
|
12676
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
12707
12677
|
var MenuItem = ({
|
|
12708
12678
|
children,
|
|
12709
12679
|
onClick,
|
|
12710
12680
|
alignment = "left",
|
|
12711
12681
|
isDisabled = false,
|
|
12712
12682
|
className
|
|
12713
|
-
}) => /* @__PURE__ */ (0,
|
|
12683
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12714
12684
|
"div",
|
|
12715
12685
|
{
|
|
12716
12686
|
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", {
|
|
@@ -12743,10 +12713,10 @@ var Menu = ({
|
|
|
12743
12713
|
menuClassName = ""
|
|
12744
12714
|
}) => {
|
|
12745
12715
|
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
12746
|
-
const triggerRef = (0,
|
|
12747
|
-
const menuRef = (0,
|
|
12716
|
+
const triggerRef = (0, import_react48.useRef)(null);
|
|
12717
|
+
const menuRef = (0, import_react48.useRef)(null);
|
|
12748
12718
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
12749
|
-
const [isHidden, setIsHidden] = (0,
|
|
12719
|
+
const [isHidden, setIsHidden] = (0, import_react48.useState)(true);
|
|
12750
12720
|
const bag = {
|
|
12751
12721
|
isOpen,
|
|
12752
12722
|
close: () => setIsOpen(false),
|
|
@@ -12757,7 +12727,7 @@ var Menu = ({
|
|
|
12757
12727
|
triggerRef.current?.getBoundingClientRect(),
|
|
12758
12728
|
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
12759
12729
|
);
|
|
12760
|
-
(0,
|
|
12730
|
+
(0, import_react48.useEffect)(() => {
|
|
12761
12731
|
if (!isOpen) return;
|
|
12762
12732
|
const triggerEl = triggerRef.current;
|
|
12763
12733
|
if (!triggerEl) return;
|
|
@@ -12774,7 +12744,7 @@ var Menu = ({
|
|
|
12774
12744
|
window.removeEventListener("resize", close3);
|
|
12775
12745
|
};
|
|
12776
12746
|
}, [isOpen, setIsOpen]);
|
|
12777
|
-
(0,
|
|
12747
|
+
(0, import_react48.useEffect)(() => {
|
|
12778
12748
|
if (isOpen) {
|
|
12779
12749
|
setIsHidden(false);
|
|
12780
12750
|
}
|
|
@@ -12782,9 +12752,9 @@ var Menu = ({
|
|
|
12782
12752
|
const { zIndex } = useOverlayRegistry({
|
|
12783
12753
|
isActive: isOpen
|
|
12784
12754
|
});
|
|
12785
|
-
return /* @__PURE__ */ (0,
|
|
12786
|
-
trigger(bag, (0,
|
|
12787
|
-
(0, import_react_dom7.createPortal)(/* @__PURE__ */ (0,
|
|
12755
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [
|
|
12756
|
+
trigger(bag, (0, import_react48.useCallback)((el) => triggerRef.current = el, [])),
|
|
12757
|
+
(0, import_react_dom7.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12788
12758
|
"div",
|
|
12789
12759
|
{
|
|
12790
12760
|
ref: menuRef,
|
|
@@ -12814,34 +12784,34 @@ var Menu = ({
|
|
|
12814
12784
|
};
|
|
12815
12785
|
|
|
12816
12786
|
// src/components/layout/table/TableFilterButton.tsx
|
|
12817
|
-
var
|
|
12818
|
-
var
|
|
12787
|
+
var import_react49 = require("react");
|
|
12788
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
12819
12789
|
var TableFilterButton = ({
|
|
12820
12790
|
filterType,
|
|
12821
12791
|
column
|
|
12822
12792
|
}) => {
|
|
12823
12793
|
const translation = useHightideTranslation();
|
|
12824
12794
|
const columnFilterValue = column.getFilterValue();
|
|
12825
|
-
const [filterValue, setFilterValue] = (0,
|
|
12795
|
+
const [filterValue, setFilterValue] = (0, import_react49.useState)(columnFilterValue);
|
|
12826
12796
|
const hasFilter = !!filterValue;
|
|
12827
|
-
(0,
|
|
12797
|
+
(0, import_react49.useEffect)(() => {
|
|
12828
12798
|
setFilterValue(columnFilterValue);
|
|
12829
12799
|
}, [columnFilterValue]);
|
|
12830
|
-
return /* @__PURE__ */ (0,
|
|
12800
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12831
12801
|
Menu,
|
|
12832
12802
|
{
|
|
12833
|
-
trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ (0,
|
|
12834
|
-
/* @__PURE__ */ (0,
|
|
12803
|
+
trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { ref, className: "relative", children: [
|
|
12804
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12835
12805
|
Button,
|
|
12836
12806
|
{
|
|
12837
12807
|
layout: "icon",
|
|
12838
12808
|
color: "neutral",
|
|
12839
12809
|
size: "xs",
|
|
12840
12810
|
onClick: toggleOpen,
|
|
12841
|
-
children: /* @__PURE__ */ (0,
|
|
12811
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react15.FilterIcon, { className: "size-4" })
|
|
12842
12812
|
}
|
|
12843
12813
|
),
|
|
12844
|
-
hasFilter && /* @__PURE__ */ (0,
|
|
12814
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12845
12815
|
"div",
|
|
12846
12816
|
{
|
|
12847
12817
|
className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-primary pointer-events-none",
|
|
@@ -12849,9 +12819,9 @@ var TableFilterButton = ({
|
|
|
12849
12819
|
}
|
|
12850
12820
|
)
|
|
12851
12821
|
] }),
|
|
12852
|
-
children: ({ close: close3 }) => /* @__PURE__ */ (0,
|
|
12853
|
-
/* @__PURE__ */ (0,
|
|
12854
|
-
filterType === "text" && /* @__PURE__ */ (0,
|
|
12822
|
+
children: ({ close: close3 }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex-col-1 p-2 items-start font-normal text-menu-text", children: [
|
|
12823
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("h4", { className: "typography-label-md-semibold", children: translation("filter") }),
|
|
12824
|
+
filterType === "text" && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12855
12825
|
Input,
|
|
12856
12826
|
{
|
|
12857
12827
|
value: filterValue ?? "",
|
|
@@ -12861,8 +12831,8 @@ var TableFilterButton = ({
|
|
|
12861
12831
|
className: "h-10"
|
|
12862
12832
|
}
|
|
12863
12833
|
),
|
|
12864
|
-
filterType === "range" && /* @__PURE__ */ (0,
|
|
12865
|
-
/* @__PURE__ */ (0,
|
|
12834
|
+
filterType === "range" && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
12835
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12866
12836
|
Input,
|
|
12867
12837
|
{
|
|
12868
12838
|
value: filterValue?.[0].toString() ?? "",
|
|
@@ -12875,8 +12845,8 @@ var TableFilterButton = ({
|
|
|
12875
12845
|
className: "h-10 input-indicator-hidden w-40"
|
|
12876
12846
|
}
|
|
12877
12847
|
),
|
|
12878
|
-
/* @__PURE__ */ (0,
|
|
12879
|
-
/* @__PURE__ */ (0,
|
|
12848
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "font-bold", children: "-" }),
|
|
12849
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12880
12850
|
Input,
|
|
12881
12851
|
{
|
|
12882
12852
|
value: filterValue?.[1].toString() ?? "",
|
|
@@ -12890,8 +12860,8 @@ var TableFilterButton = ({
|
|
|
12890
12860
|
}
|
|
12891
12861
|
)
|
|
12892
12862
|
] }),
|
|
12893
|
-
filterType === "dateRange" && /* @__PURE__ */ (0,
|
|
12894
|
-
/* @__PURE__ */ (0,
|
|
12863
|
+
filterType === "dateRange" && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
|
|
12864
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12895
12865
|
Input,
|
|
12896
12866
|
{
|
|
12897
12867
|
value: filterValue?.[0] ? filterValue?.[0].toISOString().slice(0, 16) : "",
|
|
@@ -12904,7 +12874,7 @@ var TableFilterButton = ({
|
|
|
12904
12874
|
className: "h-10 w-50"
|
|
12905
12875
|
}
|
|
12906
12876
|
),
|
|
12907
|
-
/* @__PURE__ */ (0,
|
|
12877
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12908
12878
|
Input,
|
|
12909
12879
|
{
|
|
12910
12880
|
value: filterValue?.[1] ? filterValue?.[1].toISOString().slice(0, 16) : "",
|
|
@@ -12918,12 +12888,12 @@ var TableFilterButton = ({
|
|
|
12918
12888
|
}
|
|
12919
12889
|
)
|
|
12920
12890
|
] }),
|
|
12921
|
-
/* @__PURE__ */ (0,
|
|
12922
|
-
hasFilter && /* @__PURE__ */ (0,
|
|
12891
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "flex-row-2 justify-end w-full", children: [
|
|
12892
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { color: "negative", size: "sm", onClick: () => {
|
|
12923
12893
|
column.setFilterValue(void 0);
|
|
12924
12894
|
close3();
|
|
12925
12895
|
}, children: translation("remove") }),
|
|
12926
|
-
/* @__PURE__ */ (0,
|
|
12896
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Button, { size: "sm", onClick: () => {
|
|
12927
12897
|
column.setFilterValue(filterValue);
|
|
12928
12898
|
close3();
|
|
12929
12899
|
}, children: translation("apply") })
|
|
@@ -12935,8 +12905,8 @@ var TableFilterButton = ({
|
|
|
12935
12905
|
|
|
12936
12906
|
// src/components/user-interaction/Checkbox.tsx
|
|
12937
12907
|
var import_lucide_react16 = require("lucide-react");
|
|
12938
|
-
var
|
|
12939
|
-
var
|
|
12908
|
+
var import_react50 = require("react");
|
|
12909
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
12940
12910
|
var Checkbox = ({
|
|
12941
12911
|
value = false,
|
|
12942
12912
|
indeterminate = false,
|
|
@@ -12950,11 +12920,11 @@ var Checkbox = ({
|
|
|
12950
12920
|
alwaysShowCheckIcon = false,
|
|
12951
12921
|
...props
|
|
12952
12922
|
}) => {
|
|
12953
|
-
const onChangeWrapper = (0,
|
|
12923
|
+
const onChangeWrapper = (0, import_react50.useCallback)(() => {
|
|
12954
12924
|
onValueChange?.(!value);
|
|
12955
12925
|
onEditComplete?.(!value);
|
|
12956
12926
|
}, [onEditComplete, onValueChange, value]);
|
|
12957
|
-
return /* @__PURE__ */ (0,
|
|
12927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
|
|
12958
12928
|
"div",
|
|
12959
12929
|
{
|
|
12960
12930
|
...props,
|
|
@@ -12981,8 +12951,8 @@ var Checkbox = ({
|
|
|
12981
12951
|
"aria-checked": indeterminate ? "mixed" : value,
|
|
12982
12952
|
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
12983
12953
|
children: [
|
|
12984
|
-
/* @__PURE__ */ (0,
|
|
12985
|
-
/* @__PURE__ */ (0,
|
|
12954
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react16.Minus, { "data-name": "checkbox-indicator", "aria-hidden": true }) }),
|
|
12955
|
+
/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_lucide_react16.Check, { "data-name": "checkbox-indicator", "aria-hidden": true }) })
|
|
12986
12956
|
]
|
|
12987
12957
|
}
|
|
12988
12958
|
);
|
|
@@ -12993,7 +12963,7 @@ var CheckboxUncontrolled = ({
|
|
|
12993
12963
|
...props
|
|
12994
12964
|
}) => {
|
|
12995
12965
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
12996
|
-
return /* @__PURE__ */ (0,
|
|
12966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12997
12967
|
Checkbox,
|
|
12998
12968
|
{
|
|
12999
12969
|
...props,
|
|
@@ -13004,7 +12974,7 @@ var CheckboxUncontrolled = ({
|
|
|
13004
12974
|
};
|
|
13005
12975
|
|
|
13006
12976
|
// src/components/layout/table/Table.tsx
|
|
13007
|
-
var
|
|
12977
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
13008
12978
|
var Table = ({
|
|
13009
12979
|
data,
|
|
13010
12980
|
fillerRow,
|
|
@@ -13018,22 +12988,22 @@ var Table = ({
|
|
|
13018
12988
|
columns,
|
|
13019
12989
|
...tableOptions
|
|
13020
12990
|
}) => {
|
|
13021
|
-
const ref = (0,
|
|
13022
|
-
const tableRef = (0,
|
|
13023
|
-
const [columnSizing, setColumnSizing] = (0,
|
|
12991
|
+
const ref = (0, import_react51.useRef)(null);
|
|
12992
|
+
const tableRef = (0, import_react51.useRef)(null);
|
|
12993
|
+
const [columnSizing, setColumnSizing] = (0, import_react51.useState)(columns.reduce((previousValue, currentValue) => {
|
|
13024
12994
|
return {
|
|
13025
12995
|
...previousValue,
|
|
13026
12996
|
[currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
|
|
13027
12997
|
};
|
|
13028
12998
|
}, {}));
|
|
13029
|
-
const [columnSizingInfo, setColumnSizingInfo] = (0,
|
|
13030
|
-
const [pagination, setPagination] = (0,
|
|
12999
|
+
const [columnSizingInfo, setColumnSizingInfo] = (0, import_react51.useState)();
|
|
13000
|
+
const [pagination, setPagination] = (0, import_react51.useState)({
|
|
13031
13001
|
pageSize: 10,
|
|
13032
13002
|
pageIndex: 0,
|
|
13033
13003
|
...initialState?.pagination
|
|
13034
13004
|
});
|
|
13035
|
-
const [columnFilters, setColumnFilters] = (0,
|
|
13036
|
-
const computedColumnMinWidths = (0,
|
|
13005
|
+
const [columnFilters, setColumnFilters] = (0, import_react51.useState)(initialState?.columnFilters);
|
|
13006
|
+
const computedColumnMinWidths = (0, import_react51.useMemo)(() => {
|
|
13037
13007
|
return columns.reduce((previousValue, column) => {
|
|
13038
13008
|
return {
|
|
13039
13009
|
...previousValue,
|
|
@@ -13042,7 +13012,7 @@ var Table = ({
|
|
|
13042
13012
|
};
|
|
13043
13013
|
}, {});
|
|
13044
13014
|
}, [columns, defaultColumn]);
|
|
13045
|
-
const computedColumnMaxWidths = (0,
|
|
13015
|
+
const computedColumnMaxWidths = (0, import_react51.useMemo)(() => {
|
|
13046
13016
|
return columns.reduce((previousValue, column) => {
|
|
13047
13017
|
return {
|
|
13048
13018
|
...previousValue,
|
|
@@ -13050,12 +13020,12 @@ var Table = ({
|
|
|
13050
13020
|
};
|
|
13051
13021
|
}, {});
|
|
13052
13022
|
}, [columns, defaultColumn]);
|
|
13053
|
-
const tableMinWidth = (0,
|
|
13023
|
+
const tableMinWidth = (0, import_react51.useMemo)(() => {
|
|
13054
13024
|
return columns.reduce((sum, column) => {
|
|
13055
13025
|
return sum + computedColumnMinWidths[column.id];
|
|
13056
13026
|
}, 0);
|
|
13057
13027
|
}, [columns, computedColumnMinWidths]);
|
|
13058
|
-
const updateColumnSizes = (0,
|
|
13028
|
+
const updateColumnSizes = (0, import_react51.useMemo)(() => {
|
|
13059
13029
|
return (previous) => {
|
|
13060
13030
|
const updateSizing = {
|
|
13061
13031
|
...columnSizing,
|
|
@@ -13124,7 +13094,7 @@ var Table = ({
|
|
|
13124
13094
|
minSize: 60,
|
|
13125
13095
|
maxSize: 700,
|
|
13126
13096
|
cell: ({ cell }) => {
|
|
13127
|
-
return /* @__PURE__ */ (0,
|
|
13097
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(TableCell, { children: cell.getValue() });
|
|
13128
13098
|
},
|
|
13129
13099
|
...defaultColumn
|
|
13130
13100
|
},
|
|
@@ -13172,18 +13142,18 @@ var Table = ({
|
|
|
13172
13142
|
columnResizeMode: "onChange",
|
|
13173
13143
|
...tableOptions
|
|
13174
13144
|
});
|
|
13175
|
-
const [hasInitializedSizing, setHasInitializedSizing] = (0,
|
|
13176
|
-
(0,
|
|
13145
|
+
const [hasInitializedSizing, setHasInitializedSizing] = (0, import_react51.useState)(false);
|
|
13146
|
+
(0, import_react51.useEffect)(() => {
|
|
13177
13147
|
if (!hasInitializedSizing && ref.current) {
|
|
13178
13148
|
setHasInitializedSizing(true);
|
|
13179
13149
|
table.setColumnSizing(updateColumnSizes(columnSizing));
|
|
13180
13150
|
}
|
|
13181
13151
|
}, [columnSizing, hasInitializedSizing]);
|
|
13182
|
-
useResizeCallbackWrapper((0,
|
|
13152
|
+
useResizeCallbackWrapper((0, import_react51.useCallback)(() => {
|
|
13183
13153
|
table.setColumnSizing(updateColumnSizes);
|
|
13184
13154
|
}, [updateColumnSizes]));
|
|
13185
13155
|
const pageCount = table.getPageCount();
|
|
13186
|
-
(0,
|
|
13156
|
+
(0, import_react51.useEffect)(() => {
|
|
13187
13157
|
const totalPages = pageCount;
|
|
13188
13158
|
if (totalPages === 0) {
|
|
13189
13159
|
if (pagination.pageIndex !== 0) {
|
|
@@ -13199,7 +13169,7 @@ var Table = ({
|
|
|
13199
13169
|
}));
|
|
13200
13170
|
}
|
|
13201
13171
|
}, [data, pageCount, pagination.pageSize, pagination.pageIndex]);
|
|
13202
|
-
const columnSizeVars = (0,
|
|
13172
|
+
const columnSizeVars = (0, import_react51.useMemo)(() => {
|
|
13203
13173
|
const headers = table.getFlatHeaders();
|
|
13204
13174
|
const colSizes = {};
|
|
13205
13175
|
for (let i = 0; i < headers.length; i++) {
|
|
@@ -13209,8 +13179,8 @@ var Table = ({
|
|
|
13209
13179
|
}
|
|
13210
13180
|
return colSizes;
|
|
13211
13181
|
}, [table.getState().columnSizingInfo, table.getState().columnSizing]);
|
|
13212
|
-
return /* @__PURE__ */ (0,
|
|
13213
|
-
/* @__PURE__ */ (0,
|
|
13182
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { ref, "data-name": PropsUtil.dataAttributes.name("table-container"), className, children: [
|
|
13183
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { "data-name": PropsUtil.dataAttributes.name("table-scroll-wrapper"), className: tableContainerClassName, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
13214
13184
|
"table",
|
|
13215
13185
|
{
|
|
13216
13186
|
ref: tableRef,
|
|
@@ -13221,7 +13191,7 @@ var Table = ({
|
|
|
13221
13191
|
},
|
|
13222
13192
|
className: tableClassName,
|
|
13223
13193
|
children: [
|
|
13224
|
-
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0,
|
|
13194
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13225
13195
|
"col",
|
|
13226
13196
|
{
|
|
13227
13197
|
style: {
|
|
@@ -13232,16 +13202,16 @@ var Table = ({
|
|
|
13232
13202
|
},
|
|
13233
13203
|
header.id
|
|
13234
13204
|
)) }, headerGroup.id)),
|
|
13235
|
-
/* @__PURE__ */ (0,
|
|
13236
|
-
return /* @__PURE__ */ (0,
|
|
13205
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("tr", { "data-name": PropsUtil.dataAttributes.name("table-header-row"), className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
|
|
13206
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(
|
|
13237
13207
|
"th",
|
|
13238
13208
|
{
|
|
13239
13209
|
colSpan: header.colSpan,
|
|
13240
13210
|
"data-name": PropsUtil.dataAttributes.name("table-header-cell"),
|
|
13241
13211
|
className: (0, import_clsx26.default)("group/table-header-cell", header.column.columnDef.meta?.className),
|
|
13242
13212
|
children: [
|
|
13243
|
-
/* @__PURE__ */ (0,
|
|
13244
|
-
/* @__PURE__ */ (0,
|
|
13213
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Visibility, { isVisible: !header.isPlaceholder, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex-row-1 items-center", children: [
|
|
13214
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Visibility, { isVisible: header.column.getCanSort(), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13245
13215
|
TableSortButton,
|
|
13246
13216
|
{
|
|
13247
13217
|
sortDirection: header.column.getIsSorted(),
|
|
@@ -13267,7 +13237,7 @@ var Table = ({
|
|
|
13267
13237
|
}
|
|
13268
13238
|
}
|
|
13269
13239
|
) }),
|
|
13270
|
-
/* @__PURE__ */ (0,
|
|
13240
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Visibility, { isVisible: header.column.getCanFilter() && !!header.column.columnDef.meta?.filterType, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13271
13241
|
TableFilterButton,
|
|
13272
13242
|
{
|
|
13273
13243
|
column: header.column,
|
|
@@ -13279,7 +13249,7 @@ var Table = ({
|
|
|
13279
13249
|
header.getContext()
|
|
13280
13250
|
)
|
|
13281
13251
|
] }) }),
|
|
13282
|
-
/* @__PURE__ */ (0,
|
|
13252
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Visibility, { isVisible: header.column.getCanResize(), children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13283
13253
|
"div",
|
|
13284
13254
|
{
|
|
13285
13255
|
onPointerDown: header.getResizeHandler(),
|
|
@@ -13300,16 +13270,16 @@ var Table = ({
|
|
|
13300
13270
|
header.id
|
|
13301
13271
|
);
|
|
13302
13272
|
}) }, headerGroup.id)) }),
|
|
13303
|
-
/* @__PURE__ */ (0,
|
|
13273
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("tbody", { children: [
|
|
13304
13274
|
table.getRowModel().rows.map((row) => {
|
|
13305
|
-
return /* @__PURE__ */ (0,
|
|
13275
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13306
13276
|
"tr",
|
|
13307
13277
|
{
|
|
13308
13278
|
onClick: () => onRowClick?.(row, table),
|
|
13309
13279
|
"data-name": "table-body-row",
|
|
13310
13280
|
className: BagFunctionUtil.resolve(table.options.meta?.bodyRowClassName, row.original),
|
|
13311
13281
|
children: row.getVisibleCells().map((cell) => {
|
|
13312
|
-
return /* @__PURE__ */ (0,
|
|
13282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { "data-name": "table-body-cell", children: (0, import_react_table.flexRender)(
|
|
13313
13283
|
cell.column.columnDef.cell,
|
|
13314
13284
|
cell.getContext()
|
|
13315
13285
|
) }, cell.id);
|
|
@@ -13319,15 +13289,15 @@ var Table = ({
|
|
|
13319
13289
|
);
|
|
13320
13290
|
}),
|
|
13321
13291
|
range(table.getState().pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
|
|
13322
|
-
return /* @__PURE__ */ (0,
|
|
13323
|
-
return /* @__PURE__ */ (0,
|
|
13292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("tr", { children: columns.map((column) => {
|
|
13293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(FillerCell, {}) }, column.id);
|
|
13324
13294
|
}) }, "filler-row-" + index);
|
|
13325
13295
|
})
|
|
13326
13296
|
] })
|
|
13327
13297
|
]
|
|
13328
13298
|
}
|
|
13329
13299
|
) }),
|
|
13330
|
-
/* @__PURE__ */ (0,
|
|
13300
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: "flex-row-2 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13331
13301
|
Pagination,
|
|
13332
13302
|
{
|
|
13333
13303
|
pageIndex: table.getState().pagination.pageIndex,
|
|
@@ -13339,7 +13309,7 @@ var Table = ({
|
|
|
13339
13309
|
};
|
|
13340
13310
|
var TableUncontrolled = ({ data, ...props }) => {
|
|
13341
13311
|
const [usedDate] = useOverwritableState(data);
|
|
13342
|
-
return /* @__PURE__ */ (0,
|
|
13312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13343
13313
|
Table,
|
|
13344
13314
|
{
|
|
13345
13315
|
...props,
|
|
@@ -13358,12 +13328,12 @@ var TableWithSelection = ({
|
|
|
13358
13328
|
meta,
|
|
13359
13329
|
...props
|
|
13360
13330
|
}) => {
|
|
13361
|
-
const columnsWithSelection = (0,
|
|
13331
|
+
const columnsWithSelection = (0, import_react51.useMemo)(() => {
|
|
13362
13332
|
return [
|
|
13363
13333
|
{
|
|
13364
13334
|
id: selectionRowId,
|
|
13365
13335
|
header: ({ table }) => {
|
|
13366
|
-
return /* @__PURE__ */ (0,
|
|
13336
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13367
13337
|
Checkbox,
|
|
13368
13338
|
{
|
|
13369
13339
|
value: table.getIsAllRowsSelected(),
|
|
@@ -13376,7 +13346,7 @@ var TableWithSelection = ({
|
|
|
13376
13346
|
);
|
|
13377
13347
|
},
|
|
13378
13348
|
cell: ({ row }) => {
|
|
13379
|
-
return /* @__PURE__ */ (0,
|
|
13349
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13380
13350
|
Checkbox,
|
|
13381
13351
|
{
|
|
13382
13352
|
disabled: !row.getCanSelect(),
|
|
@@ -13394,15 +13364,15 @@ var TableWithSelection = ({
|
|
|
13394
13364
|
...columns
|
|
13395
13365
|
];
|
|
13396
13366
|
}, [columns, selectionRowId]);
|
|
13397
|
-
return /* @__PURE__ */ (0,
|
|
13367
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
13398
13368
|
Table,
|
|
13399
13369
|
{
|
|
13400
13370
|
columns: columnsWithSelection,
|
|
13401
13371
|
fillerRow: (columnId, table) => {
|
|
13402
13372
|
if (columnId === selectionRowId) {
|
|
13403
|
-
return /* @__PURE__ */ (0,
|
|
13373
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Checkbox, { value: false, disabled: true, className: "max-w-6" });
|
|
13404
13374
|
}
|
|
13405
|
-
return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ (0,
|
|
13375
|
+
return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(FillerCell, {});
|
|
13406
13376
|
},
|
|
13407
13377
|
state: {
|
|
13408
13378
|
rowSelection,
|
|
@@ -13427,7 +13397,7 @@ var TableWithSelection = ({
|
|
|
13427
13397
|
};
|
|
13428
13398
|
|
|
13429
13399
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
13430
|
-
var
|
|
13400
|
+
var import_react52 = require("react");
|
|
13431
13401
|
var import_clsx27 = require("clsx");
|
|
13432
13402
|
|
|
13433
13403
|
// src/utils/writeToClipboard.ts
|
|
@@ -13437,7 +13407,7 @@ var writeToClipboard = (text) => {
|
|
|
13437
13407
|
|
|
13438
13408
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
13439
13409
|
var import_lucide_react17 = require("lucide-react");
|
|
13440
|
-
var
|
|
13410
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
13441
13411
|
var CopyToClipboardWrapper = ({
|
|
13442
13412
|
children,
|
|
13443
13413
|
textToCopy,
|
|
@@ -13447,8 +13417,8 @@ var CopyToClipboardWrapper = ({
|
|
|
13447
13417
|
zIndex = 10
|
|
13448
13418
|
}) => {
|
|
13449
13419
|
const translation = useHightideTranslation();
|
|
13450
|
-
const [isShowingIndication, setIsShowingIndication] = (0,
|
|
13451
|
-
const [isShowingConfirmation, setIsShowingConfirmation] = (0,
|
|
13420
|
+
const [isShowingIndication, setIsShowingIndication] = (0, import_react52.useState)(false);
|
|
13421
|
+
const [isShowingConfirmation, setIsShowingConfirmation] = (0, import_react52.useState)(false);
|
|
13452
13422
|
const positionClasses = {
|
|
13453
13423
|
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
13454
13424
|
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
@@ -13468,7 +13438,7 @@ var CopyToClipboardWrapper = ({
|
|
|
13468
13438
|
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
13469
13439
|
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
13470
13440
|
};
|
|
13471
|
-
return /* @__PURE__ */ (0,
|
|
13441
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
13472
13442
|
"div",
|
|
13473
13443
|
{
|
|
13474
13444
|
className: (0, import_clsx27.clsx)("relative inline-block cursor-copy", containerClassName),
|
|
@@ -13486,7 +13456,7 @@ var CopyToClipboardWrapper = ({
|
|
|
13486
13456
|
},
|
|
13487
13457
|
children: [
|
|
13488
13458
|
children,
|
|
13489
|
-
/* @__PURE__ */ (0,
|
|
13459
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
13490
13460
|
"div",
|
|
13491
13461
|
{
|
|
13492
13462
|
className: (0, import_clsx27.clsx)(
|
|
@@ -13501,15 +13471,15 @@ var CopyToClipboardWrapper = ({
|
|
|
13501
13471
|
opacity: isShowingIndication || isShowingConfirmation ? 1 : 0
|
|
13502
13472
|
},
|
|
13503
13473
|
children: [
|
|
13504
|
-
isShowingConfirmation && /* @__PURE__ */ (0,
|
|
13505
|
-
/* @__PURE__ */ (0,
|
|
13474
|
+
isShowingConfirmation && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex-row-1", children: [
|
|
13475
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react17.CheckIcon, { size: 16, className: "text-positive" }),
|
|
13506
13476
|
translation("copied")
|
|
13507
13477
|
] }),
|
|
13508
|
-
isShowingIndication && /* @__PURE__ */ (0,
|
|
13509
|
-
/* @__PURE__ */ (0,
|
|
13478
|
+
isShowingIndication && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)("div", { className: "flex-row-1 text-description", children: [
|
|
13479
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react17.Copy, { size: 16 }),
|
|
13510
13480
|
translation("clickToCopy")
|
|
13511
13481
|
] }),
|
|
13512
|
-
/* @__PURE__ */ (0,
|
|
13482
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
13513
13483
|
"div",
|
|
13514
13484
|
{
|
|
13515
13485
|
className: (0, import_clsx27.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
|
|
@@ -13525,9 +13495,9 @@ var CopyToClipboardWrapper = ({
|
|
|
13525
13495
|
};
|
|
13526
13496
|
|
|
13527
13497
|
// src/components/user-interaction/ScrollPicker.tsx
|
|
13528
|
-
var
|
|
13498
|
+
var import_react53 = require("react");
|
|
13529
13499
|
var import_clsx28 = __toESM(require("clsx"));
|
|
13530
|
-
var
|
|
13500
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
13531
13501
|
var up = 1;
|
|
13532
13502
|
var down = -1;
|
|
13533
13503
|
var ScrollPicker = ({
|
|
@@ -13546,7 +13516,7 @@ var ScrollPicker = ({
|
|
|
13546
13516
|
transition,
|
|
13547
13517
|
items,
|
|
13548
13518
|
lastTimeStamp
|
|
13549
|
-
}, setAnimation] = (0,
|
|
13519
|
+
}, setAnimation] = (0, import_react53.useState)({
|
|
13550
13520
|
targetIndex: selectedIndex,
|
|
13551
13521
|
currentIndex: disabled ? selectedIndex : 0,
|
|
13552
13522
|
velocity: 0,
|
|
@@ -13562,7 +13532,7 @@ var ScrollPicker = ({
|
|
|
13562
13532
|
const itemHeight = 40;
|
|
13563
13533
|
const distance = 8;
|
|
13564
13534
|
const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
|
|
13565
|
-
const getDirection = (0,
|
|
13535
|
+
const getDirection = (0, import_react53.useCallback)((targetIndex, currentIndex2, transition2, length) => {
|
|
13566
13536
|
if (targetIndex === currentIndex2) {
|
|
13567
13537
|
return transition2 > 0 ? up : down;
|
|
13568
13538
|
}
|
|
@@ -13572,7 +13542,7 @@ var ScrollPicker = ({
|
|
|
13572
13542
|
}
|
|
13573
13543
|
return distanceForward >= length / 2 ? down : up;
|
|
13574
13544
|
}, []);
|
|
13575
|
-
const animate = (0,
|
|
13545
|
+
const animate = (0, import_react53.useCallback)((timestamp, startTime) => {
|
|
13576
13546
|
setAnimation((prevState) => {
|
|
13577
13547
|
const {
|
|
13578
13548
|
targetIndex,
|
|
@@ -13645,7 +13615,7 @@ var ScrollPicker = ({
|
|
|
13645
13615
|
};
|
|
13646
13616
|
});
|
|
13647
13617
|
}, [disabled, getDirection, onChange]);
|
|
13648
|
-
(0,
|
|
13618
|
+
(0, import_react53.useEffect)(() => {
|
|
13649
13619
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
13650
13620
|
});
|
|
13651
13621
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -13666,7 +13636,7 @@ var ScrollPicker = ({
|
|
|
13666
13636
|
}
|
|
13667
13637
|
return clamp(1 - opacityValue / max);
|
|
13668
13638
|
};
|
|
13669
|
-
return /* @__PURE__ */ (0,
|
|
13639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13670
13640
|
"div",
|
|
13671
13641
|
{
|
|
13672
13642
|
className: "relative overflow-hidden",
|
|
@@ -13677,15 +13647,15 @@ var ScrollPicker = ({
|
|
|
13677
13647
|
setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + deltaY }));
|
|
13678
13648
|
}
|
|
13679
13649
|
},
|
|
13680
|
-
children: /* @__PURE__ */ (0,
|
|
13681
|
-
/* @__PURE__ */ (0,
|
|
13650
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
|
|
13651
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13682
13652
|
"div",
|
|
13683
13653
|
{
|
|
13684
13654
|
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 ",
|
|
13685
13655
|
style: { height: `${itemHeight}px` }
|
|
13686
13656
|
}
|
|
13687
13657
|
),
|
|
13688
|
-
/* @__PURE__ */ (0,
|
|
13658
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13689
13659
|
"div",
|
|
13690
13660
|
{
|
|
13691
13661
|
className: "flex-col-2 select-none",
|
|
@@ -13693,7 +13663,7 @@ var ScrollPicker = ({
|
|
|
13693
13663
|
transform: `translateY(${-transition * (distance + itemHeight)}px)`,
|
|
13694
13664
|
columnGap: `${distance}px`
|
|
13695
13665
|
},
|
|
13696
|
-
children: shownItems.map(({ name: name2, index }, arrayIndex) => /* @__PURE__ */ (0,
|
|
13666
|
+
children: shownItems.map(({ name: name2, index }, arrayIndex) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13697
13667
|
"div",
|
|
13698
13668
|
{
|
|
13699
13669
|
className: (0, import_clsx28.default)(
|
|
@@ -13723,10 +13693,10 @@ var ScrollPicker = ({
|
|
|
13723
13693
|
};
|
|
13724
13694
|
|
|
13725
13695
|
// src/components/user-interaction/Textarea.tsx
|
|
13726
|
-
var
|
|
13696
|
+
var import_react54 = require("react");
|
|
13727
13697
|
var import_clsx29 = __toESM(require("clsx"));
|
|
13728
|
-
var
|
|
13729
|
-
var Textarea = (0,
|
|
13698
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
13699
|
+
var Textarea = (0, import_react54.forwardRef)(function Textarea2({
|
|
13730
13700
|
invalid = false,
|
|
13731
13701
|
onValueChange,
|
|
13732
13702
|
onEditComplete,
|
|
@@ -13738,7 +13708,7 @@ var Textarea = (0, import_react50.forwardRef)(function Textarea2({
|
|
|
13738
13708
|
onEditComplete?.(text);
|
|
13739
13709
|
clearTimer();
|
|
13740
13710
|
};
|
|
13741
|
-
return /* @__PURE__ */ (0,
|
|
13711
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13742
13712
|
"textarea",
|
|
13743
13713
|
{
|
|
13744
13714
|
...props,
|
|
@@ -13768,7 +13738,7 @@ var TextareaUncontrolled = ({
|
|
|
13768
13738
|
...props
|
|
13769
13739
|
}) => {
|
|
13770
13740
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
13771
|
-
return /* @__PURE__ */ (0,
|
|
13741
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13772
13742
|
Textarea,
|
|
13773
13743
|
{
|
|
13774
13744
|
...props,
|
|
@@ -13786,9 +13756,9 @@ var TextareaWithHeadline = ({
|
|
|
13786
13756
|
containerClassName,
|
|
13787
13757
|
...props
|
|
13788
13758
|
}) => {
|
|
13789
|
-
const genId = (0,
|
|
13759
|
+
const genId = (0, import_react54.useId)();
|
|
13790
13760
|
const usedId = id ?? genId;
|
|
13791
|
-
return /* @__PURE__ */ (0,
|
|
13761
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
13792
13762
|
"div",
|
|
13793
13763
|
{
|
|
13794
13764
|
className: (0, import_clsx29.default)(
|
|
@@ -13800,8 +13770,8 @@ var TextareaWithHeadline = ({
|
|
|
13800
13770
|
containerClassName
|
|
13801
13771
|
),
|
|
13802
13772
|
children: [
|
|
13803
|
-
headline && /* @__PURE__ */ (0,
|
|
13804
|
-
/* @__PURE__ */ (0,
|
|
13773
|
+
headline && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("label", { ...headlineProps, htmlFor: usedId, className: (0, import_clsx29.default)("typography-lable-md text-label", headlineProps.className), children: headline }),
|
|
13774
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13805
13775
|
Textarea,
|
|
13806
13776
|
{
|
|
13807
13777
|
...props,
|
|
@@ -13818,7 +13788,7 @@ var TextareaWithHeadline = ({
|
|
|
13818
13788
|
};
|
|
13819
13789
|
|
|
13820
13790
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
13821
|
-
var
|
|
13791
|
+
var import_react57 = require("react");
|
|
13822
13792
|
var import_lucide_react18 = require("lucide-react");
|
|
13823
13793
|
|
|
13824
13794
|
// src/utils/date.ts
|
|
@@ -13995,8 +13965,8 @@ var DateUtils = {
|
|
|
13995
13965
|
var import_clsx31 = __toESM(require("clsx"));
|
|
13996
13966
|
|
|
13997
13967
|
// src/components/user-interaction/date/DayPicker.tsx
|
|
13998
|
-
var
|
|
13999
|
-
var
|
|
13968
|
+
var import_react55 = require("react");
|
|
13969
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
14000
13970
|
var DayPicker = ({
|
|
14001
13971
|
displayedMonth,
|
|
14002
13972
|
value,
|
|
@@ -14011,22 +13981,22 @@ var DayPicker = ({
|
|
|
14011
13981
|
const { locale } = useLocale();
|
|
14012
13982
|
const month = displayedMonth.getMonth();
|
|
14013
13983
|
const weeks = getWeeksForCalenderMonth(displayedMonth, weekStart);
|
|
14014
|
-
const end = (0,
|
|
13984
|
+
const end = (0, import_react55.useMemo)(() => {
|
|
14015
13985
|
if (!providedEnd) return;
|
|
14016
13986
|
return new Date(providedEnd.getFullYear(), providedEnd.getMonth(), providedEnd.getDate());
|
|
14017
13987
|
}, [providedEnd]);
|
|
14018
|
-
const start = (0,
|
|
13988
|
+
const start = (0, import_react55.useMemo)(() => {
|
|
14019
13989
|
if (!providedStart) return;
|
|
14020
13990
|
return new Date(providedStart.getFullYear(), providedStart.getMonth(), providedStart.getDate());
|
|
14021
13991
|
}, [providedStart]);
|
|
14022
|
-
return /* @__PURE__ */ (0,
|
|
14023
|
-
/* @__PURE__ */ (0,
|
|
14024
|
-
weeks.map((week, index) => /* @__PURE__ */ (0,
|
|
13992
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className, "data-name": "day-picker-container", children: [
|
|
13993
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { "data-name": "day-picker-header-row", children: weeks[0].map((weekDay, index) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { "data-name": "day-picker-header-item", children: new Intl.DateTimeFormat(locale, { weekday: "long" }).format(weekDay).substring(0, 2) }, index)) }),
|
|
13994
|
+
weeks.map((week, index) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("div", { "data-name": "day-picker-body-row", children: week.map((date) => {
|
|
14025
13995
|
const isSelected = !!value && DateUtils.equalDate(value, date);
|
|
14026
13996
|
const isToday = DateUtils.equalDate(/* @__PURE__ */ new Date(), date);
|
|
14027
13997
|
const isSameMonth = date.getMonth() === month;
|
|
14028
13998
|
const isDayValid = isInTimeSpan(date, start, end);
|
|
14029
|
-
return /* @__PURE__ */ (0,
|
|
13999
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
14030
14000
|
"button",
|
|
14031
14001
|
{
|
|
14032
14002
|
disabled: !isDayValid,
|
|
@@ -14060,7 +14030,7 @@ var DayPickerUncontrolled = ({
|
|
|
14060
14030
|
...props
|
|
14061
14031
|
}) => {
|
|
14062
14032
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14063
|
-
return /* @__PURE__ */ (0,
|
|
14033
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
14064
14034
|
DayPicker,
|
|
14065
14035
|
{
|
|
14066
14036
|
value,
|
|
@@ -14071,10 +14041,10 @@ var DayPickerUncontrolled = ({
|
|
|
14071
14041
|
};
|
|
14072
14042
|
|
|
14073
14043
|
// src/components/user-interaction/date/YearMonthPicker.tsx
|
|
14074
|
-
var
|
|
14044
|
+
var import_react56 = require("react");
|
|
14075
14045
|
var import_clsx30 = __toESM(require("clsx"));
|
|
14076
|
-
var
|
|
14077
|
-
var YearRow = (0,
|
|
14046
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
14047
|
+
var YearRow = (0, import_react56.memo)(function YearRow2({
|
|
14078
14048
|
year,
|
|
14079
14049
|
selectedMonthIndex,
|
|
14080
14050
|
minTimestamp,
|
|
@@ -14082,31 +14052,31 @@ var YearRow = (0, import_react52.memo)(function YearRow2({
|
|
|
14082
14052
|
monthNames,
|
|
14083
14053
|
onSelect
|
|
14084
14054
|
}) {
|
|
14085
|
-
const ref = (0,
|
|
14055
|
+
const ref = (0, import_react56.useRef)(null);
|
|
14086
14056
|
const isSelectedYear = selectedMonthIndex !== void 0;
|
|
14087
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
14088
|
-
(0,
|
|
14057
|
+
const [isExpanded, setIsExpanded] = (0, import_react56.useState)(false);
|
|
14058
|
+
(0, import_react56.useEffect)(() => {
|
|
14089
14059
|
if (isSelectedYear) {
|
|
14090
14060
|
ref.current?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
14091
14061
|
}
|
|
14092
14062
|
}, [isSelectedYear]);
|
|
14093
|
-
const monthGrid = (0,
|
|
14094
|
-
return /* @__PURE__ */ (0,
|
|
14063
|
+
const monthGrid = (0, import_react56.useMemo)(() => equalSizeGroups([...DateUtils.monthsList], 3), []);
|
|
14064
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
14095
14065
|
ExpandableRoot,
|
|
14096
14066
|
{
|
|
14097
14067
|
ref: isSelectedYear ? ref : void 0,
|
|
14098
14068
|
isExpanded,
|
|
14099
14069
|
onExpandedChange: setIsExpanded,
|
|
14100
14070
|
children: [
|
|
14101
|
-
/* @__PURE__ */ (0,
|
|
14102
|
-
/* @__PURE__ */ (0,
|
|
14071
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ExpandableHeader, { className: (0, import_clsx30.default)("px-2", { "text-primary font-bold": isSelectedYear }), children: year }),
|
|
14072
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(ExpandableContent, { className: "gap-y-1 px-2 expadable-content-h-39", children: isExpanded && monthGrid.map((group, groupIdx) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "flex-row-1", children: group.map((month) => {
|
|
14103
14073
|
const monthIndex = DateUtils.monthsList.indexOf(month);
|
|
14104
14074
|
const currentTimestamp = new Date(year, monthIndex).getTime();
|
|
14105
14075
|
const isAfterStart = minTimestamp === void 0 || currentTimestamp >= minTimestamp;
|
|
14106
14076
|
const isBeforeEnd = maxTimestamp === void 0 || currentTimestamp <= maxTimestamp;
|
|
14107
14077
|
const isValid = isAfterStart && isBeforeEnd;
|
|
14108
14078
|
const isSelectedMonth = monthIndex === selectedMonthIndex;
|
|
14109
|
-
return /* @__PURE__ */ (0,
|
|
14079
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
14110
14080
|
Button,
|
|
14111
14081
|
{
|
|
14112
14082
|
disabled: !isValid,
|
|
@@ -14138,32 +14108,32 @@ var YearMonthPicker = ({
|
|
|
14138
14108
|
className
|
|
14139
14109
|
}) => {
|
|
14140
14110
|
const { locale } = useLocale();
|
|
14141
|
-
const monthNames = (0,
|
|
14111
|
+
const monthNames = (0, import_react56.useMemo)(() => {
|
|
14142
14112
|
const formatter = new Intl.DateTimeFormat(locale, { month: "short" });
|
|
14143
14113
|
return Array.from({ length: 12 }, (_, i) => formatter.format(new Date(2e3, i, 1)));
|
|
14144
14114
|
}, [locale]);
|
|
14145
|
-
const years = (0,
|
|
14115
|
+
const years = (0, import_react56.useMemo)(
|
|
14146
14116
|
() => range([start.getFullYear(), end.getFullYear()], { exclusiveEnd: false }),
|
|
14147
14117
|
[start, end]
|
|
14148
14118
|
);
|
|
14149
|
-
const minTimestamp = (0,
|
|
14119
|
+
const minTimestamp = (0, import_react56.useMemo)(() => {
|
|
14150
14120
|
if (!start) return;
|
|
14151
14121
|
return new Date(start.getFullYear(), start.getMonth(), 1).getTime();
|
|
14152
14122
|
}, [start]);
|
|
14153
|
-
const maxTimestamp = (0,
|
|
14123
|
+
const maxTimestamp = (0, import_react56.useMemo)(() => {
|
|
14154
14124
|
if (!end) return;
|
|
14155
14125
|
return new Date(end.getFullYear(), end.getMonth() + 1, 0).getTime();
|
|
14156
14126
|
}, [end]);
|
|
14157
|
-
const callbackRefs = (0,
|
|
14158
|
-
(0,
|
|
14127
|
+
const callbackRefs = (0, import_react56.useRef)({ onValueChange, onEditComplete });
|
|
14128
|
+
(0, import_react56.useLayoutEffect)(() => {
|
|
14159
14129
|
callbackRefs.current = { onValueChange, onEditComplete };
|
|
14160
14130
|
});
|
|
14161
|
-
const handleSelect = (0,
|
|
14131
|
+
const handleSelect = (0, import_react56.useCallback)((newDate) => {
|
|
14162
14132
|
const { onValueChange: onValueChange2, onEditComplete: onEditComplete2 } = callbackRefs.current;
|
|
14163
14133
|
onValueChange2?.(newDate);
|
|
14164
14134
|
onEditComplete2?.(newDate);
|
|
14165
14135
|
}, []);
|
|
14166
|
-
return /* @__PURE__ */ (0,
|
|
14136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
14167
14137
|
InfiniteScroll,
|
|
14168
14138
|
{
|
|
14169
14139
|
itemCount: years.length,
|
|
@@ -14173,7 +14143,7 @@ var YearMonthPicker = ({
|
|
|
14173
14143
|
const year = years[index];
|
|
14174
14144
|
const isSelectedYear = value.getFullYear() === year;
|
|
14175
14145
|
const selectedMonthIndex = isSelectedYear ? value.getMonth() : void 0;
|
|
14176
|
-
return /* @__PURE__ */ (0,
|
|
14146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
14177
14147
|
YearRow,
|
|
14178
14148
|
{
|
|
14179
14149
|
year,
|
|
@@ -14195,7 +14165,7 @@ var YearMonthPickerUncontrolled = ({
|
|
|
14195
14165
|
...props
|
|
14196
14166
|
}) => {
|
|
14197
14167
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14198
|
-
return /* @__PURE__ */ (0,
|
|
14168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
14199
14169
|
YearMonthPicker,
|
|
14200
14170
|
{
|
|
14201
14171
|
value,
|
|
@@ -14206,7 +14176,7 @@ var YearMonthPickerUncontrolled = ({
|
|
|
14206
14176
|
};
|
|
14207
14177
|
|
|
14208
14178
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
14209
|
-
var
|
|
14179
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
14210
14180
|
var DatePicker = ({
|
|
14211
14181
|
value = /* @__PURE__ */ new Date(),
|
|
14212
14182
|
start,
|
|
@@ -14220,11 +14190,11 @@ var DatePicker = ({
|
|
|
14220
14190
|
className
|
|
14221
14191
|
}) => {
|
|
14222
14192
|
const { locale } = useLocale();
|
|
14223
|
-
const [displayedMonth, setDisplayedMonth] = (0,
|
|
14224
|
-
const [displayMode, setDisplayMode] = (0,
|
|
14225
|
-
return /* @__PURE__ */ (0,
|
|
14226
|
-
/* @__PURE__ */ (0,
|
|
14227
|
-
/* @__PURE__ */ (0,
|
|
14193
|
+
const [displayedMonth, setDisplayedMonth] = (0, import_react57.useState)(new Date(value.getFullYear(), value.getMonth(), 1));
|
|
14194
|
+
const [displayMode, setDisplayMode] = (0, import_react57.useState)(initialDisplay);
|
|
14195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: (0, import_clsx31.default)("flex-col-3", className), children: [
|
|
14196
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex-row-2 items-center justify-between", children: [
|
|
14197
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(
|
|
14228
14198
|
Button,
|
|
14229
14199
|
{
|
|
14230
14200
|
size: "sm",
|
|
@@ -14235,12 +14205,12 @@ var DatePicker = ({
|
|
|
14235
14205
|
onClick: () => setDisplayMode(displayMode === "day" ? "yearMonth" : "day"),
|
|
14236
14206
|
children: [
|
|
14237
14207
|
`${new Intl.DateTimeFormat(LocalizationUtil.localToLanguage(locale), { month: "long" }).format(displayedMonth)} ${displayedMonth.getFullYear()}`,
|
|
14238
|
-
/* @__PURE__ */ (0,
|
|
14208
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react18.ChevronDown, { size: 16 })
|
|
14239
14209
|
]
|
|
14240
14210
|
}
|
|
14241
14211
|
),
|
|
14242
|
-
displayMode === "day" && /* @__PURE__ */ (0,
|
|
14243
|
-
/* @__PURE__ */ (0,
|
|
14212
|
+
displayMode === "day" && /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
14213
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
14244
14214
|
Button,
|
|
14245
14215
|
{
|
|
14246
14216
|
size: "sm",
|
|
@@ -14251,10 +14221,10 @@ var DatePicker = ({
|
|
|
14251
14221
|
onValueChange(newDate);
|
|
14252
14222
|
setDisplayedMonth(newDate);
|
|
14253
14223
|
},
|
|
14254
|
-
children: /* @__PURE__ */ (0,
|
|
14224
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react18.Calendar, { className: "size-5" })
|
|
14255
14225
|
}
|
|
14256
14226
|
),
|
|
14257
|
-
/* @__PURE__ */ (0,
|
|
14227
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
14258
14228
|
Button,
|
|
14259
14229
|
{
|
|
14260
14230
|
size: "sm",
|
|
@@ -14262,10 +14232,10 @@ var DatePicker = ({
|
|
|
14262
14232
|
onClick: () => {
|
|
14263
14233
|
setDisplayedMonth(subtractDuration(displayedMonth, { months: 1 }));
|
|
14264
14234
|
},
|
|
14265
|
-
children: /* @__PURE__ */ (0,
|
|
14235
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react18.ArrowUp, { size: 20 })
|
|
14266
14236
|
}
|
|
14267
14237
|
),
|
|
14268
|
-
/* @__PURE__ */ (0,
|
|
14238
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
14269
14239
|
Button,
|
|
14270
14240
|
{
|
|
14271
14241
|
size: "sm",
|
|
@@ -14273,12 +14243,12 @@ var DatePicker = ({
|
|
|
14273
14243
|
onClick: () => {
|
|
14274
14244
|
setDisplayedMonth(addDuration(displayedMonth, { months: 1 }));
|
|
14275
14245
|
},
|
|
14276
|
-
children: /* @__PURE__ */ (0,
|
|
14246
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_lucide_react18.ArrowDown, { size: 20 })
|
|
14277
14247
|
}
|
|
14278
14248
|
)
|
|
14279
14249
|
] })
|
|
14280
14250
|
] }),
|
|
14281
|
-
displayMode === "yearMonth" ? /* @__PURE__ */ (0,
|
|
14251
|
+
displayMode === "yearMonth" ? /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
14282
14252
|
YearMonthPicker,
|
|
14283
14253
|
{
|
|
14284
14254
|
...yearMonthPickerProps,
|
|
@@ -14295,7 +14265,7 @@ var DatePicker = ({
|
|
|
14295
14265
|
},
|
|
14296
14266
|
className: "h-60 max-h-60"
|
|
14297
14267
|
}
|
|
14298
|
-
) : /* @__PURE__ */ (0,
|
|
14268
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
14299
14269
|
DayPicker,
|
|
14300
14270
|
{
|
|
14301
14271
|
...dayPickerProps,
|
|
@@ -14317,7 +14287,7 @@ var DatePickerUncontrolled = ({
|
|
|
14317
14287
|
...props
|
|
14318
14288
|
}) => {
|
|
14319
14289
|
const [date, setDate] = useOverwritableState(value, onValueChange);
|
|
14320
|
-
return /* @__PURE__ */ (0,
|
|
14290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
14321
14291
|
DatePicker,
|
|
14322
14292
|
{
|
|
14323
14293
|
...props,
|
|
@@ -14331,8 +14301,8 @@ var DatePickerUncontrolled = ({
|
|
|
14331
14301
|
var import_clsx32 = __toESM(require("clsx"));
|
|
14332
14302
|
|
|
14333
14303
|
// src/components/user-interaction/date/TimePicker.tsx
|
|
14334
|
-
var
|
|
14335
|
-
var
|
|
14304
|
+
var import_react58 = require("react");
|
|
14305
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
14336
14306
|
var TimePicker = ({
|
|
14337
14307
|
value = /* @__PURE__ */ new Date(),
|
|
14338
14308
|
onValueChange,
|
|
@@ -14341,8 +14311,8 @@ var TimePicker = ({
|
|
|
14341
14311
|
minuteIncrement = "5min",
|
|
14342
14312
|
className
|
|
14343
14313
|
}) => {
|
|
14344
|
-
const minuteRef = (0,
|
|
14345
|
-
const hourRef = (0,
|
|
14314
|
+
const minuteRef = (0, import_react58.useRef)(null);
|
|
14315
|
+
const hourRef = (0, import_react58.useRef)(null);
|
|
14346
14316
|
const isPM = value.getHours() > 11;
|
|
14347
14317
|
const hours = is24HourFormat ? range(24) : range(12);
|
|
14348
14318
|
let minutes = range(60);
|
|
@@ -14362,13 +14332,13 @@ var TimePicker = ({
|
|
|
14362
14332
|
}
|
|
14363
14333
|
const closestMinute = closestMatch(minutes, (item1, item2) => Math.abs(item1 - value.getMinutes()) < Math.abs(item2 - value.getMinutes()));
|
|
14364
14334
|
const hour = value.getHours();
|
|
14365
|
-
(0,
|
|
14335
|
+
(0, import_react58.useEffect)(() => {
|
|
14366
14336
|
minuteRef.current?.scrollIntoView({
|
|
14367
14337
|
behavior: "smooth",
|
|
14368
14338
|
block: "nearest"
|
|
14369
14339
|
});
|
|
14370
14340
|
}, [closestMinute]);
|
|
14371
|
-
(0,
|
|
14341
|
+
(0, import_react58.useEffect)(() => {
|
|
14372
14342
|
hourRef.current?.scrollIntoView({
|
|
14373
14343
|
behavior: "smooth",
|
|
14374
14344
|
block: "nearest"
|
|
@@ -14380,10 +14350,10 @@ var TimePicker = ({
|
|
|
14380
14350
|
onValueChange?.(newDate);
|
|
14381
14351
|
onEditComplete?.(newDate);
|
|
14382
14352
|
};
|
|
14383
|
-
return /* @__PURE__ */ (0,
|
|
14384
|
-
/* @__PURE__ */ (0,
|
|
14353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { "data-name": "time-picker-container", className, children: [
|
|
14354
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { "data-name": "time-picker-value-column", children: hours.map((hour2) => {
|
|
14385
14355
|
const isSelected = hour2 === value.getHours() - (!is24HourFormat && isPM ? 12 : 0);
|
|
14386
|
-
return /* @__PURE__ */ (0,
|
|
14356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14387
14357
|
Button,
|
|
14388
14358
|
{
|
|
14389
14359
|
size: "sm",
|
|
@@ -14395,9 +14365,9 @@ var TimePicker = ({
|
|
|
14395
14365
|
hour2
|
|
14396
14366
|
);
|
|
14397
14367
|
}) }),
|
|
14398
|
-
/* @__PURE__ */ (0,
|
|
14368
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { "data-name": "time-picker-value-column", children: minutes.map((minute) => {
|
|
14399
14369
|
const isSelected = minute === closestMinute;
|
|
14400
|
-
return /* @__PURE__ */ (0,
|
|
14370
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14401
14371
|
Button,
|
|
14402
14372
|
{
|
|
14403
14373
|
size: "sm",
|
|
@@ -14409,8 +14379,8 @@ var TimePicker = ({
|
|
|
14409
14379
|
minute + minuteIncrement
|
|
14410
14380
|
);
|
|
14411
14381
|
}) }),
|
|
14412
|
-
!is24HourFormat && /* @__PURE__ */ (0,
|
|
14413
|
-
/* @__PURE__ */ (0,
|
|
14382
|
+
!is24HourFormat && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { "data-name": "time-picker-value-column", children: [
|
|
14383
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14414
14384
|
Button,
|
|
14415
14385
|
{
|
|
14416
14386
|
size: "sm",
|
|
@@ -14419,7 +14389,7 @@ var TimePicker = ({
|
|
|
14419
14389
|
children: "AM"
|
|
14420
14390
|
}
|
|
14421
14391
|
),
|
|
14422
|
-
/* @__PURE__ */ (0,
|
|
14392
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14423
14393
|
Button,
|
|
14424
14394
|
{
|
|
14425
14395
|
size: "sm",
|
|
@@ -14437,7 +14407,7 @@ var TimePickerUncontrolled = ({
|
|
|
14437
14407
|
...props
|
|
14438
14408
|
}) => {
|
|
14439
14409
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14440
|
-
return /* @__PURE__ */ (0,
|
|
14410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14441
14411
|
TimePicker,
|
|
14442
14412
|
{
|
|
14443
14413
|
...props,
|
|
@@ -14448,7 +14418,7 @@ var TimePickerUncontrolled = ({
|
|
|
14448
14418
|
};
|
|
14449
14419
|
|
|
14450
14420
|
// src/components/user-interaction/date/DateTimePicker.tsx
|
|
14451
|
-
var
|
|
14421
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
14452
14422
|
var DateTimePicker = ({
|
|
14453
14423
|
value = /* @__PURE__ */ new Date(),
|
|
14454
14424
|
start,
|
|
@@ -14467,7 +14437,7 @@ var DateTimePicker = ({
|
|
|
14467
14437
|
let dateDisplay;
|
|
14468
14438
|
let timeDisplay;
|
|
14469
14439
|
if (useDate) {
|
|
14470
|
-
dateDisplay = /* @__PURE__ */ (0,
|
|
14440
|
+
dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14471
14441
|
DatePicker,
|
|
14472
14442
|
{
|
|
14473
14443
|
...datePickerProps,
|
|
@@ -14483,7 +14453,7 @@ var DateTimePicker = ({
|
|
|
14483
14453
|
);
|
|
14484
14454
|
}
|
|
14485
14455
|
if (useTime) {
|
|
14486
|
-
timeDisplay = /* @__PURE__ */ (0,
|
|
14456
|
+
timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14487
14457
|
TimePicker,
|
|
14488
14458
|
{
|
|
14489
14459
|
...timePickerProps,
|
|
@@ -14496,14 +14466,14 @@ var DateTimePicker = ({
|
|
|
14496
14466
|
}
|
|
14497
14467
|
);
|
|
14498
14468
|
}
|
|
14499
|
-
return /* @__PURE__ */ (0,
|
|
14469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex-row-2 min-h-71 max-h-71", children: [
|
|
14500
14470
|
dateDisplay,
|
|
14501
14471
|
timeDisplay
|
|
14502
14472
|
] });
|
|
14503
14473
|
};
|
|
14504
14474
|
var DateTimePickerUncontrolled = ({ value: initialValue, onValueChange, ...props }) => {
|
|
14505
14475
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14506
|
-
return /* @__PURE__ */ (0,
|
|
14476
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14507
14477
|
DateTimePicker,
|
|
14508
14478
|
{
|
|
14509
14479
|
...props,
|
|
@@ -14514,7 +14484,7 @@ var DateTimePickerUncontrolled = ({ value: initialValue, onValueChange, ...props
|
|
|
14514
14484
|
};
|
|
14515
14485
|
|
|
14516
14486
|
// src/components/user-interaction/date/TimeDisplay.tsx
|
|
14517
|
-
var
|
|
14487
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
14518
14488
|
var TimeDisplay = ({
|
|
14519
14489
|
date,
|
|
14520
14490
|
mode = "daysFromToday"
|
|
@@ -14551,15 +14521,15 @@ var TimeDisplay = ({
|
|
|
14551
14521
|
} else {
|
|
14552
14522
|
fullString = `${date.getDate()}. ${monthToTranslation[date.getMonth()]} ${date.getFullYear()}`;
|
|
14553
14523
|
}
|
|
14554
|
-
return /* @__PURE__ */ (0,
|
|
14524
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { children: fullString });
|
|
14555
14525
|
};
|
|
14556
14526
|
|
|
14557
14527
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
14558
|
-
var
|
|
14528
|
+
var import_react59 = require("react");
|
|
14559
14529
|
var import_react_dom8 = require("react-dom");
|
|
14560
14530
|
var import_lucide_react19 = require("lucide-react");
|
|
14561
14531
|
var import_clsx33 = __toESM(require("clsx"));
|
|
14562
|
-
var
|
|
14532
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
14563
14533
|
var DateTimeInput = ({
|
|
14564
14534
|
value,
|
|
14565
14535
|
onValueChange,
|
|
@@ -14572,9 +14542,9 @@ var DateTimeInput = ({
|
|
|
14572
14542
|
}) => {
|
|
14573
14543
|
const translation = useHightideTranslation();
|
|
14574
14544
|
const { locale } = useLocale();
|
|
14575
|
-
const [isOpen, setIsOpen] = (0,
|
|
14576
|
-
const anchorRef = (0,
|
|
14577
|
-
const containerRef = (0,
|
|
14545
|
+
const [isOpen, setIsOpen] = (0, import_react59.useState)(false);
|
|
14546
|
+
const anchorRef = (0, import_react59.useRef)(null);
|
|
14547
|
+
const containerRef = (0, import_react59.useRef)(null);
|
|
14578
14548
|
const position = useFloatingElement({
|
|
14579
14549
|
active: isOpen,
|
|
14580
14550
|
anchorRef,
|
|
@@ -14588,15 +14558,15 @@ var DateTimeInput = ({
|
|
|
14588
14558
|
onEditComplete(value);
|
|
14589
14559
|
});
|
|
14590
14560
|
const { zIndex } = useOverlayRegistry({ isActive: isOpen });
|
|
14591
|
-
const isReadOnly = (0,
|
|
14592
|
-
(0,
|
|
14561
|
+
const isReadOnly = (0, import_react59.useMemo)(() => props.readOnly || props.disabled, [props.readOnly, props.disabled]);
|
|
14562
|
+
(0, import_react59.useEffect)(() => {
|
|
14593
14563
|
if (isReadOnly) {
|
|
14594
14564
|
setIsOpen(false);
|
|
14595
14565
|
}
|
|
14596
14566
|
}, [isReadOnly]);
|
|
14597
|
-
return /* @__PURE__ */ (0,
|
|
14598
|
-
/* @__PURE__ */ (0,
|
|
14599
|
-
/* @__PURE__ */ (0,
|
|
14567
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
|
|
14568
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { ...containerProps, ref: anchorRef, className: (0, import_clsx33.default)("relative w-full", containerProps?.className), children: [
|
|
14569
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14600
14570
|
Input,
|
|
14601
14571
|
{
|
|
14602
14572
|
...props,
|
|
@@ -14614,7 +14584,7 @@ var DateTimeInput = ({
|
|
|
14614
14584
|
)
|
|
14615
14585
|
}
|
|
14616
14586
|
),
|
|
14617
|
-
/* @__PURE__ */ (0,
|
|
14587
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14618
14588
|
Button,
|
|
14619
14589
|
{
|
|
14620
14590
|
coloringStyle: "text",
|
|
@@ -14624,12 +14594,12 @@ var DateTimeInput = ({
|
|
|
14624
14594
|
className: "absolute right-1 top-1/2 -translate-y-1/2",
|
|
14625
14595
|
disabled: isReadOnly,
|
|
14626
14596
|
onClick: () => setIsOpen((prevState) => !prevState),
|
|
14627
|
-
children: /* @__PURE__ */ (0,
|
|
14597
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_lucide_react19.CalendarIcon, { className: "size-5" })
|
|
14628
14598
|
}
|
|
14629
14599
|
)
|
|
14630
14600
|
] }),
|
|
14631
|
-
/* @__PURE__ */ (0,
|
|
14632
|
-
/* @__PURE__ */ (0,
|
|
14601
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Visibility, { isVisible: isOpen, children: (0, import_react_dom8.createPortal)(
|
|
14602
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
|
|
14633
14603
|
"div",
|
|
14634
14604
|
{
|
|
14635
14605
|
ref: containerRef,
|
|
@@ -14640,7 +14610,7 @@ var DateTimeInput = ({
|
|
|
14640
14610
|
opacity: position ? void 0 : 0
|
|
14641
14611
|
},
|
|
14642
14612
|
children: [
|
|
14643
|
-
/* @__PURE__ */ (0,
|
|
14613
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14644
14614
|
DateTimePicker,
|
|
14645
14615
|
{
|
|
14646
14616
|
...pickerProps,
|
|
@@ -14650,8 +14620,8 @@ var DateTimeInput = ({
|
|
|
14650
14620
|
onEditComplete
|
|
14651
14621
|
}
|
|
14652
14622
|
),
|
|
14653
|
-
/* @__PURE__ */ (0,
|
|
14654
|
-
/* @__PURE__ */ (0,
|
|
14623
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
14624
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Visibility, { isVisible: !!onRemove && !!value, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14655
14625
|
Button,
|
|
14656
14626
|
{
|
|
14657
14627
|
size: "md",
|
|
@@ -14664,7 +14634,7 @@ var DateTimeInput = ({
|
|
|
14664
14634
|
children: translation("clear")
|
|
14665
14635
|
}
|
|
14666
14636
|
) }),
|
|
14667
|
-
/* @__PURE__ */ (0,
|
|
14637
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(Visibility, { isVisible: !value, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14668
14638
|
Button,
|
|
14669
14639
|
{
|
|
14670
14640
|
size: "md",
|
|
@@ -14674,7 +14644,7 @@ var DateTimeInput = ({
|
|
|
14674
14644
|
children: translation("cancel")
|
|
14675
14645
|
}
|
|
14676
14646
|
) }),
|
|
14677
|
-
/* @__PURE__ */ (0,
|
|
14647
|
+
/* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14678
14648
|
Button,
|
|
14679
14649
|
{
|
|
14680
14650
|
size: "md",
|
|
@@ -14699,7 +14669,7 @@ var DateTimeInputUncontrolled = ({
|
|
|
14699
14669
|
...props
|
|
14700
14670
|
}) => {
|
|
14701
14671
|
const [value, setValue] = useOverwritableState(initialValue);
|
|
14702
|
-
return /* @__PURE__ */ (0,
|
|
14672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14703
14673
|
DateTimeInput,
|
|
14704
14674
|
{
|
|
14705
14675
|
...props,
|
|
@@ -14717,21 +14687,21 @@ var DateTimeInputUncontrolled = ({
|
|
|
14717
14687
|
};
|
|
14718
14688
|
|
|
14719
14689
|
// src/components/user-interaction/input/InsideLabelInput.tsx
|
|
14720
|
-
var
|
|
14721
|
-
var
|
|
14690
|
+
var import_react60 = require("react");
|
|
14691
|
+
var import_react61 = require("react");
|
|
14722
14692
|
var import_clsx34 = __toESM(require("clsx"));
|
|
14723
|
-
var
|
|
14724
|
-
var InsideLabelInput = (0,
|
|
14693
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14694
|
+
var InsideLabelInput = (0, import_react61.forwardRef)(function InsideLabelInput2({
|
|
14725
14695
|
id: customId,
|
|
14726
14696
|
label,
|
|
14727
14697
|
...props
|
|
14728
14698
|
}, forwardedRef) {
|
|
14729
14699
|
const { value } = props;
|
|
14730
|
-
const [isFocused, setIsFocused] = (0,
|
|
14731
|
-
const generatedId = (0,
|
|
14700
|
+
const [isFocused, setIsFocused] = (0, import_react61.useState)(false);
|
|
14701
|
+
const generatedId = (0, import_react60.useId)();
|
|
14732
14702
|
const id = customId ?? generatedId;
|
|
14733
|
-
return /* @__PURE__ */ (0,
|
|
14734
|
-
/* @__PURE__ */ (0,
|
|
14703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)("div", { className: (0, import_clsx34.default)("relative"), children: [
|
|
14704
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14735
14705
|
Input,
|
|
14736
14706
|
{
|
|
14737
14707
|
...props,
|
|
@@ -14749,7 +14719,7 @@ var InsideLabelInput = (0, import_react57.forwardRef)(function InsideLabelInput2
|
|
|
14749
14719
|
}
|
|
14750
14720
|
}
|
|
14751
14721
|
),
|
|
14752
|
-
/* @__PURE__ */ (0,
|
|
14722
|
+
/* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14753
14723
|
"label",
|
|
14754
14724
|
{
|
|
14755
14725
|
id: id + "-label",
|
|
@@ -14771,7 +14741,7 @@ var InsideLabelInputUncontrolled = ({
|
|
|
14771
14741
|
...props
|
|
14772
14742
|
}) => {
|
|
14773
14743
|
const [value, setValue] = useOverwritableState(initialValue, props.onValueChange);
|
|
14774
|
-
return /* @__PURE__ */ (0,
|
|
14744
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
|
|
14775
14745
|
InsideLabelInput,
|
|
14776
14746
|
{
|
|
14777
14747
|
...props,
|
|
@@ -14784,7 +14754,7 @@ var InsideLabelInputUncontrolled = ({
|
|
|
14784
14754
|
// src/components/user-interaction/input/SearchBar.tsx
|
|
14785
14755
|
var import_lucide_react20 = require("lucide-react");
|
|
14786
14756
|
var import_clsx35 = require("clsx");
|
|
14787
|
-
var
|
|
14757
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
14788
14758
|
var SearchBar = ({
|
|
14789
14759
|
value: initialValue,
|
|
14790
14760
|
onSearch,
|
|
@@ -14795,8 +14765,8 @@ var SearchBar = ({
|
|
|
14795
14765
|
}) => {
|
|
14796
14766
|
const translation = useHightideTranslation();
|
|
14797
14767
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14798
|
-
return /* @__PURE__ */ (0,
|
|
14799
|
-
/* @__PURE__ */ (0,
|
|
14768
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { ...containerProps, className: (0, import_clsx35.clsx)("relative", containerProps?.className), children: [
|
|
14769
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14800
14770
|
InputUncontrolled,
|
|
14801
14771
|
{
|
|
14802
14772
|
...inputProps,
|
|
@@ -14807,7 +14777,7 @@ var SearchBar = ({
|
|
|
14807
14777
|
className: (0, import_clsx35.clsx)("pr-10 w-full", inputProps.className)
|
|
14808
14778
|
}
|
|
14809
14779
|
),
|
|
14810
|
-
/* @__PURE__ */ (0,
|
|
14780
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14811
14781
|
Button,
|
|
14812
14782
|
{
|
|
14813
14783
|
...searchButtonProps,
|
|
@@ -14817,33 +14787,33 @@ var SearchBar = ({
|
|
|
14817
14787
|
coloringStyle: "text",
|
|
14818
14788
|
onClick: () => onSearch(value),
|
|
14819
14789
|
className: (0, import_clsx35.clsx)("absolute right-1 top-1/2 -translate-y-1/2", searchButtonProps?.className),
|
|
14820
|
-
children: /* @__PURE__ */ (0,
|
|
14790
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react20.Search, { className: "w-full h-full" })
|
|
14821
14791
|
}
|
|
14822
14792
|
)
|
|
14823
14793
|
] });
|
|
14824
14794
|
};
|
|
14825
14795
|
|
|
14826
14796
|
// src/components/user-interaction/input/ToggleableInput.tsx
|
|
14827
|
-
var
|
|
14797
|
+
var import_react62 = require("react");
|
|
14828
14798
|
var import_lucide_react21 = require("lucide-react");
|
|
14829
14799
|
var import_clsx36 = __toESM(require("clsx"));
|
|
14830
|
-
var
|
|
14831
|
-
var ToggleableInput = (0,
|
|
14800
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
14801
|
+
var ToggleableInput = (0, import_react62.forwardRef)(function ToggleableInput2({
|
|
14832
14802
|
value,
|
|
14833
14803
|
initialState = "display",
|
|
14834
14804
|
editCompleteOptions,
|
|
14835
14805
|
...props
|
|
14836
14806
|
}, forwardedRef) {
|
|
14837
|
-
const [isEditing, setIsEditing] = (0,
|
|
14838
|
-
const innerRef = (0,
|
|
14839
|
-
(0,
|
|
14840
|
-
(0,
|
|
14807
|
+
const [isEditing, setIsEditing] = (0, import_react62.useState)(initialState !== "display");
|
|
14808
|
+
const innerRef = (0, import_react62.useRef)(null);
|
|
14809
|
+
(0, import_react62.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
14810
|
+
(0, import_react62.useEffect)(() => {
|
|
14841
14811
|
if (isEditing) {
|
|
14842
14812
|
innerRef.current?.focus();
|
|
14843
14813
|
}
|
|
14844
14814
|
}, [isEditing]);
|
|
14845
|
-
return /* @__PURE__ */ (0,
|
|
14846
|
-
/* @__PURE__ */ (0,
|
|
14815
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: (0, import_clsx36.default)("relative flex-row-2", { "flex-1": isEditing }), children: [
|
|
14816
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
14847
14817
|
Input,
|
|
14848
14818
|
{
|
|
14849
14819
|
...props,
|
|
@@ -14869,9 +14839,9 @@ var ToggleableInput = (0, import_react58.forwardRef)(function ToggleableInput2({
|
|
|
14869
14839
|
})
|
|
14870
14840
|
}
|
|
14871
14841
|
),
|
|
14872
|
-
!isEditing && /* @__PURE__ */ (0,
|
|
14873
|
-
/* @__PURE__ */ (0,
|
|
14874
|
-
/* @__PURE__ */ (0,
|
|
14842
|
+
!isEditing && /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
|
|
14843
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)("span", { className: (0, import_clsx36.default)(" truncate"), children: value }),
|
|
14844
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_lucide_react21.Pencil, { className: (0, import_clsx36.default)(`size-force-4`, { "text-transparent": isEditing }) })
|
|
14875
14845
|
] })
|
|
14876
14846
|
] });
|
|
14877
14847
|
});
|
|
@@ -14881,7 +14851,7 @@ var ToggleableInputUncontrolled = ({
|
|
|
14881
14851
|
...restProps
|
|
14882
14852
|
}) => {
|
|
14883
14853
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14884
|
-
return /* @__PURE__ */ (0,
|
|
14854
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
14885
14855
|
ToggleableInput,
|
|
14886
14856
|
{
|
|
14887
14857
|
value,
|
|
@@ -14896,7 +14866,7 @@ var import_lucide_react23 = require("lucide-react");
|
|
|
14896
14866
|
|
|
14897
14867
|
// src/components/user-interaction/properties/PropertyBase.tsx
|
|
14898
14868
|
var import_lucide_react22 = require("lucide-react");
|
|
14899
|
-
var
|
|
14869
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
14900
14870
|
var PropertyBase = ({
|
|
14901
14871
|
name: name2,
|
|
14902
14872
|
children,
|
|
@@ -14915,29 +14885,29 @@ var PropertyBase = ({
|
|
|
14915
14885
|
const isClearEnabled = allowClear && !readOnly;
|
|
14916
14886
|
const isRemoveEnabled = allowRemove && !readOnly;
|
|
14917
14887
|
const showActionsContainer = isClearEnabled || isRemoveEnabled;
|
|
14918
|
-
return /* @__PURE__ */ (0,
|
|
14888
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
14919
14889
|
"div",
|
|
14920
14890
|
{
|
|
14921
14891
|
className: className ? `group/property ${className}` : "group/property",
|
|
14922
14892
|
"data-name": "property-root",
|
|
14923
14893
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14924
14894
|
children: [
|
|
14925
|
-
/* @__PURE__ */ (0,
|
|
14895
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
14926
14896
|
"div",
|
|
14927
14897
|
{
|
|
14928
14898
|
className,
|
|
14929
14899
|
"data-name": "property-title",
|
|
14930
14900
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14931
14901
|
children: [
|
|
14932
|
-
/* @__PURE__ */ (0,
|
|
14933
|
-
/* @__PURE__ */ (0,
|
|
14934
|
-
/* @__PURE__ */ (0,
|
|
14902
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Tooltip, { tooltip: name2, containerClassName: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex-row-1 items-center", children: [
|
|
14903
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { "data-name": "property-title-icon", children: icon }),
|
|
14904
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { "data-name": "property-title-text", children: name2 })
|
|
14935
14905
|
] }) }),
|
|
14936
|
-
invalid && /* @__PURE__ */ (0,
|
|
14906
|
+
invalid && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react22.AlertTriangle, { className: "size-force-6" })
|
|
14937
14907
|
]
|
|
14938
14908
|
}
|
|
14939
14909
|
),
|
|
14940
|
-
/* @__PURE__ */ (0,
|
|
14910
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
|
|
14941
14911
|
"div",
|
|
14942
14912
|
{
|
|
14943
14913
|
className,
|
|
@@ -14945,8 +14915,8 @@ var PropertyBase = ({
|
|
|
14945
14915
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14946
14916
|
children: [
|
|
14947
14917
|
children({ required, hasValue, invalid }),
|
|
14948
|
-
showActionsContainer && /* @__PURE__ */ (0,
|
|
14949
|
-
isClearEnabled && /* @__PURE__ */ (0,
|
|
14918
|
+
showActionsContainer && /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { "data-name": "property-actions", children: [
|
|
14919
|
+
isClearEnabled && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Tooltip, { tooltip: translation("clearValue"), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
14950
14920
|
Button,
|
|
14951
14921
|
{
|
|
14952
14922
|
onClick: onValueClear,
|
|
@@ -14955,10 +14925,10 @@ var PropertyBase = ({
|
|
|
14955
14925
|
coloringStyle: "text",
|
|
14956
14926
|
layout: "icon",
|
|
14957
14927
|
size: "sm",
|
|
14958
|
-
children: /* @__PURE__ */ (0,
|
|
14928
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react22.X, { className: "size-force-5" })
|
|
14959
14929
|
}
|
|
14960
14930
|
) }),
|
|
14961
|
-
isRemoveEnabled && /* @__PURE__ */ (0,
|
|
14931
|
+
isRemoveEnabled && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Tooltip, { tooltip: translation("removeProperty"), children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
14962
14932
|
Button,
|
|
14963
14933
|
{
|
|
14964
14934
|
onClick: onRemove,
|
|
@@ -14966,7 +14936,7 @@ var PropertyBase = ({
|
|
|
14966
14936
|
coloringStyle: "text",
|
|
14967
14937
|
layout: "icon",
|
|
14968
14938
|
size: "sm",
|
|
14969
|
-
children: /* @__PURE__ */ (0,
|
|
14939
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react22.Trash, { className: "size-force-5" })
|
|
14970
14940
|
}
|
|
14971
14941
|
) })
|
|
14972
14942
|
] })
|
|
@@ -14979,7 +14949,7 @@ var PropertyBase = ({
|
|
|
14979
14949
|
};
|
|
14980
14950
|
|
|
14981
14951
|
// src/components/user-interaction/properties/CheckboxProperty.tsx
|
|
14982
|
-
var
|
|
14952
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
14983
14953
|
var CheckboxProperty = ({
|
|
14984
14954
|
value,
|
|
14985
14955
|
onValueChange,
|
|
@@ -14988,15 +14958,15 @@ var CheckboxProperty = ({
|
|
|
14988
14958
|
...baseProps
|
|
14989
14959
|
}) => {
|
|
14990
14960
|
const translation = useHightideTranslation();
|
|
14991
|
-
return /* @__PURE__ */ (0,
|
|
14961
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
14992
14962
|
PropertyBase,
|
|
14993
14963
|
{
|
|
14994
14964
|
...baseProps,
|
|
14995
14965
|
hasValue: value !== void 0,
|
|
14996
14966
|
readOnly,
|
|
14997
|
-
icon: /* @__PURE__ */ (0,
|
|
14998
|
-
children: () => /* @__PURE__ */ (0,
|
|
14999
|
-
/* @__PURE__ */ (0,
|
|
14967
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_lucide_react23.Check, { size: 24 }),
|
|
14968
|
+
children: () => /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
14969
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
15000
14970
|
Button,
|
|
15001
14971
|
{
|
|
15002
14972
|
color: value ? "positive" : "neutral",
|
|
@@ -15009,7 +14979,7 @@ var CheckboxProperty = ({
|
|
|
15009
14979
|
children: translation("yes")
|
|
15010
14980
|
}
|
|
15011
14981
|
),
|
|
15012
|
-
/* @__PURE__ */ (0,
|
|
14982
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
15013
14983
|
Button,
|
|
15014
14984
|
{
|
|
15015
14985
|
color: !value && value !== void 0 ? "negative" : "neutral",
|
|
@@ -15029,7 +14999,7 @@ var CheckboxProperty = ({
|
|
|
15029
14999
|
|
|
15030
15000
|
// src/components/user-interaction/properties/DateProperty.tsx
|
|
15031
15001
|
var import_lucide_react24 = require("lucide-react");
|
|
15032
|
-
var
|
|
15002
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
15033
15003
|
var DateProperty = ({
|
|
15034
15004
|
value,
|
|
15035
15005
|
onValueChange,
|
|
@@ -15039,13 +15009,13 @@ var DateProperty = ({
|
|
|
15039
15009
|
...baseProps
|
|
15040
15010
|
}) => {
|
|
15041
15011
|
const hasValue = !!value;
|
|
15042
|
-
return /* @__PURE__ */ (0,
|
|
15012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
15043
15013
|
PropertyBase,
|
|
15044
15014
|
{
|
|
15045
15015
|
...baseProps,
|
|
15046
15016
|
hasValue,
|
|
15047
|
-
icon: /* @__PURE__ */ (0,
|
|
15048
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15017
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react24.CalendarDays, { size: 24 }),
|
|
15018
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
15049
15019
|
DateTimeInput,
|
|
15050
15020
|
{
|
|
15051
15021
|
value,
|
|
@@ -15062,8 +15032,130 @@ var DateProperty = ({
|
|
|
15062
15032
|
};
|
|
15063
15033
|
|
|
15064
15034
|
// src/components/user-interaction/properties/MultiSelectProperty.tsx
|
|
15035
|
+
var import_lucide_react26 = require("lucide-react");
|
|
15036
|
+
|
|
15037
|
+
// src/components/user-interaction/select/MultiSelectChipDisplay.tsx
|
|
15038
|
+
var import_react63 = require("react");
|
|
15065
15039
|
var import_lucide_react25 = require("lucide-react");
|
|
15066
|
-
var
|
|
15040
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
15041
|
+
var MultiSelectChipDisplayButton = (0, import_react63.forwardRef)(function MultiSelectChipDisplayButton2({
|
|
15042
|
+
id,
|
|
15043
|
+
...props
|
|
15044
|
+
}, ref) {
|
|
15045
|
+
const { state, trigger, item, ids, setIds } = useSelectContext();
|
|
15046
|
+
const { register, unregister, toggleOpen } = trigger;
|
|
15047
|
+
(0, import_react63.useEffect)(() => {
|
|
15048
|
+
if (id) {
|
|
15049
|
+
setIds((prev) => ({
|
|
15050
|
+
...prev,
|
|
15051
|
+
trigger: id
|
|
15052
|
+
}));
|
|
15053
|
+
}
|
|
15054
|
+
}, [id, setIds]);
|
|
15055
|
+
const innerRef = (0, import_react63.useRef)(null);
|
|
15056
|
+
(0, import_react63.useImperativeHandle)(ref, () => innerRef.current);
|
|
15057
|
+
(0, import_react63.useEffect)(() => {
|
|
15058
|
+
register(innerRef);
|
|
15059
|
+
return () => unregister();
|
|
15060
|
+
}, [register, unregister]);
|
|
15061
|
+
const disabled = !!props?.disabled || !!state.disabled;
|
|
15062
|
+
const invalid = state.invalid;
|
|
15063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(
|
|
15064
|
+
"div",
|
|
15065
|
+
{
|
|
15066
|
+
...props,
|
|
15067
|
+
ref: innerRef,
|
|
15068
|
+
onClick: (event) => {
|
|
15069
|
+
toggleOpen();
|
|
15070
|
+
props.onClick?.(event);
|
|
15071
|
+
},
|
|
15072
|
+
"data-name": props["data-name"] ?? "select-button-chips",
|
|
15073
|
+
"data-value": state.value.length > 0 ? "" : void 0,
|
|
15074
|
+
"data-disabled": disabled ? "" : void 0,
|
|
15075
|
+
"data-invalid": invalid ? "" : void 0,
|
|
15076
|
+
"aria-invalid": invalid,
|
|
15077
|
+
"aria-disabled": disabled,
|
|
15078
|
+
children: [
|
|
15079
|
+
state.selectedOptions.map(({ value, label }) => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Chip, { className: "gap-x-2", children: [
|
|
15080
|
+
label,
|
|
15081
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
15082
|
+
Button,
|
|
15083
|
+
{
|
|
15084
|
+
onClick: () => {
|
|
15085
|
+
item.toggleSelection(value, false);
|
|
15086
|
+
},
|
|
15087
|
+
size: "xs",
|
|
15088
|
+
color: "negative",
|
|
15089
|
+
coloringStyle: "text",
|
|
15090
|
+
layout: "icon",
|
|
15091
|
+
className: "flex-row-0 items-center",
|
|
15092
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_lucide_react25.XIcon, { className: "size-5" })
|
|
15093
|
+
}
|
|
15094
|
+
)
|
|
15095
|
+
] }, value)),
|
|
15096
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
15097
|
+
Button,
|
|
15098
|
+
{
|
|
15099
|
+
id: ids.trigger,
|
|
15100
|
+
onClick: (event) => {
|
|
15101
|
+
event.stopPropagation();
|
|
15102
|
+
toggleOpen();
|
|
15103
|
+
},
|
|
15104
|
+
onKeyDown: (event) => {
|
|
15105
|
+
switch (event.key) {
|
|
15106
|
+
case "ArrowDown":
|
|
15107
|
+
toggleOpen(true, { highlightStartPositionBehavior: "first" });
|
|
15108
|
+
break;
|
|
15109
|
+
case "ArrowUp":
|
|
15110
|
+
toggleOpen(true, { highlightStartPositionBehavior: "last" });
|
|
15111
|
+
}
|
|
15112
|
+
},
|
|
15113
|
+
layout: "icon",
|
|
15114
|
+
size: "sm",
|
|
15115
|
+
color: "neutral",
|
|
15116
|
+
"aria-invalid": invalid,
|
|
15117
|
+
"aria-disabled": disabled,
|
|
15118
|
+
"aria-haspopup": "listbox",
|
|
15119
|
+
"aria-expanded": state.isOpen,
|
|
15120
|
+
"aria-controls": state.isOpen ? ids.content : void 0,
|
|
15121
|
+
className: "size-9",
|
|
15122
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_lucide_react25.Plus, {})
|
|
15123
|
+
}
|
|
15124
|
+
)
|
|
15125
|
+
]
|
|
15126
|
+
}
|
|
15127
|
+
);
|
|
15128
|
+
});
|
|
15129
|
+
var MultiSelectChipDisplay = (0, import_react63.forwardRef)(function MultiSelectChipDisplay2({
|
|
15130
|
+
children,
|
|
15131
|
+
contentPanelProps,
|
|
15132
|
+
chipDisplayProps,
|
|
15133
|
+
...props
|
|
15134
|
+
}, ref) {
|
|
15135
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(MultiSelectRoot, { ...props, children: [
|
|
15136
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(MultiSelectChipDisplayButton, { ref, ...chipDisplayProps }),
|
|
15137
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(MultiSelectContent, { ...contentPanelProps, children })
|
|
15138
|
+
] });
|
|
15139
|
+
});
|
|
15140
|
+
var MultiSelectChipDisplayUncontrolled = (0, import_react63.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
|
|
15141
|
+
value: initialValue,
|
|
15142
|
+
onValueChange,
|
|
15143
|
+
...props
|
|
15144
|
+
}, ref) {
|
|
15145
|
+
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
15146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
15147
|
+
MultiSelectChipDisplay,
|
|
15148
|
+
{
|
|
15149
|
+
...props,
|
|
15150
|
+
ref,
|
|
15151
|
+
value,
|
|
15152
|
+
onValueChange: setValue
|
|
15153
|
+
}
|
|
15154
|
+
);
|
|
15155
|
+
});
|
|
15156
|
+
|
|
15157
|
+
// src/components/user-interaction/properties/MultiSelectProperty.tsx
|
|
15158
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
15067
15159
|
var MultiSelectProperty = ({
|
|
15068
15160
|
children,
|
|
15069
15161
|
value,
|
|
@@ -15072,18 +15164,18 @@ var MultiSelectProperty = ({
|
|
|
15072
15164
|
...props
|
|
15073
15165
|
}) => {
|
|
15074
15166
|
const hasValue = value.length > 0;
|
|
15075
|
-
return /* @__PURE__ */ (0,
|
|
15167
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
15076
15168
|
PropertyBase,
|
|
15077
15169
|
{
|
|
15078
15170
|
...props,
|
|
15079
15171
|
hasValue,
|
|
15080
|
-
icon: /* @__PURE__ */ (0,
|
|
15081
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15172
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react26.List, { size: 24 }),
|
|
15173
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
15082
15174
|
"div",
|
|
15083
15175
|
{
|
|
15084
15176
|
"data-name": "property-input-wrapper",
|
|
15085
15177
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
15086
|
-
children: /* @__PURE__ */ (0,
|
|
15178
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
15087
15179
|
MultiSelectChipDisplay,
|
|
15088
15180
|
{
|
|
15089
15181
|
value,
|
|
@@ -15108,8 +15200,8 @@ var MultiSelectProperty = ({
|
|
|
15108
15200
|
};
|
|
15109
15201
|
|
|
15110
15202
|
// src/components/user-interaction/properties/NumberProperty.tsx
|
|
15111
|
-
var
|
|
15112
|
-
var
|
|
15203
|
+
var import_lucide_react27 = require("lucide-react");
|
|
15204
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
15113
15205
|
var NumberProperty = ({
|
|
15114
15206
|
value,
|
|
15115
15207
|
onRemove,
|
|
@@ -15121,20 +15213,20 @@ var NumberProperty = ({
|
|
|
15121
15213
|
}) => {
|
|
15122
15214
|
const translation = useHightideTranslation();
|
|
15123
15215
|
const hasValue = value !== void 0;
|
|
15124
|
-
return /* @__PURE__ */ (0,
|
|
15216
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15125
15217
|
PropertyBase,
|
|
15126
15218
|
{
|
|
15127
15219
|
...baseProps,
|
|
15128
15220
|
onRemove,
|
|
15129
15221
|
hasValue,
|
|
15130
|
-
icon: /* @__PURE__ */ (0,
|
|
15131
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15222
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react27.Binary, { size: 24 }),
|
|
15223
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
|
|
15132
15224
|
"div",
|
|
15133
15225
|
{
|
|
15134
15226
|
"data-name": "property-input-wrapper",
|
|
15135
15227
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
15136
15228
|
children: [
|
|
15137
|
-
/* @__PURE__ */ (0,
|
|
15229
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15138
15230
|
Input,
|
|
15139
15231
|
{
|
|
15140
15232
|
className: "w-full pr-8",
|
|
@@ -15162,7 +15254,7 @@ var NumberProperty = ({
|
|
|
15162
15254
|
}
|
|
15163
15255
|
}
|
|
15164
15256
|
),
|
|
15165
|
-
suffix && /* @__PURE__ */ (0,
|
|
15257
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15166
15258
|
"span",
|
|
15167
15259
|
{
|
|
15168
15260
|
"data-name": "property-suffix",
|
|
@@ -15178,8 +15270,8 @@ var NumberProperty = ({
|
|
|
15178
15270
|
};
|
|
15179
15271
|
|
|
15180
15272
|
// src/components/user-interaction/properties/SelectProperty.tsx
|
|
15181
|
-
var
|
|
15182
|
-
var
|
|
15273
|
+
var import_lucide_react28 = require("lucide-react");
|
|
15274
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
15183
15275
|
var SingleSelectProperty = ({
|
|
15184
15276
|
children,
|
|
15185
15277
|
value,
|
|
@@ -15188,18 +15280,18 @@ var SingleSelectProperty = ({
|
|
|
15188
15280
|
...props
|
|
15189
15281
|
}) => {
|
|
15190
15282
|
const hasValue = value !== void 0;
|
|
15191
|
-
return /* @__PURE__ */ (0,
|
|
15283
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15192
15284
|
PropertyBase,
|
|
15193
15285
|
{
|
|
15194
15286
|
...props,
|
|
15195
15287
|
hasValue,
|
|
15196
|
-
icon: /* @__PURE__ */ (0,
|
|
15197
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15288
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react28.List, { size: 24 }),
|
|
15289
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15198
15290
|
"div",
|
|
15199
15291
|
{
|
|
15200
15292
|
"data-name": "property-input-wrapper",
|
|
15201
15293
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
15202
|
-
children: /* @__PURE__ */ (0,
|
|
15294
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15203
15295
|
Select,
|
|
15204
15296
|
{
|
|
15205
15297
|
value,
|
|
@@ -15221,8 +15313,8 @@ var SingleSelectProperty = ({
|
|
|
15221
15313
|
};
|
|
15222
15314
|
|
|
15223
15315
|
// src/components/user-interaction/properties/TextProperty.tsx
|
|
15224
|
-
var
|
|
15225
|
-
var
|
|
15316
|
+
var import_lucide_react29 = require("lucide-react");
|
|
15317
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
15226
15318
|
var TextProperty = ({
|
|
15227
15319
|
value,
|
|
15228
15320
|
readOnly,
|
|
@@ -15233,14 +15325,14 @@ var TextProperty = ({
|
|
|
15233
15325
|
}) => {
|
|
15234
15326
|
const translation = useHightideTranslation();
|
|
15235
15327
|
const hasValue = value !== void 0;
|
|
15236
|
-
return /* @__PURE__ */ (0,
|
|
15328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
15237
15329
|
PropertyBase,
|
|
15238
15330
|
{
|
|
15239
15331
|
...baseProps,
|
|
15240
15332
|
onRemove,
|
|
15241
15333
|
hasValue,
|
|
15242
|
-
icon: /* @__PURE__ */ (0,
|
|
15243
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15334
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_lucide_react29.Text, { size: 24 }),
|
|
15335
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
15244
15336
|
Textarea,
|
|
15245
15337
|
{
|
|
15246
15338
|
className: "w-full",
|
|
@@ -15270,34 +15362,65 @@ var TextProperty = ({
|
|
|
15270
15362
|
);
|
|
15271
15363
|
};
|
|
15272
15364
|
|
|
15365
|
+
// src/components/user-interaction/select/MultiSelect.tsx
|
|
15366
|
+
var import_react64 = require("react");
|
|
15367
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
15368
|
+
var MultiSelect = (0, import_react64.forwardRef)(function MultiSelect2({
|
|
15369
|
+
children,
|
|
15370
|
+
contentPanelProps,
|
|
15371
|
+
buttonProps,
|
|
15372
|
+
...props
|
|
15373
|
+
}, ref) {
|
|
15374
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(MultiSelectRoot, { ...props, children: [
|
|
15375
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(MultiSelectButton, { ref, ...buttonProps }),
|
|
15376
|
+
/* @__PURE__ */ (0, import_jsx_runtime77.jsx)(MultiSelectContent, { ...contentPanelProps, children })
|
|
15377
|
+
] });
|
|
15378
|
+
});
|
|
15379
|
+
var MultiSelectUncontrolled = (0, import_react64.forwardRef)(function MultiSelectUncontrolled2({
|
|
15380
|
+
value: initialValue,
|
|
15381
|
+
onValueChange,
|
|
15382
|
+
...props
|
|
15383
|
+
}, ref) {
|
|
15384
|
+
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
15385
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15386
|
+
MultiSelect,
|
|
15387
|
+
{
|
|
15388
|
+
...props,
|
|
15389
|
+
ref,
|
|
15390
|
+
value,
|
|
15391
|
+
onValueChange: setValue
|
|
15392
|
+
}
|
|
15393
|
+
);
|
|
15394
|
+
});
|
|
15395
|
+
|
|
15273
15396
|
// src/components/utils/FocusTrap.tsx
|
|
15274
|
-
var
|
|
15275
|
-
var
|
|
15276
|
-
var
|
|
15277
|
-
var
|
|
15278
|
-
var FocusTrap = (0,
|
|
15397
|
+
var import_react65 = require("react");
|
|
15398
|
+
var import_react66 = require("react");
|
|
15399
|
+
var import_react67 = require("react");
|
|
15400
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
15401
|
+
var FocusTrap = (0, import_react67.forwardRef)(function FocusTrap2({
|
|
15279
15402
|
active = true,
|
|
15280
15403
|
initialFocus,
|
|
15281
15404
|
focusFirst = false,
|
|
15282
15405
|
...props
|
|
15283
15406
|
}, forwardedRef) {
|
|
15284
|
-
const innerRef = (0,
|
|
15285
|
-
(0,
|
|
15407
|
+
const innerRef = (0, import_react65.useRef)(null);
|
|
15408
|
+
(0, import_react66.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
15286
15409
|
useFocusTrap({ container: innerRef, active, initialFocus, focusFirst });
|
|
15287
|
-
return /* @__PURE__ */ (0,
|
|
15410
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { ref: innerRef, ...props });
|
|
15288
15411
|
});
|
|
15289
15412
|
|
|
15290
15413
|
// src/components/utils/Transition.tsx
|
|
15291
|
-
var
|
|
15414
|
+
var import_react68 = require("react");
|
|
15292
15415
|
function Transition({
|
|
15293
15416
|
children,
|
|
15294
15417
|
show,
|
|
15295
15418
|
includeAnimation = true
|
|
15296
15419
|
}) {
|
|
15297
|
-
const [isOpen, setIsOpen] = (0,
|
|
15298
|
-
const [isTransitioning, setIsTransitioning] = (0,
|
|
15420
|
+
const [isOpen, setIsOpen] = (0, import_react68.useState)(show);
|
|
15421
|
+
const [isTransitioning, setIsTransitioning] = (0, import_react68.useState)(!isOpen);
|
|
15299
15422
|
const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
|
|
15300
|
-
(0,
|
|
15423
|
+
(0, import_react68.useEffect)(() => {
|
|
15301
15424
|
setIsOpen(show);
|
|
15302
15425
|
setIsTransitioning(true);
|
|
15303
15426
|
}, [show]);
|
|
@@ -15322,18 +15445,18 @@ function Transition({
|
|
|
15322
15445
|
}
|
|
15323
15446
|
|
|
15324
15447
|
// src/contexts/HightideProvider.tsx
|
|
15325
|
-
var
|
|
15448
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
15326
15449
|
var HightideProvider = ({
|
|
15327
15450
|
children,
|
|
15328
15451
|
theme,
|
|
15329
15452
|
locale,
|
|
15330
15453
|
config
|
|
15331
15454
|
}) => {
|
|
15332
|
-
return /* @__PURE__ */ (0,
|
|
15455
|
+
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 }) }) });
|
|
15333
15456
|
};
|
|
15334
15457
|
|
|
15335
15458
|
// src/hooks/focus/useFocusGuards.ts
|
|
15336
|
-
var
|
|
15459
|
+
var import_react69 = require("react");
|
|
15337
15460
|
var selectorName = "data-hw-focus-guard";
|
|
15338
15461
|
function FocusGuard() {
|
|
15339
15462
|
const element = document.createElement("div");
|
|
@@ -15371,7 +15494,7 @@ var FocusGuardsService = class _FocusGuardsService {
|
|
|
15371
15494
|
}
|
|
15372
15495
|
};
|
|
15373
15496
|
var useFocusGuards = () => {
|
|
15374
|
-
(0,
|
|
15497
|
+
(0, import_react69.useEffect)(() => {
|
|
15375
15498
|
FocusGuardsService.getInstance().add();
|
|
15376
15499
|
return () => {
|
|
15377
15500
|
FocusGuardsService.getInstance().remove();
|
|
@@ -15380,10 +15503,10 @@ var useFocusGuards = () => {
|
|
|
15380
15503
|
};
|
|
15381
15504
|
|
|
15382
15505
|
// src/hooks/focus/useFocusOnceVisible.ts
|
|
15383
|
-
var
|
|
15506
|
+
var import_react70 = __toESM(require("react"));
|
|
15384
15507
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
15385
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
15386
|
-
(0,
|
|
15508
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react70.default.useState(false);
|
|
15509
|
+
(0, import_react70.useEffect)(() => {
|
|
15387
15510
|
if (disable || hasUsedFocus) {
|
|
15388
15511
|
return;
|
|
15389
15512
|
}
|
|
@@ -15403,13 +15526,13 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
15403
15526
|
};
|
|
15404
15527
|
|
|
15405
15528
|
// src/hooks/useRerender.ts
|
|
15406
|
-
var
|
|
15529
|
+
var import_react71 = require("react");
|
|
15407
15530
|
var useRerender = () => {
|
|
15408
|
-
return (0,
|
|
15531
|
+
return (0, import_react71.useReducer)(() => ({}), {})[1];
|
|
15409
15532
|
};
|
|
15410
15533
|
|
|
15411
15534
|
// src/hooks/useSearch.ts
|
|
15412
|
-
var
|
|
15535
|
+
var import_react72 = require("react");
|
|
15413
15536
|
|
|
15414
15537
|
// src/utils/simpleSearch.ts
|
|
15415
15538
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -15448,34 +15571,34 @@ var useSearch = ({
|
|
|
15448
15571
|
filter,
|
|
15449
15572
|
disabled = false
|
|
15450
15573
|
}) => {
|
|
15451
|
-
const [search, setSearch] = (0,
|
|
15452
|
-
const [result, setResult] = (0,
|
|
15453
|
-
const searchTags = (0,
|
|
15454
|
-
const updateSearch = (0,
|
|
15574
|
+
const [search, setSearch] = (0, import_react72.useState)(initialSearch ?? "");
|
|
15575
|
+
const [result, setResult] = (0, import_react72.useState)(list);
|
|
15576
|
+
const searchTags = (0, import_react72.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
15577
|
+
const updateSearch = (0, import_react72.useCallback)((newSearch) => {
|
|
15455
15578
|
const usedSearch = newSearch ?? search;
|
|
15456
15579
|
if (newSearch) {
|
|
15457
15580
|
setSearch(search);
|
|
15458
15581
|
}
|
|
15459
15582
|
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
15460
15583
|
}, [searchTags, list, search, searchMapping]);
|
|
15461
|
-
(0,
|
|
15584
|
+
(0, import_react72.useEffect)(() => {
|
|
15462
15585
|
if (isSearchInstant) {
|
|
15463
15586
|
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
15464
15587
|
}
|
|
15465
15588
|
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
15466
|
-
const filteredResult = (0,
|
|
15589
|
+
const filteredResult = (0, import_react72.useMemo)(() => {
|
|
15467
15590
|
if (!filter) {
|
|
15468
15591
|
return result;
|
|
15469
15592
|
}
|
|
15470
15593
|
return result.filter(filter);
|
|
15471
15594
|
}, [result, filter]);
|
|
15472
|
-
const sortedAndFilteredResult = (0,
|
|
15595
|
+
const sortedAndFilteredResult = (0, import_react72.useMemo)(() => {
|
|
15473
15596
|
if (!sortingFunction) {
|
|
15474
15597
|
return filteredResult;
|
|
15475
15598
|
}
|
|
15476
15599
|
return filteredResult.sort(sortingFunction);
|
|
15477
15600
|
}, [filteredResult, sortingFunction]);
|
|
15478
|
-
const usedResult = (0,
|
|
15601
|
+
const usedResult = (0, import_react72.useMemo)(() => {
|
|
15479
15602
|
if (!disabled) {
|
|
15480
15603
|
return sortedAndFilteredResult;
|
|
15481
15604
|
}
|
|
@@ -15497,7 +15620,7 @@ var validateEmail = (email) => {
|
|
|
15497
15620
|
};
|
|
15498
15621
|
|
|
15499
15622
|
// src/hooks/useValidators.ts
|
|
15500
|
-
var
|
|
15623
|
+
var import_react73 = require("react");
|
|
15501
15624
|
var notEmpty = (value) => {
|
|
15502
15625
|
if (!value) {
|
|
15503
15626
|
return "notEmpty";
|
|
@@ -15547,7 +15670,7 @@ var UseValidators = {
|
|
|
15547
15670
|
};
|
|
15548
15671
|
var useTranslatedValidators = () => {
|
|
15549
15672
|
const translation = useHightideTranslation();
|
|
15550
|
-
return (0,
|
|
15673
|
+
return (0, import_react73.useMemo)(() => ({
|
|
15551
15674
|
notEmpty: (value) => {
|
|
15552
15675
|
const result = notEmpty(value);
|
|
15553
15676
|
if (result) {
|
|
@@ -15885,9 +16008,14 @@ var PromiseUtils = {
|
|
|
15885
16008
|
MenuItem,
|
|
15886
16009
|
MultiSearchWithMapping,
|
|
15887
16010
|
MultiSelect,
|
|
16011
|
+
MultiSelectButton,
|
|
15888
16012
|
MultiSelectChipDisplay,
|
|
16013
|
+
MultiSelectChipDisplayButton,
|
|
15889
16014
|
MultiSelectChipDisplayUncontrolled,
|
|
16015
|
+
MultiSelectContent,
|
|
16016
|
+
MultiSelectOption,
|
|
15890
16017
|
MultiSelectProperty,
|
|
16018
|
+
MultiSelectRoot,
|
|
15891
16019
|
MultiSelectUncontrolled,
|
|
15892
16020
|
MultiSubjectSearchWithMapping,
|
|
15893
16021
|
Navigation,
|
|
@@ -15905,8 +16033,8 @@ var PromiseUtils = {
|
|
|
15905
16033
|
SearchBar,
|
|
15906
16034
|
Select,
|
|
15907
16035
|
SelectButton,
|
|
15908
|
-
SelectChipDisplay,
|
|
15909
16036
|
SelectContent,
|
|
16037
|
+
SelectContext,
|
|
15910
16038
|
SelectOption,
|
|
15911
16039
|
SelectRoot,
|
|
15912
16040
|
SelectUncontrolled,
|
|
@@ -15995,6 +16123,7 @@ var PromiseUtils = {
|
|
|
15995
16123
|
useRerender,
|
|
15996
16124
|
useResizeCallbackWrapper,
|
|
15997
16125
|
useSearch,
|
|
16126
|
+
useSelectContext,
|
|
15998
16127
|
useTabContext,
|
|
15999
16128
|
useTheme,
|
|
16000
16129
|
useTransitionState,
|