@codezee/sixtify-brahma 0.2.45 → 0.2.48

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.
Files changed (21) hide show
  1. package/package.json +1 -1
  2. package/packages/shared-components/dist/FilterList/FilterListV2.d.ts.map +1 -1
  3. package/packages/shared-components/dist/FilterList/FilterListV2.js +27 -10
  4. package/packages/shared-components/dist/FilterList/FilterPopupWrapper.d.ts.map +1 -1
  5. package/packages/shared-components/dist/FilterList/FilterPopupWrapper.js +10 -2
  6. package/packages/shared-components/dist/FilterList/GetFilterPopupComponent.d.ts +8 -1
  7. package/packages/shared-components/dist/FilterList/GetFilterPopupComponent.d.ts.map +1 -1
  8. package/packages/shared-components/dist/FilterList/GetFilterPopupComponent.js +4 -5
  9. package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.d.ts.map +1 -1
  10. package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.js +2 -32
  11. package/packages/shared-components/dist/FormFields/DateRangeSelector/DateRangeSelector.d.ts.map +1 -1
  12. package/packages/shared-components/dist/FormFields/DateRangeSelector/DateRangeSelector.js +12 -10
  13. package/packages/shared-components/dist/Tab/Tabs.d.ts +1 -0
  14. package/packages/shared-components/dist/Tab/Tabs.d.ts.map +1 -1
  15. package/packages/shared-components/dist/Tab/Tabs.js +3 -2
  16. package/packages/shared-components/dist/utils/index.d.ts +1 -0
  17. package/packages/shared-components/dist/utils/index.d.ts.map +1 -1
  18. package/packages/shared-components/dist/utils/index.js +1 -0
  19. package/packages/shared-components/dist/utils/regex.d.ts +3 -0
  20. package/packages/shared-components/dist/utils/regex.d.ts.map +1 -0
  21. package/packages/shared-components/dist/utils/regex.js +5 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codezee/sixtify-brahma",
3
- "version": "0.2.45",
3
+ "version": "0.2.48",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hardikranpariya/sixtify-brahma.git"
@@ -1 +1 @@
1
- {"version":3,"file":"FilterListV2.d.ts","sourceRoot":"","sources":["../../src/FilterList/FilterListV2.tsx"],"names":[],"mappings":"AA0BA,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,4CA0lBnB,CAAC"}
1
+ {"version":3,"file":"FilterListV2.d.ts","sourceRoot":"","sources":["../../src/FilterList/FilterListV2.tsx"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAgBnD,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,4CAwmBnB,CAAC"}
@@ -31,6 +31,7 @@ const Switch_1 = require("../FormFields/Switch");
31
31
  const PadBox_1 = require("../PadBox");
32
32
  const Toast_1 = require("../Toast");
33
33
  const Tooltip_1 = require("../Tooltip");
34
+ const utils_1 = require("../utils");
34
35
  const FilterPopupWrapper_1 = require("./FilterPopupWrapper");
35
36
  const GetFilterPopupComponent_1 = require("./GetFilterPopupComponent");
36
37
  const getFormData_1 = require("./getFormData");
@@ -55,7 +56,7 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
55
56
  const [openFilterPopup, setOpenFilterPopup] = (0, react_1.useState)(false);
56
57
  const [datePickerPopup, setDatePickerPopup] = (0, react_1.useState)(false);
57
58
  const [currentFilter, setCurrentFilter] = (0, react_1.useState)(null);
58
- const [expandedAccordions, setExpandedAccordions] = (0, react_1.useState)({});
59
+ const [isPopupOpen, setIsPopupOpen] = (0, react_1.useState)(false);
59
60
  const handleDateRange = (filter) => {
60
61
  setCurrentFilter(filter);
61
62
  setDatePickerPopup(true);
@@ -192,6 +193,18 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
192
193
  return ((0, lodash_1.isEmpty)(dirtyFields) ||
193
194
  Object.keys(formData).every((key) => !formData[key]));
194
195
  }, [formData, dirtyFields]);
196
+ function formatKeyValue(keyValue) {
197
+ if (Array.isArray(keyValue)) {
198
+ return keyValue.join(", ");
199
+ }
200
+ if (utils_1.monthYearRegex.test(keyValue)) {
201
+ return luxon_1.DateTime.fromFormat(keyValue, "yyyy-MM").toFormat("MMM yyyy");
202
+ }
203
+ if (utils_1.isoDateRegex.test(keyValue)) {
204
+ return luxon_1.DateTime.fromFormat(keyValue, "yyyy-MM-dd").toFormat("dd-MM-yyyy");
205
+ }
206
+ return keyValue;
207
+ }
195
208
  const renderChips = (data) => {
196
209
  return Object.entries(data).map(([key, value]) => {
197
210
  if (typeof value !== "boolean" && !value) {
@@ -199,14 +212,17 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
199
212
  }
200
213
  const item = getFilterItem(key);
201
214
  const keyValue = item && (0, getFormData_1.getFormValue)(value, item);
202
- if (typeof value !== "boolean" && !keyValue) {
215
+ const formattedValue = formatKeyValue(typeof keyValue === "object"
216
+ ? JSON.stringify(keyValue)
217
+ : String(keyValue));
218
+ if (typeof value !== "boolean" && !formattedValue) {
203
219
  return;
204
220
  }
205
221
  return ((0, jsx_runtime_1.jsx)(FilterPill_1.FilterPill, { ref: filterPopupAnchorElm, label: (0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip
206
222
  // eslint-disable-next-line sonarjs/no-base-to-string
207
223
  , {
208
224
  // eslint-disable-next-line sonarjs/no-base-to-string
209
- toolTipLabel: `${keyValue}`, children: `${item?.label}: ${keyValue}` }), onDelete: () => handleDelete(key), onClick: (e) => {
225
+ toolTipLabel: `${formattedValue}`, children: `${item?.label}: ${formattedValue}` }), onDelete: () => handleDelete(key), onClick: (e) => {
210
226
  if (key === "company_id" &&
211
227
  filterListItems?.some(({ required }) => required)) {
212
228
  return;
@@ -241,8 +257,7 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
241
257
  }, onKeyDown: (e) => {
242
258
  if (e.key === "Enter") {
243
259
  e.preventDefault();
244
- if (!Object.values(expandedAccordions).some(Boolean) &&
245
- !shouldFormSubmit) {
260
+ if (!isPopupOpen && !shouldFormSubmit) {
246
261
  handleSubmit((data) => {
247
262
  onSubmit(data);
248
263
  })();
@@ -263,10 +278,7 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
263
278
  }, 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: () => {
264
279
  reset();
265
280
  handleClose();
266
- }, 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, onChange: (_, isExpanded) => setExpandedAccordions((prev) => ({
267
- ...prev,
268
- [filter.key]: isExpanded,
269
- })), sx: {
281
+ }, 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: {
270
282
  "&.MuiAccordion-root.Mui-expanded": {
271
283
  margin: "0 !important",
272
284
  },
@@ -310,7 +322,12 @@ const FilterListV2 = ({ filterListItems, isDisabled = false, filterListData, onA
310
322
  }, children: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", children: Array.isArray(watch(filter.key)) &&
311
323
  watch(filter.key)[1]
312
324
  ? luxon_1.DateTime.fromISO(watch(filter.key)[1]).toFormat(FormFields_1.dateFormats.dateWithEuropean)
313
- : "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: () => {
325
+ : "End Date" }) })] })) : ((0, jsx_runtime_1.jsx)(material_1.Box, { children: (0, GetFilterPopupComponent_1.getFilterPopupComponent)({
326
+ selectedFilter: filter,
327
+ control,
328
+ errors,
329
+ setIsPopupOpen,
330
+ })[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: () => {
314
331
  handleSubmit(onSubmit)();
315
332
  }, 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: () => {
316
333
  handleSubmit(onSubmit)();
@@ -1 +1 @@
1
- {"version":3,"file":"FilterPopupWrapper.d.ts","sourceRoot":"","sources":["../../src/FilterList/FilterPopupWrapper.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAKzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,KAAK,sBAAsB,GAAG,iBAAiB,CAAC,YAAY,CAAC,GAAG;IAC9D,UAAU,EAAE,cAAc,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9B,MAAM,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IAC9C,OAAO,EAAE,MAA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E,cAAc,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9B,MAAM,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACjC,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC;IAC9C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;CACpB,CAAC;AAEF,KAAK,gCAAgC,GAAG,iBAAiB,CAAC,YAAY,CAAC,GAAG;IACxE,UAAU,EAAE,cAAc,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9B,MAAM,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,YAAY,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAC3B,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC;IAClB,IAAI,EAAE,GAAG,CAAC,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACxB,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,+FAUhC,sBAAsB,4CAyCxB,CAAC;AAEF,eAAO,MAAM,2BAA2B,GAAI,oEAQzC,gCAAgC,4CAwBlC,CAAC"}
@@ -9,10 +9,18 @@ const DateRangePickerPopUp_1 = require("./DateRangePickerPopUp");
9
9
  const FilterPopup_1 = require("./FilterPopup");
10
10
  const GetFilterPopupComponent_1 = require("./GetFilterPopupComponent");
11
11
  const FilterPopupWrapper = ({ open, anchorEl, filterItem, onClose, control, errors, onApply, currentFilterValue, reset, }) => {
12
- return ((0, jsx_runtime_1.jsx)(FilterPopup_1.FilterPopup, { title: filterItem.label, required: filterItem.required, filterItem: filterItem, open: open, onClose: onClose, anchorEl: anchorEl, onApply: onApply, currentFilterValue: currentFilterValue, reset: reset, showFooter: true, showDivider: true, background: true, children: (0, jsx_runtime_1.jsxs)(PadBox_1.PadBox, { padding: { padding: "10px" }, children: [(0, GetFilterPopupComponent_1.getFilterPopupComponent)(filterItem, control, errors)[filterItem.type], filterItem.type === "switch" && ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { padding: "10px 5px 10px 20px", margin: "auto" }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", children: filterItem.label }), (0, jsx_runtime_1.jsx)(FormFields_1.Switch, { control: control, name: filterItem.key })] }, filterItem.key))] }) }));
12
+ return ((0, jsx_runtime_1.jsx)(FilterPopup_1.FilterPopup, { title: filterItem.label, required: filterItem.required, filterItem: filterItem, open: open, onClose: onClose, anchorEl: anchorEl, onApply: onApply, currentFilterValue: currentFilterValue, reset: reset, showFooter: true, showDivider: true, background: true, children: (0, jsx_runtime_1.jsxs)(PadBox_1.PadBox, { padding: { padding: "10px" }, children: [(0, GetFilterPopupComponent_1.getFilterPopupComponent)({
13
+ selectedFilter: filterItem,
14
+ control,
15
+ errors,
16
+ })[filterItem.type], filterItem.type === "switch" && ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", sx: { padding: "10px 5px 10px 20px", margin: "auto" }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", children: filterItem.label }), (0, jsx_runtime_1.jsx)(FormFields_1.Switch, { control: control, name: filterItem.key })] }, filterItem.key))] }) }));
13
17
  };
14
18
  exports.FilterPopupWrapper = FilterPopupWrapper;
15
19
  const FilterPopUpDateRangeWrapper = ({ open, anchorEl, filterItem, onClose, control, errors, onApply, }) => {
16
- return ((0, jsx_runtime_1.jsx)(DateRangePickerPopUp_1.DateRangePickerPopUp, { title: filterItem.label, required: filterItem.required, open: open, onClose: onClose, anchorEl: anchorEl, onApply: onApply, showFooter: true, showDivider: true, background: true, children: (0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: { padding: "10px" }, children: (0, GetFilterPopupComponent_1.getFilterPopupComponent)(filterItem, control, errors)[filterItem.type] }) }));
20
+ return ((0, jsx_runtime_1.jsx)(DateRangePickerPopUp_1.DateRangePickerPopUp, { title: filterItem.label, required: filterItem.required, open: open, onClose: onClose, anchorEl: anchorEl, onApply: onApply, showFooter: true, showDivider: true, background: true, children: (0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: { padding: "10px" }, children: (0, GetFilterPopupComponent_1.getFilterPopupComponent)({
21
+ selectedFilter: filterItem,
22
+ control,
23
+ errors,
24
+ })[filterItem.type] }) }));
17
25
  };
18
26
  exports.FilterPopUpDateRangeWrapper = FilterPopUpDateRangeWrapper;
@@ -1,5 +1,12 @@
1
1
  import type { Control, FieldErrors, FieldValues } from "react-hook-form";
2
2
  import type { FilterPopupComponentType } from "./FilterPopupWrapper";
3
3
  import type { FilterListType } from "./FilterTypeWrapper";
4
- export declare const getFilterPopupComponent: (selectedFilter: FilterListType, control: Control<FieldValues>, errors: FieldErrors<FieldValues>) => FilterPopupComponentType;
4
+ type GetFilterPopupComponentArgs = {
5
+ selectedFilter: FilterListType;
6
+ control: Control<FieldValues>;
7
+ errors: FieldErrors<FieldValues>;
8
+ setIsPopupOpen?: (isOpen: boolean) => void;
9
+ };
10
+ export declare function getFilterPopupComponent({ selectedFilter, control, errors, setIsPopupOpen, }: GetFilterPopupComponentArgs): FilterPopupComponentType;
11
+ export {};
5
12
  //# sourceMappingURL=GetFilterPopupComponent.d.ts.map
@@ -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;AAQ1D,eAAO,MAAM,uBAAuB,GAClC,gBAAgB,cAAc,EAC9B,SAAS,OAAO,CAAC,WAAW,CAAC,EAC7B,QAAQ,WAAW,CAAC,WAAW,CAAC,KAC/B,wBA0EF,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,KAAK,2BAA2B,GAAG;IACjC,cAAc,EAAE,cAAc,CAAC;IAC/B,OAAO,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC;IAC9B,MAAM,EAAE,WAAW,CAAC,WAAW,CAAC,CAAC;IACjC,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,EACtC,cAAc,EACd,OAAO,EACP,MAAM,EACN,cAAc,GACf,EAAE,2BAA2B,GAAG,wBAAwB,CA4ExD"}
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getFilterPopupComponent = void 0;
3
+ exports.getFilterPopupComponent = getFilterPopupComponent;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
6
  const FormFields_1 = require("../FormFields");
7
- const getFilterPopupComponent = (selectedFilter, control, errors) => {
7
+ function getFilterPopupComponent({ selectedFilter, control, errors, setIsPopupOpen, }) {
8
8
  const theme = (0, material_1.useTheme)();
9
9
  const { sapphireBlue, black } = theme.palette.app.color;
10
10
  const errorSelectedKey = errors[selectedFilter.key];
11
11
  return {
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: {
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 ?? [], onOpen: () => setIsPopupOpen?.(true), onClose: () => setIsPopupOpen?.(false), sx: {
13
13
  maxHeight: "250px",
14
14
  overflowY: "auto",
15
15
  width: "100%",
@@ -33,5 +33,4 @@ const getFilterPopupComponent = (selectedFilter, control, errors) => {
33
33
  }) })),
34
34
  dateRange: ((0, jsx_runtime_1.jsx)(FormFields_1.DateRangePicker, { name: selectedFilter.key, control: control, disabled: selectedFilter.isDisabled, error: !!errorSelectedKey, helperText: errorSelectedKey?.message })),
35
35
  };
36
- };
37
- exports.getFilterPopupComponent = getFilterPopupComponent;
36
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../src/FormFields/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,IAAI,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAmB/E,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,iBAAiB,CAAC;AAOzB,MAAM,M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MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;CAC7C,CAAC;AAEJ,wBAAgB,YAAY,CAAC,CAAC,SAAS,WAAW,EAAE,EAClD,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,QAAgB,EAChB,KAAK,EACL,QAAgB,EAChB,QAAgB,EAChB,OAAY,EACZ,KAAK,EACL,OAAe,EACf,UAAU,EACV,KAAK,EACL,SAAiB,EACjB,WAAgB,EAChB,QAAQ,EACR,mBAA2B,EAC3B,eAAsB,EACtB,YAAoB,EACpB,kBAA0B,EAC1B,mBAA2B,EAC3B,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAwXtB"}
@@ -99,36 +99,6 @@ function Autocomplete({ control, defaultValue, name, required = false, label, mu
99
99
  if (loading) {
100
100
  return (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, { label: label });
101
101
  }
102
- // eslint-disable-next-line sonarjs/cognitive-complexity
103
- const handleKeyDown = (e) => {
104
- if (e.code === "Space" && highlightedOptionRef.current) {
105
- e.preventDefault();
106
- if (multiple) {
107
- if (highlightedOptionRef.current == "select-all") {
108
- handleSelectAll(!isAllSelected);
109
- return;
110
- }
111
- if (selectedValue && Array.isArray(selectedValue)) {
112
- if (maxLimit && selectedValue.length >= maxLimit) {
113
- Toast_1.toasts.error({
114
- title: t("common.autocomplete.limitExceed", { maxLimit }),
115
- });
116
- return;
117
- }
118
- const valuesArray = selectedValue.map((item) => item.value);
119
- if (valuesArray.includes(highlightedOptionRef.current)) {
120
- onChange(valuesArray.filter((value) => value !== highlightedOptionRef.current));
121
- }
122
- else {
123
- onChange([...valuesArray, highlightedOptionRef.current]);
124
- }
125
- }
126
- }
127
- else {
128
- onChange(highlightedOptionRef.current);
129
- }
130
- }
131
- };
132
102
  return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { gap: "10px", children: [label && (0, jsx_runtime_1.jsx)(material_1.InputLabel, { required: required, children: label }), (0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", justifyContent: "space-between", gap: "10px", alignItems: "start", children: [(0, jsx_runtime_1.jsx)(material_1.Autocomplete, { PopperComponent: material_1.Popper, PaperComponent: StyledPaper, sx: {
133
103
  "& .MuiAutocomplete-tag": {
134
104
  backgroundColor: color.slate[700],
@@ -156,7 +126,7 @@ function Autocomplete({ control, defaultValue, name, required = false, label, mu
156
126
  }
157
127
  avatar = option.avatar ? ((0, jsx_runtime_1.jsx)(material_1.Avatar, { src: option.avatar, alt: option.label })) : ((0, jsx_runtime_1.jsx)(material_1.Avatar, { children: avatarContent }));
158
128
  }
159
- return ((0, jsx_runtime_1.jsx)(material_1.Chip, { avatar: avatar, label: label, ...tagProps }, key));
129
+ return ((0, jsx_runtime_1.jsx)(material_1.Chip, { avatar: avatar, label: label, ...tagProps, disabled: option.disabled }, key));
160
130
  }), renderOption: (props, option, { selected }) => {
161
131
  if (renderOption) {
162
132
  return renderOption(props, option, { selected });
@@ -184,7 +154,7 @@ function Autocomplete({ control, defaultValue, name, required = false, label, mu
184
154
  if (isShowOptionsOnType) {
185
155
  setInputValue(e.target.value);
186
156
  }
187
- }, onKeyDown: (e) => handleKeyDown(e) }));
157
+ } }));
188
158
  }, multiple: multiple, options: isShowOptionsOnType ? filteredOptions : memoizedOptions, isOptionEqualToValue: (option, value) => freeSolo ? false : option.value === value.value, getOptionLabel: (option) => {
189
159
  if (getOptionLabel) {
190
160
  return getOptionLabel(option);
@@ -1 +1 @@
1
- {"version":3,"file":"DateRangeSelector.d.ts","sourceRoot":"","sources":["../../../src/FormFields/DateRangeSelector/DateRangeSelector.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EACX,IAAI,EAEJ,eAAe,EACf,YAAY,EACb,MAAM,iBAAiB,CAAC;AAUzB,KAAK,sBAAsB,CAAC,CAAC,SAAS,WAAW,IAAI;IACnD,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CAC9B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,EAAE,EACvD,IAAI,EACJ,KAAK,EACL,OAAO,EACP,QAAQ,GACT,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,2CAkFrC"}
1
+ {"version":3,"file":"DateRangeSelector.d.ts","sourceRoot":"","sources":["../../../src/FormFields/DateRangeSelector/DateRangeSelector.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EACX,IAAI,EAEJ,eAAe,EACf,YAAY,EACb,MAAM,iBAAiB,CAAC;AAUzB,KAAK,sBAAsB,CAAC,CAAC,SAAS,WAAW,IAAI;IACnD,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,KAAK,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;CAC9B,CAAC;AAEF,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,WAAW,EAAE,EACvD,IAAI,EACJ,KAAK,EACL,OAAO,EACP,QAAQ,GACT,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,2CAoFrC"}
@@ -16,17 +16,19 @@ function DateRangeSelector({ name, watch, control, setValue, }) {
16
16
  const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
17
17
  const [showCustom, setShowCustom] = (0, react_1.useState)(false);
18
18
  const dateField = watch(name);
19
- const castDateRangeToPathValue = (dateField) => {
19
+ function castDateRangeToPathValue(dateField) {
20
20
  return dateField;
21
- };
22
- const setRange = (days) => {
21
+ }
22
+ function setRange(days) {
23
23
  if (!showCustom) {
24
- const fromDate = luxon_1.DateTime.now().minus({ days }).toISODate();
25
- const toDate = luxon_1.DateTime.now().toISODate();
24
+ const fromDate = luxon_1.DateTime.now()
25
+ .minus({ days: 1 + days })
26
+ .toISODate();
27
+ const toDate = luxon_1.DateTime.now().minus({ days: 1 }).toISODate();
26
28
  setValue(name, castDateRangeToPathValue([fromDate, toDate]));
27
29
  setAnchorEl(null);
28
30
  }
29
- };
31
+ }
30
32
  const defaultRanges = [
31
33
  { title: "Last 7 days", onClick: () => setRange(7) },
32
34
  { title: "Last 14 days", onClick: () => setRange(14) },
@@ -38,12 +40,12 @@ function DateRangeSelector({ name, watch, control, setValue, }) {
38
40
  setValue(name, castDateRangeToPathValue(dateField));
39
41
  }
40
42
  }, [showCustom, name]);
41
- const handleClick = (event) => {
43
+ function handleClick(event) {
42
44
  setAnchorEl(event.currentTarget);
43
- };
44
- const handleClose = () => {
45
+ }
46
+ function handleClose() {
45
47
  setAnchorEl(null);
46
48
  setShowCustom(false);
47
- };
49
+ }
48
50
  return ((0, jsx_runtime_1.jsxs)(material_1.Stack, { direction: "row", alignItems: "center", children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "body2", children: [(0, utils_1.formatDate)(dateField[0] ?? "", "dd MMM yyyy"), " -", (0, utils_1.formatDate)(dateField[1] ?? "", "dd MMM yyyy")] }), (0, jsx_runtime_1.jsx)(material_1.IconButton, { component: "div", onClick: handleClick, children: (0, jsx_runtime_1.jsx)(MoreVert_1.default, { fontSize: "small" }) }), !!anchorEl && ((0, jsx_runtime_1.jsx)(material_1.Popover, { open: true, anchorEl: anchorEl, onClose: handleClose, anchorOrigin: { vertical: "bottom", horizontal: "left" }, children: (0, jsx_runtime_1.jsx)(PadBox_1.PadBox, { padding: { padding: "8px" }, children: showCustom ? ((0, jsx_runtime_1.jsx)(DateRangePicker_1.DateRangePicker, { name: name, control: control })) : (defaultRanges.map((item) => ((0, jsx_runtime_1.jsx)(material_1.ListItemButton, { sx: { width: "100%", textAlign: "center" }, onClick: item.onClick, children: item.title }, item.title)))) }) }))] }));
49
51
  }
@@ -6,6 +6,7 @@ export type TabsItems = {
6
6
  icon?: ReactElement;
7
7
  toolTipLabel?: string;
8
8
  iconPosition?: TabOwnProps["iconPosition"];
9
+ isView?: boolean;
9
10
  onClick: () => void;
10
11
  };
11
12
  type TabsProps = {
@@ -1 +1 @@
1
- {"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/Tab/Tabs.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IAC3C,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,0BAA0B,SAAS,4CAuCvD,CAAC"}
1
+ {"version":3,"file":"Tabs.d.ts","sourceRoot":"","sources":["../../src/Tab/Tabs.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,KAAK,SAAS,GAAG;IACf,IAAI,EAAE,SAAS,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,0BAA0B,SAAS,4CAoCvD,CAAC"}
@@ -5,7 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Tabs = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
- const HelpOutlineOutlined_1 = __importDefault(require("@mui/icons-material/HelpOutlineOutlined"));
9
8
  const material_1 = require("@mui/material");
10
9
  const Tab_1 = __importDefault(require("@mui/material/Tab"));
11
10
  const uuid_1 = require("uuid");
@@ -17,6 +16,8 @@ const Tabs = ({ tabs, value, loading }) => {
17
16
  return (0, jsx_runtime_1.jsx)(Skeleton_1.Skeleton, {}, (0, uuid_1.v4)());
18
17
  }) }));
19
18
  }
20
- return ((0, jsx_runtime_1.jsx)(material_1.Tabs, { value: value, children: tabs.map(({ iconPosition = "end", toolTipLabel = "", icon = (0, jsx_runtime_1.jsx)(HelpOutlineOutlined_1.default, { color: "secondary" }), ...rest }) => ((0, jsx_runtime_1.jsx)(Tab_1.default, { icon: toolTipLabel ? ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: toolTipLabel, placement: "bottom", children: icon })) : (icon), disabled: loading, iconPosition: iconPosition, ...rest }, (0, uuid_1.v4)()))) }));
19
+ return ((0, jsx_runtime_1.jsx)(material_1.Stack, { children: (0, jsx_runtime_1.jsx)(material_1.Tabs, { value: value, children: tabs
20
+ .filter(({ isView }) => isView)
21
+ .map(({ iconPosition = "end", toolTipLabel = "", icon, ...rest }) => ((0, jsx_runtime_1.jsx)(Tab_1.default, { icon: toolTipLabel ? ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: toolTipLabel, placement: "bottom", children: icon })) : (icon), disabled: loading, iconPosition: iconPosition, ...rest }, (0, uuid_1.v4)()))) }) }));
21
22
  };
22
23
  exports.Tabs = Tabs;
@@ -3,6 +3,7 @@ export * from "./date";
3
3
  export * from "./download";
4
4
  export * from "./file";
5
5
  export * from "./hooks/useDialogActions";
6
+ export * from "./regex";
6
7
  export * from "./theme/colorPaletteUI";
7
8
  export * from "./theme/theme";
8
9
  export * from "./urlToNestedObject";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,0BAA0B,CAAC;AACzC,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC"}
@@ -19,6 +19,7 @@ __exportStar(require("./date"), exports);
19
19
  __exportStar(require("./download"), exports);
20
20
  __exportStar(require("./file"), exports);
21
21
  __exportStar(require("./hooks/useDialogActions"), exports);
22
+ __exportStar(require("./regex"), exports);
22
23
  __exportStar(require("./theme/colorPaletteUI"), exports);
23
24
  __exportStar(require("./theme/theme"), exports);
24
25
  __exportStar(require("./urlToNestedObject"), exports);
@@ -0,0 +1,3 @@
1
+ export declare const monthYearRegex: RegExp;
2
+ export declare const isoDateRegex: RegExp;
3
+ //# sourceMappingURL=regex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../src/utils/regex.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QAAkB,CAAC;AAE9C,eAAO,MAAM,YAAY,QAAwB,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isoDateRegex = exports.monthYearRegex = void 0;
4
+ exports.monthYearRegex = /^\d{4}-\d{2}$/;
5
+ exports.isoDateRegex = /^\d{4}-\d{2}-\d{2}$/;