spotlibs-components 0.1.20 → 0.1.21
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 +12 -1
- package/dist/index.mjs +561 -421
- package/dist/index.mjs.map +1 -1
- package/dist/utils/index.mjs +17 -1
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/utils/index.js +3 -0
- package/src/utils/navigateToCI.d.ts +18 -0
- package/src/utils/navigateToCI.js +62 -0
package/dist/index.mjs
CHANGED
|
@@ -54,7 +54,7 @@ import CloseIconRaw from '@mui/icons-material/Close';
|
|
|
54
54
|
import { id } from 'date-fns/locale';
|
|
55
55
|
import 'react-date-range/dist/styles.css';
|
|
56
56
|
import 'react-date-range/dist/theme/default.css';
|
|
57
|
-
import
|
|
57
|
+
import Select3, { components } from 'react-select';
|
|
58
58
|
import AsyncSelect from 'react-select/async';
|
|
59
59
|
import { ErrorMessage } from '@hookform/error-message';
|
|
60
60
|
import Dropzone from 'react-dropzone';
|
|
@@ -573,18 +573,18 @@ var Radius = {
|
|
|
573
573
|
radius_4: "16px",
|
|
574
574
|
radius_x: "999px"
|
|
575
575
|
};
|
|
576
|
-
var RadiusToken = (
|
|
577
|
-
var
|
|
576
|
+
var RadiusToken = (_a130) => {
|
|
577
|
+
var _b130 = _a130, {
|
|
578
578
|
radius = "radius_0",
|
|
579
579
|
children,
|
|
580
580
|
sx = {}
|
|
581
|
-
} =
|
|
581
|
+
} = _b130, rest = __objRest(_b130, [
|
|
582
582
|
"radius",
|
|
583
583
|
"children",
|
|
584
584
|
"sx"
|
|
585
585
|
]);
|
|
586
|
-
var
|
|
587
|
-
const borderRadius = (
|
|
586
|
+
var _a131;
|
|
587
|
+
const borderRadius = (_a131 = Radius[radius]) != null ? _a131 : Radius.radius_0;
|
|
588
588
|
return /* @__PURE__ */ jsx(
|
|
589
589
|
Box,
|
|
590
590
|
__spreadProps(__spreadValues({
|
|
@@ -733,12 +733,12 @@ var VariantStyles = {
|
|
|
733
733
|
fontWeight: 400
|
|
734
734
|
}
|
|
735
735
|
};
|
|
736
|
-
var BaseTypography = (
|
|
737
|
-
var
|
|
736
|
+
var BaseTypography = (_a130) => {
|
|
737
|
+
var _b130 = _a130, {
|
|
738
738
|
variant = "body1_regular.default",
|
|
739
739
|
children,
|
|
740
740
|
sx
|
|
741
|
-
} =
|
|
741
|
+
} = _b130, props = __objRest(_b130, [
|
|
742
742
|
"variant",
|
|
743
743
|
"children",
|
|
744
744
|
"sx"
|
|
@@ -806,8 +806,8 @@ var ALERT_CONFIG = {
|
|
|
806
806
|
defaultIcon: IconAlertTriangle
|
|
807
807
|
}
|
|
808
808
|
};
|
|
809
|
-
var BaseAlert = (
|
|
810
|
-
var
|
|
809
|
+
var BaseAlert = (_a130) => {
|
|
810
|
+
var _b130 = _a130, {
|
|
811
811
|
variant = "default",
|
|
812
812
|
type = "standard",
|
|
813
813
|
title,
|
|
@@ -817,7 +817,7 @@ var BaseAlert = (_a126) => {
|
|
|
817
817
|
sx = {},
|
|
818
818
|
onClose,
|
|
819
819
|
childrenSx = {}
|
|
820
|
-
} =
|
|
820
|
+
} = _b130, props = __objRest(_b130, [
|
|
821
821
|
"variant",
|
|
822
822
|
"type",
|
|
823
823
|
"title",
|
|
@@ -828,8 +828,8 @@ var BaseAlert = (_a126) => {
|
|
|
828
828
|
"onClose",
|
|
829
829
|
"childrenSx"
|
|
830
830
|
]);
|
|
831
|
-
var
|
|
832
|
-
const config = (
|
|
831
|
+
var _a131;
|
|
832
|
+
const config = (_a131 = ALERT_CONFIG[variant]) != null ? _a131 : ALERT_CONFIG.default;
|
|
833
833
|
const hasChildrenSx = Object.keys(childrenSx).length > 0;
|
|
834
834
|
const renderIcon = useMemo(() => {
|
|
835
835
|
if (!icon) return false;
|
|
@@ -894,12 +894,12 @@ var Shadow = {
|
|
|
894
894
|
surface: "#FFFFFF"
|
|
895
895
|
}
|
|
896
896
|
};
|
|
897
|
-
var ShadowToken = (
|
|
898
|
-
var
|
|
897
|
+
var ShadowToken = (_a130) => {
|
|
898
|
+
var _b130 = _a130, {
|
|
899
899
|
level = "elevation_0",
|
|
900
900
|
children,
|
|
901
901
|
sx = {}
|
|
902
|
-
} =
|
|
902
|
+
} = _b130, rest = __objRest(_b130, [
|
|
903
903
|
"level",
|
|
904
904
|
"children",
|
|
905
905
|
"sx"
|
|
@@ -991,8 +991,8 @@ function getHoverColor(primitiveKey) {
|
|
|
991
991
|
const hoverKey = `${prefix}_${nextLevel}`;
|
|
992
992
|
return PrimitiveColor[hoverKey] || PrimitiveColor[primitiveKey];
|
|
993
993
|
}
|
|
994
|
-
var BaseButton = (
|
|
995
|
-
var
|
|
994
|
+
var BaseButton = (_a130) => {
|
|
995
|
+
var _b130 = _a130, {
|
|
996
996
|
onClick = () => {
|
|
997
997
|
},
|
|
998
998
|
children = null,
|
|
@@ -1005,7 +1005,7 @@ var BaseButton = (_a126) => {
|
|
|
1005
1005
|
endIcon = null,
|
|
1006
1006
|
width = "100%",
|
|
1007
1007
|
sx = {}
|
|
1008
|
-
} =
|
|
1008
|
+
} = _b130, rest = __objRest(_b130, [
|
|
1009
1009
|
"onClick",
|
|
1010
1010
|
"children",
|
|
1011
1011
|
"variant",
|
|
@@ -1025,36 +1025,36 @@ var BaseButton = (_a126) => {
|
|
|
1025
1025
|
const customColorValue = useCustom ? PrimitiveColor[customColor] : null;
|
|
1026
1026
|
const customHoverValue = useCustom ? getHoverColor(customColor) : null;
|
|
1027
1027
|
const getBackgroundColor = () => {
|
|
1028
|
-
var
|
|
1028
|
+
var _a131;
|
|
1029
1029
|
if (disabled) return isFill ? DISABLED_BG : "transparent";
|
|
1030
1030
|
if (useCustom) return isFill ? customColorValue : "transparent";
|
|
1031
|
-
if (isFill) return ((
|
|
1031
|
+
if (isFill) return ((_a131 = FILL_COLORS[color]) == null ? void 0 : _a131.bg) || FILL_COLORS.primary.bg;
|
|
1032
1032
|
return "transparent";
|
|
1033
1033
|
};
|
|
1034
1034
|
const getTextColor = () => {
|
|
1035
|
-
var
|
|
1035
|
+
var _a131, _b131;
|
|
1036
1036
|
if (disabled) return DISABLED_TEXT;
|
|
1037
1037
|
if (isFill) return WHITE;
|
|
1038
1038
|
if (useCustom) return customColorValue;
|
|
1039
|
-
if (isOutline) return ((
|
|
1040
|
-
if (isText) return ((
|
|
1039
|
+
if (isOutline) return ((_a131 = OUTLINE_COLORS[color]) == null ? void 0 : _a131.text) || OUTLINE_COLORS.primary.text;
|
|
1040
|
+
if (isText) return ((_b131 = OUTLINE_COLORS[color]) == null ? void 0 : _b131.text) || OUTLINE_COLORS.primary.text;
|
|
1041
1041
|
return DerivedColor.color_text_default;
|
|
1042
1042
|
};
|
|
1043
1043
|
const getBorderColor = () => {
|
|
1044
|
-
var
|
|
1044
|
+
var _a131;
|
|
1045
1045
|
if (!isOutline) return "none";
|
|
1046
1046
|
if (disabled) return `1.5px solid ${DISABLED_BG}`;
|
|
1047
1047
|
if (useCustom) return `1.5px solid ${customColorValue}`;
|
|
1048
|
-
return `1.5px solid ${((
|
|
1048
|
+
return `1.5px solid ${((_a131 = OUTLINE_COLORS[color]) == null ? void 0 : _a131.border) || OUTLINE_COLORS.primary.border}`;
|
|
1049
1049
|
};
|
|
1050
1050
|
const getHoverBg = () => {
|
|
1051
|
-
var
|
|
1051
|
+
var _a131, _b131;
|
|
1052
1052
|
if (disabled) return void 0;
|
|
1053
1053
|
if (useCustom) {
|
|
1054
1054
|
return isFill ? customHoverValue : customColorValue + "1A";
|
|
1055
1055
|
}
|
|
1056
|
-
if (isFill) return ((
|
|
1057
|
-
if (isOutline) return ((
|
|
1056
|
+
if (isFill) return ((_a131 = FILL_COLORS[color]) == null ? void 0 : _a131.hover) || FILL_COLORS.primary.hover;
|
|
1057
|
+
if (isOutline) return ((_b131 = OUTLINE_COLORS[color]) == null ? void 0 : _b131.hoverBg) || OUTLINE_COLORS.primary.hoverBg;
|
|
1058
1058
|
return void 0;
|
|
1059
1059
|
};
|
|
1060
1060
|
const getRadius = () => {
|
|
@@ -1139,8 +1139,8 @@ var _a9, _b9;
|
|
|
1139
1139
|
var Skeleton = (_b9 = (_a9 = SkeletonRaw) == null ? void 0 : _a9.default) != null ? _b9 : SkeletonRaw;
|
|
1140
1140
|
var _a10, _b10;
|
|
1141
1141
|
var Box5 = (_b10 = (_a10 = BoxRaw) == null ? void 0 : _a10.default) != null ? _b10 : BoxRaw;
|
|
1142
|
-
var BaseSkeleton = (
|
|
1143
|
-
var
|
|
1142
|
+
var BaseSkeleton = (_a130) => {
|
|
1143
|
+
var _b130 = _a130, {
|
|
1144
1144
|
variant = "rectangular",
|
|
1145
1145
|
animation = "pulse",
|
|
1146
1146
|
width,
|
|
@@ -1148,7 +1148,7 @@ var BaseSkeleton = (_a126) => {
|
|
|
1148
1148
|
count = 1,
|
|
1149
1149
|
gap = SpacingToken.spacing2,
|
|
1150
1150
|
sx = {}
|
|
1151
|
-
} =
|
|
1151
|
+
} = _b130, rest = __objRest(_b130, [
|
|
1152
1152
|
"variant",
|
|
1153
1153
|
"animation",
|
|
1154
1154
|
"width",
|
|
@@ -1349,8 +1349,8 @@ var TYPE_STYLES = {
|
|
|
1349
1349
|
icon: null
|
|
1350
1350
|
}
|
|
1351
1351
|
};
|
|
1352
|
-
var BaseChip = (
|
|
1353
|
-
var
|
|
1352
|
+
var BaseChip = (_a130) => {
|
|
1353
|
+
var _b130 = _a130, {
|
|
1354
1354
|
label = "",
|
|
1355
1355
|
type = "default",
|
|
1356
1356
|
variant = "filled",
|
|
@@ -1361,7 +1361,7 @@ var BaseChip = (_a126) => {
|
|
|
1361
1361
|
fullWidth = false,
|
|
1362
1362
|
showIcon = true,
|
|
1363
1363
|
sx = {}
|
|
1364
|
-
} =
|
|
1364
|
+
} = _b130, rest = __objRest(_b130, [
|
|
1365
1365
|
"label",
|
|
1366
1366
|
"type",
|
|
1367
1367
|
"variant",
|
|
@@ -1440,8 +1440,8 @@ var HEADER_ICON_COLORS = {
|
|
|
1440
1440
|
danger: DerivedColor.color_bg_surface,
|
|
1441
1441
|
clean: DerivedColor.color_text_subtle
|
|
1442
1442
|
};
|
|
1443
|
-
var BaseCard = (
|
|
1444
|
-
var
|
|
1443
|
+
var BaseCard = (_a130) => {
|
|
1444
|
+
var _b130 = _a130, {
|
|
1445
1445
|
variant = "default",
|
|
1446
1446
|
children = null,
|
|
1447
1447
|
color = "primary",
|
|
@@ -1460,7 +1460,7 @@ var BaseCard = (_a126) => {
|
|
|
1460
1460
|
isWatermark = false,
|
|
1461
1461
|
watermarkText = "",
|
|
1462
1462
|
sx = {}
|
|
1463
|
-
} =
|
|
1463
|
+
} = _b130, rest = __objRest(_b130, [
|
|
1464
1464
|
"variant",
|
|
1465
1465
|
"children",
|
|
1466
1466
|
"color",
|
|
@@ -1562,7 +1562,7 @@ var BaseCard = (_a126) => {
|
|
|
1562
1562
|
opacity: 0.15,
|
|
1563
1563
|
gutter: 20,
|
|
1564
1564
|
rotate: -30,
|
|
1565
|
-
wrapperStyle: { minHeight: "100px" },
|
|
1565
|
+
wrapperStyle: { minHeight: "100px", position: "relative" },
|
|
1566
1566
|
children
|
|
1567
1567
|
}
|
|
1568
1568
|
) : children
|
|
@@ -1576,7 +1576,7 @@ var BaseCard = (_a126) => {
|
|
|
1576
1576
|
borderRadius: Radius.radius_2,
|
|
1577
1577
|
backgroundColor: cardBg,
|
|
1578
1578
|
border: `1px solid ${borderColor}`,
|
|
1579
|
-
overflow: "visible",
|
|
1579
|
+
overflow: isWatermark ? "hidden" : "visible",
|
|
1580
1580
|
boxShadow: "none",
|
|
1581
1581
|
padding: SpacingToken.spacing4,
|
|
1582
1582
|
position: "relative"
|
|
@@ -1591,7 +1591,7 @@ var BaseCard = (_a126) => {
|
|
|
1591
1591
|
opacity: 0.15,
|
|
1592
1592
|
gutter: 20,
|
|
1593
1593
|
rotate: -30,
|
|
1594
|
-
wrapperStyle: { minHeight: "100px" },
|
|
1594
|
+
wrapperStyle: { minHeight: "100px", position: "relative" },
|
|
1595
1595
|
children
|
|
1596
1596
|
}
|
|
1597
1597
|
) : children
|
|
@@ -1605,7 +1605,7 @@ var BaseCard = (_a126) => {
|
|
|
1605
1605
|
sx: __spreadValues({
|
|
1606
1606
|
borderRadius: Radius.radius_2,
|
|
1607
1607
|
border: `1px solid ${borderColor}`,
|
|
1608
|
-
overflow: "visible",
|
|
1608
|
+
overflow: isWatermark ? "hidden" : "visible",
|
|
1609
1609
|
boxShadow: "none"
|
|
1610
1610
|
}, sx)
|
|
1611
1611
|
}, rest), {
|
|
@@ -1623,7 +1623,7 @@ var BaseCard = (_a126) => {
|
|
|
1623
1623
|
sx: __spreadValues({
|
|
1624
1624
|
borderRadius: Radius.radius_2,
|
|
1625
1625
|
border: `1px solid ${borderColor}`,
|
|
1626
|
-
overflow: "visible",
|
|
1626
|
+
overflow: isWatermark ? "hidden" : "visible",
|
|
1627
1627
|
boxShadow: "none"
|
|
1628
1628
|
}, sx)
|
|
1629
1629
|
}, rest), {
|
|
@@ -1689,8 +1689,8 @@ var VARIANT_CONFIG = {
|
|
|
1689
1689
|
text: PrimitiveColor.color_neutral_900
|
|
1690
1690
|
}
|
|
1691
1691
|
};
|
|
1692
|
-
var BaseSnackbar = (
|
|
1693
|
-
var
|
|
1692
|
+
var BaseSnackbar = (_a130) => {
|
|
1693
|
+
var _b130 = _a130, {
|
|
1694
1694
|
open = false,
|
|
1695
1695
|
onClose,
|
|
1696
1696
|
message,
|
|
@@ -1699,7 +1699,7 @@ var BaseSnackbar = (_a126) => {
|
|
|
1699
1699
|
position = { vertical: "top", horizontal: "center" },
|
|
1700
1700
|
icon,
|
|
1701
1701
|
sx = {}
|
|
1702
|
-
} =
|
|
1702
|
+
} = _b130, props = __objRest(_b130, [
|
|
1703
1703
|
"open",
|
|
1704
1704
|
"onClose",
|
|
1705
1705
|
"message",
|
|
@@ -1709,8 +1709,8 @@ var BaseSnackbar = (_a126) => {
|
|
|
1709
1709
|
"icon",
|
|
1710
1710
|
"sx"
|
|
1711
1711
|
]);
|
|
1712
|
-
var
|
|
1713
|
-
const config = (
|
|
1712
|
+
var _a131;
|
|
1713
|
+
const config = (_a131 = VARIANT_CONFIG[variant]) != null ? _a131 : VARIANT_CONFIG.info;
|
|
1714
1714
|
const renderIcon = useMemo(() => {
|
|
1715
1715
|
if (!icon) return false;
|
|
1716
1716
|
if (isValidElement(icon)) return icon;
|
|
@@ -1775,8 +1775,8 @@ var _a25, _b25;
|
|
|
1775
1775
|
var FormGroup = (_b25 = (_a25 = FormGroupRaw) == null ? void 0 : _a25.default) != null ? _b25 : FormGroupRaw;
|
|
1776
1776
|
var _a26, _b26;
|
|
1777
1777
|
var Box8 = (_b26 = (_a26 = BoxRaw) == null ? void 0 : _a26.default) != null ? _b26 : BoxRaw;
|
|
1778
|
-
var BaseCheckbox = (
|
|
1779
|
-
var
|
|
1778
|
+
var BaseCheckbox = (_a130) => {
|
|
1779
|
+
var _b130 = _a130, {
|
|
1780
1780
|
name = "",
|
|
1781
1781
|
control = null,
|
|
1782
1782
|
defaultValue,
|
|
@@ -1787,7 +1787,7 @@ var BaseCheckbox = (_a126) => {
|
|
|
1787
1787
|
labelPlacement = "end",
|
|
1788
1788
|
isHorizontal = false,
|
|
1789
1789
|
sx
|
|
1790
|
-
} =
|
|
1790
|
+
} = _b130, restProps = __objRest(_b130, [
|
|
1791
1791
|
"name",
|
|
1792
1792
|
"control",
|
|
1793
1793
|
"defaultValue",
|
|
@@ -1799,11 +1799,11 @@ var BaseCheckbox = (_a126) => {
|
|
|
1799
1799
|
"isHorizontal",
|
|
1800
1800
|
"sx"
|
|
1801
1801
|
]);
|
|
1802
|
-
var
|
|
1802
|
+
var _a131, _b131, _c;
|
|
1803
1803
|
const hookForm = control ? useController({ control, name, defaultValue: defaultValue != null ? defaultValue : [] }) : null;
|
|
1804
1804
|
const field = hookForm == null ? void 0 : hookForm.field;
|
|
1805
1805
|
const formState = hookForm == null ? void 0 : hookForm.formState;
|
|
1806
|
-
const hasError = !!((
|
|
1806
|
+
const hasError = !!((_a131 = formState == null ? void 0 : formState.errors) == null ? void 0 : _a131[name]);
|
|
1807
1807
|
const checkedValue = field ? field.value : restProps.checked;
|
|
1808
1808
|
const handleChange = field ? (newVal) => field.onChange(newVal) : restProps.onChange;
|
|
1809
1809
|
const isGroup = Array.isArray(options);
|
|
@@ -1817,14 +1817,14 @@ var BaseCheckbox = (_a126) => {
|
|
|
1817
1817
|
handleChange == null ? void 0 : handleChange(newChecked);
|
|
1818
1818
|
};
|
|
1819
1819
|
const handleSingleChange = (e) => {
|
|
1820
|
-
var
|
|
1820
|
+
var _a132;
|
|
1821
1821
|
if (field) {
|
|
1822
1822
|
field.onChange(e.target.checked);
|
|
1823
1823
|
} else {
|
|
1824
|
-
(
|
|
1824
|
+
(_a132 = restProps.onChange) == null ? void 0 : _a132.call(restProps, e.target.checked, e);
|
|
1825
1825
|
}
|
|
1826
1826
|
};
|
|
1827
|
-
const errorMessage = (_c = (
|
|
1827
|
+
const errorMessage = (_c = (_b131 = formState == null ? void 0 : formState.errors) == null ? void 0 : _b131[name]) == null ? void 0 : _c.message;
|
|
1828
1828
|
const iconColor = hasError ? DerivedColor.color_text_danger : DerivedColor.color_border_default;
|
|
1829
1829
|
const checkedIconColor = hasError ? DerivedColor.color_text_danger : DerivedColor.color_bg_brand_primary;
|
|
1830
1830
|
if (isGroup) {
|
|
@@ -1842,7 +1842,7 @@ var BaseCheckbox = (_a126) => {
|
|
|
1842
1842
|
}
|
|
1843
1843
|
),
|
|
1844
1844
|
/* @__PURE__ */ jsx(FormGroup, { row: isHorizontal, sx: { gap: isHorizontal ? 2 : 0 }, children: options.map((option) => {
|
|
1845
|
-
var
|
|
1845
|
+
var _a132, _b132;
|
|
1846
1846
|
return /* @__PURE__ */ jsx(
|
|
1847
1847
|
FormControlLabel,
|
|
1848
1848
|
{
|
|
@@ -1857,8 +1857,8 @@ var BaseCheckbox = (_a126) => {
|
|
|
1857
1857
|
checked: (checkedValue || []).includes(option.value),
|
|
1858
1858
|
onChange: (e) => handleGroupChange(option.value, e.target.checked),
|
|
1859
1859
|
icon: /* @__PURE__ */ jsx(IconSquare, { size: 22, color: iconColor }),
|
|
1860
|
-
checkedIcon: /* @__PURE__ */ jsx(IconSquareCheckFilled, { size: 22, color: ((
|
|
1861
|
-
disabled: (
|
|
1860
|
+
checkedIcon: /* @__PURE__ */ jsx(IconSquareCheckFilled, { size: 22, color: ((_a132 = option.disabled) != null ? _a132 : disabled) ? DerivedColor.color_bg_disabled : checkedIconColor }),
|
|
1861
|
+
disabled: (_b132 = option.disabled) != null ? _b132 : disabled,
|
|
1862
1862
|
sx: {
|
|
1863
1863
|
":hover": { backgroundColor: "#C0DBF1" }
|
|
1864
1864
|
}
|
|
@@ -1950,16 +1950,16 @@ function getVisiblePages(currentPage, totalPages, maxVisible = 3) {
|
|
|
1950
1950
|
if (totalPages <= maxVisible) {
|
|
1951
1951
|
return Array.from({ length: totalPages }, (_, i) => i);
|
|
1952
1952
|
}
|
|
1953
|
-
|
|
1954
|
-
|
|
1953
|
+
const half = Math.floor(maxVisible / 2);
|
|
1954
|
+
let start = currentPage - half;
|
|
1955
|
+
let end = currentPage + (maxVisible - 1 - half);
|
|
1956
|
+
if (start < 0) {
|
|
1955
1957
|
start = 0;
|
|
1956
|
-
|
|
1957
|
-
start = currentPage;
|
|
1958
|
+
end = maxVisible - 1;
|
|
1958
1959
|
}
|
|
1959
|
-
let end = start + maxVisible - 1;
|
|
1960
1960
|
if (end >= totalPages) {
|
|
1961
1961
|
end = totalPages - 1;
|
|
1962
|
-
start =
|
|
1962
|
+
start = totalPages - maxVisible;
|
|
1963
1963
|
}
|
|
1964
1964
|
const pages = [];
|
|
1965
1965
|
for (let i = start; i <= end; i++) {
|
|
@@ -2182,23 +2182,173 @@ var DatatablePagination = ({
|
|
|
2182
2182
|
var _a35, _b35;
|
|
2183
2183
|
var Box10 = (_b35 = (_a35 = BoxRaw) == null ? void 0 : _a35.default) != null ? _b35 : BoxRaw;
|
|
2184
2184
|
var _a36, _b36;
|
|
2185
|
-
var
|
|
2185
|
+
var Select2 = (_b36 = (_a36 = SelectRaw) == null ? void 0 : _a36.default) != null ? _b36 : SelectRaw;
|
|
2186
2186
|
var _a37, _b37;
|
|
2187
|
-
var
|
|
2187
|
+
var MenuItem2 = (_b37 = (_a37 = MenuItemRaw) == null ? void 0 : _a37.default) != null ? _b37 : MenuItemRaw;
|
|
2188
2188
|
var _a38, _b38;
|
|
2189
|
-
var
|
|
2189
|
+
var IconButton5 = (_b38 = (_a38 = IconButtonRaw) == null ? void 0 : _a38.default) != null ? _b38 : IconButtonRaw;
|
|
2190
|
+
function getVisiblePages2(currentPage, totalPages, maxVisible = 3) {
|
|
2191
|
+
if (totalPages <= maxVisible) {
|
|
2192
|
+
return Array.from({ length: totalPages }, (_, i) => i);
|
|
2193
|
+
}
|
|
2194
|
+
const half = Math.floor(maxVisible / 2);
|
|
2195
|
+
let start = currentPage - half;
|
|
2196
|
+
let end = currentPage + (maxVisible - 1 - half);
|
|
2197
|
+
if (start < 0) {
|
|
2198
|
+
start = 0;
|
|
2199
|
+
end = maxVisible - 1;
|
|
2200
|
+
}
|
|
2201
|
+
if (end >= totalPages) {
|
|
2202
|
+
end = totalPages - 1;
|
|
2203
|
+
start = totalPages - maxVisible;
|
|
2204
|
+
}
|
|
2205
|
+
const pages = [];
|
|
2206
|
+
for (let i = start; i <= end; i++) {
|
|
2207
|
+
pages.push(i);
|
|
2208
|
+
}
|
|
2209
|
+
return pages;
|
|
2210
|
+
}
|
|
2211
|
+
var NumberedPagination = ({
|
|
2212
|
+
page = 0,
|
|
2213
|
+
rowsPerPage = 10,
|
|
2214
|
+
count = 0,
|
|
2215
|
+
showTotalCount = false,
|
|
2216
|
+
onPageChange,
|
|
2217
|
+
onRowsPerPageChange,
|
|
2218
|
+
rowsPerPageOptions = [5, 10, 25],
|
|
2219
|
+
labelRowsPerPage = "Baris per halaman:"
|
|
2220
|
+
}) => {
|
|
2221
|
+
const totalPages = count > 0 ? Math.ceil(count / rowsPerPage) : 0;
|
|
2222
|
+
const startItem = page * rowsPerPage + 1;
|
|
2223
|
+
const endItem = Math.min((page + 1) * rowsPerPage, count);
|
|
2224
|
+
const visiblePages = useMemo(
|
|
2225
|
+
() => getVisiblePages2(page, totalPages),
|
|
2226
|
+
[page, totalPages]
|
|
2227
|
+
);
|
|
2228
|
+
return /* @__PURE__ */ jsxs(
|
|
2229
|
+
Box10,
|
|
2230
|
+
{
|
|
2231
|
+
sx: {
|
|
2232
|
+
display: "flex",
|
|
2233
|
+
alignItems: "center",
|
|
2234
|
+
justifyContent: "space-between",
|
|
2235
|
+
px: 2,
|
|
2236
|
+
py: 1.5,
|
|
2237
|
+
minHeight: 52
|
|
2238
|
+
},
|
|
2239
|
+
children: [
|
|
2240
|
+
/* @__PURE__ */ jsx(Box10, { sx: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsxs(BaseTypography, { variant: "body2_regular.subtle", component: "div", children: [
|
|
2241
|
+
"Menampilkan",
|
|
2242
|
+
" ",
|
|
2243
|
+
/* @__PURE__ */ jsxs("span", { style: { fontWeight: 700, color: DerivedColor.color_text_default }, children: [
|
|
2244
|
+
startItem,
|
|
2245
|
+
"-",
|
|
2246
|
+
endItem
|
|
2247
|
+
] }),
|
|
2248
|
+
showTotalCount && count > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2249
|
+
" ",
|
|
2250
|
+
"dari",
|
|
2251
|
+
" ",
|
|
2252
|
+
/* @__PURE__ */ jsx("span", { style: { fontWeight: 700, color: DerivedColor.color_text_default }, children: count }),
|
|
2253
|
+
" ",
|
|
2254
|
+
"data"
|
|
2255
|
+
] })
|
|
2256
|
+
] }) }),
|
|
2257
|
+
/* @__PURE__ */ jsxs(Box10, { sx: { display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
2258
|
+
/* @__PURE__ */ jsxs(Box10, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
|
|
2259
|
+
/* @__PURE__ */ jsx(BaseTypography, { variant: "body2_regular.subtle", children: labelRowsPerPage }),
|
|
2260
|
+
/* @__PURE__ */ jsx(
|
|
2261
|
+
Select2,
|
|
2262
|
+
{
|
|
2263
|
+
value: rowsPerPage,
|
|
2264
|
+
onChange: (e) => {
|
|
2265
|
+
onRowsPerPageChange == null ? void 0 : onRowsPerPageChange(e, Number(e.target.value));
|
|
2266
|
+
},
|
|
2267
|
+
size: "small",
|
|
2268
|
+
variant: "outlined",
|
|
2269
|
+
sx: {
|
|
2270
|
+
minWidth: 60,
|
|
2271
|
+
height: 32,
|
|
2272
|
+
fontSize: 13,
|
|
2273
|
+
"& .MuiSelect-select": { py: 0.5, px: 1 }
|
|
2274
|
+
},
|
|
2275
|
+
children: rowsPerPageOptions.map((option) => /* @__PURE__ */ jsx(MenuItem2, { value: option, sx: { fontSize: 13 }, children: option }, option))
|
|
2276
|
+
}
|
|
2277
|
+
)
|
|
2278
|
+
] }),
|
|
2279
|
+
/* @__PURE__ */ jsxs(Box10, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
|
|
2280
|
+
/* @__PURE__ */ jsx(
|
|
2281
|
+
IconButton5,
|
|
2282
|
+
{
|
|
2283
|
+
size: "small",
|
|
2284
|
+
disabled: page === 0,
|
|
2285
|
+
onClick: (e) => onPageChange == null ? void 0 : onPageChange(e, page - 1),
|
|
2286
|
+
sx: { color: DerivedColor.color_text_default, width: 32, height: 32 },
|
|
2287
|
+
children: /* @__PURE__ */ jsx(IconChevronLeft, { size: 18 })
|
|
2288
|
+
}
|
|
2289
|
+
),
|
|
2290
|
+
visiblePages.map((item) => /* @__PURE__ */ jsx(
|
|
2291
|
+
Box10,
|
|
2292
|
+
{
|
|
2293
|
+
onClick: (e) => onPageChange == null ? void 0 : onPageChange(e, item),
|
|
2294
|
+
sx: {
|
|
2295
|
+
width: 32,
|
|
2296
|
+
height: 32,
|
|
2297
|
+
display: "flex",
|
|
2298
|
+
alignItems: "center",
|
|
2299
|
+
justifyContent: "center",
|
|
2300
|
+
borderRadius: 1,
|
|
2301
|
+
fontSize: 13,
|
|
2302
|
+
fontWeight: item === page ? 600 : 400,
|
|
2303
|
+
cursor: "pointer",
|
|
2304
|
+
userSelect: "none",
|
|
2305
|
+
border: item === page ? `1.5px solid ${PrimitiveColor.color_blue_cakrawala_500}` : "1px solid transparent",
|
|
2306
|
+
color: item === page ? PrimitiveColor.color_blue_cakrawala_500 : DerivedColor.color_text_default,
|
|
2307
|
+
backgroundColor: "transparent",
|
|
2308
|
+
"&:hover": {
|
|
2309
|
+
backgroundColor: PrimitiveColor.color_neutral_200
|
|
2310
|
+
}
|
|
2311
|
+
},
|
|
2312
|
+
children: item + 1
|
|
2313
|
+
},
|
|
2314
|
+
item
|
|
2315
|
+
)),
|
|
2316
|
+
/* @__PURE__ */ jsx(
|
|
2317
|
+
IconButton5,
|
|
2318
|
+
{
|
|
2319
|
+
size: "small",
|
|
2320
|
+
disabled: page >= totalPages - 1,
|
|
2321
|
+
onClick: (e) => onPageChange == null ? void 0 : onPageChange(e, page + 1),
|
|
2322
|
+
sx: { color: DerivedColor.color_text_default, width: 32, height: 32 },
|
|
2323
|
+
children: /* @__PURE__ */ jsx(IconChevronRight, { size: 18 })
|
|
2324
|
+
}
|
|
2325
|
+
)
|
|
2326
|
+
] })
|
|
2327
|
+
] })
|
|
2328
|
+
]
|
|
2329
|
+
}
|
|
2330
|
+
);
|
|
2331
|
+
};
|
|
2190
2332
|
var _a39, _b39;
|
|
2191
|
-
var
|
|
2333
|
+
var Box11 = (_b39 = (_a39 = BoxRaw) == null ? void 0 : _a39.default) != null ? _b39 : BoxRaw;
|
|
2192
2334
|
var _a40, _b40;
|
|
2193
|
-
var
|
|
2335
|
+
var Checkbox = (_b40 = (_a40 = MuiCheckboxRaw) == null ? void 0 : _a40.default) != null ? _b40 : MuiCheckboxRaw;
|
|
2194
2336
|
var _a41, _b41;
|
|
2195
|
-
var
|
|
2337
|
+
var CircularProgress = (_b41 = (_a41 = CircularProgressRaw) == null ? void 0 : _a41.default) != null ? _b41 : CircularProgressRaw;
|
|
2196
2338
|
var _a42, _b42;
|
|
2197
|
-
var
|
|
2339
|
+
var Paper = (_b42 = (_a42 = PaperRaw) == null ? void 0 : _a42.default) != null ? _b42 : PaperRaw;
|
|
2198
2340
|
var _a43, _b43;
|
|
2199
|
-
var
|
|
2341
|
+
var Table = (_b43 = (_a43 = TableRaw) == null ? void 0 : _a43.default) != null ? _b43 : TableRaw;
|
|
2200
2342
|
var _a44, _b44;
|
|
2201
|
-
var
|
|
2343
|
+
var TableBody = (_b44 = (_a44 = TableBodyRaw) == null ? void 0 : _a44.default) != null ? _b44 : TableBodyRaw;
|
|
2344
|
+
var _a45, _b45;
|
|
2345
|
+
var TableCell = (_b45 = (_a45 = TableCellRaw) == null ? void 0 : _a45.default) != null ? _b45 : TableCellRaw;
|
|
2346
|
+
var _a46, _b46;
|
|
2347
|
+
var TableContainer = (_b46 = (_a46 = TableContainerRaw) == null ? void 0 : _a46.default) != null ? _b46 : TableContainerRaw;
|
|
2348
|
+
var _a47, _b47;
|
|
2349
|
+
var TableHead = (_b47 = (_a47 = TableHeadRaw) == null ? void 0 : _a47.default) != null ? _b47 : TableHeadRaw;
|
|
2350
|
+
var _a48, _b48;
|
|
2351
|
+
var TableRow = (_b48 = (_a48 = TableRowRaw) == null ? void 0 : _a48.default) != null ? _b48 : TableRowRaw;
|
|
2202
2352
|
var DEFAULT_COLUMN_WIDTH = 160;
|
|
2203
2353
|
var HEADER_ROW_HEIGHT = 48;
|
|
2204
2354
|
var SELECTION_COLUMN_WIDTH = 56;
|
|
@@ -2232,13 +2382,13 @@ var compareValue = (a, b) => {
|
|
|
2232
2382
|
});
|
|
2233
2383
|
};
|
|
2234
2384
|
var getColumnWidth = (column) => {
|
|
2235
|
-
var
|
|
2236
|
-
return Number((
|
|
2385
|
+
var _a130, _b130;
|
|
2386
|
+
return Number((_b130 = (_a130 = column.width) != null ? _a130 : column.minWidth) != null ? _b130 : DEFAULT_COLUMN_WIDTH);
|
|
2237
2387
|
};
|
|
2238
2388
|
var getStickyLeft = (widths, index) => widths.slice(0, index).reduce((sum, width) => sum + width, 0);
|
|
2239
2389
|
var getStickyRight = (widths, index) => widths.slice(index + 1).reduce((sum, width) => sum + width, 0);
|
|
2240
2390
|
var normalizeColumn = (column, index, sortingEnabled) => {
|
|
2241
|
-
var
|
|
2391
|
+
var _a130, _b130, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
2242
2392
|
if (typeof column === "string") {
|
|
2243
2393
|
return {
|
|
2244
2394
|
id: getLastPathSegment(column) || `column-${index}`,
|
|
@@ -2251,7 +2401,7 @@ var normalizeColumn = (column, index, sortingEnabled) => {
|
|
|
2251
2401
|
headerAlign: "center"
|
|
2252
2402
|
};
|
|
2253
2403
|
}
|
|
2254
|
-
const accessorKey = (_c = (
|
|
2404
|
+
const accessorKey = (_c = (_b130 = (_a130 = column.accessorKey) != null ? _a130 : column.key) != null ? _b130 : column.field) != null ? _c : column.id;
|
|
2255
2405
|
const id2 = (_e = (_d = column.id) != null ? _d : getLastPathSegment(accessorKey)) != null ? _e : `column-${index}`;
|
|
2256
2406
|
return __spreadProps(__spreadValues({
|
|
2257
2407
|
width: DEFAULT_COLUMN_WIDTH,
|
|
@@ -2271,12 +2421,12 @@ var normalizeHeaderRows = (header, columns) => {
|
|
|
2271
2421
|
}
|
|
2272
2422
|
return [
|
|
2273
2423
|
columns.map((column) => {
|
|
2274
|
-
var
|
|
2424
|
+
var _a130, _b130;
|
|
2275
2425
|
return {
|
|
2276
2426
|
id: column.id,
|
|
2277
2427
|
key: column.id,
|
|
2278
2428
|
label: column.header,
|
|
2279
|
-
align: (
|
|
2429
|
+
align: (_b130 = (_a130 = column.headerAlign) != null ? _a130 : column.align) != null ? _b130 : "center",
|
|
2280
2430
|
rowSpan: 1
|
|
2281
2431
|
};
|
|
2282
2432
|
})
|
|
@@ -2285,13 +2435,13 @@ var normalizeHeaderRows = (header, columns) => {
|
|
|
2285
2435
|
var buildHeaderLayout = (headerRows) => {
|
|
2286
2436
|
const occupied = [];
|
|
2287
2437
|
return headerRows.map((row, rowIndex) => {
|
|
2288
|
-
var
|
|
2289
|
-
(
|
|
2438
|
+
var _a130;
|
|
2439
|
+
(_a130 = occupied[rowIndex]) != null ? _a130 : occupied[rowIndex] = [];
|
|
2290
2440
|
let pointer = 0;
|
|
2291
2441
|
return row.map((cell, cellIndex) => {
|
|
2292
|
-
var
|
|
2442
|
+
var _a131, _b130, _c, _d, _e, _f, _g;
|
|
2293
2443
|
while (occupied[rowIndex][pointer]) pointer += 1;
|
|
2294
|
-
const colSpan = (
|
|
2444
|
+
const colSpan = (_b130 = (_a131 = cell.colSpan) != null ? _a131 : cell.colspan) != null ? _b130 : 1;
|
|
2295
2445
|
const rowSpan = (_d = (_c = cell.rowSpan) != null ? _c : cell.rowspan) != null ? _d : 1;
|
|
2296
2446
|
const start = pointer;
|
|
2297
2447
|
for (let r = rowIndex; r < rowIndex + rowSpan; r += 1) {
|
|
@@ -2327,8 +2477,8 @@ var renderSortIcon = (sortKey, sortState) => {
|
|
|
2327
2477
|
return sortState.direction === "asc" ? /* @__PURE__ */ jsx(IconArrowUp, { size: 16, color: activeColor }) : /* @__PURE__ */ jsx(IconArrowDown, { size: 16, color: activeColor });
|
|
2328
2478
|
};
|
|
2329
2479
|
var getSortField = (column) => {
|
|
2330
|
-
var
|
|
2331
|
-
return (_c = (
|
|
2480
|
+
var _a130, _b130, _c;
|
|
2481
|
+
return (_c = (_b130 = (_a130 = column.sortField) != null ? _a130 : column.accessorKey) != null ? _b130 : column.key) != null ? _c : column.id;
|
|
2332
2482
|
};
|
|
2333
2483
|
var BaseDatatable = ({
|
|
2334
2484
|
columns = EMPTY_ARRAY,
|
|
@@ -2349,7 +2499,7 @@ var BaseDatatable = ({
|
|
|
2349
2499
|
containerSx = EMPTY_OBJECT,
|
|
2350
2500
|
tableSx = EMPTY_OBJECT
|
|
2351
2501
|
}) => {
|
|
2352
|
-
var
|
|
2502
|
+
var _a130, _b130, _c, _d, _e;
|
|
2353
2503
|
const featureConfig = useMemo(
|
|
2354
2504
|
() => __spreadValues({
|
|
2355
2505
|
sorting: false,
|
|
@@ -2399,7 +2549,7 @@ var BaseDatatable = ({
|
|
|
2399
2549
|
const [internalSelectedIds, setInternalSelectedIds] = useState(
|
|
2400
2550
|
selectionConfig.defaultSelectedRowIds
|
|
2401
2551
|
);
|
|
2402
|
-
const [internalPage, setInternalPage] = useState((
|
|
2552
|
+
const [internalPage, setInternalPage] = useState((_a130 = paginationConfig.page) != null ? _a130 : 0);
|
|
2403
2553
|
const [internalRowsPerPage, setInternalRowsPerPage] = useState(
|
|
2404
2554
|
paginationConfig.rowsPerPage
|
|
2405
2555
|
);
|
|
@@ -2408,7 +2558,7 @@ var BaseDatatable = ({
|
|
|
2408
2558
|
const isRowSelectable = selectionConfig.isRowSelectable;
|
|
2409
2559
|
const selectionPosition = selectionConfig.position;
|
|
2410
2560
|
const selectedIds = controlledSelectedIds != null ? controlledSelectedIds : internalSelectedIds;
|
|
2411
|
-
const sortState = (
|
|
2561
|
+
const sortState = (_b130 = featureConfig.sortState) != null ? _b130 : internalSortState;
|
|
2412
2562
|
const currentPage = (_c = pagination.page) != null ? _c : internalPage;
|
|
2413
2563
|
const currentRowsPerPage = (_d = pagination.rowsPerPage) != null ? _d : internalRowsPerPage;
|
|
2414
2564
|
const isHeaderInteractive = typeof featureConfig.headerInteractive === "boolean" ? featureConfig.headerInteractive : featureConfig.sorting;
|
|
@@ -2445,8 +2595,8 @@ var BaseDatatable = ({
|
|
|
2445
2595
|
);
|
|
2446
2596
|
const resolveRowId = useCallback(
|
|
2447
2597
|
(row, rowIndex) => {
|
|
2448
|
-
var
|
|
2449
|
-
return (
|
|
2598
|
+
var _a131, _b131;
|
|
2599
|
+
return (_b131 = (_a131 = getRowId == null ? void 0 : getRowId(row, rowIndex)) != null ? _a131 : row == null ? void 0 : row.id) != null ? _b131 : rowIndex;
|
|
2450
2600
|
},
|
|
2451
2601
|
[getRowId]
|
|
2452
2602
|
);
|
|
@@ -2569,17 +2719,17 @@ var BaseDatatable = ({
|
|
|
2569
2719
|
]);
|
|
2570
2720
|
const handlePaginationPageChange = useCallback(
|
|
2571
2721
|
(event, nextPage) => {
|
|
2572
|
-
var
|
|
2722
|
+
var _a131;
|
|
2573
2723
|
if (pagination.page === void 0) {
|
|
2574
2724
|
setInternalPage(nextPage);
|
|
2575
2725
|
}
|
|
2576
|
-
(
|
|
2726
|
+
(_a131 = paginationConfig.onPageChange) == null ? void 0 : _a131.call(paginationConfig, event, nextPage);
|
|
2577
2727
|
},
|
|
2578
2728
|
[pagination.page, paginationConfig]
|
|
2579
2729
|
);
|
|
2580
2730
|
const handleRowsPerPageChange = useCallback(
|
|
2581
2731
|
(event) => {
|
|
2582
|
-
var
|
|
2732
|
+
var _a131;
|
|
2583
2733
|
const nextRowsPerPage = Number(event.target.value);
|
|
2584
2734
|
if (pagination.rowsPerPage === void 0) {
|
|
2585
2735
|
setInternalRowsPerPage(nextRowsPerPage);
|
|
@@ -2587,15 +2737,15 @@ var BaseDatatable = ({
|
|
|
2587
2737
|
if (pagination.page === void 0) {
|
|
2588
2738
|
setInternalPage(0);
|
|
2589
2739
|
}
|
|
2590
|
-
(
|
|
2740
|
+
(_a131 = paginationConfig.onRowsPerPageChange) == null ? void 0 : _a131.call(paginationConfig, event, nextRowsPerPage);
|
|
2591
2741
|
},
|
|
2592
2742
|
[pagination.page, pagination.rowsPerPage, paginationConfig]
|
|
2593
2743
|
);
|
|
2594
2744
|
const handleSort = useCallback(
|
|
2595
2745
|
(cell) => {
|
|
2596
|
-
var
|
|
2746
|
+
var _a131, _b131, _c2, _d2, _e2, _f;
|
|
2597
2747
|
if (!featureConfig.sorting) return;
|
|
2598
|
-
if (((
|
|
2748
|
+
if (((_a131 = cell.colSpan) != null ? _a131 : 1) > 1 || ((_b131 = cell.rowSpan) != null ? _b131 : 1) > 1) return;
|
|
2599
2749
|
const sortKey = (_d2 = (_c2 = cell.sortKey) != null ? _c2 : cell.key) != null ? _d2 : cell.id;
|
|
2600
2750
|
const targetColumn = normalizedColumns.find((column) => column.id === sortKey);
|
|
2601
2751
|
if (!(targetColumn == null ? void 0 : targetColumn.sortable)) return;
|
|
@@ -2642,8 +2792,8 @@ var BaseDatatable = ({
|
|
|
2642
2792
|
);
|
|
2643
2793
|
const renderBodyCell = useCallback(
|
|
2644
2794
|
(column, row, rowIndex, columnIndex, rowId, rowActive, cellOverrides = EMPTY_OBJECT) => {
|
|
2645
|
-
var
|
|
2646
|
-
const resolvedColumn = column.isSelection || column.id === selectionColumn.id ? selectionColumn : (
|
|
2795
|
+
var _a131, _b131, _c2, _d2, _e2;
|
|
2796
|
+
const resolvedColumn = column.isSelection || column.id === selectionColumn.id ? selectionColumn : (_a131 = visibleColumns.find((item) => item.id === column.id)) != null ? _a131 : column;
|
|
2647
2797
|
if (resolvedColumn.isSelection) {
|
|
2648
2798
|
const isSelectable = isRowSelectable ? isRowSelectable(row, rowIndex) : true;
|
|
2649
2799
|
return /* @__PURE__ */ jsx(
|
|
@@ -2666,7 +2816,7 @@ var BaseDatatable = ({
|
|
|
2666
2816
|
boxShadow: selectionPosition === "left" && columnIndex === stickyLeftCount - 1 ? `2px 0 6px ${COLORS.stickyShadow}` : selectionPosition === "right" && columnIndex === visibleColumns.length - stickyRightCount ? `-2px 0 6px ${COLORS.stickyShadow}` : "none"
|
|
2667
2817
|
}, cellOverrides.sx),
|
|
2668
2818
|
children: /* @__PURE__ */ jsx(
|
|
2669
|
-
|
|
2819
|
+
Box11,
|
|
2670
2820
|
{
|
|
2671
2821
|
sx: {
|
|
2672
2822
|
display: "flex",
|
|
@@ -2699,7 +2849,7 @@ var BaseDatatable = ({
|
|
|
2699
2849
|
return /* @__PURE__ */ jsx(
|
|
2700
2850
|
TableCell,
|
|
2701
2851
|
{
|
|
2702
|
-
align: (
|
|
2852
|
+
align: (_b131 = resolvedColumn.align) != null ? _b131 : "left",
|
|
2703
2853
|
rowSpan: cellOverrides.rowSpan,
|
|
2704
2854
|
colSpan: cellOverrides.colSpan,
|
|
2705
2855
|
sx: __spreadValues(__spreadValues({
|
|
@@ -2773,8 +2923,8 @@ var BaseDatatable = ({
|
|
|
2773
2923
|
}, tableSx),
|
|
2774
2924
|
children: [
|
|
2775
2925
|
/* @__PURE__ */ jsx(TableHead, { children: rowsForHeader.map((row, rowIndex) => /* @__PURE__ */ jsx(TableRow, { children: row.map((cell) => {
|
|
2776
|
-
var
|
|
2777
|
-
const sortKey = (
|
|
2926
|
+
var _a131, _b131, _c2, _d2, _e2, _f, _g, _h, _i;
|
|
2927
|
+
const sortKey = (_b131 = (_a131 = cell.sortKey) != null ? _a131 : cell.key) != null ? _b131 : cell.id;
|
|
2778
2928
|
const targetColumn = normalizedColumns.find((column) => column.id === sortKey);
|
|
2779
2929
|
const isSortable = featureConfig.sorting && ((_c2 = cell.colSpan) != null ? _c2 : 1) === 1 && ((_d2 = cell.rowSpan) != null ? _d2 : 1) === 1 && (targetColumn == null ? void 0 : targetColumn.sortable);
|
|
2780
2930
|
const shouldStickLeft = cell.sticky === "left" || cell.end < stickyLeftCount;
|
|
@@ -2815,7 +2965,7 @@ var BaseDatatable = ({
|
|
|
2815
2965
|
} : void 0
|
|
2816
2966
|
}),
|
|
2817
2967
|
children: /* @__PURE__ */ jsxs(
|
|
2818
|
-
|
|
2968
|
+
Box11,
|
|
2819
2969
|
{
|
|
2820
2970
|
sx: {
|
|
2821
2971
|
display: "flex",
|
|
@@ -2834,7 +2984,7 @@ var BaseDatatable = ({
|
|
|
2834
2984
|
);
|
|
2835
2985
|
}) }, `header-${rowIndex}`)) }),
|
|
2836
2986
|
/* @__PURE__ */ jsx(TableBody, { children: loading ? /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { align: "center", colSpan: visibleColumns.length, children: /* @__PURE__ */ jsxs(
|
|
2837
|
-
|
|
2987
|
+
Box11,
|
|
2838
2988
|
{
|
|
2839
2989
|
sx: {
|
|
2840
2990
|
minHeight: 120,
|
|
@@ -2945,26 +3095,26 @@ BaseDatatable.propTypes = {
|
|
|
2945
3095
|
tableSx: PropTypes3.object
|
|
2946
3096
|
};
|
|
2947
3097
|
React2.memo(BaseDatatable);
|
|
2948
|
-
var _a45, _b45;
|
|
2949
|
-
var TextField = (_b45 = (_a45 = TextFieldRaw) == null ? void 0 : _a45.default) != null ? _b45 : TextFieldRaw;
|
|
2950
|
-
var _a46, _b46;
|
|
2951
|
-
var Box11 = (_b46 = (_a46 = BoxRaw) == null ? void 0 : _a46.default) != null ? _b46 : BoxRaw;
|
|
2952
|
-
var _a47, _b47;
|
|
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
3098
|
var _a49, _b49;
|
|
2957
|
-
var
|
|
3099
|
+
var TextField = (_b49 = (_a49 = TextFieldRaw) == null ? void 0 : _a49.default) != null ? _b49 : TextFieldRaw;
|
|
2958
3100
|
var _a50, _b50;
|
|
2959
|
-
var
|
|
3101
|
+
var Box12 = (_b50 = (_a50 = BoxRaw) == null ? void 0 : _a50.default) != null ? _b50 : BoxRaw;
|
|
2960
3102
|
var _a51, _b51;
|
|
2961
|
-
var
|
|
3103
|
+
var Popover = (_b51 = (_a51 = PopoverRaw) == null ? void 0 : _a51.default) != null ? _b51 : PopoverRaw;
|
|
2962
3104
|
var _a52, _b52;
|
|
2963
|
-
var
|
|
3105
|
+
var InputAdornment = (_b52 = (_a52 = InputAdornmentRaw) == null ? void 0 : _a52.default) != null ? _b52 : InputAdornmentRaw;
|
|
2964
3106
|
var _a53, _b53;
|
|
2965
|
-
var
|
|
2966
|
-
var
|
|
2967
|
-
|
|
3107
|
+
var IconButton6 = (_b53 = (_a53 = IconButtonRaw) == null ? void 0 : _a53.default) != null ? _b53 : IconButtonRaw;
|
|
3108
|
+
var _a54, _b54;
|
|
3109
|
+
var Typography = (_b54 = (_a54 = MuiTypographyRaw) == null ? void 0 : _a54.default) != null ? _b54 : MuiTypographyRaw;
|
|
3110
|
+
var _a55, _b55;
|
|
3111
|
+
var DatePicker = (_b55 = (_a55 = DatePicker$1) == null ? void 0 : _a55.default) != null ? _b55 : DatePicker$1;
|
|
3112
|
+
var _a56, _b56;
|
|
3113
|
+
var DateTimePicker = (_b56 = (_a56 = DateTimePicker$1) == null ? void 0 : _a56.default) != null ? _b56 : DateTimePicker$1;
|
|
3114
|
+
var _a57, _b57;
|
|
3115
|
+
var TimePicker = (_b57 = (_a57 = TimePicker$1) == null ? void 0 : _a57.default) != null ? _b57 : TimePicker$1;
|
|
3116
|
+
var BaseDatePicker = (_a130) => {
|
|
3117
|
+
var _b130 = _a130, {
|
|
2968
3118
|
type = "single",
|
|
2969
3119
|
name,
|
|
2970
3120
|
control,
|
|
@@ -2982,7 +3132,7 @@ var BaseDatePicker = (_a126) => {
|
|
|
2982
3132
|
sx = {},
|
|
2983
3133
|
onChange: onChangeCustom = () => {
|
|
2984
3134
|
}
|
|
2985
|
-
} =
|
|
3135
|
+
} = _b130, props = __objRest(_b130, [
|
|
2986
3136
|
"type",
|
|
2987
3137
|
"name",
|
|
2988
3138
|
"control",
|
|
@@ -3000,13 +3150,13 @@ var BaseDatePicker = (_a126) => {
|
|
|
3000
3150
|
"sx",
|
|
3001
3151
|
"onChange"
|
|
3002
3152
|
]);
|
|
3003
|
-
var
|
|
3153
|
+
var _a131, _b131, _c, _d, _e, _f;
|
|
3004
3154
|
const { field, formState } = useController({
|
|
3005
3155
|
name,
|
|
3006
3156
|
control,
|
|
3007
3157
|
defaultValue
|
|
3008
3158
|
});
|
|
3009
|
-
const errorMessage = (_c = (
|
|
3159
|
+
const errorMessage = (_c = (_b131 = (_a131 = formState.errors) == null ? void 0 : _a131[name]) == null ? void 0 : _b131.message) == null ? void 0 : _c.toString();
|
|
3010
3160
|
const [open, setOpen] = useState(false);
|
|
3011
3161
|
const inputRef = useRef(null);
|
|
3012
3162
|
const [rangeValue, setRangeValue] = useState(
|
|
@@ -3072,15 +3222,15 @@ var BaseDatePicker = (_a126) => {
|
|
|
3072
3222
|
}
|
|
3073
3223
|
}, [type, format]);
|
|
3074
3224
|
const LabelSection = () => {
|
|
3075
|
-
var
|
|
3225
|
+
var _a132;
|
|
3076
3226
|
if (!title && !subtitle) return null;
|
|
3077
|
-
return /* @__PURE__ */ jsxs(
|
|
3078
|
-
title && /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { fontWeight: 600, color: !!((
|
|
3227
|
+
return /* @__PURE__ */ jsxs(Box12, { sx: { display: "flex", gap: SpacingToken.spacing2, mb: "4px" }, children: [
|
|
3228
|
+
title && /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { fontWeight: 600, color: !!((_a132 = formState.errors) == null ? void 0 : _a132[name]) ? DerivedColor.color_text_danger : DerivedColor.color_text_default }, children: title }),
|
|
3079
3229
|
subtitle && /* @__PURE__ */ jsx(Typography, { variant: "body2", sx: { color: DerivedColor.color_text_subtle }, children: subtitle })
|
|
3080
3230
|
] });
|
|
3081
3231
|
};
|
|
3082
3232
|
if (type === "range") {
|
|
3083
|
-
return /* @__PURE__ */ jsxs(
|
|
3233
|
+
return /* @__PURE__ */ jsxs(Box12, { sx, children: [
|
|
3084
3234
|
/* @__PURE__ */ jsx(LabelSection, {}),
|
|
3085
3235
|
/* @__PURE__ */ jsx(
|
|
3086
3236
|
TextField,
|
|
@@ -3131,7 +3281,7 @@ var BaseDatePicker = (_a126) => {
|
|
|
3131
3281
|
endAdornment: /* @__PURE__ */ jsxs(InputAdornment, { position: "end", children: [
|
|
3132
3282
|
!!errorMessage && /* @__PURE__ */ jsx(IconAlertCircleFilled, { size: 18, color: PrimitiveColor.color_red_500 }),
|
|
3133
3283
|
/* @__PURE__ */ jsx(
|
|
3134
|
-
|
|
3284
|
+
IconButton6,
|
|
3135
3285
|
{
|
|
3136
3286
|
size: "small",
|
|
3137
3287
|
onClick: (e) => {
|
|
@@ -3177,7 +3327,7 @@ var BaseDatePicker = (_a126) => {
|
|
|
3177
3327
|
] });
|
|
3178
3328
|
}
|
|
3179
3329
|
const PickerComponent = (_e = pickerConfig.component) != null ? _e : DatePicker;
|
|
3180
|
-
return /* @__PURE__ */ jsxs(
|
|
3330
|
+
return /* @__PURE__ */ jsxs(Box12, { sx, children: [
|
|
3181
3331
|
/* @__PURE__ */ jsx(LabelSection, {}),
|
|
3182
3332
|
/* @__PURE__ */ jsx(
|
|
3183
3333
|
PickerComponent,
|
|
@@ -3185,36 +3335,26 @@ var BaseDatePicker = (_a126) => {
|
|
|
3185
3335
|
value: (_f = field.value) != null ? _f : null,
|
|
3186
3336
|
open,
|
|
3187
3337
|
onOpen: () => {
|
|
3338
|
+
if (!isDisabled && (openBy === "icon" || openBy === "both")) setOpen(true);
|
|
3188
3339
|
},
|
|
3189
3340
|
onClose: () => setOpen(false),
|
|
3190
3341
|
views: pickerConfig.views,
|
|
3191
3342
|
openTo: pickerConfig.openTo,
|
|
3192
3343
|
inputFormat: pickerConfig.inputFormat,
|
|
3344
|
+
disableMaskedInput: true,
|
|
3193
3345
|
minDate: minDate ? dayjs(minDate) : void 0,
|
|
3194
3346
|
maxDate: maxDate ? dayjs(maxDate) : void 0,
|
|
3195
3347
|
disabled: isDisabled,
|
|
3196
3348
|
disableOpenPicker: openBy === "field",
|
|
3197
3349
|
components: {
|
|
3198
|
-
OpenPickerIcon: () => /* @__PURE__ */ jsx(
|
|
3199
|
-
IconButton5,
|
|
3200
|
-
{
|
|
3201
|
-
size: "small",
|
|
3202
|
-
onClick: (e) => {
|
|
3203
|
-
e.stopPropagation();
|
|
3204
|
-
if (!isDisabled && (openBy === "icon" || openBy === "both")) setOpen(true);
|
|
3205
|
-
},
|
|
3206
|
-
disabled: isDisabled,
|
|
3207
|
-
sx: { p: 0 },
|
|
3208
|
-
children: /* @__PURE__ */ jsx(IconCalendarWeekFilled, { size: 20, color: DerivedColor.color_icon_brand_primary })
|
|
3209
|
-
}
|
|
3210
|
-
)
|
|
3350
|
+
OpenPickerIcon: () => /* @__PURE__ */ jsx(IconCalendarWeekFilled, { size: 20, color: DerivedColor.color_icon_brand_primary })
|
|
3211
3351
|
},
|
|
3212
3352
|
onChange: (newValue) => {
|
|
3213
3353
|
field.onChange(newValue);
|
|
3214
3354
|
onChangeCustom(newValue);
|
|
3215
3355
|
},
|
|
3216
3356
|
renderInput: (params) => {
|
|
3217
|
-
var
|
|
3357
|
+
var _a132;
|
|
3218
3358
|
return /* @__PURE__ */ jsx(
|
|
3219
3359
|
TextField,
|
|
3220
3360
|
__spreadProps(__spreadValues({}, params), {
|
|
@@ -3260,7 +3400,7 @@ var BaseDatePicker = (_a126) => {
|
|
|
3260
3400
|
endAdornment: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3261
3401
|
!!errorMessage && /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(IconAlertCircleFilled, { size: 18, color: DerivedColor.color_icon_danger }) }),
|
|
3262
3402
|
clearable && field.value && /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(
|
|
3263
|
-
|
|
3403
|
+
IconButton6,
|
|
3264
3404
|
{
|
|
3265
3405
|
size: "small",
|
|
3266
3406
|
onClick: handleClear,
|
|
@@ -3268,7 +3408,7 @@ var BaseDatePicker = (_a126) => {
|
|
|
3268
3408
|
children: /* @__PURE__ */ jsx(CloseIconRaw, { fontSize: "small" })
|
|
3269
3409
|
}
|
|
3270
3410
|
) }),
|
|
3271
|
-
(
|
|
3411
|
+
(_a132 = params.InputProps) == null ? void 0 : _a132.endAdornment
|
|
3272
3412
|
] })
|
|
3273
3413
|
})
|
|
3274
3414
|
})
|
|
@@ -3278,12 +3418,12 @@ var BaseDatePicker = (_a126) => {
|
|
|
3278
3418
|
)
|
|
3279
3419
|
] });
|
|
3280
3420
|
};
|
|
3281
|
-
var
|
|
3282
|
-
var
|
|
3283
|
-
var
|
|
3284
|
-
var Chip2 = (
|
|
3285
|
-
var
|
|
3286
|
-
var Typography2 = (
|
|
3421
|
+
var _a58, _b58;
|
|
3422
|
+
var Box13 = (_b58 = (_a58 = BoxRaw) == null ? void 0 : _a58.default) != null ? _b58 : BoxRaw;
|
|
3423
|
+
var _a59, _b59;
|
|
3424
|
+
var Chip2 = (_b59 = (_a59 = ChipRaw) == null ? void 0 : _a59.default) != null ? _b59 : ChipRaw;
|
|
3425
|
+
var _a60, _b60;
|
|
3426
|
+
var Typography2 = (_b60 = (_a60 = MuiTypographyRaw) == null ? void 0 : _a60.default) != null ? _b60 : MuiTypographyRaw;
|
|
3287
3427
|
var CheckboxOption = (props) => {
|
|
3288
3428
|
const { isSelected, label, selectOption, data } = props;
|
|
3289
3429
|
const handleChange = () => {
|
|
@@ -3299,8 +3439,8 @@ var CheckboxOption = (props) => {
|
|
|
3299
3439
|
}
|
|
3300
3440
|
) }));
|
|
3301
3441
|
};
|
|
3302
|
-
var BaseDropdown = (
|
|
3303
|
-
var
|
|
3442
|
+
var BaseDropdown = (_a130) => {
|
|
3443
|
+
var _b130 = _a130, {
|
|
3304
3444
|
name = "",
|
|
3305
3445
|
control,
|
|
3306
3446
|
options = [],
|
|
@@ -3324,7 +3464,7 @@ var BaseDropdown = (_a126) => {
|
|
|
3324
3464
|
],
|
|
3325
3465
|
variant = "select",
|
|
3326
3466
|
sx = {}
|
|
3327
|
-
} =
|
|
3467
|
+
} = _b130, props = __objRest(_b130, [
|
|
3328
3468
|
"name",
|
|
3329
3469
|
"control",
|
|
3330
3470
|
"options",
|
|
@@ -3343,14 +3483,14 @@ var BaseDropdown = (_a126) => {
|
|
|
3343
3483
|
"variant",
|
|
3344
3484
|
"sx"
|
|
3345
3485
|
]);
|
|
3346
|
-
var
|
|
3486
|
+
var _a131;
|
|
3347
3487
|
const { field, formState } = useController({
|
|
3348
3488
|
name,
|
|
3349
3489
|
control,
|
|
3350
3490
|
defaultValue: defaultValue != null ? defaultValue : variant === "checkbox" || isMulti ? [] : null
|
|
3351
3491
|
});
|
|
3352
|
-
const SelectComponent = loadOptions ? AsyncSelect :
|
|
3353
|
-
const hasError = !!((
|
|
3492
|
+
const SelectComponent = loadOptions ? AsyncSelect : Select3;
|
|
3493
|
+
const hasError = !!((_a131 = formState.errors) == null ? void 0 : _a131[name]);
|
|
3354
3494
|
const selectedValues = Array.isArray(field.value) ? field.value : field.value ? [field.value] : [];
|
|
3355
3495
|
const isCheckboxMode = variant === "checkbox";
|
|
3356
3496
|
const selectAllChecked = showSelectAll && selectedValues.length === options.length && options.length > 0;
|
|
@@ -3359,9 +3499,9 @@ var BaseDropdown = (_a126) => {
|
|
|
3359
3499
|
field.onChange(checked ? options : []);
|
|
3360
3500
|
};
|
|
3361
3501
|
const handleChange = (val) => {
|
|
3362
|
-
var
|
|
3502
|
+
var _a132;
|
|
3363
3503
|
field.onChange(val);
|
|
3364
|
-
(
|
|
3504
|
+
(_a132 = props.onChange) == null ? void 0 : _a132.call(props, val);
|
|
3365
3505
|
};
|
|
3366
3506
|
const customStyles = {
|
|
3367
3507
|
control: (base, state) => __spreadValues(__spreadProps(__spreadValues({}, base), {
|
|
@@ -3391,7 +3531,7 @@ var BaseDropdown = (_a126) => {
|
|
|
3391
3531
|
})
|
|
3392
3532
|
};
|
|
3393
3533
|
return /* @__PURE__ */ jsxs(
|
|
3394
|
-
|
|
3534
|
+
Box13,
|
|
3395
3535
|
{
|
|
3396
3536
|
sx: __spreadValues({
|
|
3397
3537
|
width: "100%",
|
|
@@ -3400,8 +3540,8 @@ var BaseDropdown = (_a126) => {
|
|
|
3400
3540
|
gap: SpacingToken.spacing2
|
|
3401
3541
|
}, sx),
|
|
3402
3542
|
children: [
|
|
3403
|
-
(title || subtitle || showSelectAll) && /* @__PURE__ */ jsxs(
|
|
3404
|
-
/* @__PURE__ */ jsxs(
|
|
3543
|
+
(title || subtitle || showSelectAll) && /* @__PURE__ */ jsxs(Box13, { sx: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [
|
|
3544
|
+
/* @__PURE__ */ jsxs(Box13, { sx: { display: "flex", alignItems: "center", gap: SpacingToken.spacing2 }, children: [
|
|
3405
3545
|
title && /* @__PURE__ */ jsx(Typography2, { variant: "body2", sx: { fontWeight: 600, fontSize: 14, color: hasError ? DerivedColor.color_text_danger : DerivedColor.color_text_default }, children: title }),
|
|
3406
3546
|
subtitle && /* @__PURE__ */ jsx(Typography2, { variant: "body2", sx: { fontSize: 14, color: DerivedColor.color_text_subtle }, children: subtitle })
|
|
3407
3547
|
] }),
|
|
@@ -3440,7 +3580,7 @@ var BaseDropdown = (_a126) => {
|
|
|
3440
3580
|
}
|
|
3441
3581
|
})
|
|
3442
3582
|
),
|
|
3443
|
-
showChip && isMulti && !isCheckboxMode && /* @__PURE__ */ jsx(
|
|
3583
|
+
showChip && isMulti && !isCheckboxMode && /* @__PURE__ */ jsx(Box13, { sx: { display: "flex", flexWrap: "wrap", gap: 1, mt: 1 }, children: selectedValues.map((option) => /* @__PURE__ */ jsx(
|
|
3444
3584
|
Chip2,
|
|
3445
3585
|
{
|
|
3446
3586
|
label: option.label,
|
|
@@ -3470,8 +3610,8 @@ var BaseDropdown = (_a126) => {
|
|
|
3470
3610
|
}
|
|
3471
3611
|
);
|
|
3472
3612
|
};
|
|
3473
|
-
var
|
|
3474
|
-
var
|
|
3613
|
+
var _a61, _b61;
|
|
3614
|
+
var Box14 = (_b61 = (_a61 = BoxRaw) == null ? void 0 : _a61.default) != null ? _b61 : BoxRaw;
|
|
3475
3615
|
var BaseDropzone = ({
|
|
3476
3616
|
autoUpload = false,
|
|
3477
3617
|
settings = {
|
|
@@ -3523,7 +3663,7 @@ var BaseDropzone = ({
|
|
|
3523
3663
|
processedCount++;
|
|
3524
3664
|
if (processedCount === acceptedFiles.length) {
|
|
3525
3665
|
setFiles((prevFiles) => {
|
|
3526
|
-
var
|
|
3666
|
+
var _a130;
|
|
3527
3667
|
let updated;
|
|
3528
3668
|
if (settings.maxFiles === 1) {
|
|
3529
3669
|
updated = tempFiles.slice(0, 1);
|
|
@@ -3534,7 +3674,7 @@ var BaseDropzone = ({
|
|
|
3534
3674
|
);
|
|
3535
3675
|
}
|
|
3536
3676
|
if (autoUpload) {
|
|
3537
|
-
(
|
|
3677
|
+
(_a130 = callbacks == null ? void 0 : callbacks.uploadFile) == null ? void 0 : _a130.call(callbacks, updated);
|
|
3538
3678
|
}
|
|
3539
3679
|
return updated;
|
|
3540
3680
|
});
|
|
@@ -3543,8 +3683,8 @@ var BaseDropzone = ({
|
|
|
3543
3683
|
});
|
|
3544
3684
|
};
|
|
3545
3685
|
const handleRejected = (rejections) => {
|
|
3546
|
-
var
|
|
3547
|
-
const error = (_c = (
|
|
3686
|
+
var _a130, _b130, _c;
|
|
3687
|
+
const error = (_c = (_b130 = (_a130 = rejections == null ? void 0 : rejections[0]) == null ? void 0 : _a130.errors) == null ? void 0 : _b130[0]) == null ? void 0 : _c.code;
|
|
3548
3688
|
if (error === "file-too-large") {
|
|
3549
3689
|
setErrorMessage(
|
|
3550
3690
|
"Ukuran file terlalu besar. Maksimal " + settings.maxSize + "MB."
|
|
@@ -3558,12 +3698,12 @@ var BaseDropzone = ({
|
|
|
3558
3698
|
}
|
|
3559
3699
|
};
|
|
3560
3700
|
const removeFile = (index) => {
|
|
3561
|
-
var
|
|
3701
|
+
var _a130, _b130;
|
|
3562
3702
|
const removedFile = files[index];
|
|
3563
3703
|
const updated = files.filter((_, i) => i !== index);
|
|
3564
3704
|
setFiles(updated);
|
|
3565
|
-
(
|
|
3566
|
-
(
|
|
3705
|
+
(_a130 = callbacks == null ? void 0 : callbacks.removeFile) == null ? void 0 : _a130.call(callbacks, removedFile == null ? void 0 : removedFile.originName);
|
|
3706
|
+
(_b130 = callbacks == null ? void 0 : callbacks.uploadFile) == null ? void 0 : _b130.call(callbacks, updated);
|
|
3567
3707
|
};
|
|
3568
3708
|
useEffect(() => {
|
|
3569
3709
|
if (callbacks == null ? void 0 : callbacks.customError) {
|
|
@@ -3571,19 +3711,19 @@ var BaseDropzone = ({
|
|
|
3571
3711
|
}
|
|
3572
3712
|
}, [callbacks == null ? void 0 : callbacks.customError]);
|
|
3573
3713
|
const renderFileIcon = (file) => {
|
|
3574
|
-
var
|
|
3575
|
-
if ((
|
|
3576
|
-
if ((
|
|
3714
|
+
var _a130, _b130, _c;
|
|
3715
|
+
if ((_a130 = file.type) == null ? void 0 : _a130.includes("pdf")) return /* @__PURE__ */ jsx(FilePDFHero, {});
|
|
3716
|
+
if ((_b130 = file.type) == null ? void 0 : _b130.includes("csv")) return /* @__PURE__ */ jsx(FileCSVHero, {});
|
|
3577
3717
|
if ((_c = file.type) == null ? void 0 : _c.includes("image")) return /* @__PURE__ */ jsx(FileJPGHero, {});
|
|
3578
3718
|
return /* @__PURE__ */ jsx(FileJPGHero, {});
|
|
3579
3719
|
};
|
|
3580
3720
|
const PreviewGrid = () => /* @__PURE__ */ jsx(
|
|
3581
|
-
|
|
3721
|
+
Box14,
|
|
3582
3722
|
{
|
|
3583
3723
|
sx: { width: "100%", display: "flex", gap: 2, mt: 3, flexWrap: "wrap" },
|
|
3584
|
-
children: files.map((file, index) => /* @__PURE__ */ jsxs(
|
|
3724
|
+
children: files.map((file, index) => /* @__PURE__ */ jsxs(Box14, { sx: { position: "relative", width: 75 }, children: [
|
|
3585
3725
|
/* @__PURE__ */ jsx(
|
|
3586
|
-
|
|
3726
|
+
Box14,
|
|
3587
3727
|
{
|
|
3588
3728
|
sx: {
|
|
3589
3729
|
position: "absolute",
|
|
@@ -3597,7 +3737,7 @@ var BaseDropzone = ({
|
|
|
3597
3737
|
),
|
|
3598
3738
|
renderFileIcon(file),
|
|
3599
3739
|
/* @__PURE__ */ jsx(
|
|
3600
|
-
|
|
3740
|
+
Box14,
|
|
3601
3741
|
{
|
|
3602
3742
|
sx: __spreadProps(__spreadValues({}, VariantStyles.caption_regular), {
|
|
3603
3743
|
mt: 1,
|
|
@@ -3611,8 +3751,8 @@ var BaseDropzone = ({
|
|
|
3611
3751
|
] }, index))
|
|
3612
3752
|
}
|
|
3613
3753
|
);
|
|
3614
|
-
const PreviewList = () => /* @__PURE__ */ jsx(
|
|
3615
|
-
|
|
3754
|
+
const PreviewList = () => /* @__PURE__ */ jsx(Box14, { sx: { mt: 3 }, children: files.map((file, index) => /* @__PURE__ */ jsxs(
|
|
3755
|
+
Box14,
|
|
3616
3756
|
{
|
|
3617
3757
|
sx: {
|
|
3618
3758
|
display: "flex",
|
|
@@ -3624,10 +3764,10 @@ var BaseDropzone = ({
|
|
|
3624
3764
|
mb: 2
|
|
3625
3765
|
},
|
|
3626
3766
|
children: [
|
|
3627
|
-
/* @__PURE__ */ jsxs(
|
|
3767
|
+
/* @__PURE__ */ jsxs(Box14, { sx: { display: "flex", alignItems: "center", gap: 2 }, children: [
|
|
3628
3768
|
renderFileIcon(file),
|
|
3629
3769
|
/* @__PURE__ */ jsx(
|
|
3630
|
-
|
|
3770
|
+
Box14,
|
|
3631
3771
|
{
|
|
3632
3772
|
sx: __spreadProps(__spreadValues({}, VariantStyles.body2_regular), {
|
|
3633
3773
|
maxWidth: 260,
|
|
@@ -3639,14 +3779,14 @@ var BaseDropzone = ({
|
|
|
3639
3779
|
}
|
|
3640
3780
|
)
|
|
3641
3781
|
] }),
|
|
3642
|
-
/* @__PURE__ */ jsx(
|
|
3782
|
+
/* @__PURE__ */ jsx(Box14, { sx: { cursor: "pointer" }, onClick: () => removeFile(index), children: /* @__PURE__ */ jsx(IconTrash, { size: 20, color: PrimitiveColor.color_red_500 }) })
|
|
3643
3783
|
]
|
|
3644
3784
|
},
|
|
3645
3785
|
index
|
|
3646
3786
|
)) });
|
|
3647
|
-
return /* @__PURE__ */ jsxs(
|
|
3787
|
+
return /* @__PURE__ */ jsxs(Box14, { children: [
|
|
3648
3788
|
labels.title && /* @__PURE__ */ jsx(
|
|
3649
|
-
|
|
3789
|
+
Box14,
|
|
3650
3790
|
{
|
|
3651
3791
|
sx: __spreadProps(__spreadValues({}, VariantStyles.body1_regular), {
|
|
3652
3792
|
fontSize: 14,
|
|
@@ -3659,7 +3799,7 @@ var BaseDropzone = ({
|
|
|
3659
3799
|
}
|
|
3660
3800
|
),
|
|
3661
3801
|
/* @__PURE__ */ jsx(
|
|
3662
|
-
|
|
3802
|
+
Box14,
|
|
3663
3803
|
{
|
|
3664
3804
|
sx: {
|
|
3665
3805
|
border: `2px ${files.length ? "solid" : "dashed"} ${isError ? DerivedColor.color_border_danger : files.length ? DerivedColor.color_border_brand_primary : DerivedColor.color_border_default}`,
|
|
@@ -3681,7 +3821,7 @@ var BaseDropzone = ({
|
|
|
3681
3821
|
accept: settings.allowedExtensions,
|
|
3682
3822
|
multiple: !isSingle,
|
|
3683
3823
|
children: ({ getRootProps, getInputProps }) => /* @__PURE__ */ jsxs(
|
|
3684
|
-
|
|
3824
|
+
Box14,
|
|
3685
3825
|
__spreadProps(__spreadValues({}, getRootProps()), {
|
|
3686
3826
|
sx: {
|
|
3687
3827
|
cursor: "pointer",
|
|
@@ -3695,9 +3835,9 @@ var BaseDropzone = ({
|
|
|
3695
3835
|
children: [
|
|
3696
3836
|
/* @__PURE__ */ jsx("input", __spreadValues({}, getInputProps())),
|
|
3697
3837
|
/* @__PURE__ */ jsx(IconUpload$1, { size: 32, color: DerivedColor.color_icon_brand_primary }),
|
|
3698
|
-
/* @__PURE__ */ jsx(
|
|
3838
|
+
/* @__PURE__ */ jsx(Box14, { sx: __spreadProps(__spreadValues({}, VariantStyles.header1_semibold), { mt: 1 }), children: labels.dropzoneTitle }),
|
|
3699
3839
|
/* @__PURE__ */ jsx(
|
|
3700
|
-
|
|
3840
|
+
Box14,
|
|
3701
3841
|
{
|
|
3702
3842
|
sx: __spreadProps(__spreadValues({}, VariantStyles.body1_regular), {
|
|
3703
3843
|
color: PrimitiveColor.color_neutral_600,
|
|
@@ -3716,7 +3856,7 @@ var BaseDropzone = ({
|
|
|
3716
3856
|
}
|
|
3717
3857
|
),
|
|
3718
3858
|
labels.allowedFileLabel && /* @__PURE__ */ jsx(
|
|
3719
|
-
|
|
3859
|
+
Box14,
|
|
3720
3860
|
{
|
|
3721
3861
|
sx: __spreadProps(__spreadValues({}, VariantStyles.caption_regular), {
|
|
3722
3862
|
color: PrimitiveColor.color_neutral_600,
|
|
@@ -3736,7 +3876,7 @@ var BaseDropzone = ({
|
|
|
3736
3876
|
),
|
|
3737
3877
|
files.length > 0 && (settings.previewType === "list" ? /* @__PURE__ */ jsx(PreviewList, {}) : /* @__PURE__ */ jsx(PreviewGrid, {})),
|
|
3738
3878
|
isError && /* @__PURE__ */ jsxs(
|
|
3739
|
-
|
|
3879
|
+
Box14,
|
|
3740
3880
|
{
|
|
3741
3881
|
sx: __spreadProps(__spreadValues({
|
|
3742
3882
|
display: "flex",
|
|
@@ -3755,18 +3895,18 @@ var BaseDropzone = ({
|
|
|
3755
3895
|
)
|
|
3756
3896
|
] });
|
|
3757
3897
|
};
|
|
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
3898
|
var _a62, _b62;
|
|
3767
|
-
var
|
|
3768
|
-
var
|
|
3769
|
-
|
|
3899
|
+
var Radio = (_b62 = (_a62 = RadioRaw) == null ? void 0 : _a62.default) != null ? _b62 : RadioRaw;
|
|
3900
|
+
var _a63, _b63;
|
|
3901
|
+
var RadioGroup = (_b63 = (_a63 = RadioGroupRaw) == null ? void 0 : _a63.default) != null ? _b63 : RadioGroupRaw;
|
|
3902
|
+
var _a64, _b64;
|
|
3903
|
+
var FormControlLabel2 = (_b64 = (_a64 = FormControlLabelRaw) == null ? void 0 : _a64.default) != null ? _b64 : FormControlLabelRaw;
|
|
3904
|
+
var _a65, _b65;
|
|
3905
|
+
var FormControl = (_b65 = (_a65 = FormControlRaw) == null ? void 0 : _a65.default) != null ? _b65 : FormControlRaw;
|
|
3906
|
+
var _a66, _b66;
|
|
3907
|
+
var Box15 = (_b66 = (_a66 = BoxRaw) == null ? void 0 : _a66.default) != null ? _b66 : BoxRaw;
|
|
3908
|
+
var BaseRadioButton = (_a130) => {
|
|
3909
|
+
var _b130 = _a130, {
|
|
3770
3910
|
name = "",
|
|
3771
3911
|
control = null,
|
|
3772
3912
|
defaultValue,
|
|
@@ -3777,7 +3917,7 @@ var BaseRadioButton = (_a126) => {
|
|
|
3777
3917
|
isDisabled: isDisabled,
|
|
3778
3918
|
useErrorStateHelper: useErrorStateHelper = false,
|
|
3779
3919
|
sx: sx = {}
|
|
3780
|
-
} =
|
|
3920
|
+
} = _b130, restProps = __objRest(_b130, [
|
|
3781
3921
|
"name",
|
|
3782
3922
|
"control",
|
|
3783
3923
|
"defaultValue",
|
|
@@ -3795,10 +3935,10 @@ var BaseRadioButton = (_a126) => {
|
|
|
3795
3935
|
/* ================= SX ================= */
|
|
3796
3936
|
"sx"
|
|
3797
3937
|
]);
|
|
3798
|
-
var
|
|
3938
|
+
var _a131, _b131, _c, _d, _e, _f;
|
|
3799
3939
|
const { field, formState } = useController({ control, name, defaultValue });
|
|
3800
3940
|
const errorObject = useErrorStateHelper ? errorState(name, formState.errors) : null;
|
|
3801
|
-
const errorMessage = ((
|
|
3941
|
+
const errorMessage = ((_a131 = errorObject == null ? void 0 : errorObject.message) == null ? void 0 : _a131.toString()) || ((_c = (_b131 = formState.errors) == null ? void 0 : _b131[name]) == null ? void 0 : _c.message);
|
|
3802
3942
|
const radioColor = PrimitiveColor.color_blue_cakrawala_500;
|
|
3803
3943
|
const gapValue = (_d = SpacingToken) == null ? void 0 : _d.spacing0;
|
|
3804
3944
|
const isHorizontal = orientation === "horizontal";
|
|
@@ -3811,7 +3951,7 @@ var BaseRadioButton = (_a126) => {
|
|
|
3811
3951
|
py: SpacingToken.spacing0,
|
|
3812
3952
|
borderRadius: Radius.radius_2
|
|
3813
3953
|
};
|
|
3814
|
-
return /* @__PURE__ */ jsxs(
|
|
3954
|
+
return /* @__PURE__ */ jsxs(Box15, { sx, children: [
|
|
3815
3955
|
title && /* @__PURE__ */ jsx(
|
|
3816
3956
|
BaseTypography,
|
|
3817
3957
|
{
|
|
@@ -3834,9 +3974,9 @@ var BaseRadioButton = (_a126) => {
|
|
|
3834
3974
|
sx: { gap: gapValue }
|
|
3835
3975
|
}, restProps), {
|
|
3836
3976
|
children: options.length > 0 ? options.map((item, index) => {
|
|
3837
|
-
var
|
|
3838
|
-
const
|
|
3839
|
-
const optionDisabled = (_c2 = (
|
|
3977
|
+
var _b132, _c2, _d2, _e2;
|
|
3978
|
+
const _a132 = item, { isDisabled: itemDisabled, disabled: itemNativeDisabled, value, label } = _a132, itemRest = __objRest(_a132, ["isDisabled", "disabled", "value", "label"]);
|
|
3979
|
+
const optionDisabled = (_c2 = (_b132 = isDisabled != null ? isDisabled : itemDisabled) != null ? _b132 : itemNativeDisabled) != null ? _c2 : false;
|
|
3840
3980
|
return /* @__PURE__ */ jsx(
|
|
3841
3981
|
FormControlLabel2,
|
|
3842
3982
|
__spreadValues({
|
|
@@ -3875,28 +4015,28 @@ var BaseRadioButton = (_a126) => {
|
|
|
3875
4015
|
] })
|
|
3876
4016
|
] });
|
|
3877
4017
|
};
|
|
3878
|
-
var _a63, _b63;
|
|
3879
|
-
var Check = (_b63 = (_a63 = CheckRaw) == null ? void 0 : _a63.default) != null ? _b63 : CheckRaw;
|
|
3880
|
-
var _a64, _b64;
|
|
3881
|
-
var CheckIcon = (_b64 = (_a64 = CheckRaw) == null ? void 0 : _a64.default) != null ? _b64 : CheckRaw;
|
|
3882
|
-
var _a65, _b65;
|
|
3883
|
-
var StepLabel = (_b65 = (_a65 = StepLabelRaw) == null ? void 0 : _a65.default) != null ? _b65 : StepLabelRaw;
|
|
3884
|
-
var _a66, _b66;
|
|
3885
|
-
var StepConnector = (_b66 = (_a66 = StepConnectorRaw) == null ? void 0 : _a66.default) != null ? _b66 : StepConnectorRaw;
|
|
3886
4018
|
var _a67, _b67;
|
|
3887
|
-
var
|
|
4019
|
+
var Check = (_b67 = (_a67 = CheckRaw) == null ? void 0 : _a67.default) != null ? _b67 : CheckRaw;
|
|
3888
4020
|
var _a68, _b68;
|
|
3889
|
-
var
|
|
4021
|
+
var CheckIcon = (_b68 = (_a68 = CheckRaw) == null ? void 0 : _a68.default) != null ? _b68 : CheckRaw;
|
|
3890
4022
|
var _a69, _b69;
|
|
3891
|
-
var
|
|
4023
|
+
var StepLabel = (_b69 = (_a69 = StepLabelRaw) == null ? void 0 : _a69.default) != null ? _b69 : StepLabelRaw;
|
|
3892
4024
|
var _a70, _b70;
|
|
3893
|
-
var
|
|
4025
|
+
var StepConnector = (_b70 = (_a70 = StepConnectorRaw) == null ? void 0 : _a70.default) != null ? _b70 : StepConnectorRaw;
|
|
3894
4026
|
var _a71, _b71;
|
|
3895
|
-
var
|
|
4027
|
+
var Step = (_b71 = (_a71 = StepRaw) == null ? void 0 : _a71.default) != null ? _b71 : StepRaw;
|
|
3896
4028
|
var _a72, _b72;
|
|
3897
|
-
var
|
|
4029
|
+
var Stepper = (_b72 = (_a72 = StepperRaw) == null ? void 0 : _a72.default) != null ? _b72 : StepperRaw;
|
|
3898
4030
|
var _a73, _b73;
|
|
3899
|
-
var
|
|
4031
|
+
var Stack = (_b73 = (_a73 = StackRaw) == null ? void 0 : _a73.default) != null ? _b73 : StackRaw;
|
|
4032
|
+
var _a74, _b74;
|
|
4033
|
+
var Box16 = (_b74 = (_a74 = BoxRaw) == null ? void 0 : _a74.default) != null ? _b74 : BoxRaw;
|
|
4034
|
+
var _a75, _b75;
|
|
4035
|
+
var Typography3 = (_b75 = (_a75 = MuiTypographyRaw) == null ? void 0 : _a75.default) != null ? _b75 : MuiTypographyRaw;
|
|
4036
|
+
var _a76, _b76;
|
|
4037
|
+
var Button = (_b76 = (_a76 = ButtonRaw) == null ? void 0 : _a76.default) != null ? _b76 : ButtonRaw;
|
|
4038
|
+
var _a77, _b77;
|
|
4039
|
+
var Tooltip = (_b77 = (_a77 = TooltipRaw) == null ? void 0 : _a77.default) != null ? _b77 : TooltipRaw;
|
|
3900
4040
|
var CustomStepLabel = styled(StepLabel)(({ orientation }) => __spreadValues(__spreadProps(__spreadValues({}, orientation === "vertical" && {
|
|
3901
4041
|
alignItems: "flex-start",
|
|
3902
4042
|
"& .MuiStepLabel-labelContainer": {
|
|
@@ -4015,8 +4155,8 @@ var CustomProcessIcon = styled(CheckIcon)({
|
|
|
4015
4155
|
justifyContent: "center",
|
|
4016
4156
|
alignItems: "center"
|
|
4017
4157
|
});
|
|
4018
|
-
var HtmlTooltip = styled((
|
|
4019
|
-
var
|
|
4158
|
+
var HtmlTooltip = styled((_a130) => {
|
|
4159
|
+
var _b130 = _a130, { className } = _b130, props = __objRest(_b130, ["className"]);
|
|
4020
4160
|
return /* @__PURE__ */ jsx(Tooltip, __spreadProps(__spreadValues({}, props), { classes: { popper: className } }));
|
|
4021
4161
|
})(() => ({
|
|
4022
4162
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
@@ -4044,7 +4184,7 @@ var BaseStepper = ({
|
|
|
4044
4184
|
connector: /* @__PURE__ */ jsx(ColorlibConnector, { orientation }),
|
|
4045
4185
|
orientation,
|
|
4046
4186
|
children: steps == null ? void 0 : steps.map((step, index) => {
|
|
4047
|
-
var
|
|
4187
|
+
var _a130;
|
|
4048
4188
|
return /* @__PURE__ */ jsx(Step, { children: /* @__PURE__ */ jsx(
|
|
4049
4189
|
StepLabel,
|
|
4050
4190
|
{
|
|
@@ -4054,9 +4194,9 @@ var BaseStepper = ({
|
|
|
4054
4194
|
{
|
|
4055
4195
|
title: /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
4056
4196
|
/* @__PURE__ */ jsx(Typography3, { color: "inherit", children: step == null ? void 0 : step.title }),
|
|
4057
|
-
(
|
|
4058
|
-
(list == null ? void 0 : list.is_done) === 1 ? /* @__PURE__ */ jsx(
|
|
4059
|
-
/* @__PURE__ */ jsx(
|
|
4197
|
+
(_a130 = step == null ? void 0 : step.sublist) == null ? void 0 : _a130.map((list, subIndex) => /* @__PURE__ */ jsx(Box16, { sx: { display: "grid", gap: 1, mt: 0.5 }, children: /* @__PURE__ */ jsxs(Box16, { sx: { display: "flex", gap: 1, alignItems: "center" }, children: [
|
|
4198
|
+
(list == null ? void 0 : list.is_done) === 1 ? /* @__PURE__ */ jsx(Box16, { sx: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx(CustomCheckIcon, {}) }) : /* @__PURE__ */ jsx(Box16, { sx: { display: "flex", alignItems: "center" }, children: /* @__PURE__ */ jsx(CustomProcessIcon, {}) }),
|
|
4199
|
+
/* @__PURE__ */ jsx(Box16, { children: list == null ? void 0 : list.sublist_title })
|
|
4060
4200
|
] }) }, subIndex))
|
|
4061
4201
|
] }),
|
|
4062
4202
|
children: /* @__PURE__ */ jsx(
|
|
@@ -4079,7 +4219,7 @@ var BaseStepper = ({
|
|
|
4079
4219
|
}
|
|
4080
4220
|
) });
|
|
4081
4221
|
}
|
|
4082
|
-
return /* @__PURE__ */ jsx(
|
|
4222
|
+
return /* @__PURE__ */ jsx(Box16, { sx: __spreadValues({ width: "100%" }, sx), children: /* @__PURE__ */ jsx(
|
|
4083
4223
|
Stepper,
|
|
4084
4224
|
{
|
|
4085
4225
|
activeStep,
|
|
@@ -4093,7 +4233,7 @@ var BaseStepper = ({
|
|
|
4093
4233
|
if (isActive) statusColor = PrimitiveColor.color_blue_cakrawala_500;
|
|
4094
4234
|
if (isCompleted) statusColor = PrimitiveColor.color_green_500;
|
|
4095
4235
|
return /* @__PURE__ */ jsx(Step, { children: /* @__PURE__ */ jsx(CustomStepLabel, { orientation, children: /* @__PURE__ */ jsxs(
|
|
4096
|
-
|
|
4236
|
+
Box16,
|
|
4097
4237
|
{
|
|
4098
4238
|
sx: {
|
|
4099
4239
|
display: "flex",
|
|
@@ -4130,16 +4270,16 @@ BaseStepper.propTypes = {
|
|
|
4130
4270
|
variant: PropTypes3.oneOf(["simple", "dashboard"]),
|
|
4131
4271
|
sx: PropTypes3.object
|
|
4132
4272
|
};
|
|
4133
|
-
var
|
|
4134
|
-
var InputAdornment2 = (
|
|
4135
|
-
var
|
|
4136
|
-
var TextField2 = (
|
|
4137
|
-
var
|
|
4138
|
-
var
|
|
4139
|
-
var
|
|
4140
|
-
var Typography4 = (
|
|
4141
|
-
var BaseTextField = (
|
|
4142
|
-
var
|
|
4273
|
+
var _a78, _b78;
|
|
4274
|
+
var InputAdornment2 = (_b78 = (_a78 = InputAdornmentRaw) == null ? void 0 : _a78.default) != null ? _b78 : InputAdornmentRaw;
|
|
4275
|
+
var _a79, _b79;
|
|
4276
|
+
var TextField2 = (_b79 = (_a79 = TextFieldRaw) == null ? void 0 : _a79.default) != null ? _b79 : TextFieldRaw;
|
|
4277
|
+
var _a80, _b80;
|
|
4278
|
+
var Box17 = (_b80 = (_a80 = BoxRaw) == null ? void 0 : _a80.default) != null ? _b80 : BoxRaw;
|
|
4279
|
+
var _a81, _b81;
|
|
4280
|
+
var Typography4 = (_b81 = (_a81 = MuiTypographyRaw) == null ? void 0 : _a81.default) != null ? _b81 : MuiTypographyRaw;
|
|
4281
|
+
var BaseTextField = (_a130) => {
|
|
4282
|
+
var _b130 = _a130, {
|
|
4143
4283
|
name = "",
|
|
4144
4284
|
control = null,
|
|
4145
4285
|
defaultValue,
|
|
@@ -4160,7 +4300,7 @@ var BaseTextField = (_a126) => {
|
|
|
4160
4300
|
InputProps: externalInputProps,
|
|
4161
4301
|
inputProps: externalInputPropsLower,
|
|
4162
4302
|
sx = {}
|
|
4163
|
-
} =
|
|
4303
|
+
} = _b130, props = __objRest(_b130, [
|
|
4164
4304
|
"name",
|
|
4165
4305
|
"control",
|
|
4166
4306
|
"defaultValue",
|
|
@@ -4182,7 +4322,7 @@ var BaseTextField = (_a126) => {
|
|
|
4182
4322
|
"inputProps",
|
|
4183
4323
|
"sx"
|
|
4184
4324
|
]);
|
|
4185
|
-
var
|
|
4325
|
+
var _a131, _b131, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
4186
4326
|
const { field, formState } = useController({ control, name, defaultValue });
|
|
4187
4327
|
const inputRef = useRef(null);
|
|
4188
4328
|
const hasMask = !!textMask;
|
|
@@ -4275,12 +4415,12 @@ var BaseTextField = (_a126) => {
|
|
|
4275
4415
|
return new RegExp(`^[${allowedPattern}\\s]+$`);
|
|
4276
4416
|
};
|
|
4277
4417
|
const handleKeyDown = (e) => {
|
|
4278
|
-
var
|
|
4418
|
+
var _a132, _b132, _c2;
|
|
4279
4419
|
if (hasMask) {
|
|
4280
4420
|
const input = e.target;
|
|
4281
4421
|
const value = input.value || "";
|
|
4282
|
-
const selectionStart = (
|
|
4283
|
-
const selectionEnd = (
|
|
4422
|
+
const selectionStart = (_a132 = input.selectionStart) != null ? _a132 : value.length;
|
|
4423
|
+
const selectionEnd = (_b132 = input.selectionEnd) != null ? _b132 : value.length;
|
|
4284
4424
|
const allowedKeys2 = [
|
|
4285
4425
|
"Tab",
|
|
4286
4426
|
"Backspace",
|
|
@@ -4426,7 +4566,7 @@ var BaseTextField = (_a126) => {
|
|
|
4426
4566
|
}
|
|
4427
4567
|
};
|
|
4428
4568
|
const handlePaste = (e) => {
|
|
4429
|
-
var
|
|
4569
|
+
var _a132, _b132;
|
|
4430
4570
|
if (hasMask) {
|
|
4431
4571
|
if (isCantPaste) {
|
|
4432
4572
|
e.preventDefault();
|
|
@@ -4435,8 +4575,8 @@ var BaseTextField = (_a126) => {
|
|
|
4435
4575
|
const pastedData2 = e.clipboardData.getData("Text") || "";
|
|
4436
4576
|
const cleaned = sanitizeRaw(pastedData2);
|
|
4437
4577
|
const input = e.target;
|
|
4438
|
-
const selectionStart2 = (
|
|
4439
|
-
const selectionEnd2 = (
|
|
4578
|
+
const selectionStart2 = (_a132 = input.selectionStart) != null ? _a132 : 0;
|
|
4579
|
+
const selectionEnd2 = (_b132 = input.selectionEnd) != null ? _b132 : 0;
|
|
4440
4580
|
const currentRaw = sanitizeRaw(field.value).slice(0, maskSlots);
|
|
4441
4581
|
let rawArr = currentRaw.split("");
|
|
4442
4582
|
const xStart = (textMask.slice(0, selectionStart2).match(/x/gi) || []).length;
|
|
@@ -4509,22 +4649,22 @@ var BaseTextField = (_a126) => {
|
|
|
4509
4649
|
setDisplayValue(newDisplay);
|
|
4510
4650
|
field.onChange(raw);
|
|
4511
4651
|
requestAnimationFrame(() => {
|
|
4512
|
-
var
|
|
4652
|
+
var _a132;
|
|
4513
4653
|
try {
|
|
4514
4654
|
const caret = computeCaretFromRawLen(raw.length, textMask);
|
|
4515
|
-
(
|
|
4655
|
+
(_a132 = inputRef.current) == null ? void 0 : _a132.setSelectionRange(caret, caret);
|
|
4516
4656
|
} catch (e2) {
|
|
4517
4657
|
}
|
|
4518
4658
|
});
|
|
4519
4659
|
};
|
|
4520
|
-
return /* @__PURE__ */ jsxs(
|
|
4660
|
+
return /* @__PURE__ */ jsxs(Box17, { sx, children: [
|
|
4521
4661
|
props.title && /* @__PURE__ */ jsx(
|
|
4522
4662
|
Typography4,
|
|
4523
4663
|
{
|
|
4524
4664
|
variant: "body2",
|
|
4525
4665
|
sx: {
|
|
4526
4666
|
fontWeight: 600,
|
|
4527
|
-
color: !!((
|
|
4667
|
+
color: !!((_a131 = formState.errors) == null ? void 0 : _a131[name]) ? DerivedColor.color_text_danger : DerivedColor.color_text_default,
|
|
4528
4668
|
mb: "4px"
|
|
4529
4669
|
},
|
|
4530
4670
|
children: props.title
|
|
@@ -4536,10 +4676,10 @@ var BaseTextField = (_a126) => {
|
|
|
4536
4676
|
id: props.id || `field-${name}`,
|
|
4537
4677
|
variant: "outlined",
|
|
4538
4678
|
fullWidth: true,
|
|
4539
|
-
error: !!((
|
|
4679
|
+
error: !!((_b131 = formState.errors) == null ? void 0 : _b131[name]),
|
|
4540
4680
|
helperText: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
4541
|
-
/* @__PURE__ */ jsx(
|
|
4542
|
-
maxLength && showCountHelper && /* @__PURE__ */ jsxs(
|
|
4681
|
+
/* @__PURE__ */ jsx(Box17, { component: "span", children: ((_d = (_c = formState.errors) == null ? void 0 : _c[name]) == null ? void 0 : _d.message) || (maxLength && showLength ? `Maksimal ${maxLength} Karakter` : "") }),
|
|
4682
|
+
maxLength && showCountHelper && /* @__PURE__ */ jsxs(Box17, { component: "span", sx: { ml: "auto" }, children: [
|
|
4543
4683
|
((_e = field.value) == null ? void 0 : _e.length) || 0,
|
|
4544
4684
|
"/",
|
|
4545
4685
|
maxLength
|
|
@@ -4608,18 +4748,18 @@ var BaseTextField = (_a126) => {
|
|
|
4608
4748
|
)
|
|
4609
4749
|
] });
|
|
4610
4750
|
};
|
|
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
4751
|
var _a82, _b82;
|
|
4620
|
-
var
|
|
4752
|
+
var Box18 = (_b82 = (_a82 = BoxRaw) == null ? void 0 : _a82.default) != null ? _b82 : BoxRaw;
|
|
4621
4753
|
var _a83, _b83;
|
|
4622
|
-
var
|
|
4754
|
+
var Button2 = (_b83 = (_a83 = ButtonRaw) == null ? void 0 : _a83.default) != null ? _b83 : ButtonRaw;
|
|
4755
|
+
var _a84, _b84;
|
|
4756
|
+
var Input = (_b84 = (_a84 = InputRaw) == null ? void 0 : _a84.default) != null ? _b84 : InputRaw;
|
|
4757
|
+
var _a85, _b85;
|
|
4758
|
+
var TextField3 = (_b85 = (_a85 = TextFieldRaw) == null ? void 0 : _a85.default) != null ? _b85 : TextFieldRaw;
|
|
4759
|
+
var _a86, _b86;
|
|
4760
|
+
var Typography5 = (_b86 = (_a86 = MuiTypographyRaw) == null ? void 0 : _a86.default) != null ? _b86 : MuiTypographyRaw;
|
|
4761
|
+
var _a87, _b87;
|
|
4762
|
+
var UploadFile = (_b87 = (_a87 = UploadFileRaw) == null ? void 0 : _a87.default) != null ? _b87 : UploadFileRaw;
|
|
4623
4763
|
var TextFieldUpload = ({
|
|
4624
4764
|
name = "upload",
|
|
4625
4765
|
control,
|
|
@@ -4645,14 +4785,14 @@ var TextFieldUpload = ({
|
|
|
4645
4785
|
const [fileSizeError, setFileSizeError] = useState(false);
|
|
4646
4786
|
const [unsupportedFile, setUnsupportedFile] = useState(false);
|
|
4647
4787
|
const handleFileChange = (event) => {
|
|
4648
|
-
var
|
|
4649
|
-
const file = (
|
|
4788
|
+
var _a130, _b130;
|
|
4789
|
+
const file = (_a130 = event.target.files) == null ? void 0 : _a130[0];
|
|
4650
4790
|
if (!file) {
|
|
4651
4791
|
field.onChange("");
|
|
4652
4792
|
uploadFile == null ? void 0 : uploadFile("", null);
|
|
4653
4793
|
return;
|
|
4654
4794
|
}
|
|
4655
|
-
const extension = (
|
|
4795
|
+
const extension = (_b130 = file.name.split(".").pop()) == null ? void 0 : _b130.toLowerCase();
|
|
4656
4796
|
const acceptedExtensions = accept ? accept.split(",").map((ext) => ext.trim().toLowerCase()) : [];
|
|
4657
4797
|
if (acceptedExtensions.length > 0 && !acceptedExtensions.includes(`.${extension}`)) {
|
|
4658
4798
|
setUnsupportedFile(true);
|
|
@@ -4676,8 +4816,8 @@ var TextFieldUpload = ({
|
|
|
4676
4816
|
isError ? PrimitiveColor.color_red_500 : isSuccess ? PrimitiveColor.color_blue_cakrawala_500 : PrimitiveColor.color_neutral_300;
|
|
4677
4817
|
const helperText = fileSizeError ? `Ukuran file melebihi ${maxSize} MB` : unsupportedFile ? "Format file tidak didukung" : `Format ${accept || "-"} ukuran maks. ${maxSize} MB`;
|
|
4678
4818
|
const handleButtonClick = () => {
|
|
4679
|
-
var
|
|
4680
|
-
(
|
|
4819
|
+
var _a130;
|
|
4820
|
+
(_a130 = inputRef.current) == null ? void 0 : _a130.click();
|
|
4681
4821
|
};
|
|
4682
4822
|
const uploadButton = /* @__PURE__ */ jsx(
|
|
4683
4823
|
Button2,
|
|
@@ -4715,7 +4855,7 @@ var TextFieldUpload = ({
|
|
|
4715
4855
|
)
|
|
4716
4856
|
}
|
|
4717
4857
|
);
|
|
4718
|
-
return /* @__PURE__ */ jsxs(
|
|
4858
|
+
return /* @__PURE__ */ jsxs(Box18, { width: "100%", children: [
|
|
4719
4859
|
title && /* @__PURE__ */ jsx(
|
|
4720
4860
|
Typography5,
|
|
4721
4861
|
{
|
|
@@ -4728,8 +4868,8 @@ var TextFieldUpload = ({
|
|
|
4728
4868
|
children: title
|
|
4729
4869
|
}
|
|
4730
4870
|
),
|
|
4731
|
-
/* @__PURE__ */ jsxs(
|
|
4732
|
-
/* @__PURE__ */ jsxs(
|
|
4871
|
+
/* @__PURE__ */ jsxs(Box18, { width: "100%", children: [
|
|
4872
|
+
/* @__PURE__ */ jsxs(Box18, { display: "flex", width: "100%", children: [
|
|
4733
4873
|
buttonPosition === "start" && uploadButton,
|
|
4734
4874
|
/* @__PURE__ */ jsx(
|
|
4735
4875
|
TextField3,
|
|
@@ -4774,7 +4914,7 @@ var TextFieldUpload = ({
|
|
|
4774
4914
|
buttonPosition === "end" && uploadButton
|
|
4775
4915
|
] }),
|
|
4776
4916
|
/* @__PURE__ */ jsxs(
|
|
4777
|
-
|
|
4917
|
+
Box18,
|
|
4778
4918
|
{
|
|
4779
4919
|
display: "flex",
|
|
4780
4920
|
alignItems: "center",
|
|
@@ -4814,13 +4954,13 @@ function Editor(props) {
|
|
|
4814
4954
|
useEffect(() => {
|
|
4815
4955
|
let cancelled = false;
|
|
4816
4956
|
async function load() {
|
|
4817
|
-
var
|
|
4957
|
+
var _a130, _b130, _c, _d, _e, _f, _g;
|
|
4818
4958
|
const alreadyLoaded = typeof window !== "undefined" && window.tinymce;
|
|
4819
4959
|
if (!alreadyLoaded) {
|
|
4820
4960
|
try {
|
|
4821
4961
|
const tinymceModule = await import('tinymce/tinymce');
|
|
4822
4962
|
if (typeof window !== "undefined" && !window.tinymce) {
|
|
4823
|
-
const core = (
|
|
4963
|
+
const core = (_a130 = tinymceModule.default) != null ? _a130 : tinymceModule;
|
|
4824
4964
|
if (core && typeof core === "object" && core.tinymce) {
|
|
4825
4965
|
window.tinymce = core.tinymce;
|
|
4826
4966
|
} else {
|
|
@@ -4871,7 +5011,7 @@ function Editor(props) {
|
|
|
4871
5011
|
import('tinymce/skins/content/default/content.min.css'),
|
|
4872
5012
|
import('tinymce/skins/ui/oxide/content.min.css')
|
|
4873
5013
|
]);
|
|
4874
|
-
const skinCss = (
|
|
5014
|
+
const skinCss = (_b130 = skinMod == null ? void 0 : skinMod.default) != null ? _b130 : "";
|
|
4875
5015
|
const contentCss = (_c = contentMod == null ? void 0 : contentMod.default) != null ? _c : "";
|
|
4876
5016
|
const oxideContentCss = (_d = oxideContentMod == null ? void 0 : oxideContentMod.default) != null ? _d : "";
|
|
4877
5017
|
const combinedCss = [skinCss, contentCss, oxideContentCss].filter(Boolean).join("\n");
|
|
@@ -4911,16 +5051,16 @@ function Editor(props) {
|
|
|
4911
5051
|
}
|
|
4912
5052
|
return /* @__PURE__ */ jsx(TinyEditor, __spreadValues({}, props));
|
|
4913
5053
|
}
|
|
4914
|
-
var
|
|
4915
|
-
var InputAdornment3 = (
|
|
4916
|
-
var
|
|
4917
|
-
var TextField4 = (
|
|
4918
|
-
var
|
|
4919
|
-
var
|
|
4920
|
-
var
|
|
4921
|
-
var Typography6 = (
|
|
4922
|
-
var BaseTextArea = (
|
|
4923
|
-
var
|
|
5054
|
+
var _a88, _b88;
|
|
5055
|
+
var InputAdornment3 = (_b88 = (_a88 = InputAdornmentRaw) == null ? void 0 : _a88.default) != null ? _b88 : InputAdornmentRaw;
|
|
5056
|
+
var _a89, _b89;
|
|
5057
|
+
var TextField4 = (_b89 = (_a89 = TextFieldRaw) == null ? void 0 : _a89.default) != null ? _b89 : TextFieldRaw;
|
|
5058
|
+
var _a90, _b90;
|
|
5059
|
+
var Box19 = (_b90 = (_a90 = BoxRaw) == null ? void 0 : _a90.default) != null ? _b90 : BoxRaw;
|
|
5060
|
+
var _a91, _b91;
|
|
5061
|
+
var Typography6 = (_b91 = (_a91 = MuiTypographyRaw) == null ? void 0 : _a91.default) != null ? _b91 : MuiTypographyRaw;
|
|
5062
|
+
var BaseTextArea = (_a130) => {
|
|
5063
|
+
var _b130 = _a130, {
|
|
4924
5064
|
name = "",
|
|
4925
5065
|
control = null,
|
|
4926
5066
|
defaultValue = "",
|
|
@@ -4934,7 +5074,7 @@ var BaseTextArea = (_a126) => {
|
|
|
4934
5074
|
init,
|
|
4935
5075
|
handleImageUpload,
|
|
4936
5076
|
sx = {}
|
|
4937
|
-
} =
|
|
5077
|
+
} = _b130, props = __objRest(_b130, [
|
|
4938
5078
|
"name",
|
|
4939
5079
|
"control",
|
|
4940
5080
|
"defaultValue",
|
|
@@ -4949,8 +5089,8 @@ var BaseTextArea = (_a126) => {
|
|
|
4949
5089
|
"handleImageUpload",
|
|
4950
5090
|
"sx"
|
|
4951
5091
|
]);
|
|
4952
|
-
var
|
|
4953
|
-
const computedMaxLength = (
|
|
5092
|
+
var _a131, _b131, _c, _d, _e, _f, _g;
|
|
5093
|
+
const computedMaxLength = (_b131 = exactLength != null ? exactLength : maxLength) != null ? _b131 : (_a131 = rules == null ? void 0 : rules.maxLength) == null ? void 0 : _a131.value;
|
|
4954
5094
|
const { field, fieldState } = useController({
|
|
4955
5095
|
control,
|
|
4956
5096
|
name,
|
|
@@ -5019,7 +5159,7 @@ var BaseTextArea = (_a126) => {
|
|
|
5019
5159
|
const editorId = (_e = props.id) != null ? _e : `textarea-${name}-${uniqueSuffix}`;
|
|
5020
5160
|
const wrapperId = `editor-wrap-${uniqueSuffix}`;
|
|
5021
5161
|
if (useRichText) {
|
|
5022
|
-
return /* @__PURE__ */ jsxs(
|
|
5162
|
+
return /* @__PURE__ */ jsxs(Box19, { id: wrapperId, sx, children: [
|
|
5023
5163
|
title && /* @__PURE__ */ jsx(
|
|
5024
5164
|
Typography6,
|
|
5025
5165
|
{
|
|
@@ -5125,7 +5265,7 @@ var BaseTextArea = (_a126) => {
|
|
|
5125
5265
|
] });
|
|
5126
5266
|
}
|
|
5127
5267
|
return /* @__PURE__ */ jsxs(
|
|
5128
|
-
|
|
5268
|
+
Box19,
|
|
5129
5269
|
{
|
|
5130
5270
|
sx: __spreadValues({
|
|
5131
5271
|
display: "flex",
|
|
@@ -5169,16 +5309,16 @@ var BaseTextArea = (_a126) => {
|
|
|
5169
5309
|
}
|
|
5170
5310
|
);
|
|
5171
5311
|
};
|
|
5172
|
-
var _a88, _b88;
|
|
5173
|
-
var Dialog = (_b88 = (_a88 = DialogRaw) == null ? void 0 : _a88.default) != null ? _b88 : DialogRaw;
|
|
5174
|
-
var _a89, _b89;
|
|
5175
|
-
var DialogContent = (_b89 = (_a89 = DialogContentRaw) == null ? void 0 : _a89.default) != null ? _b89 : DialogContentRaw;
|
|
5176
|
-
var _a90, _b90;
|
|
5177
|
-
var DialogActions = (_b90 = (_a90 = DialogActionsRaw) == null ? void 0 : _a90.default) != null ? _b90 : DialogActionsRaw;
|
|
5178
|
-
var _a91, _b91;
|
|
5179
|
-
var IconButton6 = (_b91 = (_a91 = IconButtonRaw) == null ? void 0 : _a91.default) != null ? _b91 : IconButtonRaw;
|
|
5180
5312
|
var _a92, _b92;
|
|
5181
|
-
var
|
|
5313
|
+
var Dialog = (_b92 = (_a92 = DialogRaw) == null ? void 0 : _a92.default) != null ? _b92 : DialogRaw;
|
|
5314
|
+
var _a93, _b93;
|
|
5315
|
+
var DialogContent = (_b93 = (_a93 = DialogContentRaw) == null ? void 0 : _a93.default) != null ? _b93 : DialogContentRaw;
|
|
5316
|
+
var _a94, _b94;
|
|
5317
|
+
var DialogActions = (_b94 = (_a94 = DialogActionsRaw) == null ? void 0 : _a94.default) != null ? _b94 : DialogActionsRaw;
|
|
5318
|
+
var _a95, _b95;
|
|
5319
|
+
var IconButton7 = (_b95 = (_a95 = IconButtonRaw) == null ? void 0 : _a95.default) != null ? _b95 : IconButtonRaw;
|
|
5320
|
+
var _a96, _b96;
|
|
5321
|
+
var Box20 = (_b96 = (_a96 = BoxRaw) == null ? void 0 : _a96.default) != null ? _b96 : BoxRaw;
|
|
5182
5322
|
var ICON_MAP = {
|
|
5183
5323
|
success: {
|
|
5184
5324
|
Hero: SuccessHero,
|
|
@@ -5231,13 +5371,13 @@ var ModalAlertDialog = ({
|
|
|
5231
5371
|
if (typeof icon === "string" && ICON_MAP[icon.toLowerCase()]) {
|
|
5232
5372
|
const { Hero, FallbackIcon, color } = ICON_MAP[icon.toLowerCase()];
|
|
5233
5373
|
if (Hero) {
|
|
5234
|
-
return /* @__PURE__ */ jsx(
|
|
5374
|
+
return /* @__PURE__ */ jsx(Box20, { sx: { width: 160, height: 130, display: "flex", alignItems: "center", justifyContent: "center", "& svg": { width: "100%", height: "100%" } }, children: /* @__PURE__ */ jsx(Hero, {}) });
|
|
5235
5375
|
}
|
|
5236
5376
|
return /* @__PURE__ */ jsx(FallbackIcon, { size: 64, color, stroke: 1.5 });
|
|
5237
5377
|
}
|
|
5238
5378
|
if (typeof icon === "string" && (icon.startsWith("/") || icon.startsWith("http"))) {
|
|
5239
5379
|
return /* @__PURE__ */ jsx(
|
|
5240
|
-
|
|
5380
|
+
Box20,
|
|
5241
5381
|
{
|
|
5242
5382
|
component: "img",
|
|
5243
5383
|
src: icon,
|
|
@@ -5278,7 +5418,7 @@ var ModalAlertDialog = ({
|
|
|
5278
5418
|
}
|
|
5279
5419
|
},
|
|
5280
5420
|
children: [
|
|
5281
|
-
/* @__PURE__ */ jsx(
|
|
5421
|
+
/* @__PURE__ */ jsx(Box20, { sx: { position: "absolute", right: 8, top: 8 }, children: /* @__PURE__ */ jsx(IconButton7, { onClick: onClose, sx: { color: DerivedColor.color_text_subtle }, children: /* @__PURE__ */ jsx(IconX, { size: 20 }) }) }),
|
|
5282
5422
|
/* @__PURE__ */ jsxs(
|
|
5283
5423
|
DialogContent,
|
|
5284
5424
|
{
|
|
@@ -5293,7 +5433,7 @@ var ModalAlertDialog = ({
|
|
|
5293
5433
|
gap: SpacingToken.spacing3
|
|
5294
5434
|
},
|
|
5295
5435
|
children: [
|
|
5296
|
-
/* @__PURE__ */ jsx(
|
|
5436
|
+
/* @__PURE__ */ jsx(Box20, { sx: { display: "flex", justifyContent: "center", py: 1 }, children: renderIcon() }),
|
|
5297
5437
|
resolvedTitle && /* @__PURE__ */ jsx(BaseTypography, { variant: "header1_bold.default", sx: { fontSize: "18px" }, children: resolvedTitle }),
|
|
5298
5438
|
description && /* @__PURE__ */ jsx(BaseTypography, { variant: "body2_regular.default", sx: { textAlign: "center" }, children: description })
|
|
5299
5439
|
]
|
|
@@ -5344,14 +5484,14 @@ var setModalRef = (ref) => {
|
|
|
5344
5484
|
_modalRef = ref;
|
|
5345
5485
|
};
|
|
5346
5486
|
var show = (options = {}) => {
|
|
5347
|
-
var
|
|
5348
|
-
if ((
|
|
5487
|
+
var _a130;
|
|
5488
|
+
if ((_a130 = _modalRef == null ? void 0 : _modalRef.current) == null ? void 0 : _a130.show) {
|
|
5349
5489
|
_modalRef.current.show(options);
|
|
5350
5490
|
}
|
|
5351
5491
|
};
|
|
5352
5492
|
var hide = () => {
|
|
5353
|
-
var
|
|
5354
|
-
if ((
|
|
5493
|
+
var _a130;
|
|
5494
|
+
if ((_a130 = _modalRef == null ? void 0 : _modalRef.current) == null ? void 0 : _a130.hide) {
|
|
5355
5495
|
_modalRef.current.hide();
|
|
5356
5496
|
}
|
|
5357
5497
|
};
|
|
@@ -5446,12 +5586,12 @@ var LoadingDots = () => /* @__PURE__ */ jsxs(
|
|
|
5446
5586
|
]
|
|
5447
5587
|
}
|
|
5448
5588
|
);
|
|
5449
|
-
var
|
|
5450
|
-
var Dialog2 = (
|
|
5451
|
-
var
|
|
5452
|
-
var DialogContent2 = (
|
|
5453
|
-
var
|
|
5454
|
-
(
|
|
5589
|
+
var _a97, _b97;
|
|
5590
|
+
var Dialog2 = (_b97 = (_a97 = DialogRaw) == null ? void 0 : _a97.default) != null ? _b97 : DialogRaw;
|
|
5591
|
+
var _a98, _b98;
|
|
5592
|
+
var DialogContent2 = (_b98 = (_a98 = DialogContentRaw) == null ? void 0 : _a98.default) != null ? _b98 : DialogContentRaw;
|
|
5593
|
+
var _a99, _b99;
|
|
5594
|
+
(_b99 = (_a99 = BoxRaw) == null ? void 0 : _a99.default) != null ? _b99 : BoxRaw;
|
|
5455
5595
|
var ModalLoadingDialog = ({ open = false }) => {
|
|
5456
5596
|
return /* @__PURE__ */ jsx(
|
|
5457
5597
|
Dialog2,
|
|
@@ -5498,14 +5638,14 @@ var setModalRef2 = (ref) => {
|
|
|
5498
5638
|
_modalRef2 = ref;
|
|
5499
5639
|
};
|
|
5500
5640
|
var show2 = () => {
|
|
5501
|
-
var
|
|
5502
|
-
if ((
|
|
5641
|
+
var _a130;
|
|
5642
|
+
if ((_a130 = _modalRef2 == null ? void 0 : _modalRef2.current) == null ? void 0 : _a130.show) {
|
|
5503
5643
|
_modalRef2.current.show();
|
|
5504
5644
|
}
|
|
5505
5645
|
};
|
|
5506
5646
|
var hide2 = () => {
|
|
5507
|
-
var
|
|
5508
|
-
if ((
|
|
5647
|
+
var _a130;
|
|
5648
|
+
if ((_a130 = _modalRef2 == null ? void 0 : _modalRef2.current) == null ? void 0 : _a130.hide) {
|
|
5509
5649
|
_modalRef2.current.hide();
|
|
5510
5650
|
}
|
|
5511
5651
|
};
|
|
@@ -5530,16 +5670,16 @@ var BaseModalLoadingProvider = () => {
|
|
|
5530
5670
|
return /* @__PURE__ */ jsx(ModalLoadingDialog, { open });
|
|
5531
5671
|
};
|
|
5532
5672
|
var BaseModalLoadingDialog = ModalLoadingDialog;
|
|
5533
|
-
var _a96, _b96;
|
|
5534
|
-
var Dialog3 = (_b96 = (_a96 = DialogRaw) == null ? void 0 : _a96.default) != null ? _b96 : DialogRaw;
|
|
5535
|
-
var _a97, _b97;
|
|
5536
|
-
var DialogContent3 = (_b97 = (_a97 = DialogContentRaw) == null ? void 0 : _a97.default) != null ? _b97 : DialogContentRaw;
|
|
5537
|
-
var _a98, _b98;
|
|
5538
|
-
var DialogActions2 = (_b98 = (_a98 = DialogActionsRaw) == null ? void 0 : _a98.default) != null ? _b98 : DialogActionsRaw;
|
|
5539
|
-
var _a99, _b99;
|
|
5540
|
-
var IconButton7 = (_b99 = (_a99 = IconButtonRaw) == null ? void 0 : _a99.default) != null ? _b99 : IconButtonRaw;
|
|
5541
5673
|
var _a100, _b100;
|
|
5542
|
-
var
|
|
5674
|
+
var Dialog3 = (_b100 = (_a100 = DialogRaw) == null ? void 0 : _a100.default) != null ? _b100 : DialogRaw;
|
|
5675
|
+
var _a101, _b101;
|
|
5676
|
+
var DialogContent3 = (_b101 = (_a101 = DialogContentRaw) == null ? void 0 : _a101.default) != null ? _b101 : DialogContentRaw;
|
|
5677
|
+
var _a102, _b102;
|
|
5678
|
+
var DialogActions2 = (_b102 = (_a102 = DialogActionsRaw) == null ? void 0 : _a102.default) != null ? _b102 : DialogActionsRaw;
|
|
5679
|
+
var _a103, _b103;
|
|
5680
|
+
var IconButton8 = (_b103 = (_a103 = IconButtonRaw) == null ? void 0 : _a103.default) != null ? _b103 : IconButtonRaw;
|
|
5681
|
+
var _a104, _b104;
|
|
5682
|
+
var Box22 = (_b104 = (_a104 = BoxRaw) == null ? void 0 : _a104.default) != null ? _b104 : BoxRaw;
|
|
5543
5683
|
var HEADER_COLORS2 = {
|
|
5544
5684
|
primary: DerivedColor.color_bg_brand_primary,
|
|
5545
5685
|
secondary: DerivedColor.color_bg_brand_secondary,
|
|
@@ -5547,8 +5687,8 @@ var HEADER_COLORS2 = {
|
|
|
5547
5687
|
warning: DerivedColor.color_bg_warning,
|
|
5548
5688
|
danger: DerivedColor.color_bg_danger
|
|
5549
5689
|
};
|
|
5550
|
-
var BaseModalPopup = (
|
|
5551
|
-
var
|
|
5690
|
+
var BaseModalPopup = (_a130) => {
|
|
5691
|
+
var _b130 = _a130, {
|
|
5552
5692
|
open = false,
|
|
5553
5693
|
onClose,
|
|
5554
5694
|
variant = "default",
|
|
@@ -5563,7 +5703,7 @@ var BaseModalPopup = (_a126) => {
|
|
|
5563
5703
|
isWatermark = false,
|
|
5564
5704
|
watermarkText = "",
|
|
5565
5705
|
sx = {}
|
|
5566
|
-
} =
|
|
5706
|
+
} = _b130, rest = __objRest(_b130, [
|
|
5567
5707
|
"open",
|
|
5568
5708
|
"onClose",
|
|
5569
5709
|
"variant",
|
|
@@ -5619,7 +5759,7 @@ var BaseModalPopup = (_a126) => {
|
|
|
5619
5759
|
}, rest), {
|
|
5620
5760
|
children: [
|
|
5621
5761
|
hasHeader ? /* @__PURE__ */ jsxs(
|
|
5622
|
-
|
|
5762
|
+
Box22,
|
|
5623
5763
|
{
|
|
5624
5764
|
sx: {
|
|
5625
5765
|
backgroundColor: headerBg,
|
|
@@ -5629,11 +5769,11 @@ var BaseModalPopup = (_a126) => {
|
|
|
5629
5769
|
justifyContent: "space-between"
|
|
5630
5770
|
},
|
|
5631
5771
|
children: [
|
|
5632
|
-
/* @__PURE__ */ jsxs(
|
|
5633
|
-
startIcon && /* @__PURE__ */ jsx(
|
|
5634
|
-
/* @__PURE__ */ jsxs(
|
|
5772
|
+
/* @__PURE__ */ jsxs(Box22, { sx: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
5773
|
+
startIcon && /* @__PURE__ */ jsx(Box22, { sx: { display: "flex", alignItems: "center", lineHeight: 0, color: headerTextColor }, children: startIcon }),
|
|
5774
|
+
/* @__PURE__ */ jsxs(Box22, { children: [
|
|
5635
5775
|
/* @__PURE__ */ jsx(
|
|
5636
|
-
|
|
5776
|
+
Box22,
|
|
5637
5777
|
{
|
|
5638
5778
|
component: "span",
|
|
5639
5779
|
sx: {
|
|
@@ -5646,7 +5786,7 @@ var BaseModalPopup = (_a126) => {
|
|
|
5646
5786
|
}
|
|
5647
5787
|
),
|
|
5648
5788
|
subtitle && /* @__PURE__ */ jsx(
|
|
5649
|
-
|
|
5789
|
+
Box22,
|
|
5650
5790
|
{
|
|
5651
5791
|
component: "span",
|
|
5652
5792
|
sx: {
|
|
@@ -5662,12 +5802,12 @@ var BaseModalPopup = (_a126) => {
|
|
|
5662
5802
|
)
|
|
5663
5803
|
] })
|
|
5664
5804
|
] }),
|
|
5665
|
-
/* @__PURE__ */ jsx(
|
|
5805
|
+
/* @__PURE__ */ jsx(IconButton8, { onClick: onClose, sx: { color: headerTextColor }, children: /* @__PURE__ */ jsx(IconX, { size: 20 }) })
|
|
5666
5806
|
]
|
|
5667
5807
|
}
|
|
5668
5808
|
) : (
|
|
5669
5809
|
/* Default variant: close button top-right only */
|
|
5670
|
-
/* @__PURE__ */ jsx(
|
|
5810
|
+
/* @__PURE__ */ jsx(Box22, { sx: { position: "absolute", right: 8, top: 8, zIndex: 1 }, children: /* @__PURE__ */ jsx(IconButton8, { onClick: onClose, sx: { color: DerivedColor.color_text_subtle }, children: /* @__PURE__ */ jsx(IconX, { size: 20 }) }) })
|
|
5671
5811
|
),
|
|
5672
5812
|
/* @__PURE__ */ jsx(
|
|
5673
5813
|
DialogContent3,
|
|
@@ -5696,42 +5836,42 @@ var BaseModalPopup = (_a126) => {
|
|
|
5696
5836
|
})
|
|
5697
5837
|
);
|
|
5698
5838
|
};
|
|
5699
|
-
var _a101, _b101;
|
|
5700
|
-
var CloseIcon2 = (_b101 = (_a101 = CloseIconRaw) == null ? void 0 : _a101.default) != null ? _b101 : CloseIconRaw;
|
|
5701
|
-
var _a102, _b102;
|
|
5702
|
-
var CheckIcon2 = (_b102 = (_a102 = CheckRaw) == null ? void 0 : _a102.default) != null ? _b102 : CheckRaw;
|
|
5703
|
-
var _a103, _b103;
|
|
5704
|
-
var FailedIcon = (_b103 = (_a103 = CloseIconRaw) == null ? void 0 : _a103.default) != null ? _b103 : CloseIconRaw;
|
|
5705
|
-
var _a104, _b104;
|
|
5706
|
-
var InfoIcon = (_b104 = (_a104 = InfoIconRaw) == null ? void 0 : _a104.default) != null ? _b104 : InfoIconRaw;
|
|
5707
5839
|
var _a105, _b105;
|
|
5708
|
-
var
|
|
5840
|
+
var CloseIcon2 = (_b105 = (_a105 = CloseIconRaw) == null ? void 0 : _a105.default) != null ? _b105 : CloseIconRaw;
|
|
5709
5841
|
var _a106, _b106;
|
|
5710
|
-
var
|
|
5842
|
+
var CheckIcon2 = (_b106 = (_a106 = CheckRaw) == null ? void 0 : _a106.default) != null ? _b106 : CheckRaw;
|
|
5711
5843
|
var _a107, _b107;
|
|
5712
|
-
var
|
|
5844
|
+
var FailedIcon = (_b107 = (_a107 = CloseIconRaw) == null ? void 0 : _a107.default) != null ? _b107 : CloseIconRaw;
|
|
5713
5845
|
var _a108, _b108;
|
|
5714
|
-
var
|
|
5846
|
+
var InfoIcon = (_b108 = (_a108 = InfoIconRaw) == null ? void 0 : _a108.default) != null ? _b108 : InfoIconRaw;
|
|
5715
5847
|
var _a109, _b109;
|
|
5716
|
-
var
|
|
5848
|
+
var Dialog4 = (_b109 = (_a109 = DialogRaw) == null ? void 0 : _a109.default) != null ? _b109 : DialogRaw;
|
|
5717
5849
|
var _a110, _b110;
|
|
5718
|
-
var
|
|
5850
|
+
var DialogTitle = (_b110 = (_a110 = DialogTitleRaw) == null ? void 0 : _a110.default) != null ? _b110 : DialogTitleRaw;
|
|
5719
5851
|
var _a111, _b111;
|
|
5720
|
-
var
|
|
5852
|
+
var DialogContent4 = (_b111 = (_a111 = DialogContentRaw) == null ? void 0 : _a111.default) != null ? _b111 : DialogContentRaw;
|
|
5721
5853
|
var _a112, _b112;
|
|
5722
|
-
var
|
|
5854
|
+
var DialogActions3 = (_b112 = (_a112 = DialogActionsRaw) == null ? void 0 : _a112.default) != null ? _b112 : DialogActionsRaw;
|
|
5723
5855
|
var _a113, _b113;
|
|
5724
|
-
var
|
|
5856
|
+
var IconButton9 = (_b113 = (_a113 = IconButtonRaw) == null ? void 0 : _a113.default) != null ? _b113 : IconButtonRaw;
|
|
5725
5857
|
var _a114, _b114;
|
|
5726
|
-
var
|
|
5858
|
+
var Typography7 = (_b114 = (_a114 = MuiTypographyRaw) == null ? void 0 : _a114.default) != null ? _b114 : MuiTypographyRaw;
|
|
5727
5859
|
var _a115, _b115;
|
|
5728
|
-
var
|
|
5860
|
+
var Box23 = (_b115 = (_a115 = BoxRaw) == null ? void 0 : _a115.default) != null ? _b115 : BoxRaw;
|
|
5729
5861
|
var _a116, _b116;
|
|
5730
|
-
var
|
|
5862
|
+
var Stepper2 = (_b116 = (_a116 = StepperRaw) == null ? void 0 : _a116.default) != null ? _b116 : StepperRaw;
|
|
5731
5863
|
var _a117, _b117;
|
|
5732
|
-
var
|
|
5733
|
-
var
|
|
5734
|
-
|
|
5864
|
+
var Step2 = (_b117 = (_a117 = StepRaw) == null ? void 0 : _a117.default) != null ? _b117 : StepRaw;
|
|
5865
|
+
var _a118, _b118;
|
|
5866
|
+
var StepLabel2 = (_b118 = (_a118 = StepLabelRaw) == null ? void 0 : _a118.default) != null ? _b118 : StepLabelRaw;
|
|
5867
|
+
var _a119, _b119;
|
|
5868
|
+
var StepContent = (_b119 = (_a119 = StepContentRaw) == null ? void 0 : _a119.default) != null ? _b119 : StepContentRaw;
|
|
5869
|
+
var _a120, _b120;
|
|
5870
|
+
var Tooltip2 = (_b120 = (_a120 = TooltipRaw) == null ? void 0 : _a120.default) != null ? _b120 : TooltipRaw;
|
|
5871
|
+
var _a121, _b121;
|
|
5872
|
+
var CircularProgress2 = (_b121 = (_a121 = CircularProgressRaw) == null ? void 0 : _a121.default) != null ? _b121 : CircularProgressRaw;
|
|
5873
|
+
var HtmlTooltip2 = styled((_a130) => {
|
|
5874
|
+
var _b130 = _a130, { className } = _b130, props = __objRest(_b130, ["className"]);
|
|
5735
5875
|
return /* @__PURE__ */ jsx(Tooltip2, __spreadProps(__spreadValues({}, props), { classes: { popper: className } }));
|
|
5736
5876
|
})(({ theme }) => ({
|
|
5737
5877
|
[`& .${tooltipClasses.tooltip}`]: {
|
|
@@ -5778,8 +5918,8 @@ var StepIconWrapper = styled("div")(({ ownerState }) => __spreadValues({
|
|
|
5778
5918
|
justifyContent: "center",
|
|
5779
5919
|
minHeight: ICON_SIZE
|
|
5780
5920
|
}, ownerState.active && { backgroundColor: "transparent" }));
|
|
5781
|
-
var BaseModalStepper = (
|
|
5782
|
-
var
|
|
5921
|
+
var BaseModalStepper = (_a130) => {
|
|
5922
|
+
var _b130 = _a130, {
|
|
5783
5923
|
open,
|
|
5784
5924
|
onClose,
|
|
5785
5925
|
title = "",
|
|
@@ -5790,7 +5930,7 @@ var BaseModalStepper = (_a126) => {
|
|
|
5790
5930
|
showFooter = true,
|
|
5791
5931
|
children,
|
|
5792
5932
|
modalWidth = "max-w-md"
|
|
5793
|
-
} =
|
|
5933
|
+
} = _b130, props = __objRest(_b130, [
|
|
5794
5934
|
"open",
|
|
5795
5935
|
"onClose",
|
|
5796
5936
|
"title",
|
|
@@ -5855,14 +5995,14 @@ var BaseModalStepper = (_a126) => {
|
|
|
5855
5995
|
icon: PropTypes3.node
|
|
5856
5996
|
};
|
|
5857
5997
|
useEffect(() => {
|
|
5858
|
-
var
|
|
5998
|
+
var _a131;
|
|
5859
5999
|
if (!open) {
|
|
5860
6000
|
setActiveStep(0);
|
|
5861
6001
|
return;
|
|
5862
6002
|
}
|
|
5863
6003
|
if (stepper.length === 0) return;
|
|
5864
6004
|
const incrementStep = () => setActiveStep((prev) => prev < stepper.length ? prev + 1 : prev);
|
|
5865
|
-
const delay = activeStep > 0 ? ((
|
|
6005
|
+
const delay = activeStep > 0 ? ((_a131 = stepper[activeStep - 1]) == null ? void 0 : _a131.responseTime) || 800 : 800;
|
|
5866
6006
|
const timer = setTimeout(incrementStep, delay);
|
|
5867
6007
|
return () => clearTimeout(timer);
|
|
5868
6008
|
}, [activeStep, stepper, open]);
|
|
@@ -5912,7 +6052,7 @@ var BaseModalStepper = (_a126) => {
|
|
|
5912
6052
|
/* @__PURE__ */ jsxs(DialogTitle, { sx: { textAlign: "center", pt: 4 }, children: [
|
|
5913
6053
|
title && /* @__PURE__ */ jsx(Typography7, { style: VariantStyles.header1_bold, children: title }),
|
|
5914
6054
|
/* @__PURE__ */ jsx(
|
|
5915
|
-
|
|
6055
|
+
IconButton9,
|
|
5916
6056
|
{
|
|
5917
6057
|
"aria-label": "close",
|
|
5918
6058
|
onClick: onClose,
|
|
@@ -5928,7 +6068,7 @@ var BaseModalStepper = (_a126) => {
|
|
|
5928
6068
|
] }),
|
|
5929
6069
|
/* @__PURE__ */ jsxs(DialogContent4, { sx: { px: 4, pb: 3 }, children: [
|
|
5930
6070
|
children ? children : /* @__PURE__ */ jsxs(
|
|
5931
|
-
|
|
6071
|
+
Box23,
|
|
5932
6072
|
{
|
|
5933
6073
|
sx: {
|
|
5934
6074
|
display: "flex",
|
|
@@ -5953,7 +6093,7 @@ var BaseModalStepper = (_a126) => {
|
|
|
5953
6093
|
]
|
|
5954
6094
|
}
|
|
5955
6095
|
),
|
|
5956
|
-
/* @__PURE__ */ jsx(
|
|
6096
|
+
/* @__PURE__ */ jsx(Box23, { sx: { width: "100%", maxWidth: 500 }, children: /* @__PURE__ */ jsx(Stepper2, { activeStep, orientation: "vertical", children: stepper.map((step) => /* @__PURE__ */ jsxs(Step2, { children: [
|
|
5957
6097
|
/* @__PURE__ */ jsx(StepLabel2, { StepIconComponent: ColorlibStepIcon2, children: step.label }),
|
|
5958
6098
|
/* @__PURE__ */ jsx(StepContent, { children: /* @__PURE__ */ jsx(Typography7, { sx: { fontSize: 14 }, children: step.description }) })
|
|
5959
6099
|
] }, step.label)) }) })
|
|
@@ -5993,25 +6133,25 @@ BaseModalStepper.propTypes = {
|
|
|
5993
6133
|
};
|
|
5994
6134
|
var Countdown = dynamic(
|
|
5995
6135
|
() => import('react-countdown').then((mod) => {
|
|
5996
|
-
var
|
|
5997
|
-
return (
|
|
6136
|
+
var _a130;
|
|
6137
|
+
return (_a130 = mod.default) != null ? _a130 : mod;
|
|
5998
6138
|
}),
|
|
5999
6139
|
{ ssr: false }
|
|
6000
6140
|
);
|
|
6001
|
-
var _a118, _b118;
|
|
6002
|
-
var CloseIcon3 = (_b118 = (_a118 = CloseIconRaw) == null ? void 0 : _a118.default) != null ? _b118 : CloseIconRaw;
|
|
6003
|
-
var _a119, _b119;
|
|
6004
|
-
var Dialog5 = (_b119 = (_a119 = DialogRaw) == null ? void 0 : _a119.default) != null ? _b119 : DialogRaw;
|
|
6005
|
-
var _a120, _b120;
|
|
6006
|
-
var DialogContent5 = (_b120 = (_a120 = DialogContentRaw) == null ? void 0 : _a120.default) != null ? _b120 : DialogContentRaw;
|
|
6007
|
-
var _a121, _b121;
|
|
6008
|
-
var DialogTitle2 = (_b121 = (_a121 = DialogTitleRaw) == null ? void 0 : _a121.default) != null ? _b121 : DialogTitleRaw;
|
|
6009
6141
|
var _a122, _b122;
|
|
6010
|
-
var
|
|
6142
|
+
var CloseIcon3 = (_b122 = (_a122 = CloseIconRaw) == null ? void 0 : _a122.default) != null ? _b122 : CloseIconRaw;
|
|
6011
6143
|
var _a123, _b123;
|
|
6012
|
-
var
|
|
6144
|
+
var Dialog5 = (_b123 = (_a123 = DialogRaw) == null ? void 0 : _a123.default) != null ? _b123 : DialogRaw;
|
|
6013
6145
|
var _a124, _b124;
|
|
6014
|
-
var
|
|
6146
|
+
var DialogContent5 = (_b124 = (_a124 = DialogContentRaw) == null ? void 0 : _a124.default) != null ? _b124 : DialogContentRaw;
|
|
6147
|
+
var _a125, _b125;
|
|
6148
|
+
var DialogTitle2 = (_b125 = (_a125 = DialogTitleRaw) == null ? void 0 : _a125.default) != null ? _b125 : DialogTitleRaw;
|
|
6149
|
+
var _a126, _b126;
|
|
6150
|
+
var IconButton10 = (_b126 = (_a126 = IconButtonRaw) == null ? void 0 : _a126.default) != null ? _b126 : IconButtonRaw;
|
|
6151
|
+
var _a127, _b127;
|
|
6152
|
+
var Box24 = (_b127 = (_a127 = BoxRaw) == null ? void 0 : _a127.default) != null ? _b127 : BoxRaw;
|
|
6153
|
+
var _a128, _b128;
|
|
6154
|
+
var Typography8 = (_b128 = (_a128 = MuiTypographyRaw) == null ? void 0 : _a128.default) != null ? _b128 : MuiTypographyRaw;
|
|
6015
6155
|
var otpInputBase = {
|
|
6016
6156
|
height: 40,
|
|
6017
6157
|
width: 30,
|
|
@@ -6042,7 +6182,7 @@ var NativeOTPInput = ({ value, onChange, numInputs, hasError }) => {
|
|
|
6042
6182
|
const digits = value.split("");
|
|
6043
6183
|
const handleChange = useCallback(
|
|
6044
6184
|
(index, e) => {
|
|
6045
|
-
var
|
|
6185
|
+
var _a130;
|
|
6046
6186
|
const val = e.target.value;
|
|
6047
6187
|
if (!/^\d*$/.test(val)) return;
|
|
6048
6188
|
const newDigits = [...digits];
|
|
@@ -6051,20 +6191,20 @@ var NativeOTPInput = ({ value, onChange, numInputs, hasError }) => {
|
|
|
6051
6191
|
const newValue = newDigits.join("");
|
|
6052
6192
|
onChange(newValue.slice(0, numInputs));
|
|
6053
6193
|
if (val && index < numInputs - 1) {
|
|
6054
|
-
(
|
|
6194
|
+
(_a130 = inputRefs.current[index + 1]) == null ? void 0 : _a130.focus();
|
|
6055
6195
|
}
|
|
6056
6196
|
},
|
|
6057
6197
|
[digits, numInputs, onChange]
|
|
6058
6198
|
);
|
|
6059
6199
|
const handleKeyDown = useCallback(
|
|
6060
6200
|
(index, e) => {
|
|
6061
|
-
var
|
|
6201
|
+
var _a130, _b130, _c;
|
|
6062
6202
|
if (e.key === "Backspace" && !digits[index] && index > 0) {
|
|
6063
|
-
(
|
|
6203
|
+
(_a130 = inputRefs.current[index - 1]) == null ? void 0 : _a130.focus();
|
|
6064
6204
|
}
|
|
6065
6205
|
if (e.key === "ArrowLeft" && index > 0) {
|
|
6066
6206
|
e.preventDefault();
|
|
6067
|
-
(
|
|
6207
|
+
(_b130 = inputRefs.current[index - 1]) == null ? void 0 : _b130.focus();
|
|
6068
6208
|
}
|
|
6069
6209
|
if (e.key === "ArrowRight" && index < numInputs - 1) {
|
|
6070
6210
|
e.preventDefault();
|
|
@@ -6075,20 +6215,20 @@ var NativeOTPInput = ({ value, onChange, numInputs, hasError }) => {
|
|
|
6075
6215
|
);
|
|
6076
6216
|
const handlePaste = useCallback(
|
|
6077
6217
|
(e) => {
|
|
6078
|
-
var
|
|
6218
|
+
var _a130;
|
|
6079
6219
|
e.preventDefault();
|
|
6080
6220
|
const pasted = e.clipboardData.getData("text").replace(/\D/g, "").slice(0, numInputs);
|
|
6081
6221
|
if (!pasted) return;
|
|
6082
6222
|
onChange(pasted);
|
|
6083
6223
|
const nextIdx = Math.min(pasted.length, numInputs - 1);
|
|
6084
|
-
(
|
|
6224
|
+
(_a130 = inputRefs.current[nextIdx]) == null ? void 0 : _a130.focus();
|
|
6085
6225
|
},
|
|
6086
6226
|
[numInputs, onChange]
|
|
6087
6227
|
);
|
|
6088
6228
|
useEffect(() => {
|
|
6089
6229
|
const timer = setTimeout(() => {
|
|
6090
|
-
var
|
|
6091
|
-
return (
|
|
6230
|
+
var _a130;
|
|
6231
|
+
return (_a130 = inputRefs.current[0]) == null ? void 0 : _a130.focus();
|
|
6092
6232
|
}, 100);
|
|
6093
6233
|
return () => clearTimeout(timer);
|
|
6094
6234
|
}, []);
|
|
@@ -6175,7 +6315,7 @@ var BaseModalOTP = ({
|
|
|
6175
6315
|
},
|
|
6176
6316
|
children: [
|
|
6177
6317
|
/* @__PURE__ */ jsx(DialogTitle2, { sx: { p: 0 }, children: /* @__PURE__ */ jsx(
|
|
6178
|
-
|
|
6318
|
+
IconButton10,
|
|
6179
6319
|
{
|
|
6180
6320
|
onClick: handleClose,
|
|
6181
6321
|
sx: {
|
|
@@ -6187,7 +6327,7 @@ var BaseModalOTP = ({
|
|
|
6187
6327
|
}
|
|
6188
6328
|
) }),
|
|
6189
6329
|
/* @__PURE__ */ jsx(DialogContent5, { sx: { p: 0 }, children: /* @__PURE__ */ jsxs(
|
|
6190
|
-
|
|
6330
|
+
Box24,
|
|
6191
6331
|
{
|
|
6192
6332
|
display: "flex",
|
|
6193
6333
|
flexDirection: "column",
|
|
@@ -6218,7 +6358,7 @@ var BaseModalOTP = ({
|
|
|
6218
6358
|
]
|
|
6219
6359
|
}
|
|
6220
6360
|
),
|
|
6221
|
-
/* @__PURE__ */ jsx(
|
|
6361
|
+
/* @__PURE__ */ jsx(Box24, { width: "100%", display: "flex", justifyContent: "center", children: /* @__PURE__ */ jsxs(
|
|
6222
6362
|
"form",
|
|
6223
6363
|
{
|
|
6224
6364
|
autoComplete: "off",
|
|
@@ -6304,8 +6444,8 @@ var BaseModalOTP = ({
|
|
|
6304
6444
|
}
|
|
6305
6445
|
);
|
|
6306
6446
|
};
|
|
6307
|
-
var
|
|
6308
|
-
var
|
|
6447
|
+
var _a129, _b129;
|
|
6448
|
+
var Box25 = (_b129 = (_a129 = BoxRaw) == null ? void 0 : _a129.default) != null ? _b129 : BoxRaw;
|
|
6309
6449
|
var FORM_TYPE = {
|
|
6310
6450
|
TEXT_FIELD: "text-field",
|
|
6311
6451
|
TEXT_AREA: "text-area",
|
|
@@ -6323,10 +6463,10 @@ var FORM_TYPE = {
|
|
|
6323
6463
|
RADIO: "radio",
|
|
6324
6464
|
CUSTOM: "custom"
|
|
6325
6465
|
};
|
|
6326
|
-
var FormContent = (
|
|
6327
|
-
var
|
|
6328
|
-
var
|
|
6329
|
-
const
|
|
6466
|
+
var FormContent = (_a130) => {
|
|
6467
|
+
var _b130 = _a130, { type } = _b130, restProps = __objRest(_b130, ["type"]);
|
|
6468
|
+
var _b131;
|
|
6469
|
+
const _a131 = restProps, { layout: _layout, labelWidth: _labelWidth, divider: _divider } = _a131, componentProps = __objRest(_a131, ["layout", "labelWidth", "divider"]);
|
|
6330
6470
|
switch (type) {
|
|
6331
6471
|
case FORM_TYPE.TEXT_FIELD:
|
|
6332
6472
|
return /* @__PURE__ */ jsx(BaseTextField, __spreadValues({}, componentProps));
|
|
@@ -6357,7 +6497,7 @@ var FormContent = (_a126) => {
|
|
|
6357
6497
|
case FORM_TYPE.RADIO:
|
|
6358
6498
|
return /* @__PURE__ */ jsx(BaseRadioButton, __spreadValues({}, componentProps));
|
|
6359
6499
|
case FORM_TYPE.CUSTOM:
|
|
6360
|
-
return (
|
|
6500
|
+
return (_b131 = componentProps.component) != null ? _b131 : null;
|
|
6361
6501
|
default:
|
|
6362
6502
|
return null;
|
|
6363
6503
|
}
|
|
@@ -6368,7 +6508,7 @@ var FormField = ({ item, index, control, resolvedLayout, resolvedLabelWidth, res
|
|
|
6368
6508
|
const fieldDivider = item.divider !== void 0 ? item.divider : resolvedDivider;
|
|
6369
6509
|
if (fieldLayout === "horizontal") {
|
|
6370
6510
|
return /* @__PURE__ */ jsxs(
|
|
6371
|
-
|
|
6511
|
+
Box25,
|
|
6372
6512
|
{
|
|
6373
6513
|
sx: __spreadValues({
|
|
6374
6514
|
display: "grid",
|
|
@@ -6379,11 +6519,11 @@ var FormField = ({ item, index, control, resolvedLayout, resolvedLabelWidth, res
|
|
|
6379
6519
|
borderBottom: `1px solid ${DerivedColor.color_border_default}`
|
|
6380
6520
|
}),
|
|
6381
6521
|
children: [
|
|
6382
|
-
/* @__PURE__ */ jsxs(
|
|
6522
|
+
/* @__PURE__ */ jsxs(Box25, { sx: { display: "flex", justifyContent: "space-between", pr: 2 }, children: [
|
|
6383
6523
|
/* @__PURE__ */ jsx(BaseTypography, { variant: "body1_regular.default", children: item.title || item.name }),
|
|
6384
6524
|
/* @__PURE__ */ jsx(BaseTypography, { variant: "body1_regular.default", children: ":" })
|
|
6385
6525
|
] }),
|
|
6386
|
-
/* @__PURE__ */ jsx(
|
|
6526
|
+
/* @__PURE__ */ jsx(Box25, { children: /* @__PURE__ */ jsx(
|
|
6387
6527
|
FormContent,
|
|
6388
6528
|
__spreadProps(__spreadValues({
|
|
6389
6529
|
control
|
|
@@ -6405,27 +6545,27 @@ var FormField = ({ item, index, control, resolvedLayout, resolvedLabelWidth, res
|
|
|
6405
6545
|
);
|
|
6406
6546
|
};
|
|
6407
6547
|
var Form = ({ children, sx = {}, methods, onSubmit }) => {
|
|
6408
|
-
return /* @__PURE__ */ jsx(
|
|
6409
|
-
var
|
|
6548
|
+
return /* @__PURE__ */ jsx(Box25, { component: "form", sx, onSubmit: methods == null ? void 0 : methods.handleSubmit(onSubmit), children: React2.Children.map(children, (child) => {
|
|
6549
|
+
var _a130;
|
|
6410
6550
|
if (!child) return null;
|
|
6411
|
-
return ((
|
|
6551
|
+
return ((_a130 = child.props) == null ? void 0 : _a130.name) ? React2.createElement(child.type, __spreadProps(__spreadValues({}, child.props), {
|
|
6412
6552
|
control: methods == null ? void 0 : methods.control,
|
|
6413
6553
|
key: child.props.name
|
|
6414
6554
|
})) : child;
|
|
6415
6555
|
}) });
|
|
6416
6556
|
};
|
|
6417
6557
|
var SubForm = ({ children, sx = {}, methods }) => {
|
|
6418
|
-
return /* @__PURE__ */ jsx(
|
|
6419
|
-
var
|
|
6558
|
+
return /* @__PURE__ */ jsx(Box25, { sx, children: React2.Children.map(children, (child) => {
|
|
6559
|
+
var _a130;
|
|
6420
6560
|
if (!child) return null;
|
|
6421
|
-
return ((
|
|
6561
|
+
return ((_a130 = child.props) == null ? void 0 : _a130.name) ? React2.createElement(child.type, __spreadProps(__spreadValues({}, child.props), {
|
|
6422
6562
|
control: methods == null ? void 0 : methods.control,
|
|
6423
6563
|
key: child.props.name
|
|
6424
6564
|
})) : child;
|
|
6425
6565
|
}) });
|
|
6426
6566
|
};
|
|
6427
|
-
var FormBuilder = (
|
|
6428
|
-
var
|
|
6567
|
+
var FormBuilder = (_a130) => {
|
|
6568
|
+
var _b130 = _a130, {
|
|
6429
6569
|
sx = {},
|
|
6430
6570
|
fields = [],
|
|
6431
6571
|
methods,
|
|
@@ -6435,7 +6575,7 @@ var FormBuilder = (_a126) => {
|
|
|
6435
6575
|
layout = "vertical",
|
|
6436
6576
|
labelWidth = "30%",
|
|
6437
6577
|
divider = false
|
|
6438
|
-
} =
|
|
6578
|
+
} = _b130, restProps = __objRest(_b130, [
|
|
6439
6579
|
"sx",
|
|
6440
6580
|
"fields",
|
|
6441
6581
|
"methods",
|
|
@@ -6448,7 +6588,7 @@ var FormBuilder = (_a126) => {
|
|
|
6448
6588
|
]);
|
|
6449
6589
|
const resolvedGap = layout === "horizontal" && gap === 16 ? 0 : gap;
|
|
6450
6590
|
const layoutSx = columns > 1 ? { display: "grid", gridTemplateColumns: `repeat(${columns}, 1fr)`, gap: `${resolvedGap}px` } : { display: "flex", flexDirection: "column", gap: `${resolvedGap}px` };
|
|
6451
|
-
return /* @__PURE__ */ jsx(Form, __spreadProps(__spreadValues({ sx, methods, onSubmit }, restProps), { children: /* @__PURE__ */ jsx(
|
|
6591
|
+
return /* @__PURE__ */ jsx(Form, __spreadProps(__spreadValues({ sx, methods, onSubmit }, restProps), { children: /* @__PURE__ */ jsx(Box25, { sx: layoutSx, children: fields.map((item, index) => /* @__PURE__ */ jsx(
|
|
6452
6592
|
FormField,
|
|
6453
6593
|
{
|
|
6454
6594
|
item,
|
|
@@ -6473,7 +6613,7 @@ var SubFormBuilder = ({
|
|
|
6473
6613
|
}) => {
|
|
6474
6614
|
const resolvedGap = layout === "horizontal" && gap === 16 ? 0 : gap;
|
|
6475
6615
|
const layoutSx = columns > 1 ? { display: "grid", gridTemplateColumns: `repeat(${columns}, 1fr)`, gap: `${resolvedGap}px` } : { display: "flex", flexDirection: "column", gap: `${resolvedGap}px` };
|
|
6476
|
-
return /* @__PURE__ */ jsx(SubForm, { sx, methods, children: /* @__PURE__ */ jsx(
|
|
6616
|
+
return /* @__PURE__ */ jsx(SubForm, { sx, methods, children: /* @__PURE__ */ jsx(Box25, { sx: layoutSx, children: fields.map((item, index) => /* @__PURE__ */ jsx(
|
|
6477
6617
|
FormField,
|
|
6478
6618
|
{
|
|
6479
6619
|
item,
|
|
@@ -6487,6 +6627,6 @@ var SubFormBuilder = ({
|
|
|
6487
6627
|
)) }) });
|
|
6488
6628
|
};
|
|
6489
6629
|
|
|
6490
|
-
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 };
|
|
6630
|
+
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, NumberedPagination, Radius, radius_default as RadiusToken, ServerSidePaginationActions, Shadow, shadow_default as ShadowToken, SubFormBuilder, TextFieldUpload, UsersIcon, VariantStyles };
|
|
6491
6631
|
//# sourceMappingURL=index.mjs.map
|
|
6492
6632
|
//# sourceMappingURL=index.mjs.map
|