sevago-library 1.3.18 → 1.4.0
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/CHANGELOG.md +12 -0
- package/dist/index.cjs.js +97 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +98 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/src/common/const/apps.const.d.ts +1 -15
- package/dist/src/components/elements/filters/filter-slider/filter-slider.component.d.ts +24 -0
- package/dist/src/components/elements/filters/filter-slider/filter-slider.component.stories.d.ts +8 -0
- package/dist/src/components/elements/filters/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { createTheme as createTheme$2, Stack, TableCell, tableCellClasses, LinearProgress, linearProgressClasses, useTheme as useTheme$4, Skeleton, Box, styled as styled$3, InputLabel as InputLabel$1, Link, Paper as Paper$1, Typography as Typography$1, ClickAwayListener, Tooltip, Icon, Badge, Tabs as Tabs$1, Tab as Tab$1, Divider as Divider$1, tooltipClasses, Avatar, AvatarGroup, Popover as Popover$1, CircularProgress as CircularProgress$1, Button as Button$1, Chip as Chip$1, TextField as TextField$1, GlobalStyles as GlobalStyles$2, InputAdornment as InputAdornment$1, debounce as debounce$3, Fade as Fade$1, MenuItem as MenuItem$1, FormControl as FormControl$1, FormHelperText as FormHelperText$1, IconButton as IconButton$1, FormControlLabel, Checkbox, Collapse, Dialog as Dialog$1, DialogTitle, DialogContent as DialogContent$1, DialogActions as DialogActions$1, List as List$2, ListItem as ListItem$1, Pagination, RadioGroup, Radio, TableRow, TableContainer, TableHead, Table, TableBody, useMediaQuery as useMediaQuery$1, Card, CardHeader, CardContent, Select as Select$1, Autocomplete as Autocomplete$1 } from "@mui/material";
|
|
4
|
+
import { createTheme as createTheme$2, Stack, TableCell, tableCellClasses, LinearProgress, linearProgressClasses, useTheme as useTheme$4, Skeleton, Box, styled as styled$3, InputLabel as InputLabel$1, Link, Paper as Paper$1, Typography as Typography$1, ClickAwayListener, Tooltip, Icon, Badge, Tabs as Tabs$1, Tab as Tab$1, Divider as Divider$1, tooltipClasses, Avatar, AvatarGroup, Popover as Popover$1, CircularProgress as CircularProgress$1, Button as Button$1, Chip as Chip$1, TextField as TextField$1, GlobalStyles as GlobalStyles$2, InputAdornment as InputAdornment$1, debounce as debounce$3, Fade as Fade$1, MenuItem as MenuItem$1, FormControl as FormControl$1, FormHelperText as FormHelperText$1, IconButton as IconButton$1, FormControlLabel, Checkbox, Collapse, Dialog as Dialog$1, DialogTitle, DialogContent as DialogContent$1, DialogActions as DialogActions$1, Drawer, List as List$2, ListItem as ListItem$1, Pagination, RadioGroup, Radio, TableRow, TableContainer, TableHead, Table, TableBody, useMediaQuery as useMediaQuery$1, Card, CardHeader, CardContent, Select as Select$1, Autocomplete as Autocomplete$1 } from "@mui/material";
|
|
5
5
|
import dayjs from "dayjs";
|
|
6
6
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
7
7
|
import * as React from "react";
|
|
@@ -589,22 +589,6 @@ const APP_OBJ = {
|
|
|
589
589
|
group: AppGroup.MANUFACTURING,
|
|
590
590
|
color: APP_GROUP_COLOR[AppGroup.MANUFACTURING]
|
|
591
591
|
},
|
|
592
|
-
MANUFACTURING_EXECUTION_OLD: {
|
|
593
|
-
path: {
|
|
594
|
-
local: "http://localhost:12021",
|
|
595
|
-
develop: "https://dev.trackingproductionclient.sevago.local",
|
|
596
|
-
staging: "",
|
|
597
|
-
//https://sta.admin.manufacturing-execution.sevago.local
|
|
598
|
-
production: "",
|
|
599
|
-
//https://admin.manufacturing-execution.sevago.local
|
|
600
|
-
production_vps: ""
|
|
601
|
-
},
|
|
602
|
-
icon: ICONS.iconManufacturingExecution,
|
|
603
|
-
content: "Thực thi sản xuất",
|
|
604
|
-
title: "Sevago Execution",
|
|
605
|
-
group: AppGroup.MANUFACTURING,
|
|
606
|
-
color: APP_GROUP_COLOR[AppGroup.MANUFACTURING]
|
|
607
|
-
},
|
|
608
592
|
MANUFACTURING_EXECUTION: {
|
|
609
593
|
path: {
|
|
610
594
|
local: "http://localhost:12021",
|
|
@@ -616,9 +600,9 @@ const APP_OBJ = {
|
|
|
616
600
|
production_vps: ""
|
|
617
601
|
},
|
|
618
602
|
icon: ICONS.iconManufacturingExecution,
|
|
619
|
-
content: "
|
|
620
|
-
group: AppGroup.MANUFACTURING,
|
|
603
|
+
content: "Thực thi sản xuất",
|
|
621
604
|
title: "Sevago Execution",
|
|
605
|
+
group: AppGroup.MANUFACTURING,
|
|
622
606
|
color: APP_GROUP_COLOR[AppGroup.MANUFACTURING]
|
|
623
607
|
},
|
|
624
608
|
MATERIAL_CONTROL: {
|
|
@@ -690,7 +674,6 @@ const APP_BLACK_LIST = {
|
|
|
690
674
|
"PURCHASE",
|
|
691
675
|
"WAREHOUSE_MATERIAL",
|
|
692
676
|
"MANUFACTURING_PLAN",
|
|
693
|
-
"MANUFACTURING_EXECUTION_OLD",
|
|
694
677
|
"MANUFACTURING_EXECUTION",
|
|
695
678
|
"MATERIAL_CONTROL",
|
|
696
679
|
"PRODUCT_MANAGEMENT",
|
|
@@ -721,7 +704,6 @@ const APP_BLACK_LIST = {
|
|
|
721
704
|
"PURCHASE",
|
|
722
705
|
"WAREHOUSE_MATERIAL",
|
|
723
706
|
"MANUFACTURING_PLAN",
|
|
724
|
-
"MANUFACTURING_EXECUTION_OLD",
|
|
725
707
|
"MANUFACTURING_EXECUTION",
|
|
726
708
|
"MATERIAL_CONTROL",
|
|
727
709
|
"PRODUCT_MANAGEMENT",
|
|
@@ -752,7 +734,6 @@ const APP_BLACK_LIST = {
|
|
|
752
734
|
// 'PURCHASE',
|
|
753
735
|
// 'WAREHOUSE_MATERIAL',
|
|
754
736
|
// 'MANUFACTURING_PLAN',
|
|
755
|
-
// 'MANUFACTURING_EXECUTION_OLD',
|
|
756
737
|
// 'MANUFACTURING_EXECUTION',
|
|
757
738
|
// 'MATERIAL_CONTROL',
|
|
758
739
|
// 'PRODUCT_MANAGEMENT',
|
|
@@ -68786,7 +68767,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
68786
68767
|
const TextFieldDateTimeElement = ({
|
|
68787
68768
|
name,
|
|
68788
68769
|
label = "",
|
|
68789
|
-
iconLabel = "
|
|
68770
|
+
iconLabel = "",
|
|
68790
68771
|
icon = "calendar_today",
|
|
68791
68772
|
error = "",
|
|
68792
68773
|
value = null,
|
|
@@ -75950,6 +75931,99 @@ const AdvancedOperatorFilterDialog = ({
|
|
|
75950
75931
|
}
|
|
75951
75932
|
);
|
|
75952
75933
|
};
|
|
75934
|
+
const FilterSlider = ({
|
|
75935
|
+
children,
|
|
75936
|
+
onApply,
|
|
75937
|
+
onReset,
|
|
75938
|
+
initialFilters = {},
|
|
75939
|
+
sx = {},
|
|
75940
|
+
ignoredKeysInCount = []
|
|
75941
|
+
}) => {
|
|
75942
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
75943
|
+
const [filters, setFilters] = useState(initialFilters);
|
|
75944
|
+
const [tempFilters, setTempFilters] = useState(initialFilters);
|
|
75945
|
+
const activeFilterCount = Object.entries(filters).filter(([key, value]) => {
|
|
75946
|
+
if (ignoredKeysInCount.includes(key)) return false;
|
|
75947
|
+
if (Array.isArray(value)) return value.length > 0;
|
|
75948
|
+
return value !== null && value !== void 0 && value !== "";
|
|
75949
|
+
}).length;
|
|
75950
|
+
useEffect(() => {
|
|
75951
|
+
if (isOpen) {
|
|
75952
|
+
setTempFilters({ ...filters });
|
|
75953
|
+
}
|
|
75954
|
+
}, [filters, isOpen]);
|
|
75955
|
+
const handleFilterChange = (key, value) => {
|
|
75956
|
+
setTempFilters((prev) => ({
|
|
75957
|
+
...prev,
|
|
75958
|
+
[key]: value
|
|
75959
|
+
}));
|
|
75960
|
+
};
|
|
75961
|
+
const handleApply = () => {
|
|
75962
|
+
setFilters(tempFilters);
|
|
75963
|
+
onApply == null ? void 0 : onApply(tempFilters);
|
|
75964
|
+
setIsOpen(false);
|
|
75965
|
+
};
|
|
75966
|
+
const handleReset = () => {
|
|
75967
|
+
setTempFilters({});
|
|
75968
|
+
setFilters({});
|
|
75969
|
+
onReset == null ? void 0 : onReset();
|
|
75970
|
+
setIsOpen(false);
|
|
75971
|
+
};
|
|
75972
|
+
return /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
75973
|
+
/* @__PURE__ */ jsx(
|
|
75974
|
+
ButtonElement,
|
|
75975
|
+
{
|
|
75976
|
+
sx: {
|
|
75977
|
+
...sx,
|
|
75978
|
+
color: activeFilterCount > 0 ? PRIMARY[500] : PRIMARY[500],
|
|
75979
|
+
minWidth: "auto",
|
|
75980
|
+
p: PADDING_LAYOUT_HEADER
|
|
75981
|
+
},
|
|
75982
|
+
startIcon: "filter_list_alt",
|
|
75983
|
+
variant: "outlined",
|
|
75984
|
+
onClick: () => setIsOpen(true),
|
|
75985
|
+
content: `Bộ lọc${activeFilterCount > 0 ? ` (${activeFilterCount})` : ""}`
|
|
75986
|
+
}
|
|
75987
|
+
),
|
|
75988
|
+
/* @__PURE__ */ jsx(
|
|
75989
|
+
Drawer,
|
|
75990
|
+
{
|
|
75991
|
+
anchor: "right",
|
|
75992
|
+
open: isOpen,
|
|
75993
|
+
onClose: () => setIsOpen(false),
|
|
75994
|
+
sx: {
|
|
75995
|
+
"& .MuiDrawer-paper": {
|
|
75996
|
+
width: 320,
|
|
75997
|
+
padding: PADDING_GAP_LAYOUT
|
|
75998
|
+
}
|
|
75999
|
+
},
|
|
76000
|
+
children: /* @__PURE__ */ jsxs(Stack$1, { sx: { height: "100%" }, children: [
|
|
76001
|
+
/* @__PURE__ */ jsxs(StackRowAlignCenterJustBetween, { sx: { gap: 0 }, children: [
|
|
76002
|
+
/* @__PURE__ */ jsx(TypographyOneLine, { content: "Bộ lọc", sx: { ...TYPOGRAPHY.textLg.semiBold } }),
|
|
76003
|
+
/* @__PURE__ */ jsx(IconButton$1, { onClick: () => setIsOpen(false), children: /* @__PURE__ */ jsx(IconElement, { icon: "close" }) })
|
|
76004
|
+
] }),
|
|
76005
|
+
/* @__PURE__ */ jsx(
|
|
76006
|
+
Stack$1,
|
|
76007
|
+
{
|
|
76008
|
+
sx: {
|
|
76009
|
+
flex: 1,
|
|
76010
|
+
gap: PADDING_GAP_ITEM,
|
|
76011
|
+
overflowY: "auto",
|
|
76012
|
+
scrollbarWidth: "none",
|
|
76013
|
+
"&::-webkit-scrollbar": { display: "none" }
|
|
76014
|
+
},
|
|
76015
|
+
children: children({ filters, tempFilters, setFilter: handleFilterChange, setTempFilters })
|
|
76016
|
+
}
|
|
76017
|
+
),
|
|
76018
|
+
/* @__PURE__ */ jsxs(StackRowJustEnd, { sx: { gap: PADDING_GAP_ITEM }, children: [
|
|
76019
|
+
/* @__PURE__ */ jsx(ButtonElement, { variant: "outlined", onClick: handleReset, content: "Đặt lại" }),
|
|
76020
|
+
/* @__PURE__ */ jsx(ButtonElement, { variant: "contained", onClick: handleApply, content: "Cập nhật" })
|
|
76021
|
+
] })
|
|
76022
|
+
] })
|
|
76023
|
+
}
|
|
76024
|
+
)
|
|
76025
|
+
] });
|
|
76026
|
+
};
|
|
75953
76027
|
const ListIconContentElement = ({
|
|
75954
76028
|
titleNode,
|
|
75955
76029
|
list,
|
|
@@ -79086,6 +79160,7 @@ export {
|
|
|
79086
79160
|
FIELD_WIDTH,
|
|
79087
79161
|
FULL_OPERATOR_OPTIONS,
|
|
79088
79162
|
FilterOperator,
|
|
79163
|
+
FilterSlider,
|
|
79089
79164
|
GROUP_ICONS,
|
|
79090
79165
|
HttpStatusSpecial,
|
|
79091
79166
|
ICONS,
|