sag_components 1.0.98 → 1.0.100
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.
|
@@ -57,7 +57,9 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
57
57
|
inputRef = _ref.inputRef,
|
|
58
58
|
defaultValue = _ref.defaultValue,
|
|
59
59
|
_ref$allowedInput = _ref.allowedInput,
|
|
60
|
-
allowedInput = _ref$allowedInput === void 0 ? "all" : _ref$allowedInput
|
|
60
|
+
allowedInput = _ref$allowedInput === void 0 ? "all" : _ref$allowedInput,
|
|
61
|
+
_ref$reset = _ref.reset,
|
|
62
|
+
reset = _ref$reset === void 0 ? false : _ref$reset;
|
|
61
63
|
/**
|
|
62
64
|
* SAG Dropdown
|
|
63
65
|
*/
|
|
@@ -70,10 +72,12 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
70
72
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
71
73
|
currentOption = _useState4[0],
|
|
72
74
|
setCurrentOption = _useState4[1];
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
75
|
+
//const [defaultValueSetFlag, setDefaultValueSetFlag] = useState(false);
|
|
76
|
+
|
|
77
|
+
// useEffect(() => {
|
|
78
|
+
// reset ? setDefaultValueSetFlag(false) : null;
|
|
79
|
+
// }, [reset]);
|
|
80
|
+
|
|
77
81
|
(0, _react.useEffect)(function () {
|
|
78
82
|
var delayDebounceFn = setTimeout(function () {
|
|
79
83
|
onInputChange(currentInputValue);
|
|
@@ -135,7 +139,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
135
139
|
syntheticBaseEvent: event,
|
|
136
140
|
newValue: newValue
|
|
137
141
|
});
|
|
138
|
-
setDefaultValueSetFlag(true);
|
|
142
|
+
//setDefaultValueSetFlag(true);
|
|
139
143
|
onChange({
|
|
140
144
|
syntheticBaseEvent: event,
|
|
141
145
|
newValue: newValue
|
|
@@ -172,6 +176,7 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
172
176
|
return /*#__PURE__*/_react.default.createElement(_styles.ThemeProvider, {
|
|
173
177
|
theme: theme
|
|
174
178
|
}, /*#__PURE__*/_react.default.createElement(_Autocomplete.default, {
|
|
179
|
+
key: reset,
|
|
175
180
|
onChange: function onChange(event, newValue) {
|
|
176
181
|
onChangeHandler(event, newValue);
|
|
177
182
|
},
|
|
@@ -180,8 +185,13 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
180
185
|
},
|
|
181
186
|
disablePortal: true
|
|
182
187
|
// value={defaultValue && !currentOption?.newValue ? defaultValue : currentOption?.newValue}
|
|
188
|
+
// value={
|
|
189
|
+
// defaultValue && !defaultValueSetFlag
|
|
190
|
+
// ? defaultValue
|
|
191
|
+
// : currentOption?.newValue
|
|
192
|
+
// }
|
|
183
193
|
,
|
|
184
|
-
|
|
194
|
+
defaultValue: defaultValue,
|
|
185
195
|
id: "combo-box",
|
|
186
196
|
options: options,
|
|
187
197
|
sx: {
|
|
@@ -237,6 +247,8 @@ var Dropdown = function Dropdown(_ref) {
|
|
|
237
247
|
return /*#__PURE__*/_react.default.createElement(_styles.ThemeProvider, {
|
|
238
248
|
theme: theme
|
|
239
249
|
}, /*#__PURE__*/_react.default.createElement(_Autocomplete.default, {
|
|
250
|
+
key: reset,
|
|
251
|
+
defaultValue: defaultValue,
|
|
240
252
|
style: {
|
|
241
253
|
width: width
|
|
242
254
|
},
|
|
@@ -13,13 +13,17 @@ var _OneColumnContainer = require("./OneColumnContainer.style");
|
|
|
13
13
|
var _InfoIcon = require("./InfoIcon");
|
|
14
14
|
var _core = require("@dnd-kit/core");
|
|
15
15
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
16
|
-
var
|
|
16
|
+
var _reactLoadingSkeleton = _interopRequireWildcard(require("react-loading-skeleton"));
|
|
17
|
+
require("react-loading-skeleton/dist/skeleton.css");
|
|
18
|
+
var _excluded = ["children", "display", "isLoading", "gridTemplateColumns", "nodeRef", "itemClass", "divStyle", "overStyle", "draggingStyle", "droppedStyle", "refId", "width", "height", "infoText"];
|
|
17
19
|
/**
|
|
18
20
|
* Primary UI component for user interaction
|
|
19
21
|
*/
|
|
20
22
|
var OneColumnContainer = function OneColumnContainer(_ref) {
|
|
21
23
|
var children = _ref.children,
|
|
22
|
-
display = _ref.display,
|
|
24
|
+
_ref$display = _ref.display,
|
|
25
|
+
display = _ref$display === void 0 ? 'flex' : _ref$display,
|
|
26
|
+
isLoading = _ref.isLoading,
|
|
23
27
|
gridTemplateColumns = _ref.gridTemplateColumns,
|
|
24
28
|
nodeRef = _ref.nodeRef,
|
|
25
29
|
itemClass = _ref.itemClass,
|
|
@@ -44,15 +48,42 @@ var OneColumnContainer = function OneColumnContainer(_ref) {
|
|
|
44
48
|
width: width,
|
|
45
49
|
height: height
|
|
46
50
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
51
|
+
id: "mainDiv",
|
|
47
52
|
className: props.className,
|
|
48
53
|
style: {
|
|
54
|
+
alignItems: "flex-start",
|
|
55
|
+
justifyContent: "center",
|
|
49
56
|
width: width,
|
|
50
57
|
height: height,
|
|
51
58
|
display: display,
|
|
52
59
|
gridTemplateColumns: gridTemplateColumns
|
|
53
60
|
},
|
|
54
61
|
ref: nodeRef
|
|
55
|
-
}, children, /*#__PURE__*/_react.default.createElement(
|
|
62
|
+
}, children, isLoading && /*#__PURE__*/_react.default.createElement("div", {
|
|
63
|
+
id: "loadingDiv",
|
|
64
|
+
style: {
|
|
65
|
+
marginTop: '20px',
|
|
66
|
+
display: 'flex',
|
|
67
|
+
flexDirection: 'column',
|
|
68
|
+
justifyContent: 'space-evenly',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
width: "76%",
|
|
71
|
+
height: "65%"
|
|
72
|
+
}
|
|
73
|
+
}, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.SkeletonTheme, {
|
|
74
|
+
baseColor: "#EAEAEA"
|
|
75
|
+
}, /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
76
|
+
enableAnimation: true,
|
|
77
|
+
width: width.replace('px', '') * 0.76,
|
|
78
|
+
height: 45,
|
|
79
|
+
containerClassName: "avatar-skeleton"
|
|
80
|
+
}), /*#__PURE__*/_react.default.createElement(_reactLoadingSkeleton.default, {
|
|
81
|
+
enableAnimation: true,
|
|
82
|
+
count: 4,
|
|
83
|
+
width: width.replace('px', '') * 0.76,
|
|
84
|
+
height: 10,
|
|
85
|
+
containerClassName: "avatar-skeleton"
|
|
86
|
+
}))), !isLoading && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_OneColumnContainer.InfoTextContainer, {
|
|
56
87
|
clicked: clicked,
|
|
57
88
|
width: width,
|
|
58
89
|
height: height
|
|
@@ -60,7 +91,7 @@ var OneColumnContainer = function OneColumnContainer(_ref) {
|
|
|
60
91
|
onClick: onInfoClick
|
|
61
92
|
}, /*#__PURE__*/_react.default.createElement(_InfoIcon.InfoIcon, {
|
|
62
93
|
clicked: clicked
|
|
63
|
-
}))));
|
|
94
|
+
})))));
|
|
64
95
|
};
|
|
65
96
|
exports.OneColumnContainer = OneColumnContainer;
|
|
66
97
|
OneColumnContainer.defaultProps = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sag_components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.100",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"classnames": "^2.3.2",
|
|
56
56
|
"hoopy": "^0.1.4",
|
|
57
57
|
"react-css-modules": "^4.7.11",
|
|
58
|
+
"react-loading-skeleton": "^3.3.1",
|
|
58
59
|
"react-scripts": "5.0.1",
|
|
59
60
|
"recharts": "^2.6.2"
|
|
60
61
|
},
|