tenjin-ui-kit 0.3.4 → 0.3.6
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.
|
@@ -79,7 +79,9 @@ var Input = function Input(_ref) {
|
|
|
79
79
|
disabled: isDisabled,
|
|
80
80
|
onBlur: function onBlur(e) {
|
|
81
81
|
setTimeout(function () {
|
|
82
|
-
rest.onBlur
|
|
82
|
+
if (e && typeof rest.onBlur === "function") {
|
|
83
|
+
rest.onBlur(e);
|
|
84
|
+
}
|
|
83
85
|
}, onBlurDelay || 100);
|
|
84
86
|
},
|
|
85
87
|
autoFocus: !!autoFocus ? rest.value ? rest.value : true : false,
|
package/components/sort/index.js
CHANGED
|
@@ -26,27 +26,30 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
26
26
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
27
27
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
28
28
|
var Sort = function Sort(_ref) {
|
|
29
|
+
var _options$;
|
|
29
30
|
var onChange = _ref.onChange,
|
|
30
31
|
variant = _ref.variant,
|
|
31
32
|
columnName = _ref.columnName,
|
|
32
33
|
options = _ref.options,
|
|
33
34
|
defaultSelectedOptions = _ref.defaultSelectedOptions;
|
|
35
|
+
console.log({
|
|
36
|
+
defaultSelectedOptions: defaultSelectedOptions
|
|
37
|
+
});
|
|
34
38
|
var theme = (0, _material.useTheme)();
|
|
35
39
|
var _useState = (0, _react.useState)(null),
|
|
36
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
37
41
|
menuAnchor = _useState2[0],
|
|
38
42
|
setMenuAnchor = _useState2[1];
|
|
39
|
-
var _React$useState = _react.default.useState([]),
|
|
43
|
+
var _React$useState = _react.default.useState(defaultSelectedOptions ? defaultSelectedOptions : (_options$ = options[0]) === null || _options$ === void 0 ? void 0 : _options$.value),
|
|
40
44
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
41
45
|
value = _React$useState2[0],
|
|
42
46
|
setValue = _React$useState2[1];
|
|
43
|
-
console.log({
|
|
44
|
-
defaultSelectedOptions: defaultSelectedOptions
|
|
45
|
-
});
|
|
46
47
|
(0, _react.useEffect)(function () {
|
|
47
|
-
if (
|
|
48
|
-
var
|
|
49
|
-
setValue((
|
|
48
|
+
if (!defaultSelectedOptions) {
|
|
49
|
+
var _options$2;
|
|
50
|
+
setValue((_options$2 = options[0]) === null || _options$2 === void 0 ? void 0 : _options$2.value);
|
|
51
|
+
} else {
|
|
52
|
+
setValue(defaultSelectedOptions);
|
|
50
53
|
}
|
|
51
54
|
}, [defaultSelectedOptions]);
|
|
52
55
|
var handleMenuClose = function handleMenuClose() {
|