@codezee/sixtify-brahma 0.2.35 → 0.2.37
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/ContentBox/ContentBox.d.ts +3 -0
- package/packages/shared-components/dist/ContentBox/ContentBox.d.ts.map +1 -0
- package/packages/shared-components/dist/ContentBox/ContentBox.js +17 -0
- package/packages/shared-components/dist/ContentBox/index.d.ts +2 -0
- package/packages/shared-components/dist/ContentBox/index.d.ts.map +1 -0
- package/packages/shared-components/dist/ContentBox/index.js +17 -0
- package/packages/shared-components/dist/FilterList/FilterList.d.ts.map +1 -1
- package/packages/shared-components/dist/FilterList/FilterList.js +3 -1
- package/packages/shared-components/dist/FilterList/FilterListV2.d.ts +2 -2
- package/packages/shared-components/dist/FilterList/FilterListV2.d.ts.map +1 -1
- package/packages/shared-components/dist/FilterList/FilterListV2.js +31 -24
- package/packages/shared-components/dist/FilterList/FilterTypeWrapper.d.ts +4 -0
- package/packages/shared-components/dist/FilterList/FilterTypeWrapper.d.ts.map +1 -1
- package/packages/shared-components/dist/FilterList/GetFilterPopupComponent.d.ts.map +1 -1
- package/packages/shared-components/dist/FilterList/GetFilterPopupComponent.js +19 -3
- package/packages/shared-components/dist/Svgs/SvgFilterList.d.ts.map +1 -1
- package/packages/shared-components/dist/Svgs/SvgFilterList.js +1 -1
- package/packages/shared-components/dist/index.d.ts +1 -0
- package/packages/shared-components/dist/index.d.ts.map +1 -1
- package/packages/shared-components/dist/index.js +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContentBox.d.ts","sourceRoot":"","sources":["../../src/ContentBox/ContentBox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,eAAO,MAAM,UAAU,GAAI,cAAc,iBAAiB,4CAkBzD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ContentBox = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const ContentBox = ({ children }) => {
|
|
7
|
+
const theme = (0, material_1.useTheme)();
|
|
8
|
+
const { iron, butterflyBlue } = theme.palette.app.color;
|
|
9
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
|
|
10
|
+
background: iron[600],
|
|
11
|
+
border: `1px solid ${butterflyBlue[300]}`,
|
|
12
|
+
borderRadius: "6px",
|
|
13
|
+
height: "100%",
|
|
14
|
+
width: "100%",
|
|
15
|
+
}, children: children }));
|
|
16
|
+
};
|
|
17
|
+
exports.ContentBox = ContentBox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ContentBox/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ContentBox"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterList.d.ts","sourceRoot":"","sources":["../../src/FilterList/FilterList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterList.d.ts","sourceRoot":"","sources":["../../src/FilterList/FilterList.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,MAAM,MAAM,eAAe,GAAG;IAC5B,eAAe,EAAE,cAAc,EAAE,CAAC;CACnC,CAAC;AACF,eAAO,MAAM,UAAU,GAAI,qBAAqB,eAAe,4CAoK9D,CAAC"}
|
|
@@ -9,6 +9,7 @@ const Button_1 = require("../Button");
|
|
|
9
9
|
const FilterPill_1 = require("../Chips/FilterPill");
|
|
10
10
|
const SvgFilterList_1 = require("../Svgs/SvgFilterList");
|
|
11
11
|
const Tooltip_1 = require("../Tooltip");
|
|
12
|
+
const FilterListV2_1 = require("./FilterListV2");
|
|
12
13
|
const FilterPopup_1 = require("./FilterPopup");
|
|
13
14
|
const FilterPopupWrapper_1 = require("./FilterPopupWrapper");
|
|
14
15
|
const FilterTypeWrapper_1 = require("./FilterTypeWrapper");
|
|
@@ -27,7 +28,8 @@ const FilterList = ({ filterListItems }) => {
|
|
|
27
28
|
setOpenFilterPopup(false);
|
|
28
29
|
setCurrentFilter(null);
|
|
29
30
|
handleClose();
|
|
30
|
-
|
|
31
|
+
const filteredData = (0, FilterListV2_1.formatFilterData)(data, filterListItems);
|
|
32
|
+
setFilterListData(filteredData);
|
|
31
33
|
};
|
|
32
34
|
const handleClick = (event) => {
|
|
33
35
|
setAnchorEl(event.currentTarget);
|
|
@@ -8,7 +8,7 @@ export type FilterListV2Props = {
|
|
|
8
8
|
onChange: (data: FieldValues, isPopup: boolean) => void;
|
|
9
9
|
onClear: () => void;
|
|
10
10
|
resetFormBasedOnFields?: string;
|
|
11
|
-
dateKeys?: string[];
|
|
12
11
|
};
|
|
13
|
-
export declare
|
|
12
|
+
export declare function formatFilterData(data: FieldValues, filterListItems: FilterListType[]): Record<string, FieldValues>;
|
|
13
|
+
export declare const FilterListV2: ({ filterListItems, isDisabled, filterListData, onApply, onClear, onChange, }: FilterListV2Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
//# sourceMappingURL=FilterListV2.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterListV2.d.ts","sourceRoot":"","sources":["../../src/FilterList/FilterListV2.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FilterListV2.d.ts","sourceRoot":"","sources":["../../src/FilterList/FilterListV2.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAenD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,WAAW,CAAC;IAC7B,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,WAAW,EACjB,eAAe,EAAE,cAAc,EAAE,GAChC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAiB7B;AAED,eAAO,MAAM,YAAY,GAAI,8EAO1B,iBAAiB,4CAskBnB,CAAC"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.FilterListV2 = void 0;
|
|
7
|
+
exports.formatFilterData = formatFilterData;
|
|
4
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
9
|
/* eslint-disable sonarjs/no-nested-functions */
|
|
6
10
|
/* eslint-disable sonarjs/no-nested-conditional */
|
|
@@ -11,6 +15,7 @@ const icons_material_1 = require("@mui/icons-material");
|
|
|
11
15
|
const material_1 = require("@mui/material");
|
|
12
16
|
const icons_1 = require("@mui/x-date-pickers/icons");
|
|
13
17
|
const lodash_1 = require("lodash");
|
|
18
|
+
const isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
14
19
|
const luxon_1 = require("luxon");
|
|
15
20
|
const react_1 = require("react");
|
|
16
21
|
const react_hook_form_1 = require("react-hook-form");
|
|
@@ -26,7 +31,19 @@ const Tooltip_1 = require("../Tooltip");
|
|
|
26
31
|
const FilterPopupWrapper_1 = require("./FilterPopupWrapper");
|
|
27
32
|
const GetFilterPopupComponent_1 = require("./GetFilterPopupComponent");
|
|
28
33
|
const getFormData_1 = require("./getFormData");
|
|
29
|
-
|
|
34
|
+
function formatFilterData(data, filterListItems) {
|
|
35
|
+
return Object.fromEntries(Object.entries(data).flatMap(([key, value]) => {
|
|
36
|
+
if (value) {
|
|
37
|
+
const config = filterListItems.find((item) => item.key === key);
|
|
38
|
+
const formattedValue = config?.monthYearFormat && typeof value === "string"
|
|
39
|
+
? luxon_1.DateTime.fromISO(value).toFormat("yyyy-MM")
|
|
40
|
+
: value;
|
|
41
|
+
return [[key, formattedValue]];
|
|
42
|
+
}
|
|
43
|
+
return [];
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onApply, onClear, onChange, }) => {
|
|
30
47
|
const theme = (0, material_1.useTheme)();
|
|
31
48
|
const { iron, slate } = theme.palette.app.color;
|
|
32
49
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
@@ -35,7 +52,6 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
|
|
|
35
52
|
const [openFilterPopup, setOpenFilterPopup] = (0, react_1.useState)(false);
|
|
36
53
|
const [datePickerPopup, setDatePickerPopup] = (0, react_1.useState)(false);
|
|
37
54
|
const [currentFilter, setCurrentFilter] = (0, react_1.useState)(null);
|
|
38
|
-
const [expandedKeys, setExpandedKeys] = (0, react_1.useState)([]);
|
|
39
55
|
const handleDateRange = (filter) => {
|
|
40
56
|
setCurrentFilter(filter);
|
|
41
57
|
setDatePickerPopup(true);
|
|
@@ -114,20 +130,13 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
|
|
|
114
130
|
const onSubmit = (data) => {
|
|
115
131
|
setOpenFilterPopup(false);
|
|
116
132
|
setCurrentFilter(null);
|
|
117
|
-
const filteredData =
|
|
133
|
+
const filteredData = formatFilterData(data, filterListItems);
|
|
118
134
|
onApply(filteredData, openFilterPopup, currentFilter?.key);
|
|
119
135
|
handleClose();
|
|
120
136
|
};
|
|
121
137
|
const handleDateRangeSubmit = () => {
|
|
122
138
|
setDatePickerPopup(false);
|
|
123
139
|
};
|
|
124
|
-
const onError = (error) => {
|
|
125
|
-
const errorKeys = Object.keys(error);
|
|
126
|
-
const tabsToExpand = filterListItems
|
|
127
|
-
.filter((filter) => filter.required && errorKeys.includes(filter.key))
|
|
128
|
-
.map((filter) => filter.key);
|
|
129
|
-
setExpandedKeys(tabsToExpand);
|
|
130
|
-
};
|
|
131
140
|
const getFilterItem = (key) => {
|
|
132
141
|
return filterListItems.find((item) => item.key === key);
|
|
133
142
|
};
|
|
@@ -163,13 +172,14 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
|
|
|
163
172
|
}
|
|
164
173
|
}, [company_id]);
|
|
165
174
|
(0, react_1.useMemo)(() => {
|
|
166
|
-
if (business_unit_id
|
|
175
|
+
if (!(0, isEqual_1.default)(business_unit_id, filterListData?.business_unit_id) &&
|
|
167
176
|
!openFilterPopup) {
|
|
168
177
|
setValue("business_unit_location_id", null);
|
|
169
178
|
}
|
|
170
179
|
}, [business_unit_id]);
|
|
171
180
|
(0, react_1.useMemo)(() => {
|
|
172
|
-
if (department_id
|
|
181
|
+
if (!(0, isEqual_1.default)(department_id, filterListData?.department_id) &&
|
|
182
|
+
!openFilterPopup) {
|
|
173
183
|
setValue("sub_department_id", null);
|
|
174
184
|
}
|
|
175
185
|
}, [department_id]);
|
|
@@ -184,10 +194,7 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
|
|
|
184
194
|
return;
|
|
185
195
|
}
|
|
186
196
|
const item = getFilterItem(key);
|
|
187
|
-
const keyValue = item &&
|
|
188
|
-
(0, getFormData_1.getFormValue)(dateKeys?.includes(item?.key)
|
|
189
|
-
? luxon_1.DateTime.fromISO(value).toFormat(FormFields_1.dateFormats.dateWithEuropean)
|
|
190
|
-
: value, item);
|
|
197
|
+
const keyValue = item && (0, getFormData_1.getFormValue)(value, item);
|
|
191
198
|
if (typeof value !== "boolean" && !keyValue) {
|
|
192
199
|
return;
|
|
193
200
|
}
|
|
@@ -196,6 +203,10 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
|
|
|
196
203
|
, {
|
|
197
204
|
// eslint-disable-next-line sonarjs/no-base-to-string
|
|
198
205
|
toolTipLabel: `${keyValue}`, children: `${item?.label}: ${keyValue}` }), onDelete: () => handleDelete(key), onClick: (e) => {
|
|
206
|
+
if (key === "company_id" &&
|
|
207
|
+
filterListItems?.some(({ required }) => required)) {
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
199
210
|
setOpenFilterPopup(true);
|
|
200
211
|
filterPopupAnchorElm.current = e.currentTarget;
|
|
201
212
|
const item = getFilterItem(key);
|
|
@@ -221,7 +232,7 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
|
|
|
221
232
|
if (!shouldFormSubmit) {
|
|
222
233
|
handleSubmit((data) => {
|
|
223
234
|
onSubmit(data);
|
|
224
|
-
}
|
|
235
|
+
})();
|
|
225
236
|
}
|
|
226
237
|
}, onKeyDown: (e) => {
|
|
227
238
|
if (e.key === "Enter") {
|
|
@@ -229,7 +240,7 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
|
|
|
229
240
|
if (!shouldFormSubmit) {
|
|
230
241
|
handleSubmit((data) => {
|
|
231
242
|
onSubmit(data);
|
|
232
|
-
}
|
|
243
|
+
})();
|
|
233
244
|
}
|
|
234
245
|
}
|
|
235
246
|
}, children: (0, jsx_runtime_1.jsxs)(material_1.Drawer, { open: open, onClose: (_event, reason) => {
|
|
@@ -247,11 +258,7 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
|
|
|
247
258
|
}, children: [(0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: { padding: "10px 30px" }, children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", justifyContent: "space-between", width: "100%", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "h6", children: "Filter" }), (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: () => {
|
|
248
259
|
reset();
|
|
249
260
|
handleClose();
|
|
250
|
-
}, children: (0, jsx_runtime_1.jsx)(icons_1.ClearIcon, {}) })] }) }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: { width: "100%" } })] }), (0, jsx_runtime_1.jsx)(material_1.Stack, { flexGrow: 1, sx: { overflowX: "hidden" }, children: filterListItems.map((filter) => filter.type === "switch" ? ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", width: "80%", sx: { padding: "10px 5px 10px 20px ", margin: "auto" }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", children: filter.label }), (0, jsx_runtime_1.jsx)(Switch_1.Switch, { control: control, name: filter.key })] }, filter.key)) : ((0, jsx_runtime_1.jsxs)(material_1.Accordion, { defaultExpanded: !!filterListData?.[filter.key]
|
|
251
|
-
setExpandedKeys((prev) => prev.includes(filter.key)
|
|
252
|
-
? prev.filter((k) => k !== filter.key)
|
|
253
|
-
: [...prev, filter.key]);
|
|
254
|
-
}, sx: {
|
|
261
|
+
}, children: (0, jsx_runtime_1.jsx)(icons_1.ClearIcon, {}) })] }) }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: { width: "100%" } })] }), (0, jsx_runtime_1.jsx)(material_1.Stack, { flexGrow: 1, sx: { overflowX: "hidden" }, children: filterListItems.map((filter) => filter.type === "switch" ? ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", width: "80%", sx: { padding: "10px 5px 10px 20px ", margin: "auto" }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", children: filter.label }), (0, jsx_runtime_1.jsx)(Switch_1.Switch, { control: control, name: filter.key })] }, filter.key)) : ((0, jsx_runtime_1.jsxs)(material_1.Accordion, { defaultExpanded: !!filterListData?.[filter.key] || filter.required, disabled: filter.isDisabled, sx: {
|
|
255
262
|
"&.MuiAccordion-root.Mui-expanded": {
|
|
256
263
|
margin: "0 !important",
|
|
257
264
|
},
|
|
@@ -296,7 +303,7 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
|
|
|
296
303
|
watch(filter.key)[1]
|
|
297
304
|
? luxon_1.DateTime.fromISO(watch(filter.key)[1]).toFormat(FormFields_1.dateFormats.dateWithEuropean)
|
|
298
305
|
: "End Date" }) })] })) : ((0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, GetFilterPopupComponent_1.getFilterPopupComponent)(filter, control, errors)[filter.type] })) }) })] }, filter.key))) }), (0, jsx_runtime_1.jsx)(material_1.Divider, { sx: { width: "100%", position: "absolute", bottom: "70px" } }), (0, jsx_runtime_1.jsx)(material_1.Stack, { height: "70px", children: (0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: { padding: "10px" }, children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", gap: "10px", sx: { position: "absolute", bottom: "15px" }, children: [(0, jsx_runtime_1.jsx)(Button_1.Button, { type: "submit", disabled: shouldFormSubmit, variant: "contained", onClick: () => {
|
|
299
|
-
handleSubmit(onSubmit
|
|
306
|
+
handleSubmit(onSubmit)();
|
|
300
307
|
}, children: "Apply" }), (0, jsx_runtime_1.jsx)(Button_1.Button, { type: "button", onClick: () => handlerReset(), disabled: Object.keys(formData).every((key) => !formData[key]), variant: "outlined", children: "Reset" })] }) }) })] }) }), currentFilter && ((0, jsx_runtime_1.jsx)(FilterPopupWrapper_1.FilterPopupWrapper, { open: openFilterPopup, onClose: handleCloseFilterPopup, onApply: () => {
|
|
301
308
|
handleSubmit(onSubmit)();
|
|
302
309
|
}, control: control, errors: errors, reset: reset, anchorEl: filterPopupAnchorElm.current, filterItem: currentFilter, currentFilterValue: currentFilterValue })), currentFilter && ((0, jsx_runtime_1.jsx)(FilterPopupWrapper_1.FilterPopUpDateRangeWrapper, { open: datePickerPopup, onClose: handleCloseDatePickerPopup, onApply: () => {
|
|
@@ -5,6 +5,8 @@ type Options = readonly {
|
|
|
5
5
|
value: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
avatar?: string;
|
|
8
|
+
employee_code?: string;
|
|
9
|
+
punch_code?: string;
|
|
8
10
|
}[];
|
|
9
11
|
export type FilterListType = {
|
|
10
12
|
label: string;
|
|
@@ -16,6 +18,8 @@ export type FilterListType = {
|
|
|
16
18
|
options?: Options;
|
|
17
19
|
multiSelect?: boolean;
|
|
18
20
|
required?: boolean;
|
|
21
|
+
monthYearFormat?: boolean;
|
|
22
|
+
employeeAutocomplete?: boolean;
|
|
19
23
|
};
|
|
20
24
|
type FilterTypeWrapperProps = {
|
|
21
25
|
filter: FilterListType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilterTypeWrapper.d.ts","sourceRoot":"","sources":["../../src/FilterList/FilterTypeWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG5D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,MAAM,GACN,MAAM,GACN,WAAW,GACX,UAAU,GACV,OAAO,GACP,QAAQ,CAAC;AAEb,KAAK,OAAO,GAAG,SAAS;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"FilterTypeWrapper.d.ts","sourceRoot":"","sources":["../../src/FilterList/FilterTypeWrapper.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAG5D,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,MAAM,GACN,MAAM,GACN,WAAW,GACX,UAAU,GACV,OAAO,GACP,QAAQ,CAAC;AAEb,KAAK,OAAO,GAAG,SAAS;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,EAAE,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC;AACF,KAAK,sBAAsB,GAAG;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;CAC/B,CAAC;AACF,eAAO,MAAM,iBAAiB,GAAI,sBAG/B,sBAAsB,4CAqBxB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GetFilterPopupComponent.d.ts","sourceRoot":"","sources":["../../src/FilterList/GetFilterPopupComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAOzE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"GetFilterPopupComponent.d.ts","sourceRoot":"","sources":["../../src/FilterList/GetFilterPopupComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAOzE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAQ1D,eAAO,MAAM,uBAAuB,GAClC,gBAAgB,cAAc,EAC9B,SAAS,OAAO,CAAC,WAAW,CAAC,EAC7B,QAAQ,WAAW,CAAC,WAAW,CAAC,KAC/B,wBAsGF,CAAC"}
|
|
@@ -6,7 +6,7 @@ const material_1 = require("@mui/material");
|
|
|
6
6
|
const FormFields_1 = require("../FormFields");
|
|
7
7
|
const getFilterPopupComponent = (selectedFilter, control, errors) => {
|
|
8
8
|
const theme = (0, material_1.useTheme)();
|
|
9
|
-
const { sapphireBlue, black } = theme.palette.app.color;
|
|
9
|
+
const { iron, sapphireBlue, black } = theme.palette.app.color;
|
|
10
10
|
const errorSelectedKey = errors[selectedFilter.key];
|
|
11
11
|
return {
|
|
12
12
|
autoComplete: selectedFilter.options && ((0, jsx_runtime_1.jsx)(FormFields_1.Autocomplete, { disableClearable: true, multiple: selectedFilter.multiSelect ?? false, placeholder: `Select ${selectedFilter.label}`, name: `${selectedFilter.key}`, disabled: selectedFilter.isDisabled, shouldCloseOnSelect: selectedFilter.multiSelect ?? false, control: control, options: selectedFilter.options ?? [], sx: {
|
|
@@ -17,9 +17,25 @@ const getFilterPopupComponent = (selectedFilter, control, errors) => {
|
|
|
17
17
|
backgroundColor: sapphireBlue[300],
|
|
18
18
|
color: black[900],
|
|
19
19
|
},
|
|
20
|
-
},
|
|
20
|
+
}, ...(selectedFilter.employeeAutocomplete && {
|
|
21
|
+
isShowAvatar: true,
|
|
22
|
+
isShowSelectAll: false,
|
|
23
|
+
renderOption: (props, option) => {
|
|
24
|
+
const { key, ...optionProps } = props;
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)("li", { ...optionProps, children: (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", gap: "10px", alignItems: "center", children: [option.avatar && ((0, jsx_runtime_1.jsx)(material_1.Avatar, { sx: { width: 30, height: 30 }, src: option.avatar, alt: option.label })), (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: `${option.label} (${option.employee_code})` }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", color: iron[800], children: option.punch_code })] })] }) }, key));
|
|
26
|
+
},
|
|
27
|
+
getOptionLabel: (option) => {
|
|
28
|
+
if (typeof option === "string") {
|
|
29
|
+
return option;
|
|
30
|
+
}
|
|
31
|
+
return `${option.label} (${option.employee_code}) - ${option.punch_code}`;
|
|
32
|
+
},
|
|
33
|
+
}), error: !!errorSelectedKey, helperText: errorSelectedKey?.message })),
|
|
21
34
|
text: ((0, jsx_runtime_1.jsx)(FormFields_1.TextField, { name: selectedFilter.key, control: control, disabled: selectedFilter.isDisabled, placeholder: selectedFilter.label, error: !!errorSelectedKey, helperText: errorSelectedKey?.message })),
|
|
22
|
-
date: ((0, jsx_runtime_1.jsx)(FormFields_1.DatePicker, { name: selectedFilter.key, control: control, disabled: selectedFilter.isDisabled, error: !!errorSelectedKey, helperText: errorSelectedKey?.message
|
|
35
|
+
date: ((0, jsx_runtime_1.jsx)(FormFields_1.DatePicker, { name: selectedFilter.key, control: control, disabled: selectedFilter.isDisabled, error: !!errorSelectedKey, helperText: errorSelectedKey?.message, ...(selectedFilter.monthYearFormat && {
|
|
36
|
+
format: "MMM yyyy",
|
|
37
|
+
views: ["year", "month"],
|
|
38
|
+
}) })),
|
|
23
39
|
dateRange: ((0, jsx_runtime_1.jsx)(FormFields_1.DateRangePicker, { name: selectedFilter.key, control: control, disabled: selectedFilter.isDisabled, error: !!errorSelectedKey, helperText: errorSelectedKey?.message })),
|
|
24
40
|
};
|
|
25
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SvgFilterList.d.ts","sourceRoot":"","sources":["../../src/Svgs/SvgFilterList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,eAAO,MAAM,aAAa,GAAI,OAAO,YAAY,
|
|
1
|
+
{"version":3,"file":"SvgFilterList.d.ts","sourceRoot":"","sources":["../../src/Svgs/SvgFilterList.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,eAAO,MAAM,aAAa,GAAI,OAAO,YAAY,4CAkBhD,CAAC"}
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SvgFilterList = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const SvgFilterList = (props) => ((0, jsx_runtime_1.jsxs)("svg", { width: "38", height: "38", viewBox: "0 0 36 36", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("rect", { x: "0.5", y: "0.5", width: "
|
|
5
|
+
const SvgFilterList = (props) => ((0, jsx_runtime_1.jsxs)("svg", { width: "38", height: "38", viewBox: "0 0 36 36", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("rect", { x: "0.5", y: "0.5", width: "33", height: "33", rx: "3.5", stroke: "#BCBFC2" }), (0, jsx_runtime_1.jsx)("path", { d: "M10.5 13.8333V11.5C10.5 10.9477 10.9478 10.5 11.5 10.5H24.5001C25.0524 10.5 25.5001 10.9477 25.5001 11.4999L25.5004 13.8333M10.5 13.8333L15.9842 18.534C16.2058 18.724 16.3334 19.0013 16.3334 19.2933V24.2192C16.3334 24.8698 16.9448 25.3472 17.5759 25.1894L18.9092 24.856C19.3544 24.7447 19.6667 24.3448 19.6667 23.8859V19.2933C19.6667 19.0014 19.7943 18.724 20.0159 18.534L25.5004 13.8333M10.5 13.8333H25.5004", stroke: "#151E28", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
6
6
|
exports.SvgFilterList = SvgFilterList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC"}
|
|
@@ -22,6 +22,7 @@ __exportStar(require("./Button"), exports);
|
|
|
22
22
|
__exportStar(require("./Card"), exports);
|
|
23
23
|
__exportStar(require("./Charts"), exports);
|
|
24
24
|
__exportStar(require("./Chips"), exports);
|
|
25
|
+
__exportStar(require("./ContentBox"), exports);
|
|
25
26
|
__exportStar(require("./Dialog"), exports);
|
|
26
27
|
__exportStar(require("./Drawer"), exports);
|
|
27
28
|
__exportStar(require("./FilterList"), exports);
|