@codezee/sixtify-brahma 0.2.150 → 0.2.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -1
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridCheckBoxSelection.d.ts.map +1 -1
- package/packages/shared-components/dist/AgGrid/hooks/useAgGridCheckBoxSelection.js +27 -11
- package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/Autocomplete/Autocomplete.js +8 -13
- package/packages/shared-components/dist/FormFields/Autocomplete/AvatarCell.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/Autocomplete/AvatarCell.js +2 -9
- package/packages/shared-components/dist/FormFields/Autocomplete/Tags.d.ts.map +1 -1
- package/packages/shared-components/dist/FormFields/Autocomplete/Tags.js +3 -2
- package/packages/shared-components/dist/HighlightedText/HighlightedText.d.ts +7 -0
- package/packages/shared-components/dist/HighlightedText/HighlightedText.d.ts.map +1 -0
- package/packages/shared-components/dist/HighlightedText/HighlightedText.js +25 -0
- package/packages/shared-components/dist/HighlightedText/index.d.ts +2 -0
- package/packages/shared-components/dist/HighlightedText/index.d.ts.map +1 -0
- package/packages/shared-components/dist/HighlightedText/index.js +17 -0
- package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.js +1 -1
- package/packages/shared-components/dist/SmartGrid/exportUtils/helper.d.ts +9 -0
- package/packages/shared-components/dist/SmartGrid/exportUtils/helper.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/exportUtils/helper.js +90 -0
- package/packages/shared-components/dist/SmartGrid/exportUtils/index.d.ts +3 -0
- package/packages/shared-components/dist/SmartGrid/exportUtils/index.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/exportUtils/index.js +18 -0
- package/packages/shared-components/dist/SmartGrid/exportUtils/types.d.ts +49 -0
- package/packages/shared-components/dist/SmartGrid/exportUtils/types.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/exportUtils/types.js +2 -0
- package/packages/shared-components/dist/SmartGrid/hooks/index.d.ts +2 -0
- package/packages/shared-components/dist/SmartGrid/hooks/index.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/hooks/index.js +17 -0
- package/packages/shared-components/dist/SmartGrid/hooks/useExportToExcel.d.ts +7 -0
- package/packages/shared-components/dist/SmartGrid/hooks/useExportToExcel.d.ts.map +1 -0
- package/packages/shared-components/dist/SmartGrid/hooks/useExportToExcel.js +241 -0
- package/packages/shared-components/dist/SmartGrid/index.d.ts +1 -0
- package/packages/shared-components/dist/SmartGrid/index.d.ts.map +1 -1
- package/packages/shared-components/dist/SmartGrid/index.js +1 -0
- package/packages/shared-components/dist/index.d.ts +3 -2
- package/packages/shared-components/dist/index.d.ts.map +1 -1
- package/packages/shared-components/dist/index.js +3 -2
- package/packages/shared-components/dist/utils/helper.d.ts +1 -0
- package/packages/shared-components/dist/utils/helper.d.ts.map +1 -1
- package/packages/shared-components/dist/utils/helper.js +31 -1
- package/packages/shared-components/dist/utils/regex.d.ts +2 -0
- package/packages/shared-components/dist/utils/regex.d.ts.map +1 -1
- package/packages/shared-components/dist/utils/regex.js +3 -1
- package/packages/shared-components/dist/utils/theme/theme.d.ts.map +1 -1
- 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.
|
|
3
|
+
"version": "0.2.152",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/hardikranpariya/sixtify-brahma.git"
|
|
@@ -118,6 +118,7 @@
|
|
|
118
118
|
"axios": "^1.7.2",
|
|
119
119
|
"date-fns": "^4.1.0",
|
|
120
120
|
"eslint-plugin-sonarjs": "1.0.4-alpha.1",
|
|
121
|
+
"exceljs": "^4.4.0",
|
|
121
122
|
"file-saver": "^2.0.5",
|
|
122
123
|
"file64": "1.0.1",
|
|
123
124
|
"gh-pages": "^6.3.0",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAgGridCheckBoxSelection.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/useAgGridCheckBoxSelection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI9E,KAAK,8BAA8B,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,IAAI;IAC9D,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACxD,gBAAgB,EAAE,CAAC,EAAE,CAAC;IACtB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAqCF,eAAO,MAAM,0BAA0B,GAAI,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,uEAKlE,8BAA8B,CAAC,CAAC,CAAC;;6BAyCF,WAAW,CAAC,gBAAgB,CAAC;;;
|
|
1
|
+
{"version":3,"file":"useAgGridCheckBoxSelection.d.ts","sourceRoot":"","sources":["../../../src/AgGrid/hooks/useAgGridCheckBoxSelection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI9E,KAAK,8BAA8B,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,IAAI;IAC9D,OAAO,EAAE,SAAS,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACnC,mBAAmB,EAAE,QAAQ,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACxD,gBAAgB,EAAE,CAAC,EAAE,CAAC;IACtB,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAqCF,eAAO,MAAM,0BAA0B,GAAI,CAAC,SAAS;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,EAAE,uEAKlE,8BAA8B,CAAC,CAAC,CAAC;;6BAyCF,WAAW,CAAC,gBAAgB,CAAC;;;CAoJ9D,CAAC"}
|
|
@@ -32,12 +32,12 @@ const useAgGridCheckBoxSelection = ({ gridRef, setSelectedEmployee, currentPageI
|
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
const api = gridRef.current.api;
|
|
35
|
-
return currentPageItems.forEach((
|
|
36
|
-
api.getRowNode(
|
|
35
|
+
return currentPageItems.forEach(({ id }) => {
|
|
36
|
+
api.getRowNode(id)?.setSelected(isChecked);
|
|
37
37
|
});
|
|
38
38
|
};
|
|
39
39
|
const commonCheckBoxMethod = () => {
|
|
40
|
-
const currentPageItemsId = currentPageItems.map((
|
|
40
|
+
const currentPageItemsId = currentPageItems.map(({ id }) => id);
|
|
41
41
|
if (!isChecked) {
|
|
42
42
|
handleRowCheckBox(true);
|
|
43
43
|
setIsChecked(true);
|
|
@@ -64,16 +64,24 @@ const useAgGridCheckBoxSelection = ({ gridRef, setSelectedEmployee, currentPageI
|
|
|
64
64
|
if (isDialogOnTop(gridRef)) {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
+
// Check if user is focused on an input field
|
|
68
|
+
const activeElement = document.activeElement;
|
|
69
|
+
const isInputField = activeElement?.tagName === "INPUT" ||
|
|
70
|
+
activeElement?.tagName === "TEXTAREA" ||
|
|
71
|
+
activeElement?.contentEditable === "true";
|
|
72
|
+
if (isInputField) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
67
75
|
if (!currentPageItems.length) {
|
|
68
76
|
return;
|
|
69
77
|
}
|
|
70
|
-
const currentPageItemsId = currentPageItems.map((
|
|
78
|
+
const currentPageItemsId = currentPageItems.map(({ id }) => id);
|
|
71
79
|
if (!gridRef.current) {
|
|
72
80
|
return;
|
|
73
81
|
}
|
|
74
82
|
const api = gridRef.current.api;
|
|
75
|
-
currentPageItems.forEach((
|
|
76
|
-
api.getRowNode(
|
|
83
|
+
currentPageItems.forEach(({ id }) => {
|
|
84
|
+
api.getRowNode(id)?.setSelected(true);
|
|
77
85
|
});
|
|
78
86
|
setIsChecked(true);
|
|
79
87
|
setSelectedEmployee((prev) => {
|
|
@@ -94,16 +102,24 @@ const useAgGridCheckBoxSelection = ({ gridRef, setSelectedEmployee, currentPageI
|
|
|
94
102
|
if (isDialogOnTop(gridRef)) {
|
|
95
103
|
return;
|
|
96
104
|
}
|
|
105
|
+
// Check if user is focused on an input field
|
|
106
|
+
const activeElement = document.activeElement;
|
|
107
|
+
const isInputField = activeElement?.tagName === "INPUT" ||
|
|
108
|
+
activeElement?.tagName === "TEXTAREA" ||
|
|
109
|
+
activeElement?.contentEditable === "true";
|
|
110
|
+
if (isInputField) {
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
97
113
|
if (!currentPageItems.length) {
|
|
98
114
|
return;
|
|
99
115
|
}
|
|
100
|
-
const currentPageItemsId = currentPageItems.map((
|
|
116
|
+
const currentPageItemsId = currentPageItems.map(({ id }) => id);
|
|
101
117
|
if (!gridRef.current) {
|
|
102
118
|
return;
|
|
103
119
|
}
|
|
104
120
|
const api = gridRef.current.api;
|
|
105
|
-
currentPageItems.forEach((
|
|
106
|
-
api.getRowNode(
|
|
121
|
+
currentPageItems.forEach(({ id }) => {
|
|
122
|
+
api.getRowNode(id)?.setSelected(false);
|
|
107
123
|
});
|
|
108
124
|
setIsChecked(false);
|
|
109
125
|
setSelectedEmployee((prev) => prev.filter((id) => !currentPageItemsId.includes(id)));
|
|
@@ -111,7 +127,7 @@ const useAgGridCheckBoxSelection = ({ gridRef, setSelectedEmployee, currentPageI
|
|
|
111
127
|
});
|
|
112
128
|
(0, react_1.useEffect)(() => {
|
|
113
129
|
const isCurrentPageDataChecked = currentPageItems.length > 0 &&
|
|
114
|
-
currentPageItems.every((
|
|
130
|
+
currentPageItems.every(({ id }) => selectedEmployee.includes(id));
|
|
115
131
|
setIsChecked(isCurrentPageDataChecked);
|
|
116
132
|
const handler = (event) => {
|
|
117
133
|
if (event.code !== "Space") {
|
|
@@ -130,7 +146,7 @@ const useAgGridCheckBoxSelection = ({ gridRef, setSelectedEmployee, currentPageI
|
|
|
130
146
|
header?.removeEventListener("keydown", handler);
|
|
131
147
|
};
|
|
132
148
|
}, [currentPageItems, selectedEmployee]);
|
|
133
|
-
const currentPageSelectedItems = currentPageItems.filter((
|
|
149
|
+
const currentPageSelectedItems = currentPageItems.filter(({ id }) => selectedEmployee.includes(id)).length;
|
|
134
150
|
const isIndeterminate = (currentPageSelectedItems &&
|
|
135
151
|
currentPageSelectedItems < currentPageItems.length) ||
|
|
136
152
|
false;
|
|
@@ -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;
|
|
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;AAKzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAUlD,MAAM,MAAM,MAAM,GAAG;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,WAAW,IAAI,kBAAkB,CAAC,CAAC,CAAC,GAC1E,IAAI,CACF,IAAI,CACF,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EACvD,aAAa,CACd,EACD,MAAM,qBAAqB,CAAC,CAAC,CAAC,CAC/B,GAAG;IACF,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,CACb,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,EACrC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,KACzB,GAAG,CAAC,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C,aAAa,CAAC,EAAE,iBAAiB,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:
|
|
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
|
-
},
|
|
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
|
-
|
|
237
|
-
|
|
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,
|
|
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
|
-
|
|
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,
|
|
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
|
-
|
|
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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HighlightedText.d.ts","sourceRoot":"","sources":["../../src/HighlightedText/HighlightedText.tsx"],"names":[],"mappings":"AAIA,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,2BAG7B,oBAAoB,KAAG,GAAG,CAAC,OA2C7B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HighlightedText = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const regex_1 = require("../utils/regex");
|
|
7
|
+
const HighlightedText = ({ text, highlightWords, }) => {
|
|
8
|
+
const theme = (0, material_1.useTheme)();
|
|
9
|
+
const { slate } = theme.palette.app.color;
|
|
10
|
+
if (!highlightWords?.length) {
|
|
11
|
+
return (0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", children: text });
|
|
12
|
+
}
|
|
13
|
+
const escapedWords = highlightWords.map((w) => w.replace(regex_1.highlightWordsRegex, "\\$&"));
|
|
14
|
+
const pattern = new RegExp(`(${escapedWords.join("|")})`, "gi");
|
|
15
|
+
const segments = text.split(pattern);
|
|
16
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", children: segments.map((segment, index) => pattern.test(segment) ? ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", sx: {
|
|
17
|
+
padding: "2px 4px",
|
|
18
|
+
backgroundColor: slate[800],
|
|
19
|
+
border: `1px solid ${slate[700]}`,
|
|
20
|
+
borderRadius: "5px",
|
|
21
|
+
fontFamily: "monospace",
|
|
22
|
+
fontSize: "0.9em",
|
|
23
|
+
}, children: segment }, `highlight-${index}-${segment}`)) : ((0, jsx_runtime_1.jsx)(material_1.Box, { component: "span", children: segment }, `text-${index}-${segment}`))) }));
|
|
24
|
+
};
|
|
25
|
+
exports.HighlightedText = HighlightedText;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/HighlightedText/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,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("./HighlightedText"), exports);
|
package/packages/shared-components/dist/SmartGrid/Components/FacetedFilter/FacetedFilter.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,
|
|
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"}
|
|
@@ -142,7 +142,7 @@ const FacetedFilter = ({ header, resetAllFilters, }) => {
|
|
|
142
142
|
backgroundColor: hasActiveFilter
|
|
143
143
|
? (0, material_1.lighten)(butterflyBlue[900], 0.7)
|
|
144
144
|
: (0, material_1.lighten)(iron[500], 0.7),
|
|
145
|
-
}
|
|
145
|
+
},
|
|
146
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: {
|
|
147
147
|
backgroundColor: butterflyBlue[900],
|
|
148
148
|
borderRadius: "50%",
|
|
@@ -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 @@
|
|
|
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,EAAE,OAAO,CAAC,IAAI;IACvD,eAAe,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,mBAAmB,EAAE,aAAa,EAAE,CAAC;IACrC,UAAU,EAAE,cAAc,EAAE,CAAC;IAC7B,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC3C,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,GAAG,CAAC,CAAC,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;IACnB,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC;IAC7B,QAAQ,EAAE,CAAC,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -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 +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);
|
|
@@ -8,14 +8,15 @@ export * from "./Button";
|
|
|
8
8
|
export * from "./Card";
|
|
9
9
|
export * from "./CellSelectionTable";
|
|
10
10
|
export * from "./Charts";
|
|
11
|
-
export * from "./codeSnippetBox";
|
|
12
11
|
export * from "./Chips";
|
|
12
|
+
export * from "./codeSnippetBox";
|
|
13
13
|
export * from "./ColumnArranger";
|
|
14
14
|
export * from "./ContentBox";
|
|
15
15
|
export * from "./Dialog";
|
|
16
16
|
export * from "./Drawer";
|
|
17
17
|
export * from "./FilterList";
|
|
18
18
|
export * from "./FormFields";
|
|
19
|
+
export * from "./HighlightedText";
|
|
19
20
|
export * from "./Indicator";
|
|
20
21
|
export * from "./Layouts";
|
|
21
22
|
export * from "./Loader";
|
|
@@ -31,7 +32,7 @@ export * from "./TabBar";
|
|
|
31
32
|
export * from "./Timeline";
|
|
32
33
|
export * from "./Toast";
|
|
33
34
|
export * from "./Tooltip";
|
|
35
|
+
export * from "./Tree";
|
|
34
36
|
export * from "./UserProfileMenu";
|
|
35
37
|
export * from "./utils";
|
|
36
|
-
export * from "./Tree";
|
|
37
38
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,SAAS,CAAC"}
|
|
@@ -24,14 +24,15 @@ __exportStar(require("./Button"), exports);
|
|
|
24
24
|
__exportStar(require("./Card"), exports);
|
|
25
25
|
__exportStar(require("./CellSelectionTable"), exports);
|
|
26
26
|
__exportStar(require("./Charts"), exports);
|
|
27
|
-
__exportStar(require("./codeSnippetBox"), exports);
|
|
28
27
|
__exportStar(require("./Chips"), exports);
|
|
28
|
+
__exportStar(require("./codeSnippetBox"), exports);
|
|
29
29
|
__exportStar(require("./ColumnArranger"), exports);
|
|
30
30
|
__exportStar(require("./ContentBox"), exports);
|
|
31
31
|
__exportStar(require("./Dialog"), exports);
|
|
32
32
|
__exportStar(require("./Drawer"), exports);
|
|
33
33
|
__exportStar(require("./FilterList"), exports);
|
|
34
34
|
__exportStar(require("./FormFields"), exports);
|
|
35
|
+
__exportStar(require("./HighlightedText"), exports);
|
|
35
36
|
__exportStar(require("./Indicator"), exports);
|
|
36
37
|
__exportStar(require("./Layouts"), exports);
|
|
37
38
|
__exportStar(require("./Loader"), exports);
|
|
@@ -47,6 +48,6 @@ __exportStar(require("./TabBar"), exports);
|
|
|
47
48
|
__exportStar(require("./Timeline"), exports);
|
|
48
49
|
__exportStar(require("./Toast"), exports);
|
|
49
50
|
__exportStar(require("./Tooltip"), exports);
|
|
51
|
+
__exportStar(require("./Tree"), exports);
|
|
50
52
|
__exportStar(require("./UserProfileMenu"), exports);
|
|
51
53
|
__exportStar(require("./utils"), exports);
|
|
52
|
-
__exportStar(require("./Tree"), exports);
|
|
@@ -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;
|
|
@@ -4,4 +4,6 @@ export declare const noSpecialCharacterRegex: RegExp;
|
|
|
4
4
|
export declare const emailRegex: RegExp;
|
|
5
5
|
export declare const timeRegex: RegExp;
|
|
6
6
|
export declare const accessorFnRegex: RegExp;
|
|
7
|
+
export declare const hslaRegex: RegExp;
|
|
8
|
+
export declare const highlightWordsRegex: RegExp;
|
|
7
9
|
//# sourceMappingURL=regex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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;AAE5E,eAAO,MAAM,mBAAmB,QAAwB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.accessorFnRegex = exports.timeRegex = exports.emailRegex = exports.noSpecialCharacterRegex = exports.isoDateRegex = exports.monthYearRegex = void 0;
|
|
3
|
+
exports.highlightWordsRegex = exports.hslaRegex = exports.accessorFnRegex = exports.timeRegex = exports.emailRegex = exports.noSpecialCharacterRegex = exports.isoDateRegex = exports.monthYearRegex = void 0;
|
|
4
4
|
/* eslint-disable sonarjs/unnecessary-character-escapes */
|
|
5
5
|
/* eslint-disable no-useless-escape */
|
|
6
6
|
/* eslint-disable sonarjs/single-character-alternation */
|
|
@@ -15,3 +15,5 @@ exports.noSpecialCharacterRegex = /^[a-zA-Z0-9 ]*$/;
|
|
|
15
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}))\]))$/;
|
|
16
16
|
exports.timeRegex = /^\d{1,3}:\d{2}(:\d{2})?$/;
|
|
17
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.]+)?\)/;
|
|
19
|
+
exports.highlightWordsRegex = /[.*+?^${}()|[\]\\]/g;
|
|
@@ -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,
|
|
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"}
|