sevago-library 1.3.19 → 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 +6 -0
- package/dist/index.cjs.js +95 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +96 -2
- package/dist/index.esm.js.map +1 -1
- 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";
|
|
@@ -68767,7 +68767,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
68767
68767
|
const TextFieldDateTimeElement = ({
|
|
68768
68768
|
name,
|
|
68769
68769
|
label = "",
|
|
68770
|
-
iconLabel = "
|
|
68770
|
+
iconLabel = "",
|
|
68771
68771
|
icon = "calendar_today",
|
|
68772
68772
|
error = "",
|
|
68773
68773
|
value = null,
|
|
@@ -75931,6 +75931,99 @@ const AdvancedOperatorFilterDialog = ({
|
|
|
75931
75931
|
}
|
|
75932
75932
|
);
|
|
75933
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
|
+
};
|
|
75934
76027
|
const ListIconContentElement = ({
|
|
75935
76028
|
titleNode,
|
|
75936
76029
|
list,
|
|
@@ -79067,6 +79160,7 @@ export {
|
|
|
79067
79160
|
FIELD_WIDTH,
|
|
79068
79161
|
FULL_OPERATOR_OPTIONS,
|
|
79069
79162
|
FilterOperator,
|
|
79163
|
+
FilterSlider,
|
|
79070
79164
|
GROUP_ICONS,
|
|
79071
79165
|
HttpStatusSpecial,
|
|
79072
79166
|
ICONS,
|