@esic-lab/data-core-ui 0.0.46 → 0.0.48
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.css +22 -4
- package/dist/index.d.mts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +185 -66
- package/dist/index.mjs +192 -67
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
--color-red-600: #ee443f;
|
|
30
30
|
--color-red-700: #a9302d;
|
|
31
31
|
--color-yellow-400: #ffbb33;
|
|
32
|
+
--color-yellow-500: #ffaa00;
|
|
32
33
|
--color-green-400: #69c57d;
|
|
33
34
|
--color-green-500: #43b75d;
|
|
34
35
|
--color-green-600: #3da755;
|
|
@@ -315,6 +316,9 @@
|
|
|
315
316
|
.z-10 {
|
|
316
317
|
z-index: 10;
|
|
317
318
|
}
|
|
319
|
+
.z-20 {
|
|
320
|
+
z-index: 20;
|
|
321
|
+
}
|
|
318
322
|
.z-50 {
|
|
319
323
|
z-index: 50;
|
|
320
324
|
}
|
|
@@ -339,8 +343,8 @@
|
|
|
339
343
|
.mt-4 {
|
|
340
344
|
margin-top: calc(var(--spacing) * 4);
|
|
341
345
|
}
|
|
342
|
-
.mt-
|
|
343
|
-
margin-top: calc(var(--spacing) *
|
|
346
|
+
.mt-8 {
|
|
347
|
+
margin-top: calc(var(--spacing) * 8);
|
|
344
348
|
}
|
|
345
349
|
.mt-\[-12px\] {
|
|
346
350
|
margin-top: -12px;
|
|
@@ -751,6 +755,13 @@
|
|
|
751
755
|
margin-block-end: calc(calc(var(--spacing) * 1) * calc(1 - var(--tw-space-y-reverse)));
|
|
752
756
|
}
|
|
753
757
|
}
|
|
758
|
+
.space-y-2 {
|
|
759
|
+
:where(& > :not(:last-child)) {
|
|
760
|
+
--tw-space-y-reverse: 0;
|
|
761
|
+
margin-block-start: calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));
|
|
762
|
+
margin-block-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)));
|
|
763
|
+
}
|
|
764
|
+
}
|
|
754
765
|
.space-y-4 {
|
|
755
766
|
:where(& > :not(:last-child)) {
|
|
756
767
|
--tw-space-y-reverse: 0;
|
|
@@ -843,6 +854,10 @@
|
|
|
843
854
|
border-style: var(--tw-border-style);
|
|
844
855
|
border-width: 2px;
|
|
845
856
|
}
|
|
857
|
+
.border-3 {
|
|
858
|
+
border-style: var(--tw-border-style);
|
|
859
|
+
border-width: 3px;
|
|
860
|
+
}
|
|
846
861
|
.border-4 {
|
|
847
862
|
border-style: var(--tw-border-style);
|
|
848
863
|
border-width: 4px;
|
|
@@ -1140,6 +1155,9 @@
|
|
|
1140
1155
|
.text-white {
|
|
1141
1156
|
color: var(--color-white);
|
|
1142
1157
|
}
|
|
1158
|
+
.text-yellow-500 {
|
|
1159
|
+
color: var(--color-yellow-500);
|
|
1160
|
+
}
|
|
1143
1161
|
.uppercase {
|
|
1144
1162
|
text-transform: uppercase;
|
|
1145
1163
|
}
|
|
@@ -1297,11 +1315,11 @@
|
|
|
1297
1315
|
}
|
|
1298
1316
|
}
|
|
1299
1317
|
}
|
|
1300
|
-
.group-hover\:border-
|
|
1318
|
+
.group-hover\:border-3 {
|
|
1301
1319
|
&:is(:where(.group):hover *) {
|
|
1302
1320
|
@media (hover: hover) {
|
|
1303
1321
|
border-style: var(--tw-border-style);
|
|
1304
|
-
border-width:
|
|
1322
|
+
border-width: 3px;
|
|
1305
1323
|
}
|
|
1306
1324
|
}
|
|
1307
1325
|
}
|
package/dist/index.d.mts
CHANGED
|
@@ -523,16 +523,22 @@ interface IndicatorProps {
|
|
|
523
523
|
}[];
|
|
524
524
|
type: "OUTPUT" | "OUTCOME";
|
|
525
525
|
arrayData: IndicatorArray[];
|
|
526
|
+
canEdit?: boolean;
|
|
526
527
|
setArrayData: (data: IndicatorArray[]) => void;
|
|
528
|
+
onDeleteClick?: (payload: {
|
|
529
|
+
index: number;
|
|
530
|
+
item: IndicatorArray;
|
|
531
|
+
confirm: () => void;
|
|
532
|
+
}) => void;
|
|
527
533
|
}
|
|
528
534
|
interface IndicatorArray {
|
|
529
535
|
indicatorType: "OUTPUT" | "OUTCOME";
|
|
530
536
|
inputType: "TEXT" | "NUMBER";
|
|
531
537
|
textValue: string;
|
|
532
|
-
numberValue?:
|
|
538
|
+
numberValue?: number;
|
|
533
539
|
unit?: string;
|
|
534
540
|
}
|
|
535
|
-
declare function Indicator({ option, type, arrayData, setArrayData, }: IndicatorProps): react_jsx_runtime.JSX.Element;
|
|
541
|
+
declare function Indicator({ option, type, arrayData, setArrayData, canEdit, onDeleteClick, }: IndicatorProps): react_jsx_runtime.JSX.Element;
|
|
536
542
|
|
|
537
543
|
interface optionSelect {
|
|
538
544
|
value: string;
|
|
@@ -552,9 +558,10 @@ interface ProfileSelectProp {
|
|
|
552
558
|
allUser: UserData[];
|
|
553
559
|
assignUser: UserData[];
|
|
554
560
|
mode: "show" | "showAssign" | "icon";
|
|
561
|
+
className?: string;
|
|
555
562
|
onUpdateAssignUser: (user: UserData, action?: "add" | "remove") => void;
|
|
556
563
|
}
|
|
557
|
-
declare function ProfileSelect({ allUser, assignUser, mode, onUpdateAssignUser, }: ProfileSelectProp): react_jsx_runtime.JSX.Element;
|
|
564
|
+
declare function ProfileSelect({ allUser, assignUser, mode, className, onUpdateAssignUser, }: ProfileSelectProp): react_jsx_runtime.JSX.Element;
|
|
558
565
|
|
|
559
566
|
interface QRCodeGeneratorProps {
|
|
560
567
|
url: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -523,16 +523,22 @@ interface IndicatorProps {
|
|
|
523
523
|
}[];
|
|
524
524
|
type: "OUTPUT" | "OUTCOME";
|
|
525
525
|
arrayData: IndicatorArray[];
|
|
526
|
+
canEdit?: boolean;
|
|
526
527
|
setArrayData: (data: IndicatorArray[]) => void;
|
|
528
|
+
onDeleteClick?: (payload: {
|
|
529
|
+
index: number;
|
|
530
|
+
item: IndicatorArray;
|
|
531
|
+
confirm: () => void;
|
|
532
|
+
}) => void;
|
|
527
533
|
}
|
|
528
534
|
interface IndicatorArray {
|
|
529
535
|
indicatorType: "OUTPUT" | "OUTCOME";
|
|
530
536
|
inputType: "TEXT" | "NUMBER";
|
|
531
537
|
textValue: string;
|
|
532
|
-
numberValue?:
|
|
538
|
+
numberValue?: number;
|
|
533
539
|
unit?: string;
|
|
534
540
|
}
|
|
535
|
-
declare function Indicator({ option, type, arrayData, setArrayData, }: IndicatorProps): react_jsx_runtime.JSX.Element;
|
|
541
|
+
declare function Indicator({ option, type, arrayData, setArrayData, canEdit, onDeleteClick, }: IndicatorProps): react_jsx_runtime.JSX.Element;
|
|
536
542
|
|
|
537
543
|
interface optionSelect {
|
|
538
544
|
value: string;
|
|
@@ -552,9 +558,10 @@ interface ProfileSelectProp {
|
|
|
552
558
|
allUser: UserData[];
|
|
553
559
|
assignUser: UserData[];
|
|
554
560
|
mode: "show" | "showAssign" | "icon";
|
|
561
|
+
className?: string;
|
|
555
562
|
onUpdateAssignUser: (user: UserData, action?: "add" | "remove") => void;
|
|
556
563
|
}
|
|
557
|
-
declare function ProfileSelect({ allUser, assignUser, mode, onUpdateAssignUser, }: ProfileSelectProp): react_jsx_runtime.JSX.Element;
|
|
564
|
+
declare function ProfileSelect({ allUser, assignUser, mode, className, onUpdateAssignUser, }: ProfileSelectProp): react_jsx_runtime.JSX.Element;
|
|
558
565
|
|
|
559
566
|
interface QRCodeGeneratorProps {
|
|
560
567
|
url: string;
|
package/dist/index.js
CHANGED
|
@@ -3753,41 +3753,66 @@ function Indicator({
|
|
|
3753
3753
|
],
|
|
3754
3754
|
type,
|
|
3755
3755
|
arrayData,
|
|
3756
|
-
setArrayData
|
|
3756
|
+
setArrayData,
|
|
3757
|
+
canEdit,
|
|
3758
|
+
onDeleteClick
|
|
3757
3759
|
}) {
|
|
3758
3760
|
const [valueSwitch, setValueSwitch] = (0, import_react17.useState)("TEXT");
|
|
3759
3761
|
const [cacheData, setCacheData] = (0, import_react17.useState)({
|
|
3760
3762
|
indicatorType: type,
|
|
3761
3763
|
inputType: valueSwitch,
|
|
3762
3764
|
textValue: "",
|
|
3763
|
-
numberValue:
|
|
3765
|
+
numberValue: 0,
|
|
3764
3766
|
unit: ""
|
|
3765
3767
|
});
|
|
3766
3768
|
const [cacheEditData, setCacheEditData] = (0, import_react17.useState)({
|
|
3767
3769
|
indicatorType: type,
|
|
3768
3770
|
inputType: valueSwitch,
|
|
3769
3771
|
textValue: "",
|
|
3770
|
-
numberValue:
|
|
3772
|
+
numberValue: 0,
|
|
3771
3773
|
unit: ""
|
|
3772
3774
|
});
|
|
3773
3775
|
const [editIndex, setEditIndex] = (0, import_react17.useState)(null);
|
|
3776
|
+
const [addError, setAddError] = (0, import_react17.useState)({});
|
|
3777
|
+
const [editError, setEditError] = (0, import_react17.useState)({});
|
|
3774
3778
|
const handleAddIndicator = () => {
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3779
|
+
const nextErr = {};
|
|
3780
|
+
const textValue = (cacheData.textValue ?? "").trim();
|
|
3781
|
+
const unit = (cacheData.unit ?? "").trim();
|
|
3782
|
+
if (textValue === "") {
|
|
3783
|
+
nextErr.textValue = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E0A\u0E37\u0E48\u0E2D\u0E15\u0E31\u0E27\u0E0A\u0E35\u0E49\u0E27\u0E31\u0E14";
|
|
3784
|
+
}
|
|
3785
|
+
if (valueSwitch === "NUMBER") {
|
|
3786
|
+
const num = cacheData.numberValue;
|
|
3787
|
+
if (num === void 0 || num === null || Number(num) <= 0) {
|
|
3788
|
+
nextErr.numberValue = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E04\u0E48\u0E32\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";
|
|
3789
|
+
}
|
|
3790
|
+
if (unit === "") {
|
|
3791
|
+
nextErr.unit = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E2B\u0E19\u0E48\u0E27\u0E22";
|
|
3792
|
+
}
|
|
3793
|
+
}
|
|
3794
|
+
setAddError(nextErr);
|
|
3795
|
+
if (Object.keys(nextErr).length > 0) return;
|
|
3796
|
+
const newItem = valueSwitch === "TEXT" ? {
|
|
3797
|
+
indicatorType: type,
|
|
3798
|
+
inputType: "TEXT",
|
|
3799
|
+
textValue
|
|
3800
|
+
} : {
|
|
3801
|
+
indicatorType: type,
|
|
3802
|
+
inputType: "NUMBER",
|
|
3803
|
+
textValue,
|
|
3804
|
+
numberValue: Number(cacheData.numberValue),
|
|
3805
|
+
unit
|
|
3806
|
+
};
|
|
3807
|
+
setArrayData([...arrayData, newItem]);
|
|
3784
3808
|
setCacheData({
|
|
3785
3809
|
indicatorType: type,
|
|
3786
3810
|
inputType: valueSwitch,
|
|
3787
3811
|
textValue: "",
|
|
3788
|
-
numberValue:
|
|
3812
|
+
numberValue: 0,
|
|
3789
3813
|
unit: ""
|
|
3790
3814
|
});
|
|
3815
|
+
setAddError({});
|
|
3791
3816
|
};
|
|
3792
3817
|
const handleChangeCashData = (key, value) => {
|
|
3793
3818
|
setCacheData((prev) => ({
|
|
@@ -3813,11 +3838,32 @@ function Indicator({
|
|
|
3813
3838
|
setEditIndex(null);
|
|
3814
3839
|
};
|
|
3815
3840
|
const handleConfirmEditIndicator = (index) => {
|
|
3816
|
-
|
|
3841
|
+
const nextErr = {};
|
|
3842
|
+
const textValue = (cacheEditData.textValue ?? "").trim();
|
|
3843
|
+
const unit = (cacheEditData.unit ?? "").trim();
|
|
3844
|
+
const num = cacheEditData.numberValue;
|
|
3845
|
+
if (textValue === "") {
|
|
3846
|
+
nextErr.textValue = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E0A\u0E37\u0E48\u0E2D\u0E15\u0E31\u0E27\u0E0A\u0E35\u0E49\u0E27\u0E31\u0E14";
|
|
3847
|
+
}
|
|
3848
|
+
if (cacheEditData.inputType === "NUMBER") {
|
|
3849
|
+
if (num === void 0 || num === null || Number(num) <= 0) {
|
|
3850
|
+
nextErr.numberValue = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E04\u0E48\u0E32\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";
|
|
3851
|
+
}
|
|
3852
|
+
if (unit === "") {
|
|
3853
|
+
nextErr.unit = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E2B\u0E19\u0E48\u0E27\u0E22";
|
|
3854
|
+
}
|
|
3855
|
+
}
|
|
3856
|
+
setEditError(nextErr);
|
|
3857
|
+
if (Object.keys(nextErr).length > 0) return;
|
|
3817
3858
|
const newData = [...arrayData];
|
|
3818
|
-
newData[index] =
|
|
3859
|
+
newData[index] = {
|
|
3860
|
+
...cacheEditData,
|
|
3861
|
+
textValue,
|
|
3862
|
+
...cacheEditData.inputType === "NUMBER" ? { numberValue: Number(num), unit } : { numberValue: void 0, unit: void 0 }
|
|
3863
|
+
};
|
|
3819
3864
|
setArrayData(newData);
|
|
3820
3865
|
setEditIndex(null);
|
|
3866
|
+
setEditError({});
|
|
3821
3867
|
};
|
|
3822
3868
|
const handleChangeEditCashData = (e) => {
|
|
3823
3869
|
const { name, value } = e.target;
|
|
@@ -3833,16 +3879,29 @@ function Indicator({
|
|
|
3833
3879
|
{
|
|
3834
3880
|
className: `space-x-2 grid ${valueSwitch === "TEXT" ? `grid-cols-[140px_1fr_50px]` : `grid-cols-[140px_1fr_200px_200px_50px]`} items-start`,
|
|
3835
3881
|
children: [
|
|
3836
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3882
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3883
|
+
SwitchSelect,
|
|
3884
|
+
{
|
|
3885
|
+
option,
|
|
3886
|
+
onClick: handleClick,
|
|
3887
|
+
value: valueSwitch,
|
|
3888
|
+
label: "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17",
|
|
3889
|
+
required: true
|
|
3890
|
+
}
|
|
3891
|
+
),
|
|
3837
3892
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3838
3893
|
InputField,
|
|
3839
3894
|
{
|
|
3840
3895
|
label: `\u0E0A\u0E37\u0E48\u0E2D\u0E15\u0E31\u0E27\u0E0A\u0E35\u0E49\u0E27\u0E31\u0E14${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3841
3896
|
value: cacheData.textValue,
|
|
3842
3897
|
className: "h-[32px]",
|
|
3843
|
-
onChange: (
|
|
3898
|
+
onChange: (val) => {
|
|
3899
|
+
handleChangeCashData("textValue", val ?? "");
|
|
3900
|
+
setAddError((p) => ({ ...p, textValue: void 0 }));
|
|
3901
|
+
},
|
|
3844
3902
|
placeholder: `\u0E23\u0E30\u0E1A\u0E38\u0E0A\u0E37\u0E48\u0E2D\u0E15\u0E31\u0E27\u0E0A\u0E35\u0E49\u0E27\u0E31\u0E14${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3845
|
-
required: true
|
|
3903
|
+
required: true,
|
|
3904
|
+
error: addError.textValue
|
|
3846
3905
|
}
|
|
3847
3906
|
),
|
|
3848
3907
|
valueSwitch === "NUMBER" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
@@ -3850,11 +3909,16 @@ function Indicator({
|
|
|
3850
3909
|
InputFieldNumber,
|
|
3851
3910
|
{
|
|
3852
3911
|
label: `\u0E04\u0E48\u0E32\u0E40\u0E1B\u0E49\u0E32\u0E2B\u0E21\u0E32\u0E22${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3853
|
-
value: cacheData.numberValue ??
|
|
3912
|
+
value: cacheData.numberValue ?? 0,
|
|
3854
3913
|
className: "h-[32px]",
|
|
3855
|
-
onChange: (
|
|
3914
|
+
onChange: (val) => {
|
|
3915
|
+
handleChangeCashData("numberValue", val ?? 0);
|
|
3916
|
+
setAddError((p) => ({ ...p, numberValue: void 0 }));
|
|
3917
|
+
},
|
|
3918
|
+
min: 0,
|
|
3856
3919
|
placeholder: `\u0E23\u0E30\u0E1A\u0E38\u0E04\u0E48\u0E32\u0E40\u0E1B\u0E49\u0E32\u0E2B\u0E21\u0E32\u0E22${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3857
|
-
required: true
|
|
3920
|
+
required: true,
|
|
3921
|
+
error: addError.numberValue
|
|
3858
3922
|
}
|
|
3859
3923
|
),
|
|
3860
3924
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
@@ -3863,53 +3927,83 @@ function Indicator({
|
|
|
3863
3927
|
label: `\u0E2B\u0E19\u0E48\u0E27\u0E22`,
|
|
3864
3928
|
value: cacheData.unit ?? "",
|
|
3865
3929
|
className: "h-[32px]",
|
|
3866
|
-
onChange: (
|
|
3930
|
+
onChange: (val) => {
|
|
3931
|
+
handleChangeCashData("unit", val ?? "");
|
|
3932
|
+
setAddError((p) => ({ ...p, unit: void 0 }));
|
|
3933
|
+
},
|
|
3867
3934
|
placeholder: "\u0E23\u0E30\u0E1A\u0E38\u0E2B\u0E19\u0E48\u0E27\u0E22",
|
|
3868
|
-
required: true
|
|
3935
|
+
required: true,
|
|
3936
|
+
error: addError.unit
|
|
3869
3937
|
}
|
|
3870
3938
|
)
|
|
3871
3939
|
] }),
|
|
3872
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3940
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3941
|
+
import_icons_react12.IconCirclePlus,
|
|
3942
|
+
{
|
|
3943
|
+
onClick: handleAddIndicator,
|
|
3944
|
+
className: "mt-8 cursor-pointer",
|
|
3945
|
+
size: 32
|
|
3946
|
+
}
|
|
3947
|
+
)
|
|
3873
3948
|
]
|
|
3874
3949
|
}
|
|
3875
3950
|
),
|
|
3876
3951
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children: arrayData.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
3877
3952
|
"div",
|
|
3878
3953
|
{
|
|
3879
|
-
className: `space-y-
|
|
3954
|
+
className: `space-y-2 grid ${item.inputType === "TEXT" ? `grid-cols-[140px_1fr_50px_50px]` : `grid-cols-[140px_1fr_200px_150px_50px_50px]`} items-start`,
|
|
3880
3955
|
children: [
|
|
3881
3956
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2", children: item.inputType === "TEXT" ? "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" : "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }),
|
|
3882
|
-
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime40.
|
|
3883
|
-
|
|
3884
|
-
{
|
|
3885
|
-
className: "body-1 mt-2",
|
|
3886
|
-
variant: "underlined",
|
|
3887
|
-
value: cacheEditData.textValue,
|
|
3888
|
-
name: "textValue",
|
|
3889
|
-
onChange: (e) => handleChangeEditCashData(e)
|
|
3890
|
-
}
|
|
3891
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2", children: item.textValue }),
|
|
3892
|
-
item.inputType === "NUMBER" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3893
|
-
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3894
|
-
import_antd20.Input,
|
|
3895
|
-
{
|
|
3896
|
-
className: "body-1 mt-2",
|
|
3897
|
-
variant: "underlined",
|
|
3898
|
-
value: cacheEditData.numberValue,
|
|
3899
|
-
name: "numberValue",
|
|
3900
|
-
onChange: (e) => handleChangeEditCashData(e)
|
|
3901
|
-
}
|
|
3902
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2", children: item.numberValue }),
|
|
3903
|
-
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3957
|
+
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col gap-[8px]", children: [
|
|
3958
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3904
3959
|
import_antd20.Input,
|
|
3905
3960
|
{
|
|
3906
3961
|
className: "body-1 mt-2",
|
|
3907
3962
|
variant: "underlined",
|
|
3908
|
-
value: cacheEditData.
|
|
3909
|
-
name: "
|
|
3910
|
-
onChange: (e) =>
|
|
3963
|
+
value: cacheEditData.textValue,
|
|
3964
|
+
name: "textValue",
|
|
3965
|
+
onChange: (e) => {
|
|
3966
|
+
handleChangeEditCashData(e);
|
|
3967
|
+
setEditError((p) => ({ ...p, textValue: void 0 }));
|
|
3968
|
+
}
|
|
3911
3969
|
}
|
|
3912
|
-
)
|
|
3970
|
+
),
|
|
3971
|
+
editError.textValue && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-red-500 caption-1", children: editError.textValue })
|
|
3972
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2", children: item.textValue }),
|
|
3973
|
+
item.inputType === "NUMBER" && /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(import_jsx_runtime40.Fragment, { children: [
|
|
3974
|
+
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col gap-[8px]", children: [
|
|
3975
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3976
|
+
import_antd20.Input,
|
|
3977
|
+
{
|
|
3978
|
+
type: "number",
|
|
3979
|
+
className: "body-1 mt-2",
|
|
3980
|
+
variant: "underlined",
|
|
3981
|
+
value: cacheEditData.numberValue,
|
|
3982
|
+
name: "numberValue",
|
|
3983
|
+
onChange: (e) => {
|
|
3984
|
+
handleChangeEditCashData(e);
|
|
3985
|
+
setEditError((p) => ({ ...p, numberValue: void 0 }));
|
|
3986
|
+
}
|
|
3987
|
+
}
|
|
3988
|
+
),
|
|
3989
|
+
editError.numberValue && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-red-500 caption-1", children: editError.numberValue })
|
|
3990
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2", children: item.numberValue }),
|
|
3991
|
+
index === editIndex ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex flex-col gap-[8px]", children: [
|
|
3992
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3993
|
+
import_antd20.Input,
|
|
3994
|
+
{
|
|
3995
|
+
className: "body-1 mt-2",
|
|
3996
|
+
variant: "underlined",
|
|
3997
|
+
value: cacheEditData.unit,
|
|
3998
|
+
name: "unit",
|
|
3999
|
+
onChange: (e) => {
|
|
4000
|
+
handleChangeEditCashData(e);
|
|
4001
|
+
setEditError((p) => ({ ...p, unit: void 0 }));
|
|
4002
|
+
}
|
|
4003
|
+
}
|
|
4004
|
+
),
|
|
4005
|
+
editError.unit && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("p", { className: "text-red-500 caption-1", children: editError.unit })
|
|
4006
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2", children: item.unit })
|
|
3913
4007
|
] }),
|
|
3914
4008
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2 flex", children: editIndex !== null ? editIndex === index ? /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: "flex", children: [
|
|
3915
4009
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
@@ -3919,11 +4013,36 @@ function Indicator({
|
|
|
3919
4013
|
onClick: () => handleConfirmEditIndicator(index)
|
|
3920
4014
|
}
|
|
3921
4015
|
),
|
|
3922
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
3923
|
-
|
|
3924
|
-
|
|
4016
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4017
|
+
import_icons_react12.IconX,
|
|
4018
|
+
{
|
|
4019
|
+
className: "cursor-pointer text-red-600",
|
|
4020
|
+
onClick: handleCancelEditIndicator
|
|
4021
|
+
}
|
|
4022
|
+
)
|
|
4023
|
+
] }) : void 0 : canEdit && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4024
|
+
import_icons_react12.IconPencil,
|
|
4025
|
+
{
|
|
4026
|
+
className: "cursor-pointer",
|
|
4027
|
+
onClick: () => handleEditIndicator(index)
|
|
4028
|
+
}
|
|
4029
|
+
) }),
|
|
4030
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "body-1 mt-2 cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
4031
|
+
import_icons_react12.IconTrash,
|
|
4032
|
+
{
|
|
4033
|
+
onClick: () => {
|
|
4034
|
+
const confirm = () => handleDeleteIndicator(index);
|
|
4035
|
+
if (onDeleteClick) {
|
|
4036
|
+
onDeleteClick({ index, item, confirm });
|
|
4037
|
+
} else {
|
|
4038
|
+
confirm();
|
|
4039
|
+
}
|
|
4040
|
+
}
|
|
4041
|
+
}
|
|
4042
|
+
) })
|
|
3925
4043
|
]
|
|
3926
|
-
}
|
|
4044
|
+
},
|
|
4045
|
+
index
|
|
3927
4046
|
)) })
|
|
3928
4047
|
] });
|
|
3929
4048
|
}
|
|
@@ -3975,6 +4094,7 @@ function ProfileSelect({
|
|
|
3975
4094
|
allUser,
|
|
3976
4095
|
assignUser,
|
|
3977
4096
|
mode,
|
|
4097
|
+
className,
|
|
3978
4098
|
onUpdateAssignUser
|
|
3979
4099
|
}) {
|
|
3980
4100
|
const [maxVisible, setMaxVisible] = (0, import_react19.useState)(4);
|
|
@@ -4032,13 +4152,13 @@ function ProfileSelect({
|
|
|
4032
4152
|
import_icons_react14.IconUsers,
|
|
4033
4153
|
{
|
|
4034
4154
|
size: 40,
|
|
4035
|
-
className: "p-2 border rounded cursor-pointer",
|
|
4155
|
+
className: "p-2 border rounded cursor-pointer bg-white",
|
|
4036
4156
|
onClick: () => setIsShowSelect(!isShowSelect)
|
|
4037
4157
|
}
|
|
4038
4158
|
) }) : mode === "showAssign" ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4039
4159
|
"button",
|
|
4040
4160
|
{
|
|
4041
|
-
className:
|
|
4161
|
+
className: `w-full h-[40px] flex -space-x-2 p-2 cursor-pointer ${className}`,
|
|
4042
4162
|
onClick: () => setIsShowSelect(!isShowSelect),
|
|
4043
4163
|
children: [
|
|
4044
4164
|
visibleUsers.map((user) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex items-center cursor-point", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { className: "relative group cursor-pointer", children: [
|
|
@@ -4052,13 +4172,13 @@ function ProfileSelect({
|
|
|
4052
4172
|
height: avatarSize,
|
|
4053
4173
|
borderRadius: "50%"
|
|
4054
4174
|
},
|
|
4055
|
-
className: "border border-white group-hover:border-
|
|
4175
|
+
className: "border border-white group-hover:border-3 group-hover:border-red-500 transition"
|
|
4056
4176
|
}
|
|
4057
4177
|
),
|
|
4058
4178
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4059
4179
|
"span",
|
|
4060
4180
|
{
|
|
4061
|
-
className: "absolute top-0 right-0 -translate-y-2 translate-x-2 \r\n rounded-full bg-white opacity-0 group-hover:opacity-100 \r\n border-
|
|
4181
|
+
className: "absolute top-0 right-0 -translate-y-2 translate-x-2 \r\n rounded-full bg-white opacity-0 group-hover:opacity-100 \r\n border-3 z-10 border-red-500 flex items-center justify-center transition",
|
|
4062
4182
|
onClick: () => onUpdateAssignUser(user, "remove"),
|
|
4063
4183
|
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons_react14.IconX, { className: "w-4 h-4 text-red-500" })
|
|
4064
4184
|
}
|
|
@@ -4081,7 +4201,7 @@ function ProfileSelect({
|
|
|
4081
4201
|
)
|
|
4082
4202
|
]
|
|
4083
4203
|
}
|
|
4084
|
-
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className:
|
|
4204
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: `w-full h-[40px] flex -space-x-2 p-2 ${className}`, children: [
|
|
4085
4205
|
visibleUsers.map((user) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: "flex items-center ", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("label", { className: "relative group ", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4086
4206
|
"img",
|
|
4087
4207
|
{
|
|
@@ -4114,7 +4234,7 @@ function ProfileSelect({
|
|
|
4114
4234
|
isShowSelect ? /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
4115
4235
|
"div",
|
|
4116
4236
|
{
|
|
4117
|
-
className: "absolute top-12 min-w-[261px] max-w-[400px] w-full h-[314px] p-2 text-xs border-1 rounded-sm ",
|
|
4237
|
+
className: "absolute top-12 min-w-[261px] max-w-[400px] w-full h-[314px] p-2 text-xs border-1 rounded-sm z-20 bg-white",
|
|
4118
4238
|
ref: selectRef,
|
|
4119
4239
|
children: [
|
|
4120
4240
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "flex border-1 rounded-md p-2 gap-2 items-center", children: [
|
|
@@ -4137,9 +4257,8 @@ function ProfileSelect({
|
|
|
4137
4257
|
"button",
|
|
4138
4258
|
{
|
|
4139
4259
|
className: "flex items-center group my-1 w-full p-1 rounded hover:bg-gray-100",
|
|
4140
|
-
onClick: () => onUpdateAssignUser(user, "remove"),
|
|
4141
4260
|
children: [
|
|
4142
|
-
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("
|
|
4261
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "relative cursor-pointer", children: [
|
|
4143
4262
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4144
4263
|
"img",
|
|
4145
4264
|
{
|
|
@@ -4150,13 +4269,13 @@ function ProfileSelect({
|
|
|
4150
4269
|
height: avatarSize,
|
|
4151
4270
|
borderRadius: "50%"
|
|
4152
4271
|
},
|
|
4153
|
-
className: "border-
|
|
4272
|
+
className: "border-3 border-red-500"
|
|
4154
4273
|
}
|
|
4155
4274
|
),
|
|
4156
4275
|
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
4157
4276
|
"span",
|
|
4158
4277
|
{
|
|
4159
|
-
className: "absolute top-0 right-0 -translate-y-2 translate-x-2 \r\n rounded-full bg-white opacity-0 group-hover:opacity-100 \r\n border-
|
|
4278
|
+
className: "absolute top-0 right-0 -translate-y-2 translate-x-2 \r\n rounded-full bg-white opacity-0 group-hover:opacity-100 \r\n border-3 border-red-500 flex items-center justify-center transition",
|
|
4160
4279
|
onClick: () => onUpdateAssignUser(user, "remove"),
|
|
4161
4280
|
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_icons_react14.IconX, { className: "text-red-500", size: 15 })
|
|
4162
4281
|
}
|
|
@@ -4338,7 +4457,7 @@ var QRCodeGenerator = ({
|
|
|
4338
4457
|
] });
|
|
4339
4458
|
};
|
|
4340
4459
|
|
|
4341
|
-
// src/TabPropject/
|
|
4460
|
+
// src/TabPropject/TabProject/TabProject.tsx
|
|
4342
4461
|
var import_antd22 = require("antd");
|
|
4343
4462
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
4344
4463
|
function TabProject({ tabOption, now, onChange }) {
|
package/dist/index.mjs
CHANGED
|
@@ -3681,7 +3681,13 @@ function AntDModal({ children, isOpen, width, onCancel }) {
|
|
|
3681
3681
|
}
|
|
3682
3682
|
|
|
3683
3683
|
// src/Indicator/Indicator/Indicator.tsx
|
|
3684
|
-
import {
|
|
3684
|
+
import {
|
|
3685
|
+
IconCheck as IconCheck3,
|
|
3686
|
+
IconCirclePlus as IconCirclePlus2,
|
|
3687
|
+
IconPencil as IconPencil2,
|
|
3688
|
+
IconTrash as IconTrash4,
|
|
3689
|
+
IconX as IconX3
|
|
3690
|
+
} from "@tabler/icons-react";
|
|
3685
3691
|
import { useState as useState15 } from "react";
|
|
3686
3692
|
import { Input as Input4 } from "antd";
|
|
3687
3693
|
import { Fragment as Fragment7, jsx as jsx40, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
@@ -3692,41 +3698,66 @@ function Indicator({
|
|
|
3692
3698
|
],
|
|
3693
3699
|
type,
|
|
3694
3700
|
arrayData,
|
|
3695
|
-
setArrayData
|
|
3701
|
+
setArrayData,
|
|
3702
|
+
canEdit,
|
|
3703
|
+
onDeleteClick
|
|
3696
3704
|
}) {
|
|
3697
3705
|
const [valueSwitch, setValueSwitch] = useState15("TEXT");
|
|
3698
3706
|
const [cacheData, setCacheData] = useState15({
|
|
3699
3707
|
indicatorType: type,
|
|
3700
3708
|
inputType: valueSwitch,
|
|
3701
3709
|
textValue: "",
|
|
3702
|
-
numberValue:
|
|
3710
|
+
numberValue: 0,
|
|
3703
3711
|
unit: ""
|
|
3704
3712
|
});
|
|
3705
3713
|
const [cacheEditData, setCacheEditData] = useState15({
|
|
3706
3714
|
indicatorType: type,
|
|
3707
3715
|
inputType: valueSwitch,
|
|
3708
3716
|
textValue: "",
|
|
3709
|
-
numberValue:
|
|
3717
|
+
numberValue: 0,
|
|
3710
3718
|
unit: ""
|
|
3711
3719
|
});
|
|
3712
3720
|
const [editIndex, setEditIndex] = useState15(null);
|
|
3721
|
+
const [addError, setAddError] = useState15({});
|
|
3722
|
+
const [editError, setEditError] = useState15({});
|
|
3713
3723
|
const handleAddIndicator = () => {
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3724
|
+
const nextErr = {};
|
|
3725
|
+
const textValue = (cacheData.textValue ?? "").trim();
|
|
3726
|
+
const unit = (cacheData.unit ?? "").trim();
|
|
3727
|
+
if (textValue === "") {
|
|
3728
|
+
nextErr.textValue = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E0A\u0E37\u0E48\u0E2D\u0E15\u0E31\u0E27\u0E0A\u0E35\u0E49\u0E27\u0E31\u0E14";
|
|
3729
|
+
}
|
|
3730
|
+
if (valueSwitch === "NUMBER") {
|
|
3731
|
+
const num = cacheData.numberValue;
|
|
3732
|
+
if (num === void 0 || num === null || Number(num) <= 0) {
|
|
3733
|
+
nextErr.numberValue = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E04\u0E48\u0E32\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";
|
|
3734
|
+
}
|
|
3735
|
+
if (unit === "") {
|
|
3736
|
+
nextErr.unit = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E2B\u0E19\u0E48\u0E27\u0E22";
|
|
3737
|
+
}
|
|
3738
|
+
}
|
|
3739
|
+
setAddError(nextErr);
|
|
3740
|
+
if (Object.keys(nextErr).length > 0) return;
|
|
3741
|
+
const newItem = valueSwitch === "TEXT" ? {
|
|
3742
|
+
indicatorType: type,
|
|
3743
|
+
inputType: "TEXT",
|
|
3744
|
+
textValue
|
|
3745
|
+
} : {
|
|
3746
|
+
indicatorType: type,
|
|
3747
|
+
inputType: "NUMBER",
|
|
3748
|
+
textValue,
|
|
3749
|
+
numberValue: Number(cacheData.numberValue),
|
|
3750
|
+
unit
|
|
3751
|
+
};
|
|
3752
|
+
setArrayData([...arrayData, newItem]);
|
|
3723
3753
|
setCacheData({
|
|
3724
3754
|
indicatorType: type,
|
|
3725
3755
|
inputType: valueSwitch,
|
|
3726
3756
|
textValue: "",
|
|
3727
|
-
numberValue:
|
|
3757
|
+
numberValue: 0,
|
|
3728
3758
|
unit: ""
|
|
3729
3759
|
});
|
|
3760
|
+
setAddError({});
|
|
3730
3761
|
};
|
|
3731
3762
|
const handleChangeCashData = (key, value) => {
|
|
3732
3763
|
setCacheData((prev) => ({
|
|
@@ -3752,11 +3783,32 @@ function Indicator({
|
|
|
3752
3783
|
setEditIndex(null);
|
|
3753
3784
|
};
|
|
3754
3785
|
const handleConfirmEditIndicator = (index) => {
|
|
3755
|
-
|
|
3786
|
+
const nextErr = {};
|
|
3787
|
+
const textValue = (cacheEditData.textValue ?? "").trim();
|
|
3788
|
+
const unit = (cacheEditData.unit ?? "").trim();
|
|
3789
|
+
const num = cacheEditData.numberValue;
|
|
3790
|
+
if (textValue === "") {
|
|
3791
|
+
nextErr.textValue = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E0A\u0E37\u0E48\u0E2D\u0E15\u0E31\u0E27\u0E0A\u0E35\u0E49\u0E27\u0E31\u0E14";
|
|
3792
|
+
}
|
|
3793
|
+
if (cacheEditData.inputType === "NUMBER") {
|
|
3794
|
+
if (num === void 0 || num === null || Number(num) <= 0) {
|
|
3795
|
+
nextErr.numberValue = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E04\u0E48\u0E32\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";
|
|
3796
|
+
}
|
|
3797
|
+
if (unit === "") {
|
|
3798
|
+
nextErr.unit = "\u0E01\u0E23\u0E38\u0E13\u0E32\u0E23\u0E30\u0E1A\u0E38\u0E2B\u0E19\u0E48\u0E27\u0E22";
|
|
3799
|
+
}
|
|
3800
|
+
}
|
|
3801
|
+
setEditError(nextErr);
|
|
3802
|
+
if (Object.keys(nextErr).length > 0) return;
|
|
3756
3803
|
const newData = [...arrayData];
|
|
3757
|
-
newData[index] =
|
|
3804
|
+
newData[index] = {
|
|
3805
|
+
...cacheEditData,
|
|
3806
|
+
textValue,
|
|
3807
|
+
...cacheEditData.inputType === "NUMBER" ? { numberValue: Number(num), unit } : { numberValue: void 0, unit: void 0 }
|
|
3808
|
+
};
|
|
3758
3809
|
setArrayData(newData);
|
|
3759
3810
|
setEditIndex(null);
|
|
3811
|
+
setEditError({});
|
|
3760
3812
|
};
|
|
3761
3813
|
const handleChangeEditCashData = (e) => {
|
|
3762
3814
|
const { name, value } = e.target;
|
|
@@ -3772,16 +3824,29 @@ function Indicator({
|
|
|
3772
3824
|
{
|
|
3773
3825
|
className: `space-x-2 grid ${valueSwitch === "TEXT" ? `grid-cols-[140px_1fr_50px]` : `grid-cols-[140px_1fr_200px_200px_50px]`} items-start`,
|
|
3774
3826
|
children: [
|
|
3775
|
-
/* @__PURE__ */ jsx40(
|
|
3827
|
+
/* @__PURE__ */ jsx40(
|
|
3828
|
+
SwitchSelect,
|
|
3829
|
+
{
|
|
3830
|
+
option,
|
|
3831
|
+
onClick: handleClick,
|
|
3832
|
+
value: valueSwitch,
|
|
3833
|
+
label: "\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17",
|
|
3834
|
+
required: true
|
|
3835
|
+
}
|
|
3836
|
+
),
|
|
3776
3837
|
/* @__PURE__ */ jsx40(
|
|
3777
3838
|
InputField,
|
|
3778
3839
|
{
|
|
3779
3840
|
label: `\u0E0A\u0E37\u0E48\u0E2D\u0E15\u0E31\u0E27\u0E0A\u0E35\u0E49\u0E27\u0E31\u0E14${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3780
3841
|
value: cacheData.textValue,
|
|
3781
3842
|
className: "h-[32px]",
|
|
3782
|
-
onChange: (
|
|
3843
|
+
onChange: (val) => {
|
|
3844
|
+
handleChangeCashData("textValue", val ?? "");
|
|
3845
|
+
setAddError((p) => ({ ...p, textValue: void 0 }));
|
|
3846
|
+
},
|
|
3783
3847
|
placeholder: `\u0E23\u0E30\u0E1A\u0E38\u0E0A\u0E37\u0E48\u0E2D\u0E15\u0E31\u0E27\u0E0A\u0E35\u0E49\u0E27\u0E31\u0E14${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3784
|
-
required: true
|
|
3848
|
+
required: true,
|
|
3849
|
+
error: addError.textValue
|
|
3785
3850
|
}
|
|
3786
3851
|
),
|
|
3787
3852
|
valueSwitch === "NUMBER" && /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
@@ -3789,11 +3854,16 @@ function Indicator({
|
|
|
3789
3854
|
InputFieldNumber,
|
|
3790
3855
|
{
|
|
3791
3856
|
label: `\u0E04\u0E48\u0E32\u0E40\u0E1B\u0E49\u0E32\u0E2B\u0E21\u0E32\u0E22${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3792
|
-
value: cacheData.numberValue ??
|
|
3857
|
+
value: cacheData.numberValue ?? 0,
|
|
3793
3858
|
className: "h-[32px]",
|
|
3794
|
-
onChange: (
|
|
3859
|
+
onChange: (val) => {
|
|
3860
|
+
handleChangeCashData("numberValue", val ?? 0);
|
|
3861
|
+
setAddError((p) => ({ ...p, numberValue: void 0 }));
|
|
3862
|
+
},
|
|
3863
|
+
min: 0,
|
|
3795
3864
|
placeholder: `\u0E23\u0E30\u0E1A\u0E38\u0E04\u0E48\u0E32\u0E40\u0E1B\u0E49\u0E32\u0E2B\u0E21\u0E32\u0E22${type === "OUTPUT" ? "\u0E1C\u0E25\u0E1C\u0E25\u0E34\u0E15" : "\u0E1C\u0E25\u0E25\u0E31\u0E1E\u0E18\u0E4C"}`,
|
|
3796
|
-
required: true
|
|
3865
|
+
required: true,
|
|
3866
|
+
error: addError.numberValue
|
|
3797
3867
|
}
|
|
3798
3868
|
),
|
|
3799
3869
|
/* @__PURE__ */ jsx40(
|
|
@@ -3802,53 +3872,83 @@ function Indicator({
|
|
|
3802
3872
|
label: `\u0E2B\u0E19\u0E48\u0E27\u0E22`,
|
|
3803
3873
|
value: cacheData.unit ?? "",
|
|
3804
3874
|
className: "h-[32px]",
|
|
3805
|
-
onChange: (
|
|
3875
|
+
onChange: (val) => {
|
|
3876
|
+
handleChangeCashData("unit", val ?? "");
|
|
3877
|
+
setAddError((p) => ({ ...p, unit: void 0 }));
|
|
3878
|
+
},
|
|
3806
3879
|
placeholder: "\u0E23\u0E30\u0E1A\u0E38\u0E2B\u0E19\u0E48\u0E27\u0E22",
|
|
3807
|
-
required: true
|
|
3880
|
+
required: true,
|
|
3881
|
+
error: addError.unit
|
|
3808
3882
|
}
|
|
3809
3883
|
)
|
|
3810
3884
|
] }),
|
|
3811
|
-
/* @__PURE__ */ jsx40(
|
|
3885
|
+
/* @__PURE__ */ jsx40(
|
|
3886
|
+
IconCirclePlus2,
|
|
3887
|
+
{
|
|
3888
|
+
onClick: handleAddIndicator,
|
|
3889
|
+
className: "mt-8 cursor-pointer",
|
|
3890
|
+
size: 32
|
|
3891
|
+
}
|
|
3892
|
+
)
|
|
3812
3893
|
]
|
|
3813
3894
|
}
|
|
3814
3895
|
),
|
|
3815
3896
|
/* @__PURE__ */ jsx40(Fragment7, { children: arrayData.map((item, index) => /* @__PURE__ */ jsxs34(
|
|
3816
3897
|
"div",
|
|
3817
3898
|
{
|
|
3818
|
-
className: `space-y-
|
|
3899
|
+
className: `space-y-2 grid ${item.inputType === "TEXT" ? `grid-cols-[140px_1fr_50px_50px]` : `grid-cols-[140px_1fr_200px_150px_50px_50px]`} items-start`,
|
|
3819
3900
|
children: [
|
|
3820
3901
|
/* @__PURE__ */ jsx40("div", { className: "body-1 mt-2", children: item.inputType === "TEXT" ? "\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21" : "\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02" }),
|
|
3821
|
-
index === editIndex ? /* @__PURE__ */
|
|
3822
|
-
|
|
3823
|
-
{
|
|
3824
|
-
className: "body-1 mt-2",
|
|
3825
|
-
variant: "underlined",
|
|
3826
|
-
value: cacheEditData.textValue,
|
|
3827
|
-
name: "textValue",
|
|
3828
|
-
onChange: (e) => handleChangeEditCashData(e)
|
|
3829
|
-
}
|
|
3830
|
-
) : /* @__PURE__ */ jsx40("div", { className: "body-1 mt-2", children: item.textValue }),
|
|
3831
|
-
item.inputType === "NUMBER" && /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
3832
|
-
index === editIndex ? /* @__PURE__ */ jsx40(
|
|
3833
|
-
Input4,
|
|
3834
|
-
{
|
|
3835
|
-
className: "body-1 mt-2",
|
|
3836
|
-
variant: "underlined",
|
|
3837
|
-
value: cacheEditData.numberValue,
|
|
3838
|
-
name: "numberValue",
|
|
3839
|
-
onChange: (e) => handleChangeEditCashData(e)
|
|
3840
|
-
}
|
|
3841
|
-
) : /* @__PURE__ */ jsx40("div", { className: "body-1 mt-2", children: item.numberValue }),
|
|
3842
|
-
index === editIndex ? /* @__PURE__ */ jsx40(
|
|
3902
|
+
index === editIndex ? /* @__PURE__ */ jsxs34("div", { className: "flex flex-col gap-[8px]", children: [
|
|
3903
|
+
/* @__PURE__ */ jsx40(
|
|
3843
3904
|
Input4,
|
|
3844
3905
|
{
|
|
3845
3906
|
className: "body-1 mt-2",
|
|
3846
3907
|
variant: "underlined",
|
|
3847
|
-
value: cacheEditData.
|
|
3848
|
-
name: "
|
|
3849
|
-
onChange: (e) =>
|
|
3908
|
+
value: cacheEditData.textValue,
|
|
3909
|
+
name: "textValue",
|
|
3910
|
+
onChange: (e) => {
|
|
3911
|
+
handleChangeEditCashData(e);
|
|
3912
|
+
setEditError((p) => ({ ...p, textValue: void 0 }));
|
|
3913
|
+
}
|
|
3850
3914
|
}
|
|
3851
|
-
)
|
|
3915
|
+
),
|
|
3916
|
+
editError.textValue && /* @__PURE__ */ jsx40("p", { className: "text-red-500 caption-1", children: editError.textValue })
|
|
3917
|
+
] }) : /* @__PURE__ */ jsx40("div", { className: "body-1 mt-2", children: item.textValue }),
|
|
3918
|
+
item.inputType === "NUMBER" && /* @__PURE__ */ jsxs34(Fragment7, { children: [
|
|
3919
|
+
index === editIndex ? /* @__PURE__ */ jsxs34("div", { className: "flex flex-col gap-[8px]", children: [
|
|
3920
|
+
/* @__PURE__ */ jsx40(
|
|
3921
|
+
Input4,
|
|
3922
|
+
{
|
|
3923
|
+
type: "number",
|
|
3924
|
+
className: "body-1 mt-2",
|
|
3925
|
+
variant: "underlined",
|
|
3926
|
+
value: cacheEditData.numberValue,
|
|
3927
|
+
name: "numberValue",
|
|
3928
|
+
onChange: (e) => {
|
|
3929
|
+
handleChangeEditCashData(e);
|
|
3930
|
+
setEditError((p) => ({ ...p, numberValue: void 0 }));
|
|
3931
|
+
}
|
|
3932
|
+
}
|
|
3933
|
+
),
|
|
3934
|
+
editError.numberValue && /* @__PURE__ */ jsx40("p", { className: "text-red-500 caption-1", children: editError.numberValue })
|
|
3935
|
+
] }) : /* @__PURE__ */ jsx40("div", { className: "body-1 mt-2", children: item.numberValue }),
|
|
3936
|
+
index === editIndex ? /* @__PURE__ */ jsxs34("div", { className: "flex flex-col gap-[8px]", children: [
|
|
3937
|
+
/* @__PURE__ */ jsx40(
|
|
3938
|
+
Input4,
|
|
3939
|
+
{
|
|
3940
|
+
className: "body-1 mt-2",
|
|
3941
|
+
variant: "underlined",
|
|
3942
|
+
value: cacheEditData.unit,
|
|
3943
|
+
name: "unit",
|
|
3944
|
+
onChange: (e) => {
|
|
3945
|
+
handleChangeEditCashData(e);
|
|
3946
|
+
setEditError((p) => ({ ...p, unit: void 0 }));
|
|
3947
|
+
}
|
|
3948
|
+
}
|
|
3949
|
+
),
|
|
3950
|
+
editError.unit && /* @__PURE__ */ jsx40("p", { className: "text-red-500 caption-1", children: editError.unit })
|
|
3951
|
+
] }) : /* @__PURE__ */ jsx40("div", { className: "body-1 mt-2", children: item.unit })
|
|
3852
3952
|
] }),
|
|
3853
3953
|
/* @__PURE__ */ jsx40("div", { className: "body-1 mt-2 flex", children: editIndex !== null ? editIndex === index ? /* @__PURE__ */ jsxs34("div", { className: "flex", children: [
|
|
3854
3954
|
/* @__PURE__ */ jsx40(
|
|
@@ -3858,11 +3958,36 @@ function Indicator({
|
|
|
3858
3958
|
onClick: () => handleConfirmEditIndicator(index)
|
|
3859
3959
|
}
|
|
3860
3960
|
),
|
|
3861
|
-
/* @__PURE__ */ jsx40(
|
|
3862
|
-
|
|
3863
|
-
|
|
3961
|
+
/* @__PURE__ */ jsx40(
|
|
3962
|
+
IconX3,
|
|
3963
|
+
{
|
|
3964
|
+
className: "cursor-pointer text-red-600",
|
|
3965
|
+
onClick: handleCancelEditIndicator
|
|
3966
|
+
}
|
|
3967
|
+
)
|
|
3968
|
+
] }) : void 0 : canEdit && /* @__PURE__ */ jsx40(
|
|
3969
|
+
IconPencil2,
|
|
3970
|
+
{
|
|
3971
|
+
className: "cursor-pointer",
|
|
3972
|
+
onClick: () => handleEditIndicator(index)
|
|
3973
|
+
}
|
|
3974
|
+
) }),
|
|
3975
|
+
/* @__PURE__ */ jsx40("div", { className: "body-1 mt-2 cursor-pointer", children: /* @__PURE__ */ jsx40(
|
|
3976
|
+
IconTrash4,
|
|
3977
|
+
{
|
|
3978
|
+
onClick: () => {
|
|
3979
|
+
const confirm = () => handleDeleteIndicator(index);
|
|
3980
|
+
if (onDeleteClick) {
|
|
3981
|
+
onDeleteClick({ index, item, confirm });
|
|
3982
|
+
} else {
|
|
3983
|
+
confirm();
|
|
3984
|
+
}
|
|
3985
|
+
}
|
|
3986
|
+
}
|
|
3987
|
+
) })
|
|
3864
3988
|
]
|
|
3865
|
-
}
|
|
3989
|
+
},
|
|
3990
|
+
index
|
|
3866
3991
|
)) })
|
|
3867
3992
|
] });
|
|
3868
3993
|
}
|
|
@@ -3914,6 +4039,7 @@ function ProfileSelect({
|
|
|
3914
4039
|
allUser,
|
|
3915
4040
|
assignUser,
|
|
3916
4041
|
mode,
|
|
4042
|
+
className,
|
|
3917
4043
|
onUpdateAssignUser
|
|
3918
4044
|
}) {
|
|
3919
4045
|
const [maxVisible, setMaxVisible] = useState17(4);
|
|
@@ -3971,13 +4097,13 @@ function ProfileSelect({
|
|
|
3971
4097
|
IconUsers,
|
|
3972
4098
|
{
|
|
3973
4099
|
size: 40,
|
|
3974
|
-
className: "p-2 border rounded cursor-pointer",
|
|
4100
|
+
className: "p-2 border rounded cursor-pointer bg-white",
|
|
3975
4101
|
onClick: () => setIsShowSelect(!isShowSelect)
|
|
3976
4102
|
}
|
|
3977
4103
|
) }) : mode === "showAssign" ? /* @__PURE__ */ jsxs36(
|
|
3978
4104
|
"button",
|
|
3979
4105
|
{
|
|
3980
|
-
className:
|
|
4106
|
+
className: `w-full h-[40px] flex -space-x-2 p-2 cursor-pointer ${className}`,
|
|
3981
4107
|
onClick: () => setIsShowSelect(!isShowSelect),
|
|
3982
4108
|
children: [
|
|
3983
4109
|
visibleUsers.map((user) => /* @__PURE__ */ jsx42("div", { className: "flex items-center cursor-point", children: /* @__PURE__ */ jsxs36("label", { className: "relative group cursor-pointer", children: [
|
|
@@ -3991,13 +4117,13 @@ function ProfileSelect({
|
|
|
3991
4117
|
height: avatarSize,
|
|
3992
4118
|
borderRadius: "50%"
|
|
3993
4119
|
},
|
|
3994
|
-
className: "border border-white group-hover:border-
|
|
4120
|
+
className: "border border-white group-hover:border-3 group-hover:border-red-500 transition"
|
|
3995
4121
|
}
|
|
3996
4122
|
),
|
|
3997
4123
|
/* @__PURE__ */ jsx42(
|
|
3998
4124
|
"span",
|
|
3999
4125
|
{
|
|
4000
|
-
className: "absolute top-0 right-0 -translate-y-2 translate-x-2 \r\n rounded-full bg-white opacity-0 group-hover:opacity-100 \r\n border-
|
|
4126
|
+
className: "absolute top-0 right-0 -translate-y-2 translate-x-2 \r\n rounded-full bg-white opacity-0 group-hover:opacity-100 \r\n border-3 z-10 border-red-500 flex items-center justify-center transition",
|
|
4001
4127
|
onClick: () => onUpdateAssignUser(user, "remove"),
|
|
4002
4128
|
children: /* @__PURE__ */ jsx42(IconX4, { className: "w-4 h-4 text-red-500" })
|
|
4003
4129
|
}
|
|
@@ -4020,7 +4146,7 @@ function ProfileSelect({
|
|
|
4020
4146
|
)
|
|
4021
4147
|
]
|
|
4022
4148
|
}
|
|
4023
|
-
) : /* @__PURE__ */ jsxs36("div", { className:
|
|
4149
|
+
) : /* @__PURE__ */ jsxs36("div", { className: `w-full h-[40px] flex -space-x-2 p-2 ${className}`, children: [
|
|
4024
4150
|
visibleUsers.map((user) => /* @__PURE__ */ jsx42("div", { className: "flex items-center ", children: /* @__PURE__ */ jsx42("label", { className: "relative group ", children: /* @__PURE__ */ jsx42(
|
|
4025
4151
|
"img",
|
|
4026
4152
|
{
|
|
@@ -4053,7 +4179,7 @@ function ProfileSelect({
|
|
|
4053
4179
|
isShowSelect ? /* @__PURE__ */ jsxs36(
|
|
4054
4180
|
"div",
|
|
4055
4181
|
{
|
|
4056
|
-
className: "absolute top-12 min-w-[261px] max-w-[400px] w-full h-[314px] p-2 text-xs border-1 rounded-sm ",
|
|
4182
|
+
className: "absolute top-12 min-w-[261px] max-w-[400px] w-full h-[314px] p-2 text-xs border-1 rounded-sm z-20 bg-white",
|
|
4057
4183
|
ref: selectRef,
|
|
4058
4184
|
children: [
|
|
4059
4185
|
/* @__PURE__ */ jsxs36("div", { className: "flex border-1 rounded-md p-2 gap-2 items-center", children: [
|
|
@@ -4076,9 +4202,8 @@ function ProfileSelect({
|
|
|
4076
4202
|
"button",
|
|
4077
4203
|
{
|
|
4078
4204
|
className: "flex items-center group my-1 w-full p-1 rounded hover:bg-gray-100",
|
|
4079
|
-
onClick: () => onUpdateAssignUser(user, "remove"),
|
|
4080
4205
|
children: [
|
|
4081
|
-
/* @__PURE__ */ jsxs36("
|
|
4206
|
+
/* @__PURE__ */ jsxs36("div", { className: "relative cursor-pointer", children: [
|
|
4082
4207
|
/* @__PURE__ */ jsx42(
|
|
4083
4208
|
"img",
|
|
4084
4209
|
{
|
|
@@ -4089,13 +4214,13 @@ function ProfileSelect({
|
|
|
4089
4214
|
height: avatarSize,
|
|
4090
4215
|
borderRadius: "50%"
|
|
4091
4216
|
},
|
|
4092
|
-
className: "border-
|
|
4217
|
+
className: "border-3 border-red-500"
|
|
4093
4218
|
}
|
|
4094
4219
|
),
|
|
4095
4220
|
/* @__PURE__ */ jsx42(
|
|
4096
4221
|
"span",
|
|
4097
4222
|
{
|
|
4098
|
-
className: "absolute top-0 right-0 -translate-y-2 translate-x-2 \r\n rounded-full bg-white opacity-0 group-hover:opacity-100 \r\n border-
|
|
4223
|
+
className: "absolute top-0 right-0 -translate-y-2 translate-x-2 \r\n rounded-full bg-white opacity-0 group-hover:opacity-100 \r\n border-3 border-red-500 flex items-center justify-center transition",
|
|
4099
4224
|
onClick: () => onUpdateAssignUser(user, "remove"),
|
|
4100
4225
|
children: /* @__PURE__ */ jsx42(IconX4, { className: "text-red-500", size: 15 })
|
|
4101
4226
|
}
|
|
@@ -4277,7 +4402,7 @@ var QRCodeGenerator = ({
|
|
|
4277
4402
|
] });
|
|
4278
4403
|
};
|
|
4279
4404
|
|
|
4280
|
-
// src/TabPropject/
|
|
4405
|
+
// src/TabPropject/TabProject/TabProject.tsx
|
|
4281
4406
|
import { Tabs } from "antd";
|
|
4282
4407
|
import { jsx as jsx44, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4283
4408
|
function TabProject({ tabOption, now, onChange }) {
|