@helpwave/hightide 0.6.2 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +346 -204
- package/dist/index.d.ts +346 -204
- package/dist/index.js +877 -743
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +764 -645
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.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
|
}
|
|
@@ -9507,7 +9552,6 @@ var Expandable = (0, import_react21.forwardRef)(function Expandable2({
|
|
|
9507
9552
|
children,
|
|
9508
9553
|
id,
|
|
9509
9554
|
label,
|
|
9510
|
-
icon,
|
|
9511
9555
|
isExpanded,
|
|
9512
9556
|
onChange,
|
|
9513
9557
|
clickOnlyOnHeader = true,
|
|
@@ -9517,8 +9561,6 @@ var Expandable = (0, import_react21.forwardRef)(function Expandable2({
|
|
|
9517
9561
|
contentClassName,
|
|
9518
9562
|
contentExpandedClassName
|
|
9519
9563
|
}, ref) {
|
|
9520
|
-
const defaultIcon = (0, import_react21.useCallback)((expanded) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExpansionIcon, { isExpanded: expanded }), []);
|
|
9521
|
-
const iconBuilder = icon ?? defaultIcon;
|
|
9522
9564
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(
|
|
9523
9565
|
ExpandableRoot,
|
|
9524
9566
|
{
|
|
@@ -9530,10 +9572,7 @@ var Expandable = (0, import_react21.forwardRef)(function Expandable2({
|
|
|
9530
9572
|
allowContainerToggle: !clickOnlyOnHeader,
|
|
9531
9573
|
className,
|
|
9532
9574
|
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
|
-
] }),
|
|
9575
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExpandableHeader, { className: headerClassName, children: label }),
|
|
9537
9576
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ExpandableContext.Consumer, { children: (ctx) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
9538
9577
|
ExpandableContent,
|
|
9539
9578
|
{
|
|
@@ -9721,9 +9760,9 @@ var FloatingContainer = (0, import_react23.forwardRef)(function FloatingContaine
|
|
|
9721
9760
|
screenPadding = 16,
|
|
9722
9761
|
gap = 4,
|
|
9723
9762
|
...props
|
|
9724
|
-
},
|
|
9763
|
+
}, forwardRef16) {
|
|
9725
9764
|
const innerRef = (0, import_react23.useRef)(null);
|
|
9726
|
-
(0, import_react23.useImperativeHandle)(
|
|
9765
|
+
(0, import_react23.useImperativeHandle)(forwardRef16, () => innerRef.current);
|
|
9727
9766
|
const position = useFloatingElement({
|
|
9728
9767
|
active: !props.hidden,
|
|
9729
9768
|
containerRef: innerRef,
|
|
@@ -11055,11 +11094,8 @@ var InputDialog = ({
|
|
|
11055
11094
|
);
|
|
11056
11095
|
};
|
|
11057
11096
|
|
|
11058
|
-
// src/components/user-interaction/
|
|
11097
|
+
// src/components/user-interaction/select/SelectContext.tsx
|
|
11059
11098
|
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
11099
|
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
11064
11100
|
var defaultToggleOpenOptions = {
|
|
11065
11101
|
highlightStartPositionBehavior: "first"
|
|
@@ -11068,28 +11104,34 @@ var SelectContext = (0, import_react34.createContext)(null);
|
|
|
11068
11104
|
function useSelectContext() {
|
|
11069
11105
|
const ctx = (0, import_react34.useContext)(SelectContext);
|
|
11070
11106
|
if (!ctx) {
|
|
11071
|
-
throw new Error("
|
|
11107
|
+
throw new Error("useSelectContext must be used within a SelectRoot or MultiSelectRoot");
|
|
11072
11108
|
}
|
|
11073
11109
|
return ctx;
|
|
11074
11110
|
}
|
|
11075
|
-
var
|
|
11111
|
+
var PrimitveSelectRoot = ({
|
|
11076
11112
|
children,
|
|
11077
11113
|
id,
|
|
11078
11114
|
value,
|
|
11079
11115
|
onValueChange,
|
|
11080
11116
|
values,
|
|
11081
11117
|
onValuesChange,
|
|
11082
|
-
|
|
11118
|
+
onClose,
|
|
11119
|
+
initialIsOpen = false,
|
|
11083
11120
|
disabled = false,
|
|
11121
|
+
readOnly = false,
|
|
11122
|
+
required = false,
|
|
11084
11123
|
invalid = false,
|
|
11085
11124
|
isMultiSelect = false,
|
|
11086
11125
|
iconAppearance = "left"
|
|
11087
11126
|
}) => {
|
|
11088
11127
|
const triggerRef = (0, import_react34.useRef)(null);
|
|
11089
11128
|
const generatedId = (0, import_react34.useId)();
|
|
11090
|
-
const
|
|
11129
|
+
const [ids, setIds] = (0, import_react34.useState)({
|
|
11130
|
+
trigger: id ?? (isMultiSelect ? "multi-select-" + generatedId : "select-" + generatedId),
|
|
11131
|
+
content: isMultiSelect ? "multi-select-content-" + generatedId : "select-content-" + generatedId
|
|
11132
|
+
});
|
|
11091
11133
|
const [internalState, setInternalState] = (0, import_react34.useState)({
|
|
11092
|
-
isOpen,
|
|
11134
|
+
isOpen: initialIsOpen,
|
|
11093
11135
|
options: []
|
|
11094
11136
|
});
|
|
11095
11137
|
const selectedValues = (0, import_react34.useMemo)(
|
|
@@ -11102,9 +11144,10 @@ var SelectRoot = ({
|
|
|
11102
11144
|
);
|
|
11103
11145
|
const state = {
|
|
11104
11146
|
...internalState,
|
|
11105
|
-
id: usedId,
|
|
11106
11147
|
disabled,
|
|
11107
11148
|
invalid,
|
|
11149
|
+
readOnly,
|
|
11150
|
+
required,
|
|
11108
11151
|
value: selectedValues,
|
|
11109
11152
|
selectedOptions
|
|
11110
11153
|
};
|
|
@@ -11182,7 +11225,7 @@ var SelectRoot = ({
|
|
|
11182
11225
|
const unregisterTrigger = (0, import_react34.useCallback)(() => {
|
|
11183
11226
|
triggerRef.current = null;
|
|
11184
11227
|
}, []);
|
|
11185
|
-
const toggleOpen = (
|
|
11228
|
+
const toggleOpen = (isOpen, toggleOpenOptions) => {
|
|
11186
11229
|
const { highlightStartPositionBehavior } = { ...defaultToggleOpenOptions, ...toggleOpenOptions };
|
|
11187
11230
|
let firstSelectedValue;
|
|
11188
11231
|
let firstEnabledValue;
|
|
@@ -11198,11 +11241,15 @@ var SelectRoot = ({
|
|
|
11198
11241
|
}
|
|
11199
11242
|
}
|
|
11200
11243
|
}
|
|
11244
|
+
const newIsOpen = isOpen ?? !internalState.isOpen;
|
|
11201
11245
|
setInternalState((prevState) => ({
|
|
11202
11246
|
...prevState,
|
|
11203
|
-
isOpen:
|
|
11247
|
+
isOpen: newIsOpen,
|
|
11204
11248
|
highlightedValue: firstSelectedValue ?? firstEnabledValue
|
|
11205
11249
|
}));
|
|
11250
|
+
if (!newIsOpen) {
|
|
11251
|
+
onClose?.();
|
|
11252
|
+
}
|
|
11206
11253
|
};
|
|
11207
11254
|
const moveHighlightedIndex = (delta) => {
|
|
11208
11255
|
let highlightedIndex = state.options.findIndex((value2) => value2.value === internalState.highlightedValue);
|
|
@@ -11235,6 +11282,8 @@ var SelectRoot = ({
|
|
|
11235
11282
|
}
|
|
11236
11283
|
}, [internalState.highlightedValue]);
|
|
11237
11284
|
const contextValue = {
|
|
11285
|
+
ids,
|
|
11286
|
+
setIds,
|
|
11238
11287
|
state,
|
|
11239
11288
|
config,
|
|
11240
11289
|
item: {
|
|
@@ -11253,14 +11302,52 @@ var SelectRoot = ({
|
|
|
11253
11302
|
};
|
|
11254
11303
|
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectContext.Provider, { value: contextValue, children });
|
|
11255
11304
|
};
|
|
11256
|
-
var
|
|
11305
|
+
var SelectRoot = ({ value, onValueChange, onEditComplete, ...props }) => {
|
|
11306
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11307
|
+
PrimitveSelectRoot,
|
|
11308
|
+
{
|
|
11309
|
+
...props,
|
|
11310
|
+
isMultiSelect: false,
|
|
11311
|
+
value,
|
|
11312
|
+
onValueChange: (value2) => {
|
|
11313
|
+
onValueChange?.(value2);
|
|
11314
|
+
onEditComplete?.(value2);
|
|
11315
|
+
}
|
|
11316
|
+
}
|
|
11317
|
+
);
|
|
11318
|
+
};
|
|
11319
|
+
var MultiSelectRoot = ({ value, onValueChange, onEditComplete, ...props }) => {
|
|
11320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
11321
|
+
PrimitveSelectRoot,
|
|
11322
|
+
{
|
|
11323
|
+
...props,
|
|
11324
|
+
isMultiSelect: true,
|
|
11325
|
+
values: value,
|
|
11326
|
+
onValuesChange: (values) => {
|
|
11327
|
+
onValueChange?.(values);
|
|
11328
|
+
},
|
|
11329
|
+
onClose: () => {
|
|
11330
|
+
onEditComplete?.(value);
|
|
11331
|
+
props.onClose?.();
|
|
11332
|
+
}
|
|
11333
|
+
}
|
|
11334
|
+
);
|
|
11335
|
+
};
|
|
11336
|
+
|
|
11337
|
+
// src/components/user-interaction/select/SelectComponents.tsx
|
|
11338
|
+
var import_react35 = require("react");
|
|
11339
|
+
var import_clsx13 = __toESM(require("clsx"));
|
|
11340
|
+
var import_lucide_react7 = require("lucide-react");
|
|
11341
|
+
var import_react_dom5 = require("react-dom");
|
|
11342
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
11343
|
+
var SelectOption = (0, import_react35.forwardRef)(
|
|
11257
11344
|
function SelectOption2({ children, value, disabled = false, iconAppearance, className, ...restProps }, ref) {
|
|
11258
11345
|
const { state, config, item, trigger } = useSelectContext();
|
|
11259
11346
|
const { register, unregister, toggleSelection, highlightItem } = item;
|
|
11260
|
-
const itemRef = (0,
|
|
11347
|
+
const itemRef = (0, import_react35.useRef)(null);
|
|
11261
11348
|
iconAppearance ??= config.iconAppearance;
|
|
11262
11349
|
const label = children ?? value;
|
|
11263
|
-
(0,
|
|
11350
|
+
(0, import_react35.useEffect)(() => {
|
|
11264
11351
|
register({
|
|
11265
11352
|
value,
|
|
11266
11353
|
label,
|
|
@@ -11271,7 +11358,7 @@ var SelectOption = (0, import_react34.forwardRef)(
|
|
|
11271
11358
|
}, [value, disabled, register, unregister, children, label]);
|
|
11272
11359
|
const isHighlighted = state.highlightedValue === value;
|
|
11273
11360
|
const isSelected = state.value.includes(value);
|
|
11274
|
-
return /* @__PURE__ */ (0,
|
|
11361
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
11275
11362
|
"li",
|
|
11276
11363
|
{
|
|
11277
11364
|
...restProps,
|
|
@@ -11310,7 +11397,7 @@ var SelectOption = (0, import_react34.forwardRef)(
|
|
|
11310
11397
|
}
|
|
11311
11398
|
},
|
|
11312
11399
|
children: [
|
|
11313
|
-
iconAppearance === "left" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0,
|
|
11400
|
+
iconAppearance === "left" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11314
11401
|
import_lucide_react7.CheckIcon,
|
|
11315
11402
|
{
|
|
11316
11403
|
className: (0, import_clsx13.default)("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
@@ -11318,7 +11405,7 @@ var SelectOption = (0, import_react34.forwardRef)(
|
|
|
11318
11405
|
}
|
|
11319
11406
|
),
|
|
11320
11407
|
label,
|
|
11321
|
-
iconAppearance === "right" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0,
|
|
11408
|
+
iconAppearance === "right" && (state.value.length > 0 || config.isMultiSelect) && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11322
11409
|
import_lucide_react7.CheckIcon,
|
|
11323
11410
|
{
|
|
11324
11411
|
className: (0, import_clsx13.default)("w-4 h-4", { "opacity-0": !isSelected || disabled }),
|
|
@@ -11330,25 +11417,38 @@ var SelectOption = (0, import_react34.forwardRef)(
|
|
|
11330
11417
|
);
|
|
11331
11418
|
}
|
|
11332
11419
|
);
|
|
11333
|
-
var SelectButton = (0,
|
|
11420
|
+
var SelectButton = (0, import_react35.forwardRef)(function SelectButton2({
|
|
11421
|
+
id,
|
|
11422
|
+
placeholder,
|
|
11423
|
+
selectedDisplay,
|
|
11424
|
+
...props
|
|
11425
|
+
}, ref) {
|
|
11334
11426
|
const translation = useHightideTranslation();
|
|
11335
|
-
const { state, trigger } = useSelectContext();
|
|
11427
|
+
const { state, trigger, setIds, ids } = useSelectContext();
|
|
11336
11428
|
const { register, unregister, toggleOpen } = trigger;
|
|
11337
|
-
|
|
11338
|
-
|
|
11339
|
-
|
|
11429
|
+
(0, import_react35.useEffect)(() => {
|
|
11430
|
+
if (id) {
|
|
11431
|
+
setIds((prev) => ({
|
|
11432
|
+
...prev,
|
|
11433
|
+
trigger: id
|
|
11434
|
+
}));
|
|
11435
|
+
}
|
|
11436
|
+
}, [id, setIds]);
|
|
11437
|
+
const innerRef = (0, import_react35.useRef)(null);
|
|
11438
|
+
(0, import_react35.useImperativeHandle)(ref, () => innerRef.current);
|
|
11439
|
+
(0, import_react35.useEffect)(() => {
|
|
11340
11440
|
register(innerRef);
|
|
11341
11441
|
return () => unregister();
|
|
11342
11442
|
}, [register, unregister]);
|
|
11343
11443
|
const disabled = !!props?.disabled || !!state.disabled;
|
|
11344
11444
|
const invalid = state.invalid;
|
|
11345
11445
|
const hasValue = state.value.length > 0;
|
|
11346
|
-
return /* @__PURE__ */ (0,
|
|
11446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
11347
11447
|
"button",
|
|
11348
11448
|
{
|
|
11349
11449
|
...props,
|
|
11350
11450
|
ref: innerRef,
|
|
11351
|
-
id:
|
|
11451
|
+
id: ids.trigger,
|
|
11352
11452
|
disabled,
|
|
11353
11453
|
type: "button",
|
|
11354
11454
|
onClick: (event) => {
|
|
@@ -11378,29 +11478,188 @@ var SelectButton = (0, import_react34.forwardRef)(function SelectButton2({ place
|
|
|
11378
11478
|
"aria-disabled": disabled,
|
|
11379
11479
|
"aria-haspopup": "listbox",
|
|
11380
11480
|
"aria-expanded": state.isOpen,
|
|
11381
|
-
"aria-controls": state.isOpen ?
|
|
11481
|
+
"aria-controls": state.isOpen ? ids.content : void 0,
|
|
11382
11482
|
children: [
|
|
11383
|
-
hasValue ? selectedDisplay?.(state.value) ?? /* @__PURE__ */ (0,
|
|
11483
|
+
hasValue ? selectedDisplay?.(state.value) ?? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: (0, import_clsx13.default)("flex flex-wrap gap-x-1 gap-y-2"), children: state.selectedOptions.map(({ value, label }, index) => /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "flex-row-0", children: [
|
|
11384
11484
|
label,
|
|
11385
|
-
index < state.value.length - 1 && /* @__PURE__ */ (0,
|
|
11485
|
+
index < state.value.length - 1 && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { children: "," })
|
|
11386
11486
|
] }, value)) }) : placeholder ?? translation("clickToSelect"),
|
|
11387
|
-
/* @__PURE__ */ (0,
|
|
11487
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(ExpansionIcon, { isExpanded: state.isOpen })
|
|
11388
11488
|
]
|
|
11389
11489
|
}
|
|
11390
11490
|
);
|
|
11391
11491
|
});
|
|
11392
|
-
var
|
|
11393
|
-
|
|
11492
|
+
var SelectContent = (0, import_react35.forwardRef)(function SelectContent2({
|
|
11493
|
+
id,
|
|
11494
|
+
alignment,
|
|
11495
|
+
orientation = "vertical",
|
|
11496
|
+
containerClassName,
|
|
11497
|
+
...props
|
|
11498
|
+
}, ref) {
|
|
11499
|
+
const innerRef = (0, import_react35.useRef)(null);
|
|
11500
|
+
(0, import_react35.useImperativeHandle)(ref, () => innerRef.current);
|
|
11501
|
+
const { trigger, state, config, item, ids, setIds } = useSelectContext();
|
|
11502
|
+
(0, import_react35.useEffect)(() => {
|
|
11503
|
+
if (id) {
|
|
11504
|
+
setIds((prev) => ({
|
|
11505
|
+
...prev,
|
|
11506
|
+
content: id
|
|
11507
|
+
}));
|
|
11508
|
+
}
|
|
11509
|
+
}, [id, setIds]);
|
|
11510
|
+
const position = useFloatingElement({
|
|
11511
|
+
active: state.isOpen,
|
|
11512
|
+
anchorRef: trigger.ref,
|
|
11513
|
+
containerRef: innerRef,
|
|
11514
|
+
...alignment
|
|
11515
|
+
});
|
|
11516
|
+
useFocusTrap({
|
|
11517
|
+
container: innerRef,
|
|
11518
|
+
active: state.isOpen && !!position
|
|
11519
|
+
});
|
|
11520
|
+
const { zIndex } = useOverlayRegistry({ isActive: state.isOpen });
|
|
11521
|
+
return (0, import_react_dom5.createPortal)(
|
|
11522
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
11523
|
+
"div",
|
|
11524
|
+
{
|
|
11525
|
+
id: ids.content,
|
|
11526
|
+
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen", containerClassName),
|
|
11527
|
+
style: { zIndex },
|
|
11528
|
+
hidden: !state.isOpen,
|
|
11529
|
+
children: [
|
|
11530
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11531
|
+
"div",
|
|
11532
|
+
{
|
|
11533
|
+
onClick: () => trigger.toggleOpen(false),
|
|
11534
|
+
className: (0, import_clsx13.default)("fixed inset-0 w-screen h-screen")
|
|
11535
|
+
}
|
|
11536
|
+
),
|
|
11537
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
|
|
11538
|
+
"ul",
|
|
11539
|
+
{
|
|
11540
|
+
...props,
|
|
11541
|
+
ref: innerRef,
|
|
11542
|
+
onKeyDown: (event) => {
|
|
11543
|
+
switch (event.key) {
|
|
11544
|
+
case "Escape":
|
|
11545
|
+
trigger.toggleOpen(false);
|
|
11546
|
+
event.preventDefault();
|
|
11547
|
+
event.stopPropagation();
|
|
11548
|
+
break;
|
|
11549
|
+
case match(orientation, {
|
|
11550
|
+
vertical: "ArrowDown",
|
|
11551
|
+
horizontal: "ArrowUp"
|
|
11552
|
+
}):
|
|
11553
|
+
item.moveHighlightedIndex(1);
|
|
11554
|
+
event.preventDefault();
|
|
11555
|
+
break;
|
|
11556
|
+
case match(orientation, {
|
|
11557
|
+
vertical: "ArrowUp",
|
|
11558
|
+
horizontal: "ArrowDown"
|
|
11559
|
+
}):
|
|
11560
|
+
item.moveHighlightedIndex(-1);
|
|
11561
|
+
event.preventDefault();
|
|
11562
|
+
break;
|
|
11563
|
+
case "Home":
|
|
11564
|
+
event.preventDefault();
|
|
11565
|
+
break;
|
|
11566
|
+
case "End":
|
|
11567
|
+
event.preventDefault();
|
|
11568
|
+
break;
|
|
11569
|
+
case "Enter":
|
|
11570
|
+
// Fall through
|
|
11571
|
+
case " ":
|
|
11572
|
+
if (state.highlightedValue) {
|
|
11573
|
+
item.toggleSelection(state.highlightedValue);
|
|
11574
|
+
if (!config.isMultiSelect) {
|
|
11575
|
+
trigger.toggleOpen(false);
|
|
11576
|
+
}
|
|
11577
|
+
event.preventDefault();
|
|
11578
|
+
}
|
|
11579
|
+
break;
|
|
11580
|
+
}
|
|
11581
|
+
},
|
|
11582
|
+
className: (0, import_clsx13.default)("flex-col-0 p-2 bg-menu-background text-menu-text rounded-md shadow-hw-bottom focus-outline-within overflow-auto", props.className),
|
|
11583
|
+
style: {
|
|
11584
|
+
opacity: position ? void 0 : 0,
|
|
11585
|
+
position: "fixed",
|
|
11586
|
+
...position
|
|
11587
|
+
},
|
|
11588
|
+
role: "listbox",
|
|
11589
|
+
"aria-multiselectable": config.isMultiSelect,
|
|
11590
|
+
"aria-orientation": orientation,
|
|
11591
|
+
tabIndex: position ? 0 : void 0,
|
|
11592
|
+
children: props.children
|
|
11593
|
+
}
|
|
11594
|
+
)
|
|
11595
|
+
]
|
|
11596
|
+
}
|
|
11597
|
+
),
|
|
11598
|
+
document.body
|
|
11599
|
+
);
|
|
11600
|
+
});
|
|
11601
|
+
var MultiSelectOption = SelectOption;
|
|
11602
|
+
var MultiSelectContent = SelectContent;
|
|
11603
|
+
var MultiSelectButton = SelectButton;
|
|
11604
|
+
|
|
11605
|
+
// src/components/user-interaction/select/MultiSelect.tsx
|
|
11606
|
+
var import_react36 = require("react");
|
|
11607
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
11608
|
+
var MultiSelect = (0, import_react36.forwardRef)(function MultiSelect2({
|
|
11609
|
+
children,
|
|
11610
|
+
contentPanelProps,
|
|
11611
|
+
buttonProps,
|
|
11612
|
+
...props
|
|
11613
|
+
}, ref) {
|
|
11614
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(MultiSelectRoot, { ...props, children: [
|
|
11615
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MultiSelectButton, { ref, ...buttonProps }),
|
|
11616
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(MultiSelectContent, { ...contentPanelProps, children })
|
|
11617
|
+
] });
|
|
11618
|
+
});
|
|
11619
|
+
var MultiSelectUncontrolled = (0, import_react36.forwardRef)(function MultiSelectUncontrolled2({
|
|
11620
|
+
value: initialValue,
|
|
11621
|
+
onValueChange,
|
|
11622
|
+
...props
|
|
11623
|
+
}, ref) {
|
|
11624
|
+
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
11625
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
11626
|
+
MultiSelect,
|
|
11627
|
+
{
|
|
11628
|
+
...props,
|
|
11629
|
+
ref,
|
|
11630
|
+
value,
|
|
11631
|
+
onValueChange: setValue
|
|
11632
|
+
}
|
|
11633
|
+
);
|
|
11634
|
+
});
|
|
11635
|
+
|
|
11636
|
+
// src/components/user-interaction/select/MultiSelectChipDisplay.tsx
|
|
11637
|
+
var import_react37 = require("react");
|
|
11638
|
+
var import_lucide_react8 = require("lucide-react");
|
|
11639
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
11640
|
+
var MultiSelectChipDisplayButton = (0, import_react37.forwardRef)(function MultiSelectChipDisplayButton2({
|
|
11641
|
+
id,
|
|
11642
|
+
...props
|
|
11643
|
+
}, ref) {
|
|
11644
|
+
const { state, trigger, item, ids, setIds } = useSelectContext();
|
|
11394
11645
|
const { register, unregister, toggleOpen } = trigger;
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11646
|
+
(0, import_react37.useEffect)(() => {
|
|
11647
|
+
if (id) {
|
|
11648
|
+
setIds((prev) => ({
|
|
11649
|
+
...prev,
|
|
11650
|
+
trigger: id
|
|
11651
|
+
}));
|
|
11652
|
+
}
|
|
11653
|
+
}, [id, setIds]);
|
|
11654
|
+
const innerRef = (0, import_react37.useRef)(null);
|
|
11655
|
+
(0, import_react37.useImperativeHandle)(ref, () => innerRef.current);
|
|
11656
|
+
(0, import_react37.useEffect)(() => {
|
|
11398
11657
|
register(innerRef);
|
|
11399
11658
|
return () => unregister();
|
|
11400
11659
|
}, [register, unregister]);
|
|
11401
11660
|
const disabled = !!props?.disabled || !!state.disabled;
|
|
11402
11661
|
const invalid = state.invalid;
|
|
11403
|
-
return /* @__PURE__ */ (0,
|
|
11662
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
11404
11663
|
"div",
|
|
11405
11664
|
{
|
|
11406
11665
|
...props,
|
|
@@ -11416,9 +11675,9 @@ var SelectChipDisplay = (0, import_react34.forwardRef)(function SelectChipDispla
|
|
|
11416
11675
|
"aria-invalid": invalid,
|
|
11417
11676
|
"aria-disabled": disabled,
|
|
11418
11677
|
children: [
|
|
11419
|
-
state.selectedOptions.map(({ value, label }) => /* @__PURE__ */ (0,
|
|
11678
|
+
state.selectedOptions.map(({ value, label }) => /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(Chip, { className: "gap-x-2", children: [
|
|
11420
11679
|
label,
|
|
11421
|
-
/* @__PURE__ */ (0,
|
|
11680
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11422
11681
|
Button,
|
|
11423
11682
|
{
|
|
11424
11683
|
onClick: () => {
|
|
@@ -11429,14 +11688,14 @@ var SelectChipDisplay = (0, import_react34.forwardRef)(function SelectChipDispla
|
|
|
11429
11688
|
coloringStyle: "text",
|
|
11430
11689
|
layout: "icon",
|
|
11431
11690
|
className: "flex-row-0 items-center",
|
|
11432
|
-
children: /* @__PURE__ */ (0,
|
|
11691
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react8.XIcon, { className: "size-5" })
|
|
11433
11692
|
}
|
|
11434
11693
|
)
|
|
11435
11694
|
] }, value)),
|
|
11436
|
-
/* @__PURE__ */ (0,
|
|
11695
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11437
11696
|
Button,
|
|
11438
11697
|
{
|
|
11439
|
-
id:
|
|
11698
|
+
id: ids.trigger,
|
|
11440
11699
|
onClick: (event) => {
|
|
11441
11700
|
event.stopPropagation();
|
|
11442
11701
|
toggleOpen();
|
|
@@ -11457,149 +11716,34 @@ var SelectChipDisplay = (0, import_react34.forwardRef)(function SelectChipDispla
|
|
|
11457
11716
|
"aria-disabled": disabled,
|
|
11458
11717
|
"aria-haspopup": "listbox",
|
|
11459
11718
|
"aria-expanded": state.isOpen,
|
|
11460
|
-
"aria-controls": state.isOpen ?
|
|
11719
|
+
"aria-controls": state.isOpen ? ids.content : void 0,
|
|
11461
11720
|
className: "size-9",
|
|
11462
|
-
children: /* @__PURE__ */ (0,
|
|
11721
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_lucide_react8.Plus, {})
|
|
11463
11722
|
}
|
|
11464
11723
|
)
|
|
11465
11724
|
]
|
|
11466
11725
|
}
|
|
11467
11726
|
);
|
|
11468
11727
|
});
|
|
11469
|
-
var
|
|
11470
|
-
function SelectContent2({
|
|
11471
|
-
alignment,
|
|
11472
|
-
orientation = "vertical",
|
|
11473
|
-
containerClassName,
|
|
11474
|
-
...props
|
|
11475
|
-
}, ref) {
|
|
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({
|
|
11728
|
+
var MultiSelectChipDisplay = (0, import_react37.forwardRef)(function MultiSelectChipDisplay2({
|
|
11574
11729
|
children,
|
|
11575
11730
|
contentPanelProps,
|
|
11576
|
-
|
|
11731
|
+
chipDisplayProps,
|
|
11577
11732
|
...props
|
|
11578
11733
|
}, ref) {
|
|
11579
|
-
return /* @__PURE__ */ (0,
|
|
11580
|
-
/* @__PURE__ */ (0,
|
|
11581
|
-
|
|
11582
|
-
{
|
|
11583
|
-
ref,
|
|
11584
|
-
...buttonProps,
|
|
11585
|
-
selectedDisplay: (values) => {
|
|
11586
|
-
const value = values[0];
|
|
11587
|
-
if (!buttonProps?.selectedDisplay) return void 0;
|
|
11588
|
-
return buttonProps.selectedDisplay(value);
|
|
11589
|
-
}
|
|
11590
|
-
}
|
|
11591
|
-
),
|
|
11592
|
-
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
11734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(MultiSelectRoot, { ...props, children: [
|
|
11735
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MultiSelectChipDisplayButton, { ref, ...chipDisplayProps }),
|
|
11736
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(MultiSelectContent, { ...contentPanelProps, children })
|
|
11593
11737
|
] });
|
|
11594
11738
|
});
|
|
11595
|
-
var
|
|
11739
|
+
var MultiSelectChipDisplayUncontrolled = (0, import_react37.forwardRef)(function MultiSelectChipDisplayUncontrolled2({
|
|
11596
11740
|
value: initialValue,
|
|
11597
11741
|
onValueChange,
|
|
11598
11742
|
...props
|
|
11599
11743
|
}, ref) {
|
|
11600
11744
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
11601
|
-
return /* @__PURE__ */ (0,
|
|
11602
|
-
|
|
11745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
11746
|
+
MultiSelectChipDisplay,
|
|
11603
11747
|
{
|
|
11604
11748
|
...props,
|
|
11605
11749
|
ref,
|
|
@@ -11608,56 +11752,40 @@ var SelectUncontrolled = (0, import_react34.forwardRef)(function SelectUncontrol
|
|
|
11608
11752
|
}
|
|
11609
11753
|
);
|
|
11610
11754
|
});
|
|
11611
|
-
|
|
11755
|
+
|
|
11756
|
+
// src/components/user-interaction/select/Select.tsx
|
|
11757
|
+
var import_react38 = require("react");
|
|
11758
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
11759
|
+
var Select = (0, import_react38.forwardRef)(function Select2({
|
|
11612
11760
|
children,
|
|
11613
|
-
value,
|
|
11614
|
-
onValueChange,
|
|
11615
11761
|
contentPanelProps,
|
|
11616
11762
|
buttonProps,
|
|
11617
11763
|
...props
|
|
11618
11764
|
}, ref) {
|
|
11619
|
-
return /* @__PURE__ */ (0,
|
|
11620
|
-
/* @__PURE__ */ (0,
|
|
11621
|
-
|
|
11765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(SelectRoot, { ...props, children: [
|
|
11766
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
11767
|
+
SelectButton,
|
|
11768
|
+
{
|
|
11769
|
+
ref,
|
|
11770
|
+
...buttonProps,
|
|
11771
|
+
selectedDisplay: (values) => {
|
|
11772
|
+
const value = values[0];
|
|
11773
|
+
if (!buttonProps?.selectedDisplay) return void 0;
|
|
11774
|
+
return buttonProps.selectedDisplay(value);
|
|
11775
|
+
}
|
|
11776
|
+
}
|
|
11777
|
+
),
|
|
11778
|
+
/* @__PURE__ */ (0, import_jsx_runtime38.jsx)(SelectContent, { ...contentPanelProps, children })
|
|
11622
11779
|
] });
|
|
11623
11780
|
});
|
|
11624
|
-
var
|
|
11781
|
+
var SelectUncontrolled = (0, import_react38.forwardRef)(function SelectUncontrolled2({
|
|
11625
11782
|
value: initialValue,
|
|
11626
11783
|
onValueChange,
|
|
11627
11784
|
...props
|
|
11628
11785
|
}, ref) {
|
|
11629
11786
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
11630
|
-
return /* @__PURE__ */ (0,
|
|
11631
|
-
|
|
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,
|
|
11787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
11788
|
+
Select,
|
|
11661
11789
|
{
|
|
11662
11790
|
...props,
|
|
11663
11791
|
ref,
|
|
@@ -11668,7 +11796,7 @@ var MultiSelectChipDisplayUncontrolled = (0, import_react34.forwardRef)(function
|
|
|
11668
11796
|
});
|
|
11669
11797
|
|
|
11670
11798
|
// src/components/layout/dialog/LanguageDialog.tsx
|
|
11671
|
-
var
|
|
11799
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
11672
11800
|
var LanguageDialog = ({
|
|
11673
11801
|
onClose,
|
|
11674
11802
|
titleOverwrite,
|
|
@@ -11677,15 +11805,15 @@ var LanguageDialog = ({
|
|
|
11677
11805
|
}) => {
|
|
11678
11806
|
const { locale, setLocale } = useLocale();
|
|
11679
11807
|
const translation = useHightideTranslation();
|
|
11680
|
-
return /* @__PURE__ */ (0,
|
|
11808
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11681
11809
|
Dialog,
|
|
11682
11810
|
{
|
|
11683
11811
|
titleElement: titleOverwrite ?? translation("language"),
|
|
11684
11812
|
description: descriptionOverwrite ?? translation("chooseLanguage"),
|
|
11685
11813
|
onClose,
|
|
11686
11814
|
...props,
|
|
11687
|
-
children: /* @__PURE__ */ (0,
|
|
11688
|
-
/* @__PURE__ */ (0,
|
|
11815
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "w-64", children: [
|
|
11816
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
11689
11817
|
Select,
|
|
11690
11818
|
{
|
|
11691
11819
|
value: locale,
|
|
@@ -11693,27 +11821,27 @@ var LanguageDialog = ({
|
|
|
11693
11821
|
buttonProps: {
|
|
11694
11822
|
selectedDisplay: (locale2) => LocalizationUtil.languagesLocalNames[locale2]
|
|
11695
11823
|
},
|
|
11696
|
-
children: LocalizationUtil.locals.map((local) => /* @__PURE__ */ (0,
|
|
11824
|
+
children: LocalizationUtil.locals.map((local) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(SelectOption, { value: local, children: LocalizationUtil.languagesLocalNames[local] }, local))
|
|
11697
11825
|
}
|
|
11698
11826
|
),
|
|
11699
|
-
/* @__PURE__ */ (0,
|
|
11827
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Button, { color: "positive", onClick: onClose, children: translation("done") }) })
|
|
11700
11828
|
] })
|
|
11701
11829
|
}
|
|
11702
11830
|
);
|
|
11703
11831
|
};
|
|
11704
11832
|
|
|
11705
11833
|
// src/components/layout/dialog/ThemeDialog.tsx
|
|
11706
|
-
var
|
|
11834
|
+
var import_lucide_react9 = require("lucide-react");
|
|
11707
11835
|
var import_clsx14 = __toESM(require("clsx"));
|
|
11708
11836
|
|
|
11709
11837
|
// src/contexts/ThemeContext.tsx
|
|
11710
|
-
var
|
|
11711
|
-
var
|
|
11838
|
+
var import_react39 = require("react");
|
|
11839
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
11712
11840
|
var themes = ["light", "dark", "system"];
|
|
11713
11841
|
var ThemeUtil = {
|
|
11714
11842
|
themes
|
|
11715
11843
|
};
|
|
11716
|
-
var ThemeContext = (0,
|
|
11844
|
+
var ThemeContext = (0, import_react39.createContext)(null);
|
|
11717
11845
|
var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
11718
11846
|
const {
|
|
11719
11847
|
value: storedTheme,
|
|
@@ -11721,8 +11849,8 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11721
11849
|
deleteValue: deleteStoredTheme
|
|
11722
11850
|
} = useLocalStorage("theme", "system");
|
|
11723
11851
|
const { config } = useHightideConfig();
|
|
11724
|
-
const [themePreference, setThemePreference] = (0,
|
|
11725
|
-
const resolvedTheme = (0,
|
|
11852
|
+
const [themePreference, setThemePreference] = (0, import_react39.useState)("system");
|
|
11853
|
+
const resolvedTheme = (0, import_react39.useMemo)(() => {
|
|
11726
11854
|
if (theme && theme !== "system") {
|
|
11727
11855
|
return theme;
|
|
11728
11856
|
}
|
|
@@ -11734,7 +11862,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11734
11862
|
}
|
|
11735
11863
|
return initialTheme ?? config.theme.initialTheme;
|
|
11736
11864
|
}, [config.theme.initialTheme, initialTheme, storedTheme, theme, themePreference]);
|
|
11737
|
-
(0,
|
|
11865
|
+
(0, import_react39.useEffect)(() => {
|
|
11738
11866
|
if (!theme) return;
|
|
11739
11867
|
if (theme === "system") {
|
|
11740
11868
|
deleteStoredTheme();
|
|
@@ -11742,18 +11870,18 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11742
11870
|
setStoredTheme(theme);
|
|
11743
11871
|
}
|
|
11744
11872
|
}, [theme]);
|
|
11745
|
-
(0,
|
|
11873
|
+
(0, import_react39.useEffect)(() => {
|
|
11746
11874
|
document.documentElement.setAttribute("data-theme", resolvedTheme);
|
|
11747
11875
|
}, [resolvedTheme]);
|
|
11748
|
-
const getPreference = (0,
|
|
11876
|
+
const getPreference = (0, import_react39.useCallback)(() => {
|
|
11749
11877
|
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
11750
11878
|
const prefersLight = window.matchMedia("(prefers-color-scheme: light)").matches;
|
|
11751
11879
|
setThemePreference(prefersDark ? "dark" : prefersLight ? "light" : "system");
|
|
11752
11880
|
}, []);
|
|
11753
|
-
(0,
|
|
11881
|
+
(0, import_react39.useEffect)(() => {
|
|
11754
11882
|
getPreference();
|
|
11755
11883
|
}, [getPreference]);
|
|
11756
|
-
(0,
|
|
11884
|
+
(0, import_react39.useEffect)(() => {
|
|
11757
11885
|
const darkQuery = window.matchMedia("(prefers-color-scheme: dark)");
|
|
11758
11886
|
const lightQuery = window.matchMedia("(prefers-color-scheme: light)");
|
|
11759
11887
|
const noPrefQuery = window.matchMedia("(prefers-color-scheme: no-preference)");
|
|
@@ -11766,7 +11894,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11766
11894
|
noPrefQuery.removeEventListener("change", getPreference);
|
|
11767
11895
|
};
|
|
11768
11896
|
}, [getPreference]);
|
|
11769
|
-
return /* @__PURE__ */ (0,
|
|
11897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
11770
11898
|
ThemeContext.Provider,
|
|
11771
11899
|
{
|
|
11772
11900
|
value: {
|
|
@@ -11784,7 +11912,7 @@ var ThemeProvider = ({ children, theme, initialTheme }) => {
|
|
|
11784
11912
|
);
|
|
11785
11913
|
};
|
|
11786
11914
|
var useTheme = () => {
|
|
11787
|
-
const context = (0,
|
|
11915
|
+
const context = (0, import_react39.useContext)(ThemeContext);
|
|
11788
11916
|
if (!context) {
|
|
11789
11917
|
throw new Error("useTheme must be used within ThemeContext. Try adding a ThemeProvider around your app.");
|
|
11790
11918
|
}
|
|
@@ -11792,14 +11920,14 @@ var useTheme = () => {
|
|
|
11792
11920
|
};
|
|
11793
11921
|
|
|
11794
11922
|
// src/components/layout/dialog/ThemeDialog.tsx
|
|
11795
|
-
var
|
|
11923
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
11796
11924
|
var ThemeIcon = ({ theme, className }) => {
|
|
11797
11925
|
if (theme === "dark") {
|
|
11798
|
-
return /* @__PURE__ */ (0,
|
|
11926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react9.MoonIcon, { className: (0, import_clsx14.default)("w-4 h-4", className) });
|
|
11799
11927
|
} else if (theme === "light") {
|
|
11800
|
-
return /* @__PURE__ */ (0,
|
|
11928
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react9.SunIcon, { className: (0, import_clsx14.default)("w-4 h-4", className) });
|
|
11801
11929
|
} else {
|
|
11802
|
-
return /* @__PURE__ */ (0,
|
|
11930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_lucide_react9.MonitorCog, { className: (0, import_clsx14.default)("w-4 h-4", className) });
|
|
11803
11931
|
}
|
|
11804
11932
|
};
|
|
11805
11933
|
var ThemeDialog = ({
|
|
@@ -11810,67 +11938,67 @@ var ThemeDialog = ({
|
|
|
11810
11938
|
}) => {
|
|
11811
11939
|
const { theme, setTheme } = useTheme();
|
|
11812
11940
|
const translation = useHightideTranslation();
|
|
11813
|
-
return /* @__PURE__ */ (0,
|
|
11941
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11814
11942
|
Dialog,
|
|
11815
11943
|
{
|
|
11816
11944
|
titleElement: titleOverwrite ?? translation("pThemes", { count: 1 }),
|
|
11817
11945
|
description: descriptionOverwrite ?? translation("chooseTheme"),
|
|
11818
11946
|
onClose,
|
|
11819
11947
|
...props,
|
|
11820
|
-
children: /* @__PURE__ */ (0,
|
|
11821
|
-
/* @__PURE__ */ (0,
|
|
11948
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "w-64", children: [
|
|
11949
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
|
|
11822
11950
|
Select,
|
|
11823
11951
|
{
|
|
11824
11952
|
value: theme,
|
|
11825
11953
|
onValueChange: (theme2) => setTheme(theme2),
|
|
11826
11954
|
iconAppearance: "right",
|
|
11827
11955
|
buttonProps: {
|
|
11828
|
-
selectedDisplay: (value) => /* @__PURE__ */ (0,
|
|
11829
|
-
/* @__PURE__ */ (0,
|
|
11956
|
+
selectedDisplay: (value) => /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
11957
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ThemeIcon, { theme }),
|
|
11830
11958
|
translation("sThemeMode", { theme: value })
|
|
11831
11959
|
] }),
|
|
11832
11960
|
className: "min-w-32"
|
|
11833
11961
|
},
|
|
11834
|
-
children: ThemeUtil.themes.map((theme2) => /* @__PURE__ */ (0,
|
|
11835
|
-
/* @__PURE__ */ (0,
|
|
11962
|
+
children: ThemeUtil.themes.map((theme2) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(SelectOption, { value: theme2, className: "gap-x-6 justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
11963
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(ThemeIcon, { theme: theme2 }),
|
|
11836
11964
|
translation("sThemeMode", { theme: theme2 })
|
|
11837
11965
|
] }) }, theme2))
|
|
11838
11966
|
}
|
|
11839
11967
|
),
|
|
11840
|
-
/* @__PURE__ */ (0,
|
|
11968
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: "flex-row-4 mt-3 justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Button, { autoFocus: true, color: "positive", onClick: onClose, children: translation("done") }) })
|
|
11841
11969
|
] })
|
|
11842
11970
|
}
|
|
11843
11971
|
);
|
|
11844
11972
|
};
|
|
11845
11973
|
|
|
11846
11974
|
// src/components/layout/loading/ErrorComponent.tsx
|
|
11847
|
-
var
|
|
11975
|
+
var import_lucide_react10 = require("lucide-react");
|
|
11848
11976
|
var import_clsx15 = __toESM(require("clsx"));
|
|
11849
|
-
var
|
|
11977
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
11850
11978
|
var ErrorComponent = ({
|
|
11851
11979
|
errorText,
|
|
11852
11980
|
classname
|
|
11853
11981
|
}) => {
|
|
11854
11982
|
const translation = useHightideTranslation();
|
|
11855
|
-
return /* @__PURE__ */ (0,
|
|
11856
|
-
/* @__PURE__ */ (0,
|
|
11983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: (0, import_clsx15.default)("flex-col-4 items-center justify-center w-full h-24", classname), children: [
|
|
11984
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_lucide_react10.AlertOctagon, { size: 64, className: "text-warning" }),
|
|
11857
11985
|
errorText ?? `${translation("errorOccurred")} :(`
|
|
11858
11986
|
] });
|
|
11859
11987
|
};
|
|
11860
11988
|
|
|
11861
11989
|
// src/components/layout/loading/LoadingAndErrorComponent.tsx
|
|
11862
|
-
var
|
|
11990
|
+
var import_react40 = require("react");
|
|
11863
11991
|
|
|
11864
11992
|
// src/components/layout/loading/LoadingContainer.tsx
|
|
11865
11993
|
var import_clsx16 = require("clsx");
|
|
11866
|
-
var
|
|
11994
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
11867
11995
|
var LoadingContainer = ({ className }) => {
|
|
11868
|
-
return /* @__PURE__ */ (0,
|
|
11996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: (0, import_clsx16.clsx)("relative overflow-hidden shimmer bg-disabled/30 rounded-md", className) });
|
|
11869
11997
|
};
|
|
11870
11998
|
|
|
11871
11999
|
// src/components/layout/loading/LoadingAndErrorComponent.tsx
|
|
11872
12000
|
var import_clsx17 = require("clsx");
|
|
11873
|
-
var
|
|
12001
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
11874
12002
|
var LoadingAndErrorComponent = ({
|
|
11875
12003
|
children,
|
|
11876
12004
|
isLoading = false,
|
|
@@ -11880,8 +12008,8 @@ var LoadingAndErrorComponent = ({
|
|
|
11880
12008
|
minimumLoadingDuration = 200,
|
|
11881
12009
|
className
|
|
11882
12010
|
}) => {
|
|
11883
|
-
const [isInMinimumLoading, setIsInMinimumLoading] = (0,
|
|
11884
|
-
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0,
|
|
12011
|
+
const [isInMinimumLoading, setIsInMinimumLoading] = (0, import_react40.useState)(false);
|
|
12012
|
+
const [hasUsedMinimumLoading, setHasUsedMinimumLoading] = (0, import_react40.useState)(false);
|
|
11885
12013
|
if (minimumLoadingDuration && !isInMinimumLoading && !hasUsedMinimumLoading) {
|
|
11886
12014
|
setIsInMinimumLoading(true);
|
|
11887
12015
|
setTimeout(() => {
|
|
@@ -11890,33 +12018,33 @@ var LoadingAndErrorComponent = ({
|
|
|
11890
12018
|
}, minimumLoadingDuration);
|
|
11891
12019
|
}
|
|
11892
12020
|
if (isLoading || minimumLoadingDuration && isInMinimumLoading) {
|
|
11893
|
-
return /* @__PURE__ */ (0,
|
|
12021
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_jsx_runtime44.Fragment, { children: loadingComponent ?? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(LoadingContainer, { className: (0, import_clsx17.clsx)(className) }) });
|
|
11894
12022
|
}
|
|
11895
12023
|
if (hasError) {
|
|
11896
|
-
return /* @__PURE__ */ (0,
|
|
12024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_jsx_runtime44.Fragment, { children: errorComponent ?? /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(LoadingContainer, { className: (0, import_clsx17.clsx)("bg-negative", className) }) });
|
|
11897
12025
|
}
|
|
11898
|
-
return /* @__PURE__ */ (0,
|
|
12026
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_jsx_runtime44.Fragment, { children });
|
|
11899
12027
|
};
|
|
11900
12028
|
|
|
11901
12029
|
// src/components/layout/loading/LoadingAnimation.tsx
|
|
11902
12030
|
var import_clsx18 = __toESM(require("clsx"));
|
|
11903
|
-
var
|
|
12031
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
11904
12032
|
var LoadingAnimation = ({
|
|
11905
12033
|
loadingText,
|
|
11906
12034
|
classname
|
|
11907
12035
|
}) => {
|
|
11908
12036
|
const translation = useHightideTranslation();
|
|
11909
|
-
return /* @__PURE__ */ (0,
|
|
11910
|
-
/* @__PURE__ */ (0,
|
|
12037
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: (0, import_clsx18.default)("flex-col-2 items-center justify-center w-full h-24", classname), children: [
|
|
12038
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)(HelpwaveLogo, { animate: "loading" }),
|
|
11911
12039
|
loadingText ?? `${translation("loading")}...`
|
|
11912
12040
|
] });
|
|
11913
12041
|
};
|
|
11914
12042
|
|
|
11915
12043
|
// src/components/layout/navigation/BreadCrumbs.tsx
|
|
11916
12044
|
var import_link = __toESM(require_link2());
|
|
11917
|
-
var
|
|
12045
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
11918
12046
|
var BreadCrumbLink = ({ ...props }) => {
|
|
11919
|
-
return /* @__PURE__ */ (0,
|
|
12047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
|
|
11920
12048
|
import_link.default,
|
|
11921
12049
|
{
|
|
11922
12050
|
...props,
|
|
@@ -11925,29 +12053,29 @@ var BreadCrumbLink = ({ ...props }) => {
|
|
|
11925
12053
|
);
|
|
11926
12054
|
};
|
|
11927
12055
|
var BreadCrumbDivider = () => {
|
|
11928
|
-
return /* @__PURE__ */ (0,
|
|
12056
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { "data-name": "breadcrumb-divider", children: "/" });
|
|
11929
12057
|
};
|
|
11930
12058
|
var BreadCrumbGroup = ({ children, divider, ...props }) => {
|
|
11931
12059
|
const items = ArrayUtil.resolveSingleOrArray(children);
|
|
11932
|
-
return /* @__PURE__ */ (0,
|
|
12060
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("ul", { ...props, "data-name": props["data-name"] ?? "breadcrumb", children: items.map((item, index) => {
|
|
11933
12061
|
const isLast = index === items.length - 1;
|
|
11934
|
-
return /* @__PURE__ */ (0,
|
|
12062
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("li", { "data-name": "breadcrumb-item", children: [
|
|
11935
12063
|
item,
|
|
11936
|
-
!isLast && divider !== null && (divider ?? /* @__PURE__ */ (0,
|
|
12064
|
+
!isLast && divider !== null && (divider ?? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(BreadCrumbDivider, {}))
|
|
11937
12065
|
] }, index);
|
|
11938
12066
|
}) });
|
|
11939
12067
|
};
|
|
11940
12068
|
var BreadCrumbs = ({ crumbs }) => {
|
|
11941
|
-
return /* @__PURE__ */ (0,
|
|
12069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(BreadCrumbGroup, { children: crumbs.map(({ href, label }, index) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(BreadCrumbLink, { href, children: label }, index)) });
|
|
11942
12070
|
};
|
|
11943
12071
|
|
|
11944
12072
|
// src/components/layout/navigation/Navigation.tsx
|
|
11945
|
-
var
|
|
11946
|
-
var
|
|
11947
|
-
var
|
|
12073
|
+
var import_lucide_react11 = require("lucide-react");
|
|
12074
|
+
var import_react41 = require("react");
|
|
12075
|
+
var import_react42 = require("react");
|
|
11948
12076
|
var import_link2 = __toESM(require_link2());
|
|
11949
12077
|
var import_clsx19 = __toESM(require("clsx"));
|
|
11950
|
-
var
|
|
12078
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
11951
12079
|
function isSubItem(item) {
|
|
11952
12080
|
return "items" in item && Array.isArray(item.items);
|
|
11953
12081
|
}
|
|
@@ -11957,10 +12085,10 @@ var NavigationItemWithSubItem = ({
|
|
|
11957
12085
|
horizontalAlignment = "center",
|
|
11958
12086
|
...options
|
|
11959
12087
|
}) => {
|
|
11960
|
-
const [isOpen, setOpen] = (0,
|
|
11961
|
-
const containerRef = (0,
|
|
11962
|
-
const triggerRef = (0,
|
|
11963
|
-
const id = (0,
|
|
12088
|
+
const [isOpen, setOpen] = (0, import_react42.useState)(false);
|
|
12089
|
+
const containerRef = (0, import_react42.useRef)(null);
|
|
12090
|
+
const triggerRef = (0, import_react42.useRef)(null);
|
|
12091
|
+
const id = (0, import_react42.useId)();
|
|
11964
12092
|
const style = useFloatingElement({
|
|
11965
12093
|
active: isOpen,
|
|
11966
12094
|
containerRef,
|
|
@@ -11968,15 +12096,15 @@ var NavigationItemWithSubItem = ({
|
|
|
11968
12096
|
horizontalAlignment,
|
|
11969
12097
|
...options
|
|
11970
12098
|
});
|
|
11971
|
-
const onBlur = (0,
|
|
12099
|
+
const onBlur = (0, import_react42.useCallback)((event) => {
|
|
11972
12100
|
const nextFocus = event.relatedTarget;
|
|
11973
12101
|
if (!containerRef.current?.contains(nextFocus) && !triggerRef.current?.contains(nextFocus)) {
|
|
11974
12102
|
setOpen(false);
|
|
11975
12103
|
}
|
|
11976
12104
|
}, []);
|
|
11977
12105
|
const { zIndex } = useOverlayRegistry();
|
|
11978
|
-
return /* @__PURE__ */ (0,
|
|
11979
|
-
/* @__PURE__ */ (0,
|
|
12106
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
12107
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
11980
12108
|
"button",
|
|
11981
12109
|
{
|
|
11982
12110
|
id: "navigation-" + id,
|
|
@@ -11992,11 +12120,11 @@ var NavigationItemWithSubItem = ({
|
|
|
11992
12120
|
"aria-controls": "navigation-items-" + id,
|
|
11993
12121
|
children: [
|
|
11994
12122
|
label,
|
|
11995
|
-
/* @__PURE__ */ (0,
|
|
12123
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(ExpansionIcon, { isExpanded: isOpen })
|
|
11996
12124
|
]
|
|
11997
12125
|
}
|
|
11998
12126
|
),
|
|
11999
|
-
/* @__PURE__ */ (0,
|
|
12127
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12000
12128
|
"ul",
|
|
12001
12129
|
{
|
|
12002
12130
|
id: "navigation-items-" + id,
|
|
@@ -12015,7 +12143,7 @@ var NavigationItemWithSubItem = ({
|
|
|
12015
12143
|
{ "opacity-0": !style }
|
|
12016
12144
|
),
|
|
12017
12145
|
style: { ...style, zIndex },
|
|
12018
|
-
children: items.map(({ link, label: label2, external }, index) => /* @__PURE__ */ (0,
|
|
12146
|
+
children: items.map(({ link, label: label2, external }, index) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12019
12147
|
import_link2.default,
|
|
12020
12148
|
{
|
|
12021
12149
|
href: link,
|
|
@@ -12029,25 +12157,25 @@ var NavigationItemWithSubItem = ({
|
|
|
12029
12157
|
] });
|
|
12030
12158
|
};
|
|
12031
12159
|
var NavigationItemList = ({ items, ...restProps }) => {
|
|
12032
|
-
return /* @__PURE__ */ (0,
|
|
12160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("ul", { ...restProps, className: (0, import_clsx19.default)("flex-row-6 items-center", restProps.className), children: items.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("li", { children: isSubItem(item) ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NavigationItemWithSubItem, { ...item }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_link2.default, { href: item.link, target: item.external ? "_blank" : void 0, className: "link", children: item.label }) }, index)) });
|
|
12033
12161
|
};
|
|
12034
12162
|
var Navigation = ({ ...props }) => {
|
|
12035
|
-
const [isMobileOpen, setIsMobileOpen] = (0,
|
|
12036
|
-
const id = (0,
|
|
12037
|
-
const menuRef = (0,
|
|
12038
|
-
(0,
|
|
12163
|
+
const [isMobileOpen, setIsMobileOpen] = (0, import_react42.useState)(false);
|
|
12164
|
+
const id = (0, import_react42.useId)();
|
|
12165
|
+
const menuRef = (0, import_react42.useRef)(null);
|
|
12166
|
+
(0, import_react41.useEffect)(() => {
|
|
12039
12167
|
menuRef.current?.focus();
|
|
12040
12168
|
}, [isMobileOpen]);
|
|
12041
12169
|
const { zIndex } = useOverlayRegistry({ isActive: isMobileOpen });
|
|
12042
|
-
return /* @__PURE__ */ (0,
|
|
12043
|
-
/* @__PURE__ */ (0,
|
|
12170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("nav", { children: [
|
|
12171
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12044
12172
|
NavigationItemList,
|
|
12045
12173
|
{
|
|
12046
12174
|
...props,
|
|
12047
12175
|
className: (0, import_clsx19.default)("hidden", { "desktop:flex": !isMobileOpen }, props.className)
|
|
12048
12176
|
}
|
|
12049
12177
|
),
|
|
12050
|
-
/* @__PURE__ */ (0,
|
|
12178
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12051
12179
|
Button,
|
|
12052
12180
|
{
|
|
12053
12181
|
layout: "icon",
|
|
@@ -12058,10 +12186,10 @@ var Navigation = ({ ...props }) => {
|
|
|
12058
12186
|
"aria-haspopup": "true",
|
|
12059
12187
|
"aria-expanded": isMobileOpen,
|
|
12060
12188
|
"aria-controls": "navigation-menu-" + id,
|
|
12061
|
-
children: /* @__PURE__ */ (0,
|
|
12189
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react11.Menu, { className: "w-6 h-6" })
|
|
12062
12190
|
}
|
|
12063
12191
|
),
|
|
12064
|
-
/* @__PURE__ */ (0,
|
|
12192
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
|
|
12065
12193
|
"div",
|
|
12066
12194
|
{
|
|
12067
12195
|
id: "navigation-menu-" + id,
|
|
@@ -12083,17 +12211,17 @@ var Navigation = ({ ...props }) => {
|
|
|
12083
12211
|
),
|
|
12084
12212
|
style: { zIndex },
|
|
12085
12213
|
children: [
|
|
12086
|
-
/* @__PURE__ */ (0,
|
|
12214
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
|
|
12087
12215
|
Button,
|
|
12088
12216
|
{
|
|
12089
12217
|
layout: "icon",
|
|
12090
12218
|
coloringStyle: "text",
|
|
12091
12219
|
color: "neutral",
|
|
12092
12220
|
onClick: () => setIsMobileOpen(false),
|
|
12093
|
-
children: /* @__PURE__ */ (0,
|
|
12221
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_lucide_react11.XIcon, {})
|
|
12094
12222
|
}
|
|
12095
12223
|
),
|
|
12096
|
-
/* @__PURE__ */ (0,
|
|
12224
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)(NavigationItemList, { ...props, className: (0, import_clsx19.default)("flex-col-8", props.className) })
|
|
12097
12225
|
]
|
|
12098
12226
|
}
|
|
12099
12227
|
)
|
|
@@ -12101,10 +12229,10 @@ var Navigation = ({ ...props }) => {
|
|
|
12101
12229
|
};
|
|
12102
12230
|
|
|
12103
12231
|
// src/components/layout/navigation/Pagination.tsx
|
|
12104
|
-
var
|
|
12232
|
+
var import_lucide_react12 = require("lucide-react");
|
|
12105
12233
|
var import_clsx20 = __toESM(require("clsx"));
|
|
12106
|
-
var
|
|
12107
|
-
var
|
|
12234
|
+
var import_react43 = require("react");
|
|
12235
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
12108
12236
|
var Pagination = ({
|
|
12109
12237
|
pageIndex,
|
|
12110
12238
|
pageCount,
|
|
@@ -12113,11 +12241,11 @@ var Pagination = ({
|
|
|
12113
12241
|
style
|
|
12114
12242
|
}) => {
|
|
12115
12243
|
const translation = useHightideTranslation();
|
|
12116
|
-
const [value, setValue] = (0,
|
|
12244
|
+
const [value, setValue] = (0, import_react43.useState)((pageIndex + 1).toString());
|
|
12117
12245
|
const noPages = pageCount === 0;
|
|
12118
12246
|
const onFirstPage = pageIndex === 0 && !noPages;
|
|
12119
12247
|
const onLastPage = pageIndex === pageCount - 1;
|
|
12120
|
-
(0,
|
|
12248
|
+
(0, import_react43.useEffect)(() => {
|
|
12121
12249
|
if (noPages) {
|
|
12122
12250
|
setValue("0");
|
|
12123
12251
|
} else {
|
|
@@ -12127,8 +12255,8 @@ var Pagination = ({
|
|
|
12127
12255
|
const changePage = (page) => {
|
|
12128
12256
|
onPageChanged(page);
|
|
12129
12257
|
};
|
|
12130
|
-
return /* @__PURE__ */ (0,
|
|
12131
|
-
/* @__PURE__ */ (0,
|
|
12258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: (0, import_clsx20.default)("flex-row-1", className), style, children: [
|
|
12259
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12132
12260
|
Button,
|
|
12133
12261
|
{
|
|
12134
12262
|
layout: "icon",
|
|
@@ -12136,10 +12264,10 @@ var Pagination = ({
|
|
|
12136
12264
|
color: "neutral",
|
|
12137
12265
|
onClick: () => changePage(0),
|
|
12138
12266
|
disabled: onFirstPage || noPages,
|
|
12139
|
-
children: /* @__PURE__ */ (0,
|
|
12267
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react12.ChevronFirst, {})
|
|
12140
12268
|
}
|
|
12141
12269
|
),
|
|
12142
|
-
/* @__PURE__ */ (0,
|
|
12270
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12143
12271
|
Button,
|
|
12144
12272
|
{
|
|
12145
12273
|
layout: "icon",
|
|
@@ -12147,11 +12275,11 @@ var Pagination = ({
|
|
|
12147
12275
|
color: "neutral",
|
|
12148
12276
|
onClick: () => changePage(pageIndex - 1),
|
|
12149
12277
|
disabled: onFirstPage || noPages,
|
|
12150
|
-
children: /* @__PURE__ */ (0,
|
|
12278
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react12.ChevronLeft, {})
|
|
12151
12279
|
}
|
|
12152
12280
|
),
|
|
12153
|
-
/* @__PURE__ */ (0,
|
|
12154
|
-
/* @__PURE__ */ (0,
|
|
12281
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "flex-row-2 min-w-56 items-center justify-center mx-2 text-center", children: [
|
|
12282
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12155
12283
|
Input,
|
|
12156
12284
|
{
|
|
12157
12285
|
value,
|
|
@@ -12175,8 +12303,8 @@ var Pagination = ({
|
|
|
12175
12303
|
editCompleteOptions: { delay: 800 }
|
|
12176
12304
|
}
|
|
12177
12305
|
),
|
|
12178
|
-
/* @__PURE__ */ (0,
|
|
12179
|
-
/* @__PURE__ */ (0,
|
|
12306
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "select-none w-10", children: translation("of") }),
|
|
12307
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12180
12308
|
"span",
|
|
12181
12309
|
{
|
|
12182
12310
|
className: "flex-row-2 w-24 items-center justify-center select-none h-10 bg-input-background text-input-text rounded-md font-bold",
|
|
@@ -12184,7 +12312,7 @@ var Pagination = ({
|
|
|
12184
12312
|
}
|
|
12185
12313
|
)
|
|
12186
12314
|
] }),
|
|
12187
|
-
/* @__PURE__ */ (0,
|
|
12315
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12188
12316
|
Button,
|
|
12189
12317
|
{
|
|
12190
12318
|
layout: "icon",
|
|
@@ -12192,10 +12320,10 @@ var Pagination = ({
|
|
|
12192
12320
|
color: "neutral",
|
|
12193
12321
|
onClick: () => changePage(pageIndex + 1),
|
|
12194
12322
|
disabled: onLastPage || noPages,
|
|
12195
|
-
children: /* @__PURE__ */ (0,
|
|
12323
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react12.ChevronRight, {})
|
|
12196
12324
|
}
|
|
12197
12325
|
),
|
|
12198
|
-
/* @__PURE__ */ (0,
|
|
12326
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
12199
12327
|
Button,
|
|
12200
12328
|
{
|
|
12201
12329
|
layout: "icon",
|
|
@@ -12203,16 +12331,16 @@ var Pagination = ({
|
|
|
12203
12331
|
color: "neutral",
|
|
12204
12332
|
onClick: () => changePage(pageCount - 1),
|
|
12205
12333
|
disabled: onLastPage || noPages,
|
|
12206
|
-
children: /* @__PURE__ */ (0,
|
|
12334
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react12.ChevronLast, {})
|
|
12207
12335
|
}
|
|
12208
12336
|
)
|
|
12209
12337
|
] });
|
|
12210
12338
|
};
|
|
12211
12339
|
|
|
12212
12340
|
// src/components/layout/navigation/StepperBar.tsx
|
|
12213
|
-
var
|
|
12341
|
+
var import_lucide_react13 = require("lucide-react");
|
|
12214
12342
|
var import_clsx21 = __toESM(require("clsx"));
|
|
12215
|
-
var
|
|
12343
|
+
var import_jsx_runtime49 = require("react/jsx-runtime");
|
|
12216
12344
|
var defaultState = {
|
|
12217
12345
|
currentStep: 0,
|
|
12218
12346
|
seenSteps: /* @__PURE__ */ new Set([0])
|
|
@@ -12234,12 +12362,12 @@ var StepperBar = ({
|
|
|
12234
12362
|
seenSteps.add(newStep);
|
|
12235
12363
|
onChange({ currentStep: newStep, seenSteps });
|
|
12236
12364
|
};
|
|
12237
|
-
return /* @__PURE__ */ (0,
|
|
12365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12238
12366
|
"div",
|
|
12239
12367
|
{
|
|
12240
12368
|
className: (0, import_clsx21.default)("flex-row-2 justify-between", className),
|
|
12241
12369
|
children: [
|
|
12242
|
-
/* @__PURE__ */ (0,
|
|
12370
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex-row-2 flex-[2] justify-start", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12243
12371
|
Button,
|
|
12244
12372
|
{
|
|
12245
12373
|
disabled: currentStep === 0 || disabledSteps.has(currentStep),
|
|
@@ -12248,14 +12376,14 @@ var StepperBar = ({
|
|
|
12248
12376
|
},
|
|
12249
12377
|
className: "flex-row-1 items-center justify-center",
|
|
12250
12378
|
children: [
|
|
12251
|
-
/* @__PURE__ */ (0,
|
|
12379
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react13.ChevronLeft, { size: 14 }),
|
|
12252
12380
|
translation("back")
|
|
12253
12381
|
]
|
|
12254
12382
|
}
|
|
12255
12383
|
) }),
|
|
12256
|
-
/* @__PURE__ */ (0,
|
|
12384
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex-row-2 flex-[5] justify-center items-center", children: showDots && dots.map((value, index) => {
|
|
12257
12385
|
const seen = seenSteps.has(index);
|
|
12258
|
-
return /* @__PURE__ */ (0,
|
|
12386
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12259
12387
|
"div",
|
|
12260
12388
|
{
|
|
12261
12389
|
onClick: () => seen && update(index),
|
|
@@ -12275,7 +12403,7 @@ var StepperBar = ({
|
|
|
12275
12403
|
index
|
|
12276
12404
|
);
|
|
12277
12405
|
}) }),
|
|
12278
|
-
currentStep !== numberOfSteps && /* @__PURE__ */ (0,
|
|
12406
|
+
currentStep !== numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12279
12407
|
Button,
|
|
12280
12408
|
{
|
|
12281
12409
|
onClick: () => update(currentStep + 1),
|
|
@@ -12283,18 +12411,18 @@ var StepperBar = ({
|
|
|
12283
12411
|
disabled: disabledSteps.has(currentStep),
|
|
12284
12412
|
children: [
|
|
12285
12413
|
translation("next"),
|
|
12286
|
-
/* @__PURE__ */ (0,
|
|
12414
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react13.ChevronRight, { size: 14 })
|
|
12287
12415
|
]
|
|
12288
12416
|
}
|
|
12289
12417
|
) }),
|
|
12290
|
-
currentStep === numberOfSteps && /* @__PURE__ */ (0,
|
|
12418
|
+
currentStep === numberOfSteps && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "flex-row-2 flex-[2] justify-end", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
|
|
12291
12419
|
Button,
|
|
12292
12420
|
{
|
|
12293
12421
|
disabled: disabledSteps.has(currentStep),
|
|
12294
12422
|
onClick: onFinish,
|
|
12295
12423
|
className: "flex-row-1 items-center justify-center",
|
|
12296
12424
|
children: [
|
|
12297
|
-
/* @__PURE__ */ (0,
|
|
12425
|
+
/* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_lucide_react13.Check, { size: 14 }),
|
|
12298
12426
|
finishText ?? translation("confirm")
|
|
12299
12427
|
]
|
|
12300
12428
|
}
|
|
@@ -12305,7 +12433,7 @@ var StepperBar = ({
|
|
|
12305
12433
|
};
|
|
12306
12434
|
var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
|
|
12307
12435
|
const [usedState, setUsedState] = useOverwritableState(state, onChange);
|
|
12308
|
-
return /* @__PURE__ */ (0,
|
|
12436
|
+
return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
|
|
12309
12437
|
StepperBar,
|
|
12310
12438
|
{
|
|
12311
12439
|
...props,
|
|
@@ -12316,15 +12444,15 @@ var StepperBarUncontrolled = ({ state, onChange, ...props }) => {
|
|
|
12316
12444
|
};
|
|
12317
12445
|
|
|
12318
12446
|
// src/components/layout/table/FillerCell.tsx
|
|
12319
|
-
var
|
|
12320
|
-
var
|
|
12447
|
+
var import_lucide_react14 = require("lucide-react");
|
|
12448
|
+
var import_jsx_runtime50 = require("react/jsx-runtime");
|
|
12321
12449
|
var FillerCell = ({ ...props }) => {
|
|
12322
|
-
return /* @__PURE__ */ (0,
|
|
12450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
|
|
12323
12451
|
"div",
|
|
12324
12452
|
{
|
|
12325
12453
|
...props,
|
|
12326
12454
|
"data-name": PropsUtil.dataAttributes.name("table-filler-cell"),
|
|
12327
|
-
children: /* @__PURE__ */ (0,
|
|
12455
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_lucide_react14.Minus, { className: "max-w-4 max-h-4" })
|
|
12328
12456
|
}
|
|
12329
12457
|
);
|
|
12330
12458
|
};
|
|
@@ -12344,24 +12472,24 @@ var TableFilters = {
|
|
|
12344
12472
|
};
|
|
12345
12473
|
|
|
12346
12474
|
// src/components/layout/table/Table.tsx
|
|
12347
|
-
var
|
|
12475
|
+
var import_react51 = require("react");
|
|
12348
12476
|
var import_clsx26 = __toESM(require("clsx"));
|
|
12349
12477
|
var import_react_table = require("@tanstack/react-table");
|
|
12350
12478
|
|
|
12351
12479
|
// src/components/layout/table/TableCell.tsx
|
|
12352
12480
|
var import_clsx22 = require("clsx");
|
|
12353
|
-
var
|
|
12481
|
+
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
12354
12482
|
var TableCell = ({
|
|
12355
12483
|
children,
|
|
12356
12484
|
className
|
|
12357
12485
|
}) => {
|
|
12358
|
-
return /* @__PURE__ */ (0,
|
|
12486
|
+
return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("span", { className: (0, import_clsx22.clsx)("block max-w-full overflow-ellipsis truncate", className), children });
|
|
12359
12487
|
};
|
|
12360
12488
|
|
|
12361
12489
|
// src/hooks/useResizeCallbackWrapper.ts
|
|
12362
|
-
var
|
|
12490
|
+
var import_react44 = require("react");
|
|
12363
12491
|
var useResizeCallbackWrapper = (callback) => {
|
|
12364
|
-
(0,
|
|
12492
|
+
(0, import_react44.useEffect)(() => {
|
|
12365
12493
|
window.addEventListener("resize", callback);
|
|
12366
12494
|
return () => {
|
|
12367
12495
|
window.removeEventListener("resize", callback);
|
|
@@ -12370,14 +12498,14 @@ var useResizeCallbackWrapper = (callback) => {
|
|
|
12370
12498
|
};
|
|
12371
12499
|
|
|
12372
12500
|
// src/components/layout/table/TableSortButton.tsx
|
|
12373
|
-
var
|
|
12501
|
+
var import_lucide_react15 = require("lucide-react");
|
|
12374
12502
|
var import_clsx24 = __toESM(require("clsx"));
|
|
12375
12503
|
|
|
12376
12504
|
// src/components/user-interaction/Tooltip.tsx
|
|
12377
|
-
var
|
|
12505
|
+
var import_react45 = require("react");
|
|
12378
12506
|
var import_clsx23 = require("clsx");
|
|
12379
12507
|
var import_react_dom6 = require("react-dom");
|
|
12380
|
-
var
|
|
12508
|
+
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
12381
12509
|
var Tooltip = ({
|
|
12382
12510
|
tooltip,
|
|
12383
12511
|
children,
|
|
@@ -12388,52 +12516,52 @@ var Tooltip = ({
|
|
|
12388
12516
|
position = "bottom",
|
|
12389
12517
|
disabled = false
|
|
12390
12518
|
}) => {
|
|
12391
|
-
const [state, setState] = (0,
|
|
12519
|
+
const [state, setState] = (0, import_react45.useState)({
|
|
12392
12520
|
isShown: false,
|
|
12393
12521
|
timer: null
|
|
12394
12522
|
});
|
|
12395
12523
|
const { config } = useHightideConfig();
|
|
12396
|
-
const appearDelay = (0,
|
|
12524
|
+
const appearDelay = (0, import_react45.useMemo)(
|
|
12397
12525
|
() => appearDelayOverwrite ?? config.tooltip.appearDelay,
|
|
12398
12526
|
[config.tooltip.appearDelay, appearDelayOverwrite]
|
|
12399
12527
|
);
|
|
12400
|
-
const disappearDelay = (0,
|
|
12528
|
+
const disappearDelay = (0, import_react45.useMemo)(
|
|
12401
12529
|
() => disappearDelayOverwrite ?? config.tooltip.disappearDelay,
|
|
12402
12530
|
[config.tooltip.disappearDelay, disappearDelayOverwrite]
|
|
12403
12531
|
);
|
|
12404
|
-
const anchorRef = (0,
|
|
12405
|
-
const containerRef = (0,
|
|
12406
|
-
const triangleRef = (0,
|
|
12532
|
+
const anchorRef = (0, import_react45.useRef)(null);
|
|
12533
|
+
const containerRef = (0, import_react45.useRef)(null);
|
|
12534
|
+
const triangleRef = (0, import_react45.useRef)(null);
|
|
12407
12535
|
const isActive = !disabled && state.isShown;
|
|
12408
12536
|
const { isVisible, transitionState, callbacks } = useTransitionState(
|
|
12409
|
-
(0,
|
|
12537
|
+
(0, import_react45.useMemo)(() => ({ isOpen: isActive }), [isActive])
|
|
12410
12538
|
);
|
|
12411
|
-
const verticalAlignment = (0,
|
|
12539
|
+
const verticalAlignment = (0, import_react45.useMemo)(
|
|
12412
12540
|
() => position === "top" ? "beforeStart" : position === "bottom" ? "afterEnd" : "center",
|
|
12413
12541
|
[position]
|
|
12414
12542
|
);
|
|
12415
|
-
const horizontalAlignment = (0,
|
|
12543
|
+
const horizontalAlignment = (0, import_react45.useMemo)(
|
|
12416
12544
|
() => position === "left" ? "beforeStart" : position === "right" ? "afterEnd" : "center",
|
|
12417
12545
|
[position]
|
|
12418
12546
|
);
|
|
12419
|
-
const css = useFloatingElement((0,
|
|
12547
|
+
const css = useFloatingElement((0, import_react45.useMemo)(() => ({
|
|
12420
12548
|
active: isActive || isVisible,
|
|
12421
12549
|
anchorRef,
|
|
12422
12550
|
containerRef,
|
|
12423
12551
|
horizontalAlignment,
|
|
12424
12552
|
verticalAlignment
|
|
12425
12553
|
}), [horizontalAlignment, isActive, isVisible, verticalAlignment]));
|
|
12426
|
-
const cssTriangle = useFloatingElement((0,
|
|
12554
|
+
const cssTriangle = useFloatingElement((0, import_react45.useMemo)(() => ({
|
|
12427
12555
|
active: isActive || isVisible,
|
|
12428
12556
|
anchorRef,
|
|
12429
12557
|
containerRef: triangleRef,
|
|
12430
12558
|
horizontalAlignment,
|
|
12431
12559
|
verticalAlignment
|
|
12432
12560
|
}), [horizontalAlignment, isActive, isVisible, verticalAlignment]));
|
|
12433
|
-
const regsitryOptions = (0,
|
|
12561
|
+
const regsitryOptions = (0, import_react45.useMemo)(() => ({ isActive }), [isActive]);
|
|
12434
12562
|
const { zIndex } = useOverlayRegistry(regsitryOptions);
|
|
12435
12563
|
const { zIndex: zIndexTriangle } = useOverlayRegistry(regsitryOptions);
|
|
12436
|
-
const onEnter = (0,
|
|
12564
|
+
const onEnter = (0, import_react45.useCallback)(() => {
|
|
12437
12565
|
setState((prevState) => {
|
|
12438
12566
|
if (prevState.isShown) {
|
|
12439
12567
|
clearTimeout(prevState.timer);
|
|
@@ -12453,7 +12581,7 @@ var Tooltip = ({
|
|
|
12453
12581
|
};
|
|
12454
12582
|
});
|
|
12455
12583
|
}, [appearDelay]);
|
|
12456
|
-
const onLeave = (0,
|
|
12584
|
+
const onLeave = (0, import_react45.useCallback)(() => {
|
|
12457
12585
|
setState((prevState) => {
|
|
12458
12586
|
if (!prevState.isShown) {
|
|
12459
12587
|
clearTimeout(prevState.timer);
|
|
@@ -12474,7 +12602,7 @@ var Tooltip = ({
|
|
|
12474
12602
|
};
|
|
12475
12603
|
});
|
|
12476
12604
|
}, [disappearDelay]);
|
|
12477
|
-
return /* @__PURE__ */ (0,
|
|
12605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
12478
12606
|
"div",
|
|
12479
12607
|
{
|
|
12480
12608
|
ref: anchorRef,
|
|
@@ -12483,9 +12611,9 @@ var Tooltip = ({
|
|
|
12483
12611
|
onPointerLeave: onLeave,
|
|
12484
12612
|
children: [
|
|
12485
12613
|
children,
|
|
12486
|
-
/* @__PURE__ */ (0,
|
|
12614
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Visibility, { isVisible: isActive || isVisible, children: [
|
|
12487
12615
|
(0, import_react_dom6.createPortal)(
|
|
12488
|
-
/* @__PURE__ */ (0,
|
|
12616
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12489
12617
|
"div",
|
|
12490
12618
|
{
|
|
12491
12619
|
ref: containerRef,
|
|
@@ -12501,7 +12629,7 @@ var Tooltip = ({
|
|
|
12501
12629
|
document.body
|
|
12502
12630
|
),
|
|
12503
12631
|
(0, import_react_dom6.createPortal)(
|
|
12504
|
-
/* @__PURE__ */ (0,
|
|
12632
|
+
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
|
|
12505
12633
|
"div",
|
|
12506
12634
|
{
|
|
12507
12635
|
ref: triangleRef,
|
|
@@ -12520,7 +12648,7 @@ var Tooltip = ({
|
|
|
12520
12648
|
};
|
|
12521
12649
|
|
|
12522
12650
|
// src/components/layout/table/TableSortButton.tsx
|
|
12523
|
-
var
|
|
12651
|
+
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
12524
12652
|
var TableSortButton = ({
|
|
12525
12653
|
sortDirection,
|
|
12526
12654
|
invert = false,
|
|
@@ -12532,16 +12660,16 @@ var TableSortButton = ({
|
|
|
12532
12660
|
}) => {
|
|
12533
12661
|
const translation = useHightideTranslation();
|
|
12534
12662
|
const { sortingsCount, index } = sortingIndexDisplay;
|
|
12535
|
-
let icon = /* @__PURE__ */ (0,
|
|
12663
|
+
let icon = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react15.ChevronsUpDown, { className: "size-4" });
|
|
12536
12664
|
if (sortDirection) {
|
|
12537
12665
|
let usedSortDirection = sortDirection;
|
|
12538
12666
|
if (invert) {
|
|
12539
12667
|
usedSortDirection = usedSortDirection === "desc" ? "asc" : "desc";
|
|
12540
12668
|
}
|
|
12541
|
-
icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0,
|
|
12669
|
+
icon = usedSortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react15.ChevronUp, { className: "size-4" }) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_lucide_react15.ChevronDown, { className: "size-4" });
|
|
12542
12670
|
}
|
|
12543
12671
|
const hasSortingIndex = !!sortingIndexDisplay && sortingsCount > 1 && index > 0;
|
|
12544
|
-
return /* @__PURE__ */ (0,
|
|
12672
|
+
return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Tooltip, { tooltip: translation("rSortingOrderAfter", { otherSortings: index - 1 }), disabled: !hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
|
|
12545
12673
|
Button,
|
|
12546
12674
|
{
|
|
12547
12675
|
layout: hasSortingIndex ? "default" : "icon",
|
|
@@ -12550,7 +12678,7 @@ var TableSortButton = ({
|
|
|
12550
12678
|
className: (0, import_clsx24.default)("relative", className),
|
|
12551
12679
|
...props,
|
|
12552
12680
|
children: [
|
|
12553
|
-
/* @__PURE__ */ (0,
|
|
12681
|
+
/* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Visibility, { isVisible: hasSortingIndex, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
|
|
12554
12682
|
"div",
|
|
12555
12683
|
{
|
|
12556
12684
|
className: (0, import_clsx24.default)("absolute bottom-0 right-1/2 translate-x-1/2 translate-y-2/3 z-1 primary coloring-solid rounded-full h-4 w-5 text-sm"),
|
|
@@ -12564,10 +12692,10 @@ var TableSortButton = ({
|
|
|
12564
12692
|
};
|
|
12565
12693
|
|
|
12566
12694
|
// src/components/layout/table/TableFilterButton.tsx
|
|
12567
|
-
var
|
|
12695
|
+
var import_lucide_react16 = require("lucide-react");
|
|
12568
12696
|
|
|
12569
12697
|
// src/components/user-interaction/Menu.tsx
|
|
12570
|
-
var
|
|
12698
|
+
var import_react48 = require("react");
|
|
12571
12699
|
var import_clsx25 = __toESM(require("clsx"));
|
|
12572
12700
|
|
|
12573
12701
|
// src/utils/bagFunctions.ts
|
|
@@ -12639,15 +12767,15 @@ var usePopoverPosition = (trigger, options) => {
|
|
|
12639
12767
|
};
|
|
12640
12768
|
|
|
12641
12769
|
// src/hooks/useHoverState.ts
|
|
12642
|
-
var
|
|
12770
|
+
var import_react46 = require("react");
|
|
12643
12771
|
var defaultUseHoverStateProps = {
|
|
12644
12772
|
closingDelay: 200,
|
|
12645
12773
|
isDisabled: false
|
|
12646
12774
|
};
|
|
12647
12775
|
var useHoverState = (props = void 0) => {
|
|
12648
12776
|
const { closingDelay, isDisabled } = { ...defaultUseHoverStateProps, ...props };
|
|
12649
|
-
const [isHovered, setIsHovered] = (0,
|
|
12650
|
-
const [timer, setTimer] = (0,
|
|
12777
|
+
const [isHovered, setIsHovered] = (0, import_react46.useState)(false);
|
|
12778
|
+
const [timer, setTimer] = (0, import_react46.useState)();
|
|
12651
12779
|
const onMouseEnter = () => {
|
|
12652
12780
|
if (isDisabled) {
|
|
12653
12781
|
return;
|
|
@@ -12663,14 +12791,14 @@ var useHoverState = (props = void 0) => {
|
|
|
12663
12791
|
setIsHovered(false);
|
|
12664
12792
|
}, closingDelay));
|
|
12665
12793
|
};
|
|
12666
|
-
(0,
|
|
12794
|
+
(0, import_react46.useEffect)(() => {
|
|
12667
12795
|
if (timer) {
|
|
12668
12796
|
return () => {
|
|
12669
12797
|
clearTimeout(timer);
|
|
12670
12798
|
};
|
|
12671
12799
|
}
|
|
12672
12800
|
});
|
|
12673
|
-
(0,
|
|
12801
|
+
(0, import_react46.useEffect)(() => {
|
|
12674
12802
|
if (timer) {
|
|
12675
12803
|
clearTimeout(timer);
|
|
12676
12804
|
}
|
|
@@ -12683,9 +12811,9 @@ var useHoverState = (props = void 0) => {
|
|
|
12683
12811
|
};
|
|
12684
12812
|
|
|
12685
12813
|
// src/hooks/useOutsideClick.ts
|
|
12686
|
-
var
|
|
12814
|
+
var import_react47 = require("react");
|
|
12687
12815
|
var useOutsideClick = (refs, handler) => {
|
|
12688
|
-
(0,
|
|
12816
|
+
(0, import_react47.useEffect)(() => {
|
|
12689
12817
|
const listener = (event) => {
|
|
12690
12818
|
if (event.target === null) return;
|
|
12691
12819
|
if (refs.some((ref) => !ref.current || ref.current.contains(event.target))) {
|
|
@@ -12703,14 +12831,14 @@ var useOutsideClick = (refs, handler) => {
|
|
|
12703
12831
|
};
|
|
12704
12832
|
|
|
12705
12833
|
// src/components/user-interaction/Menu.tsx
|
|
12706
|
-
var
|
|
12834
|
+
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
12707
12835
|
var MenuItem = ({
|
|
12708
12836
|
children,
|
|
12709
12837
|
onClick,
|
|
12710
12838
|
alignment = "left",
|
|
12711
12839
|
isDisabled = false,
|
|
12712
12840
|
className
|
|
12713
|
-
}) => /* @__PURE__ */ (0,
|
|
12841
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12714
12842
|
"div",
|
|
12715
12843
|
{
|
|
12716
12844
|
className: (0, import_clsx25.default)("block px-3 py-1.5 first:rounded-t-md last:rounded-b-md text-sm font-semibold text-nowrap", {
|
|
@@ -12743,10 +12871,10 @@ var Menu = ({
|
|
|
12743
12871
|
menuClassName = ""
|
|
12744
12872
|
}) => {
|
|
12745
12873
|
const { isHovered: isOpen, setIsHovered: setIsOpen } = useHoverState({ isDisabled: !showOnHover || disabled });
|
|
12746
|
-
const triggerRef = (0,
|
|
12747
|
-
const menuRef = (0,
|
|
12874
|
+
const triggerRef = (0, import_react48.useRef)(null);
|
|
12875
|
+
const menuRef = (0, import_react48.useRef)(null);
|
|
12748
12876
|
useOutsideClick([triggerRef, menuRef], () => setIsOpen(false));
|
|
12749
|
-
const [isHidden, setIsHidden] = (0,
|
|
12877
|
+
const [isHidden, setIsHidden] = (0, import_react48.useState)(true);
|
|
12750
12878
|
const bag = {
|
|
12751
12879
|
isOpen,
|
|
12752
12880
|
close: () => setIsOpen(false),
|
|
@@ -12757,7 +12885,7 @@ var Menu = ({
|
|
|
12757
12885
|
triggerRef.current?.getBoundingClientRect(),
|
|
12758
12886
|
{ verticalAlignment: alignmentVertical, horizontalAlignment: alignmentHorizontal, disabled }
|
|
12759
12887
|
);
|
|
12760
|
-
(0,
|
|
12888
|
+
(0, import_react48.useEffect)(() => {
|
|
12761
12889
|
if (!isOpen) return;
|
|
12762
12890
|
const triggerEl = triggerRef.current;
|
|
12763
12891
|
if (!triggerEl) return;
|
|
@@ -12774,7 +12902,7 @@ var Menu = ({
|
|
|
12774
12902
|
window.removeEventListener("resize", close3);
|
|
12775
12903
|
};
|
|
12776
12904
|
}, [isOpen, setIsOpen]);
|
|
12777
|
-
(0,
|
|
12905
|
+
(0, import_react48.useEffect)(() => {
|
|
12778
12906
|
if (isOpen) {
|
|
12779
12907
|
setIsHidden(false);
|
|
12780
12908
|
}
|
|
@@ -12782,9 +12910,9 @@ var Menu = ({
|
|
|
12782
12910
|
const { zIndex } = useOverlayRegistry({
|
|
12783
12911
|
isActive: isOpen
|
|
12784
12912
|
});
|
|
12785
|
-
return /* @__PURE__ */ (0,
|
|
12786
|
-
trigger(bag, (0,
|
|
12787
|
-
(0, import_react_dom7.createPortal)(/* @__PURE__ */ (0,
|
|
12913
|
+
return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [
|
|
12914
|
+
trigger(bag, (0, import_react48.useCallback)((el) => triggerRef.current = el, [])),
|
|
12915
|
+
(0, import_react_dom7.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime54.jsx)(
|
|
12788
12916
|
"div",
|
|
12789
12917
|
{
|
|
12790
12918
|
ref: menuRef,
|
|
@@ -12814,34 +12942,34 @@ var Menu = ({
|
|
|
12814
12942
|
};
|
|
12815
12943
|
|
|
12816
12944
|
// src/components/layout/table/TableFilterButton.tsx
|
|
12817
|
-
var
|
|
12818
|
-
var
|
|
12945
|
+
var import_react49 = require("react");
|
|
12946
|
+
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
12819
12947
|
var TableFilterButton = ({
|
|
12820
12948
|
filterType,
|
|
12821
12949
|
column
|
|
12822
12950
|
}) => {
|
|
12823
12951
|
const translation = useHightideTranslation();
|
|
12824
12952
|
const columnFilterValue = column.getFilterValue();
|
|
12825
|
-
const [filterValue, setFilterValue] = (0,
|
|
12953
|
+
const [filterValue, setFilterValue] = (0, import_react49.useState)(columnFilterValue);
|
|
12826
12954
|
const hasFilter = !!filterValue;
|
|
12827
|
-
(0,
|
|
12955
|
+
(0, import_react49.useEffect)(() => {
|
|
12828
12956
|
setFilterValue(columnFilterValue);
|
|
12829
12957
|
}, [columnFilterValue]);
|
|
12830
|
-
return /* @__PURE__ */ (0,
|
|
12958
|
+
return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12831
12959
|
Menu,
|
|
12832
12960
|
{
|
|
12833
|
-
trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ (0,
|
|
12834
|
-
/* @__PURE__ */ (0,
|
|
12961
|
+
trigger: ({ toggleOpen }, ref) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { ref, className: "relative", children: [
|
|
12962
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12835
12963
|
Button,
|
|
12836
12964
|
{
|
|
12837
12965
|
layout: "icon",
|
|
12838
12966
|
color: "neutral",
|
|
12839
12967
|
size: "xs",
|
|
12840
12968
|
onClick: toggleOpen,
|
|
12841
|
-
children: /* @__PURE__ */ (0,
|
|
12969
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_lucide_react16.FilterIcon, { className: "size-4" })
|
|
12842
12970
|
}
|
|
12843
12971
|
),
|
|
12844
|
-
hasFilter && /* @__PURE__ */ (0,
|
|
12972
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12845
12973
|
"div",
|
|
12846
12974
|
{
|
|
12847
12975
|
className: "absolute top-0.5 right-0.5 w-2 h-2 rounded-full bg-primary pointer-events-none",
|
|
@@ -12849,9 +12977,9 @@ var TableFilterButton = ({
|
|
|
12849
12977
|
}
|
|
12850
12978
|
)
|
|
12851
12979
|
] }),
|
|
12852
|
-
children: ({ close: close3 }) => /* @__PURE__ */ (0,
|
|
12853
|
-
/* @__PURE__ */ (0,
|
|
12854
|
-
filterType === "text" && /* @__PURE__ */ (0,
|
|
12980
|
+
children: ({ close: close3 }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex-col-1 p-2 items-start font-normal text-menu-text", children: [
|
|
12981
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("h4", { className: "typography-label-md-semibold", children: translation("filter") }),
|
|
12982
|
+
filterType === "text" && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12855
12983
|
Input,
|
|
12856
12984
|
{
|
|
12857
12985
|
value: filterValue ?? "",
|
|
@@ -12861,8 +12989,8 @@ var TableFilterButton = ({
|
|
|
12861
12989
|
className: "h-10"
|
|
12862
12990
|
}
|
|
12863
12991
|
),
|
|
12864
|
-
filterType === "range" && /* @__PURE__ */ (0,
|
|
12865
|
-
/* @__PURE__ */ (0,
|
|
12992
|
+
filterType === "range" && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
12993
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12866
12994
|
Input,
|
|
12867
12995
|
{
|
|
12868
12996
|
value: filterValue?.[0].toString() ?? "",
|
|
@@ -12875,8 +13003,8 @@ var TableFilterButton = ({
|
|
|
12875
13003
|
className: "h-10 input-indicator-hidden w-40"
|
|
12876
13004
|
}
|
|
12877
13005
|
),
|
|
12878
|
-
/* @__PURE__ */ (0,
|
|
12879
|
-
/* @__PURE__ */ (0,
|
|
13006
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)("span", { className: "font-bold", children: "-" }),
|
|
13007
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12880
13008
|
Input,
|
|
12881
13009
|
{
|
|
12882
13010
|
value: filterValue?.[1].toString() ?? "",
|
|
@@ -12890,8 +13018,8 @@ var TableFilterButton = ({
|
|
|
12890
13018
|
}
|
|
12891
13019
|
)
|
|
12892
13020
|
] }),
|
|
12893
|
-
filterType === "dateRange" && /* @__PURE__ */ (0,
|
|
12894
|
-
/* @__PURE__ */ (0,
|
|
13021
|
+
filterType === "dateRange" && /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
|
|
13022
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12895
13023
|
Input,
|
|
12896
13024
|
{
|
|
12897
13025
|
value: filterValue?.[0] ? filterValue?.[0].toISOString().slice(0, 16) : "",
|
|
@@ -12904,7 +13032,7 @@ var TableFilterButton = ({
|
|
|
12904
13032
|
className: "h-10 w-50"
|
|
12905
13033
|
}
|
|
12906
13034
|
),
|
|
12907
|
-
/* @__PURE__ */ (0,
|
|
13035
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
|
|
12908
13036
|
Input,
|
|
12909
13037
|
{
|
|
12910
13038
|
value: filterValue?.[1] ? filterValue?.[1].toISOString().slice(0, 16) : "",
|
|
@@ -12918,12 +13046,12 @@ var TableFilterButton = ({
|
|
|
12918
13046
|
}
|
|
12919
13047
|
)
|
|
12920
13048
|
] }),
|
|
12921
|
-
/* @__PURE__ */ (0,
|
|
12922
|
-
hasFilter && /* @__PURE__ */ (0,
|
|
13049
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsxs)("div", { className: "flex-row-2 justify-end w-full", children: [
|
|
13050
|
+
hasFilter && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Button, { color: "negative", size: "sm", onClick: () => {
|
|
12923
13051
|
column.setFilterValue(void 0);
|
|
12924
13052
|
close3();
|
|
12925
13053
|
}, children: translation("remove") }),
|
|
12926
|
-
/* @__PURE__ */ (0,
|
|
13054
|
+
/* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Button, { size: "sm", onClick: () => {
|
|
12927
13055
|
column.setFilterValue(filterValue);
|
|
12928
13056
|
close3();
|
|
12929
13057
|
}, children: translation("apply") })
|
|
@@ -12934,9 +13062,9 @@ var TableFilterButton = ({
|
|
|
12934
13062
|
};
|
|
12935
13063
|
|
|
12936
13064
|
// src/components/user-interaction/Checkbox.tsx
|
|
12937
|
-
var
|
|
12938
|
-
var
|
|
12939
|
-
var
|
|
13065
|
+
var import_lucide_react17 = require("lucide-react");
|
|
13066
|
+
var import_react50 = require("react");
|
|
13067
|
+
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
12940
13068
|
var Checkbox = ({
|
|
12941
13069
|
value = false,
|
|
12942
13070
|
indeterminate = false,
|
|
@@ -12950,11 +13078,11 @@ var Checkbox = ({
|
|
|
12950
13078
|
alwaysShowCheckIcon = false,
|
|
12951
13079
|
...props
|
|
12952
13080
|
}) => {
|
|
12953
|
-
const onChangeWrapper = (0,
|
|
13081
|
+
const onChangeWrapper = (0, import_react50.useCallback)(() => {
|
|
12954
13082
|
onValueChange?.(!value);
|
|
12955
13083
|
onEditComplete?.(!value);
|
|
12956
13084
|
}, [onEditComplete, onValueChange, value]);
|
|
12957
|
-
return /* @__PURE__ */ (0,
|
|
13085
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
|
|
12958
13086
|
"div",
|
|
12959
13087
|
{
|
|
12960
13088
|
...props,
|
|
@@ -12981,8 +13109,8 @@ var Checkbox = ({
|
|
|
12981
13109
|
"aria-checked": indeterminate ? "mixed" : value,
|
|
12982
13110
|
...PropsUtil.aria.interactionStates({ disabled, invalid, readOnly, required }, props),
|
|
12983
13111
|
children: [
|
|
12984
|
-
/* @__PURE__ */ (0,
|
|
12985
|
-
/* @__PURE__ */ (0,
|
|
13112
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Visibility, { isVisible: indeterminate, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react17.Minus, { "data-name": "checkbox-indicator", "aria-hidden": true }) }),
|
|
13113
|
+
/* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Visibility, { isVisible: !indeterminate && (alwaysShowCheckIcon || value), children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_lucide_react17.Check, { "data-name": "checkbox-indicator", "aria-hidden": true }) })
|
|
12986
13114
|
]
|
|
12987
13115
|
}
|
|
12988
13116
|
);
|
|
@@ -12993,7 +13121,7 @@ var CheckboxUncontrolled = ({
|
|
|
12993
13121
|
...props
|
|
12994
13122
|
}) => {
|
|
12995
13123
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
12996
|
-
return /* @__PURE__ */ (0,
|
|
13124
|
+
return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
|
|
12997
13125
|
Checkbox,
|
|
12998
13126
|
{
|
|
12999
13127
|
...props,
|
|
@@ -13004,7 +13132,7 @@ var CheckboxUncontrolled = ({
|
|
|
13004
13132
|
};
|
|
13005
13133
|
|
|
13006
13134
|
// src/components/layout/table/Table.tsx
|
|
13007
|
-
var
|
|
13135
|
+
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
13008
13136
|
var Table = ({
|
|
13009
13137
|
data,
|
|
13010
13138
|
fillerRow,
|
|
@@ -13018,22 +13146,22 @@ var Table = ({
|
|
|
13018
13146
|
columns,
|
|
13019
13147
|
...tableOptions
|
|
13020
13148
|
}) => {
|
|
13021
|
-
const ref = (0,
|
|
13022
|
-
const tableRef = (0,
|
|
13023
|
-
const [columnSizing, setColumnSizing] = (0,
|
|
13149
|
+
const ref = (0, import_react51.useRef)(null);
|
|
13150
|
+
const tableRef = (0, import_react51.useRef)(null);
|
|
13151
|
+
const [columnSizing, setColumnSizing] = (0, import_react51.useState)(columns.reduce((previousValue, currentValue) => {
|
|
13024
13152
|
return {
|
|
13025
13153
|
...previousValue,
|
|
13026
13154
|
[currentValue.id]: currentValue.minSize ?? defaultColumn.minSize
|
|
13027
13155
|
};
|
|
13028
13156
|
}, {}));
|
|
13029
|
-
const [columnSizingInfo, setColumnSizingInfo] = (0,
|
|
13030
|
-
const [pagination, setPagination] = (0,
|
|
13157
|
+
const [columnSizingInfo, setColumnSizingInfo] = (0, import_react51.useState)();
|
|
13158
|
+
const [pagination, setPagination] = (0, import_react51.useState)({
|
|
13031
13159
|
pageSize: 10,
|
|
13032
13160
|
pageIndex: 0,
|
|
13033
13161
|
...initialState?.pagination
|
|
13034
13162
|
});
|
|
13035
|
-
const [columnFilters, setColumnFilters] = (0,
|
|
13036
|
-
const computedColumnMinWidths = (0,
|
|
13163
|
+
const [columnFilters, setColumnFilters] = (0, import_react51.useState)(initialState?.columnFilters);
|
|
13164
|
+
const computedColumnMinWidths = (0, import_react51.useMemo)(() => {
|
|
13037
13165
|
return columns.reduce((previousValue, column) => {
|
|
13038
13166
|
return {
|
|
13039
13167
|
...previousValue,
|
|
@@ -13042,7 +13170,7 @@ var Table = ({
|
|
|
13042
13170
|
};
|
|
13043
13171
|
}, {});
|
|
13044
13172
|
}, [columns, defaultColumn]);
|
|
13045
|
-
const computedColumnMaxWidths = (0,
|
|
13173
|
+
const computedColumnMaxWidths = (0, import_react51.useMemo)(() => {
|
|
13046
13174
|
return columns.reduce((previousValue, column) => {
|
|
13047
13175
|
return {
|
|
13048
13176
|
...previousValue,
|
|
@@ -13050,12 +13178,12 @@ var Table = ({
|
|
|
13050
13178
|
};
|
|
13051
13179
|
}, {});
|
|
13052
13180
|
}, [columns, defaultColumn]);
|
|
13053
|
-
const tableMinWidth = (0,
|
|
13181
|
+
const tableMinWidth = (0, import_react51.useMemo)(() => {
|
|
13054
13182
|
return columns.reduce((sum, column) => {
|
|
13055
13183
|
return sum + computedColumnMinWidths[column.id];
|
|
13056
13184
|
}, 0);
|
|
13057
13185
|
}, [columns, computedColumnMinWidths]);
|
|
13058
|
-
const updateColumnSizes = (0,
|
|
13186
|
+
const updateColumnSizes = (0, import_react51.useMemo)(() => {
|
|
13059
13187
|
return (previous) => {
|
|
13060
13188
|
const updateSizing = {
|
|
13061
13189
|
...columnSizing,
|
|
@@ -13124,7 +13252,7 @@ var Table = ({
|
|
|
13124
13252
|
minSize: 60,
|
|
13125
13253
|
maxSize: 700,
|
|
13126
13254
|
cell: ({ cell }) => {
|
|
13127
|
-
return /* @__PURE__ */ (0,
|
|
13255
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(TableCell, { children: cell.getValue() });
|
|
13128
13256
|
},
|
|
13129
13257
|
...defaultColumn
|
|
13130
13258
|
},
|
|
@@ -13172,18 +13300,18 @@ var Table = ({
|
|
|
13172
13300
|
columnResizeMode: "onChange",
|
|
13173
13301
|
...tableOptions
|
|
13174
13302
|
});
|
|
13175
|
-
const [hasInitializedSizing, setHasInitializedSizing] = (0,
|
|
13176
|
-
(0,
|
|
13303
|
+
const [hasInitializedSizing, setHasInitializedSizing] = (0, import_react51.useState)(false);
|
|
13304
|
+
(0, import_react51.useEffect)(() => {
|
|
13177
13305
|
if (!hasInitializedSizing && ref.current) {
|
|
13178
13306
|
setHasInitializedSizing(true);
|
|
13179
13307
|
table.setColumnSizing(updateColumnSizes(columnSizing));
|
|
13180
13308
|
}
|
|
13181
13309
|
}, [columnSizing, hasInitializedSizing]);
|
|
13182
|
-
useResizeCallbackWrapper((0,
|
|
13310
|
+
useResizeCallbackWrapper((0, import_react51.useCallback)(() => {
|
|
13183
13311
|
table.setColumnSizing(updateColumnSizes);
|
|
13184
13312
|
}, [updateColumnSizes]));
|
|
13185
13313
|
const pageCount = table.getPageCount();
|
|
13186
|
-
(0,
|
|
13314
|
+
(0, import_react51.useEffect)(() => {
|
|
13187
13315
|
const totalPages = pageCount;
|
|
13188
13316
|
if (totalPages === 0) {
|
|
13189
13317
|
if (pagination.pageIndex !== 0) {
|
|
@@ -13199,7 +13327,7 @@ var Table = ({
|
|
|
13199
13327
|
}));
|
|
13200
13328
|
}
|
|
13201
13329
|
}, [data, pageCount, pagination.pageSize, pagination.pageIndex]);
|
|
13202
|
-
const columnSizeVars = (0,
|
|
13330
|
+
const columnSizeVars = (0, import_react51.useMemo)(() => {
|
|
13203
13331
|
const headers = table.getFlatHeaders();
|
|
13204
13332
|
const colSizes = {};
|
|
13205
13333
|
for (let i = 0; i < headers.length; i++) {
|
|
@@ -13209,8 +13337,8 @@ var Table = ({
|
|
|
13209
13337
|
}
|
|
13210
13338
|
return colSizes;
|
|
13211
13339
|
}, [table.getState().columnSizingInfo, table.getState().columnSizing]);
|
|
13212
|
-
return /* @__PURE__ */ (0,
|
|
13213
|
-
/* @__PURE__ */ (0,
|
|
13340
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { ref, "data-name": PropsUtil.dataAttributes.name("table-container"), className, children: [
|
|
13341
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { "data-name": PropsUtil.dataAttributes.name("table-scroll-wrapper"), className: tableContainerClassName, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
13214
13342
|
"table",
|
|
13215
13343
|
{
|
|
13216
13344
|
ref: tableRef,
|
|
@@ -13221,7 +13349,7 @@ var Table = ({
|
|
|
13221
13349
|
},
|
|
13222
13350
|
className: tableClassName,
|
|
13223
13351
|
children: [
|
|
13224
|
-
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0,
|
|
13352
|
+
table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("colgroup", { children: headerGroup.headers.map((header) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13225
13353
|
"col",
|
|
13226
13354
|
{
|
|
13227
13355
|
style: {
|
|
@@ -13232,16 +13360,16 @@ var Table = ({
|
|
|
13232
13360
|
},
|
|
13233
13361
|
header.id
|
|
13234
13362
|
)) }, headerGroup.id)),
|
|
13235
|
-
/* @__PURE__ */ (0,
|
|
13236
|
-
return /* @__PURE__ */ (0,
|
|
13363
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("thead", { children: table.getHeaderGroups().map((headerGroup) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("tr", { "data-name": PropsUtil.dataAttributes.name("table-header-row"), className: table.options.meta?.headerRowClassName, children: headerGroup.headers.map((header) => {
|
|
13364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
|
|
13237
13365
|
"th",
|
|
13238
13366
|
{
|
|
13239
13367
|
colSpan: header.colSpan,
|
|
13240
13368
|
"data-name": PropsUtil.dataAttributes.name("table-header-cell"),
|
|
13241
13369
|
className: (0, import_clsx26.default)("group/table-header-cell", header.column.columnDef.meta?.className),
|
|
13242
13370
|
children: [
|
|
13243
|
-
/* @__PURE__ */ (0,
|
|
13244
|
-
/* @__PURE__ */ (0,
|
|
13371
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Visibility, { isVisible: !header.isPlaceholder, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex-row-1 items-center", children: [
|
|
13372
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Visibility, { isVisible: header.column.getCanSort(), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13245
13373
|
TableSortButton,
|
|
13246
13374
|
{
|
|
13247
13375
|
sortDirection: header.column.getIsSorted(),
|
|
@@ -13267,7 +13395,7 @@ var Table = ({
|
|
|
13267
13395
|
}
|
|
13268
13396
|
}
|
|
13269
13397
|
) }),
|
|
13270
|
-
/* @__PURE__ */ (0,
|
|
13398
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Visibility, { isVisible: header.column.getCanFilter() && !!header.column.columnDef.meta?.filterType, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13271
13399
|
TableFilterButton,
|
|
13272
13400
|
{
|
|
13273
13401
|
column: header.column,
|
|
@@ -13279,7 +13407,7 @@ var Table = ({
|
|
|
13279
13407
|
header.getContext()
|
|
13280
13408
|
)
|
|
13281
13409
|
] }) }),
|
|
13282
|
-
/* @__PURE__ */ (0,
|
|
13410
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Visibility, { isVisible: header.column.getCanResize(), children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13283
13411
|
"div",
|
|
13284
13412
|
{
|
|
13285
13413
|
onPointerDown: header.getResizeHandler(),
|
|
@@ -13300,16 +13428,16 @@ var Table = ({
|
|
|
13300
13428
|
header.id
|
|
13301
13429
|
);
|
|
13302
13430
|
}) }, headerGroup.id)) }),
|
|
13303
|
-
/* @__PURE__ */ (0,
|
|
13431
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("tbody", { children: [
|
|
13304
13432
|
table.getRowModel().rows.map((row) => {
|
|
13305
|
-
return /* @__PURE__ */ (0,
|
|
13433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13306
13434
|
"tr",
|
|
13307
13435
|
{
|
|
13308
13436
|
onClick: () => onRowClick?.(row, table),
|
|
13309
13437
|
"data-name": "table-body-row",
|
|
13310
13438
|
className: BagFunctionUtil.resolve(table.options.meta?.bodyRowClassName, row.original),
|
|
13311
13439
|
children: row.getVisibleCells().map((cell) => {
|
|
13312
|
-
return /* @__PURE__ */ (0,
|
|
13440
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("td", { "data-name": "table-body-cell", children: (0, import_react_table.flexRender)(
|
|
13313
13441
|
cell.column.columnDef.cell,
|
|
13314
13442
|
cell.getContext()
|
|
13315
13443
|
) }, cell.id);
|
|
@@ -13319,15 +13447,15 @@ var Table = ({
|
|
|
13319
13447
|
);
|
|
13320
13448
|
}),
|
|
13321
13449
|
range(table.getState().pagination.pageSize - table.getRowModel().rows.length, { allowEmptyRange: true }).map((row, index) => {
|
|
13322
|
-
return /* @__PURE__ */ (0,
|
|
13323
|
-
return /* @__PURE__ */ (0,
|
|
13450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("tr", { children: columns.map((column) => {
|
|
13451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("td", { children: fillerRow ? fillerRow(column.id, table) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FillerCell, {}) }, column.id);
|
|
13324
13452
|
}) }, "filler-row-" + index);
|
|
13325
13453
|
})
|
|
13326
13454
|
] })
|
|
13327
13455
|
]
|
|
13328
13456
|
}
|
|
13329
13457
|
) }),
|
|
13330
|
-
/* @__PURE__ */ (0,
|
|
13458
|
+
/* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "flex-row-2 justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13331
13459
|
Pagination,
|
|
13332
13460
|
{
|
|
13333
13461
|
pageIndex: table.getState().pagination.pageIndex,
|
|
@@ -13339,7 +13467,7 @@ var Table = ({
|
|
|
13339
13467
|
};
|
|
13340
13468
|
var TableUncontrolled = ({ data, ...props }) => {
|
|
13341
13469
|
const [usedDate] = useOverwritableState(data);
|
|
13342
|
-
return /* @__PURE__ */ (0,
|
|
13470
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13343
13471
|
Table,
|
|
13344
13472
|
{
|
|
13345
13473
|
...props,
|
|
@@ -13358,12 +13486,12 @@ var TableWithSelection = ({
|
|
|
13358
13486
|
meta,
|
|
13359
13487
|
...props
|
|
13360
13488
|
}) => {
|
|
13361
|
-
const columnsWithSelection = (0,
|
|
13489
|
+
const columnsWithSelection = (0, import_react51.useMemo)(() => {
|
|
13362
13490
|
return [
|
|
13363
13491
|
{
|
|
13364
13492
|
id: selectionRowId,
|
|
13365
13493
|
header: ({ table }) => {
|
|
13366
|
-
return /* @__PURE__ */ (0,
|
|
13494
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13367
13495
|
Checkbox,
|
|
13368
13496
|
{
|
|
13369
13497
|
value: table.getIsAllRowsSelected(),
|
|
@@ -13376,7 +13504,7 @@ var TableWithSelection = ({
|
|
|
13376
13504
|
);
|
|
13377
13505
|
},
|
|
13378
13506
|
cell: ({ row }) => {
|
|
13379
|
-
return /* @__PURE__ */ (0,
|
|
13507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13380
13508
|
Checkbox,
|
|
13381
13509
|
{
|
|
13382
13510
|
disabled: !row.getCanSelect(),
|
|
@@ -13394,15 +13522,15 @@ var TableWithSelection = ({
|
|
|
13394
13522
|
...columns
|
|
13395
13523
|
];
|
|
13396
13524
|
}, [columns, selectionRowId]);
|
|
13397
|
-
return /* @__PURE__ */ (0,
|
|
13525
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
|
|
13398
13526
|
Table,
|
|
13399
13527
|
{
|
|
13400
13528
|
columns: columnsWithSelection,
|
|
13401
13529
|
fillerRow: (columnId, table) => {
|
|
13402
13530
|
if (columnId === selectionRowId) {
|
|
13403
|
-
return /* @__PURE__ */ (0,
|
|
13531
|
+
return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Checkbox, { value: false, disabled: true, className: "max-w-6" });
|
|
13404
13532
|
}
|
|
13405
|
-
return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ (0,
|
|
13533
|
+
return fillerRow ? fillerRow(columnId, table) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(FillerCell, {});
|
|
13406
13534
|
},
|
|
13407
13535
|
state: {
|
|
13408
13536
|
rowSelection,
|
|
@@ -13427,7 +13555,7 @@ var TableWithSelection = ({
|
|
|
13427
13555
|
};
|
|
13428
13556
|
|
|
13429
13557
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
13430
|
-
var
|
|
13558
|
+
var import_react52 = require("react");
|
|
13431
13559
|
var import_clsx27 = require("clsx");
|
|
13432
13560
|
|
|
13433
13561
|
// src/utils/writeToClipboard.ts
|
|
@@ -13436,8 +13564,8 @@ var writeToClipboard = (text) => {
|
|
|
13436
13564
|
};
|
|
13437
13565
|
|
|
13438
13566
|
// src/components/user-interaction/CopyToClipboardWrapper.tsx
|
|
13439
|
-
var
|
|
13440
|
-
var
|
|
13567
|
+
var import_lucide_react18 = require("lucide-react");
|
|
13568
|
+
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
13441
13569
|
var CopyToClipboardWrapper = ({
|
|
13442
13570
|
children,
|
|
13443
13571
|
textToCopy,
|
|
@@ -13447,8 +13575,8 @@ var CopyToClipboardWrapper = ({
|
|
|
13447
13575
|
zIndex = 10
|
|
13448
13576
|
}) => {
|
|
13449
13577
|
const translation = useHightideTranslation();
|
|
13450
|
-
const [isShowingIndication, setIsShowingIndication] = (0,
|
|
13451
|
-
const [isShowingConfirmation, setIsShowingConfirmation] = (0,
|
|
13578
|
+
const [isShowingIndication, setIsShowingIndication] = (0, import_react52.useState)(false);
|
|
13579
|
+
const [isShowingConfirmation, setIsShowingConfirmation] = (0, import_react52.useState)(false);
|
|
13452
13580
|
const positionClasses = {
|
|
13453
13581
|
top: `bottom-full left-1/2 -translate-x-1/2 mb-[6px]`,
|
|
13454
13582
|
bottom: `top-full left-1/2 -translate-x-1/2 mt-[6px]`,
|
|
@@ -13468,7 +13596,7 @@ var CopyToClipboardWrapper = ({
|
|
|
13468
13596
|
left: { borderWidth: `${triangleSize}px 0 ${triangleSize}px ${triangleSize}px` },
|
|
13469
13597
|
right: { borderWidth: `${triangleSize}px ${triangleSize}px ${triangleSize}px 0` }
|
|
13470
13598
|
};
|
|
13471
|
-
return /* @__PURE__ */ (0,
|
|
13599
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
13472
13600
|
"div",
|
|
13473
13601
|
{
|
|
13474
13602
|
className: (0, import_clsx27.clsx)("relative inline-block cursor-copy", containerClassName),
|
|
@@ -13486,7 +13614,7 @@ var CopyToClipboardWrapper = ({
|
|
|
13486
13614
|
},
|
|
13487
13615
|
children: [
|
|
13488
13616
|
children,
|
|
13489
|
-
/* @__PURE__ */ (0,
|
|
13617
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
|
|
13490
13618
|
"div",
|
|
13491
13619
|
{
|
|
13492
13620
|
className: (0, import_clsx27.clsx)(
|
|
@@ -13501,15 +13629,15 @@ var CopyToClipboardWrapper = ({
|
|
|
13501
13629
|
opacity: isShowingIndication || isShowingConfirmation ? 1 : 0
|
|
13502
13630
|
},
|
|
13503
13631
|
children: [
|
|
13504
|
-
isShowingConfirmation && /* @__PURE__ */ (0,
|
|
13505
|
-
/* @__PURE__ */ (0,
|
|
13632
|
+
isShowingConfirmation && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex-row-1", children: [
|
|
13633
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react18.CheckIcon, { size: 16, className: "text-positive" }),
|
|
13506
13634
|
translation("copied")
|
|
13507
13635
|
] }),
|
|
13508
|
-
isShowingIndication && /* @__PURE__ */ (0,
|
|
13509
|
-
/* @__PURE__ */ (0,
|
|
13636
|
+
isShowingIndication && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: "flex-row-1 text-description", children: [
|
|
13637
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_lucide_react18.Copy, { size: 16 }),
|
|
13510
13638
|
translation("clickToCopy")
|
|
13511
13639
|
] }),
|
|
13512
|
-
/* @__PURE__ */ (0,
|
|
13640
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
13513
13641
|
"div",
|
|
13514
13642
|
{
|
|
13515
13643
|
className: (0, import_clsx27.clsx)(`absolute w-0 h-0`, triangleClasses[position]),
|
|
@@ -13525,9 +13653,9 @@ var CopyToClipboardWrapper = ({
|
|
|
13525
13653
|
};
|
|
13526
13654
|
|
|
13527
13655
|
// src/components/user-interaction/ScrollPicker.tsx
|
|
13528
|
-
var
|
|
13656
|
+
var import_react53 = require("react");
|
|
13529
13657
|
var import_clsx28 = __toESM(require("clsx"));
|
|
13530
|
-
var
|
|
13658
|
+
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
13531
13659
|
var up = 1;
|
|
13532
13660
|
var down = -1;
|
|
13533
13661
|
var ScrollPicker = ({
|
|
@@ -13546,7 +13674,7 @@ var ScrollPicker = ({
|
|
|
13546
13674
|
transition,
|
|
13547
13675
|
items,
|
|
13548
13676
|
lastTimeStamp
|
|
13549
|
-
}, setAnimation] = (0,
|
|
13677
|
+
}, setAnimation] = (0, import_react53.useState)({
|
|
13550
13678
|
targetIndex: selectedIndex,
|
|
13551
13679
|
currentIndex: disabled ? selectedIndex : 0,
|
|
13552
13680
|
velocity: 0,
|
|
@@ -13562,7 +13690,7 @@ var ScrollPicker = ({
|
|
|
13562
13690
|
const itemHeight = 40;
|
|
13563
13691
|
const distance = 8;
|
|
13564
13692
|
const containerHeight = itemHeight * (itemsShownCount - 2) + distance * (itemsShownCount - 2 + 1);
|
|
13565
|
-
const getDirection = (0,
|
|
13693
|
+
const getDirection = (0, import_react53.useCallback)((targetIndex, currentIndex2, transition2, length) => {
|
|
13566
13694
|
if (targetIndex === currentIndex2) {
|
|
13567
13695
|
return transition2 > 0 ? up : down;
|
|
13568
13696
|
}
|
|
@@ -13572,7 +13700,7 @@ var ScrollPicker = ({
|
|
|
13572
13700
|
}
|
|
13573
13701
|
return distanceForward >= length / 2 ? down : up;
|
|
13574
13702
|
}, []);
|
|
13575
|
-
const animate = (0,
|
|
13703
|
+
const animate = (0, import_react53.useCallback)((timestamp, startTime) => {
|
|
13576
13704
|
setAnimation((prevState) => {
|
|
13577
13705
|
const {
|
|
13578
13706
|
targetIndex,
|
|
@@ -13645,7 +13773,7 @@ var ScrollPicker = ({
|
|
|
13645
13773
|
};
|
|
13646
13774
|
});
|
|
13647
13775
|
}, [disabled, getDirection, onChange]);
|
|
13648
|
-
(0,
|
|
13776
|
+
(0, import_react53.useEffect)(() => {
|
|
13649
13777
|
requestAnimationFrame((timestamp) => animate(timestamp, lastTimeStamp));
|
|
13650
13778
|
});
|
|
13651
13779
|
const opacity = (transition2, index, itemsCount) => {
|
|
@@ -13666,7 +13794,7 @@ var ScrollPicker = ({
|
|
|
13666
13794
|
}
|
|
13667
13795
|
return clamp(1 - opacityValue / max);
|
|
13668
13796
|
};
|
|
13669
|
-
return /* @__PURE__ */ (0,
|
|
13797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13670
13798
|
"div",
|
|
13671
13799
|
{
|
|
13672
13800
|
className: "relative overflow-hidden",
|
|
@@ -13677,15 +13805,15 @@ var ScrollPicker = ({
|
|
|
13677
13805
|
setAnimation(({ velocity, ...animationData }) => ({ ...animationData, velocity: velocity + deltaY }));
|
|
13678
13806
|
}
|
|
13679
13807
|
},
|
|
13680
|
-
children: /* @__PURE__ */ (0,
|
|
13681
|
-
/* @__PURE__ */ (0,
|
|
13808
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("div", { className: "absolute top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2", children: [
|
|
13809
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13682
13810
|
"div",
|
|
13683
13811
|
{
|
|
13684
13812
|
className: "absolute z-[1] top-1/2 -translate-y-1/2 -translate-x-1/2 left-1/2 w-full min-w-[40px] border border-divider/50 border-y-2 border-x-0 ",
|
|
13685
13813
|
style: { height: `${itemHeight}px` }
|
|
13686
13814
|
}
|
|
13687
13815
|
),
|
|
13688
|
-
/* @__PURE__ */ (0,
|
|
13816
|
+
/* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13689
13817
|
"div",
|
|
13690
13818
|
{
|
|
13691
13819
|
className: "flex-col-2 select-none",
|
|
@@ -13693,7 +13821,7 @@ var ScrollPicker = ({
|
|
|
13693
13821
|
transform: `translateY(${-transition * (distance + itemHeight)}px)`,
|
|
13694
13822
|
columnGap: `${distance}px`
|
|
13695
13823
|
},
|
|
13696
|
-
children: shownItems.map(({ name: name2, index }, arrayIndex) => /* @__PURE__ */ (0,
|
|
13824
|
+
children: shownItems.map(({ name: name2, index }, arrayIndex) => /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
|
|
13697
13825
|
"div",
|
|
13698
13826
|
{
|
|
13699
13827
|
className: (0, import_clsx28.default)(
|
|
@@ -13723,10 +13851,10 @@ var ScrollPicker = ({
|
|
|
13723
13851
|
};
|
|
13724
13852
|
|
|
13725
13853
|
// src/components/user-interaction/Textarea.tsx
|
|
13726
|
-
var
|
|
13854
|
+
var import_react54 = require("react");
|
|
13727
13855
|
var import_clsx29 = __toESM(require("clsx"));
|
|
13728
|
-
var
|
|
13729
|
-
var Textarea = (0,
|
|
13856
|
+
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
13857
|
+
var Textarea = (0, import_react54.forwardRef)(function Textarea2({
|
|
13730
13858
|
invalid = false,
|
|
13731
13859
|
onValueChange,
|
|
13732
13860
|
onEditComplete,
|
|
@@ -13738,7 +13866,7 @@ var Textarea = (0, import_react50.forwardRef)(function Textarea2({
|
|
|
13738
13866
|
onEditComplete?.(text);
|
|
13739
13867
|
clearTimer();
|
|
13740
13868
|
};
|
|
13741
|
-
return /* @__PURE__ */ (0,
|
|
13869
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13742
13870
|
"textarea",
|
|
13743
13871
|
{
|
|
13744
13872
|
...props,
|
|
@@ -13768,7 +13896,7 @@ var TextareaUncontrolled = ({
|
|
|
13768
13896
|
...props
|
|
13769
13897
|
}) => {
|
|
13770
13898
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
13771
|
-
return /* @__PURE__ */ (0,
|
|
13899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13772
13900
|
Textarea,
|
|
13773
13901
|
{
|
|
13774
13902
|
...props,
|
|
@@ -13786,9 +13914,9 @@ var TextareaWithHeadline = ({
|
|
|
13786
13914
|
containerClassName,
|
|
13787
13915
|
...props
|
|
13788
13916
|
}) => {
|
|
13789
|
-
const genId = (0,
|
|
13917
|
+
const genId = (0, import_react54.useId)();
|
|
13790
13918
|
const usedId = id ?? genId;
|
|
13791
|
-
return /* @__PURE__ */ (0,
|
|
13919
|
+
return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
|
|
13792
13920
|
"div",
|
|
13793
13921
|
{
|
|
13794
13922
|
className: (0, import_clsx29.default)(
|
|
@@ -13800,8 +13928,8 @@ var TextareaWithHeadline = ({
|
|
|
13800
13928
|
containerClassName
|
|
13801
13929
|
),
|
|
13802
13930
|
children: [
|
|
13803
|
-
headline && /* @__PURE__ */ (0,
|
|
13804
|
-
/* @__PURE__ */ (0,
|
|
13931
|
+
headline && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("label", { ...headlineProps, htmlFor: usedId, className: (0, import_clsx29.default)("typography-lable-md text-label", headlineProps.className), children: headline }),
|
|
13932
|
+
/* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
|
|
13805
13933
|
Textarea,
|
|
13806
13934
|
{
|
|
13807
13935
|
...props,
|
|
@@ -13818,8 +13946,8 @@ var TextareaWithHeadline = ({
|
|
|
13818
13946
|
};
|
|
13819
13947
|
|
|
13820
13948
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
13821
|
-
var
|
|
13822
|
-
var
|
|
13949
|
+
var import_react57 = require("react");
|
|
13950
|
+
var import_lucide_react19 = require("lucide-react");
|
|
13823
13951
|
|
|
13824
13952
|
// src/utils/date.ts
|
|
13825
13953
|
var monthsList = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"];
|
|
@@ -13995,8 +14123,8 @@ var DateUtils = {
|
|
|
13995
14123
|
var import_clsx31 = __toESM(require("clsx"));
|
|
13996
14124
|
|
|
13997
14125
|
// src/components/user-interaction/date/DayPicker.tsx
|
|
13998
|
-
var
|
|
13999
|
-
var
|
|
14126
|
+
var import_react55 = require("react");
|
|
14127
|
+
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
14000
14128
|
var DayPicker = ({
|
|
14001
14129
|
displayedMonth,
|
|
14002
14130
|
value,
|
|
@@ -14011,22 +14139,22 @@ var DayPicker = ({
|
|
|
14011
14139
|
const { locale } = useLocale();
|
|
14012
14140
|
const month = displayedMonth.getMonth();
|
|
14013
14141
|
const weeks = getWeeksForCalenderMonth(displayedMonth, weekStart);
|
|
14014
|
-
const end = (0,
|
|
14142
|
+
const end = (0, import_react55.useMemo)(() => {
|
|
14015
14143
|
if (!providedEnd) return;
|
|
14016
14144
|
return new Date(providedEnd.getFullYear(), providedEnd.getMonth(), providedEnd.getDate());
|
|
14017
14145
|
}, [providedEnd]);
|
|
14018
|
-
const start = (0,
|
|
14146
|
+
const start = (0, import_react55.useMemo)(() => {
|
|
14019
14147
|
if (!providedStart) return;
|
|
14020
14148
|
return new Date(providedStart.getFullYear(), providedStart.getMonth(), providedStart.getDate());
|
|
14021
14149
|
}, [providedStart]);
|
|
14022
|
-
return /* @__PURE__ */ (0,
|
|
14023
|
-
/* @__PURE__ */ (0,
|
|
14024
|
-
weeks.map((week, index) => /* @__PURE__ */ (0,
|
|
14150
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className, "data-name": "day-picker-container", children: [
|
|
14151
|
+
/* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { "data-name": "day-picker-header-row", children: weeks[0].map((weekDay, index) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { "data-name": "day-picker-header-item", children: new Intl.DateTimeFormat(locale, { weekday: "long" }).format(weekDay).substring(0, 2) }, index)) }),
|
|
14152
|
+
weeks.map((week, index) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { "data-name": "day-picker-body-row", children: week.map((date) => {
|
|
14025
14153
|
const isSelected = !!value && DateUtils.equalDate(value, date);
|
|
14026
14154
|
const isToday = DateUtils.equalDate(/* @__PURE__ */ new Date(), date);
|
|
14027
14155
|
const isSameMonth = date.getMonth() === month;
|
|
14028
14156
|
const isDayValid = isInTimeSpan(date, start, end);
|
|
14029
|
-
return /* @__PURE__ */ (0,
|
|
14157
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
14030
14158
|
"button",
|
|
14031
14159
|
{
|
|
14032
14160
|
disabled: !isDayValid,
|
|
@@ -14060,7 +14188,7 @@ var DayPickerUncontrolled = ({
|
|
|
14060
14188
|
...props
|
|
14061
14189
|
}) => {
|
|
14062
14190
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14063
|
-
return /* @__PURE__ */ (0,
|
|
14191
|
+
return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
|
|
14064
14192
|
DayPicker,
|
|
14065
14193
|
{
|
|
14066
14194
|
value,
|
|
@@ -14071,10 +14199,10 @@ var DayPickerUncontrolled = ({
|
|
|
14071
14199
|
};
|
|
14072
14200
|
|
|
14073
14201
|
// src/components/user-interaction/date/YearMonthPicker.tsx
|
|
14074
|
-
var
|
|
14202
|
+
var import_react56 = require("react");
|
|
14075
14203
|
var import_clsx30 = __toESM(require("clsx"));
|
|
14076
|
-
var
|
|
14077
|
-
var YearRow = (0,
|
|
14204
|
+
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
14205
|
+
var YearRow = (0, import_react56.memo)(function YearRow2({
|
|
14078
14206
|
year,
|
|
14079
14207
|
selectedMonthIndex,
|
|
14080
14208
|
minTimestamp,
|
|
@@ -14082,31 +14210,31 @@ var YearRow = (0, import_react52.memo)(function YearRow2({
|
|
|
14082
14210
|
monthNames,
|
|
14083
14211
|
onSelect
|
|
14084
14212
|
}) {
|
|
14085
|
-
const ref = (0,
|
|
14213
|
+
const ref = (0, import_react56.useRef)(null);
|
|
14086
14214
|
const isSelectedYear = selectedMonthIndex !== void 0;
|
|
14087
|
-
const [isExpanded, setIsExpanded] = (0,
|
|
14088
|
-
(0,
|
|
14215
|
+
const [isExpanded, setIsExpanded] = (0, import_react56.useState)(false);
|
|
14216
|
+
(0, import_react56.useEffect)(() => {
|
|
14089
14217
|
if (isSelectedYear) {
|
|
14090
14218
|
ref.current?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
14091
14219
|
}
|
|
14092
14220
|
}, [isSelectedYear]);
|
|
14093
|
-
const monthGrid = (0,
|
|
14094
|
-
return /* @__PURE__ */ (0,
|
|
14221
|
+
const monthGrid = (0, import_react56.useMemo)(() => equalSizeGroups([...DateUtils.monthsList], 3), []);
|
|
14222
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
|
|
14095
14223
|
ExpandableRoot,
|
|
14096
14224
|
{
|
|
14097
14225
|
ref: isSelectedYear ? ref : void 0,
|
|
14098
14226
|
isExpanded,
|
|
14099
14227
|
onExpandedChange: setIsExpanded,
|
|
14100
14228
|
children: [
|
|
14101
|
-
/* @__PURE__ */ (0,
|
|
14102
|
-
/* @__PURE__ */ (0,
|
|
14229
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ExpandableHeader, { className: (0, import_clsx30.default)("px-2", { "text-primary font-bold": isSelectedYear }), children: year }),
|
|
14230
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(ExpandableContent, { className: "gap-y-1 px-2 expadable-content-h-39", children: isExpanded && monthGrid.map((group, groupIdx) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "flex-row-1", children: group.map((month) => {
|
|
14103
14231
|
const monthIndex = DateUtils.monthsList.indexOf(month);
|
|
14104
14232
|
const currentTimestamp = new Date(year, monthIndex).getTime();
|
|
14105
14233
|
const isAfterStart = minTimestamp === void 0 || currentTimestamp >= minTimestamp;
|
|
14106
14234
|
const isBeforeEnd = maxTimestamp === void 0 || currentTimestamp <= maxTimestamp;
|
|
14107
14235
|
const isValid = isAfterStart && isBeforeEnd;
|
|
14108
14236
|
const isSelectedMonth = monthIndex === selectedMonthIndex;
|
|
14109
|
-
return /* @__PURE__ */ (0,
|
|
14237
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14110
14238
|
Button,
|
|
14111
14239
|
{
|
|
14112
14240
|
disabled: !isValid,
|
|
@@ -14138,32 +14266,32 @@ var YearMonthPicker = ({
|
|
|
14138
14266
|
className
|
|
14139
14267
|
}) => {
|
|
14140
14268
|
const { locale } = useLocale();
|
|
14141
|
-
const monthNames = (0,
|
|
14269
|
+
const monthNames = (0, import_react56.useMemo)(() => {
|
|
14142
14270
|
const formatter = new Intl.DateTimeFormat(locale, { month: "short" });
|
|
14143
14271
|
return Array.from({ length: 12 }, (_, i) => formatter.format(new Date(2e3, i, 1)));
|
|
14144
14272
|
}, [locale]);
|
|
14145
|
-
const years = (0,
|
|
14273
|
+
const years = (0, import_react56.useMemo)(
|
|
14146
14274
|
() => range([start.getFullYear(), end.getFullYear()], { exclusiveEnd: false }),
|
|
14147
14275
|
[start, end]
|
|
14148
14276
|
);
|
|
14149
|
-
const minTimestamp = (0,
|
|
14277
|
+
const minTimestamp = (0, import_react56.useMemo)(() => {
|
|
14150
14278
|
if (!start) return;
|
|
14151
14279
|
return new Date(start.getFullYear(), start.getMonth(), 1).getTime();
|
|
14152
14280
|
}, [start]);
|
|
14153
|
-
const maxTimestamp = (0,
|
|
14281
|
+
const maxTimestamp = (0, import_react56.useMemo)(() => {
|
|
14154
14282
|
if (!end) return;
|
|
14155
14283
|
return new Date(end.getFullYear(), end.getMonth() + 1, 0).getTime();
|
|
14156
14284
|
}, [end]);
|
|
14157
|
-
const callbackRefs = (0,
|
|
14158
|
-
(0,
|
|
14285
|
+
const callbackRefs = (0, import_react56.useRef)({ onValueChange, onEditComplete });
|
|
14286
|
+
(0, import_react56.useLayoutEffect)(() => {
|
|
14159
14287
|
callbackRefs.current = { onValueChange, onEditComplete };
|
|
14160
14288
|
});
|
|
14161
|
-
const handleSelect = (0,
|
|
14289
|
+
const handleSelect = (0, import_react56.useCallback)((newDate) => {
|
|
14162
14290
|
const { onValueChange: onValueChange2, onEditComplete: onEditComplete2 } = callbackRefs.current;
|
|
14163
14291
|
onValueChange2?.(newDate);
|
|
14164
14292
|
onEditComplete2?.(newDate);
|
|
14165
14293
|
}, []);
|
|
14166
|
-
return /* @__PURE__ */ (0,
|
|
14294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14167
14295
|
InfiniteScroll,
|
|
14168
14296
|
{
|
|
14169
14297
|
itemCount: years.length,
|
|
@@ -14173,7 +14301,7 @@ var YearMonthPicker = ({
|
|
|
14173
14301
|
const year = years[index];
|
|
14174
14302
|
const isSelectedYear = value.getFullYear() === year;
|
|
14175
14303
|
const selectedMonthIndex = isSelectedYear ? value.getMonth() : void 0;
|
|
14176
|
-
return /* @__PURE__ */ (0,
|
|
14304
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14177
14305
|
YearRow,
|
|
14178
14306
|
{
|
|
14179
14307
|
year,
|
|
@@ -14195,7 +14323,7 @@ var YearMonthPickerUncontrolled = ({
|
|
|
14195
14323
|
...props
|
|
14196
14324
|
}) => {
|
|
14197
14325
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14198
|
-
return /* @__PURE__ */ (0,
|
|
14326
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
|
|
14199
14327
|
YearMonthPicker,
|
|
14200
14328
|
{
|
|
14201
14329
|
value,
|
|
@@ -14206,7 +14334,7 @@ var YearMonthPickerUncontrolled = ({
|
|
|
14206
14334
|
};
|
|
14207
14335
|
|
|
14208
14336
|
// src/components/user-interaction/date/DatePicker.tsx
|
|
14209
|
-
var
|
|
14337
|
+
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
14210
14338
|
var DatePicker = ({
|
|
14211
14339
|
value = /* @__PURE__ */ new Date(),
|
|
14212
14340
|
start,
|
|
@@ -14220,11 +14348,11 @@ var DatePicker = ({
|
|
|
14220
14348
|
className
|
|
14221
14349
|
}) => {
|
|
14222
14350
|
const { locale } = useLocale();
|
|
14223
|
-
const [displayedMonth, setDisplayedMonth] = (0,
|
|
14224
|
-
const [displayMode, setDisplayMode] = (0,
|
|
14225
|
-
return /* @__PURE__ */ (0,
|
|
14226
|
-
/* @__PURE__ */ (0,
|
|
14227
|
-
/* @__PURE__ */ (0,
|
|
14351
|
+
const [displayedMonth, setDisplayedMonth] = (0, import_react57.useState)(new Date(value.getFullYear(), value.getMonth(), 1));
|
|
14352
|
+
const [displayMode, setDisplayMode] = (0, import_react57.useState)(initialDisplay);
|
|
14353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: (0, import_clsx31.default)("flex-col-3", className), children: [
|
|
14354
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex-row-2 items-center justify-between", children: [
|
|
14355
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
|
|
14228
14356
|
Button,
|
|
14229
14357
|
{
|
|
14230
14358
|
size: "sm",
|
|
@@ -14235,12 +14363,12 @@ var DatePicker = ({
|
|
|
14235
14363
|
onClick: () => setDisplayMode(displayMode === "day" ? "yearMonth" : "day"),
|
|
14236
14364
|
children: [
|
|
14237
14365
|
`${new Intl.DateTimeFormat(LocalizationUtil.localToLanguage(locale), { month: "long" }).format(displayedMonth)} ${displayedMonth.getFullYear()}`,
|
|
14238
|
-
/* @__PURE__ */ (0,
|
|
14366
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react19.ChevronDown, { size: 16 })
|
|
14239
14367
|
]
|
|
14240
14368
|
}
|
|
14241
14369
|
),
|
|
14242
|
-
displayMode === "day" && /* @__PURE__ */ (0,
|
|
14243
|
-
/* @__PURE__ */ (0,
|
|
14370
|
+
displayMode === "day" && /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
14371
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14244
14372
|
Button,
|
|
14245
14373
|
{
|
|
14246
14374
|
size: "sm",
|
|
@@ -14251,10 +14379,10 @@ var DatePicker = ({
|
|
|
14251
14379
|
onValueChange(newDate);
|
|
14252
14380
|
setDisplayedMonth(newDate);
|
|
14253
14381
|
},
|
|
14254
|
-
children: /* @__PURE__ */ (0,
|
|
14382
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react19.Calendar, { className: "size-5" })
|
|
14255
14383
|
}
|
|
14256
14384
|
),
|
|
14257
|
-
/* @__PURE__ */ (0,
|
|
14385
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14258
14386
|
Button,
|
|
14259
14387
|
{
|
|
14260
14388
|
size: "sm",
|
|
@@ -14262,10 +14390,10 @@ var DatePicker = ({
|
|
|
14262
14390
|
onClick: () => {
|
|
14263
14391
|
setDisplayedMonth(subtractDuration(displayedMonth, { months: 1 }));
|
|
14264
14392
|
},
|
|
14265
|
-
children: /* @__PURE__ */ (0,
|
|
14393
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react19.ArrowUp, { size: 20 })
|
|
14266
14394
|
}
|
|
14267
14395
|
),
|
|
14268
|
-
/* @__PURE__ */ (0,
|
|
14396
|
+
/* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14269
14397
|
Button,
|
|
14270
14398
|
{
|
|
14271
14399
|
size: "sm",
|
|
@@ -14273,12 +14401,12 @@ var DatePicker = ({
|
|
|
14273
14401
|
onClick: () => {
|
|
14274
14402
|
setDisplayedMonth(addDuration(displayedMonth, { months: 1 }));
|
|
14275
14403
|
},
|
|
14276
|
-
children: /* @__PURE__ */ (0,
|
|
14404
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_lucide_react19.ArrowDown, { size: 20 })
|
|
14277
14405
|
}
|
|
14278
14406
|
)
|
|
14279
14407
|
] })
|
|
14280
14408
|
] }),
|
|
14281
|
-
displayMode === "yearMonth" ? /* @__PURE__ */ (0,
|
|
14409
|
+
displayMode === "yearMonth" ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14282
14410
|
YearMonthPicker,
|
|
14283
14411
|
{
|
|
14284
14412
|
...yearMonthPickerProps,
|
|
@@ -14295,7 +14423,7 @@ var DatePicker = ({
|
|
|
14295
14423
|
},
|
|
14296
14424
|
className: "h-60 max-h-60"
|
|
14297
14425
|
}
|
|
14298
|
-
) : /* @__PURE__ */ (0,
|
|
14426
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14299
14427
|
DayPicker,
|
|
14300
14428
|
{
|
|
14301
14429
|
...dayPickerProps,
|
|
@@ -14317,7 +14445,7 @@ var DatePickerUncontrolled = ({
|
|
|
14317
14445
|
...props
|
|
14318
14446
|
}) => {
|
|
14319
14447
|
const [date, setDate] = useOverwritableState(value, onValueChange);
|
|
14320
|
-
return /* @__PURE__ */ (0,
|
|
14448
|
+
return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
|
|
14321
14449
|
DatePicker,
|
|
14322
14450
|
{
|
|
14323
14451
|
...props,
|
|
@@ -14331,8 +14459,8 @@ var DatePickerUncontrolled = ({
|
|
|
14331
14459
|
var import_clsx32 = __toESM(require("clsx"));
|
|
14332
14460
|
|
|
14333
14461
|
// src/components/user-interaction/date/TimePicker.tsx
|
|
14334
|
-
var
|
|
14335
|
-
var
|
|
14462
|
+
var import_react58 = require("react");
|
|
14463
|
+
var import_jsx_runtime64 = require("react/jsx-runtime");
|
|
14336
14464
|
var TimePicker = ({
|
|
14337
14465
|
value = /* @__PURE__ */ new Date(),
|
|
14338
14466
|
onValueChange,
|
|
@@ -14341,8 +14469,8 @@ var TimePicker = ({
|
|
|
14341
14469
|
minuteIncrement = "5min",
|
|
14342
14470
|
className
|
|
14343
14471
|
}) => {
|
|
14344
|
-
const minuteRef = (0,
|
|
14345
|
-
const hourRef = (0,
|
|
14472
|
+
const minuteRef = (0, import_react58.useRef)(null);
|
|
14473
|
+
const hourRef = (0, import_react58.useRef)(null);
|
|
14346
14474
|
const isPM = value.getHours() > 11;
|
|
14347
14475
|
const hours = is24HourFormat ? range(24) : range(12);
|
|
14348
14476
|
let minutes = range(60);
|
|
@@ -14362,13 +14490,13 @@ var TimePicker = ({
|
|
|
14362
14490
|
}
|
|
14363
14491
|
const closestMinute = closestMatch(minutes, (item1, item2) => Math.abs(item1 - value.getMinutes()) < Math.abs(item2 - value.getMinutes()));
|
|
14364
14492
|
const hour = value.getHours();
|
|
14365
|
-
(0,
|
|
14493
|
+
(0, import_react58.useEffect)(() => {
|
|
14366
14494
|
minuteRef.current?.scrollIntoView({
|
|
14367
14495
|
behavior: "smooth",
|
|
14368
14496
|
block: "nearest"
|
|
14369
14497
|
});
|
|
14370
14498
|
}, [closestMinute]);
|
|
14371
|
-
(0,
|
|
14499
|
+
(0, import_react58.useEffect)(() => {
|
|
14372
14500
|
hourRef.current?.scrollIntoView({
|
|
14373
14501
|
behavior: "smooth",
|
|
14374
14502
|
block: "nearest"
|
|
@@ -14380,10 +14508,10 @@ var TimePicker = ({
|
|
|
14380
14508
|
onValueChange?.(newDate);
|
|
14381
14509
|
onEditComplete?.(newDate);
|
|
14382
14510
|
};
|
|
14383
|
-
return /* @__PURE__ */ (0,
|
|
14384
|
-
/* @__PURE__ */ (0,
|
|
14511
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { "data-name": "time-picker-container", className, children: [
|
|
14512
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { "data-name": "time-picker-value-column", children: hours.map((hour2) => {
|
|
14385
14513
|
const isSelected = hour2 === value.getHours() - (!is24HourFormat && isPM ? 12 : 0);
|
|
14386
|
-
return /* @__PURE__ */ (0,
|
|
14514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14387
14515
|
Button,
|
|
14388
14516
|
{
|
|
14389
14517
|
size: "sm",
|
|
@@ -14395,9 +14523,9 @@ var TimePicker = ({
|
|
|
14395
14523
|
hour2
|
|
14396
14524
|
);
|
|
14397
14525
|
}) }),
|
|
14398
|
-
/* @__PURE__ */ (0,
|
|
14526
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { "data-name": "time-picker-value-column", children: minutes.map((minute) => {
|
|
14399
14527
|
const isSelected = minute === closestMinute;
|
|
14400
|
-
return /* @__PURE__ */ (0,
|
|
14528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14401
14529
|
Button,
|
|
14402
14530
|
{
|
|
14403
14531
|
size: "sm",
|
|
@@ -14409,8 +14537,8 @@ var TimePicker = ({
|
|
|
14409
14537
|
minute + minuteIncrement
|
|
14410
14538
|
);
|
|
14411
14539
|
}) }),
|
|
14412
|
-
!is24HourFormat && /* @__PURE__ */ (0,
|
|
14413
|
-
/* @__PURE__ */ (0,
|
|
14540
|
+
!is24HourFormat && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("div", { "data-name": "time-picker-value-column", children: [
|
|
14541
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14414
14542
|
Button,
|
|
14415
14543
|
{
|
|
14416
14544
|
size: "sm",
|
|
@@ -14419,7 +14547,7 @@ var TimePicker = ({
|
|
|
14419
14547
|
children: "AM"
|
|
14420
14548
|
}
|
|
14421
14549
|
),
|
|
14422
|
-
/* @__PURE__ */ (0,
|
|
14550
|
+
/* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14423
14551
|
Button,
|
|
14424
14552
|
{
|
|
14425
14553
|
size: "sm",
|
|
@@ -14437,7 +14565,7 @@ var TimePickerUncontrolled = ({
|
|
|
14437
14565
|
...props
|
|
14438
14566
|
}) => {
|
|
14439
14567
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14440
|
-
return /* @__PURE__ */ (0,
|
|
14568
|
+
return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
|
|
14441
14569
|
TimePicker,
|
|
14442
14570
|
{
|
|
14443
14571
|
...props,
|
|
@@ -14448,7 +14576,7 @@ var TimePickerUncontrolled = ({
|
|
|
14448
14576
|
};
|
|
14449
14577
|
|
|
14450
14578
|
// src/components/user-interaction/date/DateTimePicker.tsx
|
|
14451
|
-
var
|
|
14579
|
+
var import_jsx_runtime65 = require("react/jsx-runtime");
|
|
14452
14580
|
var DateTimePicker = ({
|
|
14453
14581
|
value = /* @__PURE__ */ new Date(),
|
|
14454
14582
|
start,
|
|
@@ -14467,7 +14595,7 @@ var DateTimePicker = ({
|
|
|
14467
14595
|
let dateDisplay;
|
|
14468
14596
|
let timeDisplay;
|
|
14469
14597
|
if (useDate) {
|
|
14470
|
-
dateDisplay = /* @__PURE__ */ (0,
|
|
14598
|
+
dateDisplay = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14471
14599
|
DatePicker,
|
|
14472
14600
|
{
|
|
14473
14601
|
...datePickerProps,
|
|
@@ -14483,7 +14611,7 @@ var DateTimePicker = ({
|
|
|
14483
14611
|
);
|
|
14484
14612
|
}
|
|
14485
14613
|
if (useTime) {
|
|
14486
|
-
timeDisplay = /* @__PURE__ */ (0,
|
|
14614
|
+
timeDisplay = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14487
14615
|
TimePicker,
|
|
14488
14616
|
{
|
|
14489
14617
|
...timePickerProps,
|
|
@@ -14496,14 +14624,14 @@ var DateTimePicker = ({
|
|
|
14496
14624
|
}
|
|
14497
14625
|
);
|
|
14498
14626
|
}
|
|
14499
|
-
return /* @__PURE__ */ (0,
|
|
14627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "flex-row-2 min-h-71 max-h-71", children: [
|
|
14500
14628
|
dateDisplay,
|
|
14501
14629
|
timeDisplay
|
|
14502
14630
|
] });
|
|
14503
14631
|
};
|
|
14504
14632
|
var DateTimePickerUncontrolled = ({ value: initialValue, onValueChange, ...props }) => {
|
|
14505
14633
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14506
|
-
return /* @__PURE__ */ (0,
|
|
14634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
|
|
14507
14635
|
DateTimePicker,
|
|
14508
14636
|
{
|
|
14509
14637
|
...props,
|
|
@@ -14514,7 +14642,7 @@ var DateTimePickerUncontrolled = ({ value: initialValue, onValueChange, ...props
|
|
|
14514
14642
|
};
|
|
14515
14643
|
|
|
14516
14644
|
// src/components/user-interaction/date/TimeDisplay.tsx
|
|
14517
|
-
var
|
|
14645
|
+
var import_jsx_runtime66 = require("react/jsx-runtime");
|
|
14518
14646
|
var TimeDisplay = ({
|
|
14519
14647
|
date,
|
|
14520
14648
|
mode = "daysFromToday"
|
|
@@ -14551,15 +14679,15 @@ var TimeDisplay = ({
|
|
|
14551
14679
|
} else {
|
|
14552
14680
|
fullString = `${date.getDate()}. ${monthToTranslation[date.getMonth()]} ${date.getFullYear()}`;
|
|
14553
14681
|
}
|
|
14554
|
-
return /* @__PURE__ */ (0,
|
|
14682
|
+
return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)("span", { children: fullString });
|
|
14555
14683
|
};
|
|
14556
14684
|
|
|
14557
14685
|
// src/components/user-interaction/input/DateTimeInput.tsx
|
|
14558
|
-
var
|
|
14686
|
+
var import_react59 = require("react");
|
|
14559
14687
|
var import_react_dom8 = require("react-dom");
|
|
14560
|
-
var
|
|
14688
|
+
var import_lucide_react20 = require("lucide-react");
|
|
14561
14689
|
var import_clsx33 = __toESM(require("clsx"));
|
|
14562
|
-
var
|
|
14690
|
+
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
14563
14691
|
var DateTimeInput = ({
|
|
14564
14692
|
value,
|
|
14565
14693
|
onValueChange,
|
|
@@ -14572,9 +14700,9 @@ var DateTimeInput = ({
|
|
|
14572
14700
|
}) => {
|
|
14573
14701
|
const translation = useHightideTranslation();
|
|
14574
14702
|
const { locale } = useLocale();
|
|
14575
|
-
const [isOpen, setIsOpen] = (0,
|
|
14576
|
-
const anchorRef = (0,
|
|
14577
|
-
const containerRef = (0,
|
|
14703
|
+
const [isOpen, setIsOpen] = (0, import_react59.useState)(false);
|
|
14704
|
+
const anchorRef = (0, import_react59.useRef)(null);
|
|
14705
|
+
const containerRef = (0, import_react59.useRef)(null);
|
|
14578
14706
|
const position = useFloatingElement({
|
|
14579
14707
|
active: isOpen,
|
|
14580
14708
|
anchorRef,
|
|
@@ -14588,15 +14716,15 @@ var DateTimeInput = ({
|
|
|
14588
14716
|
onEditComplete(value);
|
|
14589
14717
|
});
|
|
14590
14718
|
const { zIndex } = useOverlayRegistry({ isActive: isOpen });
|
|
14591
|
-
const isReadOnly = (0,
|
|
14592
|
-
(0,
|
|
14719
|
+
const isReadOnly = (0, import_react59.useMemo)(() => props.readOnly || props.disabled, [props.readOnly, props.disabled]);
|
|
14720
|
+
(0, import_react59.useEffect)(() => {
|
|
14593
14721
|
if (isReadOnly) {
|
|
14594
14722
|
setIsOpen(false);
|
|
14595
14723
|
}
|
|
14596
14724
|
}, [isReadOnly]);
|
|
14597
|
-
return /* @__PURE__ */ (0,
|
|
14598
|
-
/* @__PURE__ */ (0,
|
|
14599
|
-
/* @__PURE__ */ (0,
|
|
14725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
14726
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { ...containerProps, ref: anchorRef, className: (0, import_clsx33.default)("relative w-full", containerProps?.className), children: [
|
|
14727
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14600
14728
|
Input,
|
|
14601
14729
|
{
|
|
14602
14730
|
...props,
|
|
@@ -14614,7 +14742,7 @@ var DateTimeInput = ({
|
|
|
14614
14742
|
)
|
|
14615
14743
|
}
|
|
14616
14744
|
),
|
|
14617
|
-
/* @__PURE__ */ (0,
|
|
14745
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14618
14746
|
Button,
|
|
14619
14747
|
{
|
|
14620
14748
|
coloringStyle: "text",
|
|
@@ -14624,12 +14752,12 @@ var DateTimeInput = ({
|
|
|
14624
14752
|
className: "absolute right-1 top-1/2 -translate-y-1/2",
|
|
14625
14753
|
disabled: isReadOnly,
|
|
14626
14754
|
onClick: () => setIsOpen((prevState) => !prevState),
|
|
14627
|
-
children: /* @__PURE__ */ (0,
|
|
14755
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_lucide_react20.CalendarIcon, { className: "size-5" })
|
|
14628
14756
|
}
|
|
14629
14757
|
)
|
|
14630
14758
|
] }),
|
|
14631
|
-
/* @__PURE__ */ (0,
|
|
14632
|
-
/* @__PURE__ */ (0,
|
|
14759
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: isOpen, children: (0, import_react_dom8.createPortal)(
|
|
14760
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
14633
14761
|
"div",
|
|
14634
14762
|
{
|
|
14635
14763
|
ref: containerRef,
|
|
@@ -14640,7 +14768,7 @@ var DateTimeInput = ({
|
|
|
14640
14768
|
opacity: position ? void 0 : 0
|
|
14641
14769
|
},
|
|
14642
14770
|
children: [
|
|
14643
|
-
/* @__PURE__ */ (0,
|
|
14771
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14644
14772
|
DateTimePicker,
|
|
14645
14773
|
{
|
|
14646
14774
|
...pickerProps,
|
|
@@ -14650,8 +14778,8 @@ var DateTimeInput = ({
|
|
|
14650
14778
|
onEditComplete
|
|
14651
14779
|
}
|
|
14652
14780
|
),
|
|
14653
|
-
/* @__PURE__ */ (0,
|
|
14654
|
-
/* @__PURE__ */ (0,
|
|
14781
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("div", { className: "flex-row-2 justify-end", children: [
|
|
14782
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !!onRemove && !!value, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14655
14783
|
Button,
|
|
14656
14784
|
{
|
|
14657
14785
|
size: "md",
|
|
@@ -14664,7 +14792,7 @@ var DateTimeInput = ({
|
|
|
14664
14792
|
children: translation("clear")
|
|
14665
14793
|
}
|
|
14666
14794
|
) }),
|
|
14667
|
-
/* @__PURE__ */ (0,
|
|
14795
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Visibility, { isVisible: !value, children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14668
14796
|
Button,
|
|
14669
14797
|
{
|
|
14670
14798
|
size: "md",
|
|
@@ -14674,7 +14802,7 @@ var DateTimeInput = ({
|
|
|
14674
14802
|
children: translation("cancel")
|
|
14675
14803
|
}
|
|
14676
14804
|
) }),
|
|
14677
|
-
/* @__PURE__ */ (0,
|
|
14805
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14678
14806
|
Button,
|
|
14679
14807
|
{
|
|
14680
14808
|
size: "md",
|
|
@@ -14699,7 +14827,7 @@ var DateTimeInputUncontrolled = ({
|
|
|
14699
14827
|
...props
|
|
14700
14828
|
}) => {
|
|
14701
14829
|
const [value, setValue] = useOverwritableState(initialValue);
|
|
14702
|
-
return /* @__PURE__ */ (0,
|
|
14830
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
14703
14831
|
DateTimeInput,
|
|
14704
14832
|
{
|
|
14705
14833
|
...props,
|
|
@@ -14717,21 +14845,21 @@ var DateTimeInputUncontrolled = ({
|
|
|
14717
14845
|
};
|
|
14718
14846
|
|
|
14719
14847
|
// src/components/user-interaction/input/InsideLabelInput.tsx
|
|
14720
|
-
var
|
|
14721
|
-
var
|
|
14848
|
+
var import_react60 = require("react");
|
|
14849
|
+
var import_react61 = require("react");
|
|
14722
14850
|
var import_clsx34 = __toESM(require("clsx"));
|
|
14723
|
-
var
|
|
14724
|
-
var InsideLabelInput = (0,
|
|
14851
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
14852
|
+
var InsideLabelInput = (0, import_react61.forwardRef)(function InsideLabelInput2({
|
|
14725
14853
|
id: customId,
|
|
14726
14854
|
label,
|
|
14727
14855
|
...props
|
|
14728
14856
|
}, forwardedRef) {
|
|
14729
14857
|
const { value } = props;
|
|
14730
|
-
const [isFocused, setIsFocused] = (0,
|
|
14731
|
-
const generatedId = (0,
|
|
14858
|
+
const [isFocused, setIsFocused] = (0, import_react61.useState)(false);
|
|
14859
|
+
const generatedId = (0, import_react60.useId)();
|
|
14732
14860
|
const id = customId ?? generatedId;
|
|
14733
|
-
return /* @__PURE__ */ (0,
|
|
14734
|
-
/* @__PURE__ */ (0,
|
|
14861
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)("div", { className: (0, import_clsx34.default)("relative"), children: [
|
|
14862
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
14735
14863
|
Input,
|
|
14736
14864
|
{
|
|
14737
14865
|
...props,
|
|
@@ -14749,7 +14877,7 @@ var InsideLabelInput = (0, import_react57.forwardRef)(function InsideLabelInput2
|
|
|
14749
14877
|
}
|
|
14750
14878
|
}
|
|
14751
14879
|
),
|
|
14752
|
-
/* @__PURE__ */ (0,
|
|
14880
|
+
/* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
14753
14881
|
"label",
|
|
14754
14882
|
{
|
|
14755
14883
|
id: id + "-label",
|
|
@@ -14771,7 +14899,7 @@ var InsideLabelInputUncontrolled = ({
|
|
|
14771
14899
|
...props
|
|
14772
14900
|
}) => {
|
|
14773
14901
|
const [value, setValue] = useOverwritableState(initialValue, props.onValueChange);
|
|
14774
|
-
return /* @__PURE__ */ (0,
|
|
14902
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
|
|
14775
14903
|
InsideLabelInput,
|
|
14776
14904
|
{
|
|
14777
14905
|
...props,
|
|
@@ -14782,9 +14910,9 @@ var InsideLabelInputUncontrolled = ({
|
|
|
14782
14910
|
};
|
|
14783
14911
|
|
|
14784
14912
|
// src/components/user-interaction/input/SearchBar.tsx
|
|
14785
|
-
var
|
|
14913
|
+
var import_lucide_react21 = require("lucide-react");
|
|
14786
14914
|
var import_clsx35 = require("clsx");
|
|
14787
|
-
var
|
|
14915
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
14788
14916
|
var SearchBar = ({
|
|
14789
14917
|
value: initialValue,
|
|
14790
14918
|
onSearch,
|
|
@@ -14795,8 +14923,8 @@ var SearchBar = ({
|
|
|
14795
14923
|
}) => {
|
|
14796
14924
|
const translation = useHightideTranslation();
|
|
14797
14925
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14798
|
-
return /* @__PURE__ */ (0,
|
|
14799
|
-
/* @__PURE__ */ (0,
|
|
14926
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { ...containerProps, className: (0, import_clsx35.clsx)("relative", containerProps?.className), children: [
|
|
14927
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
14800
14928
|
InputUncontrolled,
|
|
14801
14929
|
{
|
|
14802
14930
|
...inputProps,
|
|
@@ -14807,7 +14935,7 @@ var SearchBar = ({
|
|
|
14807
14935
|
className: (0, import_clsx35.clsx)("pr-10 w-full", inputProps.className)
|
|
14808
14936
|
}
|
|
14809
14937
|
),
|
|
14810
|
-
/* @__PURE__ */ (0,
|
|
14938
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
|
|
14811
14939
|
Button,
|
|
14812
14940
|
{
|
|
14813
14941
|
...searchButtonProps,
|
|
@@ -14817,33 +14945,33 @@ var SearchBar = ({
|
|
|
14817
14945
|
coloringStyle: "text",
|
|
14818
14946
|
onClick: () => onSearch(value),
|
|
14819
14947
|
className: (0, import_clsx35.clsx)("absolute right-1 top-1/2 -translate-y-1/2", searchButtonProps?.className),
|
|
14820
|
-
children: /* @__PURE__ */ (0,
|
|
14948
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_lucide_react21.Search, { className: "w-full h-full" })
|
|
14821
14949
|
}
|
|
14822
14950
|
)
|
|
14823
14951
|
] });
|
|
14824
14952
|
};
|
|
14825
14953
|
|
|
14826
14954
|
// src/components/user-interaction/input/ToggleableInput.tsx
|
|
14827
|
-
var
|
|
14828
|
-
var
|
|
14955
|
+
var import_react62 = require("react");
|
|
14956
|
+
var import_lucide_react22 = require("lucide-react");
|
|
14829
14957
|
var import_clsx36 = __toESM(require("clsx"));
|
|
14830
|
-
var
|
|
14831
|
-
var ToggleableInput = (0,
|
|
14958
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
14959
|
+
var ToggleableInput = (0, import_react62.forwardRef)(function ToggleableInput2({
|
|
14832
14960
|
value,
|
|
14833
14961
|
initialState = "display",
|
|
14834
14962
|
editCompleteOptions,
|
|
14835
14963
|
...props
|
|
14836
14964
|
}, forwardedRef) {
|
|
14837
|
-
const [isEditing, setIsEditing] = (0,
|
|
14838
|
-
const innerRef = (0,
|
|
14839
|
-
(0,
|
|
14840
|
-
(0,
|
|
14965
|
+
const [isEditing, setIsEditing] = (0, import_react62.useState)(initialState !== "display");
|
|
14966
|
+
const innerRef = (0, import_react62.useRef)(null);
|
|
14967
|
+
(0, import_react62.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
14968
|
+
(0, import_react62.useEffect)(() => {
|
|
14841
14969
|
if (isEditing) {
|
|
14842
14970
|
innerRef.current?.focus();
|
|
14843
14971
|
}
|
|
14844
14972
|
}, [isEditing]);
|
|
14845
|
-
return /* @__PURE__ */ (0,
|
|
14846
|
-
/* @__PURE__ */ (0,
|
|
14973
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: (0, import_clsx36.default)("relative flex-row-2", { "flex-1": isEditing }), children: [
|
|
14974
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
14847
14975
|
Input,
|
|
14848
14976
|
{
|
|
14849
14977
|
...props,
|
|
@@ -14869,9 +14997,9 @@ var ToggleableInput = (0, import_react58.forwardRef)(function ToggleableInput2({
|
|
|
14869
14997
|
})
|
|
14870
14998
|
}
|
|
14871
14999
|
),
|
|
14872
|
-
!isEditing && /* @__PURE__ */ (0,
|
|
14873
|
-
/* @__PURE__ */ (0,
|
|
14874
|
-
/* @__PURE__ */ (0,
|
|
15000
|
+
!isEditing && /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)("div", { className: "absolute left-0 flex-row-2 items-center pointer-events-none touch-none w-full overflow-hidden", children: [
|
|
15001
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)("span", { className: (0, import_clsx36.default)(" truncate"), children: value }),
|
|
15002
|
+
/* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_lucide_react22.Pencil, { className: (0, import_clsx36.default)(`size-force-4`, { "text-transparent": isEditing }) })
|
|
14875
15003
|
] })
|
|
14876
15004
|
] });
|
|
14877
15005
|
});
|
|
@@ -14881,7 +15009,7 @@ var ToggleableInputUncontrolled = ({
|
|
|
14881
15009
|
...restProps
|
|
14882
15010
|
}) => {
|
|
14883
15011
|
const [value, setValue] = useOverwritableState(initialValue, onValueChange);
|
|
14884
|
-
return /* @__PURE__ */ (0,
|
|
15012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
|
|
14885
15013
|
ToggleableInput,
|
|
14886
15014
|
{
|
|
14887
15015
|
value,
|
|
@@ -14892,11 +15020,11 @@ var ToggleableInputUncontrolled = ({
|
|
|
14892
15020
|
};
|
|
14893
15021
|
|
|
14894
15022
|
// src/components/user-interaction/properties/CheckboxProperty.tsx
|
|
14895
|
-
var
|
|
15023
|
+
var import_lucide_react24 = require("lucide-react");
|
|
14896
15024
|
|
|
14897
15025
|
// src/components/user-interaction/properties/PropertyBase.tsx
|
|
14898
|
-
var
|
|
14899
|
-
var
|
|
15026
|
+
var import_lucide_react23 = require("lucide-react");
|
|
15027
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
14900
15028
|
var PropertyBase = ({
|
|
14901
15029
|
name: name2,
|
|
14902
15030
|
children,
|
|
@@ -14915,29 +15043,29 @@ var PropertyBase = ({
|
|
|
14915
15043
|
const isClearEnabled = allowClear && !readOnly;
|
|
14916
15044
|
const isRemoveEnabled = allowRemove && !readOnly;
|
|
14917
15045
|
const showActionsContainer = isClearEnabled || isRemoveEnabled;
|
|
14918
|
-
return /* @__PURE__ */ (0,
|
|
15046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
14919
15047
|
"div",
|
|
14920
15048
|
{
|
|
14921
15049
|
className: className ? `group/property ${className}` : "group/property",
|
|
14922
15050
|
"data-name": "property-root",
|
|
14923
15051
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14924
15052
|
children: [
|
|
14925
|
-
/* @__PURE__ */ (0,
|
|
15053
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
14926
15054
|
"div",
|
|
14927
15055
|
{
|
|
14928
15056
|
className,
|
|
14929
15057
|
"data-name": "property-title",
|
|
14930
15058
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14931
15059
|
children: [
|
|
14932
|
-
/* @__PURE__ */ (0,
|
|
14933
|
-
/* @__PURE__ */ (0,
|
|
14934
|
-
/* @__PURE__ */ (0,
|
|
15060
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Tooltip, { tooltip: name2, containerClassName: "min-w-0", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "flex-row-1 items-center", children: [
|
|
15061
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { "data-name": "property-title-icon", children: icon }),
|
|
15062
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { "data-name": "property-title-text", children: name2 })
|
|
14935
15063
|
] }) }),
|
|
14936
|
-
invalid && /* @__PURE__ */ (0,
|
|
15064
|
+
invalid && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react23.AlertTriangle, { className: "size-force-6" })
|
|
14937
15065
|
]
|
|
14938
15066
|
}
|
|
14939
15067
|
),
|
|
14940
|
-
/* @__PURE__ */ (0,
|
|
15068
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsxs)(
|
|
14941
15069
|
"div",
|
|
14942
15070
|
{
|
|
14943
15071
|
className,
|
|
@@ -14945,8 +15073,8 @@ var PropertyBase = ({
|
|
|
14945
15073
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
14946
15074
|
children: [
|
|
14947
15075
|
children({ required, hasValue, invalid }),
|
|
14948
|
-
showActionsContainer && /* @__PURE__ */ (0,
|
|
14949
|
-
isClearEnabled && /* @__PURE__ */ (0,
|
|
15076
|
+
showActionsContainer && /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { "data-name": "property-actions", children: [
|
|
15077
|
+
isClearEnabled && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Tooltip, { tooltip: translation("clearValue"), children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
14950
15078
|
Button,
|
|
14951
15079
|
{
|
|
14952
15080
|
onClick: onValueClear,
|
|
@@ -14955,10 +15083,10 @@ var PropertyBase = ({
|
|
|
14955
15083
|
coloringStyle: "text",
|
|
14956
15084
|
layout: "icon",
|
|
14957
15085
|
size: "sm",
|
|
14958
|
-
children: /* @__PURE__ */ (0,
|
|
15086
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react23.X, { className: "size-force-5" })
|
|
14959
15087
|
}
|
|
14960
15088
|
) }),
|
|
14961
|
-
isRemoveEnabled && /* @__PURE__ */ (0,
|
|
15089
|
+
isRemoveEnabled && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(Tooltip, { tooltip: translation("removeProperty"), children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(
|
|
14962
15090
|
Button,
|
|
14963
15091
|
{
|
|
14964
15092
|
onClick: onRemove,
|
|
@@ -14966,7 +15094,7 @@ var PropertyBase = ({
|
|
|
14966
15094
|
coloringStyle: "text",
|
|
14967
15095
|
layout: "icon",
|
|
14968
15096
|
size: "sm",
|
|
14969
|
-
children: /* @__PURE__ */ (0,
|
|
15097
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_lucide_react23.Trash, { className: "size-force-5" })
|
|
14970
15098
|
}
|
|
14971
15099
|
) })
|
|
14972
15100
|
] })
|
|
@@ -14979,7 +15107,7 @@ var PropertyBase = ({
|
|
|
14979
15107
|
};
|
|
14980
15108
|
|
|
14981
15109
|
// src/components/user-interaction/properties/CheckboxProperty.tsx
|
|
14982
|
-
var
|
|
15110
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
14983
15111
|
var CheckboxProperty = ({
|
|
14984
15112
|
value,
|
|
14985
15113
|
onValueChange,
|
|
@@ -14988,15 +15116,15 @@ var CheckboxProperty = ({
|
|
|
14988
15116
|
...baseProps
|
|
14989
15117
|
}) => {
|
|
14990
15118
|
const translation = useHightideTranslation();
|
|
14991
|
-
return /* @__PURE__ */ (0,
|
|
15119
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
14992
15120
|
PropertyBase,
|
|
14993
15121
|
{
|
|
14994
15122
|
...baseProps,
|
|
14995
15123
|
hasValue: value !== void 0,
|
|
14996
15124
|
readOnly,
|
|
14997
|
-
icon: /* @__PURE__ */ (0,
|
|
14998
|
-
children: () => /* @__PURE__ */ (0,
|
|
14999
|
-
/* @__PURE__ */ (0,
|
|
15125
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_lucide_react24.Check, { size: 24 }),
|
|
15126
|
+
children: () => /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "flex-row-2 items-center", children: [
|
|
15127
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
15000
15128
|
Button,
|
|
15001
15129
|
{
|
|
15002
15130
|
color: value ? "positive" : "neutral",
|
|
@@ -15009,7 +15137,7 @@ var CheckboxProperty = ({
|
|
|
15009
15137
|
children: translation("yes")
|
|
15010
15138
|
}
|
|
15011
15139
|
),
|
|
15012
|
-
/* @__PURE__ */ (0,
|
|
15140
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
15013
15141
|
Button,
|
|
15014
15142
|
{
|
|
15015
15143
|
color: !value && value !== void 0 ? "negative" : "neutral",
|
|
@@ -15028,8 +15156,8 @@ var CheckboxProperty = ({
|
|
|
15028
15156
|
};
|
|
15029
15157
|
|
|
15030
15158
|
// src/components/user-interaction/properties/DateProperty.tsx
|
|
15031
|
-
var
|
|
15032
|
-
var
|
|
15159
|
+
var import_lucide_react25 = require("lucide-react");
|
|
15160
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
15033
15161
|
var DateProperty = ({
|
|
15034
15162
|
value,
|
|
15035
15163
|
onValueChange,
|
|
@@ -15039,13 +15167,13 @@ var DateProperty = ({
|
|
|
15039
15167
|
...baseProps
|
|
15040
15168
|
}) => {
|
|
15041
15169
|
const hasValue = !!value;
|
|
15042
|
-
return /* @__PURE__ */ (0,
|
|
15170
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
15043
15171
|
PropertyBase,
|
|
15044
15172
|
{
|
|
15045
15173
|
...baseProps,
|
|
15046
15174
|
hasValue,
|
|
15047
|
-
icon: /* @__PURE__ */ (0,
|
|
15048
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15175
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_lucide_react25.CalendarDays, { size: 24 }),
|
|
15176
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
15049
15177
|
DateTimeInput,
|
|
15050
15178
|
{
|
|
15051
15179
|
value,
|
|
@@ -15062,8 +15190,8 @@ var DateProperty = ({
|
|
|
15062
15190
|
};
|
|
15063
15191
|
|
|
15064
15192
|
// src/components/user-interaction/properties/MultiSelectProperty.tsx
|
|
15065
|
-
var
|
|
15066
|
-
var
|
|
15193
|
+
var import_lucide_react26 = require("lucide-react");
|
|
15194
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
15067
15195
|
var MultiSelectProperty = ({
|
|
15068
15196
|
children,
|
|
15069
15197
|
value,
|
|
@@ -15072,18 +15200,18 @@ var MultiSelectProperty = ({
|
|
|
15072
15200
|
...props
|
|
15073
15201
|
}) => {
|
|
15074
15202
|
const hasValue = value.length > 0;
|
|
15075
|
-
return /* @__PURE__ */ (0,
|
|
15203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15076
15204
|
PropertyBase,
|
|
15077
15205
|
{
|
|
15078
15206
|
...props,
|
|
15079
15207
|
hasValue,
|
|
15080
|
-
icon: /* @__PURE__ */ (0,
|
|
15081
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15208
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_lucide_react26.List, { size: 24 }),
|
|
15209
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15082
15210
|
"div",
|
|
15083
15211
|
{
|
|
15084
15212
|
"data-name": "property-input-wrapper",
|
|
15085
15213
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
15086
|
-
children: /* @__PURE__ */ (0,
|
|
15214
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
15087
15215
|
MultiSelectChipDisplay,
|
|
15088
15216
|
{
|
|
15089
15217
|
value,
|
|
@@ -15108,8 +15236,8 @@ var MultiSelectProperty = ({
|
|
|
15108
15236
|
};
|
|
15109
15237
|
|
|
15110
15238
|
// src/components/user-interaction/properties/NumberProperty.tsx
|
|
15111
|
-
var
|
|
15112
|
-
var
|
|
15239
|
+
var import_lucide_react27 = require("lucide-react");
|
|
15240
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
15113
15241
|
var NumberProperty = ({
|
|
15114
15242
|
value,
|
|
15115
15243
|
onRemove,
|
|
@@ -15121,20 +15249,20 @@ var NumberProperty = ({
|
|
|
15121
15249
|
}) => {
|
|
15122
15250
|
const translation = useHightideTranslation();
|
|
15123
15251
|
const hasValue = value !== void 0;
|
|
15124
|
-
return /* @__PURE__ */ (0,
|
|
15252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15125
15253
|
PropertyBase,
|
|
15126
15254
|
{
|
|
15127
15255
|
...baseProps,
|
|
15128
15256
|
onRemove,
|
|
15129
15257
|
hasValue,
|
|
15130
|
-
icon: /* @__PURE__ */ (0,
|
|
15131
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15258
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_lucide_react27.Binary, { size: 24 }),
|
|
15259
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(
|
|
15132
15260
|
"div",
|
|
15133
15261
|
{
|
|
15134
15262
|
"data-name": "property-input-wrapper",
|
|
15135
15263
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
15136
15264
|
children: [
|
|
15137
|
-
/* @__PURE__ */ (0,
|
|
15265
|
+
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15138
15266
|
Input,
|
|
15139
15267
|
{
|
|
15140
15268
|
className: "w-full pr-8",
|
|
@@ -15162,7 +15290,7 @@ var NumberProperty = ({
|
|
|
15162
15290
|
}
|
|
15163
15291
|
}
|
|
15164
15292
|
),
|
|
15165
|
-
suffix && /* @__PURE__ */ (0,
|
|
15293
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
15166
15294
|
"span",
|
|
15167
15295
|
{
|
|
15168
15296
|
"data-name": "property-suffix",
|
|
@@ -15178,8 +15306,8 @@ var NumberProperty = ({
|
|
|
15178
15306
|
};
|
|
15179
15307
|
|
|
15180
15308
|
// src/components/user-interaction/properties/SelectProperty.tsx
|
|
15181
|
-
var
|
|
15182
|
-
var
|
|
15309
|
+
var import_lucide_react28 = require("lucide-react");
|
|
15310
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
15183
15311
|
var SingleSelectProperty = ({
|
|
15184
15312
|
children,
|
|
15185
15313
|
value,
|
|
@@ -15188,18 +15316,18 @@ var SingleSelectProperty = ({
|
|
|
15188
15316
|
...props
|
|
15189
15317
|
}) => {
|
|
15190
15318
|
const hasValue = value !== void 0;
|
|
15191
|
-
return /* @__PURE__ */ (0,
|
|
15319
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
15192
15320
|
PropertyBase,
|
|
15193
15321
|
{
|
|
15194
15322
|
...props,
|
|
15195
15323
|
hasValue,
|
|
15196
|
-
icon: /* @__PURE__ */ (0,
|
|
15197
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15324
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_lucide_react28.List, { size: 24 }),
|
|
15325
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
15198
15326
|
"div",
|
|
15199
15327
|
{
|
|
15200
15328
|
"data-name": "property-input-wrapper",
|
|
15201
15329
|
"data-invalid": PropsUtil.dataAttributes.bool(invalid),
|
|
15202
|
-
children: /* @__PURE__ */ (0,
|
|
15330
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
15203
15331
|
Select,
|
|
15204
15332
|
{
|
|
15205
15333
|
value,
|
|
@@ -15221,8 +15349,8 @@ var SingleSelectProperty = ({
|
|
|
15221
15349
|
};
|
|
15222
15350
|
|
|
15223
15351
|
// src/components/user-interaction/properties/TextProperty.tsx
|
|
15224
|
-
var
|
|
15225
|
-
var
|
|
15352
|
+
var import_lucide_react29 = require("lucide-react");
|
|
15353
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
15226
15354
|
var TextProperty = ({
|
|
15227
15355
|
value,
|
|
15228
15356
|
readOnly,
|
|
@@ -15233,14 +15361,14 @@ var TextProperty = ({
|
|
|
15233
15361
|
}) => {
|
|
15234
15362
|
const translation = useHightideTranslation();
|
|
15235
15363
|
const hasValue = value !== void 0;
|
|
15236
|
-
return /* @__PURE__ */ (0,
|
|
15364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15237
15365
|
PropertyBase,
|
|
15238
15366
|
{
|
|
15239
15367
|
...baseProps,
|
|
15240
15368
|
onRemove,
|
|
15241
15369
|
hasValue,
|
|
15242
|
-
icon: /* @__PURE__ */ (0,
|
|
15243
|
-
children: ({ invalid }) => /* @__PURE__ */ (0,
|
|
15370
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_lucide_react29.Text, { size: 24 }),
|
|
15371
|
+
children: ({ invalid }) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
|
|
15244
15372
|
Textarea,
|
|
15245
15373
|
{
|
|
15246
15374
|
className: "w-full",
|
|
@@ -15271,33 +15399,33 @@ var TextProperty = ({
|
|
|
15271
15399
|
};
|
|
15272
15400
|
|
|
15273
15401
|
// src/components/utils/FocusTrap.tsx
|
|
15274
|
-
var
|
|
15275
|
-
var
|
|
15276
|
-
var
|
|
15277
|
-
var
|
|
15278
|
-
var FocusTrap = (0,
|
|
15402
|
+
var import_react63 = require("react");
|
|
15403
|
+
var import_react64 = require("react");
|
|
15404
|
+
var import_react65 = require("react");
|
|
15405
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
15406
|
+
var FocusTrap = (0, import_react65.forwardRef)(function FocusTrap2({
|
|
15279
15407
|
active = true,
|
|
15280
15408
|
initialFocus,
|
|
15281
15409
|
focusFirst = false,
|
|
15282
15410
|
...props
|
|
15283
15411
|
}, forwardedRef) {
|
|
15284
|
-
const innerRef = (0,
|
|
15285
|
-
(0,
|
|
15412
|
+
const innerRef = (0, import_react63.useRef)(null);
|
|
15413
|
+
(0, import_react64.useImperativeHandle)(forwardedRef, () => innerRef.current);
|
|
15286
15414
|
useFocusTrap({ container: innerRef, active, initialFocus, focusFirst });
|
|
15287
|
-
return /* @__PURE__ */ (0,
|
|
15415
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { ref: innerRef, ...props });
|
|
15288
15416
|
});
|
|
15289
15417
|
|
|
15290
15418
|
// src/components/utils/Transition.tsx
|
|
15291
|
-
var
|
|
15419
|
+
var import_react66 = require("react");
|
|
15292
15420
|
function Transition({
|
|
15293
15421
|
children,
|
|
15294
15422
|
show,
|
|
15295
15423
|
includeAnimation = true
|
|
15296
15424
|
}) {
|
|
15297
|
-
const [isOpen, setIsOpen] = (0,
|
|
15298
|
-
const [isTransitioning, setIsTransitioning] = (0,
|
|
15425
|
+
const [isOpen, setIsOpen] = (0, import_react66.useState)(show);
|
|
15426
|
+
const [isTransitioning, setIsTransitioning] = (0, import_react66.useState)(!isOpen);
|
|
15299
15427
|
const isUsingReducedMotion = typeof window !== "undefined" && typeof window.matchMedia === "function" ? window.matchMedia("(prefers-reduced-motion: reduce)").matches : true;
|
|
15300
|
-
(0,
|
|
15428
|
+
(0, import_react66.useEffect)(() => {
|
|
15301
15429
|
setIsOpen(show);
|
|
15302
15430
|
setIsTransitioning(true);
|
|
15303
15431
|
}, [show]);
|
|
@@ -15322,18 +15450,18 @@ function Transition({
|
|
|
15322
15450
|
}
|
|
15323
15451
|
|
|
15324
15452
|
// src/contexts/HightideProvider.tsx
|
|
15325
|
-
var
|
|
15453
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
15326
15454
|
var HightideProvider = ({
|
|
15327
15455
|
children,
|
|
15328
15456
|
theme,
|
|
15329
15457
|
locale,
|
|
15330
15458
|
config
|
|
15331
15459
|
}) => {
|
|
15332
|
-
return /* @__PURE__ */ (0,
|
|
15460
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(LocaleProvider, { ...locale, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ThemeProvider, { ...theme, children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(HightideConfigProvider, { ...config, children }) }) });
|
|
15333
15461
|
};
|
|
15334
15462
|
|
|
15335
15463
|
// src/hooks/focus/useFocusGuards.ts
|
|
15336
|
-
var
|
|
15464
|
+
var import_react67 = require("react");
|
|
15337
15465
|
var selectorName = "data-hw-focus-guard";
|
|
15338
15466
|
function FocusGuard() {
|
|
15339
15467
|
const element = document.createElement("div");
|
|
@@ -15371,7 +15499,7 @@ var FocusGuardsService = class _FocusGuardsService {
|
|
|
15371
15499
|
}
|
|
15372
15500
|
};
|
|
15373
15501
|
var useFocusGuards = () => {
|
|
15374
|
-
(0,
|
|
15502
|
+
(0, import_react67.useEffect)(() => {
|
|
15375
15503
|
FocusGuardsService.getInstance().add();
|
|
15376
15504
|
return () => {
|
|
15377
15505
|
FocusGuardsService.getInstance().remove();
|
|
@@ -15380,10 +15508,10 @@ var useFocusGuards = () => {
|
|
|
15380
15508
|
};
|
|
15381
15509
|
|
|
15382
15510
|
// src/hooks/focus/useFocusOnceVisible.ts
|
|
15383
|
-
var
|
|
15511
|
+
var import_react68 = __toESM(require("react"));
|
|
15384
15512
|
var useFocusOnceVisible = (ref, disable = false) => {
|
|
15385
|
-
const [hasUsedFocus, setHasUsedFocus] =
|
|
15386
|
-
(0,
|
|
15513
|
+
const [hasUsedFocus, setHasUsedFocus] = import_react68.default.useState(false);
|
|
15514
|
+
(0, import_react68.useEffect)(() => {
|
|
15387
15515
|
if (disable || hasUsedFocus) {
|
|
15388
15516
|
return;
|
|
15389
15517
|
}
|
|
@@ -15403,13 +15531,13 @@ var useFocusOnceVisible = (ref, disable = false) => {
|
|
|
15403
15531
|
};
|
|
15404
15532
|
|
|
15405
15533
|
// src/hooks/useRerender.ts
|
|
15406
|
-
var
|
|
15534
|
+
var import_react69 = require("react");
|
|
15407
15535
|
var useRerender = () => {
|
|
15408
|
-
return (0,
|
|
15536
|
+
return (0, import_react69.useReducer)(() => ({}), {})[1];
|
|
15409
15537
|
};
|
|
15410
15538
|
|
|
15411
15539
|
// src/hooks/useSearch.ts
|
|
15412
|
-
var
|
|
15540
|
+
var import_react70 = require("react");
|
|
15413
15541
|
|
|
15414
15542
|
// src/utils/simpleSearch.ts
|
|
15415
15543
|
var MultiSubjectSearchWithMapping = (search, objects, mapping) => {
|
|
@@ -15448,34 +15576,34 @@ var useSearch = ({
|
|
|
15448
15576
|
filter,
|
|
15449
15577
|
disabled = false
|
|
15450
15578
|
}) => {
|
|
15451
|
-
const [search, setSearch] = (0,
|
|
15452
|
-
const [result, setResult] = (0,
|
|
15453
|
-
const searchTags = (0,
|
|
15454
|
-
const updateSearch = (0,
|
|
15579
|
+
const [search, setSearch] = (0, import_react70.useState)(initialSearch ?? "");
|
|
15580
|
+
const [result, setResult] = (0, import_react70.useState)(list);
|
|
15581
|
+
const searchTags = (0, import_react70.useMemo)(() => additionalSearchTags ?? [], [additionalSearchTags]);
|
|
15582
|
+
const updateSearch = (0, import_react70.useCallback)((newSearch) => {
|
|
15455
15583
|
const usedSearch = newSearch ?? search;
|
|
15456
15584
|
if (newSearch) {
|
|
15457
15585
|
setSearch(search);
|
|
15458
15586
|
}
|
|
15459
15587
|
setResult(MultiSubjectSearchWithMapping([usedSearch, ...searchTags], list, searchMapping));
|
|
15460
15588
|
}, [searchTags, list, search, searchMapping]);
|
|
15461
|
-
(0,
|
|
15589
|
+
(0, import_react70.useEffect)(() => {
|
|
15462
15590
|
if (isSearchInstant) {
|
|
15463
15591
|
setResult(MultiSubjectSearchWithMapping([search, ...searchTags], list, searchMapping));
|
|
15464
15592
|
}
|
|
15465
15593
|
}, [searchTags, isSearchInstant, list, search, searchMapping, additionalSearchTags]);
|
|
15466
|
-
const filteredResult = (0,
|
|
15594
|
+
const filteredResult = (0, import_react70.useMemo)(() => {
|
|
15467
15595
|
if (!filter) {
|
|
15468
15596
|
return result;
|
|
15469
15597
|
}
|
|
15470
15598
|
return result.filter(filter);
|
|
15471
15599
|
}, [result, filter]);
|
|
15472
|
-
const sortedAndFilteredResult = (0,
|
|
15600
|
+
const sortedAndFilteredResult = (0, import_react70.useMemo)(() => {
|
|
15473
15601
|
if (!sortingFunction) {
|
|
15474
15602
|
return filteredResult;
|
|
15475
15603
|
}
|
|
15476
15604
|
return filteredResult.sort(sortingFunction);
|
|
15477
15605
|
}, [filteredResult, sortingFunction]);
|
|
15478
|
-
const usedResult = (0,
|
|
15606
|
+
const usedResult = (0, import_react70.useMemo)(() => {
|
|
15479
15607
|
if (!disabled) {
|
|
15480
15608
|
return sortedAndFilteredResult;
|
|
15481
15609
|
}
|
|
@@ -15497,7 +15625,7 @@ var validateEmail = (email) => {
|
|
|
15497
15625
|
};
|
|
15498
15626
|
|
|
15499
15627
|
// src/hooks/useValidators.ts
|
|
15500
|
-
var
|
|
15628
|
+
var import_react71 = require("react");
|
|
15501
15629
|
var notEmpty = (value) => {
|
|
15502
15630
|
if (!value) {
|
|
15503
15631
|
return "notEmpty";
|
|
@@ -15547,7 +15675,7 @@ var UseValidators = {
|
|
|
15547
15675
|
};
|
|
15548
15676
|
var useTranslatedValidators = () => {
|
|
15549
15677
|
const translation = useHightideTranslation();
|
|
15550
|
-
return (0,
|
|
15678
|
+
return (0, import_react71.useMemo)(() => ({
|
|
15551
15679
|
notEmpty: (value) => {
|
|
15552
15680
|
const result = notEmpty(value);
|
|
15553
15681
|
if (result) {
|
|
@@ -15885,9 +16013,14 @@ var PromiseUtils = {
|
|
|
15885
16013
|
MenuItem,
|
|
15886
16014
|
MultiSearchWithMapping,
|
|
15887
16015
|
MultiSelect,
|
|
16016
|
+
MultiSelectButton,
|
|
15888
16017
|
MultiSelectChipDisplay,
|
|
16018
|
+
MultiSelectChipDisplayButton,
|
|
15889
16019
|
MultiSelectChipDisplayUncontrolled,
|
|
16020
|
+
MultiSelectContent,
|
|
16021
|
+
MultiSelectOption,
|
|
15890
16022
|
MultiSelectProperty,
|
|
16023
|
+
MultiSelectRoot,
|
|
15891
16024
|
MultiSelectUncontrolled,
|
|
15892
16025
|
MultiSubjectSearchWithMapping,
|
|
15893
16026
|
Navigation,
|
|
@@ -15905,8 +16038,8 @@ var PromiseUtils = {
|
|
|
15905
16038
|
SearchBar,
|
|
15906
16039
|
Select,
|
|
15907
16040
|
SelectButton,
|
|
15908
|
-
SelectChipDisplay,
|
|
15909
16041
|
SelectContent,
|
|
16042
|
+
SelectContext,
|
|
15910
16043
|
SelectOption,
|
|
15911
16044
|
SelectRoot,
|
|
15912
16045
|
SelectUncontrolled,
|
|
@@ -15995,6 +16128,7 @@ var PromiseUtils = {
|
|
|
15995
16128
|
useRerender,
|
|
15996
16129
|
useResizeCallbackWrapper,
|
|
15997
16130
|
useSearch,
|
|
16131
|
+
useSelectContext,
|
|
15998
16132
|
useTabContext,
|
|
15999
16133
|
useTheme,
|
|
16000
16134
|
useTransitionState,
|