sag_components 1.0.371 → 1.0.372
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/.history/.env_20231001120549 +0 -0
- package/.history/.env_20231001120613 +1 -0
- package/.history/.env_20231003143620 +1 -0
- package/.history/.eslintrc_20230928112617.js +26 -0
- package/.history/.eslintrc_20230928130534.js +27 -0
- package/.history/.eslintrc_20230928133400.js +28 -0
- package/.history/.eslintrc_20230928133404.js +28 -0
- package/.history/.eslintrc_20230928133416.js +28 -0
- package/.history/.eslintrc_20230928133419.js +28 -0
- package/.history/.eslintrc_20230928133432.js +28 -0
- package/.history/.eslintrc_20230928133439.js +28 -0
- package/.history/.eslintrc_20230928133458.js +29 -0
- package/.history/.eslintrc_20230928133500.js +28 -0
- package/.history/.eslintrc_20230928134009.js +28 -0
- package/.history/.eslintrc_20230928135318.js +34 -0
- package/.history/.eslintrc_20230928135321.js +34 -0
- package/.history/.eslintrc_20230928135323.js +34 -0
- package/.history/.eslintrc_20230928135332.js +34 -0
- package/.history/.eslintrc_20230928135333.js +34 -0
- package/.history/.eslintrc_20230928135352.js +29 -0
- package/.history/.eslintrc_20230928135353.js +29 -0
- package/.history/.eslintrc_20230928135355.js +29 -0
- package/.history/.eslintrc_20230928135408.js +29 -0
- package/.history/.eslintrc_20230928135538.js +30 -0
- package/.history/.eslintrc_20230928135539.js +30 -0
- package/.history/.eslintrc_20230928135543.js +30 -0
- package/.history/.gitignore_20230921093332 +119 -0
- package/.history/.gitignore_20230921111638 +120 -0
- package/.history/.gitignore_20230921111650 +120 -0
- package/.history/.gitignore_20230921111810 +121 -0
- package/.history/package-lock_20231114111138.json +47810 -0
- package/.history/package-lock_20231114111158.json +47802 -0
- package/.history/package_20231029152422.json +82 -0
- package/.history/package_20231029153420.json +82 -0
- package/.history/package_20231029154416.json +82 -0
- package/.history/package_20231030094127.json +82 -0
- package/.history/package_20231030114707.json +82 -0
- package/.history/package_20231030130704.json +82 -0
- package/.history/package_20231030132422.json +82 -0
- package/.history/package_20231030134051.json +82 -0
- package/.history/package_20231030142913.json +82 -0
- package/.history/package_20231030143556.json +82 -0
- package/.history/package_20231030144210.json +82 -0
- package/.history/package_20231101113942.json +82 -0
- package/.history/package_20231101114544.json +82 -0
- package/.history/package_20231101151518.json +82 -0
- package/.history/package_20231101154501.json +82 -0
- package/.history/package_20231101155811.json +82 -0
- package/.history/package_20231101160235.json +82 -0
- package/.history/package_20231101160406.json +82 -0
- package/.history/package_20231101161325.json +82 -0
- package/.history/package_20231101161333.json +82 -0
- package/.history/package_20231102123623.json +82 -0
- package/.history/package_20231102125741.json +82 -0
- package/.history/package_20231102130857.json +82 -0
- package/.history/package_20231102132227.json +82 -0
- package/.history/package_20231102142340.json +82 -0
- package/.history/package_20231102143256.json +82 -0
- package/.history/package_20231105153539.json +82 -0
- package/.history/package_20231105154332.json +82 -0
- package/.history/package_20231105171201.json +82 -0
- package/.history/package_20231106123849.json +82 -0
- package/.history/package_20231107170638.json +82 -0
- package/.history/package_20231109103647.json +82 -0
- package/.history/package_20231109103911.json +82 -0
- package/.history/package_20231109105426.json +82 -0
- package/.history/package_20231109132014.json +82 -0
- package/.history/package_20231109132115.json +82 -0
- package/.history/package_20231114100517.json +82 -0
- package/.history/package_20231114100859.json +82 -0
- package/.history/package_20231114101553.json +82 -0
- package/.history/package_20231114102545.json +82 -0
- package/.history/package_20231114111208.json +83 -0
- package/.history/package_20231114111515.json +83 -0
- package/.history/package_20231114112931.json +83 -0
- package/.history/package_20231114113014.json +83 -0
- package/.history/package_20231114113155.json +83 -0
- package/.history/package_20231114124318.json +83 -0
- package/.history/package_20231114125107.json +83 -0
- package/.history/package_20231114125510.json +83 -0
- package/.history/package_20231114132634.json +83 -0
- package/.history/package_20231116165815.json +83 -0
- package/.history/package_20231116165916.json +83 -0
- package/.history/package_20231119113637.json +83 -0
- package/.history/package_20231120100907.json +83 -0
- package/.history/package_20231121151523.json +77 -0
- package/.history/package_20231121155513.json +77 -0
- package/.history/package_20231121162434.json +77 -0
- package/.history/package_20231122100718.json +77 -0
- package/.history/package_20231128125149.json +82 -0
- package/.history/package_20231128125208.json +82 -0
- package/dist/stories/components/Dropdown.js +128 -167
- package/dist/stories/components/ReportTable.js +42 -2
- package/dist/stories/components/ReportTable.style.js +11 -8
- package/dist/stories/components/TotalDoughnutChart.js +1 -1
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ var checkedIcon = /*#__PURE__*/_react.default.createElement(_CheckBox.default, {
|
|
|
33
33
|
*/
|
|
34
34
|
var Dropdown = exports.Dropdown = function Dropdown(_ref) {
|
|
35
35
|
var _ref$width = _ref.width,
|
|
36
|
-
width = _ref$width === void 0 ?
|
|
36
|
+
width = _ref$width === void 0 ? '100%' : _ref$width,
|
|
37
37
|
size = _ref.size,
|
|
38
38
|
text = _ref.text,
|
|
39
39
|
shape = _ref.shape,
|
|
@@ -46,24 +46,18 @@ var Dropdown = exports.Dropdown = function Dropdown(_ref) {
|
|
|
46
46
|
onChange = _ref.onChange,
|
|
47
47
|
onInputChange = _ref.onInputChange,
|
|
48
48
|
_ref$labelColor = _ref.labelColor,
|
|
49
|
-
labelColor = _ref$labelColor === void 0 ?
|
|
49
|
+
labelColor = _ref$labelColor === void 0 ? '#1B30AA' : _ref$labelColor,
|
|
50
50
|
required = _ref.required,
|
|
51
51
|
inputRef = _ref.inputRef,
|
|
52
52
|
defaultValue = _ref.defaultValue,
|
|
53
53
|
_ref$allowedInput = _ref.allowedInput,
|
|
54
|
-
allowedInput = _ref$allowedInput === void 0 ?
|
|
54
|
+
allowedInput = _ref$allowedInput === void 0 ? 'all' : _ref$allowedInput,
|
|
55
55
|
_ref$reset = _ref.reset,
|
|
56
56
|
reset = _ref$reset === void 0 ? false : _ref$reset,
|
|
57
57
|
_ref$disableClearable = _ref.disableClearable,
|
|
58
58
|
disableClearable = _ref$disableClearable === void 0 ? false : _ref$disableClearable,
|
|
59
59
|
_ref$disabled = _ref.disabled,
|
|
60
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled
|
|
61
|
-
_ref$dropdownListfont = _ref.dropdownListfontSize,
|
|
62
|
-
dropdownListfontSize = _ref$dropdownListfont === void 0 ? "14px" : _ref$dropdownListfont,
|
|
63
|
-
_ref$inputLabelFontSi = _ref.inputLabelFontSize,
|
|
64
|
-
inputLabelFontSize = _ref$inputLabelFontSi === void 0 ? "16px" : _ref$inputLabelFontSi,
|
|
65
|
-
_ref$placeHolderFontS = _ref.placeHolderFontSize,
|
|
66
|
-
placeHolderFontSize = _ref$placeHolderFontS === void 0 ? "14px" : _ref$placeHolderFontS;
|
|
60
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
|
67
61
|
/**
|
|
68
62
|
* SAG Dropdown
|
|
69
63
|
*/
|
|
@@ -72,18 +66,16 @@ var Dropdown = exports.Dropdown = function Dropdown(_ref) {
|
|
|
72
66
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
73
67
|
currentInputValue = _useState2[0],
|
|
74
68
|
setCurrentInputValue = _useState2[1];
|
|
75
|
-
var _useState3 = (0, _react.useState)(
|
|
76
|
-
filterArray: defaultValue
|
|
77
|
-
} : null),
|
|
69
|
+
var _useState3 = (0, _react.useState)(null),
|
|
78
70
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
71
|
+
currentOption = _useState4[0],
|
|
72
|
+
setCurrentOption = _useState4[1];
|
|
73
|
+
// const [defaultValueSetFlag, setDefaultValueSetFlag] = useState(false);
|
|
74
|
+
|
|
75
|
+
// useEffect(() => {
|
|
76
|
+
// reset ? setDefaultValueSetFlag(false) : null;
|
|
77
|
+
// }, [reset]);
|
|
78
|
+
|
|
87
79
|
(0, _react.useEffect)(function () {
|
|
88
80
|
var delayDebounceFn = setTimeout(function () {
|
|
89
81
|
onInputChange(currentInputValue);
|
|
@@ -97,114 +89,60 @@ var Dropdown = exports.Dropdown = function Dropdown(_ref) {
|
|
|
97
89
|
MuiFormLabel: {
|
|
98
90
|
styleOverrides: {
|
|
99
91
|
asterisk: {
|
|
100
|
-
color:
|
|
92
|
+
color: '#db3131'
|
|
101
93
|
}
|
|
102
94
|
}
|
|
103
95
|
}
|
|
104
96
|
}
|
|
105
97
|
});
|
|
106
98
|
|
|
107
|
-
//
|
|
108
|
-
var
|
|
109
|
-
if (shape ===
|
|
110
|
-
// round
|
|
111
|
-
return {
|
|
112
|
-
"& .MuiOutlinedInput-root": {
|
|
113
|
-
borderRadius: "12px",
|
|
114
|
-
legend: {
|
|
115
|
-
marginLeft: "10px"
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
"& .MuiAutocomplete-inputRoot": {
|
|
119
|
-
paddingLeft: "10px !important",
|
|
120
|
-
borderRadius: "12px",
|
|
121
|
-
// This matches the specificity of the default styles at https://github.com/mui-org/material-ui/blob/v4.11.3/packages/material-ui-lab/src/Autocomplete/Autocomplete.js#L90
|
|
122
|
-
'&[class*="MuiOutlinedInput-root"] .MuiAutocomplete-input:first-of-type': {
|
|
123
|
-
// Default left padding is 6px
|
|
124
|
-
paddingLeft: "10px"
|
|
125
|
-
},
|
|
126
|
-
"& .MuiOutlinedInput-notchedOutline": {
|
|
127
|
-
borderColor: "#E7E7E7"
|
|
128
|
-
},
|
|
129
|
-
"&:hover .MuiOutlinedInput-notchedOutline": {
|
|
130
|
-
borderColor: disabled ? "#E7E7E7" : labelColor
|
|
131
|
-
},
|
|
132
|
-
"&.Mui-focused .MuiOutlinedInput-notchedOutline": {
|
|
133
|
-
borderColor: disabled ? "#E7E7E7" : labelColor
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
"& .MuiInputLabel-outlined:not(.MuiInputLabel-shrink)": {
|
|
137
|
-
// Default transform is "translate(14px, 20px) scale(1)""
|
|
138
|
-
// This lines up the label with the initial cursor position in the input
|
|
139
|
-
// after changing its padding-left.
|
|
140
|
-
transform: "translate(14px, 18px) scale(1);",
|
|
141
|
-
fontSize: "14px",
|
|
142
|
-
color: disabled ? "#E7E7E7" : currentInputValue && currentInputValue.length > 0 ? "#212121" : "#757575"
|
|
143
|
-
},
|
|
144
|
-
"& .MuiInputLabel-outlined": {
|
|
145
|
-
paddingLeft: "10px",
|
|
146
|
-
color: disabled ? "#E7E7E7" : labelColor,
|
|
147
|
-
fontSize: "18px"
|
|
148
|
-
},
|
|
149
|
-
"& .MuiInputLabel-shrink": {
|
|
150
|
-
marginLeft: "1px",
|
|
151
|
-
paddingLeft: "4px",
|
|
152
|
-
paddingRight: "6px",
|
|
153
|
-
background: "white"
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
// square
|
|
158
|
-
return null;
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
// ---------------------------- Multi Text Style -----------------------------------------
|
|
162
|
-
var getTextFieldStyleMulti = function getTextFieldStyleMulti() {
|
|
163
|
-
if (shape === "round") {
|
|
99
|
+
// defines shape: squire or round
|
|
100
|
+
var getTextFieldStyle = function getTextFieldStyle() {
|
|
101
|
+
if (shape === 'round') {
|
|
164
102
|
// round
|
|
165
103
|
return {
|
|
166
|
-
|
|
167
|
-
borderRadius:
|
|
104
|
+
'& .MuiOutlinedInput-root': {
|
|
105
|
+
borderRadius: '12px',
|
|
168
106
|
legend: {
|
|
169
|
-
marginLeft:
|
|
107
|
+
marginLeft: '10px'
|
|
170
108
|
}
|
|
171
109
|
},
|
|
172
|
-
|
|
173
|
-
paddingLeft:
|
|
174
|
-
borderRadius:
|
|
110
|
+
'& .MuiAutocomplete-inputRoot': {
|
|
111
|
+
paddingLeft: '10px !important',
|
|
112
|
+
borderRadius: '12px',
|
|
175
113
|
// This matches the specificity of the default styles at https://github.com/mui-org/material-ui/blob/v4.11.3/packages/material-ui-lab/src/Autocomplete/Autocomplete.js#L90
|
|
176
114
|
'&[class*="MuiOutlinedInput-root"] .MuiAutocomplete-input:first-of-type': {
|
|
177
115
|
// Default left padding is 6px
|
|
178
|
-
paddingLeft:
|
|
116
|
+
paddingLeft: '10px'
|
|
179
117
|
},
|
|
180
|
-
|
|
181
|
-
borderColor:
|
|
118
|
+
'& .MuiOutlinedInput-notchedOutline': {
|
|
119
|
+
borderColor: '#E7E7E7'
|
|
182
120
|
},
|
|
183
|
-
|
|
184
|
-
borderColor: disabled ?
|
|
121
|
+
'&:hover .MuiOutlinedInput-notchedOutline': {
|
|
122
|
+
borderColor: disabled ? '#E7E7E7' : labelColor
|
|
185
123
|
},
|
|
186
|
-
|
|
187
|
-
borderColor: disabled ?
|
|
124
|
+
'&.Mui-focused .MuiOutlinedInput-notchedOutline': {
|
|
125
|
+
borderColor: disabled ? '#E7E7E7' : labelColor
|
|
188
126
|
}
|
|
189
127
|
},
|
|
190
|
-
|
|
128
|
+
'& .MuiInputLabel-outlined:not(.MuiInputLabel-shrink)': {
|
|
191
129
|
// Default transform is "translate(14px, 20px) scale(1)""
|
|
192
130
|
// This lines up the label with the initial cursor position in the input
|
|
193
131
|
// after changing its padding-left.
|
|
194
|
-
transform:
|
|
195
|
-
fontSize:
|
|
196
|
-
color: disabled ?
|
|
132
|
+
transform: 'translate(14px, 18px) scale(1);',
|
|
133
|
+
fontSize: '14px',
|
|
134
|
+
color: disabled ? '#E7E7E7' : currentInputValue && currentInputValue.length > 0 ? '#212121' : '#757575'
|
|
197
135
|
},
|
|
198
|
-
|
|
199
|
-
paddingLeft:
|
|
200
|
-
color: disabled ?
|
|
201
|
-
fontSize:
|
|
136
|
+
'& .MuiInputLabel-outlined': {
|
|
137
|
+
paddingLeft: '10px',
|
|
138
|
+
color: disabled ? '#E7E7E7' : labelColor,
|
|
139
|
+
fontSize: '18px'
|
|
202
140
|
},
|
|
203
|
-
|
|
204
|
-
marginLeft:
|
|
205
|
-
paddingLeft:
|
|
206
|
-
paddingRight:
|
|
207
|
-
background:
|
|
141
|
+
'& .MuiInputLabel-shrink': {
|
|
142
|
+
marginLeft: '1px',
|
|
143
|
+
paddingLeft: '4px',
|
|
144
|
+
paddingRight: '6px',
|
|
145
|
+
background: 'white'
|
|
208
146
|
}
|
|
209
147
|
};
|
|
210
148
|
}
|
|
@@ -218,10 +156,10 @@ var Dropdown = exports.Dropdown = function Dropdown(_ref) {
|
|
|
218
156
|
});
|
|
219
157
|
};
|
|
220
158
|
var onChangeHandler = function onChangeHandler(event, newValue) {
|
|
221
|
-
|
|
222
|
-
|
|
159
|
+
setCurrentOption({
|
|
160
|
+
syntheticBaseEvent: event,
|
|
161
|
+
newValue: newValue
|
|
223
162
|
});
|
|
224
|
-
console.log("currentFilterMultiSelectState", currentFilterMultiSelectState);
|
|
225
163
|
// setDefaultValueSetFlag(true);
|
|
226
164
|
onChange({
|
|
227
165
|
syntheticBaseEvent: event,
|
|
@@ -242,23 +180,21 @@ var Dropdown = exports.Dropdown = function Dropdown(_ref) {
|
|
|
242
180
|
var ALPHA_REGEX = /^[a-zA-Z]+$/;
|
|
243
181
|
var ALPHA_NUMERIC_REGEX = /^[a-zA-Z0-9-]+$/;
|
|
244
182
|
switch (allowedInput) {
|
|
245
|
-
case
|
|
183
|
+
case 'all':
|
|
246
184
|
return true;
|
|
247
|
-
case
|
|
185
|
+
case 'alpha':
|
|
248
186
|
if (ALPHA_REGEX.test(inputChar)) return true;
|
|
249
187
|
return false;
|
|
250
|
-
case
|
|
188
|
+
case 'numeric':
|
|
251
189
|
if (NUMERIC_REGEX.test(inputChar)) return true;
|
|
252
190
|
return false;
|
|
253
|
-
case
|
|
191
|
+
case 'alphaNumeric':
|
|
254
192
|
if (ALPHA_NUMERIC_REGEX.test(inputChar)) return true;
|
|
255
193
|
return false;
|
|
256
194
|
default:
|
|
257
195
|
return true;
|
|
258
196
|
}
|
|
259
197
|
};
|
|
260
|
-
|
|
261
|
-
// --------------------------------------- DROPDOWN SINGLE --------------------------------
|
|
262
198
|
var getAutocompleteSingle = function getAutocompleteSingle() {
|
|
263
199
|
return /*#__PURE__*/_react.default.createElement(_styles.ThemeProvider, {
|
|
264
200
|
theme: theme
|
|
@@ -275,9 +211,10 @@ var Dropdown = exports.Dropdown = function Dropdown(_ref) {
|
|
|
275
211
|
disableClearable: disableClearable,
|
|
276
212
|
defaultValue: defaultValue,
|
|
277
213
|
id: "combo-box",
|
|
278
|
-
options: options
|
|
279
|
-
|
|
280
|
-
|
|
214
|
+
options: options,
|
|
215
|
+
sx: {
|
|
216
|
+
width: width
|
|
217
|
+
},
|
|
281
218
|
popupIcon: showPopupIcon ? /*#__PURE__*/_react.default.createElement(_ArrowDropDownIcon.ArrowDropDownIcon, {
|
|
282
219
|
width: "0.5em",
|
|
283
220
|
height: "0.5em"
|
|
@@ -294,40 +231,45 @@ var Dropdown = exports.Dropdown = function Dropdown(_ref) {
|
|
|
294
231
|
label: text,
|
|
295
232
|
inputRef: inputRef || null,
|
|
296
233
|
size: size,
|
|
297
|
-
sx:
|
|
234
|
+
sx: getTextFieldStyle(),
|
|
298
235
|
placeholder: placeHolder,
|
|
299
236
|
InputProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params.InputProps), {}, {
|
|
300
237
|
style: {
|
|
301
|
-
fontSize:
|
|
302
|
-
fontFamily:
|
|
238
|
+
fontSize: '14px',
|
|
239
|
+
fontFamily: 'Poppins'
|
|
303
240
|
},
|
|
304
241
|
startAdornment: showSearchIcon ? /*#__PURE__*/_react.default.createElement(_InputAdornment.default, {
|
|
305
242
|
position: "start"
|
|
306
243
|
}, /*#__PURE__*/_react.default.createElement(_Search.default, {
|
|
307
244
|
fontSize: "medium"
|
|
308
245
|
})) : null
|
|
309
|
-
})
|
|
246
|
+
}),
|
|
247
|
+
InputLabelProps: {
|
|
248
|
+
style: {
|
|
249
|
+
// color: labelColor,
|
|
250
|
+
// fontSize: "14px",
|
|
251
|
+
fontFamily: 'Poppins'
|
|
252
|
+
}
|
|
253
|
+
}
|
|
310
254
|
}));
|
|
311
255
|
},
|
|
312
256
|
ListboxProps: {
|
|
313
257
|
style: {
|
|
314
|
-
fontSize:
|
|
315
|
-
|
|
316
|
-
fontFamily: "Poppins"
|
|
258
|
+
fontSize: '14px',
|
|
259
|
+
fontFamily: 'Poppins'
|
|
317
260
|
}
|
|
318
261
|
}
|
|
319
262
|
}));
|
|
320
263
|
};
|
|
321
|
-
|
|
322
|
-
// --------------------------------------- DROPDOWN MULTI --------------------------------
|
|
323
264
|
var getAutocompleteMulti = function getAutocompleteMulti() {
|
|
324
265
|
return /*#__PURE__*/_react.default.createElement(_styles.ThemeProvider, {
|
|
325
266
|
theme: theme
|
|
326
267
|
}, /*#__PURE__*/_react.default.createElement(_Autocomplete.default, {
|
|
327
268
|
key: reset,
|
|
328
|
-
defaultValue: defaultValue
|
|
329
|
-
|
|
330
|
-
|
|
269
|
+
defaultValue: defaultValue,
|
|
270
|
+
style: {
|
|
271
|
+
width: width
|
|
272
|
+
},
|
|
331
273
|
onChange: function onChange(event, newValue) {
|
|
332
274
|
onChangeHandler(event, newValue);
|
|
333
275
|
},
|
|
@@ -353,55 +295,74 @@ var Dropdown = exports.Dropdown = function Dropdown(_ref) {
|
|
|
353
295
|
return /*#__PURE__*/_react.default.createElement("li", props, /*#__PURE__*/_react.default.createElement(_Checkbox.default, {
|
|
354
296
|
icon: icon,
|
|
355
297
|
checkedIcon: checkedIcon,
|
|
356
|
-
|
|
298
|
+
style: {
|
|
299
|
+
marginRight: 8,
|
|
300
|
+
fontSize: '14px',
|
|
301
|
+
fontFamily: 'Poppins'
|
|
302
|
+
},
|
|
303
|
+
checked: selected
|
|
357
304
|
}), option.label);
|
|
358
305
|
},
|
|
359
306
|
renderInput: function renderInput(params) {
|
|
360
|
-
return (
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
event.preventDefault();
|
|
377
|
-
}
|
|
307
|
+
return showSearchIcon && (!currentOption || currentOption && currentOption.length === 0) ? /*#__PURE__*/_react.default.createElement(_TextField.default, Object.assign({}, params, {
|
|
308
|
+
label: text,
|
|
309
|
+
size: size,
|
|
310
|
+
sx: getTextFieldStyle(),
|
|
311
|
+
placeholder: placeHolder,
|
|
312
|
+
onKeyDown: function onKeyDown(event) {
|
|
313
|
+
if (!isInputAllowed(event.key)) {
|
|
314
|
+
event.preventDefault();
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
inputRef: inputRef || null,
|
|
318
|
+
required: required,
|
|
319
|
+
InputProps: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, params.InputProps), {}, {
|
|
320
|
+
style: {
|
|
321
|
+
fontSize: '14px',
|
|
322
|
+
fontFamily: 'Poppins'
|
|
378
323
|
},
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
324
|
+
startAdornment: /*#__PURE__*/_react.default.createElement(_InputAdornment.default, {
|
|
325
|
+
position: "start"
|
|
326
|
+
}, /*#__PURE__*/_react.default.createElement(_Search.default, {
|
|
327
|
+
fontSize: "medium"
|
|
328
|
+
}))
|
|
329
|
+
}),
|
|
330
|
+
InputLabelProps: {
|
|
331
|
+
style: {
|
|
332
|
+
// color: labelColor,
|
|
333
|
+
fontSize: '16px',
|
|
334
|
+
fontFamily: 'Poppins'
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
})) : /*#__PURE__*/_react.default.createElement(_TextField.default, Object.assign({}, params, {
|
|
338
|
+
label: text,
|
|
339
|
+
size: size,
|
|
340
|
+
sx: getTextFieldStyle(),
|
|
341
|
+
placeholder: placeHolder,
|
|
342
|
+
onKeyDown: function onKeyDown(event) {
|
|
343
|
+
if (!isInputAllowed(event.key)) {
|
|
344
|
+
event.preventDefault();
|
|
345
|
+
}
|
|
346
|
+
},
|
|
347
|
+
inputRef: inputRef || null,
|
|
348
|
+
required: required,
|
|
349
|
+
InputLabelProps: {
|
|
350
|
+
style: {
|
|
351
|
+
// color: labelColor,
|
|
352
|
+
fontSize: '16px',
|
|
353
|
+
fontFamily: 'Poppins'
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
}));
|
|
383
357
|
},
|
|
384
358
|
ListboxProps: {
|
|
385
359
|
style: {
|
|
386
|
-
fontSize:
|
|
387
|
-
|
|
388
|
-
fontFamily: "Poppins"
|
|
360
|
+
fontSize: '14px',
|
|
361
|
+
fontFamily: 'Poppins'
|
|
389
362
|
}
|
|
390
363
|
}
|
|
391
364
|
}));
|
|
392
365
|
};
|
|
393
|
-
var isOptionChecked = function isOptionChecked(option) {
|
|
394
|
-
var _currentFilterMultiSe;
|
|
395
|
-
if (currentFilterMultiSelectState && currentFilterMultiSelectState.filterArray && currentFilterMultiSelectState.filterArray.length > 0 && (_currentFilterMultiSe = currentFilterMultiSelectState.filterArray) !== null && _currentFilterMultiSe !== void 0 && _currentFilterMultiSe.map(function (itemFilter) {
|
|
396
|
-
return itemFilter.label;
|
|
397
|
-
}).includes(option.label)) {
|
|
398
|
-
return true;
|
|
399
|
-
} else {
|
|
400
|
-
return false;
|
|
401
|
-
}
|
|
402
|
-
};
|
|
403
|
-
|
|
404
|
-
// --------------------------------- MAIN -------------------------------------
|
|
405
366
|
return /*#__PURE__*/_react.default.createElement(_Dropdown.DropdownContainer, {
|
|
406
367
|
width: width
|
|
407
368
|
}, multiSelect ? getAutocompleteMulti() : getAutocompleteSingle());
|
|
@@ -12,11 +12,12 @@ var ReportTable = exports.ReportTable = function ReportTable(props) {
|
|
|
12
12
|
var tableData = props.tableData,
|
|
13
13
|
maxColumnsNumber = props.maxColumnsNumber;
|
|
14
14
|
var columnsNumber = tableData.columnsHeadings.length;
|
|
15
|
+
var tableWidthSize = 100 / maxColumnsNumber * columnsNumber;
|
|
15
16
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ReportTable.TableWrapper, {
|
|
16
17
|
maxColumnsNumber: maxColumnsNumber,
|
|
17
18
|
columnsNumber: columnsNumber
|
|
18
19
|
}, /*#__PURE__*/_react.default.createElement(_ReportTable.Table, {
|
|
19
|
-
tableWidthSize:
|
|
20
|
+
tableWidthSize: tableWidthSize
|
|
20
21
|
}, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, tableData.columnsHeadings.map(function (headline, index) {
|
|
21
22
|
return /*#__PURE__*/_react.default.createElement(_ReportTable.Th, {
|
|
22
23
|
key: index
|
|
@@ -33,4 +34,43 @@ var ReportTable = exports.ReportTable = function ReportTable(props) {
|
|
|
33
34
|
color: "#1B30AA"
|
|
34
35
|
}), /*#__PURE__*/_react.default.createElement(_ReportTable.InfoText, null, "Download table to get the full data")));
|
|
35
36
|
};
|
|
36
|
-
var _default = exports.default = ReportTable;
|
|
37
|
+
var _default = exports.default = ReportTable;
|
|
38
|
+
ReportTable.defaultProps = {
|
|
39
|
+
tableData: {
|
|
40
|
+
columnsHeadings: [{
|
|
41
|
+
label: 'Event Name',
|
|
42
|
+
key: 'eventName'
|
|
43
|
+
}, {
|
|
44
|
+
label: 'Retailer',
|
|
45
|
+
key: 'retailer'
|
|
46
|
+
}, {
|
|
47
|
+
label: 'Total Cost',
|
|
48
|
+
key: 'totalCost'
|
|
49
|
+
}, {
|
|
50
|
+
label: 'Inc. Baseline Sales',
|
|
51
|
+
key: 'incBaselineSales'
|
|
52
|
+
}],
|
|
53
|
+
rowsValues: [{
|
|
54
|
+
retailer: 'Large Selling Event P2 2023',
|
|
55
|
+
eventDescription: 'Food',
|
|
56
|
+
totalCost: 'Food Lion',
|
|
57
|
+
incBaselineSales: '50K'
|
|
58
|
+
}, {
|
|
59
|
+
retailer: 'Large Selling Event P2 2023',
|
|
60
|
+
eventDescription: 'Food',
|
|
61
|
+
totalCost: '$500K',
|
|
62
|
+
incBaselineSales: '50K'
|
|
63
|
+
}, {
|
|
64
|
+
retailer: 'Large Selling Event P2 2023',
|
|
65
|
+
eventDescription: 'Food',
|
|
66
|
+
totalCost: '$500K',
|
|
67
|
+
incBaselineSales: '50K'
|
|
68
|
+
}, {
|
|
69
|
+
retailer: 'Large Selling Event P2 2023',
|
|
70
|
+
eventDescription: 'Food',
|
|
71
|
+
totalCost: '$500K',
|
|
72
|
+
incBaselineSales: '50K'
|
|
73
|
+
}]
|
|
74
|
+
},
|
|
75
|
+
maxColumnsNumber: 3
|
|
76
|
+
};
|
|
@@ -4,18 +4,21 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.Tr = exports.Th = exports.
|
|
7
|
+
exports.Tr = exports.Th = exports.Td = exports.TableWrapper = exports.Table = exports.InfoText = exports.InfoBlock = void 0;
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/taggedTemplateLiteral"));
|
|
9
9
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
10
10
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7;
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
var scrollableStyles = "\n overflow-y: auto;\n\n &::-webkit-scrollbar {\n height: 10px;\n }\n\n &::-webkit-scrollbar-track {\n background: #E8E8E8;\n border-radius: 5px;\n }\n\n &::-webkit-scrollbar-thumb {\n background: #D0D0D0;\n border-radius: 5px;\n }\n";
|
|
12
|
+
var TableWrapper = exports.TableWrapper = _styledComponents.default.div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n width: 100%;\n white-space: nowrap;\n border: 1px solid #dddddd;\n border-radius: ", ";\n overflow-x: ", ";\n ", "\n\n"])), function (props) {
|
|
13
|
+
return props.columnsNumber > props.maxColumnsNumber ? ' 12px 12px 6px 6px' : '12px';
|
|
14
|
+
}, function (props) {
|
|
15
|
+
return props.columnsNumber > props.maxColumnsNumber ? 'auto' : 'hidden';
|
|
16
|
+
}, scrollableStyles);
|
|
17
|
+
var Table = exports.Table = _styledComponents.default.table(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n width: ", ";\n table-layout: fixed;\n position: relative;\n background-color: white;\n border-collapse: collapse; \n th,\n td {\n text-align: left;\n width: 100%;\n }\n"])), function (props) {
|
|
15
18
|
return "".concat(props.tableWidthSize, "%");
|
|
16
19
|
});
|
|
17
|
-
var Th = exports.Th = _styledComponents.default.th(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 600;\n font-size:
|
|
18
|
-
var Td = exports.Td = _styledComponents.default.td(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 400;\n font-size:
|
|
19
|
-
var Tr = exports.Tr = _styledComponents.default.tr(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n &:last-of-type {\n ::after {\n content: \"\";\n position: absolute;\n pointer-events: none;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(transparent 50%, white);\n z-index: 2;\n }\n }\n"])));
|
|
20
|
+
var Th = exports.Th = _styledComponents.default.th(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 600;\n font-size: 12px;\n font-family: \"poppins\";\n color: #212121;\n padding-top: 16px;\n padding-left: 40px;\n"])));
|
|
21
|
+
var Td = exports.Td = _styledComponents.default.td(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 400;\n font-size: 12px;\n font-family: \"poppins\";\n padding-top: 20px;\n padding-bottom: 20px;\n padding-top: 16px;\n padding-left: 40px;\n"])));
|
|
22
|
+
var Tr = exports.Tr = _styledComponents.default.tr(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2.default)(["\n border-bottom: 1px solid #F3F4F6;\n &:last-of-type {\n ::after {\n content: \"\";\n position: absolute;\n pointer-events: none;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: linear-gradient(transparent 50%, white);\n z-index: 2;\n }\n }\n"])));
|
|
20
23
|
var InfoText = exports.InfoText = _styledComponents.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n font-weight: 400;\n font-size: 14px;\n font-family: \"poppins\";\n color: #212121;\n padding-top: 20px;\n padding-bottom: 20px;\n"])));
|
|
21
24
|
var InfoBlock = exports.InfoBlock = _styledComponents.default.div(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 8px;\n background-color: white;\n"])));
|
|
@@ -115,7 +115,7 @@ var TotalDoughnutChart = exports.TotalDoughnutChart = function TotalDoughnutChar
|
|
|
115
115
|
style: {
|
|
116
116
|
fontWeight: itemsBoldedValues ? '700' : '500'
|
|
117
117
|
}
|
|
118
|
-
}, row.value !== undefined && row.value !== null ? dotCutTrenty(row) : 'No Data', row.value !== undefined && row.value !== null && dotCut ? (0, _CommonFunctions.getFormattedUnits)(row.value) : '', itemsPercentagesValueAside && " (".concat(Math.round(row.value / value * 100), "%)")))));
|
|
118
|
+
}, currencySign ? (0, _CommonFunctions.getCurrencySign)(currencyType, row.value) : '', row.value !== undefined && row.value !== null ? dotCutTrenty(row) : 'No Data', row.value !== undefined && row.value !== null && dotCut ? (0, _CommonFunctions.getFormattedUnits)(row.value) : '', itemsPercentagesValueAside && " (".concat(Math.round(row.value / value * 100), "%)")))));
|
|
119
119
|
})))) : /*#__PURE__*/_react.default.createElement(_NoDataFoundMessage.NoDataFoundMessage, {
|
|
120
120
|
noDataText: noDataText
|
|
121
121
|
}));
|