spotlibs-components 0.1.16 → 0.1.17
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 +1396 -5
- package/dist/index.mjs +896 -634
- package/dist/index.mjs.map +1 -1
- package/dist/utils/index.mjs +3 -1
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/utils/exception.js +2 -0
- package/src/utils/index.js +1 -0
- package/dist/types-D0cyG_RH.d.mts +0 -1347
- package/dist/types.d.mts +0 -4
- package/dist/types.mjs +0 -4
- package/dist/types.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -11,11 +11,12 @@ import AlertRaw from '@mui/material/Alert';
|
|
|
11
11
|
import AlertTitleRaw from '@mui/material/AlertTitle';
|
|
12
12
|
import BoxRaw from '@mui/material/Box';
|
|
13
13
|
import MuiTypographyRaw from '@mui/material/Typography';
|
|
14
|
-
import { IconSquareMinusFilled, IconSquareCheckFilled, IconSquare, IconArrowsUpDown, IconArrowUp, IconArrowDown, IconAlertCircle, IconX, IconAlertCircleFilled, IconCalendarWeekFilled, IconUpload as IconUpload$1, IconAlertTriangle, IconInfoCircle,
|
|
14
|
+
import { IconCircleX, IconCircleCheck, IconSquareMinusFilled, IconSquareCheckFilled, IconSquare, IconArrowsUpDown, IconArrowUp, IconArrowDown, IconChevronLeft, IconChevronRight, IconAlertCircle, IconX, IconAlertCircleFilled, IconCalendarWeekFilled, IconUpload as IconUpload$1, IconAlertTriangle, IconInfoCircle, IconXboxXFilled, IconTrash } from '@tabler/icons-react';
|
|
15
15
|
import ButtonBaseRaw from '@mui/material/ButtonBase';
|
|
16
16
|
import SkeletonRaw from '@mui/material/Skeleton';
|
|
17
17
|
import SwitchRaw from '@mui/material/Switch';
|
|
18
18
|
import { styled } from '@mui/material/styles';
|
|
19
|
+
import ChipRaw from '@mui/material/Chip';
|
|
19
20
|
import MuiCardRaw from '@mui/material/Card';
|
|
20
21
|
import CollapseRaw from '@mui/material/Collapse';
|
|
21
22
|
import IconButtonRaw from '@mui/material/IconButton';
|
|
@@ -35,10 +36,12 @@ import TableBodyRaw from '@mui/material/TableBody';
|
|
|
35
36
|
import TableCellRaw from '@mui/material/TableCell';
|
|
36
37
|
import TableContainerRaw from '@mui/material/TableContainer';
|
|
37
38
|
import TableHeadRaw from '@mui/material/TableHead';
|
|
38
|
-
import TablePaginationRaw from '@mui/material/TablePagination';
|
|
39
39
|
import TableRowRaw from '@mui/material/TableRow';
|
|
40
40
|
import KeyboardArrowRightRaw from '@mui/icons-material/KeyboardArrowRight';
|
|
41
41
|
import KeyboardArrowLeftRaw from '@mui/icons-material/KeyboardArrowLeft';
|
|
42
|
+
import SelectRaw from '@mui/material/Select';
|
|
43
|
+
import MenuItemRaw from '@mui/material/MenuItem';
|
|
44
|
+
import TablePaginationRaw from '@mui/material/TablePagination';
|
|
42
45
|
import dayjs from 'dayjs';
|
|
43
46
|
import TextFieldRaw from '@mui/material/TextField';
|
|
44
47
|
import PopoverRaw from '@mui/material/Popover';
|
|
@@ -51,10 +54,9 @@ import CloseIconRaw from '@mui/icons-material/Close';
|
|
|
51
54
|
import { id } from 'date-fns/locale';
|
|
52
55
|
import 'react-date-range/dist/styles.css';
|
|
53
56
|
import 'react-date-range/dist/theme/default.css';
|
|
54
|
-
import
|
|
57
|
+
import Select2, { components } from 'react-select';
|
|
55
58
|
import AsyncSelect from 'react-select/async';
|
|
56
59
|
import { ErrorMessage } from '@hookform/error-message';
|
|
57
|
-
import ChipRaw from '@mui/material/Chip';
|
|
58
60
|
import Dropzone from 'react-dropzone';
|
|
59
61
|
import RadioRaw from '@mui/material/Radio';
|
|
60
62
|
import RadioGroupRaw from '@mui/material/RadioGroup';
|
|
@@ -571,18 +573,18 @@ var Radius = {
|
|
|
571
573
|
radius_4: "16px",
|
|
572
574
|
radius_x: "999px"
|
|
573
575
|
};
|
|
574
|
-
var RadiusToken = (
|
|
575
|
-
var
|
|
576
|
+
var RadiusToken = (_a126) => {
|
|
577
|
+
var _b126 = _a126, {
|
|
576
578
|
radius = "radius_0",
|
|
577
579
|
children,
|
|
578
580
|
sx = {}
|
|
579
|
-
} =
|
|
581
|
+
} = _b126, rest = __objRest(_b126, [
|
|
580
582
|
"radius",
|
|
581
583
|
"children",
|
|
582
584
|
"sx"
|
|
583
585
|
]);
|
|
584
|
-
var
|
|
585
|
-
const borderRadius = (
|
|
586
|
+
var _a127;
|
|
587
|
+
const borderRadius = (_a127 = Radius[radius]) != null ? _a127 : Radius.radius_0;
|
|
586
588
|
return /* @__PURE__ */ jsx(
|
|
587
589
|
Box,
|
|
588
590
|
__spreadProps(__spreadValues({
|
|
@@ -731,12 +733,12 @@ var VariantStyles = {
|
|
|
731
733
|
fontWeight: 400
|
|
732
734
|
}
|
|
733
735
|
};
|
|
734
|
-
var BaseTypography = (
|
|
735
|
-
var
|
|
736
|
+
var BaseTypography = (_a126) => {
|
|
737
|
+
var _b126 = _a126, {
|
|
736
738
|
variant = "body1_regular.default",
|
|
737
739
|
children,
|
|
738
740
|
sx
|
|
739
|
-
} =
|
|
741
|
+
} = _b126, props = __objRest(_b126, [
|
|
740
742
|
"variant",
|
|
741
743
|
"children",
|
|
742
744
|
"sx"
|
|
@@ -804,8 +806,8 @@ var ALERT_CONFIG = {
|
|
|
804
806
|
defaultIcon: IconAlertTriangle
|
|
805
807
|
}
|
|
806
808
|
};
|
|
807
|
-
var BaseAlert = (
|
|
808
|
-
var
|
|
809
|
+
var BaseAlert = (_a126) => {
|
|
810
|
+
var _b126 = _a126, {
|
|
809
811
|
variant = "default",
|
|
810
812
|
type = "standard",
|
|
811
813
|
title,
|
|
@@ -815,7 +817,7 @@ var BaseAlert = (_a120) => {
|
|
|
815
817
|
sx = {},
|
|
816
818
|
onClose,
|
|
817
819
|
childrenSx = {}
|
|
818
|
-
} =
|
|
820
|
+
} = _b126, props = __objRest(_b126, [
|
|
819
821
|
"variant",
|
|
820
822
|
"type",
|
|
821
823
|
"title",
|
|
@@ -826,8 +828,8 @@ var BaseAlert = (_a120) => {
|
|
|
826
828
|
"onClose",
|
|
827
829
|
"childrenSx"
|
|
828
830
|
]);
|
|
829
|
-
var
|
|
830
|
-
const config = (
|
|
831
|
+
var _a127;
|
|
832
|
+
const config = (_a127 = ALERT_CONFIG[variant]) != null ? _a127 : ALERT_CONFIG.default;
|
|
831
833
|
const hasChildrenSx = Object.keys(childrenSx).length > 0;
|
|
832
834
|
const renderIcon = useMemo(() => {
|
|
833
835
|
if (!icon) return false;
|
|
@@ -892,12 +894,12 @@ var Shadow = {
|
|
|
892
894
|
surface: "#FFFFFF"
|
|
893
895
|
}
|
|
894
896
|
};
|
|
895
|
-
var ShadowToken = (
|
|
896
|
-
var
|
|
897
|
+
var ShadowToken = (_a126) => {
|
|
898
|
+
var _b126 = _a126, {
|
|
897
899
|
level = "elevation_0",
|
|
898
900
|
children,
|
|
899
901
|
sx = {}
|
|
900
|
-
} =
|
|
902
|
+
} = _b126, rest = __objRest(_b126, [
|
|
901
903
|
"level",
|
|
902
904
|
"children",
|
|
903
905
|
"sx"
|
|
@@ -989,8 +991,8 @@ function getHoverColor(primitiveKey) {
|
|
|
989
991
|
const hoverKey = `${prefix}_${nextLevel}`;
|
|
990
992
|
return PrimitiveColor[hoverKey] || PrimitiveColor[primitiveKey];
|
|
991
993
|
}
|
|
992
|
-
var BaseButton = (
|
|
993
|
-
var
|
|
994
|
+
var BaseButton = (_a126) => {
|
|
995
|
+
var _b126 = _a126, {
|
|
994
996
|
onClick = () => {
|
|
995
997
|
},
|
|
996
998
|
children = null,
|
|
@@ -1003,7 +1005,7 @@ var BaseButton = (_a120) => {
|
|
|
1003
1005
|
endIcon = null,
|
|
1004
1006
|
width = "100%",
|
|
1005
1007
|
sx = {}
|
|
1006
|
-
} =
|
|
1008
|
+
} = _b126, rest = __objRest(_b126, [
|
|
1007
1009
|
"onClick",
|
|
1008
1010
|
"children",
|
|
1009
1011
|
"variant",
|
|
@@ -1023,36 +1025,36 @@ var BaseButton = (_a120) => {
|
|
|
1023
1025
|
const customColorValue = useCustom ? PrimitiveColor[customColor] : null;
|
|
1024
1026
|
const customHoverValue = useCustom ? getHoverColor(customColor) : null;
|
|
1025
1027
|
const getBackgroundColor = () => {
|
|
1026
|
-
var
|
|
1028
|
+
var _a127;
|
|
1027
1029
|
if (disabled) return isFill ? DISABLED_BG : "transparent";
|
|
1028
1030
|
if (useCustom) return isFill ? customColorValue : "transparent";
|
|
1029
|
-
if (isFill) return ((
|
|
1031
|
+
if (isFill) return ((_a127 = FILL_COLORS[color]) == null ? void 0 : _a127.bg) || FILL_COLORS.primary.bg;
|
|
1030
1032
|
return "transparent";
|
|
1031
1033
|
};
|
|
1032
1034
|
const getTextColor = () => {
|
|
1033
|
-
var
|
|
1035
|
+
var _a127, _b127;
|
|
1034
1036
|
if (disabled) return DISABLED_TEXT;
|
|
1035
1037
|
if (isFill) return WHITE;
|
|
1036
1038
|
if (useCustom) return customColorValue;
|
|
1037
|
-
if (isOutline) return ((
|
|
1038
|
-
if (isText) return ((
|
|
1039
|
+
if (isOutline) return ((_a127 = OUTLINE_COLORS[color]) == null ? void 0 : _a127.text) || OUTLINE_COLORS.primary.text;
|
|
1040
|
+
if (isText) return ((_b127 = OUTLINE_COLORS[color]) == null ? void 0 : _b127.text) || OUTLINE_COLORS.primary.text;
|
|
1039
1041
|
return DerivedColor.color_text_default;
|
|
1040
1042
|
};
|
|
1041
1043
|
const getBorderColor = () => {
|
|
1042
|
-
var
|
|
1044
|
+
var _a127;
|
|
1043
1045
|
if (!isOutline) return "none";
|
|
1044
1046
|
if (disabled) return `1.5px solid ${DISABLED_BG}`;
|
|
1045
1047
|
if (useCustom) return `1.5px solid ${customColorValue}`;
|
|
1046
|
-
return `1.5px solid ${((
|
|
1048
|
+
return `1.5px solid ${((_a127 = OUTLINE_COLORS[color]) == null ? void 0 : _a127.border) || OUTLINE_COLORS.primary.border}`;
|
|
1047
1049
|
};
|
|
1048
1050
|
const getHoverBg = () => {
|
|
1049
|
-
var
|
|
1051
|
+
var _a127, _b127;
|
|
1050
1052
|
if (disabled) return void 0;
|
|
1051
1053
|
if (useCustom) {
|
|
1052
1054
|
return isFill ? customHoverValue : customColorValue + "1A";
|
|
1053
1055
|
}
|
|
1054
|
-
if (isFill) return ((
|
|
1055
|
-
if (isOutline) return ((
|
|
1056
|
+
if (isFill) return ((_a127 = FILL_COLORS[color]) == null ? void 0 : _a127.hover) || FILL_COLORS.primary.hover;
|
|
1057
|
+
if (isOutline) return ((_b127 = OUTLINE_COLORS[color]) == null ? void 0 : _b127.hoverBg) || OUTLINE_COLORS.primary.hoverBg;
|
|
1056
1058
|
return void 0;
|
|
1057
1059
|
};
|
|
1058
1060
|
const getRadius = () => {
|
|
@@ -1137,8 +1139,8 @@ var _a9, _b9;
|
|
|
1137
1139
|
var Skeleton = (_b9 = (_a9 = SkeletonRaw) == null ? void 0 : _a9.default) != null ? _b9 : SkeletonRaw;
|
|
1138
1140
|
var _a10, _b10;
|
|
1139
1141
|
var Box5 = (_b10 = (_a10 = BoxRaw) == null ? void 0 : _a10.default) != null ? _b10 : BoxRaw;
|
|
1140
|
-
var BaseSkeleton = (
|
|
1141
|
-
var
|
|
1142
|
+
var BaseSkeleton = (_a126) => {
|
|
1143
|
+
var _b126 = _a126, {
|
|
1142
1144
|
variant = "rectangular",
|
|
1143
1145
|
animation = "pulse",
|
|
1144
1146
|
width,
|
|
@@ -1146,7 +1148,7 @@ var BaseSkeleton = (_a120) => {
|
|
|
1146
1148
|
count = 1,
|
|
1147
1149
|
gap = SpacingToken.spacing2,
|
|
1148
1150
|
sx = {}
|
|
1149
|
-
} =
|
|
1151
|
+
} = _b126, rest = __objRest(_b126, [
|
|
1150
1152
|
"variant",
|
|
1151
1153
|
"animation",
|
|
1152
1154
|
"width",
|
|
@@ -1317,31 +1319,135 @@ var BaseSwitch = ({
|
|
|
1317
1319
|
);
|
|
1318
1320
|
};
|
|
1319
1321
|
var _a12, _b12;
|
|
1320
|
-
var
|
|
1322
|
+
var Chip = (_b12 = (_a12 = ChipRaw) == null ? void 0 : _a12.default) != null ? _b12 : ChipRaw;
|
|
1321
1323
|
var _a13, _b13;
|
|
1322
|
-
|
|
1324
|
+
(_b13 = (_a13 = BoxRaw) == null ? void 0 : _a13.default) != null ? _b13 : BoxRaw;
|
|
1325
|
+
var TYPE_STYLES = {
|
|
1326
|
+
success: {
|
|
1327
|
+
color: PrimitiveColor.color_green_500,
|
|
1328
|
+
backgroundColor: PrimitiveColor.color_green_100,
|
|
1329
|
+
icon: /* @__PURE__ */ jsx(IconCircleCheck, { size: 18, color: PrimitiveColor.color_green_500 })
|
|
1330
|
+
},
|
|
1331
|
+
danger: {
|
|
1332
|
+
color: PrimitiveColor.color_red_500,
|
|
1333
|
+
backgroundColor: PrimitiveColor.color_red_100,
|
|
1334
|
+
icon: /* @__PURE__ */ jsx(IconCircleX, { size: 18, color: PrimitiveColor.color_red_500 })
|
|
1335
|
+
},
|
|
1336
|
+
warning: {
|
|
1337
|
+
color: PrimitiveColor.color_yellow_600,
|
|
1338
|
+
backgroundColor: PrimitiveColor.color_yellow_100,
|
|
1339
|
+
icon: null
|
|
1340
|
+
},
|
|
1341
|
+
info: {
|
|
1342
|
+
color: PrimitiveColor.color_blue_cakrawala_500,
|
|
1343
|
+
backgroundColor: PrimitiveColor.color_blue_cakrawala_100,
|
|
1344
|
+
icon: null
|
|
1345
|
+
},
|
|
1346
|
+
default: {
|
|
1347
|
+
color: DerivedColor.color_text_default,
|
|
1348
|
+
backgroundColor: PrimitiveColor.color_neutral_200,
|
|
1349
|
+
icon: null
|
|
1350
|
+
}
|
|
1351
|
+
};
|
|
1352
|
+
var BaseChip = (_a126) => {
|
|
1353
|
+
var _b126 = _a126, {
|
|
1354
|
+
label = "",
|
|
1355
|
+
type = "default",
|
|
1356
|
+
variant = "filled",
|
|
1357
|
+
startIcon = null,
|
|
1358
|
+
onDelete,
|
|
1359
|
+
onClick,
|
|
1360
|
+
disabled = false,
|
|
1361
|
+
fullWidth = false,
|
|
1362
|
+
showIcon = true,
|
|
1363
|
+
sx = {}
|
|
1364
|
+
} = _b126, rest = __objRest(_b126, [
|
|
1365
|
+
"label",
|
|
1366
|
+
"type",
|
|
1367
|
+
"variant",
|
|
1368
|
+
"startIcon",
|
|
1369
|
+
"onDelete",
|
|
1370
|
+
"onClick",
|
|
1371
|
+
"disabled",
|
|
1372
|
+
"fullWidth",
|
|
1373
|
+
"showIcon",
|
|
1374
|
+
"sx"
|
|
1375
|
+
]);
|
|
1376
|
+
const typeStyle = TYPE_STYLES[type] || TYPE_STYLES.default;
|
|
1377
|
+
const resolvedIcon = showIcon ? startIcon || typeStyle.icon : null;
|
|
1378
|
+
return /* @__PURE__ */ jsx(
|
|
1379
|
+
Chip,
|
|
1380
|
+
__spreadValues({
|
|
1381
|
+
label,
|
|
1382
|
+
variant: variant === "outlined" ? "outlined" : "filled",
|
|
1383
|
+
icon: resolvedIcon || void 0,
|
|
1384
|
+
onDelete,
|
|
1385
|
+
onClick,
|
|
1386
|
+
disabled,
|
|
1387
|
+
sx: __spreadValues({
|
|
1388
|
+
fontWeight: 600,
|
|
1389
|
+
fontSize: 14,
|
|
1390
|
+
borderRadius: Radius.radius_2,
|
|
1391
|
+
color: variant === "outlined" ? typeStyle.color : typeStyle.color,
|
|
1392
|
+
backgroundColor: variant === "outlined" ? "transparent" : typeStyle.backgroundColor,
|
|
1393
|
+
borderColor: variant === "outlined" ? typeStyle.color : "transparent",
|
|
1394
|
+
width: fullWidth ? "100%" : "auto",
|
|
1395
|
+
px: "8px",
|
|
1396
|
+
".MuiChip-label": {
|
|
1397
|
+
px: "8px"
|
|
1398
|
+
},
|
|
1399
|
+
".MuiChip-icon": {
|
|
1400
|
+
margin: 0
|
|
1401
|
+
},
|
|
1402
|
+
cursor: onClick ? "pointer" : "default"
|
|
1403
|
+
}, sx)
|
|
1404
|
+
}, rest)
|
|
1405
|
+
);
|
|
1406
|
+
};
|
|
1323
1407
|
var _a14, _b14;
|
|
1324
|
-
var
|
|
1408
|
+
var MuiCard = (_b14 = (_a14 = MuiCardRaw) == null ? void 0 : _a14.default) != null ? _b14 : MuiCardRaw;
|
|
1325
1409
|
var _a15, _b15;
|
|
1326
|
-
var
|
|
1410
|
+
var Box7 = (_b15 = (_a15 = BoxRaw) == null ? void 0 : _a15.default) != null ? _b15 : BoxRaw;
|
|
1327
1411
|
var _a16, _b16;
|
|
1328
|
-
var
|
|
1412
|
+
var Collapse = (_b16 = (_a16 = CollapseRaw) == null ? void 0 : _a16.default) != null ? _b16 : CollapseRaw;
|
|
1329
1413
|
var _a17, _b17;
|
|
1330
|
-
var
|
|
1414
|
+
var IconButton = (_b17 = (_a17 = IconButtonRaw) == null ? void 0 : _a17.default) != null ? _b17 : IconButtonRaw;
|
|
1415
|
+
var _a18, _b18;
|
|
1416
|
+
var KeyboardArrowDownIcon = (_b18 = (_a18 = KeyboardArrowDownIconRaw) == null ? void 0 : _a18.default) != null ? _b18 : KeyboardArrowDownIconRaw;
|
|
1417
|
+
var _a19, _b19;
|
|
1418
|
+
var KeyboardArrowUpIcon = (_b19 = (_a19 = KeyboardArrowUpIconRaw) == null ? void 0 : _a19.default) != null ? _b19 : KeyboardArrowUpIconRaw;
|
|
1331
1419
|
var HEADER_COLORS = {
|
|
1332
1420
|
primary: DerivedColor.color_bg_brand_primary,
|
|
1333
1421
|
secondary: DerivedColor.color_bg_brand_secondary,
|
|
1334
1422
|
success: DerivedColor.color_bg_success,
|
|
1335
1423
|
warning: DerivedColor.color_bg_warning,
|
|
1336
|
-
danger: DerivedColor.color_bg_danger
|
|
1424
|
+
danger: DerivedColor.color_bg_danger,
|
|
1425
|
+
clean: DerivedColor.color_bg_surface
|
|
1426
|
+
};
|
|
1427
|
+
var HEADER_TEXT_COLORS = {
|
|
1428
|
+
primary: DerivedColor.color_bg_surface,
|
|
1429
|
+
secondary: DerivedColor.color_bg_surface,
|
|
1430
|
+
success: DerivedColor.color_bg_surface,
|
|
1431
|
+
warning: DerivedColor.color_bg_surface,
|
|
1432
|
+
danger: DerivedColor.color_bg_surface,
|
|
1433
|
+
clean: DerivedColor.color_text_brand_primary
|
|
1337
1434
|
};
|
|
1338
|
-
var
|
|
1339
|
-
|
|
1435
|
+
var HEADER_ICON_COLORS = {
|
|
1436
|
+
primary: DerivedColor.color_bg_surface,
|
|
1437
|
+
secondary: DerivedColor.color_bg_surface,
|
|
1438
|
+
success: DerivedColor.color_bg_surface,
|
|
1439
|
+
warning: DerivedColor.color_bg_surface,
|
|
1440
|
+
danger: DerivedColor.color_bg_surface,
|
|
1441
|
+
clean: DerivedColor.color_text_subtle
|
|
1442
|
+
};
|
|
1443
|
+
var BaseCard = (_a126) => {
|
|
1444
|
+
var _b126 = _a126, {
|
|
1340
1445
|
variant = "default",
|
|
1341
1446
|
children = null,
|
|
1342
1447
|
color = "primary",
|
|
1343
1448
|
title = "",
|
|
1344
1449
|
subtitle = "",
|
|
1450
|
+
subtitleVariant,
|
|
1345
1451
|
boldTitle = false,
|
|
1346
1452
|
boldSubtitle = false,
|
|
1347
1453
|
showSubtitle = false,
|
|
@@ -1354,12 +1460,13 @@ var BaseCard = (_a120) => {
|
|
|
1354
1460
|
isWatermark = false,
|
|
1355
1461
|
watermarkText = "",
|
|
1356
1462
|
sx = {}
|
|
1357
|
-
} =
|
|
1463
|
+
} = _b126, rest = __objRest(_b126, [
|
|
1358
1464
|
"variant",
|
|
1359
1465
|
"children",
|
|
1360
1466
|
"color",
|
|
1361
1467
|
"title",
|
|
1362
1468
|
"subtitle",
|
|
1469
|
+
"subtitleVariant",
|
|
1363
1470
|
"boldTitle",
|
|
1364
1471
|
"boldSubtitle",
|
|
1365
1472
|
"showSubtitle",
|
|
@@ -1374,11 +1481,94 @@ var BaseCard = (_a120) => {
|
|
|
1374
1481
|
"sx"
|
|
1375
1482
|
]);
|
|
1376
1483
|
const [open, setOpen] = useState(true);
|
|
1484
|
+
let baseVariant = variant;
|
|
1485
|
+
let titleTypography = "header1_semibold";
|
|
1486
|
+
if (variant && variant.includes(".")) {
|
|
1487
|
+
const [v, t] = variant.split(".");
|
|
1488
|
+
baseVariant = v;
|
|
1489
|
+
titleTypography = t;
|
|
1490
|
+
}
|
|
1377
1491
|
const headerBg = HEADER_COLORS[color] || HEADER_COLORS.primary;
|
|
1378
|
-
const headerTextColor =
|
|
1492
|
+
const headerTextColor = HEADER_TEXT_COLORS[color] || HEADER_TEXT_COLORS.primary;
|
|
1493
|
+
const headerIconColor = HEADER_ICON_COLORS[color] || HEADER_ICON_COLORS.primary;
|
|
1379
1494
|
const cardBg = DerivedColor.color_bg_surface;
|
|
1380
1495
|
const borderColor = DerivedColor.color_border_default;
|
|
1381
|
-
|
|
1496
|
+
const renderHeaderContent = () => /* @__PURE__ */ jsxs(
|
|
1497
|
+
Box7,
|
|
1498
|
+
{
|
|
1499
|
+
onClick: () => isCollapsible && setOpen(!open),
|
|
1500
|
+
sx: {
|
|
1501
|
+
backgroundColor: headerBg,
|
|
1502
|
+
padding: SpacingToken.spacing4,
|
|
1503
|
+
display: "flex",
|
|
1504
|
+
alignItems: "center",
|
|
1505
|
+
justifyContent: "space-between",
|
|
1506
|
+
cursor: isCollapsible ? "pointer" : "default",
|
|
1507
|
+
borderTopLeftRadius: Radius.radius_2,
|
|
1508
|
+
borderTopRightRadius: Radius.radius_2
|
|
1509
|
+
},
|
|
1510
|
+
children: [
|
|
1511
|
+
/* @__PURE__ */ jsxs(Box7, { sx: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
1512
|
+
showStartIcon && startIcon && /* @__PURE__ */ jsx(Box7, { sx: { display: "flex", alignItems: "center", lineHeight: 0 }, children: startIcon }),
|
|
1513
|
+
/* @__PURE__ */ jsxs(Box7, { children: [
|
|
1514
|
+
/* @__PURE__ */ jsx(BaseTypography, { variant: `${titleTypography}.default`, sx: { color: headerTextColor }, children: title }),
|
|
1515
|
+
showSubtitle && subtitle && (subtitleVariant ? /* @__PURE__ */ jsx(BaseTypography, { variant: subtitleVariant, sx: { color: headerTextColor, mt: "2px" }, children: subtitle }) : /* @__PURE__ */ jsx(
|
|
1516
|
+
Box7,
|
|
1517
|
+
{
|
|
1518
|
+
component: "span",
|
|
1519
|
+
sx: {
|
|
1520
|
+
color: headerTextColor,
|
|
1521
|
+
fontWeight: boldSubtitle ? 700 : 400,
|
|
1522
|
+
fontSize: "13px",
|
|
1523
|
+
display: "block",
|
|
1524
|
+
mt: "2px"
|
|
1525
|
+
},
|
|
1526
|
+
children: subtitle
|
|
1527
|
+
}
|
|
1528
|
+
))
|
|
1529
|
+
] })
|
|
1530
|
+
] }),
|
|
1531
|
+
/* @__PURE__ */ jsxs(Box7, { sx: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
1532
|
+
showEndIcon && endIcon && /* @__PURE__ */ jsx(Box7, { sx: { display: "flex", alignItems: "center", lineHeight: 0 }, children: endIcon }),
|
|
1533
|
+
isCollapsible && /* @__PURE__ */ jsx(
|
|
1534
|
+
IconButton,
|
|
1535
|
+
{
|
|
1536
|
+
size: "small",
|
|
1537
|
+
onClick: (e) => {
|
|
1538
|
+
e.stopPropagation();
|
|
1539
|
+
setOpen(!open);
|
|
1540
|
+
},
|
|
1541
|
+
sx: { color: headerIconColor },
|
|
1542
|
+
children: open ? /* @__PURE__ */ jsx(KeyboardArrowUpIcon, {}) : /* @__PURE__ */ jsx(KeyboardArrowDownIcon, {})
|
|
1543
|
+
}
|
|
1544
|
+
)
|
|
1545
|
+
] })
|
|
1546
|
+
]
|
|
1547
|
+
}
|
|
1548
|
+
);
|
|
1549
|
+
const renderContent = () => /* @__PURE__ */ jsx(Collapse, { in: !isCollapsible || open, timeout: 300, children: /* @__PURE__ */ jsx(
|
|
1550
|
+
Box7,
|
|
1551
|
+
{
|
|
1552
|
+
sx: {
|
|
1553
|
+
padding: SpacingToken.spacing4,
|
|
1554
|
+
backgroundColor: cardBg
|
|
1555
|
+
},
|
|
1556
|
+
children: isWatermark && watermarkText ? /* @__PURE__ */ jsx(
|
|
1557
|
+
Watermark,
|
|
1558
|
+
{
|
|
1559
|
+
text: watermarkText,
|
|
1560
|
+
textColor: "#000000",
|
|
1561
|
+
textSize: 14,
|
|
1562
|
+
opacity: 0.15,
|
|
1563
|
+
gutter: 20,
|
|
1564
|
+
rotate: -30,
|
|
1565
|
+
wrapperStyle: { minHeight: "100px" },
|
|
1566
|
+
children
|
|
1567
|
+
}
|
|
1568
|
+
) : children
|
|
1569
|
+
}
|
|
1570
|
+
) });
|
|
1571
|
+
if (baseVariant === "default") {
|
|
1382
1572
|
return /* @__PURE__ */ jsx(
|
|
1383
1573
|
MuiCard,
|
|
1384
1574
|
__spreadProps(__spreadValues({
|
|
@@ -1408,7 +1598,7 @@ var BaseCard = (_a120) => {
|
|
|
1408
1598
|
})
|
|
1409
1599
|
);
|
|
1410
1600
|
}
|
|
1411
|
-
if (
|
|
1601
|
+
if (baseVariant === "with-header") {
|
|
1412
1602
|
return /* @__PURE__ */ jsxs(
|
|
1413
1603
|
MuiCard,
|
|
1414
1604
|
__spreadProps(__spreadValues({
|
|
@@ -1420,98 +1610,13 @@ var BaseCard = (_a120) => {
|
|
|
1420
1610
|
}, sx)
|
|
1421
1611
|
}, rest), {
|
|
1422
1612
|
children: [
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
{
|
|
1426
|
-
onClick: () => isCollapsible && setOpen(!open),
|
|
1427
|
-
sx: {
|
|
1428
|
-
backgroundColor: headerBg,
|
|
1429
|
-
padding: SpacingToken.spacing4,
|
|
1430
|
-
display: "flex",
|
|
1431
|
-
alignItems: "center",
|
|
1432
|
-
justifyContent: "space-between",
|
|
1433
|
-
cursor: isCollapsible ? "pointer" : "default",
|
|
1434
|
-
borderTopLeftRadius: Radius.radius_2,
|
|
1435
|
-
borderTopRightRadius: Radius.radius_2
|
|
1436
|
-
},
|
|
1437
|
-
children: [
|
|
1438
|
-
/* @__PURE__ */ jsxs(Box6, { sx: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
1439
|
-
showStartIcon && startIcon && /* @__PURE__ */ jsx(Box6, { sx: { display: "flex", alignItems: "center", lineHeight: 0 }, children: startIcon }),
|
|
1440
|
-
/* @__PURE__ */ jsxs(Box6, { children: [
|
|
1441
|
-
/* @__PURE__ */ jsx(
|
|
1442
|
-
Box6,
|
|
1443
|
-
{
|
|
1444
|
-
component: "span",
|
|
1445
|
-
sx: {
|
|
1446
|
-
color: headerTextColor,
|
|
1447
|
-
fontWeight: boldTitle ? 700 : 400,
|
|
1448
|
-
fontSize: "16px",
|
|
1449
|
-
display: "block"
|
|
1450
|
-
},
|
|
1451
|
-
children: title
|
|
1452
|
-
}
|
|
1453
|
-
),
|
|
1454
|
-
showSubtitle && subtitle && /* @__PURE__ */ jsx(
|
|
1455
|
-
Box6,
|
|
1456
|
-
{
|
|
1457
|
-
component: "span",
|
|
1458
|
-
sx: {
|
|
1459
|
-
color: headerTextColor,
|
|
1460
|
-
fontWeight: boldSubtitle ? 700 : 400,
|
|
1461
|
-
fontSize: "13px",
|
|
1462
|
-
display: "block",
|
|
1463
|
-
mt: "2px"
|
|
1464
|
-
},
|
|
1465
|
-
children: subtitle
|
|
1466
|
-
}
|
|
1467
|
-
)
|
|
1468
|
-
] })
|
|
1469
|
-
] }),
|
|
1470
|
-
/* @__PURE__ */ jsxs(Box6, { sx: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
1471
|
-
showEndIcon && endIcon && /* @__PURE__ */ jsx(Box6, { sx: { display: "flex", alignItems: "center", lineHeight: 0 }, children: endIcon }),
|
|
1472
|
-
isCollapsible && /* @__PURE__ */ jsx(
|
|
1473
|
-
IconButton,
|
|
1474
|
-
{
|
|
1475
|
-
size: "small",
|
|
1476
|
-
onClick: (e) => {
|
|
1477
|
-
e.stopPropagation();
|
|
1478
|
-
setOpen(!open);
|
|
1479
|
-
},
|
|
1480
|
-
sx: { color: headerTextColor },
|
|
1481
|
-
children: open ? /* @__PURE__ */ jsx(KeyboardArrowUpIcon, {}) : /* @__PURE__ */ jsx(KeyboardArrowDownIcon, {})
|
|
1482
|
-
}
|
|
1483
|
-
)
|
|
1484
|
-
] })
|
|
1485
|
-
]
|
|
1486
|
-
}
|
|
1487
|
-
),
|
|
1488
|
-
/* @__PURE__ */ jsx(Collapse, { in: !isCollapsible || open, timeout: 300, children: /* @__PURE__ */ jsx(
|
|
1489
|
-
Box6,
|
|
1490
|
-
{
|
|
1491
|
-
sx: {
|
|
1492
|
-
padding: SpacingToken.spacing4,
|
|
1493
|
-
backgroundColor: cardBg
|
|
1494
|
-
},
|
|
1495
|
-
children: isWatermark && watermarkText ? /* @__PURE__ */ jsx(
|
|
1496
|
-
Watermark,
|
|
1497
|
-
{
|
|
1498
|
-
text: watermarkText,
|
|
1499
|
-
textColor: "#000000",
|
|
1500
|
-
textSize: 14,
|
|
1501
|
-
opacity: 0.15,
|
|
1502
|
-
gutter: 20,
|
|
1503
|
-
rotate: -30,
|
|
1504
|
-
wrapperStyle: { minHeight: "100px" },
|
|
1505
|
-
children
|
|
1506
|
-
}
|
|
1507
|
-
) : children
|
|
1508
|
-
}
|
|
1509
|
-
) })
|
|
1613
|
+
renderHeaderContent(),
|
|
1614
|
+
renderContent()
|
|
1510
1615
|
]
|
|
1511
1616
|
})
|
|
1512
1617
|
);
|
|
1513
1618
|
}
|
|
1514
|
-
if (
|
|
1619
|
+
if (baseVariant === "with-header-footer") {
|
|
1515
1620
|
return /* @__PURE__ */ jsxs(
|
|
1516
1621
|
MuiCard,
|
|
1517
1622
|
__spreadProps(__spreadValues({
|
|
@@ -1523,95 +1628,10 @@ var BaseCard = (_a120) => {
|
|
|
1523
1628
|
}, sx)
|
|
1524
1629
|
}, rest), {
|
|
1525
1630
|
children: [
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
{
|
|
1529
|
-
onClick: () => isCollapsible && setOpen(!open),
|
|
1530
|
-
sx: {
|
|
1531
|
-
backgroundColor: headerBg,
|
|
1532
|
-
padding: SpacingToken.spacing4,
|
|
1533
|
-
display: "flex",
|
|
1534
|
-
alignItems: "center",
|
|
1535
|
-
justifyContent: "space-between",
|
|
1536
|
-
cursor: isCollapsible ? "pointer" : "default",
|
|
1537
|
-
borderTopLeftRadius: Radius.radius_2,
|
|
1538
|
-
borderTopRightRadius: Radius.radius_2
|
|
1539
|
-
},
|
|
1540
|
-
children: [
|
|
1541
|
-
/* @__PURE__ */ jsxs(Box6, { sx: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
1542
|
-
showStartIcon && startIcon && /* @__PURE__ */ jsx(Box6, { sx: { display: "flex", alignItems: "center", lineHeight: 0 }, children: startIcon }),
|
|
1543
|
-
/* @__PURE__ */ jsxs(Box6, { children: [
|
|
1544
|
-
/* @__PURE__ */ jsx(
|
|
1545
|
-
Box6,
|
|
1546
|
-
{
|
|
1547
|
-
component: "span",
|
|
1548
|
-
sx: {
|
|
1549
|
-
color: headerTextColor,
|
|
1550
|
-
fontWeight: boldTitle ? 700 : 400,
|
|
1551
|
-
fontSize: "16px",
|
|
1552
|
-
display: "block"
|
|
1553
|
-
},
|
|
1554
|
-
children: title
|
|
1555
|
-
}
|
|
1556
|
-
),
|
|
1557
|
-
showSubtitle && subtitle && /* @__PURE__ */ jsx(
|
|
1558
|
-
Box6,
|
|
1559
|
-
{
|
|
1560
|
-
component: "span",
|
|
1561
|
-
sx: {
|
|
1562
|
-
color: headerTextColor,
|
|
1563
|
-
fontWeight: boldSubtitle ? 700 : 400,
|
|
1564
|
-
fontSize: "13px",
|
|
1565
|
-
display: "block",
|
|
1566
|
-
mt: "2px"
|
|
1567
|
-
},
|
|
1568
|
-
children: subtitle
|
|
1569
|
-
}
|
|
1570
|
-
)
|
|
1571
|
-
] })
|
|
1572
|
-
] }),
|
|
1573
|
-
/* @__PURE__ */ jsxs(Box6, { sx: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
1574
|
-
showEndIcon && endIcon && /* @__PURE__ */ jsx(Box6, { sx: { display: "flex", alignItems: "center", lineHeight: 0 }, children: endIcon }),
|
|
1575
|
-
isCollapsible && /* @__PURE__ */ jsx(
|
|
1576
|
-
IconButton,
|
|
1577
|
-
{
|
|
1578
|
-
size: "small",
|
|
1579
|
-
onClick: (e) => {
|
|
1580
|
-
e.stopPropagation();
|
|
1581
|
-
setOpen(!open);
|
|
1582
|
-
},
|
|
1583
|
-
sx: { color: headerTextColor },
|
|
1584
|
-
children: open ? /* @__PURE__ */ jsx(KeyboardArrowUpIcon, {}) : /* @__PURE__ */ jsx(KeyboardArrowDownIcon, {})
|
|
1585
|
-
}
|
|
1586
|
-
)
|
|
1587
|
-
] })
|
|
1588
|
-
]
|
|
1589
|
-
}
|
|
1590
|
-
),
|
|
1591
|
-
/* @__PURE__ */ jsx(Collapse, { in: !isCollapsible || open, timeout: 300, children: /* @__PURE__ */ jsx(
|
|
1592
|
-
Box6,
|
|
1593
|
-
{
|
|
1594
|
-
sx: {
|
|
1595
|
-
padding: SpacingToken.spacing4,
|
|
1596
|
-
backgroundColor: cardBg
|
|
1597
|
-
},
|
|
1598
|
-
children: isWatermark && watermarkText ? /* @__PURE__ */ jsx(
|
|
1599
|
-
Watermark,
|
|
1600
|
-
{
|
|
1601
|
-
text: watermarkText,
|
|
1602
|
-
textColor: "#000000",
|
|
1603
|
-
textSize: 14,
|
|
1604
|
-
opacity: 0.15,
|
|
1605
|
-
gutter: 20,
|
|
1606
|
-
rotate: -30,
|
|
1607
|
-
wrapperStyle: { minHeight: "100px" },
|
|
1608
|
-
children
|
|
1609
|
-
}
|
|
1610
|
-
) : children
|
|
1611
|
-
}
|
|
1612
|
-
) }),
|
|
1631
|
+
renderHeaderContent(),
|
|
1632
|
+
renderContent(),
|
|
1613
1633
|
footer && /* @__PURE__ */ jsx(
|
|
1614
|
-
|
|
1634
|
+
Box7,
|
|
1615
1635
|
{
|
|
1616
1636
|
sx: {
|
|
1617
1637
|
padding: SpacingToken.spacing4,
|
|
@@ -1641,12 +1661,12 @@ var BaseCard = (_a120) => {
|
|
|
1641
1661
|
})
|
|
1642
1662
|
);
|
|
1643
1663
|
};
|
|
1644
|
-
var _a18, _b18;
|
|
1645
|
-
var Snackbar = (_b18 = (_a18 = SnackbarRaw) == null ? void 0 : _a18.default) != null ? _b18 : SnackbarRaw;
|
|
1646
|
-
var _a19, _b19;
|
|
1647
|
-
var Alert2 = (_b19 = (_a19 = AlertRaw) == null ? void 0 : _a19.default) != null ? _b19 : AlertRaw;
|
|
1648
1664
|
var _a20, _b20;
|
|
1649
|
-
var
|
|
1665
|
+
var Snackbar = (_b20 = (_a20 = SnackbarRaw) == null ? void 0 : _a20.default) != null ? _b20 : SnackbarRaw;
|
|
1666
|
+
var _a21, _b21;
|
|
1667
|
+
var Alert2 = (_b21 = (_a21 = AlertRaw) == null ? void 0 : _a21.default) != null ? _b21 : AlertRaw;
|
|
1668
|
+
var _a22, _b22;
|
|
1669
|
+
var IconButton2 = (_b22 = (_a22 = IconButtonRaw) == null ? void 0 : _a22.default) != null ? _b22 : IconButtonRaw;
|
|
1650
1670
|
var VARIANT_CONFIG = {
|
|
1651
1671
|
success: {
|
|
1652
1672
|
bg: PrimitiveColor.color_green_100,
|
|
@@ -1669,8 +1689,8 @@ var VARIANT_CONFIG = {
|
|
|
1669
1689
|
text: PrimitiveColor.color_neutral_900
|
|
1670
1690
|
}
|
|
1671
1691
|
};
|
|
1672
|
-
var BaseSnackbar = (
|
|
1673
|
-
var
|
|
1692
|
+
var BaseSnackbar = (_a126) => {
|
|
1693
|
+
var _b126 = _a126, {
|
|
1674
1694
|
open = false,
|
|
1675
1695
|
onClose,
|
|
1676
1696
|
message,
|
|
@@ -1679,7 +1699,7 @@ var BaseSnackbar = (_a120) => {
|
|
|
1679
1699
|
position = { vertical: "top", horizontal: "center" },
|
|
1680
1700
|
icon,
|
|
1681
1701
|
sx = {}
|
|
1682
|
-
} =
|
|
1702
|
+
} = _b126, props = __objRest(_b126, [
|
|
1683
1703
|
"open",
|
|
1684
1704
|
"onClose",
|
|
1685
1705
|
"message",
|
|
@@ -1689,8 +1709,8 @@ var BaseSnackbar = (_a120) => {
|
|
|
1689
1709
|
"icon",
|
|
1690
1710
|
"sx"
|
|
1691
1711
|
]);
|
|
1692
|
-
var
|
|
1693
|
-
const config = (
|
|
1712
|
+
var _a127;
|
|
1713
|
+
const config = (_a127 = VARIANT_CONFIG[variant]) != null ? _a127 : VARIANT_CONFIG.info;
|
|
1694
1714
|
const renderIcon = useMemo(() => {
|
|
1695
1715
|
if (!icon) return false;
|
|
1696
1716
|
if (isValidElement(icon)) return icon;
|
|
@@ -1747,16 +1767,16 @@ var BaseSnackbar = (_a120) => {
|
|
|
1747
1767
|
})
|
|
1748
1768
|
);
|
|
1749
1769
|
};
|
|
1750
|
-
var _a21, _b21;
|
|
1751
|
-
var MuiCheckbox = (_b21 = (_a21 = MuiCheckboxRaw) == null ? void 0 : _a21.default) != null ? _b21 : MuiCheckboxRaw;
|
|
1752
|
-
var _a22, _b22;
|
|
1753
|
-
var FormControlLabel = (_b22 = (_a22 = FormControlLabelRaw) == null ? void 0 : _a22.default) != null ? _b22 : FormControlLabelRaw;
|
|
1754
1770
|
var _a23, _b23;
|
|
1755
|
-
var
|
|
1771
|
+
var MuiCheckbox = (_b23 = (_a23 = MuiCheckboxRaw) == null ? void 0 : _a23.default) != null ? _b23 : MuiCheckboxRaw;
|
|
1756
1772
|
var _a24, _b24;
|
|
1757
|
-
var
|
|
1758
|
-
var
|
|
1759
|
-
|
|
1773
|
+
var FormControlLabel = (_b24 = (_a24 = FormControlLabelRaw) == null ? void 0 : _a24.default) != null ? _b24 : FormControlLabelRaw;
|
|
1774
|
+
var _a25, _b25;
|
|
1775
|
+
var FormGroup = (_b25 = (_a25 = FormGroupRaw) == null ? void 0 : _a25.default) != null ? _b25 : FormGroupRaw;
|
|
1776
|
+
var _a26, _b26;
|
|
1777
|
+
var Box8 = (_b26 = (_a26 = BoxRaw) == null ? void 0 : _a26.default) != null ? _b26 : BoxRaw;
|
|
1778
|
+
var BaseCheckbox = (_a126) => {
|
|
1779
|
+
var _b126 = _a126, {
|
|
1760
1780
|
name = "",
|
|
1761
1781
|
control = null,
|
|
1762
1782
|
defaultValue,
|
|
@@ -1767,7 +1787,7 @@ var BaseCheckbox = (_a120) => {
|
|
|
1767
1787
|
labelPlacement = "end",
|
|
1768
1788
|
isHorizontal = false,
|
|
1769
1789
|
sx
|
|
1770
|
-
} =
|
|
1790
|
+
} = _b126, restProps = __objRest(_b126, [
|
|
1771
1791
|
"name",
|
|
1772
1792
|
"control",
|
|
1773
1793
|
"defaultValue",
|
|
@@ -1779,11 +1799,11 @@ var BaseCheckbox = (_a120) => {
|
|
|
1779
1799
|
"isHorizontal",
|
|
1780
1800
|
"sx"
|
|
1781
1801
|
]);
|
|
1782
|
-
var
|
|
1802
|
+
var _a127, _b127, _c;
|
|
1783
1803
|
const hookForm = control ? useController({ control, name, defaultValue: defaultValue != null ? defaultValue : [] }) : null;
|
|
1784
1804
|
const field = hookForm == null ? void 0 : hookForm.field;
|
|
1785
1805
|
const formState = hookForm == null ? void 0 : hookForm.formState;
|
|
1786
|
-
const hasError = !!((
|
|
1806
|
+
const hasError = !!((_a127 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a127[name]);
|
|
1787
1807
|
const checkedValue = field ? field.value : restProps.checked;
|
|
1788
1808
|
const handleChange = field ? (newVal) => field.onChange(newVal) : restProps.onChange;
|
|
1789
1809
|
const isGroup = Array.isArray(options);
|
|
@@ -1797,18 +1817,18 @@ var BaseCheckbox = (_a120) => {
|
|
|
1797
1817
|
handleChange == null ? void 0 : handleChange(newChecked);
|
|
1798
1818
|
};
|
|
1799
1819
|
const handleSingleChange = (e) => {
|
|
1800
|
-
var
|
|
1820
|
+
var _a128;
|
|
1801
1821
|
if (field) {
|
|
1802
1822
|
field.onChange(e.target.checked);
|
|
1803
1823
|
} else {
|
|
1804
|
-
(
|
|
1824
|
+
(_a128 = restProps.onChange) == null ? void 0 : _a128.call(restProps, e.target.checked, e);
|
|
1805
1825
|
}
|
|
1806
1826
|
};
|
|
1807
|
-
const errorMessage = (_c = (
|
|
1827
|
+
const errorMessage = (_c = (_b127 = formState == null ? void 0 : formState.errors) == null ? void 0 : _b127[name]) == null ? void 0 : _c.message;
|
|
1808
1828
|
const iconColor = hasError ? DerivedColor.color_text_danger : DerivedColor.color_border_default;
|
|
1809
1829
|
const checkedIconColor = hasError ? DerivedColor.color_text_danger : DerivedColor.color_bg_brand_primary;
|
|
1810
1830
|
if (isGroup) {
|
|
1811
|
-
return /* @__PURE__ */ jsxs(
|
|
1831
|
+
return /* @__PURE__ */ jsxs(Box8, { children: [
|
|
1812
1832
|
title && /* @__PURE__ */ jsx(
|
|
1813
1833
|
BaseTypography,
|
|
1814
1834
|
{
|
|
@@ -1822,7 +1842,7 @@ var BaseCheckbox = (_a120) => {
|
|
|
1822
1842
|
}
|
|
1823
1843
|
),
|
|
1824
1844
|
/* @__PURE__ */ jsx(FormGroup, { row: isHorizontal, sx: { gap: isHorizontal ? 2 : 0 }, children: options.map((option) => {
|
|
1825
|
-
var
|
|
1845
|
+
var _a128, _b128;
|
|
1826
1846
|
return /* @__PURE__ */ jsx(
|
|
1827
1847
|
FormControlLabel,
|
|
1828
1848
|
{
|
|
@@ -1837,8 +1857,8 @@ var BaseCheckbox = (_a120) => {
|
|
|
1837
1857
|
checked: (checkedValue || []).includes(option.value),
|
|
1838
1858
|
onChange: (e) => handleGroupChange(option.value, e.target.checked),
|
|
1839
1859
|
icon: /* @__PURE__ */ jsx(IconSquare, { size: 22, color: iconColor }),
|
|
1840
|
-
checkedIcon: /* @__PURE__ */ jsx(IconSquareCheckFilled, { size: 22, color: ((
|
|
1841
|
-
disabled: (
|
|
1860
|
+
checkedIcon: /* @__PURE__ */ jsx(IconSquareCheckFilled, { size: 22, color: ((_a128 = option.disabled) != null ? _a128 : disabled) ? DerivedColor.color_bg_disabled : checkedIconColor }),
|
|
1861
|
+
disabled: (_b128 = option.disabled) != null ? _b128 : disabled,
|
|
1842
1862
|
sx: {
|
|
1843
1863
|
":hover": { backgroundColor: "#C0DBF1" }
|
|
1844
1864
|
}
|
|
@@ -1851,7 +1871,7 @@ var BaseCheckbox = (_a120) => {
|
|
|
1851
1871
|
errorMessage && /* @__PURE__ */ jsx(BaseTypography, { variant: "body1_regular.danger", sx: { mt: "4px" }, children: errorMessage })
|
|
1852
1872
|
] });
|
|
1853
1873
|
}
|
|
1854
|
-
return /* @__PURE__ */ jsxs(
|
|
1874
|
+
return /* @__PURE__ */ jsxs(Box8, { children: [
|
|
1855
1875
|
title && /* @__PURE__ */ jsx(
|
|
1856
1876
|
BaseTypography,
|
|
1857
1877
|
{
|
|
@@ -1890,12 +1910,12 @@ var BaseCheckbox = (_a120) => {
|
|
|
1890
1910
|
errorMessage && /* @__PURE__ */ jsx(BaseTypography, { variant: "body1_regular.danger", sx: { mt: "4px" }, children: errorMessage })
|
|
1891
1911
|
] });
|
|
1892
1912
|
};
|
|
1893
|
-
var _a25, _b25;
|
|
1894
|
-
var KeyboardArrowRight = (_b25 = (_a25 = KeyboardArrowRightRaw) == null ? void 0 : _a25.default) != null ? _b25 : KeyboardArrowRightRaw;
|
|
1895
|
-
var _a26, _b26;
|
|
1896
|
-
var KeyboardArrowLeft = (_b26 = (_a26 = KeyboardArrowLeftRaw) == null ? void 0 : _a26.default) != null ? _b26 : KeyboardArrowLeftRaw;
|
|
1897
1913
|
var _a27, _b27;
|
|
1898
|
-
var
|
|
1914
|
+
var KeyboardArrowRight = (_b27 = (_a27 = KeyboardArrowRightRaw) == null ? void 0 : _a27.default) != null ? _b27 : KeyboardArrowRightRaw;
|
|
1915
|
+
var _a28, _b28;
|
|
1916
|
+
var KeyboardArrowLeft = (_b28 = (_a28 = KeyboardArrowLeftRaw) == null ? void 0 : _a28.default) != null ? _b28 : KeyboardArrowLeftRaw;
|
|
1917
|
+
var _a29, _b29;
|
|
1918
|
+
var IconButton3 = (_b29 = (_a29 = IconButtonRaw) == null ? void 0 : _a29.default) != null ? _b29 : IconButtonRaw;
|
|
1899
1919
|
var ServerSidePaginationActions = (props) => {
|
|
1900
1920
|
const { page, onPageChange, rowsPerPage, currentPageData } = props;
|
|
1901
1921
|
const handleBackButtonClick = () => {
|
|
@@ -1916,28 +1936,269 @@ var ServerSidePaginationActions = (props) => {
|
|
|
1916
1936
|
)
|
|
1917
1937
|
] });
|
|
1918
1938
|
};
|
|
1919
|
-
var _a28, _b28;
|
|
1920
|
-
var Box8 = (_b28 = (_a28 = BoxRaw) == null ? void 0 : _a28.default) != null ? _b28 : BoxRaw;
|
|
1921
|
-
var _a29, _b29;
|
|
1922
|
-
var Checkbox = (_b29 = (_a29 = MuiCheckboxRaw) == null ? void 0 : _a29.default) != null ? _b29 : MuiCheckboxRaw;
|
|
1923
1939
|
var _a30, _b30;
|
|
1924
|
-
var
|
|
1940
|
+
var Box9 = (_b30 = (_a30 = BoxRaw) == null ? void 0 : _a30.default) != null ? _b30 : BoxRaw;
|
|
1925
1941
|
var _a31, _b31;
|
|
1926
|
-
var
|
|
1942
|
+
var Select = (_b31 = (_a31 = SelectRaw) == null ? void 0 : _a31.default) != null ? _b31 : SelectRaw;
|
|
1927
1943
|
var _a32, _b32;
|
|
1928
|
-
var
|
|
1944
|
+
var MenuItem = (_b32 = (_a32 = MenuItemRaw) == null ? void 0 : _a32.default) != null ? _b32 : MenuItemRaw;
|
|
1929
1945
|
var _a33, _b33;
|
|
1930
|
-
var
|
|
1946
|
+
var IconButton4 = (_b33 = (_a33 = IconButtonRaw) == null ? void 0 : _a33.default) != null ? _b33 : IconButtonRaw;
|
|
1931
1947
|
var _a34, _b34;
|
|
1932
|
-
var
|
|
1948
|
+
var TablePagination = (_b34 = (_a34 = TablePaginationRaw) == null ? void 0 : _a34.default) != null ? _b34 : TablePaginationRaw;
|
|
1949
|
+
function getVisiblePages(currentPage, totalPages, maxVisible = 3) {
|
|
1950
|
+
if (totalPages <= maxVisible) {
|
|
1951
|
+
return Array.from({ length: totalPages }, (_, i) => i);
|
|
1952
|
+
}
|
|
1953
|
+
let start;
|
|
1954
|
+
if (currentPage < maxVisible) {
|
|
1955
|
+
start = 0;
|
|
1956
|
+
} else {
|
|
1957
|
+
start = currentPage;
|
|
1958
|
+
}
|
|
1959
|
+
let end = start + maxVisible - 1;
|
|
1960
|
+
if (end >= totalPages) {
|
|
1961
|
+
end = totalPages - 1;
|
|
1962
|
+
start = Math.max(0, end - maxVisible + 1);
|
|
1963
|
+
}
|
|
1964
|
+
const pages = [];
|
|
1965
|
+
for (let i = start; i <= end; i++) {
|
|
1966
|
+
pages.push(i);
|
|
1967
|
+
}
|
|
1968
|
+
return pages;
|
|
1969
|
+
}
|
|
1970
|
+
var NumberedPageButtons = ({ page, onPageChange, totalPages }) => {
|
|
1971
|
+
const visiblePages = useMemo(
|
|
1972
|
+
() => getVisiblePages(page, totalPages),
|
|
1973
|
+
[page, totalPages]
|
|
1974
|
+
);
|
|
1975
|
+
return /* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
1976
|
+
/* @__PURE__ */ jsx(
|
|
1977
|
+
IconButton4,
|
|
1978
|
+
{
|
|
1979
|
+
size: "small",
|
|
1980
|
+
disabled: page === 0,
|
|
1981
|
+
onClick: (e) => onPageChange(e, page - 1),
|
|
1982
|
+
sx: { color: DerivedColor.color_text_default, width: 32, height: 32 },
|
|
1983
|
+
children: /* @__PURE__ */ jsx(IconChevronLeft, { size: 18 })
|
|
1984
|
+
}
|
|
1985
|
+
),
|
|
1986
|
+
visiblePages.map((item, idx) => /* @__PURE__ */ jsx(
|
|
1987
|
+
Box9,
|
|
1988
|
+
{
|
|
1989
|
+
onClick: (e) => onPageChange(e, item),
|
|
1990
|
+
sx: {
|
|
1991
|
+
width: 32,
|
|
1992
|
+
height: 32,
|
|
1993
|
+
display: "flex",
|
|
1994
|
+
alignItems: "center",
|
|
1995
|
+
justifyContent: "center",
|
|
1996
|
+
borderRadius: 1,
|
|
1997
|
+
fontSize: 13,
|
|
1998
|
+
fontWeight: item === page ? 600 : 400,
|
|
1999
|
+
cursor: "pointer",
|
|
2000
|
+
userSelect: "none",
|
|
2001
|
+
border: item === page ? `1.5px solid ${PrimitiveColor.color_blue_cakrawala_500}` : "1px solid transparent",
|
|
2002
|
+
color: item === page ? PrimitiveColor.color_blue_cakrawala_500 : DerivedColor.color_text_default,
|
|
2003
|
+
backgroundColor: "transparent",
|
|
2004
|
+
"&:hover": {
|
|
2005
|
+
backgroundColor: PrimitiveColor.color_neutral_200
|
|
2006
|
+
}
|
|
2007
|
+
},
|
|
2008
|
+
children: item + 1
|
|
2009
|
+
},
|
|
2010
|
+
item
|
|
2011
|
+
)),
|
|
2012
|
+
/* @__PURE__ */ jsx(
|
|
2013
|
+
IconButton4,
|
|
2014
|
+
{
|
|
2015
|
+
size: "small",
|
|
2016
|
+
disabled: page >= totalPages - 1,
|
|
2017
|
+
onClick: (e) => onPageChange(e, page + 1),
|
|
2018
|
+
sx: { color: DerivedColor.color_text_default, width: 32, height: 32 },
|
|
2019
|
+
children: /* @__PURE__ */ jsx(IconChevronRight, { size: 18 })
|
|
2020
|
+
}
|
|
2021
|
+
)
|
|
2022
|
+
] });
|
|
2023
|
+
};
|
|
2024
|
+
var NumberedVariant = ({
|
|
2025
|
+
showTotalCount,
|
|
2026
|
+
page,
|
|
2027
|
+
rowsPerPage,
|
|
2028
|
+
count,
|
|
2029
|
+
onPageChange,
|
|
2030
|
+
onRowsPerPageChange,
|
|
2031
|
+
rowsPerPageOptions,
|
|
2032
|
+
labelRowsPerPage,
|
|
2033
|
+
currentPageDataLength
|
|
2034
|
+
}) => {
|
|
2035
|
+
const totalPages = count >= 0 ? Math.ceil(count / rowsPerPage) : 0;
|
|
2036
|
+
const startItem = page * rowsPerPage + 1;
|
|
2037
|
+
const endItem = count >= 0 ? Math.min((page + 1) * rowsPerPage, count) : page * rowsPerPage + currentPageDataLength;
|
|
2038
|
+
return /* @__PURE__ */ jsxs(
|
|
2039
|
+
Box9,
|
|
2040
|
+
{
|
|
2041
|
+
sx: {
|
|
2042
|
+
display: "flex",
|
|
2043
|
+
alignItems: "center",
|
|
2044
|
+
justifyContent: "space-between",
|
|
2045
|
+
px: 2,
|
|
2046
|
+
py: 1.5,
|
|
2047
|
+
borderTop: `1px solid ${DerivedColor.color_border_default}`,
|
|
2048
|
+
minHeight: 52
|
|
2049
|
+
},
|
|
2050
|
+
children: [
|
|
2051
|
+
/* @__PURE__ */ jsx(Box9, { sx: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsxs(BaseTypography, { variant: "body2_regular.subtle", component: "div", children: [
|
|
2052
|
+
"Menampilkan",
|
|
2053
|
+
" ",
|
|
2054
|
+
/* @__PURE__ */ jsxs("span", { style: { fontWeight: 700, color: DerivedColor.color_text_default }, children: [
|
|
2055
|
+
startItem,
|
|
2056
|
+
"-",
|
|
2057
|
+
endItem
|
|
2058
|
+
] }),
|
|
2059
|
+
showTotalCount && count >= 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2060
|
+
" ",
|
|
2061
|
+
"dari",
|
|
2062
|
+
" ",
|
|
2063
|
+
/* @__PURE__ */ jsx("span", { style: { fontWeight: 700, color: DerivedColor.color_text_default }, children: count }),
|
|
2064
|
+
" ",
|
|
2065
|
+
"data"
|
|
2066
|
+
] })
|
|
2067
|
+
] }) }),
|
|
2068
|
+
/* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
2069
|
+
/* @__PURE__ */ jsxs(Box9, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
2070
|
+
/* @__PURE__ */ jsx(BaseTypography, { variant: "body2_regular.subtle", children: labelRowsPerPage }),
|
|
2071
|
+
/* @__PURE__ */ jsx(
|
|
2072
|
+
Select,
|
|
2073
|
+
{
|
|
2074
|
+
value: rowsPerPage,
|
|
2075
|
+
onChange: (e) => {
|
|
2076
|
+
const syntheticEvent = { target: { value: e.target.value } };
|
|
2077
|
+
onRowsPerPageChange == null ? void 0 : onRowsPerPageChange(syntheticEvent, Number(e.target.value));
|
|
2078
|
+
},
|
|
2079
|
+
size: "small",
|
|
2080
|
+
variant: "outlined",
|
|
2081
|
+
sx: {
|
|
2082
|
+
minWidth: 60,
|
|
2083
|
+
height: 32,
|
|
2084
|
+
fontSize: 13,
|
|
2085
|
+
"& .MuiSelect-select": { py: 0.5, px: 1 }
|
|
2086
|
+
},
|
|
2087
|
+
children: rowsPerPageOptions.map((option) => /* @__PURE__ */ jsx(MenuItem, { value: option, sx: { fontSize: 13 }, children: option }, option))
|
|
2088
|
+
}
|
|
2089
|
+
)
|
|
2090
|
+
] }),
|
|
2091
|
+
/* @__PURE__ */ jsx(
|
|
2092
|
+
NumberedPageButtons,
|
|
2093
|
+
{
|
|
2094
|
+
page,
|
|
2095
|
+
onPageChange,
|
|
2096
|
+
totalPages
|
|
2097
|
+
}
|
|
2098
|
+
)
|
|
2099
|
+
] })
|
|
2100
|
+
]
|
|
2101
|
+
}
|
|
2102
|
+
);
|
|
2103
|
+
};
|
|
2104
|
+
var DefaultVariant = ({
|
|
2105
|
+
page,
|
|
2106
|
+
rowsPerPage,
|
|
2107
|
+
count,
|
|
2108
|
+
onPageChange,
|
|
2109
|
+
onRowsPerPageChange,
|
|
2110
|
+
rowsPerPageOptions,
|
|
2111
|
+
labelRowsPerPage,
|
|
2112
|
+
serverSide,
|
|
2113
|
+
currentPageDataLength
|
|
2114
|
+
}) => {
|
|
2115
|
+
return /* @__PURE__ */ jsx(
|
|
2116
|
+
TablePagination,
|
|
2117
|
+
{
|
|
2118
|
+
component: "div",
|
|
2119
|
+
count: count >= 0 ? count : -1,
|
|
2120
|
+
page,
|
|
2121
|
+
rowsPerPage,
|
|
2122
|
+
onPageChange,
|
|
2123
|
+
onRowsPerPageChange: (e) => {
|
|
2124
|
+
onRowsPerPageChange == null ? void 0 : onRowsPerPageChange(e, Number(e.target.value));
|
|
2125
|
+
},
|
|
2126
|
+
rowsPerPageOptions,
|
|
2127
|
+
labelRowsPerPage,
|
|
2128
|
+
ActionsComponent: serverSide ? (actionProps) => /* @__PURE__ */ jsx(
|
|
2129
|
+
ServerSidePaginationActions,
|
|
2130
|
+
__spreadProps(__spreadValues({}, actionProps), {
|
|
2131
|
+
currentPageData: { length: currentPageDataLength }
|
|
2132
|
+
})
|
|
2133
|
+
) : void 0
|
|
2134
|
+
}
|
|
2135
|
+
);
|
|
2136
|
+
};
|
|
2137
|
+
var DatatablePagination = ({
|
|
2138
|
+
variant = "default",
|
|
2139
|
+
showTotalCount = false,
|
|
2140
|
+
page = 0,
|
|
2141
|
+
rowsPerPage = 10,
|
|
2142
|
+
count = -1,
|
|
2143
|
+
onPageChange,
|
|
2144
|
+
onRowsPerPageChange,
|
|
2145
|
+
rowsPerPageOptions = [5, 10, 25],
|
|
2146
|
+
labelRowsPerPage,
|
|
2147
|
+
serverSide = false,
|
|
2148
|
+
currentPageDataLength = 0
|
|
2149
|
+
}) => {
|
|
2150
|
+
const resolvedLabel = labelRowsPerPage != null ? labelRowsPerPage : variant === "numbered" ? "Baris per halaman:" : "Rows per page:";
|
|
2151
|
+
if (variant === "numbered") {
|
|
2152
|
+
return /* @__PURE__ */ jsx(
|
|
2153
|
+
NumberedVariant,
|
|
2154
|
+
{
|
|
2155
|
+
showTotalCount,
|
|
2156
|
+
page,
|
|
2157
|
+
rowsPerPage,
|
|
2158
|
+
count,
|
|
2159
|
+
onPageChange,
|
|
2160
|
+
onRowsPerPageChange,
|
|
2161
|
+
rowsPerPageOptions,
|
|
2162
|
+
labelRowsPerPage: resolvedLabel,
|
|
2163
|
+
currentPageDataLength
|
|
2164
|
+
}
|
|
2165
|
+
);
|
|
2166
|
+
}
|
|
2167
|
+
return /* @__PURE__ */ jsx(
|
|
2168
|
+
DefaultVariant,
|
|
2169
|
+
{
|
|
2170
|
+
page,
|
|
2171
|
+
rowsPerPage,
|
|
2172
|
+
count,
|
|
2173
|
+
onPageChange,
|
|
2174
|
+
onRowsPerPageChange,
|
|
2175
|
+
rowsPerPageOptions,
|
|
2176
|
+
labelRowsPerPage: resolvedLabel,
|
|
2177
|
+
serverSide,
|
|
2178
|
+
currentPageDataLength
|
|
2179
|
+
}
|
|
2180
|
+
);
|
|
2181
|
+
};
|
|
1933
2182
|
var _a35, _b35;
|
|
1934
|
-
var
|
|
2183
|
+
var Box10 = (_b35 = (_a35 = BoxRaw) == null ? void 0 : _a35.default) != null ? _b35 : BoxRaw;
|
|
1935
2184
|
var _a36, _b36;
|
|
1936
|
-
var
|
|
2185
|
+
var Checkbox = (_b36 = (_a36 = MuiCheckboxRaw) == null ? void 0 : _a36.default) != null ? _b36 : MuiCheckboxRaw;
|
|
1937
2186
|
var _a37, _b37;
|
|
1938
|
-
var
|
|
2187
|
+
var CircularProgress = (_b37 = (_a37 = CircularProgressRaw) == null ? void 0 : _a37.default) != null ? _b37 : CircularProgressRaw;
|
|
1939
2188
|
var _a38, _b38;
|
|
1940
|
-
var
|
|
2189
|
+
var Paper = (_b38 = (_a38 = PaperRaw) == null ? void 0 : _a38.default) != null ? _b38 : PaperRaw;
|
|
2190
|
+
var _a39, _b39;
|
|
2191
|
+
var Table = (_b39 = (_a39 = TableRaw) == null ? void 0 : _a39.default) != null ? _b39 : TableRaw;
|
|
2192
|
+
var _a40, _b40;
|
|
2193
|
+
var TableBody = (_b40 = (_a40 = TableBodyRaw) == null ? void 0 : _a40.default) != null ? _b40 : TableBodyRaw;
|
|
2194
|
+
var _a41, _b41;
|
|
2195
|
+
var TableCell = (_b41 = (_a41 = TableCellRaw) == null ? void 0 : _a41.default) != null ? _b41 : TableCellRaw;
|
|
2196
|
+
var _a42, _b42;
|
|
2197
|
+
var TableContainer = (_b42 = (_a42 = TableContainerRaw) == null ? void 0 : _a42.default) != null ? _b42 : TableContainerRaw;
|
|
2198
|
+
var _a43, _b43;
|
|
2199
|
+
var TableHead = (_b43 = (_a43 = TableHeadRaw) == null ? void 0 : _a43.default) != null ? _b43 : TableHeadRaw;
|
|
2200
|
+
var _a44, _b44;
|
|
2201
|
+
var TableRow = (_b44 = (_a44 = TableRowRaw) == null ? void 0 : _a44.default) != null ? _b44 : TableRowRaw;
|
|
1941
2202
|
var DEFAULT_COLUMN_WIDTH = 160;
|
|
1942
2203
|
var HEADER_ROW_HEIGHT = 48;
|
|
1943
2204
|
var SELECTION_COLUMN_WIDTH = 56;
|
|
@@ -1971,13 +2232,13 @@ var compareValue = (a, b) => {
|
|
|
1971
2232
|
});
|
|
1972
2233
|
};
|
|
1973
2234
|
var getColumnWidth = (column) => {
|
|
1974
|
-
var
|
|
1975
|
-
return Number((
|
|
2235
|
+
var _a126, _b126;
|
|
2236
|
+
return Number((_b126 = (_a126 = column.width) != null ? _a126 : column.minWidth) != null ? _b126 : DEFAULT_COLUMN_WIDTH);
|
|
1976
2237
|
};
|
|
1977
2238
|
var getStickyLeft = (widths, index) => widths.slice(0, index).reduce((sum, width) => sum + width, 0);
|
|
1978
2239
|
var getStickyRight = (widths, index) => widths.slice(index + 1).reduce((sum, width) => sum + width, 0);
|
|
1979
2240
|
var normalizeColumn = (column, index, sortingEnabled) => {
|
|
1980
|
-
var
|
|
2241
|
+
var _a126, _b126, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
1981
2242
|
if (typeof column === "string") {
|
|
1982
2243
|
return {
|
|
1983
2244
|
id: getLastPathSegment(column) || `column-${index}`,
|
|
@@ -1990,7 +2251,7 @@ var normalizeColumn = (column, index, sortingEnabled) => {
|
|
|
1990
2251
|
headerAlign: "center"
|
|
1991
2252
|
};
|
|
1992
2253
|
}
|
|
1993
|
-
const accessorKey = (_c = (
|
|
2254
|
+
const accessorKey = (_c = (_b126 = (_a126 = column.accessorKey) != null ? _a126 : column.key) != null ? _b126 : column.field) != null ? _c : column.id;
|
|
1994
2255
|
const id2 = (_e = (_d = column.id) != null ? _d : getLastPathSegment(accessorKey)) != null ? _e : `column-${index}`;
|
|
1995
2256
|
return __spreadProps(__spreadValues({
|
|
1996
2257
|
width: DEFAULT_COLUMN_WIDTH,
|
|
@@ -2010,12 +2271,12 @@ var normalizeHeaderRows = (header, columns) => {
|
|
|
2010
2271
|
}
|
|
2011
2272
|
return [
|
|
2012
2273
|
columns.map((column) => {
|
|
2013
|
-
var
|
|
2274
|
+
var _a126, _b126;
|
|
2014
2275
|
return {
|
|
2015
2276
|
id: column.id,
|
|
2016
2277
|
key: column.id,
|
|
2017
2278
|
label: column.header,
|
|
2018
|
-
align: (
|
|
2279
|
+
align: (_b126 = (_a126 = column.headerAlign) != null ? _a126 : column.align) != null ? _b126 : "center",
|
|
2019
2280
|
rowSpan: 1
|
|
2020
2281
|
};
|
|
2021
2282
|
})
|
|
@@ -2024,13 +2285,13 @@ var normalizeHeaderRows = (header, columns) => {
|
|
|
2024
2285
|
var buildHeaderLayout = (headerRows) => {
|
|
2025
2286
|
const occupied = [];
|
|
2026
2287
|
return headerRows.map((row, rowIndex) => {
|
|
2027
|
-
var
|
|
2028
|
-
(
|
|
2288
|
+
var _a126;
|
|
2289
|
+
(_a126 = occupied[rowIndex]) != null ? _a126 : occupied[rowIndex] = [];
|
|
2029
2290
|
let pointer = 0;
|
|
2030
2291
|
return row.map((cell, cellIndex) => {
|
|
2031
|
-
var
|
|
2292
|
+
var _a127, _b126, _c, _d, _e, _f, _g;
|
|
2032
2293
|
while (occupied[rowIndex][pointer]) pointer += 1;
|
|
2033
|
-
const colSpan = (
|
|
2294
|
+
const colSpan = (_b126 = (_a127 = cell.colSpan) != null ? _a127 : cell.colspan) != null ? _b126 : 1;
|
|
2034
2295
|
const rowSpan = (_d = (_c = cell.rowSpan) != null ? _c : cell.rowspan) != null ? _d : 1;
|
|
2035
2296
|
const start = pointer;
|
|
2036
2297
|
for (let r = rowIndex; r < rowIndex + rowSpan; r += 1) {
|
|
@@ -2066,8 +2327,8 @@ var renderSortIcon = (sortKey, sortState) => {
|
|
|
2066
2327
|
return sortState.direction === "asc" ? /* @__PURE__ */ jsx(IconArrowUp, { size: 16, color: activeColor }) : /* @__PURE__ */ jsx(IconArrowDown, { size: 16, color: activeColor });
|
|
2067
2328
|
};
|
|
2068
2329
|
var getSortField = (column) => {
|
|
2069
|
-
var
|
|
2070
|
-
return (_c = (
|
|
2330
|
+
var _a126, _b126, _c;
|
|
2331
|
+
return (_c = (_b126 = (_a126 = column.sortField) != null ? _a126 : column.accessorKey) != null ? _b126 : column.key) != null ? _c : column.id;
|
|
2071
2332
|
};
|
|
2072
2333
|
var BaseDatatable = ({
|
|
2073
2334
|
columns = EMPTY_ARRAY,
|
|
@@ -2088,7 +2349,7 @@ var BaseDatatable = ({
|
|
|
2088
2349
|
containerSx = EMPTY_OBJECT,
|
|
2089
2350
|
tableSx = EMPTY_OBJECT
|
|
2090
2351
|
}) => {
|
|
2091
|
-
var
|
|
2352
|
+
var _a126, _b126, _c, _d, _e;
|
|
2092
2353
|
const featureConfig = useMemo(
|
|
2093
2354
|
() => __spreadValues({
|
|
2094
2355
|
sorting: false,
|
|
@@ -2124,9 +2385,11 @@ var BaseDatatable = ({
|
|
|
2124
2385
|
() => __spreadValues({
|
|
2125
2386
|
enabled: false,
|
|
2126
2387
|
serverSide: false,
|
|
2388
|
+
variant: "default",
|
|
2389
|
+
showTotalCount: false,
|
|
2127
2390
|
rowsPerPage: 5,
|
|
2128
2391
|
rowsPerPageOptions: [5, 10, 25],
|
|
2129
|
-
labelRowsPerPage:
|
|
2392
|
+
labelRowsPerPage: void 0
|
|
2130
2393
|
}, pagination),
|
|
2131
2394
|
[pagination]
|
|
2132
2395
|
);
|
|
@@ -2136,7 +2399,7 @@ var BaseDatatable = ({
|
|
|
2136
2399
|
const [internalSelectedIds, setInternalSelectedIds] = useState(
|
|
2137
2400
|
selectionConfig.defaultSelectedRowIds
|
|
2138
2401
|
);
|
|
2139
|
-
const [internalPage, setInternalPage] = useState((
|
|
2402
|
+
const [internalPage, setInternalPage] = useState((_a126 = paginationConfig.page) != null ? _a126 : 0);
|
|
2140
2403
|
const [internalRowsPerPage, setInternalRowsPerPage] = useState(
|
|
2141
2404
|
paginationConfig.rowsPerPage
|
|
2142
2405
|
);
|
|
@@ -2145,7 +2408,7 @@ var BaseDatatable = ({
|
|
|
2145
2408
|
const isRowSelectable = selectionConfig.isRowSelectable;
|
|
2146
2409
|
const selectionPosition = selectionConfig.position;
|
|
2147
2410
|
const selectedIds = controlledSelectedIds != null ? controlledSelectedIds : internalSelectedIds;
|
|
2148
|
-
const sortState = (
|
|
2411
|
+
const sortState = (_b126 = featureConfig.sortState) != null ? _b126 : internalSortState;
|
|
2149
2412
|
const currentPage = (_c = pagination.page) != null ? _c : internalPage;
|
|
2150
2413
|
const currentRowsPerPage = (_d = pagination.rowsPerPage) != null ? _d : internalRowsPerPage;
|
|
2151
2414
|
const isHeaderInteractive = typeof featureConfig.headerInteractive === "boolean" ? featureConfig.headerInteractive : featureConfig.sorting;
|
|
@@ -2182,8 +2445,8 @@ var BaseDatatable = ({
|
|
|
2182
2445
|
);
|
|
2183
2446
|
const resolveRowId = useCallback(
|
|
2184
2447
|
(row, rowIndex) => {
|
|
2185
|
-
var
|
|
2186
|
-
return (
|
|
2448
|
+
var _a127, _b127;
|
|
2449
|
+
return (_b127 = (_a127 = getRowId == null ? void 0 : getRowId(row, rowIndex)) != null ? _a127 : row == null ? void 0 : row.id) != null ? _b127 : rowIndex;
|
|
2187
2450
|
},
|
|
2188
2451
|
[getRowId]
|
|
2189
2452
|
);
|
|
@@ -2306,17 +2569,17 @@ var BaseDatatable = ({
|
|
|
2306
2569
|
]);
|
|
2307
2570
|
const handlePaginationPageChange = useCallback(
|
|
2308
2571
|
(event, nextPage) => {
|
|
2309
|
-
var
|
|
2572
|
+
var _a127;
|
|
2310
2573
|
if (pagination.page === void 0) {
|
|
2311
2574
|
setInternalPage(nextPage);
|
|
2312
2575
|
}
|
|
2313
|
-
(
|
|
2576
|
+
(_a127 = paginationConfig.onPageChange) == null ? void 0 : _a127.call(paginationConfig, event, nextPage);
|
|
2314
2577
|
},
|
|
2315
2578
|
[pagination.page, paginationConfig]
|
|
2316
2579
|
);
|
|
2317
2580
|
const handleRowsPerPageChange = useCallback(
|
|
2318
2581
|
(event) => {
|
|
2319
|
-
var
|
|
2582
|
+
var _a127;
|
|
2320
2583
|
const nextRowsPerPage = Number(event.target.value);
|
|
2321
2584
|
if (pagination.rowsPerPage === void 0) {
|
|
2322
2585
|
setInternalRowsPerPage(nextRowsPerPage);
|
|
@@ -2324,15 +2587,15 @@ var BaseDatatable = ({
|
|
|
2324
2587
|
if (pagination.page === void 0) {
|
|
2325
2588
|
setInternalPage(0);
|
|
2326
2589
|
}
|
|
2327
|
-
(
|
|
2590
|
+
(_a127 = paginationConfig.onRowsPerPageChange) == null ? void 0 : _a127.call(paginationConfig, event, nextRowsPerPage);
|
|
2328
2591
|
},
|
|
2329
2592
|
[pagination.page, pagination.rowsPerPage, paginationConfig]
|
|
2330
2593
|
);
|
|
2331
2594
|
const handleSort = useCallback(
|
|
2332
2595
|
(cell) => {
|
|
2333
|
-
var
|
|
2596
|
+
var _a127, _b127, _c2, _d2, _e2, _f;
|
|
2334
2597
|
if (!featureConfig.sorting) return;
|
|
2335
|
-
if (((
|
|
2598
|
+
if (((_a127 = cell.colSpan) != null ? _a127 : 1) > 1 || ((_b127 = cell.rowSpan) != null ? _b127 : 1) > 1) return;
|
|
2336
2599
|
const sortKey = (_d2 = (_c2 = cell.sortKey) != null ? _c2 : cell.key) != null ? _d2 : cell.id;
|
|
2337
2600
|
const targetColumn = normalizedColumns.find((column) => column.id === sortKey);
|
|
2338
2601
|
if (!(targetColumn == null ? void 0 : targetColumn.sortable)) return;
|
|
@@ -2379,8 +2642,8 @@ var BaseDatatable = ({
|
|
|
2379
2642
|
);
|
|
2380
2643
|
const renderBodyCell = useCallback(
|
|
2381
2644
|
(column, row, rowIndex, columnIndex, rowId, rowActive, cellOverrides = EMPTY_OBJECT) => {
|
|
2382
|
-
var
|
|
2383
|
-
const resolvedColumn = column.isSelection || column.id === selectionColumn.id ? selectionColumn : (
|
|
2645
|
+
var _a127, _b127, _c2, _d2, _e2;
|
|
2646
|
+
const resolvedColumn = column.isSelection || column.id === selectionColumn.id ? selectionColumn : (_a127 = visibleColumns.find((item) => item.id === column.id)) != null ? _a127 : column;
|
|
2384
2647
|
if (resolvedColumn.isSelection) {
|
|
2385
2648
|
const isSelectable = isRowSelectable ? isRowSelectable(row, rowIndex) : true;
|
|
2386
2649
|
return /* @__PURE__ */ jsx(
|
|
@@ -2403,7 +2666,7 @@ var BaseDatatable = ({
|
|
|
2403
2666
|
boxShadow: selectionPosition === "left" && columnIndex === stickyLeftCount - 1 ? `2px 0 6px ${COLORS.stickyShadow}` : selectionPosition === "right" && columnIndex === visibleColumns.length - stickyRightCount ? `-2px 0 6px ${COLORS.stickyShadow}` : "none"
|
|
2404
2667
|
}, cellOverrides.sx),
|
|
2405
2668
|
children: /* @__PURE__ */ jsx(
|
|
2406
|
-
|
|
2669
|
+
Box10,
|
|
2407
2670
|
{
|
|
2408
2671
|
sx: {
|
|
2409
2672
|
display: "flex",
|
|
@@ -2436,7 +2699,7 @@ var BaseDatatable = ({
|
|
|
2436
2699
|
return /* @__PURE__ */ jsx(
|
|
2437
2700
|
TableCell,
|
|
2438
2701
|
{
|
|
2439
|
-
align: (
|
|
2702
|
+
align: (_b127 = resolvedColumn.align) != null ? _b127 : "left",
|
|
2440
2703
|
rowSpan: cellOverrides.rowSpan,
|
|
2441
2704
|
colSpan: cellOverrides.colSpan,
|
|
2442
2705
|
sx: __spreadValues(__spreadValues({
|
|
@@ -2510,8 +2773,8 @@ var BaseDatatable = ({
|
|
|
2510
2773
|
}, tableSx),
|
|
2511
2774
|
children: [
|
|
2512
2775
|
/* @__PURE__ */ jsx(TableHead, { children: rowsForHeader.map((row, rowIndex) => /* @__PURE__ */ jsx(TableRow, { children: row.map((cell) => {
|
|
2513
|
-
var
|
|
2514
|
-
const sortKey = (
|
|
2776
|
+
var _a127, _b127, _c2, _d2, _e2, _f, _g, _h, _i;
|
|
2777
|
+
const sortKey = (_b127 = (_a127 = cell.sortKey) != null ? _a127 : cell.key) != null ? _b127 : cell.id;
|
|
2515
2778
|
const targetColumn = normalizedColumns.find((column) => column.id === sortKey);
|
|
2516
2779
|
const isSortable = featureConfig.sorting && ((_c2 = cell.colSpan) != null ? _c2 : 1) === 1 && ((_d2 = cell.rowSpan) != null ? _d2 : 1) === 1 && (targetColumn == null ? void 0 : targetColumn.sortable);
|
|
2517
2780
|
const shouldStickLeft = cell.sticky === "left" || cell.end < stickyLeftCount;
|
|
@@ -2552,7 +2815,7 @@ var BaseDatatable = ({
|
|
|
2552
2815
|
} : void 0
|
|
2553
2816
|
}),
|
|
2554
2817
|
children: /* @__PURE__ */ jsxs(
|
|
2555
|
-
|
|
2818
|
+
Box10,
|
|
2556
2819
|
{
|
|
2557
2820
|
sx: {
|
|
2558
2821
|
display: "flex",
|
|
@@ -2571,7 +2834,7 @@ var BaseDatatable = ({
|
|
|
2571
2834
|
);
|
|
2572
2835
|
}) }, `header-${rowIndex}`)) }),
|
|
2573
2836
|
/* @__PURE__ */ jsx(TableBody, { children: loading ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { align: "center", colSpan: visibleColumns.length, children: /* @__PURE__ */ jsxs(
|
|
2574
|
-
|
|
2837
|
+
Box10,
|
|
2575
2838
|
{
|
|
2576
2839
|
sx: {
|
|
2577
2840
|
minHeight: 120,
|
|
@@ -2643,22 +2906,19 @@ var BaseDatatable = ({
|
|
|
2643
2906
|
}
|
|
2644
2907
|
),
|
|
2645
2908
|
paginationConfig.enabled && /* @__PURE__ */ jsx(
|
|
2646
|
-
|
|
2909
|
+
DatatablePagination,
|
|
2647
2910
|
{
|
|
2648
|
-
|
|
2649
|
-
|
|
2911
|
+
variant: paginationConfig.variant,
|
|
2912
|
+
showTotalCount: paginationConfig.showTotalCount,
|
|
2650
2913
|
page: currentPage,
|
|
2651
2914
|
rowsPerPage: currentRowsPerPage,
|
|
2915
|
+
count: totalRowCount,
|
|
2652
2916
|
onPageChange: handlePaginationPageChange,
|
|
2653
2917
|
onRowsPerPageChange: handleRowsPerPageChange,
|
|
2654
2918
|
rowsPerPageOptions: paginationConfig.rowsPerPageOptions,
|
|
2655
2919
|
labelRowsPerPage: paginationConfig.labelRowsPerPage,
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
__spreadProps(__spreadValues({}, actionProps), {
|
|
2659
|
-
currentPageData: displayedData
|
|
2660
|
-
})
|
|
2661
|
-
) : void 0
|
|
2920
|
+
serverSide: paginationConfig.serverSide,
|
|
2921
|
+
currentPageDataLength: displayedData.length
|
|
2662
2922
|
}
|
|
2663
2923
|
)
|
|
2664
2924
|
]
|
|
@@ -2685,26 +2945,26 @@ BaseDatatable.propTypes = {
|
|
|
2685
2945
|
tableSx: PropTypes3.object
|
|
2686
2946
|
};
|
|
2687
2947
|
React2.memo(BaseDatatable);
|
|
2688
|
-
var _a39, _b39;
|
|
2689
|
-
var TextField = (_b39 = (_a39 = TextFieldRaw) == null ? void 0 : _a39.default) != null ? _b39 : TextFieldRaw;
|
|
2690
|
-
var _a40, _b40;
|
|
2691
|
-
var Box9 = (_b40 = (_a40 = BoxRaw) == null ? void 0 : _a40.default) != null ? _b40 : BoxRaw;
|
|
2692
|
-
var _a41, _b41;
|
|
2693
|
-
var Popover = (_b41 = (_a41 = PopoverRaw) == null ? void 0 : _a41.default) != null ? _b41 : PopoverRaw;
|
|
2694
|
-
var _a42, _b42;
|
|
2695
|
-
var InputAdornment = (_b42 = (_a42 = InputAdornmentRaw) == null ? void 0 : _a42.default) != null ? _b42 : InputAdornmentRaw;
|
|
2696
|
-
var _a43, _b43;
|
|
2697
|
-
var IconButton4 = (_b43 = (_a43 = IconButtonRaw) == null ? void 0 : _a43.default) != null ? _b43 : IconButtonRaw;
|
|
2698
|
-
var _a44, _b44;
|
|
2699
|
-
var Typography = (_b44 = (_a44 = MuiTypographyRaw) == null ? void 0 : _a44.default) != null ? _b44 : MuiTypographyRaw;
|
|
2700
2948
|
var _a45, _b45;
|
|
2701
|
-
var
|
|
2949
|
+
var TextField = (_b45 = (_a45 = TextFieldRaw) == null ? void 0 : _a45.default) != null ? _b45 : TextFieldRaw;
|
|
2702
2950
|
var _a46, _b46;
|
|
2703
|
-
var
|
|
2951
|
+
var Box11 = (_b46 = (_a46 = BoxRaw) == null ? void 0 : _a46.default) != null ? _b46 : BoxRaw;
|
|
2704
2952
|
var _a47, _b47;
|
|
2705
|
-
var
|
|
2706
|
-
var
|
|
2707
|
-
|
|
2953
|
+
var Popover = (_b47 = (_a47 = PopoverRaw) == null ? void 0 : _a47.default) != null ? _b47 : PopoverRaw;
|
|
2954
|
+
var _a48, _b48;
|
|
2955
|
+
var InputAdornment = (_b48 = (_a48 = InputAdornmentRaw) == null ? void 0 : _a48.default) != null ? _b48 : InputAdornmentRaw;
|
|
2956
|
+
var _a49, _b49;
|
|
2957
|
+
var IconButton5 = (_b49 = (_a49 = IconButtonRaw) == null ? void 0 : _a49.default) != null ? _b49 : IconButtonRaw;
|
|
2958
|
+
var _a50, _b50;
|
|
2959
|
+
var Typography = (_b50 = (_a50 = MuiTypographyRaw) == null ? void 0 : _a50.default) != null ? _b50 : MuiTypographyRaw;
|
|
2960
|
+
var _a51, _b51;
|
|
2961
|
+
var DatePicker = (_b51 = (_a51 = DatePicker$1) == null ? void 0 : _a51.default) != null ? _b51 : DatePicker$1;
|
|
2962
|
+
var _a52, _b52;
|
|
2963
|
+
var DateTimePicker = (_b52 = (_a52 = DateTimePicker$1) == null ? void 0 : _a52.default) != null ? _b52 : DateTimePicker$1;
|
|
2964
|
+
var _a53, _b53;
|
|
2965
|
+
var TimePicker = (_b53 = (_a53 = TimePicker$1) == null ? void 0 : _a53.default) != null ? _b53 : TimePicker$1;
|
|
2966
|
+
var BaseDatePicker = (_a126) => {
|
|
2967
|
+
var _b126 = _a126, {
|
|
2708
2968
|
type = "single",
|
|
2709
2969
|
name,
|
|
2710
2970
|
control,
|
|
@@ -2722,7 +2982,7 @@ var BaseDatePicker = (_a120) => {
|
|
|
2722
2982
|
sx = {},
|
|
2723
2983
|
onChange: onChangeCustom = () => {
|
|
2724
2984
|
}
|
|
2725
|
-
} =
|
|
2985
|
+
} = _b126, props = __objRest(_b126, [
|
|
2726
2986
|
"type",
|
|
2727
2987
|
"name",
|
|
2728
2988
|
"control",
|
|
@@ -2740,13 +3000,13 @@ var BaseDatePicker = (_a120) => {
|
|
|
2740
3000
|
"sx",
|
|
2741
3001
|
"onChange"
|
|
2742
3002
|
]);
|
|
2743
|
-
var
|
|
3003
|
+
var _a127, _b127, _c, _d, _e, _f;
|
|
2744
3004
|
const { field, formState } = useController({
|
|
2745
3005
|
name,
|
|
2746
3006
|
control,
|
|
2747
3007
|
defaultValue
|
|
2748
3008
|
});
|
|
2749
|
-
const errorMessage = (_c = (
|
|
3009
|
+
const errorMessage = (_c = (_b127 = (_a127 = formState.errors) == null ? void 0 : _a127[name]) == null ? void 0 : _b127.message) == null ? void 0 : _c.toString();
|
|
2750
3010
|
const [open, setOpen] = useState(false);
|
|
2751
3011
|
const inputRef = useRef(null);
|
|
2752
3012
|
const [rangeValue, setRangeValue] = useState(
|
|
@@ -2812,15 +3072,15 @@ var BaseDatePicker = (_a120) => {
|
|
|
2812
3072
|
}
|
|
2813
3073
|
}, [type, format]);
|
|
2814
3074
|
const LabelSection = () => {
|
|
2815
|
-
var
|
|
3075
|
+
var _a128;
|
|
2816
3076
|
if (!title && !subtitle) return null;
|
|
2817
|
-
return /* @__PURE__ */ jsxs(
|
|
2818
|
-
title && /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { fontWeight: 600, color: !!((
|
|
3077
|
+
return /* @__PURE__ */ jsxs(Box11, { sx: { display: "flex", gap: SpacingToken.spacing2, mb: "4px" }, children: [
|
|
3078
|
+
title && /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { fontWeight: 600, color: !!((_a128 = formState.errors) == null ? void 0 : _a128[name]) ? DerivedColor.color_text_danger : DerivedColor.color_text_default }, children: title }),
|
|
2819
3079
|
subtitle && /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { color: DerivedColor.color_text_subtle }, children: subtitle })
|
|
2820
3080
|
] });
|
|
2821
3081
|
};
|
|
2822
3082
|
if (type === "range") {
|
|
2823
|
-
return /* @__PURE__ */ jsxs(
|
|
3083
|
+
return /* @__PURE__ */ jsxs(Box11, { sx, children: [
|
|
2824
3084
|
/* @__PURE__ */ jsx(LabelSection, {}),
|
|
2825
3085
|
/* @__PURE__ */ jsx(
|
|
2826
3086
|
TextField,
|
|
@@ -2871,7 +3131,7 @@ var BaseDatePicker = (_a120) => {
|
|
|
2871
3131
|
endAdornment: /* @__PURE__ */ jsxs(InputAdornment, { position: "end", children: [
|
|
2872
3132
|
!!errorMessage && /* @__PURE__ */ jsx(IconAlertCircleFilled, { size: 18, color: PrimitiveColor.color_red_500 }),
|
|
2873
3133
|
/* @__PURE__ */ jsx(
|
|
2874
|
-
|
|
3134
|
+
IconButton5,
|
|
2875
3135
|
{
|
|
2876
3136
|
size: "small",
|
|
2877
3137
|
onClick: (e) => {
|
|
@@ -2917,7 +3177,7 @@ var BaseDatePicker = (_a120) => {
|
|
|
2917
3177
|
] });
|
|
2918
3178
|
}
|
|
2919
3179
|
const PickerComponent = (_e = pickerConfig.component) != null ? _e : DatePicker;
|
|
2920
|
-
return /* @__PURE__ */ jsxs(
|
|
3180
|
+
return /* @__PURE__ */ jsxs(Box11, { sx, children: [
|
|
2921
3181
|
/* @__PURE__ */ jsx(LabelSection, {}),
|
|
2922
3182
|
/* @__PURE__ */ jsx(
|
|
2923
3183
|
PickerComponent,
|
|
@@ -2936,7 +3196,7 @@ var BaseDatePicker = (_a120) => {
|
|
|
2936
3196
|
disableOpenPicker: openBy === "field",
|
|
2937
3197
|
components: {
|
|
2938
3198
|
OpenPickerIcon: () => /* @__PURE__ */ jsx(
|
|
2939
|
-
|
|
3199
|
+
IconButton5,
|
|
2940
3200
|
{
|
|
2941
3201
|
size: "small",
|
|
2942
3202
|
onClick: (e) => {
|
|
@@ -2954,7 +3214,7 @@ var BaseDatePicker = (_a120) => {
|
|
|
2954
3214
|
onChangeCustom(newValue);
|
|
2955
3215
|
},
|
|
2956
3216
|
renderInput: (params) => {
|
|
2957
|
-
var
|
|
3217
|
+
var _a128;
|
|
2958
3218
|
return /* @__PURE__ */ jsx(
|
|
2959
3219
|
TextField,
|
|
2960
3220
|
__spreadProps(__spreadValues({}, params), {
|
|
@@ -3000,7 +3260,7 @@ var BaseDatePicker = (_a120) => {
|
|
|
3000
3260
|
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3001
3261
|
!!errorMessage && /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(IconAlertCircleFilled, { size: 18, color: DerivedColor.color_icon_danger }) }),
|
|
3002
3262
|
clearable && field.value && /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(
|
|
3003
|
-
|
|
3263
|
+
IconButton5,
|
|
3004
3264
|
{
|
|
3005
3265
|
size: "small",
|
|
3006
3266
|
onClick: handleClear,
|
|
@@ -3008,7 +3268,7 @@ var BaseDatePicker = (_a120) => {
|
|
|
3008
3268
|
children: /* @__PURE__ */ jsx(CloseIconRaw, { fontSize: "small" })
|
|
3009
3269
|
}
|
|
3010
3270
|
) }),
|
|
3011
|
-
(
|
|
3271
|
+
(_a128 = params.InputProps) == null ? void 0 : _a128.endAdornment
|
|
3012
3272
|
] })
|
|
3013
3273
|
})
|
|
3014
3274
|
})
|
|
@@ -3018,12 +3278,12 @@ var BaseDatePicker = (_a120) => {
|
|
|
3018
3278
|
)
|
|
3019
3279
|
] });
|
|
3020
3280
|
};
|
|
3021
|
-
var
|
|
3022
|
-
var
|
|
3023
|
-
var
|
|
3024
|
-
var
|
|
3025
|
-
var
|
|
3026
|
-
var Typography2 = (
|
|
3281
|
+
var _a54, _b54;
|
|
3282
|
+
var Box12 = (_b54 = (_a54 = BoxRaw) == null ? void 0 : _a54.default) != null ? _b54 : BoxRaw;
|
|
3283
|
+
var _a55, _b55;
|
|
3284
|
+
var Chip2 = (_b55 = (_a55 = ChipRaw) == null ? void 0 : _a55.default) != null ? _b55 : ChipRaw;
|
|
3285
|
+
var _a56, _b56;
|
|
3286
|
+
var Typography2 = (_b56 = (_a56 = MuiTypographyRaw) == null ? void 0 : _a56.default) != null ? _b56 : MuiTypographyRaw;
|
|
3027
3287
|
var CheckboxOption = (props) => {
|
|
3028
3288
|
const { isSelected, label, selectOption, data } = props;
|
|
3029
3289
|
const handleChange = () => {
|
|
@@ -3039,8 +3299,8 @@ var CheckboxOption = (props) => {
|
|
|
3039
3299
|
}
|
|
3040
3300
|
) }));
|
|
3041
3301
|
};
|
|
3042
|
-
var BaseDropdown = (
|
|
3043
|
-
var
|
|
3302
|
+
var BaseDropdown = (_a126) => {
|
|
3303
|
+
var _b126 = _a126, {
|
|
3044
3304
|
name = "",
|
|
3045
3305
|
control,
|
|
3046
3306
|
options = [],
|
|
@@ -3064,7 +3324,7 @@ var BaseDropdown = (_a120) => {
|
|
|
3064
3324
|
],
|
|
3065
3325
|
variant = "select",
|
|
3066
3326
|
sx = {}
|
|
3067
|
-
} =
|
|
3327
|
+
} = _b126, props = __objRest(_b126, [
|
|
3068
3328
|
"name",
|
|
3069
3329
|
"control",
|
|
3070
3330
|
"options",
|
|
@@ -3083,14 +3343,14 @@ var BaseDropdown = (_a120) => {
|
|
|
3083
3343
|
"variant",
|
|
3084
3344
|
"sx"
|
|
3085
3345
|
]);
|
|
3086
|
-
var
|
|
3346
|
+
var _a127;
|
|
3087
3347
|
const { field, formState } = useController({
|
|
3088
3348
|
name,
|
|
3089
3349
|
control,
|
|
3090
3350
|
defaultValue: defaultValue != null ? defaultValue : variant === "checkbox" || isMulti ? [] : null
|
|
3091
3351
|
});
|
|
3092
|
-
const SelectComponent = loadOptions ? AsyncSelect :
|
|
3093
|
-
const hasError = !!((
|
|
3352
|
+
const SelectComponent = loadOptions ? AsyncSelect : Select2;
|
|
3353
|
+
const hasError = !!((_a127 = formState.errors) == null ? void 0 : _a127[name]);
|
|
3094
3354
|
const selectedValues = Array.isArray(field.value) ? field.value : field.value ? [field.value] : [];
|
|
3095
3355
|
const isCheckboxMode = variant === "checkbox";
|
|
3096
3356
|
const selectAllChecked = showSelectAll && selectedValues.length === options.length && options.length > 0;
|
|
@@ -3099,9 +3359,9 @@ var BaseDropdown = (_a120) => {
|
|
|
3099
3359
|
field.onChange(checked ? options : []);
|
|
3100
3360
|
};
|
|
3101
3361
|
const handleChange = (val) => {
|
|
3102
|
-
var
|
|
3362
|
+
var _a128;
|
|
3103
3363
|
field.onChange(val);
|
|
3104
|
-
(
|
|
3364
|
+
(_a128 = props.onChange) == null ? void 0 : _a128.call(props, val);
|
|
3105
3365
|
};
|
|
3106
3366
|
const customStyles = {
|
|
3107
3367
|
control: (base, state) => __spreadValues(__spreadProps(__spreadValues({}, base), {
|
|
@@ -3131,7 +3391,7 @@ var BaseDropdown = (_a120) => {
|
|
|
3131
3391
|
})
|
|
3132
3392
|
};
|
|
3133
3393
|
return /* @__PURE__ */ jsxs(
|
|
3134
|
-
|
|
3394
|
+
Box12,
|
|
3135
3395
|
{
|
|
3136
3396
|
sx: __spreadValues({
|
|
3137
3397
|
width: "100%",
|
|
@@ -3140,8 +3400,8 @@ var BaseDropdown = (_a120) => {
|
|
|
3140
3400
|
gap: SpacingToken.spacing2
|
|
3141
3401
|
}, sx),
|
|
3142
3402
|
children: [
|
|
3143
|
-
(title || subtitle || showSelectAll) && /* @__PURE__ */ jsxs(
|
|
3144
|
-
/* @__PURE__ */ jsxs(
|
|
3403
|
+
(title || subtitle || showSelectAll) && /* @__PURE__ */ jsxs(Box12, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
3404
|
+
/* @__PURE__ */ jsxs(Box12, { sx: { display: "flex", alignItems: "center", gap: SpacingToken.spacing2 }, children: [
|
|
3145
3405
|
title && /* @__PURE__ */ jsx(Typography2, { variant: "body2", sx: { fontWeight: 600, fontSize: 14, color: hasError ? DerivedColor.color_text_danger : DerivedColor.color_text_default }, children: title }),
|
|
3146
3406
|
subtitle && /* @__PURE__ */ jsx(Typography2, { variant: "body2", sx: { fontSize: 14, color: DerivedColor.color_text_subtle }, children: subtitle })
|
|
3147
3407
|
] }),
|
|
@@ -3180,8 +3440,8 @@ var BaseDropdown = (_a120) => {
|
|
|
3180
3440
|
}
|
|
3181
3441
|
})
|
|
3182
3442
|
),
|
|
3183
|
-
showChip && isMulti && !isCheckboxMode && /* @__PURE__ */ jsx(
|
|
3184
|
-
|
|
3443
|
+
showChip && isMulti && !isCheckboxMode && /* @__PURE__ */ jsx(Box12, { sx: { display: "flex", flexWrap: "wrap", gap: 1, mt: 1 }, children: selectedValues.map((option) => /* @__PURE__ */ jsx(
|
|
3444
|
+
Chip2,
|
|
3185
3445
|
{
|
|
3186
3446
|
label: option.label,
|
|
3187
3447
|
size: "small",
|
|
@@ -3210,8 +3470,8 @@ var BaseDropdown = (_a120) => {
|
|
|
3210
3470
|
}
|
|
3211
3471
|
);
|
|
3212
3472
|
};
|
|
3213
|
-
var
|
|
3214
|
-
var
|
|
3473
|
+
var _a57, _b57;
|
|
3474
|
+
var Box13 = (_b57 = (_a57 = BoxRaw) == null ? void 0 : _a57.default) != null ? _b57 : BoxRaw;
|
|
3215
3475
|
var BaseDropzone = ({
|
|
3216
3476
|
autoUpload = false,
|
|
3217
3477
|
settings = {
|
|
@@ -3263,7 +3523,7 @@ var BaseDropzone = ({
|
|
|
3263
3523
|
processedCount++;
|
|
3264
3524
|
if (processedCount === acceptedFiles.length) {
|
|
3265
3525
|
setFiles((prevFiles) => {
|
|
3266
|
-
var
|
|
3526
|
+
var _a126;
|
|
3267
3527
|
let updated;
|
|
3268
3528
|
if (settings.maxFiles === 1) {
|
|
3269
3529
|
updated = tempFiles.slice(0, 1);
|
|
@@ -3274,7 +3534,7 @@ var BaseDropzone = ({
|
|
|
3274
3534
|
);
|
|
3275
3535
|
}
|
|
3276
3536
|
if (autoUpload) {
|
|
3277
|
-
(
|
|
3537
|
+
(_a126 = callbacks == null ? void 0 : callbacks.uploadFile) == null ? void 0 : _a126.call(callbacks, updated);
|
|
3278
3538
|
}
|
|
3279
3539
|
return updated;
|
|
3280
3540
|
});
|
|
@@ -3283,8 +3543,8 @@ var BaseDropzone = ({
|
|
|
3283
3543
|
});
|
|
3284
3544
|
};
|
|
3285
3545
|
const handleRejected = (rejections) => {
|
|
3286
|
-
var
|
|
3287
|
-
const error = (_c = (
|
|
3546
|
+
var _a126, _b126, _c;
|
|
3547
|
+
const error = (_c = (_b126 = (_a126 = rejections == null ? void 0 : rejections[0]) == null ? void 0 : _a126.errors) == null ? void 0 : _b126[0]) == null ? void 0 : _c.code;
|
|
3288
3548
|
if (error === "file-too-large") {
|
|
3289
3549
|
setErrorMessage(
|
|
3290
3550
|
"Ukuran file terlalu besar. Maksimal " + settings.maxSize + "MB."
|
|
@@ -3298,12 +3558,12 @@ var BaseDropzone = ({
|
|
|
3298
3558
|
}
|
|
3299
3559
|
};
|
|
3300
3560
|
const removeFile = (index) => {
|
|
3301
|
-
var
|
|
3561
|
+
var _a126, _b126;
|
|
3302
3562
|
const removedFile = files[index];
|
|
3303
3563
|
const updated = files.filter((_, i) => i !== index);
|
|
3304
3564
|
setFiles(updated);
|
|
3305
|
-
(
|
|
3306
|
-
(
|
|
3565
|
+
(_a126 = callbacks == null ? void 0 : callbacks.removeFile) == null ? void 0 : _a126.call(callbacks, removedFile == null ? void 0 : removedFile.originName);
|
|
3566
|
+
(_b126 = callbacks == null ? void 0 : callbacks.uploadFile) == null ? void 0 : _b126.call(callbacks, updated);
|
|
3307
3567
|
};
|
|
3308
3568
|
useEffect(() => {
|
|
3309
3569
|
if (callbacks == null ? void 0 : callbacks.customError) {
|
|
@@ -3311,19 +3571,19 @@ var BaseDropzone = ({
|
|
|
3311
3571
|
}
|
|
3312
3572
|
}, [callbacks == null ? void 0 : callbacks.customError]);
|
|
3313
3573
|
const renderFileIcon = (file) => {
|
|
3314
|
-
var
|
|
3315
|
-
if ((
|
|
3316
|
-
if ((
|
|
3574
|
+
var _a126, _b126, _c;
|
|
3575
|
+
if ((_a126 = file.type) == null ? void 0 : _a126.includes("pdf")) return /* @__PURE__ */ jsx(FilePDFHero, {});
|
|
3576
|
+
if ((_b126 = file.type) == null ? void 0 : _b126.includes("csv")) return /* @__PURE__ */ jsx(FileCSVHero, {});
|
|
3317
3577
|
if ((_c = file.type) == null ? void 0 : _c.includes("image")) return /* @__PURE__ */ jsx(FileJPGHero, {});
|
|
3318
3578
|
return /* @__PURE__ */ jsx(FileJPGHero, {});
|
|
3319
3579
|
};
|
|
3320
3580
|
const PreviewGrid = () => /* @__PURE__ */ jsx(
|
|
3321
|
-
|
|
3581
|
+
Box13,
|
|
3322
3582
|
{
|
|
3323
3583
|
sx: { width: "100%", display: "flex", gap: 2, mt: 3, flexWrap: "wrap" },
|
|
3324
|
-
children: files.map((file, index) => /* @__PURE__ */ jsxs(
|
|
3584
|
+
children: files.map((file, index) => /* @__PURE__ */ jsxs(Box13, { sx: { position: "relative", width: 75 }, children: [
|
|
3325
3585
|
/* @__PURE__ */ jsx(
|
|
3326
|
-
|
|
3586
|
+
Box13,
|
|
3327
3587
|
{
|
|
3328
3588
|
sx: {
|
|
3329
3589
|
position: "absolute",
|
|
@@ -3337,7 +3597,7 @@ var BaseDropzone = ({
|
|
|
3337
3597
|
),
|
|
3338
3598
|
renderFileIcon(file),
|
|
3339
3599
|
/* @__PURE__ */ jsx(
|
|
3340
|
-
|
|
3600
|
+
Box13,
|
|
3341
3601
|
{
|
|
3342
3602
|
sx: __spreadProps(__spreadValues({}, VariantStyles.caption_regular), {
|
|
3343
3603
|
mt: 1,
|
|
@@ -3351,8 +3611,8 @@ var BaseDropzone = ({
|
|
|
3351
3611
|
] }, index))
|
|
3352
3612
|
}
|
|
3353
3613
|
);
|
|
3354
|
-
const PreviewList = () => /* @__PURE__ */ jsx(
|
|
3355
|
-
|
|
3614
|
+
const PreviewList = () => /* @__PURE__ */ jsx(Box13, { sx: { mt: 3 }, children: files.map((file, index) => /* @__PURE__ */ jsxs(
|
|
3615
|
+
Box13,
|
|
3356
3616
|
{
|
|
3357
3617
|
sx: {
|
|
3358
3618
|
display: "flex",
|
|
@@ -3364,10 +3624,10 @@ var BaseDropzone = ({
|
|
|
3364
3624
|
mb: 2
|
|
3365
3625
|
},
|
|
3366
3626
|
children: [
|
|
3367
|
-
/* @__PURE__ */ jsxs(
|
|
3627
|
+
/* @__PURE__ */ jsxs(Box13, { sx: { display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
3368
3628
|
renderFileIcon(file),
|
|
3369
3629
|
/* @__PURE__ */ jsx(
|
|
3370
|
-
|
|
3630
|
+
Box13,
|
|
3371
3631
|
{
|
|
3372
3632
|
sx: __spreadProps(__spreadValues({}, VariantStyles.body2_regular), {
|
|
3373
3633
|
maxWidth: 260,
|
|
@@ -3379,14 +3639,14 @@ var BaseDropzone = ({
|
|
|
3379
3639
|
}
|
|
3380
3640
|
)
|
|
3381
3641
|
] }),
|
|
3382
|
-
/* @__PURE__ */ jsx(
|
|
3642
|
+
/* @__PURE__ */ jsx(Box13, { sx: { cursor: "pointer" }, onClick: () => removeFile(index), children: /* @__PURE__ */ jsx(IconTrash, { size: 20, color: PrimitiveColor.color_red_500 }) })
|
|
3383
3643
|
]
|
|
3384
3644
|
},
|
|
3385
3645
|
index
|
|
3386
3646
|
)) });
|
|
3387
|
-
return /* @__PURE__ */ jsxs(
|
|
3647
|
+
return /* @__PURE__ */ jsxs(Box13, { children: [
|
|
3388
3648
|
labels.title && /* @__PURE__ */ jsx(
|
|
3389
|
-
|
|
3649
|
+
Box13,
|
|
3390
3650
|
{
|
|
3391
3651
|
sx: __spreadProps(__spreadValues({}, VariantStyles.body1_regular), {
|
|
3392
3652
|
fontSize: 14,
|
|
@@ -3399,7 +3659,7 @@ var BaseDropzone = ({
|
|
|
3399
3659
|
}
|
|
3400
3660
|
),
|
|
3401
3661
|
/* @__PURE__ */ jsx(
|
|
3402
|
-
|
|
3662
|
+
Box13,
|
|
3403
3663
|
{
|
|
3404
3664
|
sx: {
|
|
3405
3665
|
border: `2px ${files.length ? "solid" : "dashed"} ${isError ? DerivedColor.color_border_danger : files.length ? DerivedColor.color_border_brand_primary : DerivedColor.color_border_default}`,
|
|
@@ -3421,7 +3681,7 @@ var BaseDropzone = ({
|
|
|
3421
3681
|
accept: settings.allowedExtensions,
|
|
3422
3682
|
multiple: !isSingle,
|
|
3423
3683
|
children: ({ getRootProps, getInputProps }) => /* @__PURE__ */ jsxs(
|
|
3424
|
-
|
|
3684
|
+
Box13,
|
|
3425
3685
|
__spreadProps(__spreadValues({}, getRootProps()), {
|
|
3426
3686
|
sx: {
|
|
3427
3687
|
cursor: "pointer",
|
|
@@ -3435,9 +3695,9 @@ var BaseDropzone = ({
|
|
|
3435
3695
|
children: [
|
|
3436
3696
|
/* @__PURE__ */ jsx("input", __spreadValues({}, getInputProps())),
|
|
3437
3697
|
/* @__PURE__ */ jsx(IconUpload$1, { size: 32, color: DerivedColor.color_icon_brand_primary }),
|
|
3438
|
-
/* @__PURE__ */ jsx(
|
|
3698
|
+
/* @__PURE__ */ jsx(Box13, { sx: __spreadProps(__spreadValues({}, VariantStyles.header1_semibold), { mt: 1 }), children: labels.dropzoneTitle }),
|
|
3439
3699
|
/* @__PURE__ */ jsx(
|
|
3440
|
-
|
|
3700
|
+
Box13,
|
|
3441
3701
|
{
|
|
3442
3702
|
sx: __spreadProps(__spreadValues({}, VariantStyles.body1_regular), {
|
|
3443
3703
|
color: PrimitiveColor.color_neutral_600,
|
|
@@ -3456,7 +3716,7 @@ var BaseDropzone = ({
|
|
|
3456
3716
|
}
|
|
3457
3717
|
),
|
|
3458
3718
|
labels.allowedFileLabel && /* @__PURE__ */ jsx(
|
|
3459
|
-
|
|
3719
|
+
Box13,
|
|
3460
3720
|
{
|
|
3461
3721
|
sx: __spreadProps(__spreadValues({}, VariantStyles.caption_regular), {
|
|
3462
3722
|
color: PrimitiveColor.color_neutral_600,
|
|
@@ -3476,7 +3736,7 @@ var BaseDropzone = ({
|
|
|
3476
3736
|
),
|
|
3477
3737
|
files.length > 0 && (settings.previewType === "list" ? /* @__PURE__ */ jsx(PreviewList, {}) : /* @__PURE__ */ jsx(PreviewGrid, {})),
|
|
3478
3738
|
isError && /* @__PURE__ */ jsxs(
|
|
3479
|
-
|
|
3739
|
+
Box13,
|
|
3480
3740
|
{
|
|
3481
3741
|
sx: __spreadProps(__spreadValues({
|
|
3482
3742
|
display: "flex",
|
|
@@ -3495,18 +3755,18 @@ var BaseDropzone = ({
|
|
|
3495
3755
|
)
|
|
3496
3756
|
] });
|
|
3497
3757
|
};
|
|
3498
|
-
var
|
|
3499
|
-
var Radio = (
|
|
3500
|
-
var
|
|
3501
|
-
var RadioGroup = (
|
|
3502
|
-
var
|
|
3503
|
-
var FormControlLabel2 = (
|
|
3504
|
-
var
|
|
3505
|
-
var FormControl = (
|
|
3506
|
-
var
|
|
3507
|
-
var
|
|
3508
|
-
var BaseRadioButton = (
|
|
3509
|
-
var
|
|
3758
|
+
var _a58, _b58;
|
|
3759
|
+
var Radio = (_b58 = (_a58 = RadioRaw) == null ? void 0 : _a58.default) != null ? _b58 : RadioRaw;
|
|
3760
|
+
var _a59, _b59;
|
|
3761
|
+
var RadioGroup = (_b59 = (_a59 = RadioGroupRaw) == null ? void 0 : _a59.default) != null ? _b59 : RadioGroupRaw;
|
|
3762
|
+
var _a60, _b60;
|
|
3763
|
+
var FormControlLabel2 = (_b60 = (_a60 = FormControlLabelRaw) == null ? void 0 : _a60.default) != null ? _b60 : FormControlLabelRaw;
|
|
3764
|
+
var _a61, _b61;
|
|
3765
|
+
var FormControl = (_b61 = (_a61 = FormControlRaw) == null ? void 0 : _a61.default) != null ? _b61 : FormControlRaw;
|
|
3766
|
+
var _a62, _b62;
|
|
3767
|
+
var Box14 = (_b62 = (_a62 = BoxRaw) == null ? void 0 : _a62.default) != null ? _b62 : BoxRaw;
|
|
3768
|
+
var BaseRadioButton = (_a126) => {
|
|
3769
|
+
var _b126 = _a126, {
|
|
3510
3770
|
name = "",
|
|
3511
3771
|
control = null,
|
|
3512
3772
|
defaultValue,
|
|
@@ -3517,7 +3777,7 @@ var BaseRadioButton = (_a120) => {
|
|
|
3517
3777
|
isDisabled: isDisabled,
|
|
3518
3778
|
useErrorStateHelper: useErrorStateHelper = false,
|
|
3519
3779
|
sx: sx = {}
|
|
3520
|
-
} =
|
|
3780
|
+
} = _b126, restProps = __objRest(_b126, [
|
|
3521
3781
|
"name",
|
|
3522
3782
|
"control",
|
|
3523
3783
|
"defaultValue",
|
|
@@ -3535,10 +3795,10 @@ var BaseRadioButton = (_a120) => {
|
|
|
3535
3795
|
/* ================= SX ================= */
|
|
3536
3796
|
"sx"
|
|
3537
3797
|
]);
|
|
3538
|
-
var
|
|
3798
|
+
var _a127, _b127, _c, _d, _e, _f;
|
|
3539
3799
|
const { field, formState } = useController({ control, name, defaultValue });
|
|
3540
3800
|
const errorObject = useErrorStateHelper ? errorState(name, formState.errors) : null;
|
|
3541
|
-
const errorMessage = ((
|
|
3801
|
+
const errorMessage = ((_a127 = errorObject == null ? void 0 : errorObject.message) == null ? void 0 : _a127.toString()) || ((_c = (_b127 = formState.errors) == null ? void 0 : _b127[name]) == null ? void 0 : _c.message);
|
|
3542
3802
|
const radioColor = PrimitiveColor.color_blue_cakrawala_500;
|
|
3543
3803
|
const gapValue = (_d = SpacingToken) == null ? void 0 : _d.spacing0;
|
|
3544
3804
|
const isHorizontal = orientation === "horizontal";
|
|
@@ -3551,7 +3811,7 @@ var BaseRadioButton = (_a120) => {
|
|
|
3551
3811
|
py: SpacingToken.spacing0,
|
|
3552
3812
|
borderRadius: Radius.radius_2
|
|
3553
3813
|
};
|
|
3554
|
-
return /* @__PURE__ */ jsxs(
|
|
3814
|
+
return /* @__PURE__ */ jsxs(Box14, { sx, children: [
|
|
3555
3815
|
title && /* @__PURE__ */ jsx(
|
|
3556
3816
|
BaseTypography,
|
|
3557
3817
|
{
|
|
@@ -3574,13 +3834,15 @@ var BaseRadioButton = (_a120) => {
|
|
|
3574
3834
|
sx: { gap: gapValue }
|
|
3575
3835
|
}, restProps), {
|
|
3576
3836
|
children: options.length > 0 ? options.map((item, index) => {
|
|
3577
|
-
var
|
|
3837
|
+
var _b128, _c2, _d2, _e2;
|
|
3838
|
+
const _a128 = item, { isDisabled: itemDisabled, disabled: itemNativeDisabled, value, label } = _a128, itemRest = __objRest(_a128, ["isDisabled", "disabled", "value", "label"]);
|
|
3839
|
+
const optionDisabled = (_c2 = (_b128 = isDisabled != null ? isDisabled : itemDisabled) != null ? _b128 : itemNativeDisabled) != null ? _c2 : false;
|
|
3578
3840
|
return /* @__PURE__ */ jsx(
|
|
3579
3841
|
FormControlLabel2,
|
|
3580
3842
|
__spreadValues({
|
|
3581
|
-
value
|
|
3582
|
-
label
|
|
3583
|
-
disabled:
|
|
3843
|
+
value,
|
|
3844
|
+
label,
|
|
3845
|
+
disabled: optionDisabled,
|
|
3584
3846
|
sx: __spreadProps(__spreadValues({}, radioItemSx), {
|
|
3585
3847
|
"& .MuiFormControlLabel-label": {
|
|
3586
3848
|
fontSize: "14px"
|
|
@@ -3591,9 +3853,9 @@ var BaseRadioButton = (_a120) => {
|
|
|
3591
3853
|
{
|
|
3592
3854
|
sx: {
|
|
3593
3855
|
"&.Mui-checked": {
|
|
3594
|
-
color: !!((
|
|
3856
|
+
color: !!((_d2 = formState.errors) == null ? void 0 : _d2[name]) ? DerivedColor.color_text_danger : radioColor
|
|
3595
3857
|
},
|
|
3596
|
-
color: !!((
|
|
3858
|
+
color: !!((_e2 = formState.errors) == null ? void 0 : _e2[name]) ? DerivedColor.color_text_danger : void 0,
|
|
3597
3859
|
"&.Mui-disabled": {
|
|
3598
3860
|
color: PrimitiveColor.color_neutral_400
|
|
3599
3861
|
},
|
|
@@ -3603,7 +3865,7 @@ var BaseRadioButton = (_a120) => {
|
|
|
3603
3865
|
}
|
|
3604
3866
|
}
|
|
3605
3867
|
)
|
|
3606
|
-
},
|
|
3868
|
+
}, itemRest),
|
|
3607
3869
|
`radio-item-${index}`
|
|
3608
3870
|
);
|
|
3609
3871
|
}) : "You must provide options props"
|
|
@@ -3613,28 +3875,28 @@ var BaseRadioButton = (_a120) => {
|
|
|
3613
3875
|
] })
|
|
3614
3876
|
] });
|
|
3615
3877
|
};
|
|
3616
|
-
var _a57, _b57;
|
|
3617
|
-
var Check = (_b57 = (_a57 = CheckRaw) == null ? void 0 : _a57.default) != null ? _b57 : CheckRaw;
|
|
3618
|
-
var _a58, _b58;
|
|
3619
|
-
var CheckIcon = (_b58 = (_a58 = CheckRaw) == null ? void 0 : _a58.default) != null ? _b58 : CheckRaw;
|
|
3620
|
-
var _a59, _b59;
|
|
3621
|
-
var StepLabel = (_b59 = (_a59 = StepLabelRaw) == null ? void 0 : _a59.default) != null ? _b59 : StepLabelRaw;
|
|
3622
|
-
var _a60, _b60;
|
|
3623
|
-
var StepConnector = (_b60 = (_a60 = StepConnectorRaw) == null ? void 0 : _a60.default) != null ? _b60 : StepConnectorRaw;
|
|
3624
|
-
var _a61, _b61;
|
|
3625
|
-
var Step = (_b61 = (_a61 = StepRaw) == null ? void 0 : _a61.default) != null ? _b61 : StepRaw;
|
|
3626
|
-
var _a62, _b62;
|
|
3627
|
-
var Stepper = (_b62 = (_a62 = StepperRaw) == null ? void 0 : _a62.default) != null ? _b62 : StepperRaw;
|
|
3628
3878
|
var _a63, _b63;
|
|
3629
|
-
var
|
|
3879
|
+
var Check = (_b63 = (_a63 = CheckRaw) == null ? void 0 : _a63.default) != null ? _b63 : CheckRaw;
|
|
3630
3880
|
var _a64, _b64;
|
|
3631
|
-
var
|
|
3881
|
+
var CheckIcon = (_b64 = (_a64 = CheckRaw) == null ? void 0 : _a64.default) != null ? _b64 : CheckRaw;
|
|
3632
3882
|
var _a65, _b65;
|
|
3633
|
-
var
|
|
3883
|
+
var StepLabel = (_b65 = (_a65 = StepLabelRaw) == null ? void 0 : _a65.default) != null ? _b65 : StepLabelRaw;
|
|
3634
3884
|
var _a66, _b66;
|
|
3635
|
-
var
|
|
3885
|
+
var StepConnector = (_b66 = (_a66 = StepConnectorRaw) == null ? void 0 : _a66.default) != null ? _b66 : StepConnectorRaw;
|
|
3636
3886
|
var _a67, _b67;
|
|
3637
|
-
var
|
|
3887
|
+
var Step = (_b67 = (_a67 = StepRaw) == null ? void 0 : _a67.default) != null ? _b67 : StepRaw;
|
|
3888
|
+
var _a68, _b68;
|
|
3889
|
+
var Stepper = (_b68 = (_a68 = StepperRaw) == null ? void 0 : _a68.default) != null ? _b68 : StepperRaw;
|
|
3890
|
+
var _a69, _b69;
|
|
3891
|
+
var Stack = (_b69 = (_a69 = StackRaw) == null ? void 0 : _a69.default) != null ? _b69 : StackRaw;
|
|
3892
|
+
var _a70, _b70;
|
|
3893
|
+
var Box15 = (_b70 = (_a70 = BoxRaw) == null ? void 0 : _a70.default) != null ? _b70 : BoxRaw;
|
|
3894
|
+
var _a71, _b71;
|
|
3895
|
+
var Typography3 = (_b71 = (_a71 = MuiTypographyRaw) == null ? void 0 : _a71.default) != null ? _b71 : MuiTypographyRaw;
|
|
3896
|
+
var _a72, _b72;
|
|
3897
|
+
var Button = (_b72 = (_a72 = ButtonRaw) == null ? void 0 : _a72.default) != null ? _b72 : ButtonRaw;
|
|
3898
|
+
var _a73, _b73;
|
|
3899
|
+
var Tooltip = (_b73 = (_a73 = TooltipRaw) == null ? void 0 : _a73.default) != null ? _b73 : TooltipRaw;
|
|
3638
3900
|
var CustomStepLabel = styled(StepLabel)(({ orientation }) => __spreadValues(__spreadProps(__spreadValues({}, orientation === "vertical" && {
|
|
3639
3901
|
alignItems: "flex-start",
|
|
3640
3902
|
"& .MuiStepLabel-labelContainer": {
|
|
@@ -3753,8 +4015,8 @@ var CustomProcessIcon = styled(CheckIcon)({
|
|
|
3753
4015
|
justifyContent: "center",
|
|
3754
4016
|
alignItems: "center"
|
|
3755
4017
|
});
|
|
3756
|
-
var HtmlTooltip = styled((
|
|
3757
|
-
var
|
|
4018
|
+
var HtmlTooltip = styled((_a126) => {
|
|
4019
|
+
var _b126 = _a126, { className } = _b126, props = __objRest(_b126, ["className"]);
|
|
3758
4020
|
return /* @__PURE__ */ jsx(Tooltip, __spreadProps(__spreadValues({}, props), { classes: { popper: className } }));
|
|
3759
4021
|
})(() => ({
|
|
3760
4022
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
@@ -3782,7 +4044,7 @@ var BaseStepper = ({
|
|
|
3782
4044
|
connector: /* @__PURE__ */ jsx(ColorlibConnector, { orientation }),
|
|
3783
4045
|
orientation,
|
|
3784
4046
|
children: steps == null ? void 0 : steps.map((step, index) => {
|
|
3785
|
-
var
|
|
4047
|
+
var _a126;
|
|
3786
4048
|
return /* @__PURE__ */ jsx(Step, { children: /* @__PURE__ */ jsx(
|
|
3787
4049
|
StepLabel,
|
|
3788
4050
|
{
|
|
@@ -3792,9 +4054,9 @@ var BaseStepper = ({
|
|
|
3792
4054
|
{
|
|
3793
4055
|
title: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
3794
4056
|
/* @__PURE__ */ jsx(Typography3, { color: "inherit", children: step == null ? void 0 : step.title }),
|
|
3795
|
-
(
|
|
3796
|
-
(list == null ? void 0 : list.is_done) === 1 ? /* @__PURE__ */ jsx(
|
|
3797
|
-
/* @__PURE__ */ jsx(
|
|
4057
|
+
(_a126 = step == null ? void 0 : step.sublist) == null ? void 0 : _a126.map((list, subIndex) => /* @__PURE__ */ jsx(Box15, { sx: { display: "grid", gap: 1, mt: 0.5 }, children: /* @__PURE__ */ jsxs(Box15, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: [
|
|
4058
|
+
(list == null ? void 0 : list.is_done) === 1 ? /* @__PURE__ */ jsx(Box15, { sx: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx(CustomCheckIcon, {}) }) : /* @__PURE__ */ jsx(Box15, { sx: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx(CustomProcessIcon, {}) }),
|
|
4059
|
+
/* @__PURE__ */ jsx(Box15, { children: list == null ? void 0 : list.sublist_title })
|
|
3798
4060
|
] }) }, subIndex))
|
|
3799
4061
|
] }),
|
|
3800
4062
|
children: /* @__PURE__ */ jsx(
|
|
@@ -3817,7 +4079,7 @@ var BaseStepper = ({
|
|
|
3817
4079
|
}
|
|
3818
4080
|
) });
|
|
3819
4081
|
}
|
|
3820
|
-
return /* @__PURE__ */ jsx(
|
|
4082
|
+
return /* @__PURE__ */ jsx(Box15, { sx: __spreadValues({ width: "100%" }, sx), children: /* @__PURE__ */ jsx(
|
|
3821
4083
|
Stepper,
|
|
3822
4084
|
{
|
|
3823
4085
|
activeStep,
|
|
@@ -3831,7 +4093,7 @@ var BaseStepper = ({
|
|
|
3831
4093
|
if (isActive) statusColor = PrimitiveColor.color_blue_cakrawala_500;
|
|
3832
4094
|
if (isCompleted) statusColor = PrimitiveColor.color_green_500;
|
|
3833
4095
|
return /* @__PURE__ */ jsx(Step, { children: /* @__PURE__ */ jsx(CustomStepLabel, { orientation, children: /* @__PURE__ */ jsxs(
|
|
3834
|
-
|
|
4096
|
+
Box15,
|
|
3835
4097
|
{
|
|
3836
4098
|
sx: {
|
|
3837
4099
|
display: "flex",
|
|
@@ -3868,16 +4130,16 @@ BaseStepper.propTypes = {
|
|
|
3868
4130
|
variant: PropTypes3.oneOf(["simple", "dashboard"]),
|
|
3869
4131
|
sx: PropTypes3.object
|
|
3870
4132
|
};
|
|
3871
|
-
var
|
|
3872
|
-
var InputAdornment2 = (
|
|
3873
|
-
var
|
|
3874
|
-
var TextField2 = (
|
|
3875
|
-
var
|
|
3876
|
-
var
|
|
3877
|
-
var
|
|
3878
|
-
var Typography4 = (
|
|
3879
|
-
var BaseTextField = (
|
|
3880
|
-
var
|
|
4133
|
+
var _a74, _b74;
|
|
4134
|
+
var InputAdornment2 = (_b74 = (_a74 = InputAdornmentRaw) == null ? void 0 : _a74.default) != null ? _b74 : InputAdornmentRaw;
|
|
4135
|
+
var _a75, _b75;
|
|
4136
|
+
var TextField2 = (_b75 = (_a75 = TextFieldRaw) == null ? void 0 : _a75.default) != null ? _b75 : TextFieldRaw;
|
|
4137
|
+
var _a76, _b76;
|
|
4138
|
+
var Box16 = (_b76 = (_a76 = BoxRaw) == null ? void 0 : _a76.default) != null ? _b76 : BoxRaw;
|
|
4139
|
+
var _a77, _b77;
|
|
4140
|
+
var Typography4 = (_b77 = (_a77 = MuiTypographyRaw) == null ? void 0 : _a77.default) != null ? _b77 : MuiTypographyRaw;
|
|
4141
|
+
var BaseTextField = (_a126) => {
|
|
4142
|
+
var _b126 = _a126, {
|
|
3881
4143
|
name = "",
|
|
3882
4144
|
control = null,
|
|
3883
4145
|
defaultValue,
|
|
@@ -3898,7 +4160,7 @@ var BaseTextField = (_a120) => {
|
|
|
3898
4160
|
InputProps: externalInputProps,
|
|
3899
4161
|
inputProps: externalInputPropsLower,
|
|
3900
4162
|
sx = {}
|
|
3901
|
-
} =
|
|
4163
|
+
} = _b126, props = __objRest(_b126, [
|
|
3902
4164
|
"name",
|
|
3903
4165
|
"control",
|
|
3904
4166
|
"defaultValue",
|
|
@@ -3920,7 +4182,7 @@ var BaseTextField = (_a120) => {
|
|
|
3920
4182
|
"inputProps",
|
|
3921
4183
|
"sx"
|
|
3922
4184
|
]);
|
|
3923
|
-
var
|
|
4185
|
+
var _a127, _b127, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
3924
4186
|
const { field, formState } = useController({ control, name, defaultValue });
|
|
3925
4187
|
const inputRef = useRef(null);
|
|
3926
4188
|
const hasMask = !!textMask;
|
|
@@ -4013,12 +4275,12 @@ var BaseTextField = (_a120) => {
|
|
|
4013
4275
|
return new RegExp(`^[${allowedPattern}\\s]+$`);
|
|
4014
4276
|
};
|
|
4015
4277
|
const handleKeyDown = (e) => {
|
|
4016
|
-
var
|
|
4278
|
+
var _a128, _b128, _c2;
|
|
4017
4279
|
if (hasMask) {
|
|
4018
4280
|
const input = e.target;
|
|
4019
4281
|
const value = input.value || "";
|
|
4020
|
-
const selectionStart = (
|
|
4021
|
-
const selectionEnd = (
|
|
4282
|
+
const selectionStart = (_a128 = input.selectionStart) != null ? _a128 : value.length;
|
|
4283
|
+
const selectionEnd = (_b128 = input.selectionEnd) != null ? _b128 : value.length;
|
|
4022
4284
|
const allowedKeys2 = [
|
|
4023
4285
|
"Tab",
|
|
4024
4286
|
"Backspace",
|
|
@@ -4164,7 +4426,7 @@ var BaseTextField = (_a120) => {
|
|
|
4164
4426
|
}
|
|
4165
4427
|
};
|
|
4166
4428
|
const handlePaste = (e) => {
|
|
4167
|
-
var
|
|
4429
|
+
var _a128, _b128;
|
|
4168
4430
|
if (hasMask) {
|
|
4169
4431
|
if (isCantPaste) {
|
|
4170
4432
|
e.preventDefault();
|
|
@@ -4173,8 +4435,8 @@ var BaseTextField = (_a120) => {
|
|
|
4173
4435
|
const pastedData2 = e.clipboardData.getData("Text") || "";
|
|
4174
4436
|
const cleaned = sanitizeRaw(pastedData2);
|
|
4175
4437
|
const input = e.target;
|
|
4176
|
-
const selectionStart2 = (
|
|
4177
|
-
const selectionEnd2 = (
|
|
4438
|
+
const selectionStart2 = (_a128 = input.selectionStart) != null ? _a128 : 0;
|
|
4439
|
+
const selectionEnd2 = (_b128 = input.selectionEnd) != null ? _b128 : 0;
|
|
4178
4440
|
const currentRaw = sanitizeRaw(field.value).slice(0, maskSlots);
|
|
4179
4441
|
let rawArr = currentRaw.split("");
|
|
4180
4442
|
const xStart = (textMask.slice(0, selectionStart2).match(/x/gi) || []).length;
|
|
@@ -4247,22 +4509,22 @@ var BaseTextField = (_a120) => {
|
|
|
4247
4509
|
setDisplayValue(newDisplay);
|
|
4248
4510
|
field.onChange(raw);
|
|
4249
4511
|
requestAnimationFrame(() => {
|
|
4250
|
-
var
|
|
4512
|
+
var _a128;
|
|
4251
4513
|
try {
|
|
4252
4514
|
const caret = computeCaretFromRawLen(raw.length, textMask);
|
|
4253
|
-
(
|
|
4515
|
+
(_a128 = inputRef.current) == null ? void 0 : _a128.setSelectionRange(caret, caret);
|
|
4254
4516
|
} catch (e2) {
|
|
4255
4517
|
}
|
|
4256
4518
|
});
|
|
4257
4519
|
};
|
|
4258
|
-
return /* @__PURE__ */ jsxs(
|
|
4520
|
+
return /* @__PURE__ */ jsxs(Box16, { sx, children: [
|
|
4259
4521
|
props.title && /* @__PURE__ */ jsx(
|
|
4260
4522
|
Typography4,
|
|
4261
4523
|
{
|
|
4262
4524
|
variant: "body2",
|
|
4263
4525
|
sx: {
|
|
4264
4526
|
fontWeight: 600,
|
|
4265
|
-
color: !!((
|
|
4527
|
+
color: !!((_a127 = formState.errors) == null ? void 0 : _a127[name]) ? DerivedColor.color_text_danger : DerivedColor.color_text_default,
|
|
4266
4528
|
mb: "4px"
|
|
4267
4529
|
},
|
|
4268
4530
|
children: props.title
|
|
@@ -4274,10 +4536,10 @@ var BaseTextField = (_a120) => {
|
|
|
4274
4536
|
id: props.id || `field-${name}`,
|
|
4275
4537
|
variant: "outlined",
|
|
4276
4538
|
fullWidth: true,
|
|
4277
|
-
error: !!((
|
|
4539
|
+
error: !!((_b127 = formState.errors) == null ? void 0 : _b127[name]),
|
|
4278
4540
|
helperText: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4279
|
-
/* @__PURE__ */ jsx(
|
|
4280
|
-
maxLength && showCountHelper && /* @__PURE__ */ jsxs(
|
|
4541
|
+
/* @__PURE__ */ jsx(Box16, { component: "span", children: ((_d = (_c = formState.errors) == null ? void 0 : _c[name]) == null ? void 0 : _d.message) || (maxLength && showLength ? `Maksimal ${maxLength} Karakter` : "") }),
|
|
4542
|
+
maxLength && showCountHelper && /* @__PURE__ */ jsxs(Box16, { component: "span", sx: { ml: "auto" }, children: [
|
|
4281
4543
|
((_e = field.value) == null ? void 0 : _e.length) || 0,
|
|
4282
4544
|
"/",
|
|
4283
4545
|
maxLength
|
|
@@ -4346,18 +4608,18 @@ var BaseTextField = (_a120) => {
|
|
|
4346
4608
|
)
|
|
4347
4609
|
] });
|
|
4348
4610
|
};
|
|
4349
|
-
var
|
|
4350
|
-
var
|
|
4351
|
-
var
|
|
4352
|
-
var Button2 = (
|
|
4353
|
-
var
|
|
4354
|
-
var Input = (
|
|
4355
|
-
var
|
|
4356
|
-
var TextField3 = (
|
|
4357
|
-
var
|
|
4358
|
-
var Typography5 = (
|
|
4359
|
-
var
|
|
4360
|
-
var UploadFile = (
|
|
4611
|
+
var _a78, _b78;
|
|
4612
|
+
var Box17 = (_b78 = (_a78 = BoxRaw) == null ? void 0 : _a78.default) != null ? _b78 : BoxRaw;
|
|
4613
|
+
var _a79, _b79;
|
|
4614
|
+
var Button2 = (_b79 = (_a79 = ButtonRaw) == null ? void 0 : _a79.default) != null ? _b79 : ButtonRaw;
|
|
4615
|
+
var _a80, _b80;
|
|
4616
|
+
var Input = (_b80 = (_a80 = InputRaw) == null ? void 0 : _a80.default) != null ? _b80 : InputRaw;
|
|
4617
|
+
var _a81, _b81;
|
|
4618
|
+
var TextField3 = (_b81 = (_a81 = TextFieldRaw) == null ? void 0 : _a81.default) != null ? _b81 : TextFieldRaw;
|
|
4619
|
+
var _a82, _b82;
|
|
4620
|
+
var Typography5 = (_b82 = (_a82 = MuiTypographyRaw) == null ? void 0 : _a82.default) != null ? _b82 : MuiTypographyRaw;
|
|
4621
|
+
var _a83, _b83;
|
|
4622
|
+
var UploadFile = (_b83 = (_a83 = UploadFileRaw) == null ? void 0 : _a83.default) != null ? _b83 : UploadFileRaw;
|
|
4361
4623
|
var TextFieldUpload = ({
|
|
4362
4624
|
name = "upload",
|
|
4363
4625
|
control,
|
|
@@ -4383,14 +4645,14 @@ var TextFieldUpload = ({
|
|
|
4383
4645
|
const [fileSizeError, setFileSizeError] = useState(false);
|
|
4384
4646
|
const [unsupportedFile, setUnsupportedFile] = useState(false);
|
|
4385
4647
|
const handleFileChange = (event) => {
|
|
4386
|
-
var
|
|
4387
|
-
const file = (
|
|
4648
|
+
var _a126, _b126;
|
|
4649
|
+
const file = (_a126 = event.target.files) == null ? void 0 : _a126[0];
|
|
4388
4650
|
if (!file) {
|
|
4389
4651
|
field.onChange("");
|
|
4390
4652
|
uploadFile == null ? void 0 : uploadFile("", null);
|
|
4391
4653
|
return;
|
|
4392
4654
|
}
|
|
4393
|
-
const extension = (
|
|
4655
|
+
const extension = (_b126 = file.name.split(".").pop()) == null ? void 0 : _b126.toLowerCase();
|
|
4394
4656
|
const acceptedExtensions = accept ? accept.split(",").map((ext) => ext.trim().toLowerCase()) : [];
|
|
4395
4657
|
if (acceptedExtensions.length > 0 && !acceptedExtensions.includes(`.${extension}`)) {
|
|
4396
4658
|
setUnsupportedFile(true);
|
|
@@ -4414,8 +4676,8 @@ var TextFieldUpload = ({
|
|
|
4414
4676
|
isError ? PrimitiveColor.color_red_500 : isSuccess ? PrimitiveColor.color_blue_cakrawala_500 : PrimitiveColor.color_neutral_300;
|
|
4415
4677
|
const helperText = fileSizeError ? `Ukuran file melebihi ${maxSize} MB` : unsupportedFile ? "Format file tidak didukung" : `Format ${accept || "-"} ukuran maks. ${maxSize} MB`;
|
|
4416
4678
|
const handleButtonClick = () => {
|
|
4417
|
-
var
|
|
4418
|
-
(
|
|
4679
|
+
var _a126;
|
|
4680
|
+
(_a126 = inputRef.current) == null ? void 0 : _a126.click();
|
|
4419
4681
|
};
|
|
4420
4682
|
const uploadButton = /* @__PURE__ */ jsx(
|
|
4421
4683
|
Button2,
|
|
@@ -4453,7 +4715,7 @@ var TextFieldUpload = ({
|
|
|
4453
4715
|
)
|
|
4454
4716
|
}
|
|
4455
4717
|
);
|
|
4456
|
-
return /* @__PURE__ */ jsxs(
|
|
4718
|
+
return /* @__PURE__ */ jsxs(Box17, { width: "100%", children: [
|
|
4457
4719
|
title && /* @__PURE__ */ jsx(
|
|
4458
4720
|
Typography5,
|
|
4459
4721
|
{
|
|
@@ -4466,8 +4728,8 @@ var TextFieldUpload = ({
|
|
|
4466
4728
|
children: title
|
|
4467
4729
|
}
|
|
4468
4730
|
),
|
|
4469
|
-
/* @__PURE__ */ jsxs(
|
|
4470
|
-
/* @__PURE__ */ jsxs(
|
|
4731
|
+
/* @__PURE__ */ jsxs(Box17, { width: "100%", children: [
|
|
4732
|
+
/* @__PURE__ */ jsxs(Box17, { display: "flex", width: "100%", children: [
|
|
4471
4733
|
buttonPosition === "start" && uploadButton,
|
|
4472
4734
|
/* @__PURE__ */ jsx(
|
|
4473
4735
|
TextField3,
|
|
@@ -4512,7 +4774,7 @@ var TextFieldUpload = ({
|
|
|
4512
4774
|
buttonPosition === "end" && uploadButton
|
|
4513
4775
|
] }),
|
|
4514
4776
|
/* @__PURE__ */ jsxs(
|
|
4515
|
-
|
|
4777
|
+
Box17,
|
|
4516
4778
|
{
|
|
4517
4779
|
display: "flex",
|
|
4518
4780
|
alignItems: "center",
|
|
@@ -4552,13 +4814,13 @@ function Editor(props) {
|
|
|
4552
4814
|
useEffect(() => {
|
|
4553
4815
|
let cancelled = false;
|
|
4554
4816
|
async function load() {
|
|
4555
|
-
var
|
|
4817
|
+
var _a126, _b126, _c, _d, _e, _f, _g;
|
|
4556
4818
|
const alreadyLoaded = typeof window !== "undefined" && window.tinymce;
|
|
4557
4819
|
if (!alreadyLoaded) {
|
|
4558
4820
|
try {
|
|
4559
4821
|
const tinymceModule = await import('tinymce/tinymce');
|
|
4560
4822
|
if (typeof window !== "undefined" && !window.tinymce) {
|
|
4561
|
-
const core = (
|
|
4823
|
+
const core = (_a126 = tinymceModule.default) != null ? _a126 : tinymceModule;
|
|
4562
4824
|
if (core && typeof core === "object" && core.tinymce) {
|
|
4563
4825
|
window.tinymce = core.tinymce;
|
|
4564
4826
|
} else {
|
|
@@ -4610,7 +4872,7 @@ function Editor(props) {
|
|
|
4610
4872
|
import('tinymce/skins/content/default/content.min.css'),
|
|
4611
4873
|
import('tinymce/skins/ui/oxide/content.min.css')
|
|
4612
4874
|
]);
|
|
4613
|
-
const skinCss = (
|
|
4875
|
+
const skinCss = (_b126 = skinMod == null ? void 0 : skinMod.default) != null ? _b126 : "";
|
|
4614
4876
|
const contentCss = (_c = contentMod == null ? void 0 : contentMod.default) != null ? _c : "";
|
|
4615
4877
|
const oxideContentCss = (_d = oxideContentMod == null ? void 0 : oxideContentMod.default) != null ? _d : "";
|
|
4616
4878
|
const combinedCss = [skinCss, contentCss, oxideContentCss].filter(Boolean).join("\n");
|
|
@@ -4650,16 +4912,16 @@ function Editor(props) {
|
|
|
4650
4912
|
}
|
|
4651
4913
|
return /* @__PURE__ */ jsx(TinyEditor, __spreadValues({}, props));
|
|
4652
4914
|
}
|
|
4653
|
-
var
|
|
4654
|
-
var InputAdornment3 = (
|
|
4655
|
-
var
|
|
4656
|
-
var TextField4 = (
|
|
4657
|
-
var
|
|
4658
|
-
var
|
|
4659
|
-
var
|
|
4660
|
-
var Typography6 = (
|
|
4661
|
-
var BaseTextArea = (
|
|
4662
|
-
var
|
|
4915
|
+
var _a84, _b84;
|
|
4916
|
+
var InputAdornment3 = (_b84 = (_a84 = InputAdornmentRaw) == null ? void 0 : _a84.default) != null ? _b84 : InputAdornmentRaw;
|
|
4917
|
+
var _a85, _b85;
|
|
4918
|
+
var TextField4 = (_b85 = (_a85 = TextFieldRaw) == null ? void 0 : _a85.default) != null ? _b85 : TextFieldRaw;
|
|
4919
|
+
var _a86, _b86;
|
|
4920
|
+
var Box18 = (_b86 = (_a86 = BoxRaw) == null ? void 0 : _a86.default) != null ? _b86 : BoxRaw;
|
|
4921
|
+
var _a87, _b87;
|
|
4922
|
+
var Typography6 = (_b87 = (_a87 = MuiTypographyRaw) == null ? void 0 : _a87.default) != null ? _b87 : MuiTypographyRaw;
|
|
4923
|
+
var BaseTextArea = (_a126) => {
|
|
4924
|
+
var _b126 = _a126, {
|
|
4663
4925
|
name = "",
|
|
4664
4926
|
control = null,
|
|
4665
4927
|
defaultValue = "",
|
|
@@ -4673,7 +4935,7 @@ var BaseTextArea = (_a120) => {
|
|
|
4673
4935
|
init,
|
|
4674
4936
|
handleImageUpload,
|
|
4675
4937
|
sx = {}
|
|
4676
|
-
} =
|
|
4938
|
+
} = _b126, props = __objRest(_b126, [
|
|
4677
4939
|
"name",
|
|
4678
4940
|
"control",
|
|
4679
4941
|
"defaultValue",
|
|
@@ -4688,8 +4950,8 @@ var BaseTextArea = (_a120) => {
|
|
|
4688
4950
|
"handleImageUpload",
|
|
4689
4951
|
"sx"
|
|
4690
4952
|
]);
|
|
4691
|
-
var
|
|
4692
|
-
const computedMaxLength = (
|
|
4953
|
+
var _a127, _b127, _c, _d, _e, _f, _g;
|
|
4954
|
+
const computedMaxLength = (_b127 = exactLength != null ? exactLength : maxLength) != null ? _b127 : (_a127 = rules == null ? void 0 : rules.maxLength) == null ? void 0 : _a127.value;
|
|
4693
4955
|
const { field, fieldState } = useController({
|
|
4694
4956
|
control,
|
|
4695
4957
|
name,
|
|
@@ -4758,7 +5020,7 @@ var BaseTextArea = (_a120) => {
|
|
|
4758
5020
|
const editorId = (_e = props.id) != null ? _e : `textarea-${name}-${uniqueSuffix}`;
|
|
4759
5021
|
const wrapperId = `editor-wrap-${uniqueSuffix}`;
|
|
4760
5022
|
if (useRichText) {
|
|
4761
|
-
return /* @__PURE__ */ jsxs(
|
|
5023
|
+
return /* @__PURE__ */ jsxs(Box18, { id: wrapperId, sx, children: [
|
|
4762
5024
|
title && /* @__PURE__ */ jsx(
|
|
4763
5025
|
Typography6,
|
|
4764
5026
|
{
|
|
@@ -4865,7 +5127,7 @@ var BaseTextArea = (_a120) => {
|
|
|
4865
5127
|
] });
|
|
4866
5128
|
}
|
|
4867
5129
|
return /* @__PURE__ */ jsxs(
|
|
4868
|
-
|
|
5130
|
+
Box18,
|
|
4869
5131
|
{
|
|
4870
5132
|
sx: __spreadValues({
|
|
4871
5133
|
display: "flex",
|
|
@@ -4909,16 +5171,16 @@ var BaseTextArea = (_a120) => {
|
|
|
4909
5171
|
}
|
|
4910
5172
|
);
|
|
4911
5173
|
};
|
|
4912
|
-
var
|
|
4913
|
-
var Dialog = (
|
|
4914
|
-
var
|
|
4915
|
-
var DialogContent = (
|
|
4916
|
-
var
|
|
4917
|
-
var DialogActions = (
|
|
4918
|
-
var
|
|
4919
|
-
var
|
|
4920
|
-
var
|
|
4921
|
-
var
|
|
5174
|
+
var _a88, _b88;
|
|
5175
|
+
var Dialog = (_b88 = (_a88 = DialogRaw) == null ? void 0 : _a88.default) != null ? _b88 : DialogRaw;
|
|
5176
|
+
var _a89, _b89;
|
|
5177
|
+
var DialogContent = (_b89 = (_a89 = DialogContentRaw) == null ? void 0 : _a89.default) != null ? _b89 : DialogContentRaw;
|
|
5178
|
+
var _a90, _b90;
|
|
5179
|
+
var DialogActions = (_b90 = (_a90 = DialogActionsRaw) == null ? void 0 : _a90.default) != null ? _b90 : DialogActionsRaw;
|
|
5180
|
+
var _a91, _b91;
|
|
5181
|
+
var IconButton6 = (_b91 = (_a91 = IconButtonRaw) == null ? void 0 : _a91.default) != null ? _b91 : IconButtonRaw;
|
|
5182
|
+
var _a92, _b92;
|
|
5183
|
+
var Box19 = (_b92 = (_a92 = BoxRaw) == null ? void 0 : _a92.default) != null ? _b92 : BoxRaw;
|
|
4922
5184
|
var ICON_MAP = {
|
|
4923
5185
|
success: {
|
|
4924
5186
|
Hero: SuccessHero,
|
|
@@ -4971,13 +5233,13 @@ var ModalAlertDialog = ({
|
|
|
4971
5233
|
if (typeof icon === "string" && ICON_MAP[icon.toLowerCase()]) {
|
|
4972
5234
|
const { Hero, FallbackIcon, color } = ICON_MAP[icon.toLowerCase()];
|
|
4973
5235
|
if (Hero) {
|
|
4974
|
-
return /* @__PURE__ */ jsx(
|
|
5236
|
+
return /* @__PURE__ */ jsx(Box19, { sx: { width: 160, height: 130, display: "flex", alignItems: "center", justifyContent: "center", "& svg": { width: "100%", height: "100%" } }, children: /* @__PURE__ */ jsx(Hero, {}) });
|
|
4975
5237
|
}
|
|
4976
5238
|
return /* @__PURE__ */ jsx(FallbackIcon, { size: 64, color, stroke: 1.5 });
|
|
4977
5239
|
}
|
|
4978
5240
|
if (typeof icon === "string" && (icon.startsWith("/") || icon.startsWith("http"))) {
|
|
4979
5241
|
return /* @__PURE__ */ jsx(
|
|
4980
|
-
|
|
5242
|
+
Box19,
|
|
4981
5243
|
{
|
|
4982
5244
|
component: "img",
|
|
4983
5245
|
src: icon,
|
|
@@ -5018,7 +5280,7 @@ var ModalAlertDialog = ({
|
|
|
5018
5280
|
}
|
|
5019
5281
|
},
|
|
5020
5282
|
children: [
|
|
5021
|
-
/* @__PURE__ */ jsx(
|
|
5283
|
+
/* @__PURE__ */ jsx(Box19, { sx: { position: "absolute", right: 8, top: 8 }, children: /* @__PURE__ */ jsx(IconButton6, { onClick: onClose, sx: { color: DerivedColor.color_text_subtle }, children: /* @__PURE__ */ jsx(IconX, { size: 20 }) }) }),
|
|
5022
5284
|
/* @__PURE__ */ jsxs(
|
|
5023
5285
|
DialogContent,
|
|
5024
5286
|
{
|
|
@@ -5033,7 +5295,7 @@ var ModalAlertDialog = ({
|
|
|
5033
5295
|
gap: SpacingToken.spacing3
|
|
5034
5296
|
},
|
|
5035
5297
|
children: [
|
|
5036
|
-
/* @__PURE__ */ jsx(
|
|
5298
|
+
/* @__PURE__ */ jsx(Box19, { sx: { display: "flex", justifyContent: "center", py: 1 }, children: renderIcon() }),
|
|
5037
5299
|
resolvedTitle && /* @__PURE__ */ jsx(BaseTypography, { variant: "header1_bold.default", sx: { fontSize: "18px" }, children: resolvedTitle }),
|
|
5038
5300
|
description && /* @__PURE__ */ jsx(BaseTypography, { variant: "body2_regular.default", sx: { textAlign: "center" }, children: description })
|
|
5039
5301
|
]
|
|
@@ -5084,14 +5346,14 @@ var setModalRef = (ref) => {
|
|
|
5084
5346
|
_modalRef = ref;
|
|
5085
5347
|
};
|
|
5086
5348
|
var show = (options = {}) => {
|
|
5087
|
-
var
|
|
5088
|
-
if ((
|
|
5349
|
+
var _a126;
|
|
5350
|
+
if ((_a126 = _modalRef == null ? void 0 : _modalRef.current) == null ? void 0 : _a126.show) {
|
|
5089
5351
|
_modalRef.current.show(options);
|
|
5090
5352
|
}
|
|
5091
5353
|
};
|
|
5092
5354
|
var hide = () => {
|
|
5093
|
-
var
|
|
5094
|
-
if ((
|
|
5355
|
+
var _a126;
|
|
5356
|
+
if ((_a126 = _modalRef == null ? void 0 : _modalRef.current) == null ? void 0 : _a126.hide) {
|
|
5095
5357
|
_modalRef.current.hide();
|
|
5096
5358
|
}
|
|
5097
5359
|
};
|
|
@@ -5186,12 +5448,12 @@ var LoadingDots = () => /* @__PURE__ */ jsxs(
|
|
|
5186
5448
|
]
|
|
5187
5449
|
}
|
|
5188
5450
|
);
|
|
5189
|
-
var
|
|
5190
|
-
var Dialog2 = (
|
|
5191
|
-
var
|
|
5192
|
-
var DialogContent2 = (
|
|
5193
|
-
var
|
|
5194
|
-
(
|
|
5451
|
+
var _a93, _b93;
|
|
5452
|
+
var Dialog2 = (_b93 = (_a93 = DialogRaw) == null ? void 0 : _a93.default) != null ? _b93 : DialogRaw;
|
|
5453
|
+
var _a94, _b94;
|
|
5454
|
+
var DialogContent2 = (_b94 = (_a94 = DialogContentRaw) == null ? void 0 : _a94.default) != null ? _b94 : DialogContentRaw;
|
|
5455
|
+
var _a95, _b95;
|
|
5456
|
+
(_b95 = (_a95 = BoxRaw) == null ? void 0 : _a95.default) != null ? _b95 : BoxRaw;
|
|
5195
5457
|
var ModalLoadingDialog = ({ open = false }) => {
|
|
5196
5458
|
return /* @__PURE__ */ jsx(
|
|
5197
5459
|
Dialog2,
|
|
@@ -5238,14 +5500,14 @@ var setModalRef2 = (ref) => {
|
|
|
5238
5500
|
_modalRef2 = ref;
|
|
5239
5501
|
};
|
|
5240
5502
|
var show2 = () => {
|
|
5241
|
-
var
|
|
5242
|
-
if ((
|
|
5503
|
+
var _a126;
|
|
5504
|
+
if ((_a126 = _modalRef2 == null ? void 0 : _modalRef2.current) == null ? void 0 : _a126.show) {
|
|
5243
5505
|
_modalRef2.current.show();
|
|
5244
5506
|
}
|
|
5245
5507
|
};
|
|
5246
5508
|
var hide2 = () => {
|
|
5247
|
-
var
|
|
5248
|
-
if ((
|
|
5509
|
+
var _a126;
|
|
5510
|
+
if ((_a126 = _modalRef2 == null ? void 0 : _modalRef2.current) == null ? void 0 : _a126.hide) {
|
|
5249
5511
|
_modalRef2.current.hide();
|
|
5250
5512
|
}
|
|
5251
5513
|
};
|
|
@@ -5270,16 +5532,16 @@ var BaseModalLoadingProvider = () => {
|
|
|
5270
5532
|
return /* @__PURE__ */ jsx(ModalLoadingDialog, { open });
|
|
5271
5533
|
};
|
|
5272
5534
|
var BaseModalLoadingDialog = ModalLoadingDialog;
|
|
5273
|
-
var
|
|
5274
|
-
var Dialog3 = (
|
|
5275
|
-
var
|
|
5276
|
-
var DialogContent3 = (
|
|
5277
|
-
var
|
|
5278
|
-
var DialogActions2 = (
|
|
5279
|
-
var
|
|
5280
|
-
var
|
|
5281
|
-
var
|
|
5282
|
-
var
|
|
5535
|
+
var _a96, _b96;
|
|
5536
|
+
var Dialog3 = (_b96 = (_a96 = DialogRaw) == null ? void 0 : _a96.default) != null ? _b96 : DialogRaw;
|
|
5537
|
+
var _a97, _b97;
|
|
5538
|
+
var DialogContent3 = (_b97 = (_a97 = DialogContentRaw) == null ? void 0 : _a97.default) != null ? _b97 : DialogContentRaw;
|
|
5539
|
+
var _a98, _b98;
|
|
5540
|
+
var DialogActions2 = (_b98 = (_a98 = DialogActionsRaw) == null ? void 0 : _a98.default) != null ? _b98 : DialogActionsRaw;
|
|
5541
|
+
var _a99, _b99;
|
|
5542
|
+
var IconButton7 = (_b99 = (_a99 = IconButtonRaw) == null ? void 0 : _a99.default) != null ? _b99 : IconButtonRaw;
|
|
5543
|
+
var _a100, _b100;
|
|
5544
|
+
var Box21 = (_b100 = (_a100 = BoxRaw) == null ? void 0 : _a100.default) != null ? _b100 : BoxRaw;
|
|
5283
5545
|
var HEADER_COLORS2 = {
|
|
5284
5546
|
primary: DerivedColor.color_bg_brand_primary,
|
|
5285
5547
|
secondary: DerivedColor.color_bg_brand_secondary,
|
|
@@ -5287,8 +5549,8 @@ var HEADER_COLORS2 = {
|
|
|
5287
5549
|
warning: DerivedColor.color_bg_warning,
|
|
5288
5550
|
danger: DerivedColor.color_bg_danger
|
|
5289
5551
|
};
|
|
5290
|
-
var BaseModalPopup = (
|
|
5291
|
-
var
|
|
5552
|
+
var BaseModalPopup = (_a126) => {
|
|
5553
|
+
var _b126 = _a126, {
|
|
5292
5554
|
open = false,
|
|
5293
5555
|
onClose,
|
|
5294
5556
|
variant = "default",
|
|
@@ -5303,7 +5565,7 @@ var BaseModalPopup = (_a120) => {
|
|
|
5303
5565
|
isWatermark = false,
|
|
5304
5566
|
watermarkText = "",
|
|
5305
5567
|
sx = {}
|
|
5306
|
-
} =
|
|
5568
|
+
} = _b126, rest = __objRest(_b126, [
|
|
5307
5569
|
"open",
|
|
5308
5570
|
"onClose",
|
|
5309
5571
|
"variant",
|
|
@@ -5359,7 +5621,7 @@ var BaseModalPopup = (_a120) => {
|
|
|
5359
5621
|
}, rest), {
|
|
5360
5622
|
children: [
|
|
5361
5623
|
hasHeader ? /* @__PURE__ */ jsxs(
|
|
5362
|
-
|
|
5624
|
+
Box21,
|
|
5363
5625
|
{
|
|
5364
5626
|
sx: {
|
|
5365
5627
|
backgroundColor: headerBg,
|
|
@@ -5369,11 +5631,11 @@ var BaseModalPopup = (_a120) => {
|
|
|
5369
5631
|
justifyContent: "space-between"
|
|
5370
5632
|
},
|
|
5371
5633
|
children: [
|
|
5372
|
-
/* @__PURE__ */ jsxs(
|
|
5373
|
-
startIcon && /* @__PURE__ */ jsx(
|
|
5374
|
-
/* @__PURE__ */ jsxs(
|
|
5634
|
+
/* @__PURE__ */ jsxs(Box21, { sx: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
5635
|
+
startIcon && /* @__PURE__ */ jsx(Box21, { sx: { display: "flex", alignItems: "center", lineHeight: 0, color: headerTextColor }, children: startIcon }),
|
|
5636
|
+
/* @__PURE__ */ jsxs(Box21, { children: [
|
|
5375
5637
|
/* @__PURE__ */ jsx(
|
|
5376
|
-
|
|
5638
|
+
Box21,
|
|
5377
5639
|
{
|
|
5378
5640
|
component: "span",
|
|
5379
5641
|
sx: {
|
|
@@ -5386,7 +5648,7 @@ var BaseModalPopup = (_a120) => {
|
|
|
5386
5648
|
}
|
|
5387
5649
|
),
|
|
5388
5650
|
subtitle && /* @__PURE__ */ jsx(
|
|
5389
|
-
|
|
5651
|
+
Box21,
|
|
5390
5652
|
{
|
|
5391
5653
|
component: "span",
|
|
5392
5654
|
sx: {
|
|
@@ -5402,12 +5664,12 @@ var BaseModalPopup = (_a120) => {
|
|
|
5402
5664
|
)
|
|
5403
5665
|
] })
|
|
5404
5666
|
] }),
|
|
5405
|
-
/* @__PURE__ */ jsx(
|
|
5667
|
+
/* @__PURE__ */ jsx(IconButton7, { onClick: onClose, sx: { color: headerTextColor }, children: /* @__PURE__ */ jsx(IconX, { size: 20 }) })
|
|
5406
5668
|
]
|
|
5407
5669
|
}
|
|
5408
5670
|
) : (
|
|
5409
5671
|
/* Default variant: close button top-right only */
|
|
5410
|
-
/* @__PURE__ */ jsx(
|
|
5672
|
+
/* @__PURE__ */ jsx(Box21, { sx: { position: "absolute", right: 8, top: 8, zIndex: 1 }, children: /* @__PURE__ */ jsx(IconButton7, { onClick: onClose, sx: { color: DerivedColor.color_text_subtle }, children: /* @__PURE__ */ jsx(IconX, { size: 20 }) }) })
|
|
5411
5673
|
),
|
|
5412
5674
|
/* @__PURE__ */ jsx(
|
|
5413
5675
|
DialogContent3,
|
|
@@ -5436,42 +5698,42 @@ var BaseModalPopup = (_a120) => {
|
|
|
5436
5698
|
})
|
|
5437
5699
|
);
|
|
5438
5700
|
};
|
|
5439
|
-
var _a95, _b95;
|
|
5440
|
-
var CloseIcon2 = (_b95 = (_a95 = CloseIconRaw) == null ? void 0 : _a95.default) != null ? _b95 : CloseIconRaw;
|
|
5441
|
-
var _a96, _b96;
|
|
5442
|
-
var CheckIcon2 = (_b96 = (_a96 = CheckRaw) == null ? void 0 : _a96.default) != null ? _b96 : CheckRaw;
|
|
5443
|
-
var _a97, _b97;
|
|
5444
|
-
var FailedIcon = (_b97 = (_a97 = CloseIconRaw) == null ? void 0 : _a97.default) != null ? _b97 : CloseIconRaw;
|
|
5445
|
-
var _a98, _b98;
|
|
5446
|
-
var InfoIcon = (_b98 = (_a98 = InfoIconRaw) == null ? void 0 : _a98.default) != null ? _b98 : InfoIconRaw;
|
|
5447
|
-
var _a99, _b99;
|
|
5448
|
-
var Dialog4 = (_b99 = (_a99 = DialogRaw) == null ? void 0 : _a99.default) != null ? _b99 : DialogRaw;
|
|
5449
|
-
var _a100, _b100;
|
|
5450
|
-
var DialogTitle = (_b100 = (_a100 = DialogTitleRaw) == null ? void 0 : _a100.default) != null ? _b100 : DialogTitleRaw;
|
|
5451
5701
|
var _a101, _b101;
|
|
5452
|
-
var
|
|
5702
|
+
var CloseIcon2 = (_b101 = (_a101 = CloseIconRaw) == null ? void 0 : _a101.default) != null ? _b101 : CloseIconRaw;
|
|
5453
5703
|
var _a102, _b102;
|
|
5454
|
-
var
|
|
5704
|
+
var CheckIcon2 = (_b102 = (_a102 = CheckRaw) == null ? void 0 : _a102.default) != null ? _b102 : CheckRaw;
|
|
5455
5705
|
var _a103, _b103;
|
|
5456
|
-
var
|
|
5706
|
+
var FailedIcon = (_b103 = (_a103 = CloseIconRaw) == null ? void 0 : _a103.default) != null ? _b103 : CloseIconRaw;
|
|
5457
5707
|
var _a104, _b104;
|
|
5458
|
-
var
|
|
5708
|
+
var InfoIcon = (_b104 = (_a104 = InfoIconRaw) == null ? void 0 : _a104.default) != null ? _b104 : InfoIconRaw;
|
|
5459
5709
|
var _a105, _b105;
|
|
5460
|
-
var
|
|
5710
|
+
var Dialog4 = (_b105 = (_a105 = DialogRaw) == null ? void 0 : _a105.default) != null ? _b105 : DialogRaw;
|
|
5461
5711
|
var _a106, _b106;
|
|
5462
|
-
var
|
|
5712
|
+
var DialogTitle = (_b106 = (_a106 = DialogTitleRaw) == null ? void 0 : _a106.default) != null ? _b106 : DialogTitleRaw;
|
|
5463
5713
|
var _a107, _b107;
|
|
5464
|
-
var
|
|
5714
|
+
var DialogContent4 = (_b107 = (_a107 = DialogContentRaw) == null ? void 0 : _a107.default) != null ? _b107 : DialogContentRaw;
|
|
5465
5715
|
var _a108, _b108;
|
|
5466
|
-
var
|
|
5716
|
+
var DialogActions3 = (_b108 = (_a108 = DialogActionsRaw) == null ? void 0 : _a108.default) != null ? _b108 : DialogActionsRaw;
|
|
5467
5717
|
var _a109, _b109;
|
|
5468
|
-
var
|
|
5718
|
+
var IconButton8 = (_b109 = (_a109 = IconButtonRaw) == null ? void 0 : _a109.default) != null ? _b109 : IconButtonRaw;
|
|
5469
5719
|
var _a110, _b110;
|
|
5470
|
-
var
|
|
5720
|
+
var Typography7 = (_b110 = (_a110 = MuiTypographyRaw) == null ? void 0 : _a110.default) != null ? _b110 : MuiTypographyRaw;
|
|
5471
5721
|
var _a111, _b111;
|
|
5472
|
-
var
|
|
5473
|
-
var
|
|
5474
|
-
|
|
5722
|
+
var Box22 = (_b111 = (_a111 = BoxRaw) == null ? void 0 : _a111.default) != null ? _b111 : BoxRaw;
|
|
5723
|
+
var _a112, _b112;
|
|
5724
|
+
var Stepper2 = (_b112 = (_a112 = StepperRaw) == null ? void 0 : _a112.default) != null ? _b112 : StepperRaw;
|
|
5725
|
+
var _a113, _b113;
|
|
5726
|
+
var Step2 = (_b113 = (_a113 = StepRaw) == null ? void 0 : _a113.default) != null ? _b113 : StepRaw;
|
|
5727
|
+
var _a114, _b114;
|
|
5728
|
+
var StepLabel2 = (_b114 = (_a114 = StepLabelRaw) == null ? void 0 : _a114.default) != null ? _b114 : StepLabelRaw;
|
|
5729
|
+
var _a115, _b115;
|
|
5730
|
+
var StepContent = (_b115 = (_a115 = StepContentRaw) == null ? void 0 : _a115.default) != null ? _b115 : StepContentRaw;
|
|
5731
|
+
var _a116, _b116;
|
|
5732
|
+
var Tooltip2 = (_b116 = (_a116 = TooltipRaw) == null ? void 0 : _a116.default) != null ? _b116 : TooltipRaw;
|
|
5733
|
+
var _a117, _b117;
|
|
5734
|
+
var CircularProgress2 = (_b117 = (_a117 = CircularProgressRaw) == null ? void 0 : _a117.default) != null ? _b117 : CircularProgressRaw;
|
|
5735
|
+
var HtmlTooltip2 = styled((_a126) => {
|
|
5736
|
+
var _b126 = _a126, { className } = _b126, props = __objRest(_b126, ["className"]);
|
|
5475
5737
|
return /* @__PURE__ */ jsx(Tooltip2, __spreadProps(__spreadValues({}, props), { classes: { popper: className } }));
|
|
5476
5738
|
})(({ theme }) => ({
|
|
5477
5739
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
@@ -5518,8 +5780,8 @@ var StepIconWrapper = styled("div")(({ ownerState }) => __spreadValues({
|
|
|
5518
5780
|
justifyContent: "center",
|
|
5519
5781
|
minHeight: ICON_SIZE
|
|
5520
5782
|
}, ownerState.active && { backgroundColor: "transparent" }));
|
|
5521
|
-
var BaseModalStepper = (
|
|
5522
|
-
var
|
|
5783
|
+
var BaseModalStepper = (_a126) => {
|
|
5784
|
+
var _b126 = _a126, {
|
|
5523
5785
|
open,
|
|
5524
5786
|
onClose,
|
|
5525
5787
|
title = "",
|
|
@@ -5530,7 +5792,7 @@ var BaseModalStepper = (_a120) => {
|
|
|
5530
5792
|
showFooter = true,
|
|
5531
5793
|
children,
|
|
5532
5794
|
modalWidth = "max-w-md"
|
|
5533
|
-
} =
|
|
5795
|
+
} = _b126, props = __objRest(_b126, [
|
|
5534
5796
|
"open",
|
|
5535
5797
|
"onClose",
|
|
5536
5798
|
"title",
|
|
@@ -5595,14 +5857,14 @@ var BaseModalStepper = (_a120) => {
|
|
|
5595
5857
|
icon: PropTypes3.node
|
|
5596
5858
|
};
|
|
5597
5859
|
useEffect(() => {
|
|
5598
|
-
var
|
|
5860
|
+
var _a127;
|
|
5599
5861
|
if (!open) {
|
|
5600
5862
|
setActiveStep(0);
|
|
5601
5863
|
return;
|
|
5602
5864
|
}
|
|
5603
5865
|
if (stepper.length === 0) return;
|
|
5604
5866
|
const incrementStep = () => setActiveStep((prev) => prev < stepper.length ? prev + 1 : prev);
|
|
5605
|
-
const delay = activeStep > 0 ? ((
|
|
5867
|
+
const delay = activeStep > 0 ? ((_a127 = stepper[activeStep - 1]) == null ? void 0 : _a127.responseTime) || 800 : 800;
|
|
5606
5868
|
const timer = setTimeout(incrementStep, delay);
|
|
5607
5869
|
return () => clearTimeout(timer);
|
|
5608
5870
|
}, [activeStep, stepper, open]);
|
|
@@ -5652,7 +5914,7 @@ var BaseModalStepper = (_a120) => {
|
|
|
5652
5914
|
/* @__PURE__ */ jsxs(DialogTitle, { sx: { textAlign: "center", pt: 4 }, children: [
|
|
5653
5915
|
title && /* @__PURE__ */ jsx(Typography7, { style: VariantStyles.header1_bold, children: title }),
|
|
5654
5916
|
/* @__PURE__ */ jsx(
|
|
5655
|
-
|
|
5917
|
+
IconButton8,
|
|
5656
5918
|
{
|
|
5657
5919
|
"aria-label": "close",
|
|
5658
5920
|
onClick: onClose,
|
|
@@ -5668,7 +5930,7 @@ var BaseModalStepper = (_a120) => {
|
|
|
5668
5930
|
] }),
|
|
5669
5931
|
/* @__PURE__ */ jsxs(DialogContent4, { sx: { px: 4, pb: 3 }, children: [
|
|
5670
5932
|
children ? children : /* @__PURE__ */ jsxs(
|
|
5671
|
-
|
|
5933
|
+
Box22,
|
|
5672
5934
|
{
|
|
5673
5935
|
sx: {
|
|
5674
5936
|
display: "flex",
|
|
@@ -5693,7 +5955,7 @@ var BaseModalStepper = (_a120) => {
|
|
|
5693
5955
|
]
|
|
5694
5956
|
}
|
|
5695
5957
|
),
|
|
5696
|
-
/* @__PURE__ */ jsx(
|
|
5958
|
+
/* @__PURE__ */ jsx(Box22, { sx: { width: "100%", maxWidth: 500 }, children: /* @__PURE__ */ jsx(Stepper2, { activeStep, orientation: "vertical", children: stepper.map((step) => /* @__PURE__ */ jsxs(Step2, { children: [
|
|
5697
5959
|
/* @__PURE__ */ jsx(StepLabel2, { StepIconComponent: ColorlibStepIcon2, children: step.label }),
|
|
5698
5960
|
/* @__PURE__ */ jsx(StepContent, { children: /* @__PURE__ */ jsx(Typography7, { sx: { fontSize: 14 }, children: step.description }) })
|
|
5699
5961
|
] }, step.label)) }) })
|
|
@@ -5733,25 +5995,25 @@ BaseModalStepper.propTypes = {
|
|
|
5733
5995
|
};
|
|
5734
5996
|
var Countdown = dynamic(
|
|
5735
5997
|
() => import('react-countdown').then((mod) => {
|
|
5736
|
-
var
|
|
5737
|
-
return (
|
|
5998
|
+
var _a126;
|
|
5999
|
+
return (_a126 = mod.default) != null ? _a126 : mod;
|
|
5738
6000
|
}),
|
|
5739
6001
|
{ ssr: false }
|
|
5740
6002
|
);
|
|
5741
|
-
var _a112, _b112;
|
|
5742
|
-
var CloseIcon3 = (_b112 = (_a112 = CloseIconRaw) == null ? void 0 : _a112.default) != null ? _b112 : CloseIconRaw;
|
|
5743
|
-
var _a113, _b113;
|
|
5744
|
-
var Dialog5 = (_b113 = (_a113 = DialogRaw) == null ? void 0 : _a113.default) != null ? _b113 : DialogRaw;
|
|
5745
|
-
var _a114, _b114;
|
|
5746
|
-
var DialogContent5 = (_b114 = (_a114 = DialogContentRaw) == null ? void 0 : _a114.default) != null ? _b114 : DialogContentRaw;
|
|
5747
|
-
var _a115, _b115;
|
|
5748
|
-
var DialogTitle2 = (_b115 = (_a115 = DialogTitleRaw) == null ? void 0 : _a115.default) != null ? _b115 : DialogTitleRaw;
|
|
5749
|
-
var _a116, _b116;
|
|
5750
|
-
var IconButton8 = (_b116 = (_a116 = IconButtonRaw) == null ? void 0 : _a116.default) != null ? _b116 : IconButtonRaw;
|
|
5751
|
-
var _a117, _b117;
|
|
5752
|
-
var Box21 = (_b117 = (_a117 = BoxRaw) == null ? void 0 : _a117.default) != null ? _b117 : BoxRaw;
|
|
5753
6003
|
var _a118, _b118;
|
|
5754
|
-
var
|
|
6004
|
+
var CloseIcon3 = (_b118 = (_a118 = CloseIconRaw) == null ? void 0 : _a118.default) != null ? _b118 : CloseIconRaw;
|
|
6005
|
+
var _a119, _b119;
|
|
6006
|
+
var Dialog5 = (_b119 = (_a119 = DialogRaw) == null ? void 0 : _a119.default) != null ? _b119 : DialogRaw;
|
|
6007
|
+
var _a120, _b120;
|
|
6008
|
+
var DialogContent5 = (_b120 = (_a120 = DialogContentRaw) == null ? void 0 : _a120.default) != null ? _b120 : DialogContentRaw;
|
|
6009
|
+
var _a121, _b121;
|
|
6010
|
+
var DialogTitle2 = (_b121 = (_a121 = DialogTitleRaw) == null ? void 0 : _a121.default) != null ? _b121 : DialogTitleRaw;
|
|
6011
|
+
var _a122, _b122;
|
|
6012
|
+
var IconButton9 = (_b122 = (_a122 = IconButtonRaw) == null ? void 0 : _a122.default) != null ? _b122 : IconButtonRaw;
|
|
6013
|
+
var _a123, _b123;
|
|
6014
|
+
var Box23 = (_b123 = (_a123 = BoxRaw) == null ? void 0 : _a123.default) != null ? _b123 : BoxRaw;
|
|
6015
|
+
var _a124, _b124;
|
|
6016
|
+
var Typography8 = (_b124 = (_a124 = MuiTypographyRaw) == null ? void 0 : _a124.default) != null ? _b124 : MuiTypographyRaw;
|
|
5755
6017
|
var otpInputBase = {
|
|
5756
6018
|
height: 40,
|
|
5757
6019
|
width: 30,
|
|
@@ -5782,7 +6044,7 @@ var NativeOTPInput = ({ value, onChange, numInputs, hasError }) => {
|
|
|
5782
6044
|
const digits = value.split("");
|
|
5783
6045
|
const handleChange = useCallback(
|
|
5784
6046
|
(index, e) => {
|
|
5785
|
-
var
|
|
6047
|
+
var _a126;
|
|
5786
6048
|
const val = e.target.value;
|
|
5787
6049
|
if (!/^\d*$/.test(val)) return;
|
|
5788
6050
|
const newDigits = [...digits];
|
|
@@ -5791,20 +6053,20 @@ var NativeOTPInput = ({ value, onChange, numInputs, hasError }) => {
|
|
|
5791
6053
|
const newValue = newDigits.join("");
|
|
5792
6054
|
onChange(newValue.slice(0, numInputs));
|
|
5793
6055
|
if (val && index < numInputs - 1) {
|
|
5794
|
-
(
|
|
6056
|
+
(_a126 = inputRefs.current[index + 1]) == null ? void 0 : _a126.focus();
|
|
5795
6057
|
}
|
|
5796
6058
|
},
|
|
5797
6059
|
[digits, numInputs, onChange]
|
|
5798
6060
|
);
|
|
5799
6061
|
const handleKeyDown = useCallback(
|
|
5800
6062
|
(index, e) => {
|
|
5801
|
-
var
|
|
6063
|
+
var _a126, _b126, _c;
|
|
5802
6064
|
if (e.key === "Backspace" && !digits[index] && index > 0) {
|
|
5803
|
-
(
|
|
6065
|
+
(_a126 = inputRefs.current[index - 1]) == null ? void 0 : _a126.focus();
|
|
5804
6066
|
}
|
|
5805
6067
|
if (e.key === "ArrowLeft" && index > 0) {
|
|
5806
6068
|
e.preventDefault();
|
|
5807
|
-
(
|
|
6069
|
+
(_b126 = inputRefs.current[index - 1]) == null ? void 0 : _b126.focus();
|
|
5808
6070
|
}
|
|
5809
6071
|
if (e.key === "ArrowRight" && index < numInputs - 1) {
|
|
5810
6072
|
e.preventDefault();
|
|
@@ -5815,20 +6077,20 @@ var NativeOTPInput = ({ value, onChange, numInputs, hasError }) => {
|
|
|
5815
6077
|
);
|
|
5816
6078
|
const handlePaste = useCallback(
|
|
5817
6079
|
(e) => {
|
|
5818
|
-
var
|
|
6080
|
+
var _a126;
|
|
5819
6081
|
e.preventDefault();
|
|
5820
6082
|
const pasted = e.clipboardData.getData("text").replace(/\D/g, "").slice(0, numInputs);
|
|
5821
6083
|
if (!pasted) return;
|
|
5822
6084
|
onChange(pasted);
|
|
5823
6085
|
const nextIdx = Math.min(pasted.length, numInputs - 1);
|
|
5824
|
-
(
|
|
6086
|
+
(_a126 = inputRefs.current[nextIdx]) == null ? void 0 : _a126.focus();
|
|
5825
6087
|
},
|
|
5826
6088
|
[numInputs, onChange]
|
|
5827
6089
|
);
|
|
5828
6090
|
useEffect(() => {
|
|
5829
6091
|
const timer = setTimeout(() => {
|
|
5830
|
-
var
|
|
5831
|
-
return (
|
|
6092
|
+
var _a126;
|
|
6093
|
+
return (_a126 = inputRefs.current[0]) == null ? void 0 : _a126.focus();
|
|
5832
6094
|
}, 100);
|
|
5833
6095
|
return () => clearTimeout(timer);
|
|
5834
6096
|
}, []);
|
|
@@ -5915,7 +6177,7 @@ var BaseModalOTP = ({
|
|
|
5915
6177
|
},
|
|
5916
6178
|
children: [
|
|
5917
6179
|
/* @__PURE__ */ jsx(DialogTitle2, { sx: { p: 0 }, children: /* @__PURE__ */ jsx(
|
|
5918
|
-
|
|
6180
|
+
IconButton9,
|
|
5919
6181
|
{
|
|
5920
6182
|
onClick: handleClose,
|
|
5921
6183
|
sx: {
|
|
@@ -5927,7 +6189,7 @@ var BaseModalOTP = ({
|
|
|
5927
6189
|
}
|
|
5928
6190
|
) }),
|
|
5929
6191
|
/* @__PURE__ */ jsx(DialogContent5, { sx: { p: 0 }, children: /* @__PURE__ */ jsxs(
|
|
5930
|
-
|
|
6192
|
+
Box23,
|
|
5931
6193
|
{
|
|
5932
6194
|
display: "flex",
|
|
5933
6195
|
flexDirection: "column",
|
|
@@ -5958,7 +6220,7 @@ var BaseModalOTP = ({
|
|
|
5958
6220
|
]
|
|
5959
6221
|
}
|
|
5960
6222
|
),
|
|
5961
|
-
/* @__PURE__ */ jsx(
|
|
6223
|
+
/* @__PURE__ */ jsx(Box23, { width: "100%", display: "flex", justifyContent: "center", children: /* @__PURE__ */ jsxs(
|
|
5962
6224
|
"form",
|
|
5963
6225
|
{
|
|
5964
6226
|
autoComplete: "off",
|
|
@@ -6044,8 +6306,8 @@ var BaseModalOTP = ({
|
|
|
6044
6306
|
}
|
|
6045
6307
|
);
|
|
6046
6308
|
};
|
|
6047
|
-
var
|
|
6048
|
-
var
|
|
6309
|
+
var _a125, _b125;
|
|
6310
|
+
var Box24 = (_b125 = (_a125 = BoxRaw) == null ? void 0 : _a125.default) != null ? _b125 : BoxRaw;
|
|
6049
6311
|
var FORM_TYPE = {
|
|
6050
6312
|
TEXT_FIELD: "text-field",
|
|
6051
6313
|
TEXT_AREA: "text-area",
|
|
@@ -6063,10 +6325,10 @@ var FORM_TYPE = {
|
|
|
6063
6325
|
RADIO: "radio",
|
|
6064
6326
|
CUSTOM: "custom"
|
|
6065
6327
|
};
|
|
6066
|
-
var FormContent = (
|
|
6067
|
-
var
|
|
6068
|
-
var
|
|
6069
|
-
const
|
|
6328
|
+
var FormContent = (_a126) => {
|
|
6329
|
+
var _b126 = _a126, { type } = _b126, restProps = __objRest(_b126, ["type"]);
|
|
6330
|
+
var _b127;
|
|
6331
|
+
const _a127 = restProps, { layout: _layout, labelWidth: _labelWidth, divider: _divider } = _a127, componentProps = __objRest(_a127, ["layout", "labelWidth", "divider"]);
|
|
6070
6332
|
switch (type) {
|
|
6071
6333
|
case FORM_TYPE.TEXT_FIELD:
|
|
6072
6334
|
return /* @__PURE__ */ jsx(BaseTextField, __spreadValues({}, componentProps));
|
|
@@ -6097,7 +6359,7 @@ var FormContent = (_a120) => {
|
|
|
6097
6359
|
case FORM_TYPE.RADIO:
|
|
6098
6360
|
return /* @__PURE__ */ jsx(BaseRadioButton, __spreadValues({}, componentProps));
|
|
6099
6361
|
case FORM_TYPE.CUSTOM:
|
|
6100
|
-
return (
|
|
6362
|
+
return (_b127 = componentProps.component) != null ? _b127 : null;
|
|
6101
6363
|
default:
|
|
6102
6364
|
return null;
|
|
6103
6365
|
}
|
|
@@ -6108,7 +6370,7 @@ var FormField = ({ item, index, control, resolvedLayout, resolvedLabelWidth, res
|
|
|
6108
6370
|
const fieldDivider = item.divider !== void 0 ? item.divider : resolvedDivider;
|
|
6109
6371
|
if (fieldLayout === "horizontal") {
|
|
6110
6372
|
return /* @__PURE__ */ jsxs(
|
|
6111
|
-
|
|
6373
|
+
Box24,
|
|
6112
6374
|
{
|
|
6113
6375
|
sx: __spreadValues({
|
|
6114
6376
|
display: "grid",
|
|
@@ -6119,11 +6381,11 @@ var FormField = ({ item, index, control, resolvedLayout, resolvedLabelWidth, res
|
|
|
6119
6381
|
borderBottom: `1px solid ${DerivedColor.color_border_default}`
|
|
6120
6382
|
}),
|
|
6121
6383
|
children: [
|
|
6122
|
-
/* @__PURE__ */ jsxs(
|
|
6384
|
+
/* @__PURE__ */ jsxs(Box24, { sx: { display: "flex", justifyContent: "space-between", pr: 2 }, children: [
|
|
6123
6385
|
/* @__PURE__ */ jsx(BaseTypography, { variant: "body1_regular.default", children: item.title || item.name }),
|
|
6124
6386
|
/* @__PURE__ */ jsx(BaseTypography, { variant: "body1_regular.default", children: ":" })
|
|
6125
6387
|
] }),
|
|
6126
|
-
/* @__PURE__ */ jsx(
|
|
6388
|
+
/* @__PURE__ */ jsx(Box24, { children: /* @__PURE__ */ jsx(
|
|
6127
6389
|
FormContent,
|
|
6128
6390
|
__spreadProps(__spreadValues({
|
|
6129
6391
|
control
|
|
@@ -6145,27 +6407,27 @@ var FormField = ({ item, index, control, resolvedLayout, resolvedLabelWidth, res
|
|
|
6145
6407
|
);
|
|
6146
6408
|
};
|
|
6147
6409
|
var Form = ({ children, sx = {}, methods, onSubmit }) => {
|
|
6148
|
-
return /* @__PURE__ */ jsx(
|
|
6149
|
-
var
|
|
6410
|
+
return /* @__PURE__ */ jsx(Box24, { component: "form", sx, onSubmit: methods == null ? void 0 : methods.handleSubmit(onSubmit), children: React2.Children.map(children, (child) => {
|
|
6411
|
+
var _a126;
|
|
6150
6412
|
if (!child) return null;
|
|
6151
|
-
return ((
|
|
6413
|
+
return ((_a126 = child.props) == null ? void 0 : _a126.name) ? React2.createElement(child.type, __spreadProps(__spreadValues({}, child.props), {
|
|
6152
6414
|
control: methods == null ? void 0 : methods.control,
|
|
6153
6415
|
key: child.props.name
|
|
6154
6416
|
})) : child;
|
|
6155
6417
|
}) });
|
|
6156
6418
|
};
|
|
6157
6419
|
var SubForm = ({ children, sx = {}, methods }) => {
|
|
6158
|
-
return /* @__PURE__ */ jsx(
|
|
6159
|
-
var
|
|
6420
|
+
return /* @__PURE__ */ jsx(Box24, { sx, children: React2.Children.map(children, (child) => {
|
|
6421
|
+
var _a126;
|
|
6160
6422
|
if (!child) return null;
|
|
6161
|
-
return ((
|
|
6423
|
+
return ((_a126 = child.props) == null ? void 0 : _a126.name) ? React2.createElement(child.type, __spreadProps(__spreadValues({}, child.props), {
|
|
6162
6424
|
control: methods == null ? void 0 : methods.control,
|
|
6163
6425
|
key: child.props.name
|
|
6164
6426
|
})) : child;
|
|
6165
6427
|
}) });
|
|
6166
6428
|
};
|
|
6167
|
-
var FormBuilder = (
|
|
6168
|
-
var
|
|
6429
|
+
var FormBuilder = (_a126) => {
|
|
6430
|
+
var _b126 = _a126, {
|
|
6169
6431
|
sx = {},
|
|
6170
6432
|
fields = [],
|
|
6171
6433
|
methods,
|
|
@@ -6175,7 +6437,7 @@ var FormBuilder = (_a120) => {
|
|
|
6175
6437
|
layout = "vertical",
|
|
6176
6438
|
labelWidth = "30%",
|
|
6177
6439
|
divider = false
|
|
6178
|
-
} =
|
|
6440
|
+
} = _b126, restProps = __objRest(_b126, [
|
|
6179
6441
|
"sx",
|
|
6180
6442
|
"fields",
|
|
6181
6443
|
"methods",
|
|
@@ -6188,7 +6450,7 @@ var FormBuilder = (_a120) => {
|
|
|
6188
6450
|
]);
|
|
6189
6451
|
const resolvedGap = layout === "horizontal" && gap === 16 ? 0 : gap;
|
|
6190
6452
|
const layoutSx = columns > 1 ? { display: "grid", gridTemplateColumns: `repeat(${columns}, 1fr)`, gap: `${resolvedGap}px` } : { display: "flex", flexDirection: "column", gap: `${resolvedGap}px` };
|
|
6191
|
-
return /* @__PURE__ */ jsx(Form, __spreadProps(__spreadValues({ sx, methods, onSubmit }, restProps), { children: /* @__PURE__ */ jsx(
|
|
6453
|
+
return /* @__PURE__ */ jsx(Form, __spreadProps(__spreadValues({ sx, methods, onSubmit }, restProps), { children: /* @__PURE__ */ jsx(Box24, { sx: layoutSx, children: fields.map((item, index) => /* @__PURE__ */ jsx(
|
|
6192
6454
|
FormField,
|
|
6193
6455
|
{
|
|
6194
6456
|
item,
|
|
@@ -6213,7 +6475,7 @@ var SubFormBuilder = ({
|
|
|
6213
6475
|
}) => {
|
|
6214
6476
|
const resolvedGap = layout === "horizontal" && gap === 16 ? 0 : gap;
|
|
6215
6477
|
const layoutSx = columns > 1 ? { display: "grid", gridTemplateColumns: `repeat(${columns}, 1fr)`, gap: `${resolvedGap}px` } : { display: "flex", flexDirection: "column", gap: `${resolvedGap}px` };
|
|
6216
|
-
return /* @__PURE__ */ jsx(SubForm, { sx, methods, children: /* @__PURE__ */ jsx(
|
|
6478
|
+
return /* @__PURE__ */ jsx(SubForm, { sx, methods, children: /* @__PURE__ */ jsx(Box24, { sx: layoutSx, children: fields.map((item, index) => /* @__PURE__ */ jsx(
|
|
6217
6479
|
FormField,
|
|
6218
6480
|
{
|
|
6219
6481
|
item,
|
|
@@ -6227,6 +6489,6 @@ var SubFormBuilder = ({
|
|
|
6227
6489
|
)) }) });
|
|
6228
6490
|
};
|
|
6229
6491
|
|
|
6230
|
-
export { BaseAlert, BaseButton, BaseCard, BaseCheckbox, BaseDatatable, BaseDatePicker, BaseDropdown, BaseDropzone, BaseModalAlert, BaseModalAlertDialog, BaseModalAlertProvider, BaseModalLoading, BaseModalLoadingDialog, BaseModalLoadingProvider, BaseModalOTP, BaseModalPopup, BaseModalStepper, BaseRadioButton, BaseSkeleton, BaseSnackbar, BaseStepper, BaseSwitch, BaseTextArea, BaseTextField, BaseTypography, CapsLockOn, DownloadIconLarge, FORM_TYPE, FormBuilder, IconBiometricScan, IconDocumentAdd, IconEdit, IconFile, IconGradingRounded, IconListDocument, IconMoney, IconProgress, IconReset, IconSave, IconSaveOutlined, IconSendWhite, IconSendWhiteFull, IconUpload, IconUserScan, IconVerification, MoneyIcon, Radius, radius_default as RadiusToken, ServerSidePaginationActions, Shadow, shadow_default as ShadowToken, SubFormBuilder, TextFieldUpload, UsersIcon, VariantStyles };
|
|
6492
|
+
export { BaseAlert, BaseButton, BaseCard, BaseCheckbox, BaseChip, BaseDatatable, BaseDatePicker, BaseDropdown, BaseDropzone, BaseModalAlert, BaseModalAlertDialog, BaseModalAlertProvider, BaseModalLoading, BaseModalLoadingDialog, BaseModalLoadingProvider, BaseModalOTP, BaseModalPopup, BaseModalStepper, BaseRadioButton, BaseSkeleton, BaseSnackbar, BaseStepper, BaseSwitch, BaseTextArea, BaseTextField, BaseTypography, CapsLockOn, DatatablePagination, DownloadIconLarge, FORM_TYPE, FormBuilder, IconBiometricScan, IconDocumentAdd, IconEdit, IconFile, IconGradingRounded, IconListDocument, IconMoney, IconProgress, IconReset, IconSave, IconSaveOutlined, IconSendWhite, IconSendWhiteFull, IconUpload, IconUserScan, IconVerification, MoneyIcon, Radius, radius_default as RadiusToken, ServerSidePaginationActions, Shadow, shadow_default as ShadowToken, SubFormBuilder, TextFieldUpload, UsersIcon, VariantStyles };
|
|
6231
6493
|
//# sourceMappingURL=index.mjs.map
|
|
6232
6494
|
//# sourceMappingURL=index.mjs.map
|