@firecms/ui 3.0.0-beta.13 → 3.0.0-beta.14
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/components/Autocomplete.d.ts +4 -2
- package/dist/components/Select.d.ts +1 -0
- package/dist/index.css +1 -0
- package/dist/index.es.js +186 -165
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +186 -165
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/components/Autocomplete.tsx +10 -5
- package/src/components/Button.tsx +1 -1
- package/src/components/LoadingButton.tsx +1 -1
- package/src/components/MultiSelect.tsx +2 -3
- package/src/components/Select.tsx +44 -39
- package/src/icons/Icon.tsx +1 -1
- package/src/index.css +1 -0
- package/src/material-icons.woff2 +0 -0
|
@@ -3,6 +3,7 @@ export type AutocompleteProps = {
|
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
open: boolean;
|
|
5
5
|
setOpen: (open: boolean) => void;
|
|
6
|
+
className?: string;
|
|
6
7
|
};
|
|
7
8
|
export declare const useAutoComplete: ({ ref }: {
|
|
8
9
|
ref: React.MutableRefObject<HTMLDivElement | null>;
|
|
@@ -11,9 +12,10 @@ export declare const useAutoComplete: ({ ref }: {
|
|
|
11
12
|
autoCompleteOpen: boolean;
|
|
12
13
|
setAutoCompleteOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
13
14
|
};
|
|
14
|
-
export declare function Autocomplete({ children, open, setOpen }: AutocompleteProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function Autocomplete({ children, open, setOpen, className }: AutocompleteProps): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export type AutocompleteItemProps = {
|
|
16
17
|
children: React.ReactNode;
|
|
17
18
|
onClick?: () => void;
|
|
19
|
+
className?: string;
|
|
18
20
|
};
|
|
19
|
-
export declare function AutocompleteItem({ children, onClick }: AutocompleteItemProps): import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare function AutocompleteItem({ children, onClick, className }: AutocompleteItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -23,6 +23,7 @@ export type SelectProps<T extends SelectValue = string> = {
|
|
|
23
23
|
padding?: boolean;
|
|
24
24
|
invisible?: boolean;
|
|
25
25
|
children?: React.ReactNode;
|
|
26
|
+
dataType?: "string" | "number" | "boolean";
|
|
26
27
|
};
|
|
27
28
|
export declare const Select: React.ForwardRefExoticComponent<SelectProps<string> & React.RefAttributes<HTMLDivElement>>;
|
|
28
29
|
export type SelectItemProps<T extends SelectValue = string> = {
|
package/dist/index.css
CHANGED
package/dist/index.es.js
CHANGED
|
@@ -452,11 +452,12 @@ const useAutoComplete = ({
|
|
|
452
452
|
};
|
|
453
453
|
};
|
|
454
454
|
function Autocomplete(t0) {
|
|
455
|
-
const $ = c(
|
|
455
|
+
const $ = c(14);
|
|
456
456
|
const {
|
|
457
457
|
children,
|
|
458
458
|
open,
|
|
459
|
-
setOpen
|
|
459
|
+
setOpen,
|
|
460
|
+
className
|
|
460
461
|
} = t0;
|
|
461
462
|
const autocompleteRef = React__default.useRef(null);
|
|
462
463
|
let t1;
|
|
@@ -479,50 +480,61 @@ function Autocomplete(t0) {
|
|
|
479
480
|
}
|
|
480
481
|
const t4 = open ? paperMixin : "";
|
|
481
482
|
let t5;
|
|
482
|
-
if ($[4] !== t4) {
|
|
483
|
-
t5 = cls(t4, "bg-surface-50 dark:bg-surface-900
|
|
484
|
-
$[4] =
|
|
485
|
-
$[5] =
|
|
483
|
+
if ($[4] !== className || $[5] !== t4) {
|
|
484
|
+
t5 = cls(t4, "bg-surface-50 dark:bg-surface-900", className);
|
|
485
|
+
$[4] = className;
|
|
486
|
+
$[5] = t4;
|
|
487
|
+
$[6] = t5;
|
|
486
488
|
} else {
|
|
487
|
-
t5 = $[
|
|
489
|
+
t5 = $[6];
|
|
488
490
|
}
|
|
489
491
|
let t6;
|
|
490
|
-
if ($[
|
|
492
|
+
if ($[7] !== children || $[8] !== t5) {
|
|
491
493
|
t6 = /* @__PURE__ */ jsx("div", { ref: autocompleteRef, className: t5, children });
|
|
492
|
-
$[
|
|
493
|
-
$[
|
|
494
|
-
$[
|
|
494
|
+
$[7] = children;
|
|
495
|
+
$[8] = t5;
|
|
496
|
+
$[9] = t6;
|
|
495
497
|
} else {
|
|
496
|
-
t6 = $[
|
|
498
|
+
t6 = $[9];
|
|
497
499
|
}
|
|
498
500
|
let t7;
|
|
499
|
-
if ($[
|
|
500
|
-
t7 = /* @__PURE__ */ jsx(Collapse, { in: open, duration:
|
|
501
|
-
$[
|
|
502
|
-
$[
|
|
503
|
-
$[
|
|
504
|
-
$[
|
|
501
|
+
if ($[10] !== open || $[11] !== t3 || $[12] !== t6) {
|
|
502
|
+
t7 = /* @__PURE__ */ jsx(Collapse, { in: open, duration: 30, className: t3, children: t6 });
|
|
503
|
+
$[10] = open;
|
|
504
|
+
$[11] = t3;
|
|
505
|
+
$[12] = t6;
|
|
506
|
+
$[13] = t7;
|
|
505
507
|
} else {
|
|
506
|
-
t7 = $[
|
|
508
|
+
t7 = $[13];
|
|
507
509
|
}
|
|
508
510
|
return t7;
|
|
509
511
|
}
|
|
510
512
|
function AutocompleteItem(t0) {
|
|
511
|
-
const $ = c(
|
|
513
|
+
const $ = c(6);
|
|
512
514
|
const {
|
|
513
515
|
children,
|
|
514
|
-
onClick
|
|
516
|
+
onClick,
|
|
517
|
+
className
|
|
515
518
|
} = t0;
|
|
516
519
|
let t1;
|
|
517
|
-
if ($[0] !==
|
|
518
|
-
t1 =
|
|
519
|
-
$[0] =
|
|
520
|
-
$[1] =
|
|
521
|
-
$[2] = t1;
|
|
520
|
+
if ($[0] !== className) {
|
|
521
|
+
t1 = cls("flex w-full items-center h-[48px] cursor-pointer hover:bg-surface-accent-100 dark:hover:bg-surface-accent-800", className);
|
|
522
|
+
$[0] = className;
|
|
523
|
+
$[1] = t1;
|
|
522
524
|
} else {
|
|
523
|
-
t1 = $[
|
|
525
|
+
t1 = $[1];
|
|
524
526
|
}
|
|
525
|
-
|
|
527
|
+
let t2;
|
|
528
|
+
if ($[2] !== children || $[3] !== onClick || $[4] !== t1) {
|
|
529
|
+
t2 = /* @__PURE__ */ jsx("div", { className: t1, onClick, children });
|
|
530
|
+
$[2] = children;
|
|
531
|
+
$[3] = onClick;
|
|
532
|
+
$[4] = t1;
|
|
533
|
+
$[5] = t2;
|
|
534
|
+
} else {
|
|
535
|
+
t2 = $[5];
|
|
536
|
+
}
|
|
537
|
+
return t2;
|
|
526
538
|
}
|
|
527
539
|
const getSizeClasses = (size) => {
|
|
528
540
|
switch (size) {
|
|
@@ -869,7 +881,7 @@ const ButtonInner = React__default.forwardRef((t0, ref) => {
|
|
|
869
881
|
"border border-transparent text-secondary hover:text-secondary hover:bg-surface-accent-200 hover:bg-opacity-75 dark:hover:bg-surface-accent-800": t14,
|
|
870
882
|
"border border-transparent text-red-500 hover:text-red-500 hover:bg-red-500 hover:bg-opacity-10": t15,
|
|
871
883
|
"border border-transparent text-text-primary hover:text-text-primary dark:text-text-primary-dark hover:dark:text-text-primary-dark hover:bg-surface-accent-200 hover:dark:bg-surface-700": t16,
|
|
872
|
-
"border border-transparent text-text-primary hover:text-text-primary hover:bg-surface-accent-200 dark:text-text-primary-dark dark:hover:bg-surface-accent-700": t17,
|
|
884
|
+
"border border-transparent text-text-primary hover:text-text-primary hover:bg-surface-accent-200 dark:text-text-primary-dark dark:hover:text-text-primary-dark dark:hover:bg-surface-accent-700": t17,
|
|
873
885
|
"border border-primary text-primary hover:text-primary hover:bg-primary-bg": t18,
|
|
874
886
|
"border border-secondary text-secondary hover:text-secondary hover:bg-secondary-bg": t19,
|
|
875
887
|
"border border-red-500 text-red-500 hover:text-red-500 hover:bg-red-500 hover:text-white": t20,
|
|
@@ -1267,6 +1279,7 @@ const Icon = React.forwardRef((t0, ref) => {
|
|
|
1267
1279
|
if ($[0] !== style || $[1] !== t2) {
|
|
1268
1280
|
t3 = {
|
|
1269
1281
|
fontSize: t2,
|
|
1282
|
+
verticalAlign: "middle",
|
|
1270
1283
|
...style
|
|
1271
1284
|
};
|
|
1272
1285
|
$[0] = style;
|
|
@@ -1278,7 +1291,7 @@ const Icon = React.forwardRef((t0, ref) => {
|
|
|
1278
1291
|
const t4 = color ? colorClassesMapping[color] : "";
|
|
1279
1292
|
let t5;
|
|
1280
1293
|
if ($[3] !== className || $[4] !== t4) {
|
|
1281
|
-
t5 = cls("material-icons",
|
|
1294
|
+
t5 = cls("material-icons", t4, "select-none", className);
|
|
1282
1295
|
$[3] = className;
|
|
1283
1296
|
$[4] = t4;
|
|
1284
1297
|
$[5] = t5;
|
|
@@ -28708,7 +28721,7 @@ const Label = React.forwardRef((t0, ref) => {
|
|
|
28708
28721
|
});
|
|
28709
28722
|
Label.displayName = LabelPrimitive.Root.displayName;
|
|
28710
28723
|
function LoadingButton(t0) {
|
|
28711
|
-
const $ = c(
|
|
28724
|
+
const $ = c(18);
|
|
28712
28725
|
let children;
|
|
28713
28726
|
let disabled;
|
|
28714
28727
|
let loading;
|
|
@@ -28742,31 +28755,32 @@ function LoadingButton(t0) {
|
|
|
28742
28755
|
const t1 = loading || disabled;
|
|
28743
28756
|
const t2 = props.component;
|
|
28744
28757
|
let t3;
|
|
28745
|
-
if ($[7] !== loading) {
|
|
28746
|
-
t3 = loading && /* @__PURE__ */ jsx(CircularProgress, { size: "small" });
|
|
28758
|
+
if ($[7] !== loading || $[8] !== props.size) {
|
|
28759
|
+
t3 = loading && /* @__PURE__ */ jsx(CircularProgress, { size: props.size === "small" ? "smallest" : "small" });
|
|
28747
28760
|
$[7] = loading;
|
|
28748
|
-
$[8] =
|
|
28761
|
+
$[8] = props.size;
|
|
28762
|
+
$[9] = t3;
|
|
28749
28763
|
} else {
|
|
28750
|
-
t3 = $[
|
|
28764
|
+
t3 = $[9];
|
|
28751
28765
|
}
|
|
28752
28766
|
const t4 = !loading && startIcon;
|
|
28753
28767
|
let t5;
|
|
28754
|
-
if ($[
|
|
28768
|
+
if ($[10] !== children || $[11] !== onClick || $[12] !== props || $[13] !== t1 || $[14] !== t2 || $[15] !== t3 || $[16] !== t4) {
|
|
28755
28769
|
t5 = /* @__PURE__ */ jsxs(Button, { disabled: t1, onClick, component: t2, ...props, children: [
|
|
28756
28770
|
t3,
|
|
28757
28771
|
t4,
|
|
28758
28772
|
children
|
|
28759
28773
|
] });
|
|
28760
|
-
$[
|
|
28761
|
-
$[
|
|
28762
|
-
$[
|
|
28763
|
-
$[
|
|
28764
|
-
$[
|
|
28765
|
-
$[
|
|
28766
|
-
$[
|
|
28767
|
-
$[
|
|
28774
|
+
$[10] = children;
|
|
28775
|
+
$[11] = onClick;
|
|
28776
|
+
$[12] = props;
|
|
28777
|
+
$[13] = t1;
|
|
28778
|
+
$[14] = t2;
|
|
28779
|
+
$[15] = t3;
|
|
28780
|
+
$[16] = t4;
|
|
28781
|
+
$[17] = t5;
|
|
28768
28782
|
} else {
|
|
28769
|
-
t5 = $[
|
|
28783
|
+
t5 = $[17];
|
|
28770
28784
|
}
|
|
28771
28785
|
return t5;
|
|
28772
28786
|
}
|
|
@@ -29653,7 +29667,7 @@ function SelectInputLabel(t0) {
|
|
|
29653
29667
|
}
|
|
29654
29668
|
const MultiSelectContext = React.createContext({});
|
|
29655
29669
|
const MultiSelect = React.forwardRef((t0, ref) => {
|
|
29656
|
-
const $ = c(
|
|
29670
|
+
const $ = c(103);
|
|
29657
29671
|
const {
|
|
29658
29672
|
value,
|
|
29659
29673
|
size: t1,
|
|
@@ -29898,7 +29912,7 @@ const MultiSelect = React.forwardRef((t0, ref) => {
|
|
|
29898
29912
|
t24 = $[48];
|
|
29899
29913
|
}
|
|
29900
29914
|
let t25;
|
|
29901
|
-
if ($[49] !== children || $[50] !== handleClear || $[51] !== includeClear || $[52] !== isPopoverOpen || $[53] !== placeholder || $[54] !== renderValues || $[55] !== selectedValues || $[56] !==
|
|
29915
|
+
if ($[49] !== children || $[50] !== handleClear || $[51] !== includeClear || $[52] !== isPopoverOpen || $[53] !== placeholder || $[54] !== renderValues || $[55] !== selectedValues || $[56] !== size || $[57] !== toggleOption || $[58] !== useChips) {
|
|
29902
29916
|
t25 = selectedValues.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center w-full", children: [
|
|
29903
29917
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1.5 text-start", children: [
|
|
29904
29918
|
renderValues && renderValues(selectedValues),
|
|
@@ -29922,11 +29936,11 @@ const MultiSelect = React.forwardRef((t0, ref) => {
|
|
|
29922
29936
|
event_1.stopPropagation();
|
|
29923
29937
|
handleClear();
|
|
29924
29938
|
} }),
|
|
29925
|
-
/* @__PURE__ */ jsx("div", { className: cls("px-2 h-full flex items-center"), children: /* @__PURE__ */ jsx(KeyboardArrowDownIcon, { size: "small", className: cls("transition", isPopoverOpen ? "rotate-180" : "") }) })
|
|
29939
|
+
/* @__PURE__ */ jsx("div", { className: cls("px-2 h-full flex items-center"), children: /* @__PURE__ */ jsx(KeyboardArrowDownIcon, { size: size === "large" ? "medium" : "small", className: cls("transition", isPopoverOpen ? "rotate-180" : "") }) })
|
|
29926
29940
|
] })
|
|
29927
29941
|
] }) : /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between w-full mx-auto", children: [
|
|
29928
29942
|
/* @__PURE__ */ jsx("span", { className: "text-sm", children: placeholder }),
|
|
29929
|
-
/* @__PURE__ */ jsx("div", { className: cls("px-2 h-full flex items-center"), children: /* @__PURE__ */ jsx(KeyboardArrowDownIcon, { size: "small", className: cls("transition", isPopoverOpen ? "rotate-180" : "") }) })
|
|
29943
|
+
/* @__PURE__ */ jsx("div", { className: cls("px-2 h-full flex items-center"), children: /* @__PURE__ */ jsx(KeyboardArrowDownIcon, { size: size === "large" ? "medium" : "small", className: cls("transition", isPopoverOpen ? "rotate-180" : "") }) })
|
|
29930
29944
|
] });
|
|
29931
29945
|
$[49] = children;
|
|
29932
29946
|
$[50] = handleClear;
|
|
@@ -29935,104 +29949,105 @@ const MultiSelect = React.forwardRef((t0, ref) => {
|
|
|
29935
29949
|
$[53] = placeholder;
|
|
29936
29950
|
$[54] = renderValues;
|
|
29937
29951
|
$[55] = selectedValues;
|
|
29938
|
-
$[56] =
|
|
29939
|
-
$[57] =
|
|
29940
|
-
$[58] =
|
|
29952
|
+
$[56] = size;
|
|
29953
|
+
$[57] = toggleOption;
|
|
29954
|
+
$[58] = useChips;
|
|
29955
|
+
$[59] = t25;
|
|
29941
29956
|
} else {
|
|
29942
|
-
t25 = $[
|
|
29957
|
+
t25 = $[59];
|
|
29943
29958
|
}
|
|
29944
29959
|
let t26;
|
|
29945
|
-
if ($[
|
|
29960
|
+
if ($[60] !== handleTogglePopover || $[61] !== ref || $[62] !== t24 || $[63] !== t25) {
|
|
29946
29961
|
t26 = /* @__PURE__ */ jsx(PopoverPrimitive.Trigger, { asChild: true, children: /* @__PURE__ */ jsx("button", { ref, onClick: handleTogglePopover, className: t24, children: t25 }) });
|
|
29947
|
-
$[
|
|
29948
|
-
$[
|
|
29949
|
-
$[
|
|
29950
|
-
$[
|
|
29951
|
-
$[
|
|
29962
|
+
$[60] = handleTogglePopover;
|
|
29963
|
+
$[61] = ref;
|
|
29964
|
+
$[62] = t24;
|
|
29965
|
+
$[63] = t25;
|
|
29966
|
+
$[64] = t26;
|
|
29952
29967
|
} else {
|
|
29953
|
-
t26 = $[
|
|
29968
|
+
t26 = $[64];
|
|
29954
29969
|
}
|
|
29955
29970
|
let t27;
|
|
29956
|
-
if ($[
|
|
29971
|
+
if ($[65] === Symbol.for("react.memo_cache_sentinel")) {
|
|
29957
29972
|
t27 = cls("z-50 relative overflow-hidden border bg-white dark:bg-surface-900 rounded-lg w-[400px]", defaultBorderMixin);
|
|
29958
|
-
$[
|
|
29973
|
+
$[65] = t27;
|
|
29959
29974
|
} else {
|
|
29960
|
-
t27 = $[
|
|
29975
|
+
t27 = $[65];
|
|
29961
29976
|
}
|
|
29962
29977
|
let t28;
|
|
29963
|
-
if ($[
|
|
29978
|
+
if ($[66] !== onPopoverOpenChange) {
|
|
29964
29979
|
t28 = () => onPopoverOpenChange(false);
|
|
29965
|
-
$[
|
|
29966
|
-
$[
|
|
29980
|
+
$[66] = onPopoverOpenChange;
|
|
29981
|
+
$[67] = t28;
|
|
29967
29982
|
} else {
|
|
29968
|
-
t28 = $[
|
|
29983
|
+
t28 = $[67];
|
|
29969
29984
|
}
|
|
29970
29985
|
let t29;
|
|
29971
|
-
if ($[
|
|
29986
|
+
if ($[68] === Symbol.for("react.memo_cache_sentinel")) {
|
|
29972
29987
|
t29 = cls(focusedDisabled, "bg-transparent outline-none flex-1 h-full w-full m-4 flex-grow ");
|
|
29973
|
-
$[
|
|
29988
|
+
$[68] = t29;
|
|
29974
29989
|
} else {
|
|
29975
|
-
t29 = $[
|
|
29990
|
+
t29 = $[68];
|
|
29976
29991
|
}
|
|
29977
29992
|
let t30;
|
|
29978
|
-
if ($[
|
|
29993
|
+
if ($[69] !== handleInputKeyDown) {
|
|
29979
29994
|
t30 = /* @__PURE__ */ jsx(Command.Input, { className: t29, placeholder: "Search...", onKeyDown: handleInputKeyDown });
|
|
29980
|
-
$[
|
|
29981
|
-
$[
|
|
29995
|
+
$[69] = handleInputKeyDown;
|
|
29996
|
+
$[70] = t30;
|
|
29982
29997
|
} else {
|
|
29983
|
-
t30 = $[
|
|
29998
|
+
t30 = $[70];
|
|
29984
29999
|
}
|
|
29985
30000
|
let t31;
|
|
29986
|
-
if ($[
|
|
30001
|
+
if ($[71] !== handleClear || $[72] !== selectedValues.length) {
|
|
29987
30002
|
t31 = selectedValues.length > 0 && /* @__PURE__ */ jsx("div", { onClick: handleClear, className: "text-sm justify-center cursor-pointer py-3 px-4 text-text-secondary dark:text-text-secondary-dark", children: "Clear" });
|
|
29988
|
-
$[
|
|
29989
|
-
$[
|
|
29990
|
-
$[
|
|
30003
|
+
$[71] = handleClear;
|
|
30004
|
+
$[72] = selectedValues.length;
|
|
30005
|
+
$[73] = t31;
|
|
29991
30006
|
} else {
|
|
29992
|
-
t31 = $[
|
|
30007
|
+
t31 = $[73];
|
|
29993
30008
|
}
|
|
29994
30009
|
let t32;
|
|
29995
|
-
if ($[
|
|
30010
|
+
if ($[74] !== t30 || $[75] !== t31) {
|
|
29996
30011
|
t32 = /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center", children: [
|
|
29997
30012
|
t30,
|
|
29998
30013
|
t31
|
|
29999
30014
|
] });
|
|
30000
|
-
$[
|
|
30001
|
-
$[
|
|
30002
|
-
$[
|
|
30015
|
+
$[74] = t30;
|
|
30016
|
+
$[75] = t31;
|
|
30017
|
+
$[76] = t32;
|
|
30003
30018
|
} else {
|
|
30004
|
-
t32 = $[
|
|
30019
|
+
t32 = $[76];
|
|
30005
30020
|
}
|
|
30006
30021
|
let t33;
|
|
30007
|
-
if ($[
|
|
30022
|
+
if ($[77] === Symbol.for("react.memo_cache_sentinel")) {
|
|
30008
30023
|
t33 = /* @__PURE__ */ jsx(Separator, { orientation: "horizontal", className: "my-0" });
|
|
30009
|
-
$[
|
|
30024
|
+
$[77] = t33;
|
|
30010
30025
|
} else {
|
|
30011
|
-
t33 = $[
|
|
30026
|
+
t33 = $[77];
|
|
30012
30027
|
}
|
|
30013
30028
|
let t34;
|
|
30014
|
-
if ($[
|
|
30029
|
+
if ($[78] === Symbol.for("react.memo_cache_sentinel")) {
|
|
30015
30030
|
t34 = /* @__PURE__ */ jsx(Command.Empty, { className: "px-4 py-2", children: "No results found." });
|
|
30016
|
-
$[
|
|
30031
|
+
$[78] = t34;
|
|
30017
30032
|
} else {
|
|
30018
|
-
t34 = $[
|
|
30033
|
+
t34 = $[78];
|
|
30019
30034
|
}
|
|
30020
30035
|
let t35;
|
|
30021
|
-
if ($[
|
|
30036
|
+
if ($[79] !== allValues.length || $[80] !== includeSelectAll || $[81] !== selectedValues.length || $[82] !== toggleAll) {
|
|
30022
30037
|
t35 = includeSelectAll && /* @__PURE__ */ jsxs(Command.Item, { onSelect: toggleAll, className: cls("flex flex-row items-center gap-1.5", "cursor-pointer", "m-1", "ring-offset-transparent", "p-1 rounded aria-[selected=true]:outline-none aria-[selected=true]:ring-2 aria-[selected=true]:ring-primary aria-[selected=true]:ring-opacity-75 aria-[selected=true]:ring-offset-2", "aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900", "cursor-pointer p-2 rounded aria-[selected=true]:bg-surface-accent-100 aria-[selected=true]:dark:bg-surface-accent-900"), children: [
|
|
30023
30038
|
/* @__PURE__ */ jsx(InnerCheckBox, { checked: selectedValues.length === allValues.length }),
|
|
30024
30039
|
/* @__PURE__ */ jsx("span", { className: "text-sm text-text-secondary dark:text-text-secondary-dark", children: "(Select All)" })
|
|
30025
30040
|
] }, "all");
|
|
30026
|
-
$[
|
|
30027
|
-
$[
|
|
30028
|
-
$[
|
|
30029
|
-
$[
|
|
30030
|
-
$[
|
|
30041
|
+
$[79] = allValues.length;
|
|
30042
|
+
$[80] = includeSelectAll;
|
|
30043
|
+
$[81] = selectedValues.length;
|
|
30044
|
+
$[82] = toggleAll;
|
|
30045
|
+
$[83] = t35;
|
|
30031
30046
|
} else {
|
|
30032
|
-
t35 = $[
|
|
30047
|
+
t35 = $[83];
|
|
30033
30048
|
}
|
|
30034
30049
|
let t36;
|
|
30035
|
-
if ($[
|
|
30050
|
+
if ($[84] !== children || $[85] !== t35) {
|
|
30036
30051
|
t36 = /* @__PURE__ */ jsxs(Command.List, { children: [
|
|
30037
30052
|
t34,
|
|
30038
30053
|
/* @__PURE__ */ jsxs(Command.Group, { children: [
|
|
@@ -30040,61 +30055,61 @@ const MultiSelect = React.forwardRef((t0, ref) => {
|
|
|
30040
30055
|
children
|
|
30041
30056
|
] })
|
|
30042
30057
|
] });
|
|
30043
|
-
$[
|
|
30044
|
-
$[
|
|
30045
|
-
$[
|
|
30058
|
+
$[84] = children;
|
|
30059
|
+
$[85] = t35;
|
|
30060
|
+
$[86] = t36;
|
|
30046
30061
|
} else {
|
|
30047
|
-
t36 = $[
|
|
30062
|
+
t36 = $[86];
|
|
30048
30063
|
}
|
|
30049
30064
|
let t37;
|
|
30050
|
-
if ($[
|
|
30065
|
+
if ($[87] !== t32 || $[88] !== t36) {
|
|
30051
30066
|
t37 = /* @__PURE__ */ jsxs(Command, { children: [
|
|
30052
30067
|
t32,
|
|
30053
30068
|
t33,
|
|
30054
30069
|
t36
|
|
30055
30070
|
] });
|
|
30056
|
-
$[
|
|
30057
|
-
$[
|
|
30058
|
-
$[
|
|
30071
|
+
$[87] = t32;
|
|
30072
|
+
$[88] = t36;
|
|
30073
|
+
$[89] = t37;
|
|
30059
30074
|
} else {
|
|
30060
|
-
t37 = $[
|
|
30075
|
+
t37 = $[89];
|
|
30061
30076
|
}
|
|
30062
30077
|
let t38;
|
|
30063
|
-
if ($[
|
|
30078
|
+
if ($[90] !== t28 || $[91] !== t37) {
|
|
30064
30079
|
t38 = /* @__PURE__ */ jsx(PopoverPrimitive.Content, { className: t27, align: "start", sideOffset: 8, onEscapeKeyDown: t28, children: t37 });
|
|
30065
|
-
$[
|
|
30066
|
-
$[
|
|
30067
|
-
$[
|
|
30080
|
+
$[90] = t28;
|
|
30081
|
+
$[91] = t37;
|
|
30082
|
+
$[92] = t38;
|
|
30068
30083
|
} else {
|
|
30069
|
-
t38 = $[
|
|
30084
|
+
t38 = $[92];
|
|
30070
30085
|
}
|
|
30071
30086
|
let t39;
|
|
30072
|
-
if ($[
|
|
30087
|
+
if ($[93] !== isPopoverOpen || $[94] !== modalPopover || $[95] !== onPopoverOpenChange || $[96] !== t26 || $[97] !== t38) {
|
|
30073
30088
|
t39 = /* @__PURE__ */ jsxs(PopoverPrimitive.Root, { open: isPopoverOpen, onOpenChange: onPopoverOpenChange, modal: modalPopover, children: [
|
|
30074
30089
|
t26,
|
|
30075
30090
|
t38
|
|
30076
30091
|
] });
|
|
30077
|
-
$[
|
|
30078
|
-
$[
|
|
30079
|
-
$[
|
|
30080
|
-
$[
|
|
30081
|
-
$[
|
|
30082
|
-
$[
|
|
30092
|
+
$[93] = isPopoverOpen;
|
|
30093
|
+
$[94] = modalPopover;
|
|
30094
|
+
$[95] = onPopoverOpenChange;
|
|
30095
|
+
$[96] = t26;
|
|
30096
|
+
$[97] = t38;
|
|
30097
|
+
$[98] = t39;
|
|
30083
30098
|
} else {
|
|
30084
|
-
t39 = $[
|
|
30099
|
+
t39 = $[98];
|
|
30085
30100
|
}
|
|
30086
30101
|
let t40;
|
|
30087
|
-
if ($[
|
|
30102
|
+
if ($[99] !== t18 || $[100] !== t19 || $[101] !== t39) {
|
|
30088
30103
|
t40 = /* @__PURE__ */ jsxs(MultiSelectContext.Provider, { value: t18, children: [
|
|
30089
30104
|
t19,
|
|
30090
30105
|
t39
|
|
30091
30106
|
] });
|
|
30092
|
-
$[
|
|
30093
|
-
$[
|
|
30094
|
-
$[
|
|
30095
|
-
$[
|
|
30107
|
+
$[99] = t18;
|
|
30108
|
+
$[100] = t19;
|
|
30109
|
+
$[101] = t39;
|
|
30110
|
+
$[102] = t40;
|
|
30096
30111
|
} else {
|
|
30097
|
-
t40 = $[
|
|
30112
|
+
t40 = $[102];
|
|
30098
30113
|
}
|
|
30099
30114
|
return t40;
|
|
30100
30115
|
});
|
|
@@ -30536,6 +30551,7 @@ const Select = forwardRef(({
|
|
|
30536
30551
|
endAdornment,
|
|
30537
30552
|
invisible,
|
|
30538
30553
|
children,
|
|
30554
|
+
dataType = "string",
|
|
30539
30555
|
...props
|
|
30540
30556
|
}, ref) => {
|
|
30541
30557
|
const [openInternal, setOpenInternal] = useState(open ?? false);
|
|
@@ -30544,9 +30560,12 @@ const Select = forwardRef(({
|
|
|
30544
30560
|
}, [open]);
|
|
30545
30561
|
const onValueChangeInternal = useCallback((newValue) => {
|
|
30546
30562
|
let typedValue = newValue;
|
|
30547
|
-
if (
|
|
30548
|
-
|
|
30549
|
-
|
|
30563
|
+
if (dataType === "boolean") {
|
|
30564
|
+
if (newValue === "true") typedValue = true;
|
|
30565
|
+
else if (newValue === "false") typedValue = false;
|
|
30566
|
+
} else if (dataType === "number") {
|
|
30567
|
+
if (!isNaN(Number(newValue)) && newValue.trim() !== "") typedValue = Number(newValue);
|
|
30568
|
+
}
|
|
30550
30569
|
onValueChange?.(typedValue);
|
|
30551
30570
|
if (onChange) {
|
|
30552
30571
|
const event = {
|
|
@@ -30565,54 +30584,56 @@ const Select = forwardRef(({
|
|
|
30565
30584
|
setOpenInternal(open_0);
|
|
30566
30585
|
}, ...props, children: [
|
|
30567
30586
|
typeof label === "string" ? /* @__PURE__ */ jsx(SelectInputLabel, { error, children: label }) : label,
|
|
30568
|
-
/* @__PURE__ */
|
|
30587
|
+
/* @__PURE__ */ jsxs("div", { className: cls("select-none rounded-md text-sm", invisible ? fieldBackgroundInvisibleMixin : fieldBackgroundMixin, disabled ? fieldBackgroundDisabledMixin : fieldBackgroundHoverMixin, "relative flex items-center", className, {
|
|
30569
30588
|
"min-h-[28px]": size === "smallest",
|
|
30570
30589
|
"min-h-[32px]": size === "small",
|
|
30571
30590
|
"min-h-[42px]": size === "medium",
|
|
30572
30591
|
"min-h-[64px]": size === "large",
|
|
30573
30592
|
"w-fit": !fullWidth,
|
|
30574
30593
|
"w-full": fullWidth
|
|
30575
|
-
}), children:
|
|
30576
|
-
"
|
|
30577
|
-
|
|
30578
|
-
|
|
30579
|
-
|
|
30580
|
-
"
|
|
30581
|
-
"min-h-[32px]": size === "small",
|
|
30582
|
-
"min-h-[42px]": size === "medium",
|
|
30583
|
-
"min-h-[64px]": size === "large",
|
|
30584
|
-
"w-full": fullWidth,
|
|
30585
|
-
"w-fit": !fullWidth
|
|
30586
|
-
}, inputClassName), children: [
|
|
30587
|
-
/* @__PURE__ */ jsx("div", { ref, className: cls("flex-grow max-w-full flex flex-row gap-2 items-center", "overflow-visible", {
|
|
30594
|
+
}), children: [
|
|
30595
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Trigger, { ref: inputRef, id, asChild: true, children: /* @__PURE__ */ jsxs("div", { className: cls("h-full", padding ? {
|
|
30596
|
+
"px-4": size === "large",
|
|
30597
|
+
"px-3": size === "medium",
|
|
30598
|
+
"px-2": size === "small" || size === "smallest"
|
|
30599
|
+
} : "", "outline-none focus:outline-none", "select-none rounded-md text-sm", error ? "text-red-500 dark:text-red-600" : "focus:text-text-primary dark:focus:text-text-primary-dark", error ? "border border-red-500 dark:border-red-600" : "", disabled ? "text-surface-accent-600 dark:text-surface-accent-400" : "text-surface-accent-800 dark:text-white", "relative flex flex-row items-center", {
|
|
30588
30600
|
"min-h-[28px]": size === "smallest",
|
|
30589
30601
|
"min-h-[32px]": size === "small",
|
|
30590
30602
|
"min-h-[42px]": size === "medium",
|
|
30591
|
-
"min-h-[64px]": size === "large"
|
|
30592
|
-
|
|
30593
|
-
|
|
30594
|
-
|
|
30595
|
-
|
|
30596
|
-
|
|
30597
|
-
|
|
30598
|
-
|
|
30599
|
-
|
|
30600
|
-
|
|
30601
|
-
|
|
30602
|
-
|
|
30603
|
-
|
|
30604
|
-
|
|
30605
|
-
|
|
30603
|
+
"min-h-[64px]": size === "large",
|
|
30604
|
+
"w-full": fullWidth,
|
|
30605
|
+
"w-fit": !fullWidth
|
|
30606
|
+
}, inputClassName), children: [
|
|
30607
|
+
/* @__PURE__ */ jsx("div", { ref, className: cls("flex-grow max-w-full flex flex-row gap-2 items-center", "overflow-visible", {
|
|
30608
|
+
"min-h-[28px]": size === "smallest",
|
|
30609
|
+
"min-h-[32px]": size === "small",
|
|
30610
|
+
"min-h-[42px]": size === "medium",
|
|
30611
|
+
"min-h-[64px]": size === "large"
|
|
30612
|
+
}), children: /* @__PURE__ */ jsxs(SelectPrimitive.Value, { onClick: (e) => {
|
|
30613
|
+
e.preventDefault();
|
|
30614
|
+
e.stopPropagation();
|
|
30615
|
+
}, placeholder, className: "w-full", children: [
|
|
30616
|
+
hasValue && value !== void 0 && renderValue ? renderValue(value) : placeholder,
|
|
30617
|
+
hasValue && !renderValue && (() => {
|
|
30618
|
+
const childrenProps = Children.map(children, (child) => {
|
|
30619
|
+
if (React__default.isValidElement(child)) {
|
|
30620
|
+
return child.props;
|
|
30621
|
+
}
|
|
30622
|
+
}).filter(Boolean);
|
|
30623
|
+
const option = childrenProps.find((o) => String(o.value) === String(value));
|
|
30624
|
+
return option?.children;
|
|
30625
|
+
})()
|
|
30626
|
+
] }) }),
|
|
30627
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, { asChild: true, children: /* @__PURE__ */ jsx(KeyboardArrowDownIcon, { size: size === "large" ? "medium" : "small", className: cls("transition", open ? "rotate-180" : "", {
|
|
30628
|
+
"px-2": size === "large",
|
|
30629
|
+
"px-1": size === "medium" || size === "small"
|
|
30630
|
+
}) }) })
|
|
30606
30631
|
] }) }),
|
|
30607
|
-
endAdornment && /* @__PURE__ */ jsx("div", { className: cls("h-full flex items-center"), onClick: (e_0) => {
|
|
30632
|
+
endAdornment && /* @__PURE__ */ jsx("div", { className: cls("h-full flex items-center absolute right-0 pr-12"), onClick: (e_0) => {
|
|
30608
30633
|
e_0.preventDefault();
|
|
30609
30634
|
e_0.stopPropagation();
|
|
30610
|
-
}, children: endAdornment })
|
|
30611
|
-
|
|
30612
|
-
"px-2": size === "large",
|
|
30613
|
-
"px-1": size === "medium" || size === "small"
|
|
30614
|
-
}) }) })
|
|
30615
|
-
] }) }) }),
|
|
30635
|
+
}, children: endAdornment })
|
|
30636
|
+
] }),
|
|
30616
30637
|
/* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx(SelectPrimitive.Content, { position, className: cls(focusedDisabled, "z-50 relative overflow-hidden border bg-white dark:bg-surface-900 p-2 rounded-lg", defaultBorderMixin), children: /* @__PURE__ */ jsx(SelectPrimitive.Viewport, { className: "p-1", style: {
|
|
30617
30638
|
maxHeight: "var(--radix-select-content-available-height)"
|
|
30618
30639
|
}, children }) }) })
|