@erpsquad/common 1.10.65 → 1.10.67

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-BP2CP-ah.js → android-12-switch-CPchopCJ.js} +67 -61
  6. package/dist/chunks/android-12-switch-CPchopCJ.js.map +1 -0
  7. package/dist/chunks/{android-12-switch-CrpXnQsd.esm.js → android-12-switch-CRhzpgwy.esm.js} +67 -61
  8. package/dist/chunks/android-12-switch-CRhzpgwy.esm.js.map +1 -0
  9. package/dist/chunks/{appbar-Bb4MdbyO.js → appbar-CLVklo7i.js} +3 -3
  10. package/dist/chunks/{appbar-Bb4MdbyO.js.map → appbar-CLVklo7i.js.map} +1 -1
  11. package/dist/chunks/{appbar-CHxm7L_f.esm.js → appbar-JugRLTTB.esm.js} +3 -3
  12. package/dist/chunks/{appbar-CHxm7L_f.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-WODnnwD5.js → default-data-BV11jE2f.js} +6 -6
  18. package/dist/chunks/{default-data-WODnnwD5.js.map → default-data-BV11jE2f.js.map} +1 -1
  19. package/dist/chunks/{default-data-7fDwUquk.esm.js → default-data-CttLHjij.esm.js} +6 -6
  20. package/dist/chunks/{default-data-7fDwUquk.esm.js.map → default-data-CttLHjij.esm.js.map} +1 -1
  21. package/dist/chunks/{fullScreen-BJR97bsP.js → fullScreen-DrLlR1HI.js} +2 -2
  22. package/dist/chunks/{fullScreen-BJR97bsP.js.map → fullScreen-DrLlR1HI.js.map} +1 -1
  23. package/dist/chunks/{fullScreen-uN74Cs7z.esm.js → fullScreen-TJdVNF4N.esm.js} +2 -2
  24. package/dist/chunks/{fullScreen-uN74Cs7z.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-Df3O8Xw6.js → sidebar-BOpyMIRe.js} +2 -2
  38. package/dist/chunks/{sidebar-Df3O8Xw6.js.map → sidebar-BOpyMIRe.js.map} +1 -1
  39. package/dist/chunks/{sidebar-C_fhINvI.esm.js → sidebar-Cc9-z3ES.esm.js} +2 -2
  40. package/dist/chunks/{sidebar-C_fhINvI.esm.js.map → sidebar-Cc9-z3ES.esm.js.map} +1 -1
  41. package/dist/chunks/{sidebarScreen-BbczvGnM.js → sidebarScreen-C6RJT1PK.js} +3 -3
  42. package/dist/chunks/{sidebarScreen-BbczvGnM.js.map → sidebarScreen-C6RJT1PK.js.map} +1 -1
  43. package/dist/chunks/{sidebarScreen-Df0FcbCe.esm.js → sidebarScreen-kbpZZe_u.esm.js} +3 -3
  44. package/dist/chunks/{sidebarScreen-Df0FcbCe.esm.js.map → sidebarScreen-kbpZZe_u.esm.js.map} +1 -1
  45. package/dist/chunks/{uom-field-wrapper-BN-gHLZh.esm.js → uom-field-wrapper-CvW-ILPC.esm.js} +465 -222
  46. package/dist/chunks/uom-field-wrapper-CvW-ILPC.esm.js.map +1 -0
  47. package/dist/chunks/{uom-field-wrapper-DQKUL4a5.js → uom-field-wrapper-QpAULeef.js} +413 -170
  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 +23 -2
  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 +23 -2
  73. package/dist/src/components/upload-media/upload-media.d.ts +1 -0
  74. package/dist/style.css +4 -1
  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-BP2CP-ah.js.map +0 -1
  79. package/dist/chunks/android-12-switch-CrpXnQsd.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-BN-gHLZh.esm.js.map +0 -1
  83. package/dist/chunks/uom-field-wrapper-DQKUL4a5.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-CrpXnQsd.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-CHxm7L_f.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-C_fhINvI.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";
@@ -4264,29 +4267,9 @@ const AddressModal = ({
4264
4267
  placeholder: t(`accounting.${translationKey}.addressModal.address3_placeholder`)
4265
4268
  }
4266
4269
  ) }),
4267
- /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4268
- DynamicInput,
4269
- {
4270
- type: "text",
4271
- formControl: control,
4272
- label: t(`accounting.${translationKey}.addressModal.streetName_label`),
4273
- name: "street_name",
4274
- fieldArrayName: "addresses",
4275
- placeholder: t(`accounting.${translationKey}.addressModal.streetName_placeholder`)
4276
- }
4277
- ) }),
4278
4270
  isKSA,
4279
- /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4280
- DynamicInput,
4281
- {
4282
- type: "text",
4283
- formControl: control,
4284
- label: t(`accounting.${translationKey}.addressModal.nationalAddress_label`),
4285
- name: "national_address",
4286
- fieldArrayName: "addresses",
4287
- placeholder: t(`accounting.${translationKey}.addressModal.nationalAddress_placeholder`)
4288
- }
4289
- ) }),
4271
+ isKSA,
4272
+ isKSA,
4290
4273
  /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4291
4274
  DynamicInput,
4292
4275
  {
@@ -4336,17 +4319,7 @@ const AddressModal = ({
4336
4319
  formControl: control
4337
4320
  }
4338
4321
  ) }),
4339
- /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4340
- DynamicInput,
4341
- {
4342
- type: "text",
4343
- formControl: control,
4344
- label: t(`accounting.${translationKey}.addressModal.districtName_label`),
4345
- name: "district_name",
4346
- fieldArrayName: "addresses",
4347
- placeholder: t(`accounting.${translationKey}.addressModal.districtName_placeholder`)
4348
- }
4349
- ) }),
4322
+ isKSA,
4350
4323
  /* @__PURE__ */ jsxRuntimeExports.jsx(Grid, { item: true, sm: 6, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
4351
4324
  DynamicInput,
4352
4325
  {
@@ -4657,6 +4630,135 @@ const DashBoardHeader = ({ title, customElement, showEdit = true, showDropDowan
4657
4630
  ] })
4658
4631
  ] }) });
4659
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
+ };
4660
4762
  const ExpandableSummaryWrapper = ({
4661
4763
  children,
4662
4764
  defaultExpanded = true,
@@ -10331,9 +10433,8 @@ const ReportsTitleBar = (props) => {
10331
10433
  ];
10332
10434
  const [selectedItems, setSelectedItems] = useState(defaultSelected);
10333
10435
  const [level, setLevel] = useState(1);
10334
- const [actionAnchorEl, setActionAnchorEl] = useState(
10335
- null
10336
- );
10436
+ const [actionAnchorEl, setActionAnchorEl] = useState(null);
10437
+ const [appliedFiltersAnchorEl, setAppliedFiltersAnchorEl] = useState(null);
10337
10438
  const [allFields, setAllFields] = useState([]);
10338
10439
  const [dateRange, setDateRange] = useState();
10339
10440
  const [open, setOpen] = useState(false);
@@ -10430,6 +10531,19 @@ const ReportsTitleBar = (props) => {
10430
10531
  multiple: filter.multiple || false,
10431
10532
  options: filter.options || void 0
10432
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]);
10433
10547
  useEffect(() => {
10434
10548
  if (!autoShowFiltersWithValue) return;
10435
10549
  setSelectedItems((prev) => {
@@ -10600,9 +10714,10 @@ const ReportsTitleBar = (props) => {
10600
10714
  multiple = false,
10601
10715
  options: options2,
10602
10716
  show = true,
10603
- showCancelButton = true
10717
+ showCancelButton = true,
10718
+ forceShow = false
10604
10719
  }) => {
10605
- if (!showFilter(key) || !show) return null;
10720
+ if (!showFilter(key) && !forceShow || !show) return null;
10606
10721
  const companyKey = (filterKeys == null ? void 0 : filterKeys.company) || "company";
10607
10722
  const companyId = filters == null ? void 0 : filters[companyKey];
10608
10723
  const hasCompany = Array.isArray(companyId) ? companyId.length > 0 : !!companyId;
@@ -10632,13 +10747,12 @@ const ReportsTitleBar = (props) => {
10632
10747
  }
10633
10748
  );
10634
10749
  };
10635
- const FilterContainer = () => /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10636
- filtersConfig.map(renderFilter),
10637
- customFilterComponents.map(({ key, component }) => /* @__PURE__ */ jsxRuntimeExports.jsx(React__default.Fragment, { children: component }, key))
10638
- ] });
10639
10750
  const handleFilterClose = () => {
10640
10751
  setActionAnchorEl(null);
10641
10752
  };
10753
+ const handleAppliedFilterClose = () => {
10754
+ setAppliedFiltersAnchorEl(null);
10755
+ };
10642
10756
  const ExportContainer = React__default.memo(() => {
10643
10757
  var _a2;
10644
10758
  const handleClose2 = () => setExportAnchorEl(null);
@@ -10685,27 +10799,7 @@ const ReportsTitleBar = (props) => {
10685
10799
  }
10686
10800
  ) }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { type: "h3", weight: "medium", color: "theme.secondary.1000", children: title }) }),
10687
10801
  searchBar && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "reportsTitleBar--SearchBar", children: searchBar }),
10688
- /* @__PURE__ */ jsxRuntimeExports.jsx(
10689
- ReportButtons,
10690
- {
10691
- zIndex: 999,
10692
- className: "reportsTitleBar--RightContent",
10693
- buttons
10694
- }
10695
- )
10696
- ] }),
10697
- (tabs == null ? void 0 : tabs.length) ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
10698
- TabBar,
10699
- {
10700
- tabs: tabs || [],
10701
- activeValue,
10702
- setActiveValue,
10703
- isTabViewOnly: true
10704
- }
10705
- ) }) : null,
10706
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", justifyContent: "space-between", my: 2.5, alignItems: "center", flexWrap: "wrap", gap: 1 }, children: [
10707
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "reportsTitleBar--FilterWrapper", children: [
10708
- FilterContainer(),
10802
+ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "reportsTitleBar--RightContent", children: [
10709
10803
  showDateFilter && isDateRange && (filters == null ? void 0 : filters[endDateKey]) && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { display: "flex", gap: "8px" }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
10710
10804
  "div",
10711
10805
  {
@@ -10846,110 +10940,165 @@ const ReportsTitleBar = (props) => {
10846
10940
  /* @__PURE__ */ jsxRuntimeExports.jsx(default_1$5, {})
10847
10941
  ]
10848
10942
  }
10849
- ) })
10850
- ] }),
10851
- /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "report-display", children: [
10852
- ((_a = dropdownMenuButtonData == null ? void 0 : dropdownMenuButtonData.options) == null ? void 0 : _a.length) > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { children: [
10853
- /* @__PURE__ */ jsxRuntimeExports.jsx(
10854
- Button,
10855
- {
10856
- sx: ({ palette }) => ({
10857
- border: "1px solid",
10858
- borderColor: "grey.200",
10859
- borderRadius: "50px",
10860
- color: `${palette.grey[800]} !important`,
10861
- "&:hover": {
10862
- bgcolor: `${palette.grey[200]} !important`
10863
- }
10864
- }),
10865
- variant: "text",
10866
- startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(Export, { fontSize: "small" }),
10867
- onClick: (event) => setExportAnchorEl(event.currentTarget),
10868
- children: t("common.export")
10869
- }
10870
- ),
10871
- exportAnchorEl && /* @__PURE__ */ jsxRuntimeExports.jsx(ExportContainer, {})
10872
- ] }),
10873
- (filterDropDown == null ? void 0 : filterDropDown.length) && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10874
- /* @__PURE__ */ jsxRuntimeExports.jsx(Box, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
10875
- Button,
10876
- {
10877
- sx: ({ palette }) => ({
10878
- border: "1px solid",
10879
- borderColor: "grey.200",
10880
- borderRadius: "50px",
10881
- color: `${palette.grey[800]} !important`,
10882
- "&:hover": {
10883
- 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
10884
11049
  }
10885
- }),
10886
- variant: "text",
10887
- startIcon: /* @__PURE__ */ jsxRuntimeExports.jsx(Filter, { fontSize: "small" }),
10888
- onClick: (event) => setActionAnchorEl(event.currentTarget),
10889
- children: t("common.filter")
10890
- }
10891
- ) }),
10892
- showLevelBtn && /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { flexItem: true, orientation: "vertical", sx: { height: "50%", alignSelf: "auto" } })
10893
- ] }),
10894
- filterDropDownFunc(),
10895
- showLevelBtn && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10896
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { className: "reportsTitleBar--FilterAction--lvWrapper", children: [
10897
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Typography, { type: "s3", weight: "medium", color: "grey.800", children: [
10898
- " Level ",
10899
- level,
10900
- " of ",
10901
- 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
+ ] })
10902
11060
  ] }),
10903
- /* @__PURE__ */ jsxRuntimeExports.jsxs(ButtonGroup, { variant: "outlined", disableElevation: true, sx: ({ palette }) => ({
10904
- "& .MuiButton-root": {
10905
- borderColor: `${palette.grey[200]} !important`,
10906
- "&:hover": {
10907
- bgcolor: `${palette.grey[200]} !important`
10908
- }
10909
- },
10910
- "& .MuiButtonGroup-firstButton": {
10911
- borderTopLeftRadius: 20,
10912
- borderBottomLeftRadius: 20
10913
- },
10914
- "& .MuiButtonGroup-lastButton": {
10915
- borderTopRightRadius: 20,
10916
- borderBottomRightRadius: 20
10917
- }
10918
- }), children: [
10919
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { onClick: () => {
10920
- setLevel(level == dataLength ? level : level + 1);
10921
- handleRowsCollapse == null ? void 0 : handleRowsCollapse(level);
10922
- }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: images.common.expand }) }),
10923
- /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { onClick: () => {
10924
- setLevel(level != 1 ? level - 1 : 1);
10925
- handleRowsExpand == null ? void 0 : handleRowsExpand(level);
10926
- }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: images.common.collapse }) })
10927
- ] })
11061
+ isDateFilterEnabled && /* @__PURE__ */ jsxRuntimeExports.jsx(Divider, { flexItem: true, orientation: "vertical", sx: { height: "50%", alignSelf: "auto" } })
10928
11062
  ] }),
10929
- 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
+ ] })
10930
11083
  ] }),
10931
- isDateFilterEnabled && showDateFilter && /* @__PURE__ */ jsxRuntimeExports.jsxs(Box, { sx: { display: "flex", alignItems: "center", gap: 0.5 }, children: [
10932
- /* @__PURE__ */ jsxRuntimeExports.jsx(Typography, { type: "s3", weight: "medium", color: "grey.800", children: "As of: " }),
10933
- /* @__PURE__ */ jsxRuntimeExports.jsx(
10934
- ReportButtons,
10935
- {
10936
- zIndex: 997,
10937
- className: "reportsTitleBar--RightContent",
10938
- dropdownMenuButtonData: {
10939
- icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Calendar$1, { fontSize: "small" }),
10940
- children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
10941
- RANGE[dateRange],
10942
- /* @__PURE__ */ jsxRuntimeExports.jsx(default_1$5, {})
10943
- ] }),
10944
- options
10945
- },
10946
- toggleCallback
10947
- }
10948
- ),
10949
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: dateSelectRef })
10950
- ] })
11084
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
11085
+ ReportButtons,
11086
+ {
11087
+ zIndex: 999,
11088
+ buttons
11089
+ }
11090
+ )
10951
11091
  ] })
10952
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,
10953
11102
  /* @__PURE__ */ jsxRuntimeExports.jsx(
10954
11103
  Popper,
10955
11104
  {
@@ -11010,6 +11159,99 @@ const ReportsTitleBar = (props) => {
11010
11159
  }
11011
11160
  )
11012
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
+ }
11013
11255
  )
11014
11256
  ] });
11015
11257
  };
@@ -16773,58 +17015,59 @@ const UomFieldWrapper = ({
16773
17015
  );
16774
17016
  };
16775
17017
  export {
16776
- MaterialEditableTable as $,
17018
+ ListingComponent as $,
16777
17019
  AISummaryPanel as A,
16778
17020
  BarChart as B,
16779
17021
  CalculationSummary as C,
16780
17022
  DonutChart as D,
16781
- DynamicDateTime as E,
16782
- DynamicLayoutWrapper as F,
17023
+ DynamicDateRange as E,
17024
+ DynamicDateTime as F,
16783
17025
  GridCard as G,
16784
- DynamicModal as H,
16785
- ElementController as I,
16786
- EntityViewWrapper as J,
16787
- ExpandableSummaryWrapper as K,
16788
- FormData as L,
16789
- FormLoader as M,
16790
- Forms as N,
16791
- GanttChart as O,
16792
- GridCard$1 as P,
16793
- GridCardMarkup as Q,
16794
- GridFallback as R,
16795
- GridWrapper as S,
16796
- GroupedBarChart as T,
16797
- HrLine as U,
16798
- InventoryReportsTitleBar as V,
16799
- ItemResponseDetails as W,
16800
- LabelValue as X,
16801
- LineChart as Y,
16802
- List as Z,
16803
- 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 _,
16804
17046
  ActivityTag as a,
16805
- MultiLine as a0,
16806
- MultiLineChart as a1,
16807
- MultiSelect as a2,
16808
- PageLoader as a3,
16809
- QuickApprovalModal as a4,
16810
- ReportButtons as a5,
16811
- ReportTable as a6,
16812
- ReportsTitleBar as a7,
16813
- GeneralScheduleReport as a8,
16814
- ScheduleReportModal as a9,
16815
- Snackbar as aa,
16816
- SubHeaderDoc as ab,
16817
- TabBarUi as ac,
16818
- TextArea as ad,
16819
- TimeRangePicker as ae,
16820
- UomFieldWrapper as af,
16821
- Upload as ag,
16822
- UserDropdown as ah,
16823
- calculateOptimalSizes as ai,
16824
- dynamicFields as aj,
16825
- fields as ak,
16826
- useDynamicLayout as al,
16827
- 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,
16828
17071
  ActivityTag$1 as b,
16829
17072
  AddressModal as c,
16830
17073
  AdvancedDynamicLayoutWrapper as d,
@@ -16847,8 +17090,8 @@ export {
16847
17090
  DashBoardCard as u,
16848
17091
  DashBoardHeader as v,
16849
17092
  DateRangePicker as w,
16850
- DonutChart$1 as x,
16851
- DyanmicTextEditor as y,
16852
- DynamicDateRange as z
17093
+ DocumentPreview as x,
17094
+ DonutChart$1 as y,
17095
+ DyanmicTextEditor as z
16853
17096
  };
16854
- //# sourceMappingURL=uom-field-wrapper-BN-gHLZh.esm.js.map
17097
+ //# sourceMappingURL=uom-field-wrapper-CvW-ILPC.esm.js.map