@vention/machine-apps-components 0.4.0 → 0.4.2
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/index.esm.js +629 -115
- package/package.json +2 -2
- package/src/hooks/use-auto-scroll-input.d.ts +6 -0
- package/src/i18n/locales/de.d.ts +13 -0
- package/src/i18n/locales/en.d.ts +13 -0
- package/src/i18n/locales/es.d.ts +13 -0
- package/src/i18n/locales/fr.d.ts +13 -0
- package/src/index.d.ts +3 -4
- package/src/lib/navigation-bar/navigation-bar.d.ts +3 -0
- package/src/lib/product-form-list/product-form-list.d.ts +27 -0
- package/src/lib/product-form-list/product-form-list.stories.d.ts +18 -0
- package/src/lib/sidebar/sidebar.d.ts +3 -0
- package/src/lib/sidebar/sidebar.stories.d.ts +2 -0
- package/src/lib/status-top-bar/status-top-bar.d.ts +2 -0
- package/src/lib/status-top-bar/status-top-bar.stories.d.ts +3 -0
package/index.esm.js
CHANGED
|
@@ -10,8 +10,8 @@ import 'dayjs/locale/en';
|
|
|
10
10
|
import 'dayjs/locale/fr';
|
|
11
11
|
import 'dayjs/locale/de';
|
|
12
12
|
import 'dayjs/locale/es';
|
|
13
|
-
import { Box, useTheme, Typography, Button, InputAdornment, IconButton, TableContainer, Paper, Table, TableHead, TableRow, TableCell, TableBody } from '@mui/material';
|
|
14
|
-
import { VentionSelect,
|
|
13
|
+
import { Box, useTheme, Typography, Button, InputAdornment, IconButton, TableContainer, Paper, Table, TableHead, TableRow, TableCell, TableBody, List, ListItem, Dialog, DialogTitle, DialogContent, DialogActions } from '@mui/material';
|
|
14
|
+
import { VentionSelect, VentionModalBase, VentionIcon, VentionTextInput, COLORS, VentionButton, VentionStatusIndicator, VentionSpinner, VentionAlert, VentionDropZone, VentionUploadFile, VentionIconButton } from '@vention/machine-ui';
|
|
15
15
|
import { tss } from 'tss-react/mui';
|
|
16
16
|
import { useLocation, useNavigate } from 'react-router-dom';
|
|
17
17
|
|
|
@@ -130,8 +130,21 @@ var enTranslations = {
|
|
|
130
130
|
inprogress: "In Progress",
|
|
131
131
|
complete: "Complete",
|
|
132
132
|
loading: "Loading",
|
|
133
|
-
waiting: "Waiting"
|
|
133
|
+
waiting: "Waiting",
|
|
134
|
+
warning: "Warning",
|
|
135
|
+
error: "Error"
|
|
134
136
|
}
|
|
137
|
+
},
|
|
138
|
+
productFormList: {
|
|
139
|
+
add: "Add",
|
|
140
|
+
cancel: "Cancel",
|
|
141
|
+
save: "Save",
|
|
142
|
+
create: "Create",
|
|
143
|
+
modify: "Edit",
|
|
144
|
+
new: "New",
|
|
145
|
+
delete: "Delete",
|
|
146
|
+
deleteConfirmation: "Are you sure you want to delete this item?",
|
|
147
|
+
emptyState: "No items yet. Click Add to create one."
|
|
135
148
|
}
|
|
136
149
|
};
|
|
137
150
|
|
|
@@ -248,8 +261,21 @@ var frTranslations = {
|
|
|
248
261
|
inprogress: "En cours",
|
|
249
262
|
complete: "Terminé",
|
|
250
263
|
loading: "Chargement",
|
|
251
|
-
waiting: "En attente"
|
|
264
|
+
waiting: "En attente",
|
|
265
|
+
warning: "Avertissement",
|
|
266
|
+
error: "Erreur"
|
|
252
267
|
}
|
|
268
|
+
},
|
|
269
|
+
productFormList: {
|
|
270
|
+
add: "Ajouter",
|
|
271
|
+
cancel: "Annuler",
|
|
272
|
+
save: "Sauvegarder",
|
|
273
|
+
create: "Créer",
|
|
274
|
+
modify: "Modifier",
|
|
275
|
+
new: "Nouveau",
|
|
276
|
+
delete: "Supprimer",
|
|
277
|
+
deleteConfirmation: "Êtes-vous sûr de vouloir supprimer cet élément?",
|
|
278
|
+
emptyState: "Aucun élément. Cliquez sur Ajouter pour en créer un."
|
|
253
279
|
}
|
|
254
280
|
};
|
|
255
281
|
|
|
@@ -366,8 +392,21 @@ var deTranslations = {
|
|
|
366
392
|
inprogress: "In Bearbeitung",
|
|
367
393
|
complete: "Abgeschlossen",
|
|
368
394
|
loading: "Laden",
|
|
369
|
-
waiting: "Warten"
|
|
395
|
+
waiting: "Warten",
|
|
396
|
+
warning: "Warnung",
|
|
397
|
+
error: "Fehler"
|
|
370
398
|
}
|
|
399
|
+
},
|
|
400
|
+
productFormList: {
|
|
401
|
+
add: "Hinzufügen",
|
|
402
|
+
cancel: "Abbrechen",
|
|
403
|
+
save: "Speichern",
|
|
404
|
+
create: "Erstellen",
|
|
405
|
+
modify: "Bearbeiten",
|
|
406
|
+
new: "Neu",
|
|
407
|
+
delete: "Löschen",
|
|
408
|
+
deleteConfirmation: "Sind Sie sicher, dass Sie dieses Element löschen möchten?",
|
|
409
|
+
emptyState: "Noch keine Elemente. Klicken Sie auf Hinzufügen, um eines zu erstellen."
|
|
371
410
|
}
|
|
372
411
|
};
|
|
373
412
|
|
|
@@ -484,8 +523,21 @@ var esTranslations = {
|
|
|
484
523
|
inprogress: "En progreso",
|
|
485
524
|
complete: "Completo",
|
|
486
525
|
loading: "Cargando",
|
|
487
|
-
waiting: "Esperando"
|
|
526
|
+
waiting: "Esperando",
|
|
527
|
+
warning: "Advertencia",
|
|
528
|
+
error: "Error"
|
|
488
529
|
}
|
|
530
|
+
},
|
|
531
|
+
productFormList: {
|
|
532
|
+
add: "Agregar",
|
|
533
|
+
cancel: "Cancelar",
|
|
534
|
+
save: "Guardar",
|
|
535
|
+
create: "Crear",
|
|
536
|
+
modify: "Editar",
|
|
537
|
+
new: "Nuevo",
|
|
538
|
+
delete: "Eliminar",
|
|
539
|
+
deleteConfirmation: "¿Está seguro de que desea eliminar este elemento?",
|
|
540
|
+
emptyState: "Aún no hay elementos. Haz clic en Agregar para crear uno."
|
|
489
541
|
}
|
|
490
542
|
};
|
|
491
543
|
|
|
@@ -779,7 +831,7 @@ const I18nSettings = function I18nSettings({
|
|
|
779
831
|
const {
|
|
780
832
|
classes,
|
|
781
833
|
cx
|
|
782
|
-
} = useStyles$
|
|
834
|
+
} = useStyles$g({
|
|
783
835
|
layout
|
|
784
836
|
});
|
|
785
837
|
const {
|
|
@@ -834,35 +886,41 @@ const I18nSettings = function I18nSettings({
|
|
|
834
886
|
};
|
|
835
887
|
return jsxs(Box, {
|
|
836
888
|
className: cx(classes.container, className),
|
|
837
|
-
children: [jsx(
|
|
889
|
+
children: [jsx(Box, {
|
|
838
890
|
className: classes.settingItem,
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
891
|
+
children: jsx(VentionSelect, {
|
|
892
|
+
size: "xx-large",
|
|
893
|
+
variant: "outlined",
|
|
894
|
+
labelText: t("common.settings.unitSystem"),
|
|
895
|
+
value: unitSystem,
|
|
896
|
+
onChange: handleUnitSystemChange,
|
|
897
|
+
menuItems: unitSystemOptions
|
|
898
|
+
})
|
|
899
|
+
}), jsx(Box, {
|
|
846
900
|
className: classes.settingItem,
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
901
|
+
children: jsx(VentionSelect, {
|
|
902
|
+
size: "xx-large",
|
|
903
|
+
variant: "outlined",
|
|
904
|
+
labelText: t("common.settings.timezone"),
|
|
905
|
+
value: timezone,
|
|
906
|
+
onChange: handleTimezoneChange,
|
|
907
|
+
menuItems: timezoneOptions
|
|
908
|
+
})
|
|
909
|
+
}), supportedLanguages.length > 1 && jsx(Box, {
|
|
854
910
|
className: classes.settingItem,
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
911
|
+
children: jsx(VentionSelect, {
|
|
912
|
+
size: "xx-large",
|
|
913
|
+
variant: "outlined",
|
|
914
|
+
labelText: t("common.settings.locale"),
|
|
915
|
+
value: locale,
|
|
916
|
+
onChange: handleLocaleChange,
|
|
917
|
+
menuItems: localeOptions
|
|
918
|
+
})
|
|
861
919
|
})]
|
|
862
920
|
});
|
|
863
921
|
};
|
|
864
922
|
I18nSettings.displayName = "I18nSettings";
|
|
865
|
-
const useStyles$
|
|
923
|
+
const useStyles$g = tss.withParams().create(({
|
|
866
924
|
theme,
|
|
867
925
|
layout
|
|
868
926
|
}) => ({
|
|
@@ -870,14 +928,16 @@ const useStyles$f = tss.withParams().create(({
|
|
|
870
928
|
display: "flex",
|
|
871
929
|
flexDirection: layout === "horizontal" ? "row" : "column",
|
|
872
930
|
flexWrap: layout === "horizontal" ? "wrap" : "nowrap",
|
|
873
|
-
gap: theme.spacing(
|
|
874
|
-
width: "100%"
|
|
875
|
-
maxWidth: layout === "horizontal" ? "none" : "500px"
|
|
931
|
+
gap: theme.spacing(3),
|
|
932
|
+
width: "100%"
|
|
876
933
|
},
|
|
877
934
|
settingItem: layout === "horizontal" ? {
|
|
878
|
-
flex: "1 1
|
|
879
|
-
maxWidth: "
|
|
880
|
-
} : {
|
|
935
|
+
flex: "1 1 250px",
|
|
936
|
+
maxWidth: "350px"
|
|
937
|
+
} : {
|
|
938
|
+
width: "100%",
|
|
939
|
+
maxWidth: "400px"
|
|
940
|
+
}
|
|
881
941
|
}));
|
|
882
942
|
|
|
883
943
|
function TimeLabel({
|
|
@@ -962,7 +1022,7 @@ const NavigationConfirmationModal = function NavigationConfirmationModal(props)
|
|
|
962
1022
|
} = props;
|
|
963
1023
|
const {
|
|
964
1024
|
classes
|
|
965
|
-
} = useStyles$
|
|
1025
|
+
} = useStyles$f();
|
|
966
1026
|
const {
|
|
967
1027
|
t
|
|
968
1028
|
} = useI18n();
|
|
@@ -1025,7 +1085,7 @@ const NavigationConfirmationModal = function NavigationConfirmationModal(props)
|
|
|
1025
1085
|
})
|
|
1026
1086
|
});
|
|
1027
1087
|
};
|
|
1028
|
-
const useStyles$
|
|
1088
|
+
const useStyles$f = tss.create(({
|
|
1029
1089
|
theme
|
|
1030
1090
|
}) => ({
|
|
1031
1091
|
modalContent: {
|
|
@@ -1051,11 +1111,14 @@ const useStyles$e = tss.create(({
|
|
|
1051
1111
|
width: "auto",
|
|
1052
1112
|
maxWidth: "100%",
|
|
1053
1113
|
height: "80px",
|
|
1054
|
-
backgroundColor:
|
|
1114
|
+
backgroundColor: theme.palette.button.filled,
|
|
1055
1115
|
borderRadius: "4px",
|
|
1056
1116
|
padding: "8px 16px",
|
|
1057
1117
|
boxSizing: "border-box",
|
|
1058
|
-
marginTop: "auto"
|
|
1118
|
+
marginTop: "auto",
|
|
1119
|
+
"&:hover": {
|
|
1120
|
+
backgroundColor: theme.palette.button.filledHover
|
|
1121
|
+
}
|
|
1059
1122
|
},
|
|
1060
1123
|
buttonLabel: {
|
|
1061
1124
|
display: "flex",
|
|
@@ -1086,7 +1149,7 @@ const PasswordProtectionModal = function PasswordProtectionModal(props) {
|
|
|
1086
1149
|
const [isKeyboardVisible, setIsKeyboardVisible] = useState(false);
|
|
1087
1150
|
const {
|
|
1088
1151
|
classes
|
|
1089
|
-
} = useStyles$
|
|
1152
|
+
} = useStyles$e();
|
|
1090
1153
|
const {
|
|
1091
1154
|
t
|
|
1092
1155
|
} = useI18n();
|
|
@@ -1185,7 +1248,7 @@ const PasswordProtectionModal = function PasswordProtectionModal(props) {
|
|
|
1185
1248
|
children: jsx(VentionIcon, {
|
|
1186
1249
|
type: showPassword ? "eye-closed" : "eye",
|
|
1187
1250
|
size: 28,
|
|
1188
|
-
color:
|
|
1251
|
+
color: "#0f172a"
|
|
1189
1252
|
})
|
|
1190
1253
|
})
|
|
1191
1254
|
})
|
|
@@ -1210,7 +1273,7 @@ const PasswordProtectionModal = function PasswordProtectionModal(props) {
|
|
|
1210
1273
|
})]
|
|
1211
1274
|
});
|
|
1212
1275
|
};
|
|
1213
|
-
const useStyles$
|
|
1276
|
+
const useStyles$e = tss.create(({
|
|
1214
1277
|
theme
|
|
1215
1278
|
}) => ({
|
|
1216
1279
|
modalContent: {
|
|
@@ -1228,7 +1291,7 @@ const useStyles$d = tss.create(({
|
|
|
1228
1291
|
fontWeight: 700,
|
|
1229
1292
|
lineHeight: "48px",
|
|
1230
1293
|
textAlign: "center",
|
|
1231
|
-
color:
|
|
1294
|
+
color: theme.palette.text.primary
|
|
1232
1295
|
},
|
|
1233
1296
|
inputContainer: {
|
|
1234
1297
|
width: "499px",
|
|
@@ -1239,12 +1302,12 @@ const useStyles$d = tss.create(({
|
|
|
1239
1302
|
button: {
|
|
1240
1303
|
width: "250px",
|
|
1241
1304
|
height: "64px",
|
|
1242
|
-
backgroundColor:
|
|
1305
|
+
backgroundColor: theme.palette.button.filled,
|
|
1243
1306
|
borderRadius: "4px",
|
|
1244
1307
|
padding: "8px",
|
|
1245
1308
|
boxSizing: "border-box",
|
|
1246
1309
|
"&:hover": {
|
|
1247
|
-
backgroundColor:
|
|
1310
|
+
backgroundColor: theme.palette.button.filledHover
|
|
1248
1311
|
}
|
|
1249
1312
|
},
|
|
1250
1313
|
buttonLabel: {
|
|
@@ -1282,7 +1345,7 @@ const NavigationBarItem = function NavigationBarItem(props) {
|
|
|
1282
1345
|
const {
|
|
1283
1346
|
classes,
|
|
1284
1347
|
cx
|
|
1285
|
-
} = useStyles$
|
|
1348
|
+
} = useStyles$d();
|
|
1286
1349
|
const {
|
|
1287
1350
|
t
|
|
1288
1351
|
} = useI18n();
|
|
@@ -1315,7 +1378,7 @@ const NavigationBarItem = function NavigationBarItem(props) {
|
|
|
1315
1378
|
})]
|
|
1316
1379
|
});
|
|
1317
1380
|
};
|
|
1318
|
-
const useStyles$
|
|
1381
|
+
const useStyles$d = tss.create(({
|
|
1319
1382
|
theme
|
|
1320
1383
|
}) => ({
|
|
1321
1384
|
tabButton: {
|
|
@@ -1330,7 +1393,7 @@ const useStyles$c = tss.create(({
|
|
|
1330
1393
|
backgroundColor: "transparent",
|
|
1331
1394
|
transition: "background-color 0.2s",
|
|
1332
1395
|
"&:hover": {
|
|
1333
|
-
backgroundColor:
|
|
1396
|
+
backgroundColor: theme.palette.button.filledHover
|
|
1334
1397
|
},
|
|
1335
1398
|
color: theme.palette.common.white,
|
|
1336
1399
|
"&.Mui-disabled": {
|
|
@@ -1338,7 +1401,7 @@ const useStyles$c = tss.create(({
|
|
|
1338
1401
|
}
|
|
1339
1402
|
},
|
|
1340
1403
|
active: {
|
|
1341
|
-
backgroundColor:
|
|
1404
|
+
backgroundColor: theme.palette.button.filledPressed
|
|
1342
1405
|
},
|
|
1343
1406
|
disabled: {
|
|
1344
1407
|
opacity: 0.5,
|
|
@@ -1378,14 +1441,17 @@ const NavigationBarRoot = function NavigationBarRoot(props) {
|
|
|
1378
1441
|
isControlCenterDisabled = false,
|
|
1379
1442
|
isSupportDisabled = false,
|
|
1380
1443
|
showControlCenterButton = true,
|
|
1381
|
-
showSupportButton = true
|
|
1444
|
+
showSupportButton = true,
|
|
1445
|
+
variant = "fixed"
|
|
1382
1446
|
} = props;
|
|
1383
1447
|
const location = useLocation();
|
|
1384
1448
|
const navigate = useNavigate();
|
|
1385
1449
|
const theme = useTheme();
|
|
1386
1450
|
const {
|
|
1387
1451
|
classes
|
|
1388
|
-
} = useStyles$
|
|
1452
|
+
} = useStyles$c({
|
|
1453
|
+
variant
|
|
1454
|
+
});
|
|
1389
1455
|
const {
|
|
1390
1456
|
t
|
|
1391
1457
|
} = useI18n();
|
|
@@ -1470,8 +1536,8 @@ const NavigationBarRoot = function NavigationBarRoot(props) {
|
|
|
1470
1536
|
disabled: isControlCenterDisabled,
|
|
1471
1537
|
className: classes.sideButton,
|
|
1472
1538
|
style: {
|
|
1473
|
-
backgroundColor: isControlCenterDisabled ? getFadedColor(
|
|
1474
|
-
borderColor: isControlCenterDisabled ? getFadedColor(
|
|
1539
|
+
backgroundColor: isControlCenterDisabled ? getFadedColor(theme.palette.background.brand) : theme.palette.background.brand,
|
|
1540
|
+
borderColor: isControlCenterDisabled ? getFadedColor(theme.palette.border.onColor) : theme.palette.border.onColor,
|
|
1475
1541
|
opacity: isControlCenterDisabled ? 0.5 : 1,
|
|
1476
1542
|
cursor: isControlCenterDisabled ? "not-allowed" : "pointer"
|
|
1477
1543
|
},
|
|
@@ -1496,8 +1562,8 @@ const NavigationBarRoot = function NavigationBarRoot(props) {
|
|
|
1496
1562
|
disabled: isSupportDisabled,
|
|
1497
1563
|
className: classes.sideButton,
|
|
1498
1564
|
style: {
|
|
1499
|
-
backgroundColor: isSupportDisabled ? getFadedColor(
|
|
1500
|
-
borderColor: isSupportDisabled ? getFadedColor(
|
|
1565
|
+
backgroundColor: isSupportDisabled ? getFadedColor(theme.palette.background.brand) : theme.palette.background.brand,
|
|
1566
|
+
borderColor: isSupportDisabled ? getFadedColor(theme.palette.border.onColor) : theme.palette.border.onColor,
|
|
1501
1567
|
opacity: isSupportDisabled ? 0.5 : 1,
|
|
1502
1568
|
cursor: isSupportDisabled ? "not-allowed" : "pointer"
|
|
1503
1569
|
},
|
|
@@ -1524,16 +1590,18 @@ const NavigationBarRoot = function NavigationBarRoot(props) {
|
|
|
1524
1590
|
})]
|
|
1525
1591
|
});
|
|
1526
1592
|
};
|
|
1527
|
-
const useStyles$
|
|
1528
|
-
theme
|
|
1593
|
+
const useStyles$c = tss.withParams().create(({
|
|
1594
|
+
theme,
|
|
1595
|
+
variant
|
|
1529
1596
|
}) => ({
|
|
1530
|
-
root: {
|
|
1597
|
+
root: Object.assign({
|
|
1531
1598
|
boxSizing: "border-box",
|
|
1532
1599
|
display: "flex",
|
|
1533
1600
|
justifyContent: "center",
|
|
1534
1601
|
alignItems: "center",
|
|
1535
1602
|
height: "120px",
|
|
1536
|
-
padding: theme.spacing(2, 6)
|
|
1603
|
+
padding: theme.spacing(2, 6)
|
|
1604
|
+
}, variant === "fixed" ? {
|
|
1537
1605
|
backgroundColor: COLORS.slate[900],
|
|
1538
1606
|
position: "fixed",
|
|
1539
1607
|
left: 0,
|
|
@@ -1541,7 +1609,13 @@ const useStyles$b = tss.create(({
|
|
|
1541
1609
|
bottom: 0,
|
|
1542
1610
|
borderTop: `1px solid ${COLORS.slate[800]}`,
|
|
1543
1611
|
zIndex: Z_INDEX.NAVIGATION
|
|
1544
|
-
}
|
|
1612
|
+
} : {
|
|
1613
|
+
backgroundColor: theme.palette.background.defaultInverse,
|
|
1614
|
+
position: "relative",
|
|
1615
|
+
width: "100%",
|
|
1616
|
+
borderTop: `1px solid ${theme.palette.border.inverse}`,
|
|
1617
|
+
flexShrink: 0
|
|
1618
|
+
}),
|
|
1545
1619
|
container: {
|
|
1546
1620
|
display: "flex",
|
|
1547
1621
|
alignItems: "center",
|
|
@@ -1568,14 +1642,14 @@ const useStyles$b = tss.create(({
|
|
|
1568
1642
|
justifyContent: "center",
|
|
1569
1643
|
height: theme.spacing(11),
|
|
1570
1644
|
padding: theme.spacing(2, 4),
|
|
1571
|
-
backgroundColor:
|
|
1645
|
+
backgroundColor: theme.palette.background.brand,
|
|
1572
1646
|
borderRadius: 4,
|
|
1573
|
-
border: `2px solid ${
|
|
1647
|
+
border: `2px solid ${theme.palette.border.onColor}`,
|
|
1574
1648
|
color: theme.palette.common.white,
|
|
1575
1649
|
textTransform: "none",
|
|
1576
1650
|
minWidth: 0,
|
|
1577
1651
|
"&:hover": {
|
|
1578
|
-
backgroundColor:
|
|
1652
|
+
backgroundColor: theme.palette.button.filledHover
|
|
1579
1653
|
},
|
|
1580
1654
|
"&.Mui-disabled": {
|
|
1581
1655
|
color: theme.palette.common.white
|
|
@@ -1626,7 +1700,7 @@ const StatusTopBarButton = function StatusTopBarButton(props) {
|
|
|
1626
1700
|
} = props;
|
|
1627
1701
|
const {
|
|
1628
1702
|
classes
|
|
1629
|
-
} = useStyles$
|
|
1703
|
+
} = useStyles$b();
|
|
1630
1704
|
if (!visible) return null;
|
|
1631
1705
|
const getFadedColor = function getFadedColor(color, opacity = 1) {
|
|
1632
1706
|
return `${color}${Math.round(opacity * 255).toString(16).padStart(2, "0")}`;
|
|
@@ -1672,7 +1746,7 @@ const StatusTopBarButton = function StatusTopBarButton(props) {
|
|
|
1672
1746
|
})
|
|
1673
1747
|
});
|
|
1674
1748
|
};
|
|
1675
|
-
const useStyles$
|
|
1749
|
+
const useStyles$b = tss.create(({
|
|
1676
1750
|
theme
|
|
1677
1751
|
}) => ({
|
|
1678
1752
|
actionButton: {
|
|
@@ -1703,11 +1777,14 @@ const useStyles$a = tss.create(({
|
|
|
1703
1777
|
const StatusTopBarRoot = function StatusTopBarRoot(props) {
|
|
1704
1778
|
const {
|
|
1705
1779
|
status,
|
|
1706
|
-
buttonConfigs = []
|
|
1780
|
+
buttonConfigs = [],
|
|
1781
|
+
variant = "light"
|
|
1707
1782
|
} = props;
|
|
1708
1783
|
const {
|
|
1709
1784
|
classes
|
|
1710
|
-
} = useStyles$
|
|
1785
|
+
} = useStyles$a({
|
|
1786
|
+
variant
|
|
1787
|
+
});
|
|
1711
1788
|
const visibleButtons = buttonConfigs.filter(config => config.visible !== false);
|
|
1712
1789
|
const hasVisibleButtons = visibleButtons.length > 0;
|
|
1713
1790
|
return jsxs("header", {
|
|
@@ -1732,18 +1809,17 @@ const StatusTopBarRoot = function StatusTopBarRoot(props) {
|
|
|
1732
1809
|
})]
|
|
1733
1810
|
});
|
|
1734
1811
|
};
|
|
1735
|
-
const useStyles$
|
|
1736
|
-
theme
|
|
1812
|
+
const useStyles$a = tss.withParams().create(({
|
|
1813
|
+
theme,
|
|
1814
|
+
variant
|
|
1737
1815
|
}) => ({
|
|
1738
1816
|
root: {
|
|
1739
1817
|
boxSizing: "border-box",
|
|
1740
|
-
position: "
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
height: "128px",
|
|
1746
|
-
zIndex: Z_INDEX.NAVIGATION
|
|
1818
|
+
position: "relative",
|
|
1819
|
+
width: "100%",
|
|
1820
|
+
backgroundColor: variant === "dark" ? theme.palette.background.defaultInverse : theme.palette.common.white,
|
|
1821
|
+
height: "120px",
|
|
1822
|
+
flexShrink: 0
|
|
1747
1823
|
},
|
|
1748
1824
|
content: {
|
|
1749
1825
|
display: "flex",
|
|
@@ -1753,7 +1829,10 @@ const useStyles$9 = tss.create(({
|
|
|
1753
1829
|
},
|
|
1754
1830
|
leftArea: {
|
|
1755
1831
|
display: "flex",
|
|
1756
|
-
alignItems: "center"
|
|
1832
|
+
alignItems: "center",
|
|
1833
|
+
"& .MuiTypography-root": {
|
|
1834
|
+
color: variant === "dark" ? theme.palette.common.white : theme.palette.text.primary
|
|
1835
|
+
}
|
|
1757
1836
|
},
|
|
1758
1837
|
rightArea: {
|
|
1759
1838
|
display: "flex",
|
|
@@ -1773,25 +1852,34 @@ const useStyles$9 = tss.create(({
|
|
|
1773
1852
|
const StatusTopBar = StatusTopBarRoot;
|
|
1774
1853
|
|
|
1775
1854
|
const Sidebar = function Sidebar(props) {
|
|
1855
|
+
const {
|
|
1856
|
+
items,
|
|
1857
|
+
variant = "card"
|
|
1858
|
+
} = props;
|
|
1776
1859
|
const {
|
|
1777
1860
|
classes
|
|
1778
|
-
} = useStyles$
|
|
1861
|
+
} = useStyles$9({
|
|
1862
|
+
variant
|
|
1863
|
+
});
|
|
1779
1864
|
return jsx(Box, {
|
|
1780
1865
|
className: classes.container,
|
|
1781
|
-
children:
|
|
1782
|
-
item: item
|
|
1866
|
+
children: items.map(item => jsx(SidebarItemComponent, {
|
|
1867
|
+
item: item,
|
|
1868
|
+
variant: variant
|
|
1783
1869
|
}, item.id))
|
|
1784
1870
|
});
|
|
1785
1871
|
};
|
|
1786
1872
|
const ICON_SIZE = 32;
|
|
1787
1873
|
const SidebarItemComponent = function SidebarItemComponent(props) {
|
|
1788
1874
|
const {
|
|
1789
|
-
item
|
|
1875
|
+
item,
|
|
1876
|
+
variant
|
|
1790
1877
|
} = props;
|
|
1791
1878
|
const {
|
|
1792
1879
|
classes
|
|
1793
1880
|
} = useSidebarItemStyles({
|
|
1794
|
-
state: item.state
|
|
1881
|
+
state: item.state,
|
|
1882
|
+
variant
|
|
1795
1883
|
});
|
|
1796
1884
|
const isDisabled = item.state === "disabled";
|
|
1797
1885
|
return jsx(Button, {
|
|
@@ -1806,7 +1894,10 @@ const SidebarItemComponent = function SidebarItemComponent(props) {
|
|
|
1806
1894
|
className: classes.content,
|
|
1807
1895
|
children: [jsxs(Box, {
|
|
1808
1896
|
className: classes.leftSection,
|
|
1809
|
-
children: [item.icon ?
|
|
1897
|
+
children: [item.icon ? jsx(Box, {
|
|
1898
|
+
className: classes.iconWrapper,
|
|
1899
|
+
children: item.icon
|
|
1900
|
+
}) : jsx(Box, {
|
|
1810
1901
|
className: classes.iconPlaceholder
|
|
1811
1902
|
}), jsxs(Box, {
|
|
1812
1903
|
className: classes.textContainer,
|
|
@@ -1831,42 +1922,65 @@ const SidebarItemComponent = function SidebarItemComponent(props) {
|
|
|
1831
1922
|
})
|
|
1832
1923
|
});
|
|
1833
1924
|
};
|
|
1834
|
-
const useStyles$
|
|
1835
|
-
theme
|
|
1925
|
+
const useStyles$9 = tss.withParams().create(({
|
|
1926
|
+
theme,
|
|
1927
|
+
variant
|
|
1836
1928
|
}) => ({
|
|
1837
|
-
container: {
|
|
1929
|
+
container: Object.assign({
|
|
1838
1930
|
display: "flex",
|
|
1839
1931
|
flexDirection: "column",
|
|
1840
|
-
width: "100%"
|
|
1932
|
+
width: "100%"
|
|
1933
|
+
}, variant === "card" ? {
|
|
1841
1934
|
padding: theme.spacing(2),
|
|
1842
1935
|
gap: theme.spacing(1)
|
|
1843
|
-
}
|
|
1936
|
+
} : {
|
|
1937
|
+
padding: 0,
|
|
1938
|
+
gap: 0
|
|
1939
|
+
})
|
|
1844
1940
|
}));
|
|
1845
1941
|
const useSidebarItemStyles = tss.withParams().create(function createSidebarItemStyles({
|
|
1846
1942
|
theme,
|
|
1847
|
-
state
|
|
1943
|
+
state,
|
|
1944
|
+
variant
|
|
1848
1945
|
}) {
|
|
1849
1946
|
const isActive = state === "active";
|
|
1850
1947
|
const isDisabled = state === "disabled";
|
|
1851
|
-
|
|
1852
|
-
|
|
1948
|
+
const isAccentVariant = variant === "accent";
|
|
1949
|
+
const getButtonStyles = () => {
|
|
1950
|
+
const baseStyles = {
|
|
1853
1951
|
width: "100%",
|
|
1854
1952
|
minHeight: theme.spacing(14),
|
|
1855
1953
|
padding: theme.spacing(3, 4),
|
|
1856
1954
|
textAlign: "left",
|
|
1857
1955
|
textTransform: "none",
|
|
1858
|
-
borderRadius: theme.spacing(2),
|
|
1859
|
-
backgroundColor: isActive ? theme.palette.background.surface1active : theme.palette.background.paper,
|
|
1860
|
-
border: `1px solid ${isActive ? theme.palette.border.main : theme.palette.divider}`,
|
|
1861
1956
|
display: "flex",
|
|
1862
1957
|
alignItems: "center",
|
|
1863
1958
|
justifyContent: "flex-start",
|
|
1864
|
-
transition: "all 0.2s ease"
|
|
1959
|
+
transition: "all 0.2s ease"
|
|
1960
|
+
};
|
|
1961
|
+
if (isAccentVariant) {
|
|
1962
|
+
return Object.assign(Object.assign({}, baseStyles), {
|
|
1963
|
+
borderRadius: 0,
|
|
1964
|
+
backgroundColor: isActive ? theme.palette.background.surface1active : "transparent",
|
|
1965
|
+
border: "none",
|
|
1966
|
+
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
1967
|
+
"&:hover": {
|
|
1968
|
+
backgroundColor: isDisabled ? "transparent" : isActive ? theme.palette.background.surface1active : theme.palette.action.hover
|
|
1969
|
+
}
|
|
1970
|
+
});
|
|
1971
|
+
}
|
|
1972
|
+
return Object.assign(Object.assign({}, baseStyles), {
|
|
1973
|
+
borderRadius: theme.spacing(2),
|
|
1974
|
+
backgroundColor: isActive ? theme.palette.background.surface1active : theme.palette.background.paper,
|
|
1975
|
+
border: `1px solid ${isActive ? theme.palette.border.main : theme.palette.divider}`,
|
|
1865
1976
|
"&:hover": {
|
|
1866
1977
|
backgroundColor: isDisabled ? theme.palette.background.paper : isActive ? theme.palette.background.surface1active : theme.palette.action.hover,
|
|
1867
1978
|
borderColor: isDisabled ? theme.palette.divider : theme.palette.border.main
|
|
1868
1979
|
}
|
|
1869
|
-
}
|
|
1980
|
+
});
|
|
1981
|
+
};
|
|
1982
|
+
return {
|
|
1983
|
+
button: getButtonStyles(),
|
|
1870
1984
|
content: {
|
|
1871
1985
|
display: "flex",
|
|
1872
1986
|
alignItems: "center",
|
|
@@ -1880,6 +1994,15 @@ const useSidebarItemStyles = tss.withParams().create(function createSidebarItemS
|
|
|
1880
1994
|
gap: theme.spacing(3),
|
|
1881
1995
|
flex: 1
|
|
1882
1996
|
},
|
|
1997
|
+
iconWrapper: {
|
|
1998
|
+
display: "flex",
|
|
1999
|
+
alignItems: "center",
|
|
2000
|
+
justifyContent: "center",
|
|
2001
|
+
color: isActive ? theme.palette.background.defaultInverse : theme.palette.icon.tertiary,
|
|
2002
|
+
"& svg": {
|
|
2003
|
+
color: isActive ? theme.palette.background.defaultInverse : theme.palette.icon.tertiary
|
|
2004
|
+
}
|
|
2005
|
+
},
|
|
1883
2006
|
iconPlaceholder: {
|
|
1884
2007
|
width: theme.spacing(4)
|
|
1885
2008
|
},
|
|
@@ -1924,7 +2047,7 @@ const LogsTable = memo(({
|
|
|
1924
2047
|
const {
|
|
1925
2048
|
classes,
|
|
1926
2049
|
cx
|
|
1927
|
-
} = useStyles$
|
|
2050
|
+
} = useStyles$8({
|
|
1928
2051
|
tableHeight
|
|
1929
2052
|
});
|
|
1930
2053
|
const theme = useTheme();
|
|
@@ -2189,7 +2312,7 @@ const LogsTable = memo(({
|
|
|
2189
2312
|
});
|
|
2190
2313
|
});
|
|
2191
2314
|
LogsTable.displayName = "LogsTable";
|
|
2192
|
-
const useStyles$
|
|
2315
|
+
const useStyles$8 = tss.withParams().create(({
|
|
2193
2316
|
theme,
|
|
2194
2317
|
tableHeight
|
|
2195
2318
|
}) => ({
|
|
@@ -2303,7 +2426,7 @@ const LogFilterForm = memo(({
|
|
|
2303
2426
|
var _a, _b, _c, _d;
|
|
2304
2427
|
const {
|
|
2305
2428
|
classes
|
|
2306
|
-
} = useStyles$
|
|
2429
|
+
} = useStyles$7();
|
|
2307
2430
|
const {
|
|
2308
2431
|
t
|
|
2309
2432
|
} = useI18n();
|
|
@@ -2440,7 +2563,7 @@ const LogFilterForm = memo(({
|
|
|
2440
2563
|
});
|
|
2441
2564
|
});
|
|
2442
2565
|
LogFilterForm.displayName = "LogFilterForm";
|
|
2443
|
-
const useStyles$
|
|
2566
|
+
const useStyles$7 = tss.create(({
|
|
2444
2567
|
theme
|
|
2445
2568
|
}) => ({
|
|
2446
2569
|
filterSection: {
|
|
@@ -2504,7 +2627,7 @@ const LogsPagination = memo(({
|
|
|
2504
2627
|
}) => {
|
|
2505
2628
|
const {
|
|
2506
2629
|
classes
|
|
2507
|
-
} = useStyles$
|
|
2630
|
+
} = useStyles$6();
|
|
2508
2631
|
const {
|
|
2509
2632
|
t
|
|
2510
2633
|
} = useI18n();
|
|
@@ -2543,7 +2666,7 @@ const LogsPagination = memo(({
|
|
|
2543
2666
|
});
|
|
2544
2667
|
});
|
|
2545
2668
|
LogsPagination.displayName = "LogsPagination";
|
|
2546
|
-
const useStyles$
|
|
2669
|
+
const useStyles$6 = tss.create(({
|
|
2547
2670
|
theme
|
|
2548
2671
|
}) => ({
|
|
2549
2672
|
paginationSection: {
|
|
@@ -2593,7 +2716,7 @@ const LogsPanel = forwardRef((props, ref) => {
|
|
|
2593
2716
|
const {
|
|
2594
2717
|
classes,
|
|
2595
2718
|
cx
|
|
2596
|
-
} = useStyles$
|
|
2719
|
+
} = useStyles$5();
|
|
2597
2720
|
const [logs, setLogs] = useState([]);
|
|
2598
2721
|
const [isLoading, setIsLoading] = useState(true);
|
|
2599
2722
|
const [error, setError] = useState(null);
|
|
@@ -2728,7 +2851,7 @@ const LogsPanel = forwardRef((props, ref) => {
|
|
|
2728
2851
|
});
|
|
2729
2852
|
});
|
|
2730
2853
|
LogsPanel.displayName = "LogsPanel";
|
|
2731
|
-
const useStyles$
|
|
2854
|
+
const useStyles$5 = tss.create(({
|
|
2732
2855
|
theme
|
|
2733
2856
|
}) => ({
|
|
2734
2857
|
root: {
|
|
@@ -2746,7 +2869,7 @@ const SettingsPage = function SettingsPage({
|
|
|
2746
2869
|
}) {
|
|
2747
2870
|
const {
|
|
2748
2871
|
classes
|
|
2749
|
-
} = useStyles$
|
|
2872
|
+
} = useStyles$4({
|
|
2750
2873
|
sidebarWidth
|
|
2751
2874
|
});
|
|
2752
2875
|
return jsxs(Box, {
|
|
@@ -2763,7 +2886,7 @@ const SettingsPage = function SettingsPage({
|
|
|
2763
2886
|
});
|
|
2764
2887
|
};
|
|
2765
2888
|
SettingsPage.displayName = "SettingsPage";
|
|
2766
|
-
const useStyles$
|
|
2889
|
+
const useStyles$4 = tss.withParams().create(({
|
|
2767
2890
|
theme,
|
|
2768
2891
|
sidebarWidth
|
|
2769
2892
|
}) => ({
|
|
@@ -2805,7 +2928,7 @@ function FileUploadPanel({
|
|
|
2805
2928
|
}) {
|
|
2806
2929
|
const {
|
|
2807
2930
|
classes
|
|
2808
|
-
} = useStyles$
|
|
2931
|
+
} = useStyles$3({
|
|
2809
2932
|
maxHeight
|
|
2810
2933
|
});
|
|
2811
2934
|
const {
|
|
@@ -2857,7 +2980,7 @@ function FileUploadPanel({
|
|
|
2857
2980
|
});
|
|
2858
2981
|
}
|
|
2859
2982
|
FileUploadPanel.displayName = "FileUploadPanel";
|
|
2860
|
-
const useStyles$
|
|
2983
|
+
const useStyles$3 = tss.withParams().create(({
|
|
2861
2984
|
theme,
|
|
2862
2985
|
maxHeight
|
|
2863
2986
|
}) => ({
|
|
@@ -2875,10 +2998,19 @@ const useStyles$2 = tss.withParams().create(({
|
|
|
2875
2998
|
flexDirection: "column",
|
|
2876
2999
|
gap: theme.spacing(1),
|
|
2877
3000
|
maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : "auto",
|
|
2878
|
-
overflowY: maxHeight ? "auto" : "visible"
|
|
3001
|
+
overflowY: maxHeight ? "auto" : "visible",
|
|
3002
|
+
"& .MuiGrid-container": {
|
|
3003
|
+
width: "100%"
|
|
3004
|
+
},
|
|
3005
|
+
"& .MuiGrid-root:nth-of-type(2)": {
|
|
3006
|
+
flex: "1 1 0",
|
|
3007
|
+
minWidth: 0
|
|
3008
|
+
}
|
|
2879
3009
|
}
|
|
2880
3010
|
}));
|
|
2881
3011
|
|
|
3012
|
+
/** Padding between the circle edge and the SVG boundary */
|
|
3013
|
+
const CIRCLE_PADDING = 10;
|
|
2882
3014
|
function StepProgressCircle({
|
|
2883
3015
|
currentStep,
|
|
2884
3016
|
totalSteps,
|
|
@@ -2894,7 +3026,7 @@ function StepProgressCircle({
|
|
|
2894
3026
|
} = useTranslation();
|
|
2895
3027
|
const {
|
|
2896
3028
|
classes
|
|
2897
|
-
} = useStyles$
|
|
3029
|
+
} = useStyles$2({
|
|
2898
3030
|
size,
|
|
2899
3031
|
strokeWidth,
|
|
2900
3032
|
variant
|
|
@@ -2904,7 +3036,7 @@ function StepProgressCircle({
|
|
|
2904
3036
|
defaultValue: title !== null && title !== void 0 ? title : "Progress"
|
|
2905
3037
|
});
|
|
2906
3038
|
const percentage = totalSteps > 0 ? Math.round(currentStep / totalSteps * 100) : 0;
|
|
2907
|
-
const radius = (size - strokeWidth) / 2 -
|
|
3039
|
+
const radius = (size - strokeWidth) / 2 - CIRCLE_PADDING;
|
|
2908
3040
|
const circumference = 2 * Math.PI * radius;
|
|
2909
3041
|
const strokeDashoffset = circumference - percentage / 100 * circumference;
|
|
2910
3042
|
const center = size / 2;
|
|
@@ -2951,7 +3083,7 @@ function StepProgressCircle({
|
|
|
2951
3083
|
});
|
|
2952
3084
|
}
|
|
2953
3085
|
StepProgressCircle.displayName = "StepProgressCircle";
|
|
2954
|
-
const useStyles$
|
|
3086
|
+
const useStyles$2 = tss.withParams().create(({
|
|
2955
3087
|
theme,
|
|
2956
3088
|
size,
|
|
2957
3089
|
strokeWidth,
|
|
@@ -3017,7 +3149,7 @@ const ActionButton = function ActionButton({
|
|
|
3017
3149
|
}) {
|
|
3018
3150
|
const {
|
|
3019
3151
|
classes
|
|
3020
|
-
} = useStyles({
|
|
3152
|
+
} = useStyles$1({
|
|
3021
3153
|
size
|
|
3022
3154
|
});
|
|
3023
3155
|
const {
|
|
@@ -3048,7 +3180,7 @@ const ActionButton = function ActionButton({
|
|
|
3048
3180
|
});
|
|
3049
3181
|
};
|
|
3050
3182
|
ActionButton.displayName = "ActionButton";
|
|
3051
|
-
const useStyles = tss.withParams().create(({
|
|
3183
|
+
const useStyles$1 = tss.withParams().create(({
|
|
3052
3184
|
theme,
|
|
3053
3185
|
size
|
|
3054
3186
|
}) => ({
|
|
@@ -3075,6 +3207,388 @@ const useStyles = tss.withParams().create(({
|
|
|
3075
3207
|
}
|
|
3076
3208
|
}));
|
|
3077
3209
|
|
|
3210
|
+
function useAutoScrollInput(enabled, options = {}) {
|
|
3211
|
+
const {
|
|
3212
|
+
targetPositionPercent = 25,
|
|
3213
|
+
scrollableContainerSelector = '[role="dialog"] .MuiDialogContent-root',
|
|
3214
|
+
scrollBehavior = "smooth"
|
|
3215
|
+
} = options;
|
|
3216
|
+
useEffect(() => {
|
|
3217
|
+
if (!enabled) return;
|
|
3218
|
+
function findScrollableParent(element) {
|
|
3219
|
+
let parent = element.parentElement;
|
|
3220
|
+
while (parent) {
|
|
3221
|
+
const style = window.getComputedStyle(parent);
|
|
3222
|
+
const hasOverflow = style.overflow === "auto" || style.overflow === "scroll" || style.overflowY === "auto" || style.overflowY === "scroll";
|
|
3223
|
+
if (hasOverflow) {
|
|
3224
|
+
return parent;
|
|
3225
|
+
}
|
|
3226
|
+
if (parent === document.body || parent === document.documentElement) {
|
|
3227
|
+
break;
|
|
3228
|
+
}
|
|
3229
|
+
parent = parent.parentElement;
|
|
3230
|
+
}
|
|
3231
|
+
return null;
|
|
3232
|
+
}
|
|
3233
|
+
function handleFocus(event) {
|
|
3234
|
+
const target = event.target;
|
|
3235
|
+
if (!target || !(target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement || target instanceof HTMLSelectElement)) {
|
|
3236
|
+
return;
|
|
3237
|
+
}
|
|
3238
|
+
const targetRect = target.getBoundingClientRect();
|
|
3239
|
+
const viewportHeight = window.innerHeight;
|
|
3240
|
+
const targetY = viewportHeight * (targetPositionPercent / 100);
|
|
3241
|
+
const currentY = targetRect.top;
|
|
3242
|
+
const scrollNeeded = currentY - targetY;
|
|
3243
|
+
let scrollableContainer = null;
|
|
3244
|
+
if (scrollableContainerSelector) {
|
|
3245
|
+
const selectors = scrollableContainerSelector.split(",").map(selector => selector.trim());
|
|
3246
|
+
for (const selector of selectors) {
|
|
3247
|
+
const found = document.querySelector(selector);
|
|
3248
|
+
if (found) {
|
|
3249
|
+
scrollableContainer = found;
|
|
3250
|
+
break;
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
if (!scrollableContainer) {
|
|
3255
|
+
scrollableContainer = findScrollableParent(target);
|
|
3256
|
+
}
|
|
3257
|
+
if (scrollableContainer) {
|
|
3258
|
+
const currentScrollTop = scrollableContainer.scrollTop;
|
|
3259
|
+
const newScrollTop = currentScrollTop + scrollNeeded;
|
|
3260
|
+
scrollableContainer.scrollTo({
|
|
3261
|
+
top: newScrollTop,
|
|
3262
|
+
behavior: scrollBehavior
|
|
3263
|
+
});
|
|
3264
|
+
}
|
|
3265
|
+
}
|
|
3266
|
+
document.addEventListener("focusin", handleFocus);
|
|
3267
|
+
return () => {
|
|
3268
|
+
document.removeEventListener("focusin", handleFocus);
|
|
3269
|
+
};
|
|
3270
|
+
}, [enabled, targetPositionPercent, scrollableContainerSelector, scrollBehavior]);
|
|
3271
|
+
}
|
|
3272
|
+
|
|
3273
|
+
function ProductFormListComponent({
|
|
3274
|
+
title = "Products",
|
|
3275
|
+
items,
|
|
3276
|
+
onDelete,
|
|
3277
|
+
onSubmit,
|
|
3278
|
+
getItemId,
|
|
3279
|
+
fields,
|
|
3280
|
+
maxHeight = 600
|
|
3281
|
+
}) {
|
|
3282
|
+
const [editDialogOpen, setEditDialogOpen] = useState(false);
|
|
3283
|
+
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
|
3284
|
+
const [deleteId, setDeleteId] = useState(null);
|
|
3285
|
+
const [formData, setFormData] = useState({});
|
|
3286
|
+
const {
|
|
3287
|
+
t
|
|
3288
|
+
} = useTranslation();
|
|
3289
|
+
const {
|
|
3290
|
+
classes
|
|
3291
|
+
} = useStyles({
|
|
3292
|
+
maxHeight
|
|
3293
|
+
});
|
|
3294
|
+
useAutoScrollInput(editDialogOpen);
|
|
3295
|
+
function handleEditClick(item) {
|
|
3296
|
+
setFormData(item);
|
|
3297
|
+
setEditDialogOpen(true);
|
|
3298
|
+
}
|
|
3299
|
+
function handleEditClose() {
|
|
3300
|
+
setEditDialogOpen(false);
|
|
3301
|
+
setFormData({});
|
|
3302
|
+
}
|
|
3303
|
+
function handleDeleteClick(id) {
|
|
3304
|
+
setDeleteId(id);
|
|
3305
|
+
setDeleteDialogOpen(true);
|
|
3306
|
+
}
|
|
3307
|
+
function handleDeleteConfirm() {
|
|
3308
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
3309
|
+
if (deleteId) {
|
|
3310
|
+
yield onDelete(deleteId);
|
|
3311
|
+
setDeleteDialogOpen(false);
|
|
3312
|
+
setDeleteId(null);
|
|
3313
|
+
}
|
|
3314
|
+
});
|
|
3315
|
+
}
|
|
3316
|
+
function handleDeleteCancel() {
|
|
3317
|
+
setDeleteDialogOpen(false);
|
|
3318
|
+
setDeleteId(null);
|
|
3319
|
+
}
|
|
3320
|
+
function handleFieldChange(name, value) {
|
|
3321
|
+
setFormData(prev => Object.assign(Object.assign({}, prev), {
|
|
3322
|
+
[name]: value
|
|
3323
|
+
}));
|
|
3324
|
+
}
|
|
3325
|
+
function getFieldDisplayValue(field, value) {
|
|
3326
|
+
var _a, _b;
|
|
3327
|
+
if (field.type === "select") {
|
|
3328
|
+
return ((_b = (_a = field.options) === null || _a === void 0 ? void 0 : _a.find(opt => opt.value === value)) === null || _b === void 0 ? void 0 : _b.label) || String(value);
|
|
3329
|
+
}
|
|
3330
|
+
return (value === null || value === void 0 ? void 0 : value.toString()) || "";
|
|
3331
|
+
}
|
|
3332
|
+
function renderItemContent(item) {
|
|
3333
|
+
const mainField = fields[0];
|
|
3334
|
+
const secondaryFields = fields.slice(1);
|
|
3335
|
+
return jsxs(Box, {
|
|
3336
|
+
className: classes.itemContent,
|
|
3337
|
+
children: [jsx(Typography, {
|
|
3338
|
+
variant: "heading18SemiBold",
|
|
3339
|
+
className: classes.itemTitle,
|
|
3340
|
+
children: getFieldDisplayValue(mainField, item[mainField.name])
|
|
3341
|
+
}), jsx(Typography, {
|
|
3342
|
+
variant: "uiText14Regular",
|
|
3343
|
+
color: "textSecondary",
|
|
3344
|
+
className: classes.itemSubtitle,
|
|
3345
|
+
children: secondaryFields.map(field => `${field.label}: ${getFieldDisplayValue(field, item[field.name])}`).join(" | ")
|
|
3346
|
+
})]
|
|
3347
|
+
});
|
|
3348
|
+
}
|
|
3349
|
+
function renderField(field) {
|
|
3350
|
+
var _a;
|
|
3351
|
+
const fieldValue = formData[field.name];
|
|
3352
|
+
if (field.type === "select") {
|
|
3353
|
+
const menuItems = ((_a = field.options) === null || _a === void 0 ? void 0 : _a.map(opt => ({
|
|
3354
|
+
value: opt.value,
|
|
3355
|
+
displayText: opt.label
|
|
3356
|
+
}))) || [];
|
|
3357
|
+
return jsx(VentionSelect, {
|
|
3358
|
+
labelText: field.label,
|
|
3359
|
+
value: fieldValue || "",
|
|
3360
|
+
onChange: event => {
|
|
3361
|
+
handleFieldChange(field.name, event.target.value);
|
|
3362
|
+
},
|
|
3363
|
+
menuItems: menuItems,
|
|
3364
|
+
size: "large",
|
|
3365
|
+
variant: "outlined"
|
|
3366
|
+
}, field.name);
|
|
3367
|
+
}
|
|
3368
|
+
return jsx(VentionTextInput, {
|
|
3369
|
+
label: field.label,
|
|
3370
|
+
value: fieldValue !== null && fieldValue !== void 0 ? fieldValue : "",
|
|
3371
|
+
onChange: event => {
|
|
3372
|
+
handleFieldChange(field.name, field.type === "number" ? Number(event.target.value) : event.target.value);
|
|
3373
|
+
},
|
|
3374
|
+
type: field.type === "number" ? "number" : "text",
|
|
3375
|
+
fullWidth: true,
|
|
3376
|
+
size: "large",
|
|
3377
|
+
inputProps: field.type === "number" ? {
|
|
3378
|
+
min: field.min,
|
|
3379
|
+
max: field.max
|
|
3380
|
+
} : undefined
|
|
3381
|
+
}, field.name);
|
|
3382
|
+
}
|
|
3383
|
+
const isEditing = Object.keys(formData).length > 0 && "id" in formData;
|
|
3384
|
+
return jsxs(Box, {
|
|
3385
|
+
className: classes.container,
|
|
3386
|
+
children: [jsxs(Box, {
|
|
3387
|
+
className: classes.header,
|
|
3388
|
+
children: [jsx(Typography, {
|
|
3389
|
+
variant: "heading24SemiBold",
|
|
3390
|
+
children: title
|
|
3391
|
+
}), jsx(VentionButton, {
|
|
3392
|
+
onClick: () => {
|
|
3393
|
+
setFormData({});
|
|
3394
|
+
setEditDialogOpen(true);
|
|
3395
|
+
},
|
|
3396
|
+
size: "large",
|
|
3397
|
+
variant: "filled",
|
|
3398
|
+
startIcon: jsx(VentionIcon, {
|
|
3399
|
+
type: "plus",
|
|
3400
|
+
size: 24,
|
|
3401
|
+
color: "white"
|
|
3402
|
+
}),
|
|
3403
|
+
children: t("productFormList.add")
|
|
3404
|
+
})]
|
|
3405
|
+
}), jsx(Box, {
|
|
3406
|
+
className: classes.listContainer,
|
|
3407
|
+
children: items.length === 0 ? jsx(Box, {
|
|
3408
|
+
className: classes.emptyState,
|
|
3409
|
+
children: jsx(Typography, {
|
|
3410
|
+
variant: "uiText14Regular",
|
|
3411
|
+
color: "textSecondary",
|
|
3412
|
+
children: t("productFormList.emptyState", {
|
|
3413
|
+
defaultValue: "No items yet. Click Add to create one."
|
|
3414
|
+
})
|
|
3415
|
+
})
|
|
3416
|
+
}) : jsx(List, {
|
|
3417
|
+
children: items.map(item => jsxs(ListItem, {
|
|
3418
|
+
className: classes.listItem,
|
|
3419
|
+
children: [renderItemContent(item), jsxs(Box, {
|
|
3420
|
+
className: classes.actions,
|
|
3421
|
+
children: [jsx(IconButton, {
|
|
3422
|
+
onClick: () => handleEditClick(item),
|
|
3423
|
+
size: "medium",
|
|
3424
|
+
children: jsx(VentionIcon, {
|
|
3425
|
+
type: "edit",
|
|
3426
|
+
size: 24
|
|
3427
|
+
})
|
|
3428
|
+
}), jsx(IconButton, {
|
|
3429
|
+
onClick: () => handleDeleteClick(getItemId(item)),
|
|
3430
|
+
size: "medium",
|
|
3431
|
+
children: jsx(VentionIcon, {
|
|
3432
|
+
type: "trash",
|
|
3433
|
+
size: 24
|
|
3434
|
+
})
|
|
3435
|
+
})]
|
|
3436
|
+
})]
|
|
3437
|
+
}, getItemId(item)))
|
|
3438
|
+
})
|
|
3439
|
+
}), jsxs(Dialog, {
|
|
3440
|
+
open: editDialogOpen,
|
|
3441
|
+
onClose: handleEditClose,
|
|
3442
|
+
maxWidth: "sm",
|
|
3443
|
+
fullWidth: true,
|
|
3444
|
+
children: [jsx(DialogTitle, {
|
|
3445
|
+
children: jsx(Typography, {
|
|
3446
|
+
variant: "heading18SemiBold",
|
|
3447
|
+
textAlign: "center",
|
|
3448
|
+
children: isEditing ? t("productFormList.modify") : t("productFormList.new")
|
|
3449
|
+
})
|
|
3450
|
+
}), jsx(DialogContent, {
|
|
3451
|
+
className: classes.dialogContent,
|
|
3452
|
+
children: jsx(Box, {
|
|
3453
|
+
className: classes.dialogForm,
|
|
3454
|
+
children: fields.map(field => renderField(field))
|
|
3455
|
+
})
|
|
3456
|
+
}), jsxs(DialogActions, {
|
|
3457
|
+
className: classes.dialogActions,
|
|
3458
|
+
children: [jsx(VentionButton, {
|
|
3459
|
+
onClick: handleEditClose,
|
|
3460
|
+
variant: "outline",
|
|
3461
|
+
size: "large",
|
|
3462
|
+
children: t("productFormList.cancel")
|
|
3463
|
+
}), jsx(VentionButton, {
|
|
3464
|
+
onClick: () => __awaiter(this, void 0, void 0, function* () {
|
|
3465
|
+
if (yield onSubmit(formData)) {
|
|
3466
|
+
handleEditClose();
|
|
3467
|
+
}
|
|
3468
|
+
}),
|
|
3469
|
+
variant: "filled",
|
|
3470
|
+
size: "large",
|
|
3471
|
+
children: isEditing ? t("productFormList.save") : t("productFormList.create")
|
|
3472
|
+
})]
|
|
3473
|
+
})]
|
|
3474
|
+
}), jsxs(Dialog, {
|
|
3475
|
+
open: deleteDialogOpen,
|
|
3476
|
+
onClose: handleDeleteCancel,
|
|
3477
|
+
maxWidth: "xs",
|
|
3478
|
+
fullWidth: true,
|
|
3479
|
+
children: [jsx(DialogTitle, {
|
|
3480
|
+
children: jsx(Typography, {
|
|
3481
|
+
variant: "heading18SemiBold",
|
|
3482
|
+
textAlign: "center",
|
|
3483
|
+
children: t("productFormList.delete")
|
|
3484
|
+
})
|
|
3485
|
+
}), jsx(DialogContent, {
|
|
3486
|
+
children: jsx(Typography, {
|
|
3487
|
+
variant: "uiText14Regular",
|
|
3488
|
+
className: classes.deleteMessage,
|
|
3489
|
+
children: t("productFormList.deleteConfirmation")
|
|
3490
|
+
})
|
|
3491
|
+
}), jsxs(DialogActions, {
|
|
3492
|
+
className: classes.dialogActions,
|
|
3493
|
+
children: [jsx(VentionButton, {
|
|
3494
|
+
onClick: handleDeleteCancel,
|
|
3495
|
+
variant: "outline",
|
|
3496
|
+
size: "large",
|
|
3497
|
+
children: t("productFormList.cancel")
|
|
3498
|
+
}), jsx(VentionButton, {
|
|
3499
|
+
onClick: handleDeleteConfirm,
|
|
3500
|
+
variant: "destructive",
|
|
3501
|
+
size: "large",
|
|
3502
|
+
children: t("productFormList.delete")
|
|
3503
|
+
})]
|
|
3504
|
+
})]
|
|
3505
|
+
})]
|
|
3506
|
+
});
|
|
3507
|
+
}
|
|
3508
|
+
ProductFormListComponent.displayName = "ProductFormList";
|
|
3509
|
+
const ProductFormList = memo(ProductFormListComponent);
|
|
3510
|
+
const useStyles = tss.withParams().create(({
|
|
3511
|
+
theme,
|
|
3512
|
+
maxHeight
|
|
3513
|
+
}) => ({
|
|
3514
|
+
container: {
|
|
3515
|
+
display: "flex",
|
|
3516
|
+
flexDirection: "column",
|
|
3517
|
+
height: "100%",
|
|
3518
|
+
flex: 1,
|
|
3519
|
+
minWidth: 0
|
|
3520
|
+
},
|
|
3521
|
+
header: {
|
|
3522
|
+
flexShrink: 0,
|
|
3523
|
+
display: "flex",
|
|
3524
|
+
justifyContent: "space-between",
|
|
3525
|
+
alignItems: "center",
|
|
3526
|
+
marginBottom: theme.spacing(3)
|
|
3527
|
+
},
|
|
3528
|
+
listContainer: {
|
|
3529
|
+
flexGrow: 1,
|
|
3530
|
+
overflowY: "auto",
|
|
3531
|
+
maxHeight
|
|
3532
|
+
},
|
|
3533
|
+
listItem: {
|
|
3534
|
+
backgroundColor: theme.palette.background.paper,
|
|
3535
|
+
borderRadius: theme.shape.borderRadius,
|
|
3536
|
+
marginBottom: theme.spacing(2),
|
|
3537
|
+
alignItems: "center",
|
|
3538
|
+
overflow: "hidden",
|
|
3539
|
+
display: "flex",
|
|
3540
|
+
width: "100%"
|
|
3541
|
+
},
|
|
3542
|
+
itemContent: {
|
|
3543
|
+
minWidth: 0,
|
|
3544
|
+
flex: 1,
|
|
3545
|
+
overflow: "hidden",
|
|
3546
|
+
paddingRight: theme.spacing(2)
|
|
3547
|
+
},
|
|
3548
|
+
itemTitle: {
|
|
3549
|
+
overflow: "hidden",
|
|
3550
|
+
textOverflow: "ellipsis",
|
|
3551
|
+
whiteSpace: "nowrap",
|
|
3552
|
+
width: "100%"
|
|
3553
|
+
},
|
|
3554
|
+
itemSubtitle: {
|
|
3555
|
+
overflow: "hidden",
|
|
3556
|
+
textOverflow: "ellipsis",
|
|
3557
|
+
whiteSpace: "nowrap",
|
|
3558
|
+
width: "100%"
|
|
3559
|
+
},
|
|
3560
|
+
actions: {
|
|
3561
|
+
display: "flex",
|
|
3562
|
+
alignItems: "center",
|
|
3563
|
+
flexShrink: 0,
|
|
3564
|
+
gap: theme.spacing(1)
|
|
3565
|
+
},
|
|
3566
|
+
emptyState: {
|
|
3567
|
+
display: "flex",
|
|
3568
|
+
alignItems: "center",
|
|
3569
|
+
justifyContent: "center",
|
|
3570
|
+
padding: theme.spacing(4),
|
|
3571
|
+
flex: 1
|
|
3572
|
+
},
|
|
3573
|
+
dialogContent: {
|
|
3574
|
+
borderTop: `1px solid ${theme.palette.divider}`,
|
|
3575
|
+
borderBottom: `1px solid ${theme.palette.divider}`
|
|
3576
|
+
},
|
|
3577
|
+
dialogForm: {
|
|
3578
|
+
display: "flex",
|
|
3579
|
+
flexDirection: "column",
|
|
3580
|
+
gap: theme.spacing(3),
|
|
3581
|
+
paddingTop: theme.spacing(2)
|
|
3582
|
+
},
|
|
3583
|
+
dialogActions: {
|
|
3584
|
+
padding: theme.spacing(2),
|
|
3585
|
+
gap: theme.spacing(2)
|
|
3586
|
+
},
|
|
3587
|
+
deleteMessage: {
|
|
3588
|
+
paddingTop: theme.spacing(1)
|
|
3589
|
+
}
|
|
3590
|
+
}));
|
|
3591
|
+
|
|
3078
3592
|
var UserLevel;
|
|
3079
3593
|
(function (UserLevel) {
|
|
3080
3594
|
UserLevel[UserLevel["Operator"] = 1] = "Operator";
|
|
@@ -3141,4 +3655,4 @@ function getApiBaseUrl(options) {
|
|
|
3141
3655
|
return getExecutionEngineHttpUrl(processName);
|
|
3142
3656
|
}
|
|
3143
3657
|
|
|
3144
|
-
export { ActionButton, FileUploadPanel, I18nProvider, I18nSettings, LogFilterForm, LogsPagination, LogsPanel, LogsTable, NavigationBar, NavigationConfirmationModal, PasswordProtectionModal, SettingsPage, Sidebar, StatusTopBar, StepProgressCircle, TimeLabel, UserLevel, Z_INDEX, closeCustomUi, formatDateToInput, getApiBaseUrl, getAvailableTimezones, getLanguageDisplayName, getSupportedLanguages, hasSufficientLevel, isOnEdge, isTouchScreenDevice, navigateControlCenter, parseLogDate, useI18n };
|
|
3658
|
+
export { ActionButton, FileUploadPanel, I18nProvider, I18nSettings, LogFilterForm, LogsPagination, LogsPanel, LogsTable, NavigationBar, NavigationConfirmationModal, PasswordProtectionModal, ProductFormList, SettingsPage, Sidebar, StatusTopBar, StepProgressCircle, TimeLabel, UserLevel, Z_INDEX, closeCustomUi, formatDateToInput, getApiBaseUrl, getAvailableTimezones, getLanguageDisplayName, getSupportedLanguages, hasSufficientLevel, isOnEdge, isTouchScreenDevice, navigateControlCenter, parseLogDate, useAutoScrollInput, useI18n };
|