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