@erpsquad/common 1.10.64 → 1.10.66

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 (83) hide show
  1. package/dist/chunks/{ERPUIProvider-DtSGxSro.esm.js → ERPUIProvider-B25RO0oy.esm.js} +4 -4
  2. package/dist/chunks/{ERPUIProvider-DtSGxSro.esm.js.map → ERPUIProvider-B25RO0oy.esm.js.map} +1 -1
  3. package/dist/chunks/{ERPUIProvider-B_cYjAdF.js → ERPUIProvider-qVNxuYUq.js} +4 -4
  4. package/dist/chunks/{ERPUIProvider-B_cYjAdF.js.map → ERPUIProvider-qVNxuYUq.js.map} +1 -1
  5. package/dist/chunks/{android-12-switch-CQqq1bod.js → android-12-switch-CPchopCJ.js} +75 -33
  6. package/dist/chunks/android-12-switch-CPchopCJ.js.map +1 -0
  7. package/dist/chunks/{android-12-switch-DMpKRS49.esm.js → android-12-switch-CRhzpgwy.esm.js} +75 -33
  8. package/dist/chunks/android-12-switch-CRhzpgwy.esm.js.map +1 -0
  9. package/dist/chunks/{appbar-GvhMl2LR.js → appbar-CLVklo7i.js} +8 -8
  10. package/dist/chunks/{appbar-GvhMl2LR.js.map → appbar-CLVklo7i.js.map} +1 -1
  11. package/dist/chunks/{appbar-BPTUcuZH.esm.js → appbar-JugRLTTB.esm.js} +8 -8
  12. package/dist/chunks/{appbar-BPTUcuZH.esm.js.map → appbar-JugRLTTB.esm.js.map} +1 -1
  13. package/dist/chunks/{checkbox-CS7OvJZk.js → checkbox-BtV5gEk1.js} +3 -3
  14. package/dist/chunks/{checkbox-CS7OvJZk.js.map → checkbox-BtV5gEk1.js.map} +1 -1
  15. package/dist/chunks/{checkbox-BG9DbVQ5.esm.js → checkbox-aq3lcSNh.esm.js} +3 -3
  16. package/dist/chunks/{checkbox-BG9DbVQ5.esm.js.map → checkbox-aq3lcSNh.esm.js.map} +1 -1
  17. package/dist/chunks/{default-data-C3gd1olF.js → default-data-BV11jE2f.js} +6 -6
  18. package/dist/chunks/{default-data-C3gd1olF.js.map → default-data-BV11jE2f.js.map} +1 -1
  19. package/dist/chunks/{default-data-c7qJW0S-.esm.js → default-data-CttLHjij.esm.js} +6 -6
  20. package/dist/chunks/{default-data-c7qJW0S-.esm.js.map → default-data-CttLHjij.esm.js.map} +1 -1
  21. package/dist/chunks/{fullScreen-BvWfY0hb.js → fullScreen-DrLlR1HI.js} +2 -2
  22. package/dist/chunks/{fullScreen-BvWfY0hb.js.map → fullScreen-DrLlR1HI.js.map} +1 -1
  23. package/dist/chunks/{fullScreen-CEK_HZnP.esm.js → fullScreen-TJdVNF4N.esm.js} +2 -2
  24. package/dist/chunks/{fullScreen-CEK_HZnP.esm.js.map → fullScreen-TJdVNF4N.esm.js.map} +1 -1
  25. package/dist/chunks/{modules-BEfRrTxc.js → modules--vSuX1U9.js} +2 -2
  26. package/dist/chunks/{modules-BEfRrTxc.js.map → modules--vSuX1U9.js.map} +1 -1
  27. package/dist/chunks/{modules-BjL8mfuw.esm.js → modules-DmtCo0T_.esm.js} +2 -2
  28. package/dist/chunks/{modules-BjL8mfuw.esm.js.map → modules-DmtCo0T_.esm.js.map} +1 -1
  29. package/dist/chunks/{page-context-D32zeXhS.js → page-context-DPP1VkDf.js} +2 -2
  30. package/dist/chunks/{page-context-D32zeXhS.js.map → page-context-DPP1VkDf.js.map} +1 -1
  31. package/dist/chunks/{page-context-BR0JEfCp.esm.js → page-context-Da49_1zP.esm.js} +2 -2
  32. package/dist/chunks/{page-context-BR0JEfCp.esm.js.map → page-context-Da49_1zP.esm.js.map} +1 -1
  33. package/dist/chunks/{route-page-map-gBJ6YfCI.esm.js → route-page-map-BRDtQTgL.esm.js} +7 -4
  34. package/dist/chunks/route-page-map-BRDtQTgL.esm.js.map +1 -0
  35. package/dist/chunks/{route-page-map-CuVKVc8s.js → route-page-map-Czwp-hfI.js} +7 -4
  36. package/dist/chunks/route-page-map-Czwp-hfI.js.map +1 -0
  37. package/dist/chunks/{sidebar-C3G058lH.js → sidebar-BOpyMIRe.js} +2 -2
  38. package/dist/chunks/{sidebar-C3G058lH.js.map → sidebar-BOpyMIRe.js.map} +1 -1
  39. package/dist/chunks/{sidebar-PQ4JubXM.esm.js → sidebar-Cc9-z3ES.esm.js} +2 -2
  40. package/dist/chunks/{sidebar-PQ4JubXM.esm.js.map → sidebar-Cc9-z3ES.esm.js.map} +1 -1
  41. package/dist/chunks/{sidebarScreen-fIj--OhC.js → sidebarScreen-C6RJT1PK.js} +3 -3
  42. package/dist/chunks/{sidebarScreen-fIj--OhC.js.map → sidebarScreen-C6RJT1PK.js.map} +1 -1
  43. package/dist/chunks/{sidebarScreen-DC7R30eg.esm.js → sidebarScreen-kbpZZe_u.esm.js} +3 -3
  44. package/dist/chunks/{sidebarScreen-DC7R30eg.esm.js.map → sidebarScreen-kbpZZe_u.esm.js.map} +1 -1
  45. package/dist/chunks/{uom-field-wrapper-BlJaV_Jd.esm.js → uom-field-wrapper-CvW-ILPC.esm.js} +471 -192
  46. package/dist/chunks/uom-field-wrapper-CvW-ILPC.esm.js.map +1 -0
  47. package/dist/chunks/{uom-field-wrapper-BMejbao3.js → uom-field-wrapper-QpAULeef.js} +419 -140
  48. package/dist/chunks/uom-field-wrapper-QpAULeef.js.map +1 -0
  49. package/dist/chunks/{useAddressContact-Dm7nV19E.esm.js → useAddressContact-BstaYk7Q.esm.js} +3 -3
  50. package/dist/chunks/{useAddressContact-Dm7nV19E.esm.js.map → useAddressContact-BstaYk7Q.esm.js.map} +1 -1
  51. package/dist/chunks/{useAddressContact-omyt5axK.js → useAddressContact-NganFSy-.js} +3 -3
  52. package/dist/chunks/{useAddressContact-omyt5axK.js.map → useAddressContact-NganFSy-.js.map} +1 -1
  53. package/dist/components/document-preview/document-preview.d.ts +6 -0
  54. package/dist/components/index.esm.js +72 -71
  55. package/dist/components/index.js +8 -7
  56. package/dist/components/index.js.map +1 -1
  57. package/dist/components/parties-modal/utils/constant.d.ts +25 -1
  58. package/dist/components/upload-media/upload-media.d.ts +1 -0
  59. package/dist/constants/index.esm.js +2 -2
  60. package/dist/constants/index.js +2 -2
  61. package/dist/contexts/index.esm.js +1 -1
  62. package/dist/contexts/index.js +1 -1
  63. package/dist/hooks/index.esm.js +3 -3
  64. package/dist/hooks/index.js +3 -3
  65. package/dist/index.esm.js +97 -96
  66. package/dist/index.js +14 -13
  67. package/dist/index.js.map +1 -1
  68. package/dist/layout/index.esm.js +2 -2
  69. package/dist/layout/index.js +2 -2
  70. package/dist/src/components/document-preview/document-preview.d.ts +6 -0
  71. package/dist/src/components/index.d.ts +2 -0
  72. package/dist/src/components/parties-modal/utils/constant.d.ts +25 -1
  73. package/dist/src/components/upload-media/upload-media.d.ts +1 -0
  74. package/dist/style.css +15 -2
  75. package/dist/views/index.esm.js +7 -7
  76. package/dist/views/index.js +6 -6
  77. package/package.json +1 -1
  78. package/dist/chunks/android-12-switch-CQqq1bod.js.map +0 -1
  79. package/dist/chunks/android-12-switch-DMpKRS49.esm.js.map +0 -1
  80. package/dist/chunks/route-page-map-CuVKVc8s.js.map +0 -1
  81. package/dist/chunks/route-page-map-gBJ6YfCI.esm.js.map +0 -1
  82. package/dist/chunks/uom-field-wrapper-BMejbao3.js.map +0 -1
  83. package/dist/chunks/uom-field-wrapper-BlJaV_Jd.esm.js.map +0 -1
@@ -2,15 +2,15 @@ import { j as jsxRuntimeExports } from "./jsx-runtime-ClFauRgV.esm.js";
2
2
  import { useFieldArray, Controller, useForm, useWatch, useFormContext } from "react-hook-form";
3
3
  import { P as PropTypes, e as _objectWithoutPropertiesLoose, _ as _extends$1, g as generateUtilityClass, j as capitalize, u as useDefaultProps, k as interopRequireDefaultExports, y as lighten_1, z as darken_1, f as alpha_1 } from "./identifier-0SZUhw_A.esm.js";
4
4
  import { i as default_1$3, T as Typography, e as useForkRef, o as ownerWindow, d as useEnhancedEffect, h as debounce, p as isMuiElement, u as useAuth, q as useControlled, r as requireCreateSvgIcon } from "./useAuth-BVQ2r4xx.esm.js";
5
- import { aq as default_1$4, w as DynamicSelect, h as DateTimePicker, D as DatePicker$1, ar as useThemeProps, A as Accordion$1, a8 as Select, f as ChipOrPlaceholder$1, i as DropdownButton, s as DynamicPhone, u as DynamicSearchSelect, k as DynamicCheckBox, af as TitleDropdownButton, T as HeaderCard, ad as TabBar, as as default_1$5, a7 as SearchableSelect, at as Chip$1, ae as TimePicker, aj as UploadMedia, a3 as PhoneInput, Z as ModalLoader, Y as MaterialTable, m as DynamicDate, z as DynamicTime, C as ChipGenerator, M as Footer, F as Fallback, au as IconButton$1, av as TabContext, aw as TabList, ax as Tab, ay as TabPanel, az as default_1$9, a as ActionBar, aA as SwitchBase } from "./android-12-switch-DMpKRS49.esm.js";
6
- import { D as DynamicInput, E as Typography$1, b as Avatar, G as o, M as Modal, B as Button, c as ConfirmPopUp, f as Box$1, d as Toast, u as useTheme$1, S as SearchBar, I as resolveComponentProps, J as mergeSlotProps, K as appendOwnerState, P as Paper$1, o as chainPropTypes, h as ButtonBase$1, y as default_1$6, T as TextField$1, e as Tooltip$1, F as default_1$7, x as default_1$8, N as Menu$2, O as MenuItem$1, q as useRtl, z as List$1, v as ListItem, Q as ListItemText$1, U as refType } from "./appbar-BPTUcuZH.esm.js";
5
+ import { aq as default_1$4, w as DynamicSelect, h as DateTimePicker, D as DatePicker$1, ar as useThemeProps, A as Accordion$1, a8 as Select, f as ChipOrPlaceholder$1, i as DropdownButton, s as DynamicPhone, u as DynamicSearchSelect, k as DynamicCheckBox, af as TitleDropdownButton, T as HeaderCard, ad as TabBar, as as default_1$5, a7 as SearchableSelect, at as Chip$1, ae as TimePicker, aj as UploadMedia, a3 as PhoneInput, Z as ModalLoader, Y as MaterialTable, m as DynamicDate, z as DynamicTime, C as ChipGenerator, M as Footer, F as Fallback, au as IconButton$1, av as TabContext, aw as TabList, ax as Tab, ay as TabPanel, az as default_1$9, a as ActionBar, aA as SwitchBase } from "./android-12-switch-CRhzpgwy.esm.js";
6
+ import { D as DynamicInput, E as Typography$1, b as Avatar, G as o, M as Modal, B as Button, c as ConfirmPopUp, f as Box$1, d as Toast, u as useTheme$1, S as SearchBar, I as resolveComponentProps, J as mergeSlotProps, K as appendOwnerState, P as Paper$1, o as chainPropTypes, h as ButtonBase$1, y as default_1$6, T as TextField$1, e as Tooltip$1, F as default_1$7, x as default_1$8, N as Menu$2, O as MenuItem$1, q as useRtl, z as List$1, v as ListItem, Q as ListItemText$1, U as refType } from "./appbar-JugRLTTB.esm.js";
7
7
  import * as React from "react";
8
8
  import React__default, { useState, lazy, useMemo, useRef, useEffect, useCallback, useLayoutEffect, useContext, createElement, createContext, cloneElement } from "react";
9
9
  import DatePicker from "react-datepicker";
10
10
  /* empty css */
11
11
  import { C as CalenderIcon, i as images } from "./images-DvZ6-RV8.esm.js";
12
12
  import { KeyboardArrowLeft, KeyboardArrowRight, Close, ChevronLeft, ChevronRight, Add, AccessTimeRounded, KeyboardArrowUp, KeyboardArrowDown, Clear } from "@mui/icons-material";
13
- import { Box, styled as styled$1, TextField, DialogTitle, IconButton, DialogContent, MenuItem, DialogActions, CircularProgress, FormControlLabel, Checkbox as Checkbox$2, Grid, ButtonBase, useTheme, useMediaQuery, Drawer, Tooltip, Collapse, Divider, ButtonGroup, Button as Button$1, Popper, Grow, Paper, ClickAwayListener, Menu as Menu$1, ListItemIcon, ListItemText, OutlinedInput, InputAdornment, Dialog, FormHelperText, Card as Card$1, CardContent as CardContent$1, TableRow, TableCell, TableContainer, Table, TableHead, TableBody } from "@mui/material";
13
+ import { Box, styled as styled$1, TextField, DialogTitle, IconButton, DialogContent, MenuItem, DialogActions, CircularProgress, FormControlLabel, Checkbox as Checkbox$2, Grid, ButtonBase, Modal as Modal$1, useTheme, useMediaQuery, Drawer, Tooltip, Collapse, Divider, ButtonGroup, Button as Button$1, Popper, Grow, Paper, ClickAwayListener, Menu as Menu$1, ListItemIcon, ListItemText, OutlinedInput, InputAdornment, Popover, Dialog, FormHelperText, Card as Card$1, CardContent as CardContent$1, TableRow, TableCell, TableContainer, Table, TableHead, TableBody } from "@mui/material";
14
14
  import { u as useLanguage } from "./useLangauge-Cb9mu6cS.esm.js";
15
15
  import dayjs from "dayjs";
16
16
  /* empty css */
@@ -21,14 +21,14 @@ import { Sparkles, X, TrendingUp, AlertTriangle, Clock, SendHorizontal, Check, C
21
21
  import * as d3 from "d3";
22
22
  import { marked } from "marked";
23
23
  import { bw as streamV1AiFeatureChat, aF as getV1User, bx as getV1ReportsScheduleReport, J as getV1ReportsReportList, by as deleteV1ReportsScheduleReportId, bz as putV1ReportsUpdateScheduleReportId, bA as postV1ReportsScheduleReport, y as getV1FormBuilder } from "./api-DhR7H-jj.esm.js";
24
- import { b as getApiConfigSafe, a as auth, g as getApiConfig } from "./api-config-GOys-syK.esm.js";
24
+ import { b as getApiConfigSafe, g as getApiConfig, a as auth } from "./api-config-GOys-syK.esm.js";
25
25
  import * as Yup from "yup";
26
- import { C as Checkbox$1, f as usePages, b as useDeepMemo, a as useApi } from "./checkbox-BG9DbVQ5.esm.js";
26
+ import { C as Checkbox$1, f as usePages, b as useDeepMemo, a as useApi } from "./checkbox-aq3lcSNh.esm.js";
27
27
  import { C as Chip, M as Menu, t as transformTableColumns, b as formateValueByType, r as renderEmptyRowsFallback } from "./form-builder-deconversion-DNCtkxQC.esm.js";
28
- import { M as MoreIcon, q as Filter, e as Close$1, c as ArrowUpDown, g as Export, p as Calendar$1, a as ArrowDown } from "./radio-button-DSUBR45C.esm.js";
28
+ import { M as MoreIcon, e as Close$1, q as Filter, c as ArrowUpDown, g as Export, p as Calendar$1, a as ArrowDown } from "./radio-button-DSUBR45C.esm.js";
29
29
  import { enqueueSnackbar, useSnackbar, SnackbarProvider } from "notistack";
30
30
  import { useDispatch } from "react-redux";
31
- import { a as apiHelper, c as useGenericDataFetcher, b as useAppTranslations } from "./ERPUIProvider-DtSGxSro.esm.js";
31
+ import { a as apiHelper, c as useGenericDataFetcher, b as useAppTranslations } from "./ERPUIProvider-B25RO0oy.esm.js";
32
32
  import Board from "@asseinfo/react-kanban";
33
33
  import { a as calculateEntries, t as truncateDecimals } from "./translations-Df5Mt7kz.esm.js";
34
34
  import FullCalendar from "@fullcalendar/react";
@@ -42,22 +42,25 @@ import resourceTimelinePlugin from "@fullcalendar/resource-timeline";
42
42
  import { E as Eye, a as EyeOff } from "./tick-BKOomNx0.esm.js";
43
43
  import { j as Copy$1, e as ArrowUp } from "./arrow-up-BDkqlEB_.esm.js";
44
44
  import ReactFlagsSelect from "react-flags-select";
45
+ import DocViewer, { DocViewerRenderers } from "react-doc-viewer";
46
+ import Papa from "papaparse";
47
+ import { D as Document } from "./document-rki7DMqA.esm.js";
45
48
  import { useParams, useLocation, useNavigate } from "react-router-dom";
46
49
  import { g as getEntityId, R as RANGE, a as handleCompareDateRangeSync, h as handleCompareDateRange } from "./navigation-utils-ChG-fDRf.esm.js";
47
- import { E as ErpLoader } from "./page-context-BR0JEfCp.esm.js";
50
+ import { E as ErpLoader } from "./page-context-Da49_1zP.esm.js";
48
51
  import { Gantt, ViewMode } from "gantt-task-react";
49
52
  import { DateRange, Calendar } from "react-date-range";
50
53
  import { v as viewTypes } from "./action-bar-BsXTcYpL.esm.js";
51
54
  import DataEditor, { GridCellKind } from "@glideapps/glide-data-grid";
52
55
  import { useExtraCells } from "@glideapps/glide-data-grid-cells";
53
56
  import { createPortal } from "react-dom";
54
- import { C as Collapse$1 } from "./sidebar-PQ4JubXM.esm.js";
57
+ import { C as Collapse$1 } from "./sidebar-Cc9-z3ES.esm.js";
55
58
  import { useMaterialReactTable, MaterialReactTable } from "material-react-table";
56
59
  import { R as RecgtangleIcon, C as CheckBoxIcon$1, T as Trash, E as Edit } from "./trash-Dgfsw2UY.esm.js";
57
60
  import _$1 from "lodash";
58
- import { P as PathnameDocument } from "./modules-BjL8mfuw.esm.js";
61
+ import { P as PathnameDocument } from "./modules-DmtCo0T_.esm.js";
59
62
  import { f as PathnameRental, b as PathnameCrm, e as PathnamePurchase, d as PathnameManufacturing, c as PathnameInventory, a as PathnameAccounting } from "./pathname.rental-Dvo5a732.esm.js";
60
- import { a as PathnameUsers } from "./route-page-map-gBJ6YfCI.esm.js";
63
+ import { a as PathnameUsers } from "./route-page-map-BRDtQTgL.esm.js";
61
64
  import { u as useAppDispatch, a as useAppSelector } from "./hooks-Cj9Yhy-E.esm.js";
62
65
  import { f as fetchCompanies } from "./store-Djcai2P1.esm.js";
63
66
  import { useDropzone } from "react-dropzone";
@@ -4013,10 +4016,13 @@ const AddressModal = ({
4013
4016
  "addresses.street_1",
4014
4017
  "addresses.street_2",
4015
4018
  "addresses.street_3",
4019
+ "addresses.street_name",
4016
4020
  "addresses.building_no",
4017
4021
  "addresses.additional_no",
4022
+ "addresses.national_address",
4018
4023
  "addresses.zip_code",
4019
4024
  "addresses.city",
4025
+ "addresses.district_name",
4020
4026
  "addresses.state",
4021
4027
  "addresses.country"
4022
4028
  ]
@@ -4128,15 +4134,15 @@ const AddressModal = ({
4128
4134
  const summaryVal = watchedValues.reduce((ele, ele2, index) => {
4129
4135
  if (!ele2) return ele;
4130
4136
  if (!ele) return ele2;
4131
- if (index === 8) {
4137
+ if (index === 11) {
4132
4138
  ele2 = state_data;
4133
4139
  }
4134
- if (index === 9) {
4140
+ if (index === 12) {
4135
4141
  ele2 = country_data;
4136
4142
  }
4137
4143
  ele = (ele == null ? void 0 : ele.name) || ele;
4138
4144
  ele2 = (ele2 == null ? void 0 : ele2.name) || ele2;
4139
- if ([2, 3, 4, 5].includes(index)) {
4145
+ if ([2, 3, 4, 5, 6, 7].includes(index)) {
4140
4146
  return ele + " " + ele2;
4141
4147
  }
4142
4148
  return ele + ", \n" + ele2;
@@ -4262,6 +4268,8 @@ const AddressModal = ({
4262
4268
  }
4263
4269
  ) }),
4264
4270
  isKSA,
4271
+ isKSA,
4272
+ isKSA,
4265
4273
  /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4266
4274
  DynamicInput,
4267
4275
  {
@@ -4311,6 +4319,7 @@ const AddressModal = ({
4311
4319
  formControl: control
4312
4320
  }
4313
4321
  ) }),
4322
+ isKSA,
4314
4323
  /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4315
4324
  DynamicInput,
4316
4325
  {
@@ -4621,6 +4630,135 @@ const DashBoardHeader = ({ title, customElement, showEdit = true, showDropDowan
4621
4630
  ] })
4622
4631
  ] }) });
4623
4632
  };
4633
+ const imageExts = [
4634
+ "png",
4635
+ "jpg",
4636
+ "jpeg",
4637
+ "gif",
4638
+ "svg",
4639
+ "webp",
4640
+ "bmp",
4641
+ "tiff",
4642
+ "tif",
4643
+ "ico",
4644
+ "heic",
4645
+ "heif"
4646
+ ];
4647
+ const iframeExts = ["txt", "csv", "rtf"];
4648
+ const pdfExts = ["pdf"];
4649
+ const CsvPreview = ({ url }) => {
4650
+ const [data, setData] = useState([]);
4651
+ const [loading, setLoading] = useState(true);
4652
+ useEffect(() => {
4653
+ fetch(url).then((r) => r.text()).then((text) => {
4654
+ const result = Papa.parse(text);
4655
+ setData(result.data);
4656
+ setLoading(false);
4657
+ });
4658
+ }, [url]);
4659
+ if (loading) return /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { type: "s3", children: "Loading..." });
4660
+ if (!data.length) return /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { type: "s3", children: "Empty file" });
4661
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { component: "table", sx: { width: "100%", borderCollapse: "collapse" }, children: [
4662
+ /* @__PURE__ */ jsxRuntimeExports.jsx("thead", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: (data[0] || []).map((h, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("th", { style: { border: "1px solid #ccc", padding: 8, background: "#f5f5f5", textAlign: "left" }, children: h }, i)) }) }),
4663
+ /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", { children: data.slice(1).map((row, r) => /* @__PURE__ */ jsxRuntimeExports.jsx("tr", { children: row.map((c, i) => /* @__PURE__ */ jsxRuntimeExports.jsx("td", { style: { border: "1px solid #ccc", padding: 8 }, children: c }, i)) }, r)) })
4664
+ ] });
4665
+ };
4666
+ const TextPreview = ({ url }) => {
4667
+ const [text, setText] = useState("");
4668
+ useEffect(() => {
4669
+ fetch(url).then((r) => r.text()).then(setText);
4670
+ }, [url]);
4671
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { style: { whiteSpace: "pre-wrap", wordBreak: "break-word", margin: 0, fontSize: 14 }, children: text });
4672
+ };
4673
+ const DocumentPreview = ({ fileUrl, fileName }) => {
4674
+ var _a;
4675
+ const [open, setOpen] = useState(false);
4676
+ const name = fileName || (fileUrl == null ? void 0 : fileUrl.substring((fileUrl == null ? void 0 : fileUrl.lastIndexOf("/")) + 1)) || "";
4677
+ const ext = useMemo(() => {
4678
+ var _a2;
4679
+ return ((_a2 = name.split(".").pop()) == null ? void 0 : _a2.toLowerCase()) || "";
4680
+ }, [name]);
4681
+ const s3BucketUrl = ((_a = getApiConfig()) == null ? void 0 : _a.s3BucketUrl) || "https://erpforce-dev.s3.eu-west-1.amazonaws.com/";
4682
+ const fullUrl = useMemo(
4683
+ () => (fileUrl == null ? void 0 : fileUrl.startsWith("http")) || (fileUrl == null ? void 0 : fileUrl.startsWith("blob:")) ? fileUrl : s3BucketUrl + fileUrl,
4684
+ [fileUrl, s3BucketUrl]
4685
+ );
4686
+ const isLocalFile = fileUrl == null ? void 0 : fileUrl.startsWith("blob:");
4687
+ const renderContent = () => {
4688
+ if (imageExts.includes(ext)) {
4689
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
4690
+ "img",
4691
+ {
4692
+ src: fullUrl,
4693
+ alt: name,
4694
+ style: { width: "100%", height: "100%", objectFit: "contain" }
4695
+ }
4696
+ );
4697
+ }
4698
+ if (pdfExts.includes(ext)) {
4699
+ return isLocalFile ? /* @__PURE__ */ jsxRuntimeExports.jsx("embed", { src: fullUrl, title: name, style: { width: "100%", height: "100%" } }) : /* @__PURE__ */ jsxRuntimeExports.jsx("iframe", { src: fullUrl, title: name, style: { width: "100%", height: "100%", border: "none" } });
4700
+ }
4701
+ if (iframeExts.includes(ext)) {
4702
+ if (ext === "csv") {
4703
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(CsvPreview, { url: fullUrl });
4704
+ }
4705
+ if (isLocalFile) {
4706
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(TextPreview, { url: fullUrl });
4707
+ }
4708
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("iframe", { src: fullUrl, title: name, style: { width: "100%", height: "100%", border: "none" } });
4709
+ }
4710
+ if (isLocalFile) {
4711
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
4712
+ Box,
4713
+ {
4714
+ display: "flex",
4715
+ alignItems: "center",
4716
+ justifyContent: "center",
4717
+ flexDirection: "column",
4718
+ gap: 2,
4719
+ height: "100%",
4720
+ children: [
4721
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Document, { fontSize: "large" }),
4722
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { type: "s3", weight: "medium", children: name }),
4723
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "outlined", onClick: () => window.open(fullUrl, "_blank"), children: "Download" })
4724
+ ]
4725
+ }
4726
+ );
4727
+ }
4728
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
4729
+ DocViewer,
4730
+ {
4731
+ documents: [{ uri: fullUrl, fileName: name, fileType: ext }],
4732
+ pluginRenderers: DocViewerRenderers,
4733
+ config: { header: { disableHeader: true } },
4734
+ style: { width: "100%", height: "100%" }
4735
+ }
4736
+ );
4737
+ };
4738
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
4739
+ /* @__PURE__ */ jsxRuntimeExports.jsx(IconButton, { size: "small", onClick: () => setOpen(true), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Eye, { fontSize: "small" }) }),
4740
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Modal$1, { open, onClose: () => setOpen(false), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: {
4741
+ position: "absolute",
4742
+ top: "50%",
4743
+ left: "50%",
4744
+ transform: "translate(-50%, -50%)",
4745
+ bgcolor: "background.paper",
4746
+ boxShadow: 24,
4747
+ borderRadius: 1,
4748
+ width: "90vw",
4749
+ height: "90vh",
4750
+ display: "flex",
4751
+ flexDirection: "column",
4752
+ overflow: "hidden"
4753
+ }, children: [
4754
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "center", p: 2, children: [
4755
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { type: "s3", weight: "medium", children: name }),
4756
+ /* @__PURE__ */ jsxRuntimeExports.jsx(IconButton, { onClick: () => setOpen(false), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Close$1, {}) })
4757
+ ] }),
4758
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { flex: 1, p: 2, sx: { overflow: "auto", minHeight: 0 }, children: renderContent() })
4759
+ ] }) })
4760
+ ] });
4761
+ };
4624
4762
  const ExpandableSummaryWrapper = ({
4625
4763
  children,
4626
4764
  defaultExpanded = true,
@@ -10295,9 +10433,8 @@ const ReportsTitleBar = (props) => {
10295
10433
  ];
10296
10434
  const [selectedItems, setSelectedItems] = useState(defaultSelected);
10297
10435
  const [level, setLevel] = useState(1);
10298
- const [actionAnchorEl, setActionAnchorEl] = useState(
10299
- null
10300
- );
10436
+ const [actionAnchorEl, setActionAnchorEl] = useState(null);
10437
+ const [appliedFiltersAnchorEl, setAppliedFiltersAnchorEl] = useState(null);
10301
10438
  const [allFields, setAllFields] = useState([]);
10302
10439
  const [dateRange, setDateRange] = useState();
10303
10440
  const [open, setOpen] = useState(false);
@@ -10394,6 +10531,19 @@ const ReportsTitleBar = (props) => {
10394
10531
  multiple: filter.multiple || false,
10395
10532
  options: filter.options || void 0
10396
10533
  }))) || [];
10534
+ const isFilterApplied = (val) => Array.isArray(val) ? val.length > 0 : val !== void 0 && val !== null && val !== "";
10535
+ const selectedFilters = filtersConfig.filter(
10536
+ (config) => showFilter(config.key)
10537
+ );
10538
+ const selectedFilterCount = selectedFilters.length;
10539
+ const appliedFilterCount = filtersConfig.filter(
10540
+ (config) => isFilterApplied(filters == null ? void 0 : filters[config.valueKey])
10541
+ ).length;
10542
+ useEffect(() => {
10543
+ if (selectedFilterCount === 0 && appliedFiltersAnchorEl) {
10544
+ setAppliedFiltersAnchorEl(null);
10545
+ }
10546
+ }, [selectedFilterCount, appliedFiltersAnchorEl]);
10397
10547
  useEffect(() => {
10398
10548
  if (!autoShowFiltersWithValue) return;
10399
10549
  setSelectedItems((prev) => {
@@ -10564,9 +10714,10 @@ const ReportsTitleBar = (props) => {
10564
10714
  multiple = false,
10565
10715
  options: options2,
10566
10716
  show = true,
10567
- showCancelButton = true
10717
+ showCancelButton = true,
10718
+ forceShow = false
10568
10719
  }) => {
10569
- if (!showFilter(key) || !show) return null;
10720
+ if (!showFilter(key) && !forceShow || !show) return null;
10570
10721
  const companyKey = (filterKeys == null ? void 0 : filterKeys.company) || "company";
10571
10722
  const companyId = filters == null ? void 0 : filters[companyKey];
10572
10723
  const hasCompany = Array.isArray(companyId) ? companyId.length > 0 : !!companyId;
@@ -10596,13 +10747,12 @@ const ReportsTitleBar = (props) => {
10596
10747
  }
10597
10748
  );
10598
10749
  };
10599
- const FilterContainer = () => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10600
- filtersConfig.map(renderFilter),
10601
- customFilterComponents.map(({ key, component }) => /* @__PURE__ */ jsxRuntimeExports.jsx(React__default.Fragment, { children: component }, key))
10602
- ] });
10603
10750
  const handleFilterClose = () => {
10604
10751
  setActionAnchorEl(null);
10605
10752
  };
10753
+ const handleAppliedFilterClose = () => {
10754
+ setAppliedFiltersAnchorEl(null);
10755
+ };
10606
10756
  const ExportContainer = React__default.memo(() => {
10607
10757
  var _a2;
10608
10758
  const handleClose2 = () => setExportAnchorEl(null);
@@ -10649,27 +10799,7 @@ const ReportsTitleBar = (props) => {
10649
10799
  }
10650
10800
  ) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { type: "h3", weight: "medium", color: "theme.secondary.1000", children: title }) }),
10651
10801
  searchBar && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "reportsTitleBar--SearchBar", children: searchBar }),
10652
- /* @__PURE__ */ jsxRuntimeExports.jsx(
10653
- ReportButtons,
10654
- {
10655
- zIndex: 999,
10656
- className: "reportsTitleBar--RightContent",
10657
- buttons
10658
- }
10659
- )
10660
- ] }),
10661
- (tabs == null ? void 0 : tabs.length) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
10662
- TabBar,
10663
- {
10664
- tabs: tabs || [],
10665
- activeValue,
10666
- setActiveValue,
10667
- isTabViewOnly: true
10668
- }
10669
- ) }) : null,
10670
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", justifyContent: "space-between", my: 2.5, alignItems: "center", flexWrap: "wrap", gap: 1 }, children: [
10671
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "reportsTitleBar--FilterWrapper", children: [
10672
- FilterContainer(),
10802
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "reportsTitleBar--RightContent", children: [
10673
10803
  showDateFilter && isDateRange && (filters == null ? void 0 : filters[endDateKey]) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: "flex", gap: "8px" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
10674
10804
  "div",
10675
10805
  {
@@ -10810,110 +10940,165 @@ const ReportsTitleBar = (props) => {
10810
10940
  /* @__PURE__ */ jsxRuntimeExports.jsx(default_1$5, {})
10811
10941
  ]
10812
10942
  }
10813
- ) })
10814
- ] }),
10815
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "report-display", children: [
10816
- ((_a = dropdownMenuButtonData == null ? void 0 : dropdownMenuButtonData.options) == null ? void 0 : _a.length) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
10817
- /* @__PURE__ */ jsxRuntimeExports.jsx(
10818
- Button,
10819
- {
10820
- sx: ({ palette }) => ({
10821
- border: "1px solid",
10822
- borderColor: "grey.200",
10823
- borderRadius: "50px",
10824
- color: `${palette.grey[800]} !important`,
10825
- "&:hover": {
10826
- bgcolor: `${palette.grey[200]} !important`
10827
- }
10828
- }),
10829
- variant: "text",
10830
- startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(Export, { fontSize: "small" }),
10831
- onClick: (event) => setExportAnchorEl(event.currentTarget),
10832
- children: t("common.export")
10833
- }
10834
- ),
10835
- exportAnchorEl && /* @__PURE__ */ jsxRuntimeExports.jsx(ExportContainer, {})
10836
- ] }),
10837
- (filterDropDown == null ? void 0 : filterDropDown.length) && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10838
- /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
10839
- Button,
10840
- {
10841
- sx: ({ palette }) => ({
10842
- border: "1px solid",
10843
- borderColor: "grey.200",
10844
- borderRadius: "50px",
10845
- color: `${palette.grey[800]} !important`,
10846
- "&:hover": {
10847
- bgcolor: `${palette.grey[200]} !important`
10943
+ ) }),
10944
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "report-display", children: [
10945
+ ((_a = dropdownMenuButtonData == null ? void 0 : dropdownMenuButtonData.options) == null ? void 0 : _a.length) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
10946
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
10947
+ Button,
10948
+ {
10949
+ sx: ({ palette }) => ({
10950
+ border: "1px solid",
10951
+ borderColor: "grey.200",
10952
+ borderRadius: "50px",
10953
+ color: `${palette.grey[800]} !important`,
10954
+ "&:hover": {
10955
+ bgcolor: `${palette.grey[200]} !important`
10956
+ }
10957
+ }),
10958
+ variant: "text",
10959
+ startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(Export, { fontSize: "small" }),
10960
+ onClick: (event) => setExportAnchorEl(event.currentTarget),
10961
+ children: t("common.export")
10962
+ }
10963
+ ),
10964
+ exportAnchorEl && /* @__PURE__ */ jsxRuntimeExports.jsx(ExportContainer, {})
10965
+ ] }),
10966
+ (filterDropDown == null ? void 0 : filterDropDown.length) && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10967
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
10968
+ Button,
10969
+ {
10970
+ sx: ({ palette }) => ({
10971
+ border: "1px solid",
10972
+ borderColor: "grey.200",
10973
+ borderRadius: "50px",
10974
+ color: `${palette.grey[800]} !important`,
10975
+ "&:hover": {
10976
+ bgcolor: `${palette.grey[200]} !important`
10977
+ }
10978
+ }),
10979
+ variant: "text",
10980
+ startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(Filter, { fontSize: "small" }),
10981
+ onClick: (event) => setActionAnchorEl(event.currentTarget),
10982
+ children: t("common.filter")
10983
+ }
10984
+ ) }),
10985
+ showLevelBtn && /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { flexItem: true, orientation: "vertical", sx: { height: "50%", alignSelf: "auto" } }),
10986
+ selectedFilterCount > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
10987
+ Button,
10988
+ {
10989
+ sx: ({ palette }) => ({
10990
+ border: "1px solid",
10991
+ borderColor: "grey.200",
10992
+ borderRadius: "50px",
10993
+ color: `${palette.grey[800]} !important`,
10994
+ "&:hover": {
10995
+ bgcolor: `${palette.grey[200]} !important`
10996
+ }
10997
+ }),
10998
+ variant: "text",
10999
+ startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(Filter, { fontSize: "small" }),
11000
+ endIcon: appliedFilterCount > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
11001
+ Box,
11002
+ {
11003
+ component: "span",
11004
+ sx: ({ palette }) => ({
11005
+ display: "inline-flex",
11006
+ alignItems: "center",
11007
+ justifyContent: "center",
11008
+ minWidth: 20,
11009
+ height: 20,
11010
+ px: 0.75,
11011
+ borderRadius: "10px",
11012
+ fontSize: `12px !important`,
11013
+ fontWeight: 600,
11014
+ lineHeight: 1,
11015
+ color: palette.common.white,
11016
+ bgcolor: palette.primary.main
11017
+ }),
11018
+ children: appliedFilterCount
11019
+ }
11020
+ ) : null,
11021
+ onClick: (event) => setAppliedFiltersAnchorEl(event.currentTarget),
11022
+ children: t("common.appliedFilters", "Applied Filters")
11023
+ }
11024
+ )
11025
+ ] }),
11026
+ filterDropDownFunc(),
11027
+ showLevelBtn && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
11028
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: "reportsTitleBar--FilterAction--lvWrapper", children: [
11029
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { type: "s3", weight: "medium", color: "grey.800", children: [
11030
+ " Level ",
11031
+ level,
11032
+ " of ",
11033
+ dataLength
11034
+ ] }),
11035
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(ButtonGroup, { variant: "outlined", disableElevation: true, sx: ({ palette }) => ({
11036
+ "& .MuiButton-root": {
11037
+ borderColor: `${palette.grey[200]} !important`,
11038
+ "&:hover": {
11039
+ bgcolor: `${palette.grey[200]} !important`
11040
+ }
11041
+ },
11042
+ "& .MuiButtonGroup-firstButton": {
11043
+ borderTopLeftRadius: 20,
11044
+ borderBottomLeftRadius: 20
11045
+ },
11046
+ "& .MuiButtonGroup-lastButton": {
11047
+ borderTopRightRadius: 20,
11048
+ borderBottomRightRadius: 20
10848
11049
  }
10849
- }),
10850
- variant: "text",
10851
- startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(Filter, { fontSize: "small" }),
10852
- onClick: (event) => setActionAnchorEl(event.currentTarget),
10853
- children: t("common.filter")
10854
- }
10855
- ) }),
10856
- showLevelBtn && /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { flexItem: true, orientation: "vertical", sx: { height: "50%", alignSelf: "auto" } })
10857
- ] }),
10858
- filterDropDownFunc(),
10859
- showLevelBtn && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10860
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: "reportsTitleBar--FilterAction--lvWrapper", children: [
10861
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { type: "s3", weight: "medium", color: "grey.800", children: [
10862
- " Level ",
10863
- level,
10864
- " of ",
10865
- dataLength
11050
+ }), children: [
11051
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { onClick: () => {
11052
+ setLevel(level == dataLength ? level : level + 1);
11053
+ handleRowsCollapse == null ? void 0 : handleRowsCollapse(level);
11054
+ }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: images.common.expand }) }),
11055
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { onClick: () => {
11056
+ setLevel(level != 1 ? level - 1 : 1);
11057
+ handleRowsExpand == null ? void 0 : handleRowsExpand(level);
11058
+ }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: images.common.collapse }) })
11059
+ ] })
10866
11060
  ] }),
10867
- /* @__PURE__ */ jsxRuntimeExports.jsxs(ButtonGroup, { variant: "outlined", disableElevation: true, sx: ({ palette }) => ({
10868
- "& .MuiButton-root": {
10869
- borderColor: `${palette.grey[200]} !important`,
10870
- "&:hover": {
10871
- bgcolor: `${palette.grey[200]} !important`
10872
- }
10873
- },
10874
- "& .MuiButtonGroup-firstButton": {
10875
- borderTopLeftRadius: 20,
10876
- borderBottomLeftRadius: 20
10877
- },
10878
- "& .MuiButtonGroup-lastButton": {
10879
- borderTopRightRadius: 20,
10880
- borderBottomRightRadius: 20
10881
- }
10882
- }), children: [
10883
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { onClick: () => {
10884
- setLevel(level == dataLength ? level : level + 1);
10885
- handleRowsCollapse == null ? void 0 : handleRowsCollapse(level);
10886
- }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: images.common.expand }) }),
10887
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { onClick: () => {
10888
- setLevel(level != 1 ? level - 1 : 1);
10889
- handleRowsExpand == null ? void 0 : handleRowsExpand(level);
10890
- }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: images.common.collapse }) })
10891
- ] })
11061
+ isDateFilterEnabled && /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { flexItem: true, orientation: "vertical", sx: { height: "50%", alignSelf: "auto" } })
10892
11062
  ] }),
10893
- isDateFilterEnabled && /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { flexItem: true, orientation: "vertical", sx: { height: "50%", alignSelf: "auto" } })
11063
+ isDateFilterEnabled && showDateFilter && /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
11064
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { type: "s3", weight: "medium", color: "grey.800", children: "As of: " }),
11065
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
11066
+ ReportButtons,
11067
+ {
11068
+ zIndex: 997,
11069
+ className: "reportsTitleBar--RightContent",
11070
+ dropdownMenuButtonData: {
11071
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Calendar$1, { fontSize: "small" }),
11072
+ children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
11073
+ RANGE[dateRange],
11074
+ /* @__PURE__ */ jsxRuntimeExports.jsx(default_1$5, {})
11075
+ ] }),
11076
+ options
11077
+ },
11078
+ toggleCallback
11079
+ }
11080
+ ),
11081
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: dateSelectRef })
11082
+ ] })
10894
11083
  ] }),
10895
- isDateFilterEnabled && showDateFilter && /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
10896
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { type: "s3", weight: "medium", color: "grey.800", children: "As of: " }),
10897
- /* @__PURE__ */ jsxRuntimeExports.jsx(
10898
- ReportButtons,
10899
- {
10900
- zIndex: 997,
10901
- className: "reportsTitleBar--RightContent",
10902
- dropdownMenuButtonData: {
10903
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Calendar$1, { fontSize: "small" }),
10904
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10905
- RANGE[dateRange],
10906
- /* @__PURE__ */ jsxRuntimeExports.jsx(default_1$5, {})
10907
- ] }),
10908
- options
10909
- },
10910
- toggleCallback
10911
- }
10912
- ),
10913
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: dateSelectRef })
10914
- ] })
11084
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
11085
+ ReportButtons,
11086
+ {
11087
+ zIndex: 999,
11088
+ buttons
11089
+ }
11090
+ )
10915
11091
  ] })
10916
11092
  ] }),
11093
+ (tabs == null ? void 0 : tabs.length) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
11094
+ TabBar,
11095
+ {
11096
+ tabs: tabs || [],
11097
+ activeValue,
11098
+ setActiveValue,
11099
+ isTabViewOnly: true
11100
+ }
11101
+ ) }) : null,
10917
11102
  /* @__PURE__ */ jsxRuntimeExports.jsx(
10918
11103
  Popper,
10919
11104
  {
@@ -10974,6 +11159,99 @@ const ReportsTitleBar = (props) => {
10974
11159
  }
10975
11160
  )
10976
11161
  }
11162
+ ),
11163
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
11164
+ Popover,
11165
+ {
11166
+ anchorEl: appliedFiltersAnchorEl,
11167
+ open: Boolean(appliedFiltersAnchorEl),
11168
+ onClose: handleAppliedFilterClose,
11169
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
11170
+ transformOrigin: { vertical: "top", horizontal: "right" },
11171
+ slotProps: {
11172
+ paper: {
11173
+ sx: {
11174
+ mt: 1,
11175
+ minWidth: 280,
11176
+ maxWidth: 340,
11177
+ borderRadius: 2,
11178
+ overflow: "hidden",
11179
+ boxShadow: "0 8px 24px rgba(0, 0, 0, 0.12)"
11180
+ }
11181
+ }
11182
+ },
11183
+ children: (() => {
11184
+ const hasContent = selectedFilters.length > 0 || customFilterComponents.length > 0;
11185
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
11186
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
11187
+ Box,
11188
+ {
11189
+ sx: {
11190
+ px: 2,
11191
+ py: 1.5,
11192
+ borderBottom: "1px solid",
11193
+ borderColor: "grey.200",
11194
+ bgcolor: "grey.50",
11195
+ display: "flex",
11196
+ alignItems: "center",
11197
+ gap: 1
11198
+ },
11199
+ children: [
11200
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { type: "s3", weight: "medium", color: "grey.800", children: t("common.appliedFilters", "Applied Filters") }),
11201
+ appliedFilterCount > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
11202
+ Box,
11203
+ {
11204
+ component: "span",
11205
+ sx: ({ palette }) => ({
11206
+ display: "inline-flex",
11207
+ alignItems: "center",
11208
+ justifyContent: "center",
11209
+ minWidth: 20,
11210
+ height: 20,
11211
+ px: 0.75,
11212
+ borderRadius: "10px",
11213
+ fontSize: "12px !important",
11214
+ fontWeight: 600,
11215
+ lineHeight: 1,
11216
+ color: palette.common.white,
11217
+ bgcolor: palette.primary.main
11218
+ }),
11219
+ children: appliedFilterCount
11220
+ }
11221
+ )
11222
+ ]
11223
+ }
11224
+ ),
11225
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
11226
+ Box,
11227
+ {
11228
+ sx: {
11229
+ display: "flex",
11230
+ flexDirection: "column",
11231
+ gap: 2,
11232
+ p: 2,
11233
+ maxHeight: 380,
11234
+ overflowY: "auto"
11235
+ },
11236
+ children: hasContent ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
11237
+ selectedFilters.map((config) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
11238
+ Box,
11239
+ {
11240
+ sx: { display: "flex", flexDirection: "column", gap: 0.75 },
11241
+ children: [
11242
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { type: "s4", weight: "medium", color: "grey.700", children: t(config.label) }),
11243
+ renderFilter(config)
11244
+ ]
11245
+ },
11246
+ config.key
11247
+ )),
11248
+ customFilterComponents.map(({ key, component }) => /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { children: component }, key))
11249
+ ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { type: "s4", color: "grey.500", children: t("common.noFiltersApplied", "No filters applied") })
11250
+ }
11251
+ )
11252
+ ] });
11253
+ })()
11254
+ }
10977
11255
  )
10978
11256
  ] });
10979
11257
  };
@@ -16737,58 +17015,59 @@ const UomFieldWrapper = ({
16737
17015
  );
16738
17016
  };
16739
17017
  export {
16740
- MaterialEditableTable as $,
17018
+ ListingComponent as $,
16741
17019
  AISummaryPanel as A,
16742
17020
  BarChart as B,
16743
17021
  CalculationSummary as C,
16744
17022
  DonutChart as D,
16745
- DynamicDateTime as E,
16746
- DynamicLayoutWrapper as F,
17023
+ DynamicDateRange as E,
17024
+ DynamicDateTime as F,
16747
17025
  GridCard as G,
16748
- DynamicModal as H,
16749
- ElementController as I,
16750
- EntityViewWrapper as J,
16751
- ExpandableSummaryWrapper as K,
16752
- FormData as L,
16753
- FormLoader as M,
16754
- Forms as N,
16755
- GanttChart as O,
16756
- GridCard$1 as P,
16757
- GridCardMarkup as Q,
16758
- GridFallback as R,
16759
- GridWrapper as S,
16760
- GroupedBarChart as T,
16761
- HrLine as U,
16762
- InventoryReportsTitleBar as V,
16763
- ItemResponseDetails as W,
16764
- LabelValue as X,
16765
- LineChart as Y,
16766
- List as Z,
16767
- ListingComponent as _,
17026
+ DynamicLayoutWrapper as H,
17027
+ DynamicModal as I,
17028
+ ElementController as J,
17029
+ EntityViewWrapper as K,
17030
+ ExpandableSummaryWrapper as L,
17031
+ FormData as M,
17032
+ FormLoader as N,
17033
+ Forms as O,
17034
+ GanttChart as P,
17035
+ GridCard$1 as Q,
17036
+ GridCardMarkup as R,
17037
+ GridFallback as S,
17038
+ GridWrapper as T,
17039
+ GroupedBarChart as U,
17040
+ HrLine as V,
17041
+ InventoryReportsTitleBar as W,
17042
+ ItemResponseDetails as X,
17043
+ LabelValue as Y,
17044
+ LineChart as Z,
17045
+ List as _,
16768
17046
  ActivityTag as a,
16769
- MultiLine as a0,
16770
- MultiLineChart as a1,
16771
- MultiSelect as a2,
16772
- PageLoader as a3,
16773
- QuickApprovalModal as a4,
16774
- ReportButtons as a5,
16775
- ReportTable as a6,
16776
- ReportsTitleBar as a7,
16777
- GeneralScheduleReport as a8,
16778
- ScheduleReportModal as a9,
16779
- Snackbar as aa,
16780
- SubHeaderDoc as ab,
16781
- TabBarUi as ac,
16782
- TextArea as ad,
16783
- TimeRangePicker as ae,
16784
- UomFieldWrapper as af,
16785
- Upload as ag,
16786
- UserDropdown as ah,
16787
- calculateOptimalSizes as ai,
16788
- dynamicFields as aj,
16789
- fields as ak,
16790
- useDynamicLayout as al,
16791
- validator as am,
17047
+ MaterialEditableTable as a0,
17048
+ MultiLine as a1,
17049
+ MultiLineChart as a2,
17050
+ MultiSelect as a3,
17051
+ PageLoader as a4,
17052
+ QuickApprovalModal as a5,
17053
+ ReportButtons as a6,
17054
+ ReportTable as a7,
17055
+ ReportsTitleBar as a8,
17056
+ GeneralScheduleReport as a9,
17057
+ ScheduleReportModal as aa,
17058
+ Snackbar as ab,
17059
+ SubHeaderDoc as ac,
17060
+ TabBarUi as ad,
17061
+ TextArea as ae,
17062
+ TimeRangePicker as af,
17063
+ UomFieldWrapper as ag,
17064
+ Upload as ah,
17065
+ UserDropdown as ai,
17066
+ calculateOptimalSizes as aj,
17067
+ dynamicFields as ak,
17068
+ fields as al,
17069
+ useDynamicLayout as am,
17070
+ validator as an,
16792
17071
  ActivityTag$1 as b,
16793
17072
  AddressModal as c,
16794
17073
  AdvancedDynamicLayoutWrapper as d,
@@ -16811,8 +17090,8 @@ export {
16811
17090
  DashBoardCard as u,
16812
17091
  DashBoardHeader as v,
16813
17092
  DateRangePicker as w,
16814
- DonutChart$1 as x,
16815
- DyanmicTextEditor as y,
16816
- DynamicDateRange as z
17093
+ DocumentPreview as x,
17094
+ DonutChart$1 as y,
17095
+ DyanmicTextEditor as z
16817
17096
  };
16818
- //# sourceMappingURL=uom-field-wrapper-BlJaV_Jd.esm.js.map
17097
+ //# sourceMappingURL=uom-field-wrapper-CvW-ILPC.esm.js.map