@codezee/sixtify-brahma 0.2.126 → 0.2.128
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/package.json +1 -1
- package/packages/shared-components/dist/ActionButtons/FormActionButton.d.ts +16 -0
- package/packages/shared-components/dist/ActionButtons/FormActionButton.d.ts.map +1 -0
- package/packages/shared-components/dist/ActionButtons/FormActionButton.js +41 -0
- package/packages/shared-components/dist/ActionButtons/index.d.ts +1 -0
- package/packages/shared-components/dist/ActionButtons/index.d.ts.map +1 -1
- package/packages/shared-components/dist/ActionButtons/index.js +1 -0
- package/packages/shared-components/dist/ActionButtons/types.d.ts +3 -2
- package/packages/shared-components/dist/ActionButtons/types.d.ts.map +1 -1
- package/packages/shared-components/dist/AgGrid/ActionCell/ActionCell.d.ts +2 -1
- package/packages/shared-components/dist/AgGrid/ActionCell/ActionCell.d.ts.map +1 -1
- package/packages/shared-components/dist/Breadcrumbs/Breadcrumbs.d.ts +2 -1
- package/packages/shared-components/dist/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
- package/packages/shared-components/dist/Button/Button.d.ts +2 -1
- package/packages/shared-components/dist/Button/Button.d.ts.map +1 -1
- package/packages/shared-components/dist/Button/SplitButton.d.ts +3 -2
- package/packages/shared-components/dist/Button/SplitButton.d.ts.map +1 -1
- package/packages/shared-components/dist/Chips/FilterPill.d.ts +2 -1
- package/packages/shared-components/dist/Chips/FilterPill.d.ts.map +1 -1
- package/packages/shared-components/dist/Chips/FilterPill.js +2 -2
- package/packages/shared-components/dist/ColumnArranger/ColumnArrangerDialog.d.ts +2 -1
- package/packages/shared-components/dist/ColumnArranger/ColumnArrangerDialog.d.ts.map +1 -1
- package/packages/shared-components/dist/Dialog/BottomDialog.d.ts +2 -1
- package/packages/shared-components/dist/Dialog/BottomDialog.d.ts.map +1 -1
- package/packages/shared-components/dist/Dialog/BottomDialog.js +1 -1
- package/packages/shared-components/dist/Dialog/DeleteDialog.d.ts +3 -2
- package/packages/shared-components/dist/Dialog/DeleteDialog.d.ts.map +1 -1
- package/packages/shared-components/dist/Dialog/DeleteDialog.js +1 -1
- package/packages/shared-components/dist/Dialog/SaveDialog.d.ts +3 -2
- package/packages/shared-components/dist/Dialog/SaveDialog.d.ts.map +1 -1
- package/packages/shared-components/dist/Drawer/CloseDrawer/CloseDrawerSubMenuItemList.d.ts +2 -1
- package/packages/shared-components/dist/Drawer/CloseDrawer/CloseDrawerSubMenuItemList.d.ts.map +1 -1
- package/packages/shared-components/dist/FilterList/DateRangePickerPopUp.d.ts +2 -1
- package/packages/shared-components/dist/FilterList/DateRangePickerPopUp.d.ts.map +1 -1
- package/packages/shared-components/dist/FilterList/FilterListV2.d.ts +2 -1
- package/packages/shared-components/dist/FilterList/FilterListV2.d.ts.map +1 -1
- package/packages/shared-components/dist/FilterList/FilterPopup.d.ts +3 -2
- package/packages/shared-components/dist/FilterList/FilterPopup.d.ts.map +1 -1
- package/packages/shared-components/dist/FilterList/FilterPopupWrapper.d.ts +4 -3
- package/packages/shared-components/dist/FilterList/FilterPopupWrapper.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.d.ts +2 -1
- package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/DateRangeSelector/DateRangeSelector.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/FileUpload/Dialogs/FilePreview.d.ts +4 -3
- package/packages/shared-components/dist/FormFields/FileUpload/Dialogs/FilePreview.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/FileUpload/Dialogs/ViewFilePreviewDialog.d.ts +2 -1
- package/packages/shared-components/dist/FormFields/FileUpload/Dialogs/ViewFilePreviewDialog.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/ImageUpload/ImageUpload.d.ts +2 -1
- package/packages/shared-components/dist/FormFields/ImageUpload/ImageUpload.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/ImageUpload/PhotoCaptureDialog.d.ts +2 -1
- package/packages/shared-components/dist/FormFields/ImageUpload/PhotoCaptureDialog.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/Select/Select.d.ts +2 -1
- package/packages/shared-components/dist/FormFields/Select/Select.d.ts.map +1 -1
- package/packages/shared-components/dist/PrintDownloadAction/PrintDownloadActions.d.ts +2 -1
- package/packages/shared-components/dist/PrintDownloadAction/PrintDownloadActions.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.d.ts +2 -1
- package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.js +11 -13
- package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.js +37 -6
- package/packages/shared-components/dist/SmartGrid/Components/FilterStatusPanel.d.ts +9 -0
- package/packages/shared-components/dist/SmartGrid/Components/FilterStatusPanel.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/FilterStatusPanel.js +69 -0
- package/packages/shared-components/dist/SmartGrid/Components/HeaderCell.d.ts +2 -1
- package/packages/shared-components/dist/SmartGrid/Components/HeaderCell.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/HeaderCell.js +4 -4
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DateRangeInput/DateRangeInput.d.ts +8 -0
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DateRangeInput/DateRangeInput.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DateRangeInput/DateRangeInput.js +127 -0
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DateRangeInput/StyleDateRangeWrapper.d.ts +6 -0
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DateRangeInput/StyleDateRangeWrapper.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DateRangeInput/StyleDateRangeWrapper.js +120 -0
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DebouncedInput.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DebouncedInput.js +1 -21
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/GetRenderInputs.d.ts +2 -1
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/GetRenderInputs.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/GetRenderInputs.js +21 -10
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/SearchFilterRow.d.ts +2 -1
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/SearchFilterRow.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/SearchFilterRow.js +2 -2
- package/packages/shared-components/dist/SmartGrid/Components/TableRowComponent.d.ts +0 -1
- package/packages/shared-components/dist/SmartGrid/Components/TableRowComponent.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/SmartGrid.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/SmartGrid.js +24 -6
- package/packages/shared-components/dist/SmartGrid/context/CellSelectionContext.d.ts +4 -3
- package/packages/shared-components/dist/SmartGrid/context/CellSelectionContext.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/hooks/useCopyToClipboard.d.ts +2 -1
- package/packages/shared-components/dist/SmartGrid/hooks/useCopyToClipboard.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/hooks/useGetColumnWidth.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/hooks/useGetColumnWidth.js +24 -8
- package/packages/shared-components/dist/SmartGrid/hooks/useGetFacetedFilter.d.ts +1 -0
- package/packages/shared-components/dist/SmartGrid/hooks/useGetFacetedFilter.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/hooks/useGetFacetedFilter.js +46 -6
- package/packages/shared-components/dist/SmartGrid/hooks/useGetRowSelection.d.ts +2 -1
- package/packages/shared-components/dist/SmartGrid/hooks/useGetRowSelection.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/hooks/useGetRowSelection.js +56 -7
- package/packages/shared-components/dist/SmartGrid/hooks/useTableState.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/hooks/useTableState.js +2 -1
- package/packages/shared-components/dist/SmartGrid/types/index.d.ts +3 -1
- package/packages/shared-components/dist/SmartGrid/types/index.d.ts.map +1 -1
- package/packages/shared-components/dist/TabBar/TabsMenus.d.ts +3 -2
- package/packages/shared-components/dist/TabBar/TabsMenus.d.ts.map +1 -1
- package/packages/shared-components/dist/Toast/Toast.d.ts +2 -1
- package/packages/shared-components/dist/Toast/Toast.d.ts.map +1 -1
- package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.d.ts +2 -1
- package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.d.ts.map +1 -1
- package/packages/shared-components/dist/UserProfileMenu/UserProfileMenu.js +1 -1
- package/packages/shared-components/dist/utils/hooks/useDialogActions.d.ts +2 -1
- package/packages/shared-components/dist/utils/hooks/useDialogActions.d.ts.map +1 -1
- package/packages/shared-components/dist/utils/hooks/useGlobalKeyboardShortcut.d.ts +2 -1
- package/packages/shared-components/dist/utils/hooks/useGlobalKeyboardShortcut.d.ts.map +1 -1
- package/packages/shared-components/dist/utils/index.d.ts +1 -0
- package/packages/shared-components/dist/utils/index.d.ts.map +1 -1
- package/packages/shared-components/dist/utils/index.js +1 -0
- package/packages/shared-components/dist/utils/types.d.ts +2 -0
- package/packages/shared-components/dist/utils/types.d.ts.map +1 -0
- package/packages/shared-components/dist/utils/types.js +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/FormFields/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AAmBnE,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/FormFields/Select/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,eAAe,CAAC;AAmBnE,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AAUzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,WAAW,IAAI,kBAAkB,CAAC,CAAC,CAAC,GACpE,IAAI,CACF,cAAc,EACd,MAAM,qBAAqB,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,CACnE,GAAG;IACF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC;IACxE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAChC,CAAC;AAEJ,wBAAgB,MAAM,CAAC,CAAC,SAAS,WAAW,EAAE,EAC5C,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,QAAgB,EAChB,KAAK,EACL,QAAgB,EAChB,QAAgB,EAChB,OAAY,EACZ,KAAK,EACL,OAAe,EACf,UAAU,EACV,KAAK,EACL,WAAgB,EAChB,eAAsB,EACtB,YAAoB,EACpB,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,eAAmB,EACnB,gBAA0C,EAC1C,gBAAwB,EACxB,OAAkB,EAClB,GAAG,SAAS,EACb,EAAE,WAAW,CAAC,CAAC,CAAC,2CAmdhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrintDownloadActions.d.ts","sourceRoot":"","sources":["../../src/PrintDownloadAction/PrintDownloadActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,OAAO,EAAc,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"PrintDownloadActions.d.ts","sourceRoot":"","sources":["../../src/PrintDownloadAction/PrintDownloadActions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,OAAO,EAAc,MAAM,eAAe,CAAC;AAK9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,KAAK,wBAAwB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,QAAQ,CAAC;CACnB,CAAC;AAEF,KAAK,yBAAyB,GAAG;IAC/B,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,KAAK,EAAE,wBAAwB,EAAE,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,0BAIlC,yBAAyB,4CAsC3B,CAAC"}
|
package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Header } from "@tanstack/react-table";
|
|
2
2
|
type FacetedFilterProps<T> = {
|
|
3
3
|
header: Header<T, unknown>;
|
|
4
|
+
resetAllFilters: boolean;
|
|
4
5
|
};
|
|
5
|
-
export declare const FacetedFilter: <T>({ header }: FacetedFilterProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const FacetedFilter: <T>({ header, resetAllFilters, }: FacetedFilterProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export {};
|
|
7
8
|
//# sourceMappingURL=FacetedFilter.d.ts.map
|
package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FacetedFilter.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/FacetedFilter/FacetedFilter.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAUpD,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"FacetedFilter.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/FacetedFilter/FacetedFilter.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAUpD,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,EAAG,8BAG/B,kBAAkB,CAAC,CAAC,CAAC,4CAmTvB,CAAC"}
|
|
@@ -5,11 +5,11 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const icons_material_1 = require("@mui/icons-material");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
const useGetDynamicOptionData_1 = require("./hooks/useGetDynamicOptionData");
|
|
9
8
|
const DebouncedInput_1 = require("../SearchFilterRow/DebouncedInput");
|
|
10
|
-
const
|
|
9
|
+
const useGetDynamicOptionData_1 = require("./hooks/useGetDynamicOptionData");
|
|
11
10
|
const Tooltip_1 = require("../../../Tooltip");
|
|
12
|
-
const
|
|
11
|
+
const VirtualCheckboxList_1 = require("./VirtualCheckboxList");
|
|
12
|
+
const FacetedFilter = ({ header, resetAllFilters, }) => {
|
|
13
13
|
const theme = (0, material_1.useTheme)();
|
|
14
14
|
const { butterflyBlue, iron, mirage } = theme.palette.app.color;
|
|
15
15
|
const [isOpen, setIsOpen] = (0, react_1.useState)(false);
|
|
@@ -24,7 +24,6 @@ const FacetedFilter = ({ header }) => {
|
|
|
24
24
|
const columnDef = header.column.columnDef;
|
|
25
25
|
const { facetedFilter, filterVariant } = columnDef;
|
|
26
26
|
const { getFilterValue, setFilterValue } = header.column;
|
|
27
|
-
// Check if this column has both faceted filter and filter variant
|
|
28
27
|
const isCombinedFilter = facetedFilter && filterVariant;
|
|
29
28
|
const filterValue = isCombinedFilter
|
|
30
29
|
? (getFilterValue()?.facets ?? [])
|
|
@@ -93,12 +92,9 @@ const FacetedFilter = ({ header }) => {
|
|
|
93
92
|
setLocalFilterData(allOptions);
|
|
94
93
|
}
|
|
95
94
|
};
|
|
96
|
-
// useCallback is needed here because handleApply and handleReset are passed as onClick props
|
|
97
|
-
// to Button components, ensuring stable references for event handlers
|
|
98
95
|
const handleApply = (0, react_1.useCallback)(() => {
|
|
99
96
|
if (localFilterData !== undefined) {
|
|
100
97
|
if (isCombinedFilter) {
|
|
101
|
-
// Update only the facets part of the combined filter
|
|
102
98
|
const currentFilter = getFilterValue() ?? {
|
|
103
99
|
facets: [],
|
|
104
100
|
search: "",
|
|
@@ -113,11 +109,8 @@ const FacetedFilter = ({ header }) => {
|
|
|
113
109
|
setIsOpen(false);
|
|
114
110
|
setSearchValue("");
|
|
115
111
|
}, [localFilterData, header.column, isCombinedFilter]);
|
|
116
|
-
// useCallback is needed here because handleApply and handleReset are passed as onClick props
|
|
117
|
-
// to Button components, ensuring stable references for event handlers
|
|
118
112
|
const handleReset = (0, react_1.useCallback)(() => {
|
|
119
113
|
if (isCombinedFilter) {
|
|
120
|
-
// Reset only the facets part of the combined filter
|
|
121
114
|
const currentFilter = getFilterValue() ?? {
|
|
122
115
|
facets: [],
|
|
123
116
|
search: "",
|
|
@@ -132,17 +125,22 @@ const FacetedFilter = ({ header }) => {
|
|
|
132
125
|
setSearchValue("");
|
|
133
126
|
setIsOpen(false);
|
|
134
127
|
}, [header.column, isCombinedFilter]);
|
|
128
|
+
(0, react_1.useMemo)(() => {
|
|
129
|
+
if (resetAllFilters) {
|
|
130
|
+
handleReset();
|
|
131
|
+
}
|
|
132
|
+
}, [resetAllFilters]);
|
|
135
133
|
return ((0, jsx_runtime_1.jsxs)("div", { style: { position: "relative" }, children: [(0, jsx_runtime_1.jsxs)(material_1.IconButton, { ref: buttonRef, onClick: () => setIsOpen(!isOpen), sx: { padding: 0, position: "relative" }, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: "Faceted Filter", children: (0, jsx_runtime_1.jsx)(icons_material_1.FilterListRounded, {}) }), activeFilterCount > 0 && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
136
134
|
backgroundColor: butterflyBlue[900],
|
|
135
|
+
border: `2px solid ${iron[600]}`,
|
|
137
136
|
borderRadius: "50%",
|
|
138
137
|
color: iron[600],
|
|
139
138
|
fontSize: "10px",
|
|
140
139
|
fontWeight: "bold",
|
|
141
140
|
height: "6px",
|
|
142
|
-
lineHeight: "6px",
|
|
143
141
|
position: "absolute",
|
|
144
142
|
right: 0,
|
|
145
|
-
top:
|
|
143
|
+
top: 1,
|
|
146
144
|
width: "6px",
|
|
147
145
|
} }))] }), isOpen && ((0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, { onClickAway: handleClickAway, children: (0, jsx_runtime_1.jsxs)("div", { ref: popoverRef, style: {
|
|
148
146
|
backgroundColor: iron[600],
|
|
@@ -150,7 +148,7 @@ const FacetedFilter = ({ header }) => {
|
|
|
150
148
|
boxShadow: `0 0 20px ${mirage[50]}`,
|
|
151
149
|
display: "flex",
|
|
152
150
|
flexDirection: "column",
|
|
153
|
-
height: "
|
|
151
|
+
height: "290px",
|
|
154
152
|
left: 0,
|
|
155
153
|
padding: "8px",
|
|
156
154
|
position: "absolute",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualCheckboxList.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.tsx"],"names":[],"mappings":"AAGA,KAAK,wBAAwB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,mBAAmB,0EACM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"VirtualCheckboxList.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.tsx"],"names":[],"mappings":"AAGA,KAAK,wBAAwB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,mBAAmB,0EACM,wBAAwB,6CAsJ7D,CAAC"}
|
package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.js
CHANGED
|
@@ -6,14 +6,14 @@ const material_1 = require("@mui/material");
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
exports.VirtualCheckboxList = (0, react_1.memo)(({ checkedMap, onToggle, options }) => {
|
|
8
8
|
const theme = (0, material_1.useTheme)();
|
|
9
|
-
const { butterflyBlue } = theme.palette.app.color;
|
|
9
|
+
const { butterflyBlue, sapphireBlue } = theme.palette.app.color;
|
|
10
10
|
const containerRef = (0, react_1.useRef)(null);
|
|
11
11
|
const [visibleRange, setVisibleRange] = (0, react_1.useState)({ end: 20, start: 0 });
|
|
12
|
-
const
|
|
12
|
+
const [isMouseDown, setIsMouseDown] = (0, react_1.useState)(false);
|
|
13
|
+
const [dragMode, setDragMode] = (0, react_1.useState)(null);
|
|
14
|
+
const ITEM_HEIGHT = 25;
|
|
13
15
|
const BUFFER = 5;
|
|
14
16
|
const CONTAINER_HEIGHT = 200;
|
|
15
|
-
// useCallback is used to stabilize the scroll handler reference,
|
|
16
|
-
// preventing unnecessary re-attachment when used in event listeners or memoized components.
|
|
17
17
|
const handleScroll = (0, react_1.useCallback)(() => {
|
|
18
18
|
if (!containerRef.current) {
|
|
19
19
|
return;
|
|
@@ -28,12 +28,37 @@ exports.VirtualCheckboxList = (0, react_1.memo)(({ checkedMap, onToggle, options
|
|
|
28
28
|
const visibleItems = (0, react_1.useMemo)(() => {
|
|
29
29
|
return options.slice(visibleRange.start, visibleRange.end);
|
|
30
30
|
}, [options, visibleRange.start, visibleRange.end]);
|
|
31
|
+
const handleMouseDown = (0, react_1.useCallback)((value) => {
|
|
32
|
+
setIsMouseDown(true);
|
|
33
|
+
const isAlreadyChecked = checkedMap[value];
|
|
34
|
+
setDragMode(isAlreadyChecked ? "unCheck" : "check");
|
|
35
|
+
onToggle(value);
|
|
36
|
+
}, [onToggle, checkedMap]);
|
|
37
|
+
const handleMouseEnter = (0, react_1.useCallback)((value) => {
|
|
38
|
+
if (isMouseDown && dragMode) {
|
|
39
|
+
const isChecked = checkedMap[value];
|
|
40
|
+
if ((dragMode === "check" && !isChecked) ||
|
|
41
|
+
(dragMode === "unCheck" && isChecked)) {
|
|
42
|
+
onToggle(value);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}, [isMouseDown, dragMode, checkedMap, onToggle]);
|
|
46
|
+
const handleMouseUp = (0, react_1.useCallback)(() => {
|
|
47
|
+
setIsMouseDown(false);
|
|
48
|
+
setDragMode(null);
|
|
49
|
+
}, []);
|
|
50
|
+
(0, react_1.useMemo)(() => {
|
|
51
|
+
document.addEventListener("mouseup", handleMouseUp);
|
|
52
|
+
return () => document.removeEventListener("mouseup", handleMouseUp);
|
|
53
|
+
}, [handleMouseUp]);
|
|
31
54
|
return ((0, jsx_runtime_1.jsx)("div", { ref: containerRef, onScroll: handleScroll, style: {
|
|
32
55
|
display: "flex",
|
|
33
56
|
flexDirection: "column",
|
|
57
|
+
height: "300px",
|
|
34
58
|
maxHeight: `${CONTAINER_HEIGHT}px`,
|
|
35
59
|
overflowY: "auto",
|
|
36
60
|
position: "relative",
|
|
61
|
+
userSelect: "none",
|
|
37
62
|
}, children: (0, jsx_runtime_1.jsx)("div", { style: {
|
|
38
63
|
height: `${options.length * ITEM_HEIGHT}px`,
|
|
39
64
|
position: "relative",
|
|
@@ -43,14 +68,20 @@ exports.VirtualCheckboxList = (0, react_1.memo)(({ checkedMap, onToggle, options
|
|
|
43
68
|
width: "100%",
|
|
44
69
|
}, children: visibleItems.map((value) => {
|
|
45
70
|
const isChecked = checkedMap[value] || false;
|
|
46
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Typography, {
|
|
71
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Typography, { onMouseDown: () => handleMouseDown(value), onMouseEnter: () => handleMouseEnter(value), style: {
|
|
47
72
|
alignItems: "center",
|
|
73
|
+
backgroundColor: isChecked
|
|
74
|
+
? sapphireBlue[400]
|
|
75
|
+
: "transparent",
|
|
48
76
|
cursor: "pointer",
|
|
49
77
|
display: "flex",
|
|
50
78
|
fontSize: "12px",
|
|
51
79
|
gap: "4px",
|
|
52
80
|
height: `${ITEM_HEIGHT}px`,
|
|
53
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: isChecked, onChange: () =>
|
|
81
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.Checkbox, { checked: isChecked, onChange: (e) => {
|
|
82
|
+
e.stopPropagation();
|
|
83
|
+
onToggle(value);
|
|
84
|
+
}, onMouseDown: (e) => e.stopPropagation(), size: "small", style: {
|
|
54
85
|
color: isChecked ? butterflyBlue[900] : "",
|
|
55
86
|
padding: "4px",
|
|
56
87
|
} }), value] }, value));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Table } from "@tanstack/react-table";
|
|
2
|
+
import type { OnAction } from "../../utils/types";
|
|
3
|
+
type FilterStatusPanelProps<T> = {
|
|
4
|
+
clearAllFilters: OnAction;
|
|
5
|
+
table: Table<T>;
|
|
6
|
+
};
|
|
7
|
+
export declare const FilterStatusPanel: <T>({ clearAllFilters, table, }: FilterStatusPanelProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=FilterStatusPanel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterStatusPanel.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/Components/FilterStatusPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAGnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,KAAK,sBAAsB,CAAC,CAAC,IAAI;IAC/B,eAAe,EAAE,QAAQ,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAG,6BAGnC,sBAAsB,CAAC,CAAC,CAAC,4CAoI3B,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilterStatusPanel = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const icons_material_1 = require("@mui/icons-material");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const FilterStatusPanel = ({ clearAllFilters, table, }) => {
|
|
9
|
+
const theme = (0, material_1.useTheme)();
|
|
10
|
+
const { brown, butterflyBlue, iron, slate } = theme.palette.app.color;
|
|
11
|
+
const { getHeaderGroups } = table;
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)("div", { style: {
|
|
13
|
+
backgroundColor: slate[600],
|
|
14
|
+
borderTop: `1px solid ${iron[700]}`,
|
|
15
|
+
display: "flex",
|
|
16
|
+
overflow: "auto",
|
|
17
|
+
width: "100%",
|
|
18
|
+
}, children: (() => {
|
|
19
|
+
const extractFilterValues = (filter) => {
|
|
20
|
+
if (!filter) {
|
|
21
|
+
return { facets: [], search: [] };
|
|
22
|
+
}
|
|
23
|
+
const { facets: filterFacets, search: filterSearch } = filter;
|
|
24
|
+
if (Array.isArray(filter)) {
|
|
25
|
+
return { facets: filter.map(String), search: [] };
|
|
26
|
+
}
|
|
27
|
+
if (typeof filter === "string" || typeof filter === "number") {
|
|
28
|
+
return {
|
|
29
|
+
facets: filter !== "" ? [String(filter)] : [],
|
|
30
|
+
search: [],
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (typeof filter === "object" && filter != null) {
|
|
34
|
+
const facets = Array.isArray(filterFacets) ? filterFacets : [];
|
|
35
|
+
const search = filterSearch != null && filterSearch !== ""
|
|
36
|
+
? [String(filterSearch)]
|
|
37
|
+
: [];
|
|
38
|
+
return { facets, search };
|
|
39
|
+
}
|
|
40
|
+
return { facets: [], search: [] };
|
|
41
|
+
};
|
|
42
|
+
const appliedFilters = getHeaderGroups()
|
|
43
|
+
.flatMap((group) => group.headers)
|
|
44
|
+
.map((header) => {
|
|
45
|
+
const filter = header.column.getFilterValue();
|
|
46
|
+
const { facets, search } = extractFilterValues(filter);
|
|
47
|
+
const hasValues = facets.length > 0 || search.length > 0;
|
|
48
|
+
return hasValues ? ((0, jsx_runtime_1.jsxs)(material_1.Stack, { flexDirection: "row", gap: "3px", children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "caption", fontWeight: 600, children: [header.column.columnDef.header, ":"] }), facets.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", sx: { color: butterflyBlue[900] }, children: facets.join(", ") })), facets.length > 0 && search.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", children: "," })), search.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", sx: { color: brown[900] }, children: search.join(", ") }))] }, header.id)) : null;
|
|
49
|
+
})
|
|
50
|
+
.filter(Boolean);
|
|
51
|
+
if (!appliedFilters.length) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
55
|
+
alignItems: "center",
|
|
56
|
+
display: "flex",
|
|
57
|
+
gap: "5px",
|
|
58
|
+
padding: "5px 0px",
|
|
59
|
+
}, children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { sx: { borderRight: `2px solid ${iron[700]}`, padding: "0px 5px" }, onClick: clearAllFilters, children: (0, jsx_runtime_1.jsx)(icons_material_1.HighlightOffRounded, { fontSize: "small" }) }), (0, jsx_runtime_1.jsx)("div", { style: {
|
|
60
|
+
alignItems: "center",
|
|
61
|
+
display: "flex",
|
|
62
|
+
gap: "3px",
|
|
63
|
+
overflow: "hidden",
|
|
64
|
+
textOverflow: "ellipsis",
|
|
65
|
+
whiteSpace: "nowrap",
|
|
66
|
+
}, children: appliedFilters.map((filter, index) => ((0, jsx_runtime_1.jsxs)(react_1.Fragment, { children: [!!index && (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", children: "," }), filter] }, index + 1))) })] }));
|
|
67
|
+
})() }));
|
|
68
|
+
};
|
|
69
|
+
exports.FilterStatusPanel = FilterStatusPanel;
|
|
@@ -3,7 +3,8 @@ type HeaderCellProps<T> = {
|
|
|
3
3
|
defaultGrouping?: (keyof T)[];
|
|
4
4
|
header: Header<T, unknown>;
|
|
5
5
|
loading: boolean;
|
|
6
|
+
resetAllFilters: boolean;
|
|
6
7
|
};
|
|
7
|
-
export declare const HeaderCell: <T>({ defaultGrouping, header, loading, }: HeaderCellProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const HeaderCell: <T>({ defaultGrouping, header, loading, resetAllFilters, }: HeaderCellProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=HeaderCell.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderCell.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/Components/HeaderCell.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,uBAAuB,CAAC;AAQhE,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,eAAe,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"HeaderCell.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/Components/HeaderCell.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,MAAM,EAAc,MAAM,uBAAuB,CAAC;AAQhE,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,eAAe,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,CAAC,EAAG,wDAK5B,eAAe,CAAC,CAAC,CAAC,4CA0IpB,CAAC"}
|
|
@@ -9,11 +9,11 @@ const BlurOffRounded_1 = __importDefault(require("@mui/icons-material/BlurOffRou
|
|
|
9
9
|
const BlurOnRounded_1 = __importDefault(require("@mui/icons-material/BlurOnRounded"));
|
|
10
10
|
const material_1 = require("@mui/material");
|
|
11
11
|
const react_table_1 = require("@tanstack/react-table");
|
|
12
|
-
const
|
|
12
|
+
const Tooltip_1 = require("../../Tooltip");
|
|
13
13
|
const useGetGroupedColumn_1 = require("../hooks/useGetGroupedColumn");
|
|
14
14
|
const useGetSortedColumn_1 = require("../hooks/useGetSortedColumn");
|
|
15
|
-
const
|
|
16
|
-
const HeaderCell = ({ defaultGrouping, header, loading = false, }) => {
|
|
15
|
+
const FacetedFilter_1 = require("./FacetedFilter/FacetedFilter");
|
|
16
|
+
const HeaderCell = ({ defaultGrouping, header, loading = false, resetAllFilters, }) => {
|
|
17
17
|
const theme = (0, material_1.useTheme)();
|
|
18
18
|
const { butterflyBlue, iron, slate } = theme.palette.app.color;
|
|
19
19
|
const { isSortable, mutipleSortCounts, sortableIcon } = (0, useGetSortedColumn_1.useGetSortedColumn)({
|
|
@@ -54,7 +54,7 @@ const HeaderCell = ({ defaultGrouping, header, loading = false, }) => {
|
|
|
54
54
|
textOverflow: "ellipsis",
|
|
55
55
|
textWrap: "nowrap",
|
|
56
56
|
}, children: !header.isPlaceholder &&
|
|
57
|
-
(0, react_table_1.flexRender)(columnDef.header, header.getContext()) }) }),
|
|
57
|
+
(0, react_table_1.flexRender)(columnDef.header, header.getContext()) }) }), showFacetedFilter && !loading && ((0, jsx_runtime_1.jsx)(FacetedFilter_1.FacetedFilter, { header: header, resetAllFilters: resetAllFilters })), isSortable && !loading && ((0, jsx_runtime_1.jsxs)(Tooltip_1.Tooltip, { toolTipLabel: "Sorting", children: [(0, jsx_runtime_1.jsx)(material_1.IconButton, { sx: { padding: 0 }, onClick: getToggleSortingHandler(), children: sortableIcon }), isSortable && !!mutipleSortCounts && ((0, jsx_runtime_1.jsxs)(material_1.Typography, { color: iron[400], variant: "body2", children: ["(", mutipleSortCounts + 1, ")"] }))] })), isGroupable && !defaultGrouping?.length && !loading && ((0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: getToggleGroupingHandler(),
|
|
58
58
|
style: {
|
|
59
59
|
cursor: "pointer",
|
|
60
60
|
padding: 0,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type DateRangeInputProps = {
|
|
2
|
+
initialValue?: string[];
|
|
3
|
+
onApply: (dates: string[]) => void;
|
|
4
|
+
width: string | number;
|
|
5
|
+
};
|
|
6
|
+
export declare const DateRangeInput: ({ initialValue, onApply, width, }: DateRangeInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=DateRangeInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateRangeInput.d.ts","sourceRoot":"","sources":["../../../../../src/SmartGrid/Components/SearchFilterRow/DateRangeInput/DateRangeInput.tsx"],"names":[],"mappings":"AAmBA,KAAK,mBAAmB,GAAG;IACzB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACnC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACxB,CAAC;AAYF,eAAO,MAAM,cAAc,GAAI,mCAI5B,mBAAmB,4CAyLrB,CAAC"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DateRangeInput = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const x_date_pickers_1 = require("@mui/x-date-pickers");
|
|
7
|
+
const date_fns_1 = require("date-fns");
|
|
8
|
+
const react_1 = require("react");
|
|
9
|
+
const react_date_range_1 = require("react-date-range");
|
|
10
|
+
const StyleDateRangeWrapper_1 = require("./StyleDateRangeWrapper");
|
|
11
|
+
const parseDateString = (value) => {
|
|
12
|
+
if (!value) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
const parsed = (0, date_fns_1.parseISO)(value);
|
|
16
|
+
return (0, date_fns_1.isValid)(parsed) ? parsed : null;
|
|
17
|
+
};
|
|
18
|
+
const DateRangeInput = ({ initialValue, onApply, width, }) => {
|
|
19
|
+
const anchorRef = (0, react_1.useRef)(null);
|
|
20
|
+
const [open, setOpen] = (0, react_1.useState)(false);
|
|
21
|
+
const defaultDate = (0, react_1.useMemo)(() => new Date(), []);
|
|
22
|
+
const [range, setRange] = (0, react_1.useState)(() => [
|
|
23
|
+
{
|
|
24
|
+
endDate: defaultDate,
|
|
25
|
+
key: "selection",
|
|
26
|
+
startDate: defaultDate,
|
|
27
|
+
},
|
|
28
|
+
]);
|
|
29
|
+
const [value, setValue] = (0, react_1.useState)({
|
|
30
|
+
firstDate: null,
|
|
31
|
+
lastDate: null,
|
|
32
|
+
});
|
|
33
|
+
const startDate = value.firstDate && (0, date_fns_1.format)(value.firstDate, "dd/MM/yyyy");
|
|
34
|
+
const endDate = value.lastDate && (0, date_fns_1.format)(value.lastDate, "dd/MM/yyyy");
|
|
35
|
+
const displayValue = startDate && endDate
|
|
36
|
+
? // eslint-disable-next-line sonarjs/no-nested-conditional
|
|
37
|
+
startDate === endDate
|
|
38
|
+
? startDate
|
|
39
|
+
: `${startDate} - ${endDate}`
|
|
40
|
+
: "";
|
|
41
|
+
(0, react_1.useEffect)(() => {
|
|
42
|
+
if (initialValue && initialValue.length > 0) {
|
|
43
|
+
const [initialStart, initialEnd = initialValue[0]] = initialValue;
|
|
44
|
+
const start = parseDateString(initialStart);
|
|
45
|
+
const end = parseDateString(initialEnd);
|
|
46
|
+
if (start && end) {
|
|
47
|
+
setValue({ firstDate: start, lastDate: end });
|
|
48
|
+
setRange([
|
|
49
|
+
{
|
|
50
|
+
endDate: end,
|
|
51
|
+
key: "selection",
|
|
52
|
+
startDate: start,
|
|
53
|
+
},
|
|
54
|
+
]);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
setValue({ firstDate: null, lastDate: null });
|
|
59
|
+
setRange([
|
|
60
|
+
{
|
|
61
|
+
endDate: defaultDate,
|
|
62
|
+
key: "selection",
|
|
63
|
+
startDate: defaultDate,
|
|
64
|
+
},
|
|
65
|
+
]);
|
|
66
|
+
}, [defaultDate, initialValue]);
|
|
67
|
+
const handleApply = () => {
|
|
68
|
+
const selection = range[0];
|
|
69
|
+
const start = selection?.startDate ?? null;
|
|
70
|
+
const end = selection?.endDate ?? null;
|
|
71
|
+
if (!start || !end) {
|
|
72
|
+
onApply([]);
|
|
73
|
+
setValue({ firstDate: null, lastDate: null });
|
|
74
|
+
setOpen(false);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
setValue({ firstDate: start, lastDate: end });
|
|
78
|
+
setOpen(false);
|
|
79
|
+
const startStr = (0, date_fns_1.format)(start, "yyyy-MM-dd");
|
|
80
|
+
const endStr = (0, date_fns_1.format)(end, "yyyy-MM-dd");
|
|
81
|
+
onApply([startStr, endStr]);
|
|
82
|
+
};
|
|
83
|
+
const handleClear = (event) => {
|
|
84
|
+
event.stopPropagation();
|
|
85
|
+
setOpen(false);
|
|
86
|
+
setValue({ firstDate: null, lastDate: null });
|
|
87
|
+
setRange([
|
|
88
|
+
{
|
|
89
|
+
endDate: defaultDate,
|
|
90
|
+
key: "selection",
|
|
91
|
+
startDate: defaultDate,
|
|
92
|
+
},
|
|
93
|
+
]);
|
|
94
|
+
onApply([]);
|
|
95
|
+
};
|
|
96
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(material_1.TextField, { inputRef: anchorRef, value: displayValue, placeholder: "dd/mm/yyyy", onClick: () => setOpen(true), fullWidth: true, InputProps: {
|
|
97
|
+
endAdornment: displayValue && ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", style: { padding: "0px" }, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "small", onClick: handleClear, sx: {
|
|
98
|
+
p: 0.5,
|
|
99
|
+
}, children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.ClearIcon, { fontSize: "small" }) }) })),
|
|
100
|
+
readOnly: true,
|
|
101
|
+
}, sx: {
|
|
102
|
+
"& .MuiInputAdornment-root": {
|
|
103
|
+
margin: 0,
|
|
104
|
+
},
|
|
105
|
+
"& .MuiInputBase-input": {
|
|
106
|
+
fontSize: "14px",
|
|
107
|
+
height: "10px",
|
|
108
|
+
padding: "4px 4px",
|
|
109
|
+
},
|
|
110
|
+
"& input[type='date']::-webkit-calendar-picker-indicator": {
|
|
111
|
+
position: "absolute",
|
|
112
|
+
right: 8,
|
|
113
|
+
zIndex: 2,
|
|
114
|
+
},
|
|
115
|
+
width,
|
|
116
|
+
} }), (0, jsx_runtime_1.jsxs)(material_1.Popover, { open: open, anchorEl: anchorRef.current, onClose: () => setOpen(false), anchorOrigin: { horizontal: "left", vertical: "bottom" }, children: [(0, jsx_runtime_1.jsx)(StyleDateRangeWrapper_1.StyleDateRangeWrapper, { children: (0, jsx_runtime_1.jsx)(react_date_range_1.DateRange, { ranges: range, onChange: (ranges) => {
|
|
117
|
+
const selectedRange = ranges.selection;
|
|
118
|
+
setRange([
|
|
119
|
+
{
|
|
120
|
+
endDate: selectedRange?.endDate ?? defaultDate,
|
|
121
|
+
key: "selection",
|
|
122
|
+
startDate: selectedRange?.startDate ?? defaultDate,
|
|
123
|
+
},
|
|
124
|
+
]);
|
|
125
|
+
}, moveRangeOnFirstSelection: false, retainEndDateOnFirstSelection: false }) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { display: "flex", justifyContent: "flex-end", margin: "10px" }, children: (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", size: "small", sx: { fontSize: "12px", height: "22px", minWidth: "40px" }, disableElevation: true, onClick: handleApply, children: "Apply" }) })] })] }));
|
|
126
|
+
};
|
|
127
|
+
exports.DateRangeInput = DateRangeInput;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type StyleDateRangeWrapperProps = {
|
|
2
|
+
children: React.ReactNode;
|
|
3
|
+
};
|
|
4
|
+
export declare const StyleDateRangeWrapper: ({ children, }: StyleDateRangeWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export {};
|
|
6
|
+
//# sourceMappingURL=StyleDateRangeWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StyleDateRangeWrapper.d.ts","sourceRoot":"","sources":["../../../../../src/SmartGrid/Components/SearchFilterRow/DateRangeInput/StyleDateRangeWrapper.tsx"],"names":[],"mappings":"AAAA,KAAK,0BAA0B,GAAG;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,eAEnC,0BAA0B,4CAwH5B,CAAC"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyleDateRangeWrapper = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const StyleDateRangeWrapper = ({ children, }) => {
|
|
6
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "inline-date-range", children: [(0, jsx_runtime_1.jsx)("style", { children: `
|
|
7
|
+
.inline-date-range .rdrCalendarWrapper {
|
|
8
|
+
font-size: 12px;
|
|
9
|
+
width: auto;
|
|
10
|
+
}
|
|
11
|
+
.inline-date-range .rdrDateDisplayWrapper {
|
|
12
|
+
display: none;
|
|
13
|
+
}
|
|
14
|
+
.inline-date-range .rdrMonthAndYearWrapper {
|
|
15
|
+
padding: 10px 12px;
|
|
16
|
+
background: white;
|
|
17
|
+
height: auto;
|
|
18
|
+
}
|
|
19
|
+
.inline-date-range .rdrMonthAndYearPickers {
|
|
20
|
+
display: flex;
|
|
21
|
+
gap: 6px;
|
|
22
|
+
justify-content: center;
|
|
23
|
+
align-items: center;
|
|
24
|
+
}
|
|
25
|
+
.inline-date-range .rdrMonthPicker,
|
|
26
|
+
.inline-date-range .rdrYearPicker {
|
|
27
|
+
margin: 0;
|
|
28
|
+
}
|
|
29
|
+
.inline-date-range .rdrMonthPicker select,
|
|
30
|
+
.inline-date-range .rdrYearPicker select {
|
|
31
|
+
padding: 0px 5px;
|
|
32
|
+
font-size: 12px;
|
|
33
|
+
border: 0px;
|
|
34
|
+
background: white;
|
|
35
|
+
cursor: pointer;
|
|
36
|
+
font-weight: 500;
|
|
37
|
+
}
|
|
38
|
+
.inline-date-range .rdrMonthPicker select:hover,
|
|
39
|
+
.inline-date-range .rdrYearPicker select:hover {
|
|
40
|
+
color: #3b82f6 !important;
|
|
41
|
+
}
|
|
42
|
+
.inline-date-range .rdrMonth {
|
|
43
|
+
padding: 0px 12px;
|
|
44
|
+
width: 200px;
|
|
45
|
+
}
|
|
46
|
+
.inline-date-range .rdrMonthName {
|
|
47
|
+
display: none;
|
|
48
|
+
}
|
|
49
|
+
.inline-date-range .rdrWeekDays {
|
|
50
|
+
margin-bottom: 2px;
|
|
51
|
+
}
|
|
52
|
+
.inline-date-range .rdrWeekDay {
|
|
53
|
+
font-size: 11px;
|
|
54
|
+
font-weight: 600;
|
|
55
|
+
color: #333;
|
|
56
|
+
line-height: 2.2em;
|
|
57
|
+
}
|
|
58
|
+
.inline-date-range .rdrDay {
|
|
59
|
+
font-size: 12px;
|
|
60
|
+
height: 30px;
|
|
61
|
+
line-height: 30px;
|
|
62
|
+
}
|
|
63
|
+
.inline-date-range .rdrDayNumber span {
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
color: #333;
|
|
66
|
+
}
|
|
67
|
+
.inline-date-range .rdrDayToday .rdrDayNumber span:after {
|
|
68
|
+
background: #3b82f6;
|
|
69
|
+
bottom: 2px;
|
|
70
|
+
}
|
|
71
|
+
.inline-date-range .rdrDayPassive .rdrDayNumber span {
|
|
72
|
+
color: #bbb;
|
|
73
|
+
}
|
|
74
|
+
.inline-date-range .rdrStartEdge,
|
|
75
|
+
.inline-date-range .rdrEndEdge {
|
|
76
|
+
background: #3b82f6 !important;
|
|
77
|
+
color: white !important;
|
|
78
|
+
}
|
|
79
|
+
.inline-date-range .rdrInRange {
|
|
80
|
+
background: rgba(59, 131, 246, 0.77) !important;
|
|
81
|
+
}
|
|
82
|
+
.inline-date-range .rdrNextPrevButton {
|
|
83
|
+
background: white;
|
|
84
|
+
border: none;
|
|
85
|
+
width: 20px;
|
|
86
|
+
height: 20px;
|
|
87
|
+
border-radius: 3px;
|
|
88
|
+
margin: 0 2px;
|
|
89
|
+
}
|
|
90
|
+
.inline-date-range .rdrNextPrevButton:hover {
|
|
91
|
+
background: #f5f5f5;
|
|
92
|
+
}
|
|
93
|
+
.inline-date-range .rdrPprevButton i,
|
|
94
|
+
.inline-date-range .rdrNextButton i {
|
|
95
|
+
display: none;
|
|
96
|
+
}
|
|
97
|
+
.inline-date-range .rdrPprevButton::before {
|
|
98
|
+
content: '‹';
|
|
99
|
+
font-size: 18px;
|
|
100
|
+
font-weight: bold;
|
|
101
|
+
color: #666;
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
justify-content: center;
|
|
105
|
+
}
|
|
106
|
+
.inline-date-range .rdrNextButton::before {
|
|
107
|
+
content: '›';
|
|
108
|
+
font-size: 18px;
|
|
109
|
+
font-weight: bold;
|
|
110
|
+
color: #666;
|
|
111
|
+
display: flex;
|
|
112
|
+
align-items: center;
|
|
113
|
+
justify-content: center;
|
|
114
|
+
}
|
|
115
|
+
.inline-date-range .rdrDefinedRangesWrapper {
|
|
116
|
+
display: none;
|
|
117
|
+
}
|
|
118
|
+
` }), children] }));
|
|
119
|
+
};
|
|
120
|
+
exports.StyleDateRangeWrapper = StyleDateRangeWrapper;
|
package/packages/shared-components/dist/SmartGrid/Components/SearchFilterRow/DebouncedInput.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebouncedInput.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/SearchFilterRow/DebouncedInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DebouncedInput.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/SearchFilterRow/DebouncedInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAI/D,KAAK,mBAAmB,GAAG;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;AAExD,eAAO,MAAM,cAAc,GAAI,yFAQ5B,mBAAmB,4CAwCrB,CAAC"}
|