linear-react-components-ui 0.4.76-rc.16 → 0.4.76-rc.17
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/lib/form/index.js +5 -11
- package/lib/tabs/index.js +5 -5
- package/package.json +1 -1
package/lib/form/index.js
CHANGED
|
@@ -113,11 +113,7 @@ var Form = function Form(_ref) {
|
|
|
113
113
|
fieldErrors = _useState8[0],
|
|
114
114
|
setFieldErrors = _useState8[1];
|
|
115
115
|
|
|
116
|
-
var
|
|
117
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
118
|
-
fieldsValidators = _useState10[0],
|
|
119
|
-
setFieldsValidators = _useState10[1];
|
|
120
|
-
|
|
116
|
+
var fieldsValidators = (0, _react.useRef)({});
|
|
121
117
|
var context = (0, _react.useContext)(_withFormSecurity.FormSecurityContext);
|
|
122
118
|
|
|
123
119
|
var getValidatesErrorMessages = function getValidatesErrorMessages(validators, fieldValue) {
|
|
@@ -135,7 +131,7 @@ var Form = function Form(_ref) {
|
|
|
135
131
|
var dataValidate = value || data;
|
|
136
132
|
var currentFieldErrors = {};
|
|
137
133
|
|
|
138
|
-
_lodash["default"].forEach(fieldsValidators, function (validators, fieldName) {
|
|
134
|
+
_lodash["default"].forEach(fieldsValidators.current, function (validators, fieldName) {
|
|
139
135
|
var fieldValue = _lodash["default"].get(dataValidate, fieldName);
|
|
140
136
|
|
|
141
137
|
var messages = getValidatesErrorMessages(validators, fieldValue);
|
|
@@ -198,9 +194,9 @@ var Form = function Form(_ref) {
|
|
|
198
194
|
};
|
|
199
195
|
|
|
200
196
|
var onRemoveFieldValidators = function onRemoveFieldValidators(fieldName) {
|
|
201
|
-
var newFieldsValidators = _lodash["default"].omit(fieldsValidators, fieldName);
|
|
197
|
+
var newFieldsValidators = _lodash["default"].omit(fieldsValidators.current, fieldName);
|
|
202
198
|
|
|
203
|
-
|
|
199
|
+
fieldsValidators.current = newFieldsValidators;
|
|
204
200
|
};
|
|
205
201
|
|
|
206
202
|
var onBeforeUnload = function onBeforeUnload(e) {
|
|
@@ -226,9 +222,7 @@ var Form = function Form(_ref) {
|
|
|
226
222
|
handlerFieldChange: onFieldChange,
|
|
227
223
|
handlerFieldValidade: onValidate,
|
|
228
224
|
handlerStoreValidators: function handlerStoreValidators(fieldName, fieldValidates) {
|
|
229
|
-
|
|
230
|
-
return _extends({}, prevState, _defineProperty({}, fieldName, fieldValidates));
|
|
231
|
-
});
|
|
225
|
+
fieldsValidators.current = _extends({}, fieldsValidators.current, _defineProperty({}, fieldName, fieldValidates));
|
|
232
226
|
},
|
|
233
227
|
handlerRemoveValidators: onRemoveFieldValidators,
|
|
234
228
|
data: data,
|
package/lib/tabs/index.js
CHANGED
|
@@ -63,7 +63,7 @@ var Tabs = function Tabs(props) {
|
|
|
63
63
|
style = props.style,
|
|
64
64
|
selectedTab = props.selectedTab,
|
|
65
65
|
toolbar = props.toolbar,
|
|
66
|
-
|
|
66
|
+
tabsWidthOnExceedCount = props.tabsWidthOnExceedCount;
|
|
67
67
|
|
|
68
68
|
var _useState = (0, _react.useState)((0, _tabHelpers.buildPanels)(children) || []),
|
|
69
69
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -153,8 +153,8 @@ var Tabs = function Tabs(props) {
|
|
|
153
153
|
var lastPanel = newCurrentPanels[newCurrentPanels.length - 1];
|
|
154
154
|
newDropdownPanels.push(lastPanel);
|
|
155
155
|
newCurrentPanels.pop();
|
|
156
|
-
if (
|
|
157
|
-
} else if (tabsListWidth + (
|
|
156
|
+
if (tabsWidthOnExceedCount) setTabWidth(tabsWidthOnExceedCount);
|
|
157
|
+
} else if (tabsListWidth + (tabsWidthOnExceedCount || 110) < tabsContentWidth && newDropdownPanels.length) {
|
|
158
158
|
newCurrentPanels.push(newDropdownPanels[0]);
|
|
159
159
|
newDropdownPanels.shift();
|
|
160
160
|
}
|
|
@@ -292,7 +292,7 @@ Tabs.propTypes = {
|
|
|
292
292
|
toolbar: _propTypes["default"].object,
|
|
293
293
|
customClassForToolBar: _propTypes["default"].string,
|
|
294
294
|
style: _propTypes["default"].object,
|
|
295
|
-
|
|
295
|
+
tabsWidthOnExceedCount: _propTypes["default"].number
|
|
296
296
|
};
|
|
297
297
|
Tabs.defaultProps = {
|
|
298
298
|
selectedTab: null,
|
|
@@ -304,7 +304,7 @@ Tabs.defaultProps = {
|
|
|
304
304
|
toolbar: undefined,
|
|
305
305
|
customClassForToolBar: '',
|
|
306
306
|
style: {},
|
|
307
|
-
|
|
307
|
+
tabsWidthOnExceedCount: 0
|
|
308
308
|
};
|
|
309
309
|
var _default = Tabs;
|
|
310
310
|
exports["default"] = _default;
|