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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # sevago-library
2
2
 
3
+ ## 1.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - feat: FilterSlider
8
+
9
+ ## 1.3.19
10
+
11
+ ### Patch Changes
12
+
13
+ - feat: update app
14
+
3
15
  ## 1.3.18
4
16
 
5
17
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -607,22 +607,6 @@ const APP_OBJ = {
607
607
  group: AppGroup.MANUFACTURING,
608
608
  color: APP_GROUP_COLOR[AppGroup.MANUFACTURING]
609
609
  },
610
- MANUFACTURING_EXECUTION_OLD: {
611
- path: {
612
- local: "http://localhost:12021",
613
- develop: "https://dev.trackingproductionclient.sevago.local",
614
- staging: "",
615
- //https://sta.admin.manufacturing-execution.sevago.local
616
- production: "",
617
- //https://admin.manufacturing-execution.sevago.local
618
- production_vps: ""
619
- },
620
- icon: ICONS.iconManufacturingExecution,
621
- content: "Thực thi sản xuất",
622
- title: "Sevago Execution",
623
- group: AppGroup.MANUFACTURING,
624
- color: APP_GROUP_COLOR[AppGroup.MANUFACTURING]
625
- },
626
610
  MANUFACTURING_EXECUTION: {
627
611
  path: {
628
612
  local: "http://localhost:12021",
@@ -634,9 +618,9 @@ const APP_OBJ = {
634
618
  production_vps: ""
635
619
  },
636
620
  icon: ICONS.iconManufacturingExecution,
637
- content: "ME",
638
- group: AppGroup.MANUFACTURING,
621
+ content: "Thực thi sản xuất",
639
622
  title: "Sevago Execution",
623
+ group: AppGroup.MANUFACTURING,
640
624
  color: APP_GROUP_COLOR[AppGroup.MANUFACTURING]
641
625
  },
642
626
  MATERIAL_CONTROL: {
@@ -708,7 +692,6 @@ const APP_BLACK_LIST = {
708
692
  "PURCHASE",
709
693
  "WAREHOUSE_MATERIAL",
710
694
  "MANUFACTURING_PLAN",
711
- "MANUFACTURING_EXECUTION_OLD",
712
695
  "MANUFACTURING_EXECUTION",
713
696
  "MATERIAL_CONTROL",
714
697
  "PRODUCT_MANAGEMENT",
@@ -739,7 +722,6 @@ const APP_BLACK_LIST = {
739
722
  "PURCHASE",
740
723
  "WAREHOUSE_MATERIAL",
741
724
  "MANUFACTURING_PLAN",
742
- "MANUFACTURING_EXECUTION_OLD",
743
725
  "MANUFACTURING_EXECUTION",
744
726
  "MATERIAL_CONTROL",
745
727
  "PRODUCT_MANAGEMENT",
@@ -770,7 +752,6 @@ const APP_BLACK_LIST = {
770
752
  // 'PURCHASE',
771
753
  // 'WAREHOUSE_MATERIAL',
772
754
  // 'MANUFACTURING_PLAN',
773
- // 'MANUFACTURING_EXECUTION_OLD',
774
755
  // 'MANUFACTURING_EXECUTION',
775
756
  // 'MATERIAL_CONTROL',
776
757
  // 'PRODUCT_MANAGEMENT',
@@ -68804,7 +68785,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
68804
68785
  const TextFieldDateTimeElement = ({
68805
68786
  name,
68806
68787
  label = "",
68807
- iconLabel = "edit_calendar",
68788
+ iconLabel = "",
68808
68789
  icon = "calendar_today",
68809
68790
  error = "",
68810
68791
  value = null,
@@ -75968,6 +75949,99 @@ const AdvancedOperatorFilterDialog = ({
75968
75949
  }
75969
75950
  );
75970
75951
  };
75952
+ const FilterSlider = ({
75953
+ children,
75954
+ onApply,
75955
+ onReset,
75956
+ initialFilters = {},
75957
+ sx = {},
75958
+ ignoredKeysInCount = []
75959
+ }) => {
75960
+ const [isOpen, setIsOpen] = React.useState(false);
75961
+ const [filters, setFilters] = React.useState(initialFilters);
75962
+ const [tempFilters, setTempFilters] = React.useState(initialFilters);
75963
+ const activeFilterCount = Object.entries(filters).filter(([key, value]) => {
75964
+ if (ignoredKeysInCount.includes(key)) return false;
75965
+ if (Array.isArray(value)) return value.length > 0;
75966
+ return value !== null && value !== void 0 && value !== "";
75967
+ }).length;
75968
+ React.useEffect(() => {
75969
+ if (isOpen) {
75970
+ setTempFilters({ ...filters });
75971
+ }
75972
+ }, [filters, isOpen]);
75973
+ const handleFilterChange = (key, value) => {
75974
+ setTempFilters((prev) => ({
75975
+ ...prev,
75976
+ [key]: value
75977
+ }));
75978
+ };
75979
+ const handleApply = () => {
75980
+ setFilters(tempFilters);
75981
+ onApply == null ? void 0 : onApply(tempFilters);
75982
+ setIsOpen(false);
75983
+ };
75984
+ const handleReset = () => {
75985
+ setTempFilters({});
75986
+ setFilters({});
75987
+ onReset == null ? void 0 : onReset();
75988
+ setIsOpen(false);
75989
+ };
75990
+ return /* @__PURE__ */ jsxRuntime.jsxs(React.Fragment, { children: [
75991
+ /* @__PURE__ */ jsxRuntime.jsx(
75992
+ ButtonElement,
75993
+ {
75994
+ sx: {
75995
+ ...sx,
75996
+ color: activeFilterCount > 0 ? PRIMARY[500] : PRIMARY[500],
75997
+ minWidth: "auto",
75998
+ p: PADDING_LAYOUT_HEADER
75999
+ },
76000
+ startIcon: "filter_list_alt",
76001
+ variant: "outlined",
76002
+ onClick: () => setIsOpen(true),
76003
+ content: `Bộ lọc${activeFilterCount > 0 ? ` (${activeFilterCount})` : ""}`
76004
+ }
76005
+ ),
76006
+ /* @__PURE__ */ jsxRuntime.jsx(
76007
+ material.Drawer,
76008
+ {
76009
+ anchor: "right",
76010
+ open: isOpen,
76011
+ onClose: () => setIsOpen(false),
76012
+ sx: {
76013
+ "& .MuiDrawer-paper": {
76014
+ width: 320,
76015
+ padding: PADDING_GAP_LAYOUT
76016
+ }
76017
+ },
76018
+ children: /* @__PURE__ */ jsxRuntime.jsxs(system.Stack, { sx: { height: "100%" }, children: [
76019
+ /* @__PURE__ */ jsxRuntime.jsxs(StackRowAlignCenterJustBetween, { sx: { gap: 0 }, children: [
76020
+ /* @__PURE__ */ jsxRuntime.jsx(TypographyOneLine, { content: "Bộ lọc", sx: { ...TYPOGRAPHY.textLg.semiBold } }),
76021
+ /* @__PURE__ */ jsxRuntime.jsx(material.IconButton, { onClick: () => setIsOpen(false), children: /* @__PURE__ */ jsxRuntime.jsx(IconElement, { icon: "close" }) })
76022
+ ] }),
76023
+ /* @__PURE__ */ jsxRuntime.jsx(
76024
+ system.Stack,
76025
+ {
76026
+ sx: {
76027
+ flex: 1,
76028
+ gap: PADDING_GAP_ITEM,
76029
+ overflowY: "auto",
76030
+ scrollbarWidth: "none",
76031
+ "&::-webkit-scrollbar": { display: "none" }
76032
+ },
76033
+ children: children({ filters, tempFilters, setFilter: handleFilterChange, setTempFilters })
76034
+ }
76035
+ ),
76036
+ /* @__PURE__ */ jsxRuntime.jsxs(StackRowJustEnd, { sx: { gap: PADDING_GAP_ITEM }, children: [
76037
+ /* @__PURE__ */ jsxRuntime.jsx(ButtonElement, { variant: "outlined", onClick: handleReset, content: "Đặt lại" }),
76038
+ /* @__PURE__ */ jsxRuntime.jsx(ButtonElement, { variant: "contained", onClick: handleApply, content: "Cập nhật" })
76039
+ ] })
76040
+ ] })
76041
+ }
76042
+ )
76043
+ ] });
76044
+ };
75971
76045
  const ListIconContentElement = ({
75972
76046
  titleNode,
75973
76047
  list,
@@ -79103,6 +79177,7 @@ exports.Environment = Environment;
79103
79177
  exports.FIELD_WIDTH = FIELD_WIDTH;
79104
79178
  exports.FULL_OPERATOR_OPTIONS = FULL_OPERATOR_OPTIONS;
79105
79179
  exports.FilterOperator = FilterOperator;
79180
+ exports.FilterSlider = FilterSlider;
79106
79181
  exports.GROUP_ICONS = GROUP_ICONS;
79107
79182
  exports.HttpStatusSpecial = HttpStatusSpecial;
79108
79183
  exports.ICONS = ICONS;