@codezee/sixtify-brahma 0.2.149 → 0.2.151

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 (47) hide show
  1. package/package.json +4 -1
  2. package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.d.ts.map +1 -1
  3. package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.js +8 -13
  4. package/packages/shared-components/dist/FormFields/Autocomplete/AvatarCell.d.ts.map +1 -1
  5. package/packages/shared-components/dist/FormFields/Autocomplete/AvatarCell.js +2 -9
  6. package/packages/shared-components/dist/FormFields/Autocomplete/Tags.d.ts.map +1 -1
  7. package/packages/shared-components/dist/FormFields/Autocomplete/Tags.js +3 -2
  8. package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.d.ts.map +1 -1
  9. package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.js +17 -6
  10. package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.d.ts +2 -2
  11. package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.d.ts.map +1 -1
  12. package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.js +1 -1
  13. package/packages/shared-components/dist/SmartGrid/Components/FilterStatusPanel.d.ts.map +1 -1
  14. package/packages/shared-components/dist/SmartGrid/Components/FilterStatusPanel.js +6 -2
  15. package/packages/shared-components/dist/SmartGrid/exportUtils/helper.d.ts +9 -0
  16. package/packages/shared-components/dist/SmartGrid/exportUtils/helper.d.ts.map +1 -0
  17. package/packages/shared-components/dist/SmartGrid/exportUtils/helper.js +90 -0
  18. package/packages/shared-components/dist/SmartGrid/exportUtils/index.d.ts +3 -0
  19. package/packages/shared-components/dist/SmartGrid/exportUtils/index.d.ts.map +1 -0
  20. package/packages/shared-components/dist/SmartGrid/exportUtils/index.js +18 -0
  21. package/packages/shared-components/dist/SmartGrid/exportUtils/types.d.ts +49 -0
  22. package/packages/shared-components/dist/SmartGrid/exportUtils/types.d.ts.map +1 -0
  23. package/packages/shared-components/dist/SmartGrid/exportUtils/types.js +2 -0
  24. package/packages/shared-components/dist/SmartGrid/hooks/index.d.ts +2 -0
  25. package/packages/shared-components/dist/SmartGrid/hooks/index.d.ts.map +1 -0
  26. package/packages/shared-components/dist/SmartGrid/hooks/index.js +17 -0
  27. package/packages/shared-components/dist/SmartGrid/hooks/useExportToExcel.d.ts +7 -0
  28. package/packages/shared-components/dist/SmartGrid/hooks/useExportToExcel.d.ts.map +1 -0
  29. package/packages/shared-components/dist/SmartGrid/hooks/useExportToExcel.js +241 -0
  30. package/packages/shared-components/dist/SmartGrid/index.d.ts +1 -0
  31. package/packages/shared-components/dist/SmartGrid/index.d.ts.map +1 -1
  32. package/packages/shared-components/dist/SmartGrid/index.js +1 -0
  33. package/packages/shared-components/dist/SmartGrid/utils/helper.d.ts.map +1 -1
  34. package/packages/shared-components/dist/SmartGrid/utils/helper.js +2 -1
  35. package/packages/shared-components/dist/codeSnippetBox/CodeSnippetBox.d.ts +4 -3
  36. package/packages/shared-components/dist/codeSnippetBox/CodeSnippetBox.d.ts.map +1 -1
  37. package/packages/shared-components/dist/codeSnippetBox/CodeSnippetBox.js +38 -2
  38. package/packages/shared-components/dist/codeSnippetBox/CodeSnippetBox.styled.d.ts.map +1 -1
  39. package/packages/shared-components/dist/codeSnippetBox/CodeSnippetBox.styled.js +3 -10
  40. package/packages/shared-components/dist/utils/helper.d.ts +1 -0
  41. package/packages/shared-components/dist/utils/helper.d.ts.map +1 -1
  42. package/packages/shared-components/dist/utils/helper.js +31 -1
  43. package/packages/shared-components/dist/utils/regex.d.ts +2 -0
  44. package/packages/shared-components/dist/utils/regex.d.ts.map +1 -1
  45. package/packages/shared-components/dist/utils/regex.js +5 -1
  46. package/packages/shared-components/dist/utils/theme/theme.d.ts.map +1 -1
  47. package/packages/shared-components/dist/utils/theme/theme.js +0 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codezee/sixtify-brahma",
3
- "version": "0.2.149",
3
+ "version": "0.2.151",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/hardikranpariya/sixtify-brahma.git"
@@ -112,11 +112,13 @@
112
112
  "@tiptap/starter-kit": "^3.4.4",
113
113
  "@tiptap/suggestion": "^3.4.4",
114
114
  "@types/file-saver": "^2.0.7",
115
+ "@types/react-syntax-highlighter": "^15.5.13",
115
116
  "ag-grid-community": "^34.3.1",
116
117
  "ag-grid-react": "^34.3.1",
117
118
  "axios": "^1.7.2",
118
119
  "date-fns": "^4.1.0",
119
120
  "eslint-plugin-sonarjs": "1.0.4-alpha.1",
121
+ "exceljs": "^4.4.0",
120
122
  "file-saver": "^2.0.5",
121
123
  "file64": "1.0.1",
122
124
  "gh-pages": "^6.3.0",
@@ -132,6 +134,7 @@
132
134
  "react-i18next": "^14.1.2",
133
135
  "react-multi-carousel": "^2.8.5",
134
136
  "react-phone-input-2": "^2.15.1",
137
+ "react-syntax-highlighter": "^16.1.0",
135
138
  "react-toastify": "^10.0.5",
136
139
  "react-webcam": "7.2.0",
137
140
  "styled-components": "^6.1.11",
@@ -1 +1 @@
1
- {"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../../src/FormFields/Autocomplete/Autocomplete.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,IAAI,oBAAoB,EACzC,UAAU,EACX,MAAM,eAAe,CAAC;AAkBvB,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAEhB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACrB,MAAM,iBAAiB,CAAC;AAazB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,MAAM,MAAM,MAAM,GAAG;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE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AiB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACrE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAC9B,cAAc,CAAC,EAAE,UAAU,CAAC;IAC5B,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAChC,CAAC;AAEJ,wBAAgB,YAAY,CAAC,CAAC,SAAS,WAAW,EAAE,EAClD,OAAO,EACP,YAAY,EACZ,IAAI,EACJ,QAAgB,EAChB,KAAK,EACL,QAAgB,EAChB,QAAgB,EAChB,OAAY,EACZ,KAAK,EACL,OAAe,EACf,UAAU,EACV,KAAK,EACL,SAAiB,EACjB,WAAgB,EAChB,QAAQ,EACR,mBAA2B,EAC3B,eAAsB,EACtB,YAAoB,EACpB,kBAA0B,EAC1B,mBAA2B,EAC3B,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,QAAQ,EACR,SAAiB,EACjB,aAAa,EACb,gBAA0C,EAC1C,cAAc,EACd,QAAQ,EACR,SAAa,EACb,OAAkB,EAClB,GAAG,SAAS,EACb,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAobtB"}
@@ -39,7 +39,6 @@ function Autocomplete({ control, defaultValue, name, required = false, label, mu
39
39
  onChange(disabledValues);
40
40
  }
41
41
  };
42
- const highlightedOptionRef = (0, react_1.useRef)("");
43
42
  const isAllSelected = (0, react_1.useMemo)(() => {
44
43
  return (multiple &&
45
44
  isShowSelectAll &&
@@ -92,7 +91,7 @@ function Autocomplete({ control, defaultValue, name, required = false, label, mu
92
91
  const { palette: { app: { color }, }, } = (0, material_1.useTheme)();
93
92
  const StyledPaper = (0, styles_1.styled)(material_1.Paper)(({ theme }) => ({
94
93
  "& .MuiAutocomplete-listbox": {
95
- maxHeight: 150,
94
+ maxHeight: 300,
96
95
  overflowY: "auto",
97
96
  marginTop: "0px",
98
97
  "&::-webkit-scrollbar": {
@@ -137,13 +136,7 @@ function Autocomplete({ control, defaultValue, name, required = false, label, mu
137
136
  borderRadius: "50%",
138
137
  },
139
138
  width: "100%",
140
- }, onHighlightChange: (event, option) => {
141
- if (option) {
142
- if (highlightedOptionRef.current != option.value) {
143
- highlightedOptionRef.current = option.value;
144
- }
145
- }
146
- }, disableCloseOnSelect: shouldCloseOnSelect, disabled: disabled, freeSolo: freeSolo, ...restProps, ...restField, disableClearable: disableClearable, renderTags: (value, getTagProps) => {
139
+ }, disableCloseOnSelect: multiple || !shouldCloseOnSelect, disabled: disabled, freeSolo: freeSolo, ...restProps, ...restField, disableClearable: disableClearable, renderTags: (value, getTagProps) => {
147
140
  const visibleTags = limitTags ? value.slice(0, limitTags) : value;
148
141
  const hiddenCount = value.length - visibleTags.length;
149
142
  const hiddenTags = limitTags ? value.slice(limitTags) : value;
@@ -176,7 +169,7 @@ function Autocomplete({ control, defaultValue, name, required = false, label, mu
176
169
  }
177
170
  return placeholder || `Select ${label}`;
178
171
  };
179
- return ((0, jsx_runtime_1.jsx)(material_1.TextField, { ...params, placeholder: getPlaceholder(), label: styling === "default" ? label : undefined, required: styling === "default" ? required : undefined, error: error, autoFocus: autoFocus, helperText: helperText, sx: (0, commonStyles_1.getDefaultTextFieldSx)(styling), InputLabelProps: (0, commonStyles_1.getDefaultInputLabelProps)(styling), InputProps: {
172
+ return ((0, jsx_runtime_1.jsx)(material_1.TextField, { ...params, placeholder: multiple && selectedValue?.length ? "" : getPlaceholder(), label: styling === "default" ? label : undefined, required: styling === "default" ? required : undefined, error: error, autoFocus: !multiple ? autoFocus : false, helperText: helperText, sx: (0, commonStyles_1.getDefaultTextFieldSx)(styling), InputLabelProps: (0, commonStyles_1.getDefaultInputLabelProps)(styling), InputProps: {
180
173
  ...params.InputProps,
181
174
  startAdornment,
182
175
  }, onChange: (e) => {
@@ -184,7 +177,7 @@ function Autocomplete({ control, defaultValue, name, required = false, label, mu
184
177
  setInputValue(e.target.value);
185
178
  }
186
179
  } }));
187
- }, multiple: multiple, options: isShowOptionsOnType ? filteredOptions : memoizedOptions, isOptionEqualToValue: (option, value) => freeSolo ? false : option.value === value.value, getOptionLabel: (option) => {
180
+ }, blurOnSelect: !multiple, multiple: multiple, options: isShowOptionsOnType ? filteredOptions : memoizedOptions, isOptionEqualToValue: (option, value) => freeSolo ? false : option.value === value.value, getOptionLabel: (option) => {
188
181
  if (getOptionLabel) {
189
182
  return getOptionLabel(option);
190
183
  }
@@ -233,6 +226,8 @@ function Autocomplete({ control, defaultValue, name, required = false, label, mu
233
226
  }
234
227
  return ((0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)(GroupHeader, { children: params.group }), (0, jsx_runtime_1.jsx)(GroupItems, { children: params.children })] }, params.key));
235
228
  }, getOptionDisabled: (option) => !!option.disabled, onBlur: () => {
236
- setInputValue("");
237
- } }), onAction && (0, jsx_runtime_1.jsx)(Actions_1.EditIconAction, { disabled: disabled, onClick: onAction })] })] }));
229
+ if (!multiple) {
230
+ setInputValue("");
231
+ }
232
+ }, autoHighlight: true }), onAction && (0, jsx_runtime_1.jsx)(Actions_1.EditIconAction, { disabled: disabled, onClick: onAction })] })] }));
238
233
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AvatarCell.d.ts","sourceRoot":"","sources":["../../../src/FormFields/Autocomplete/AvatarCell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,KAAK,eAAe,GAAG;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,kCAIxB,eAAe,wDAiBjB,CAAC"}
1
+ {"version":3,"file":"AvatarCell.d.ts","sourceRoot":"","sources":["../../../src/FormFields/Autocomplete/AvatarCell.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,KAAK,eAAe,GAAG;IACrB,YAAY,EAAE,OAAO,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,kCAIxB,eAAe,wDAQjB,CAAC"}
@@ -4,17 +4,10 @@ exports.AvatarCell = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
6
  const AvatarCell = ({ isShowAvatar, option, label, }) => {
7
- const { avatar } = option;
7
+ const { avatar = "" } = option;
8
8
  if (!isShowAvatar) {
9
9
  return undefined;
10
10
  }
11
- if (avatar) {
12
- return (0, jsx_runtime_1.jsx)(material_1.Avatar, { sx: { width: 25, height: 25 }, src: avatar, alt: label });
13
- }
14
- const initials = label
15
- .split(" ")
16
- .map((word) => word[0]?.toUpperCase())
17
- .join("");
18
- return (0, jsx_runtime_1.jsx)(material_1.Avatar, { sx: { width: 25, height: 25 }, children: initials });
11
+ return (0, jsx_runtime_1.jsx)(material_1.Avatar, { sx: { width: 25, height: 25 }, src: avatar, alt: label });
19
12
  };
20
13
  exports.AvatarCell = AvatarCell;
@@ -1 +1 @@
1
- {"version":3,"file":"Tags.d.ts","sourceRoot":"","sources":["../../../src/FormFields/Autocomplete/Tags.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAI7C,KAAK,SAAS,GAAG,QAAQ,CAAC;IACxB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,WAAW,EAAE,6BAA6B,CAAC;IAC3C,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,eAAO,MAAM,IAAI,GAAI,4DAMlB,SAAS,8CA0BX,CAAC"}
1
+ {"version":3,"file":"Tags.d.ts","sourceRoot":"","sources":["../../../src/FormFields/Autocomplete/Tags.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,6BAA6B,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAI7C,KAAK,SAAS,GAAG,QAAQ,CAAC;IACxB,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,WAAW,EAAE,6BAA6B,CAAC;IAC3C,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC,CAAC;AAEH,eAAO,MAAM,IAAI,GAAI,4DAMlB,SAAS,8CA6BX,CAAC"}
@@ -7,11 +7,12 @@ const Chip_styled_1 = require("./Chip.styled");
7
7
  const Tags = ({ tags, getTagProps, isShowAvatar, disabled, startIndex, }) => {
8
8
  return tags.map((option, index) => {
9
9
  const realIndex = startIndex + index;
10
- const { key, ...tagProps } = getTagProps({
10
+ const { key, onDelete, ...tagProps } = getTagProps({
11
11
  index: realIndex,
12
12
  });
13
13
  const label = typeof option === "string" ? option : option.label;
14
- return ((0, jsx_runtime_1.jsx)(Chip_styled_1.StyledChip, { avatar: (0, jsx_runtime_1.jsx)(AvatarCell_1.AvatarCell, { isShowAvatar: isShowAvatar, option: option, label: label }), label: label, ...tagProps, disabled: option.disabled || disabled }, key));
14
+ const isDisabled = option.disabled || disabled;
15
+ return ((0, jsx_runtime_1.jsx)(Chip_styled_1.StyledChip, { avatar: (0, jsx_runtime_1.jsx)(AvatarCell_1.AvatarCell, { isShowAvatar: isShowAvatar, option: option, label: label }), label: label, ...tagProps, disabled: isDisabled, onDelete: isDisabled ? undefined : onDelete }, key));
15
16
  });
16
17
  };
17
18
  exports.Tags = Tags;
@@ -1 +1 @@
1
- {"version":3,"file":"FacetedFilter.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/FacetedFilter/FacetedFilter.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAUpD,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,EAAG,8BAG/B,kBAAkB,CAAC,CAAC,CAAC,4CAoTvB,CAAC"}
1
+ {"version":3,"file":"FacetedFilter.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/FacetedFilter/FacetedFilter.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAUpD,KAAK,kBAAkB,CAAC,CAAC,IAAI;IAC3B,MAAM,EAAE,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAC3B,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,CAAC,EAAG,8BAG/B,kBAAkB,CAAC,CAAC,CAAC,4CAgUvB,CAAC"}
@@ -131,18 +131,29 @@ const FacetedFilter = ({ header, resetAllFilters, }) => {
131
131
  handleReset();
132
132
  }
133
133
  }, [resetAllFilters]);
134
- return ((0, jsx_runtime_1.jsxs)("div", { style: { position: "relative" }, children: [(0, jsx_runtime_1.jsxs)(material_1.IconButton, { ref: buttonRef, onClick: () => setIsOpen(!isOpen), sx: { padding: 0, position: "relative" }, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: "Faceted Filter", children: (0, jsx_runtime_1.jsx)(icons_material_1.FilterListRounded, {}) }), activeFilterCount > 0 && ((0, jsx_runtime_1.jsx)("span", { style: {
134
+ const hasActiveFilter = activeFilterCount > 0;
135
+ return ((0, jsx_runtime_1.jsxs)("div", { style: { position: "relative" }, children: [(0, jsx_runtime_1.jsxs)(material_1.IconButton, { ref: buttonRef, onClick: () => setIsOpen(!isOpen), sx: {
136
+ padding: "2px",
137
+ position: "relative",
138
+ backgroundColor: hasActiveFilter
139
+ ? (0, material_1.lighten)(butterflyBlue[900], 0.7)
140
+ : "transparent",
141
+ "&:hover": {
142
+ backgroundColor: hasActiveFilter
143
+ ? (0, material_1.lighten)(butterflyBlue[900], 0.7)
144
+ : (0, material_1.lighten)(iron[500], 0.7),
145
+ },
146
+ }, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { toolTipLabel: "Faceted Filter", children: (0, jsx_runtime_1.jsx)(icons_material_1.FilterListRounded, {}) }), hasActiveFilter && ((0, jsx_runtime_1.jsx)("span", { style: {
135
147
  backgroundColor: butterflyBlue[900],
136
- border: `2px solid ${iron[600]}`,
137
148
  borderRadius: "50%",
138
149
  color: iron[600],
139
150
  fontSize: "10px",
140
151
  fontWeight: "bold",
141
- height: "6px",
152
+ height: "7px",
142
153
  position: "absolute",
143
- right: 0,
144
- top: 1,
145
- width: "6px",
154
+ right: 4,
155
+ top: 4,
156
+ width: "7px",
146
157
  } }))] }), isOpen && ((0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, { onClickAway: handleClickAway, children: (0, jsx_runtime_1.jsxs)("div", { ref: popoverRef, style: {
147
158
  backgroundColor: iron[600],
148
159
  borderRadius: "6px",
@@ -1,7 +1,7 @@
1
1
  type VirtualCheckboxListProps = {
2
2
  checkedMap: Record<string, boolean>;
3
- onToggle: (value: string) => void;
4
- options: string[];
3
+ onToggle: (value: string | number) => void;
4
+ options: (string | number)[];
5
5
  };
6
6
  export declare const VirtualCheckboxList: import("react").MemoExoticComponent<({ checkedMap, onToggle, options }: VirtualCheckboxListProps) => import("react/jsx-runtime").JSX.Element>;
7
7
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualCheckboxList.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.tsx"],"names":[],"mappings":"AAIA,KAAK,wBAAwB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,mBAAmB,0EACM,wBAAwB,6CA2K7D,CAAC"}
1
+ {"version":3,"file":"VirtualCheckboxList.d.ts","sourceRoot":"","sources":["../../../../src/SmartGrid/Components/FacetedFilter/VirtualCheckboxList.tsx"],"names":[],"mappings":"AAIA,KAAK,wBAAwB,GAAG;IAC9B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAC3C,OAAO,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,0EACM,wBAAwB,6CA2K7D,CAAC"}
@@ -95,7 +95,7 @@ exports.VirtualCheckboxList = (0, react_1.memo)(({ checkedMap, onToggle, options
95
95
  overflow: "hidden",
96
96
  textOverflow: "ellipsis",
97
97
  width: "150px",
98
- }, children: (0, helper_1.formatDateValue)(value) })] }, value));
98
+ }, children: typeof value === "string" ? (0, helper_1.formatDateValue)(value) : value })] }, value));
99
99
  }) }) }) }));
100
100
  });
101
101
  exports.VirtualCheckboxList.displayName = "VirtualCheckboxList";
@@ -1 +1 @@
1
- {"version":3,"file":"FilterStatusPanel.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/Components/FilterStatusPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAIlD,KAAK,sBAAsB,CAAC,CAAC,IAAI;IAC/B,eAAe,EAAE,QAAQ,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAG,6BAGnC,sBAAsB,CAAC,CAAC,CAAC,4CA2I3B,CAAC"}
1
+ {"version":3,"file":"FilterStatusPanel.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/Components/FilterStatusPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAIlD,KAAK,sBAAsB,CAAC,CAAC,IAAI;IAC/B,eAAe,EAAE,QAAQ,CAAC;IAC1B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,CAAC,EAAG,6BAGnC,sBAAsB,CAAC,CAAC,CAAC,4CAiJ3B,CAAC"}
@@ -30,7 +30,7 @@ const FilterStatusPanel = ({ clearAllFilters, table, }) => {
30
30
  // Handle primitive filters (string/number)
31
31
  if (typeof filter === "string" || typeof filter === "number") {
32
32
  return {
33
- facets: filter !== "" ? [String(filter)] : [],
33
+ facets: filter !== "" ? [filter] : [],
34
34
  search: [],
35
35
  };
36
36
  }
@@ -51,7 +51,11 @@ const FilterStatusPanel = ({ clearAllFilters, table, }) => {
51
51
  const filter = header.column.getFilterValue();
52
52
  const { facets, search } = extractFilterValues(filter);
53
53
  const hasValues = facets.length > 0 || search.length > 0;
54
- return hasValues ? ((0, jsx_runtime_1.jsxs)(material_1.Stack, { flexDirection: "row", gap: "3px", children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "caption", fontWeight: 600, children: [header.column.columnDef.header, ":"] }), facets.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", sx: { color: butterflyBlue[900] }, children: facets.map(helper_1.formatDateValue).join(", ") })), facets.length > 0 && search.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", children: "," })), search.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", sx: { color: brown[900] }, children: search.join(", ") }))] }, header.id)) : null;
54
+ return hasValues ? ((0, jsx_runtime_1.jsxs)(material_1.Stack, { flexDirection: "row", gap: "3px", children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, { variant: "caption", fontWeight: 600, children: [header.column.columnDef.header, ":"] }), facets.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", sx: { color: butterflyBlue[900] }, children: facets
55
+ .map((value) => typeof value === "string"
56
+ ? (0, helper_1.formatDateValue)(value)
57
+ : value)
58
+ .join(", ") })), facets.length > 0 && search.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", children: "," })), search.length > 0 && ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "caption", sx: { color: brown[900] }, children: search.join(", ") }))] }, header.id)) : null;
55
59
  })
56
60
  .filter(Boolean);
57
61
  // Don't render if no filters applied
@@ -0,0 +1,9 @@
1
+ import type { CellValue, ExcelRow, VisibleColumn } from "./types";
2
+ export declare function getColumnLabel(col: VisibleColumn): string;
3
+ export declare function createEmptyRow(headers: string[]): Record<string, CellValue>;
4
+ export declare function createEmptyTotals(numericCols: Set<string>): Record<string, number>;
5
+ export declare const toCellValue: (input: unknown) => CellValue;
6
+ export declare const formatCellForExcel: (value: CellValue, rowType: ExcelRow["type"], isGroupingColumn: boolean) => CellValue;
7
+ export declare function extractTextForWidth(cellValue: unknown): string;
8
+ export declare const hslaToArgb: (hsla: string) => string;
9
+ //# sourceMappingURL=helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/exportUtils/helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGlE,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,MAAM,CAIzD;AAGD,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAE3E;AAGD,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,GACvB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAExB;AAGD,eAAO,MAAM,WAAW,GAAI,OAAO,OAAO,KAAG,SAyB5C,CAAC;AAGF,eAAO,MAAM,kBAAkB,GAC7B,OAAO,SAAS,EAChB,SAAS,QAAQ,CAAC,MAAM,CAAC,EACzB,kBAAkB,OAAO,KACxB,SAcF,CAAC;AAGF,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,CAc9D;AAED,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,KAAG,MA6BzC,CAAC"}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hslaToArgb = exports.formatCellForExcel = exports.toCellValue = void 0;
4
+ exports.getColumnLabel = getColumnLabel;
5
+ exports.createEmptyRow = createEmptyRow;
6
+ exports.createEmptyTotals = createEmptyTotals;
7
+ exports.extractTextForWidth = extractTextForWidth;
8
+ /* eslint-disable sonarjs/function-return-type */
9
+ const utils_1 = require("../../utils");
10
+ // Extracts column label from column definition
11
+ function getColumnLabel(col) {
12
+ return typeof col.columnDef.header === "string"
13
+ ? col.columnDef.header
14
+ : String(col.id);
15
+ }
16
+ // Creates an empty row object with all headers set to empty string
17
+ function createEmptyRow(headers) {
18
+ return Object.fromEntries(headers.map((h) => [h, ""]));
19
+ }
20
+ // Creates an empty totals object for numeric columns
21
+ function createEmptyTotals(numericCols) {
22
+ return Object.fromEntries(Array.from(numericCols).map((c) => [c, 0]));
23
+ }
24
+ // Converts unknown input to a valid Excel cell value
25
+ const toCellValue = (input) => {
26
+ if (!input) {
27
+ return null;
28
+ }
29
+ const t = typeof input;
30
+ if (t === "string" ||
31
+ t === "number" ||
32
+ t === "boolean" ||
33
+ input instanceof Date) {
34
+ return input;
35
+ }
36
+ if (typeof input === "object" &&
37
+ input != null &&
38
+ Object.keys(input).length > 0) {
39
+ return String(input);
40
+ }
41
+ return "";
42
+ };
43
+ exports.toCellValue = toCellValue;
44
+ // Formats cell value appropriately for Excel based on row type
45
+ const formatCellForExcel = (value, rowType, isGroupingColumn) => {
46
+ if (rowType !== "data" && value === "") {
47
+ return "";
48
+ }
49
+ if (!value) {
50
+ return isGroupingColumn ? "" : "-";
51
+ }
52
+ if (typeof value === "boolean") {
53
+ return value ? "Yes" : "No";
54
+ }
55
+ return value;
56
+ };
57
+ exports.formatCellForExcel = formatCellForExcel;
58
+ // Extracts text from various value types for width calculation
59
+ function extractTextForWidth(cellValue) {
60
+ if (cellValue instanceof Date) {
61
+ return cellValue.toLocaleDateString();
62
+ }
63
+ if (typeof cellValue === "object" && cellValue != null) {
64
+ if ("text" in cellValue && typeof cellValue.text === "string") {
65
+ return cellValue.text;
66
+ }
67
+ return String(cellValue);
68
+ }
69
+ return String(cellValue ?? "");
70
+ }
71
+ const hslaToArgb = (hsla) => {
72
+ const match = utils_1.hslaRegex.exec(hsla);
73
+ if (!match) {
74
+ return "FF000000";
75
+ }
76
+ const h = Number(match[1]);
77
+ const s = Number(match[2]) / 100;
78
+ const l = Number(match[3]) / 100;
79
+ const a = Number(match[4]) ?? 1;
80
+ const rgb = (0, utils_1.hslToRgb)(h, s, l);
81
+ const alphaHex = Math.round(a * 255)
82
+ .toString(16)
83
+ .padStart(2, "0")
84
+ .toUpperCase();
85
+ const rHex = rgb[0].toString(16).padStart(2, "0").toUpperCase();
86
+ const gHex = rgb[1].toString(16).padStart(2, "0").toUpperCase();
87
+ const bHex = rgb[2].toString(16).padStart(2, "0").toUpperCase();
88
+ return `${alphaHex}${rHex}${gHex}${bHex}`;
89
+ };
90
+ exports.hslaToArgb = hslaToArgb;
@@ -0,0 +1,3 @@
1
+ export * from "./helper";
2
+ export * from "./types";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/exportUtils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./helper"), exports);
18
+ __exportStar(require("./types"), exports);
@@ -0,0 +1,49 @@
1
+ export type ColumnName<T> = Extract<keyof T, string>;
2
+ export type CellValue = string | number | boolean | Date | null;
3
+ export type ExcelRow = {
4
+ data: Record<string, CellValue>;
5
+ type: "group" | "data" | "total";
6
+ };
7
+ export type VisibleColumn = {
8
+ columnDef: {
9
+ header?: string;
10
+ };
11
+ id: string;
12
+ };
13
+ export type GroupStackItem = {
14
+ count: number;
15
+ id: string;
16
+ totals: Record<string, number>;
17
+ };
18
+ export type ExportOptions<T = Record<string, unknown>> = {
19
+ excludedColumns?: ColumnName<T>[];
20
+ fileName: string;
21
+ numericColumns?: ColumnName<T>[];
22
+ };
23
+ export type ExcelColors = {
24
+ BORDER: string;
25
+ HEADER_BG: string;
26
+ };
27
+ export type RowProcessingContext = {
28
+ builtRows: ExcelRow[];
29
+ colIdToHeader: Record<string, string>;
30
+ filteredVisibleCols: VisibleColumn[];
31
+ groupStack: GroupStackItem[];
32
+ groupingColumnNames: string[];
33
+ hasGrouping: boolean;
34
+ headers: string[];
35
+ lastSeenGrouped: Record<string, CellValue>;
36
+ numericColumns: Set<string>;
37
+ };
38
+ export type Row<T> = {
39
+ id: string;
40
+ depth: number;
41
+ groupingColumnId?: string;
42
+ subRows?: Row<T>[];
43
+ getValue: (columnId: string) => unknown;
44
+ getIsGrouped?: () => boolean;
45
+ original: T;
46
+ index: number;
47
+ parentId?: string;
48
+ };
49
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/exportUtils/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AAErD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;AAEhE,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAChC,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC/B,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,E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"./useExportToExcel";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./useExportToExcel"), exports);
@@ -0,0 +1,7 @@
1
+ import type { RefObject } from "react";
2
+ import type { SmartGridRef } from "../types";
3
+ import type { ColumnName } from "../exportUtils/types";
4
+ export declare function useExportToExcel<T extends Record<string, unknown>>(): {
5
+ exportToExcel: (gridRef: RefObject<SmartGridRef<T>>, fileName: string, numericColumns?: ColumnName<T>[], excludedColumns?: ColumnName<T>[]) => Promise<void>;
6
+ };
7
+ //# sourceMappingURL=useExportToExcel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useExportToExcel.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/hooks/useExportToExcel.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAa7C,OAAO,KAAK,EAEV,UAAU,EAOX,MAAM,sBAAsB,CAAC;AAmW9B,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;6BAKnD,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YACzB,MAAM,mBACC,UAAU,CAAC,CAAC,CAAC,EAAE,oBACd,UAAU,CAAC,CAAC,CAAC,EAAE;EAQtC"}
@@ -0,0 +1,241 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.useExportToExcel = useExportToExcel;
7
+ const exceljs_1 = __importDefault(require("exceljs"));
8
+ const file_saver_1 = require("file-saver");
9
+ const material_1 = require("@mui/material");
10
+ const Toast_1 = require("../../Toast");
11
+ const helper_1 = require("../exportUtils/helper");
12
+ const DEFAULT_EXCLUDED_COLUMNS = [
13
+ "select",
14
+ "srNo",
15
+ "action",
16
+ "actionBy",
17
+ ];
18
+ // Theme-based Excel styling hook
19
+ const useExcelStyles = () => {
20
+ const theme = (0, material_1.useTheme)();
21
+ const { iron, black } = theme.palette.app.color;
22
+ const argbIron700 = (0, helper_1.hslaToArgb)(iron[700]);
23
+ const argbBlack900 = (0, helper_1.hslaToArgb)(black[900]);
24
+ const argbIron800 = (0, helper_1.hslaToArgb)(iron[800]);
25
+ const EXCEL_BORDER = {
26
+ bottom: { color: { argb: argbIron800 }, style: "thin" },
27
+ left: { color: { argb: argbIron800 }, style: "thin" },
28
+ right: { color: { argb: argbIron800 }, style: "thin" },
29
+ top: { color: { argb: argbIron800 }, style: "thin" },
30
+ };
31
+ const EXCEL_FILL = {
32
+ fgColor: { argb: argbIron700 },
33
+ pattern: "solid",
34
+ type: "pattern",
35
+ };
36
+ const styleCell = (cell, style) => {
37
+ cell.border = EXCEL_BORDER;
38
+ if (style === "header") {
39
+ cell.font = {
40
+ bold: true,
41
+ color: { argb: argbBlack900 },
42
+ size: 14,
43
+ };
44
+ cell.fill = EXCEL_FILL;
45
+ }
46
+ else if (style === "total") {
47
+ cell.font = {
48
+ bold: true,
49
+ size: 12,
50
+ };
51
+ cell.fill = EXCEL_FILL;
52
+ }
53
+ };
54
+ return { styleCell };
55
+ };
56
+ // Column Processing
57
+ const buildColumnMappings = (cols, excludedIds) => {
58
+ const filtered = cols.filter(({ id }) => !excludedIds.includes(id));
59
+ const headers = [];
60
+ const colIdToHeader = {};
61
+ filtered.forEach((col) => {
62
+ const label = (0, helper_1.getColumnLabel)(col);
63
+ headers.push(label);
64
+ colIdToHeader[col.id] = label;
65
+ });
66
+ return { colIdToHeader, filteredVisibleCols: filtered, headers };
67
+ };
68
+ // Group Stack Management
69
+ const ensureGroupStackSize = (stack, size, numericCols) => {
70
+ while (stack.length < size) {
71
+ stack.push({
72
+ count: 0,
73
+ id: "",
74
+ totals: (0, helper_1.createEmptyTotals)(numericCols),
75
+ });
76
+ }
77
+ };
78
+ const createTotalRow = (group, headers, colIdToHeader, numericCols) => {
79
+ const row = (0, helper_1.createEmptyRow)(headers);
80
+ const { id, totals } = group;
81
+ const groupLabel = colIdToHeader[id];
82
+ if (groupLabel) {
83
+ row[groupLabel] = "Total";
84
+ }
85
+ numericCols.forEach((col) => {
86
+ const label = colIdToHeader[col];
87
+ if (label) {
88
+ row[label] = String(totals[col] ?? 0);
89
+ }
90
+ });
91
+ return row;
92
+ };
93
+ const pushTotalRow = (context, levelIndex) => {
94
+ const { groupStack, numericColumns, builtRows, headers, colIdToHeader } = context;
95
+ const group = groupStack[levelIndex];
96
+ if (!group || !numericColumns.size) {
97
+ return;
98
+ }
99
+ builtRows.push({
100
+ data: createTotalRow(group, headers, colIdToHeader, numericColumns),
101
+ type: "total",
102
+ });
103
+ };
104
+ // Group Row Processing
105
+ const createGroupHeaderRow = (row, context) => {
106
+ const { headers, filteredVisibleCols, lastSeenGrouped } = context;
107
+ const { getValue, subRows, groupingColumnId } = row;
108
+ const headerRow = (0, helper_1.createEmptyRow)(headers);
109
+ if (!groupingColumnId) {
110
+ return headerRow;
111
+ }
112
+ const colMeta = filteredVisibleCols.find(({ id }) => id === groupingColumnId);
113
+ if (!colMeta) {
114
+ return headerRow;
115
+ }
116
+ const label = (0, helper_1.getColumnLabel)(colMeta);
117
+ const val = (0, helper_1.toCellValue)(getValue(groupingColumnId));
118
+ const count = subRows?.length;
119
+ headerRow[label] =
120
+ count && count > 0 ? `${String(val)} (${count})` : String(val);
121
+ lastSeenGrouped[label] = val;
122
+ return headerRow;
123
+ };
124
+ const processGroupRow = (row, context) => {
125
+ const { depth, groupingColumnId, subRows } = row;
126
+ const { groupStack, numericColumns, builtRows } = context;
127
+ const level = typeof depth === "number" && depth >= 0 ? depth : 0;
128
+ while (groupStack.length > level) {
129
+ pushTotalRow(context, groupStack.length - 1);
130
+ groupStack.pop();
131
+ }
132
+ ensureGroupStackSize(groupStack, level + 1, numericColumns);
133
+ groupStack[level] = {
134
+ count: subRows?.length ?? 0,
135
+ id: groupingColumnId ?? "",
136
+ totals: (0, helper_1.createEmptyTotals)(numericColumns),
137
+ };
138
+ builtRows.push({
139
+ data: createGroupHeaderRow(row, context),
140
+ type: "group",
141
+ });
142
+ };
143
+ // Data Row Processing
144
+ const processDataRow = (row, context) => {
145
+ const { filteredVisibleCols, hasGrouping, groupingColumnNames, lastSeenGrouped, numericColumns, groupStack, builtRows, } = context;
146
+ const { getValue } = row;
147
+ const dataRow = {};
148
+ filteredVisibleCols.forEach((col) => {
149
+ const { id } = col;
150
+ const label = (0, helper_1.getColumnLabel)(col);
151
+ const cell = (0, helper_1.toCellValue)(getValue(id));
152
+ let finalValue = cell;
153
+ if (hasGrouping && groupingColumnNames.includes(id)) {
154
+ const last = lastSeenGrouped[label];
155
+ finalValue = last === cell ? "" : cell;
156
+ lastSeenGrouped[label] = cell;
157
+ }
158
+ dataRow[label] = finalValue;
159
+ if (numericColumns.has(id)) {
160
+ const numVal = typeof cell === "number" ? cell : 0;
161
+ groupStack.forEach(({ totals }) => {
162
+ totals[id] = (totals[id] ?? 0) + numVal;
163
+ });
164
+ }
165
+ });
166
+ builtRows.push({ data: dataRow, type: "data" });
167
+ };
168
+ const processAllRows = (rows, context) => {
169
+ const { groupStack } = context;
170
+ rows.forEach((row) => {
171
+ if (row.getIsGrouped?.() ?? false) {
172
+ processGroupRow(row, context);
173
+ }
174
+ else {
175
+ processDataRow(row, context);
176
+ }
177
+ });
178
+ while (groupStack.length > 0) {
179
+ pushTotalRow(context, groupStack.length - 1);
180
+ groupStack.pop();
181
+ }
182
+ };
183
+ // Excel Generation
184
+ const generateExcelFile = async (builtRows, headers, groupingColumnNames, colIdToHeader, fileName, styleCell) => {
185
+ const workbook = new exceljs_1.default.Workbook();
186
+ const sheet = workbook.addWorksheet("Sheet1");
187
+ const groupingHeaderSet = new Set(groupingColumnNames.map((name) => colIdToHeader[name]).filter(Boolean));
188
+ const headerRow = sheet.addRow(headers);
189
+ headerRow.eachCell((cell) => styleCell(cell, "header"));
190
+ builtRows.forEach((row) => {
191
+ const values = headers.map((h) => (0, helper_1.formatCellForExcel)(row.data[h] ?? "", row.type, groupingHeaderSet.has(h)));
192
+ const excelRow = sheet.addRow(values);
193
+ excelRow.eachCell((cell) => styleCell(cell, row.type === "total" ? "total" : undefined));
194
+ });
195
+ sheet.columns.forEach((col) => {
196
+ let maxWidth = 12;
197
+ col.eachCell?.({ includeEmpty: true }, ({ value }) => {
198
+ maxWidth = Math.max(maxWidth, (0, helper_1.extractTextForWidth)(value).length + 2);
199
+ });
200
+ col.width = Math.min(maxWidth, 60);
201
+ });
202
+ const buffer = await workbook.xlsx.writeBuffer();
203
+ (0, file_saver_1.saveAs)(new Blob([buffer]), `${fileName}.xlsx`);
204
+ };
205
+ // Main Export Function
206
+ async function exportSmartGridToExcel(gridRef, options, styleCell) {
207
+ try {
208
+ const table = gridRef.current?.getTable();
209
+ const excludedIds = [
210
+ ...DEFAULT_EXCLUDED_COLUMNS,
211
+ ...(options.excludedColumns ?? []),
212
+ ];
213
+ const visibleCols = table?.getVisibleLeafColumns();
214
+ const { colIdToHeader, filteredVisibleCols, headers } = buildColumnMappings(visibleCols, excludedIds);
215
+ const rows = table?.getRowModel().rows;
216
+ const groupingColumnNames = table?.getState().grouping ?? [];
217
+ const context = {
218
+ builtRows: [],
219
+ colIdToHeader,
220
+ filteredVisibleCols,
221
+ groupStack: [],
222
+ groupingColumnNames,
223
+ hasGrouping: groupingColumnNames.length > 0,
224
+ headers,
225
+ lastSeenGrouped: {},
226
+ numericColumns: new Set(options.numericColumns ?? []),
227
+ };
228
+ processAllRows(rows, context);
229
+ await generateExcelFile(context.builtRows, headers, groupingColumnNames, colIdToHeader, options.fileName, styleCell);
230
+ }
231
+ catch (error) {
232
+ Toast_1.toasts.error({ title: `Failed to export to Excel: ${error}` });
233
+ }
234
+ }
235
+ // Hook: useExportToExcel
236
+ function useExportToExcel() {
237
+ const { styleCell } = useExcelStyles();
238
+ return {
239
+ exportToExcel: (gridRef, fileName, numericColumns, excludedColumns) => exportSmartGridToExcel(gridRef, { fileName, numericColumns, excludedColumns }, styleCell),
240
+ };
241
+ }
@@ -1,3 +1,4 @@
1
1
  export * from "./SmartGrid";
2
2
  export * from "./types/index";
3
+ export * from "./hooks/useExportToExcel";
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SmartGrid/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/SmartGrid/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,0BAA0B,CAAC"}
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./SmartGrid"), exports);
18
18
  __exportStar(require("./types/index"), exports);
19
+ __exportStar(require("./hooks/useExportToExcel"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/utils/helper.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,WAQ5C,CAAC"}
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../../src/SmartGrid/utils/helper.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,GAAI,OAAO,MAAM,WAQ5C,CAAC"}
@@ -2,9 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.formatDateValue = void 0;
4
4
  const luxon_1 = require("luxon");
5
+ const utils_1 = require("../../utils");
5
6
  const formatDateValue = (value) => {
6
7
  const date = luxon_1.DateTime.fromISO(value);
7
- if (date.isValid) {
8
+ if (date.isValid && utils_1.isoDateRegex.test(value)) {
8
9
  return date.toFormat("dd-MM-yyyy");
9
10
  }
10
11
  return value;
@@ -1,9 +1,10 @@
1
- import type { BoxProps } from "@mui/material";
2
1
  import type { ReactNode } from "react";
2
+ export type CodeSnippetBoxLanguage = "typescript" | "javascript" | "html" | "css" | "json" | "xml" | "yaml" | "markdown" | "plaintext";
3
3
  type CodeSnippetBoxProps = {
4
4
  children: ReactNode;
5
- component?: BoxProps["component"];
5
+ language?: CodeSnippetBoxLanguage;
6
+ isCopyable?: boolean;
6
7
  };
7
- export declare const CodeSnippetBox: ({ children, component, }: CodeSnippetBoxProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const CodeSnippetBox: ({ children, language, isCopyable, }: CodeSnippetBoxProps) => import("react/jsx-runtime").JSX.Element;
8
9
  export {};
9
10
  //# sourceMappingURL=CodeSnippetBox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodeSnippetBox.d.ts","sourceRoot":"","sources":["../../src/codeSnippetBox/CodeSnippetBox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,KAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,0BAG5B,mBAAmB,4CAMrB,CAAC"}
1
+ {"version":3,"file":"CodeSnippetBox.d.ts","sourceRoot":"","sources":["../../src/codeSnippetBox/CodeSnippetBox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC,MAAM,MAAM,sBAAsB,GAC9B,YAAY,GACZ,YAAY,GACZ,MAAM,GACN,KAAK,GACL,MAAM,GACN,KAAK,GACL,MAAM,GACN,UAAU,GACV,WAAW,CAAC;AAEhB,KAAK,mBAAmB,GAAG;IACzB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,qCAI5B,mBAAmB,4CA6ErB,CAAC"}
@@ -2,8 +2,44 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CodeSnippetBox = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const icons_material_1 = require("@mui/icons-material");
6
+ const material_1 = require("@mui/material");
7
+ const react_1 = require("react");
8
+ const react_syntax_highlighter_1 = require("react-syntax-highlighter");
9
+ // eslint-disable-next-line import/no-internal-modules
10
+ const prism_1 = require("react-syntax-highlighter/dist/esm/styles/prism");
5
11
  const CodeSnippetBox_styled_1 = require("./CodeSnippetBox.styled");
6
- const CodeSnippetBox = ({ children, component = "pre", }) => {
7
- return ((0, jsx_runtime_1.jsx)(CodeSnippetBox_styled_1.StyledCodeSnippetBox, { component: component, children: children }));
12
+ const Button_1 = require("../Button");
13
+ const CodeSnippetBox = ({ children, language = "typescript", isCopyable = true, }) => {
14
+ const theme = (0, material_1.useTheme)();
15
+ const { mirage, iron } = theme.palette.app.color;
16
+ const [copied, setCopied] = (0, react_1.useState)(false);
17
+ const handleCopy = () => {
18
+ if (typeof children !== "string" || !isCopyable) {
19
+ return;
20
+ }
21
+ navigator.clipboard
22
+ .writeText(children)
23
+ .then(() => {
24
+ setCopied(true);
25
+ setTimeout(() => {
26
+ setCopied(false);
27
+ }, 2000);
28
+ })
29
+ .catch(() => {
30
+ // Silently fail
31
+ });
32
+ };
33
+ return ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: { position: "relative" }, children: typeof children === "string" ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [isCopyable && ((0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
34
+ position: "absolute",
35
+ top: theme.spacing(1),
36
+ right: theme.spacing(1),
37
+ zIndex: 1,
38
+ }, children: (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: copied ? "Copied!" : "Copy code", children: (0, jsx_runtime_1.jsx)(Button_1.Button, { size: "small", onClick: handleCopy, variant: "text", sx: { color: iron[600], fontSize: "10px" }, startIcon: copied ? ((0, jsx_runtime_1.jsx)(icons_material_1.Check, { sx: { fontSize: "10px" } })) : ((0, jsx_runtime_1.jsx)(icons_material_1.ContentCopy, { sx: { fontSize: "10px" } })), children: copied ? "Copied!" : "Copy code" }) }) })), (0, jsx_runtime_1.jsx)(react_syntax_highlighter_1.Prism, { language: language, style: prism_1.vscDarkPlus, customStyle: {
39
+ margin: 0,
40
+ borderRadius: "5px",
41
+ padding: theme.spacing(2),
42
+ background: mirage[900],
43
+ }, PreTag: "div", children: children })] })) : ((0, jsx_runtime_1.jsx)(CodeSnippetBox_styled_1.StyledCodeSnippetBox, { children: children })) }));
8
44
  };
9
45
  exports.CodeSnippetBox = CodeSnippetBox;
@@ -1 +1 @@
1
- {"version":3,"file":"CodeSnippetBox.styled.d.ts","sourceRoot":"","sources":["../../src/codeSnippetBox/CodeSnippetBox.styled.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGnD,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC,QAAQ,CA+BzD,CAAC"}
1
+ {"version":3,"file":"CodeSnippetBox.styled.d.ts","sourceRoot":"","sources":["../../src/codeSnippetBox/CodeSnippetBox.styled.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGnD,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC,QAAQ,CAwBzD,CAAC"}
@@ -5,7 +5,7 @@ const material_1 = require("@mui/material");
5
5
  const styles_1 = require("@mui/material/styles");
6
6
  exports.StyledCodeSnippetBox = (0, styles_1.styled)(material_1.Box)(({ theme, }) => {
7
7
  const { app: { color }, } = theme.palette;
8
- const { slate, iron, claude } = color;
8
+ const { slate, iron } = color;
9
9
  return {
10
10
  backgroundColor: slate[900],
11
11
  borderRadius: "4px",
@@ -16,16 +16,9 @@ exports.StyledCodeSnippetBox = (0, styles_1.styled)(material_1.Box)(({ theme, })
16
16
  overflow: "auto",
17
17
  fontFamily: "SFMono-Regular, Menlo, Monaco, Consolas, monospace",
18
18
  lineHeight: 1.5,
19
- "& code": {
19
+ "& .react-syntax-highlighter-code-element": {
20
+ fontSize: "inherit",
20
21
  fontFamily: "inherit",
21
22
  },
22
- "& pre": {
23
- margin: 0,
24
- fontFamily: "inherit",
25
- },
26
- "& ::selection": {
27
- backgroundColor: claude[300],
28
- color: slate[900],
29
- },
30
23
  };
31
24
  });
@@ -1,2 +1,3 @@
1
1
  export declare const getZIndex: (element: HTMLElement) => number;
2
+ export declare const hslToRgb: (h: number, s: number, l: number) => [number, number, number];
2
3
  //# sourceMappingURL=helper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/utils/helper.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAI,SAAS,WAAW,WAI7C,CAAC"}
1
+ {"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../../src/utils/helper.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAI,SAAS,WAAW,WAI7C,CAAC;AAEF,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,GAAG,MAAM,KACR,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CA8BzB,CAAC"}
@@ -1,8 +1,38 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getZIndex = void 0;
3
+ exports.hslToRgb = exports.getZIndex = void 0;
4
4
  const getZIndex = (element) => {
5
5
  const parsed = parseInt(window.getComputedStyle(element).zIndex ?? "", 10);
6
6
  return isNaN(parsed) ? 0 : parsed;
7
7
  };
8
8
  exports.getZIndex = getZIndex;
9
+ const hslToRgb = (h, s, l) => {
10
+ const c = (1 - Math.abs(2 * l - 1)) * s;
11
+ const x = c * (1 - Math.abs(((h / 60) % 2) - 1));
12
+ const m = l - c / 2;
13
+ let r = 0, g = 0, b = 0;
14
+ if (h < 60) {
15
+ [r, g, b] = [c, x, 0];
16
+ }
17
+ else if (h < 120) {
18
+ [r, g, b] = [x, c, 0];
19
+ }
20
+ else if (h < 180) {
21
+ [r, g, b] = [0, c, x];
22
+ }
23
+ else if (h < 240) {
24
+ [r, g, b] = [0, x, c];
25
+ }
26
+ else if (h < 300) {
27
+ [r, g, b] = [x, 0, c];
28
+ }
29
+ else {
30
+ [r, g, b] = [c, 0, x];
31
+ }
32
+ return [
33
+ Math.round((r + m) * 255),
34
+ Math.round((g + m) * 255),
35
+ Math.round((b + m) * 255),
36
+ ];
37
+ };
38
+ exports.hslToRgb = hslToRgb;
@@ -3,4 +3,6 @@ export declare const isoDateRegex: RegExp;
3
3
  export declare const noSpecialCharacterRegex: RegExp;
4
4
  export declare const emailRegex: RegExp;
5
5
  export declare const timeRegex: RegExp;
6
+ export declare const accessorFnRegex: RegExp;
7
+ export declare const hslaRegex: RegExp;
6
8
  //# sourceMappingURL=regex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../src/utils/regex.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,QAAkB,CAAC;AAE9C,eAAO,MAAM,YAAY,QAAwB,CAAC;AAElD,eAAO,MAAM,uBAAuB,QAAoB,CAAC;AAEzD,eAAO,MAAM,UAAU,QACmvB,CAAC;AAE3wB,eAAO,MAAM,SAAS,QAA6B,CAAC"}
1
+ {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../src/utils/regex.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,cAAc,QAAkB,CAAC;AAE9C,eAAO,MAAM,YAAY,QAAwB,CAAC;AAElD,eAAO,MAAM,uBAAuB,QAAoB,CAAC;AAEzD,eAAO,MAAM,UAAU,QACmvB,CAAC;AAE3wB,eAAO,MAAM,SAAS,QAA6B,CAAC;AAEpD,eAAO,MAAM,eAAe,QACqD,CAAC;AAElF,eAAO,MAAM,SAAS,QAAqD,CAAC"}
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.timeRegex = exports.emailRegex = exports.noSpecialCharacterRegex = exports.isoDateRegex = exports.monthYearRegex = void 0;
3
+ exports.hslaRegex = exports.accessorFnRegex = exports.timeRegex = exports.emailRegex = exports.noSpecialCharacterRegex = exports.isoDateRegex = exports.monthYearRegex = void 0;
4
+ /* eslint-disable sonarjs/unnecessary-character-escapes */
5
+ /* eslint-disable no-useless-escape */
4
6
  /* eslint-disable sonarjs/single-character-alternation */
5
7
  /* eslint-disable sonarjs/concise-regex */
6
8
  /* eslint-disable sonarjs/sonar-no-control-regex */
@@ -12,3 +14,5 @@ exports.isoDateRegex = /^\d{4}-\d{2}-\d{2}$/;
12
14
  exports.noSpecialCharacterRegex = /^[a-zA-Z0-9 ]*$/;
13
15
  exports.emailRegex = /^(((?!.*[^\x00-\x7F])[^<>()[\]\\.,;:\s@"](\.[^<>()[\]\\.,;:\s@"])*){1,64}|(".{1,64}"))@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-zA-Z\-0-9]+(?:-[a-zA-Z\-0-9]+)*([.]{1,1}))){1,4}([a-zA-Z][a-zA-Z0-9]{1,}))|(?:\[(?:(?:(i|I)(p|P)(v)6:(?:(?:[a-zA-Z\-0-9]{1,4}(?::[a-zA-Z\-0-9]{1,4}){7})|(?:(?!(?:.*[a-zA-Z\-0-9][:\]]){7,})(?:[a-zA-Z\-0-9]{1,4}(?::[a-zA-Z\-0-9]{1,4}){0,5})?::(?:[a-zA-Z\-0-9]{1,4}(?::[a-zA-Z\-0-9]{1,4}){0,5})?)))|(?:(?:(i|I)(p|P)(v)6:(?:(?:[a-zA-Z\-0-9]{1,4}(?::[a-zA-Z\-0-9]{1,4}){5}:)|(?:(?!(?:.*[a-zA-Z\-0-9]:){5,})(?:[a-zA-Z\-0-9]{1,4}(?::[a-zA-Z\-0-9]{1,4}){0,3})?::(?:[a-zA-Z\-0-9]{1,4}(?::[a-zA-Z\-0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\]))$/;
14
16
  exports.timeRegex = /^\d{1,3}:\d{2}(:\d{2})?$/;
17
+ exports.accessorFnRegex = /([a-zA-Z0-9_$.\[\]]+)\s*!==\s*null\s*&&\s*\1\s*!==\s*void 0\s*\?\s*\1\s*:\s*/g;
18
+ exports.hslaRegex = /hsla?\((\d+),\s*(\d+)%,\s*(\d+)%,?\s*([\d.]+)?\)/;
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/utils/theme/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAGvB,OAAO,SAAS,CAAC;AAGjB,eAAO,MAAM,KAAK;;;CAGR,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,KAAK,CAAC;AAE9C,eAAO,MAAM,iBAAiB,GAAI,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKjD,CAAC;AAEH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAqSzD"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../src/utils/theme/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,eAAe,CAAC;AAGvB,OAAO,SAAS,CAAC;AAGjB,eAAO,MAAM,KAAK;;;CAGR,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,KAAK,CAAC;AAE9C,eAAO,MAAM,iBAAiB,GAAI,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;CAKjD,CAAC;AAEH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,WAAW,GAAG,YAAY,CAkSzD"}
@@ -104,9 +104,6 @@ function appTheme(theme) {
104
104
  padding: "unset",
105
105
  },
106
106
  },
107
- defaultProps: {
108
- disableRipple: true,
109
- },
110
107
  },
111
108
  MuiBreadcrumbs: {
112
109
  styleOverrides: {