linear-react-components-ui 1.1.20-beta.12 → 1.1.20-beta.14
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/alerts/BaseAlert.js +1 -1
- package/lib/alerts/Message.js +1 -1
- package/lib/assets/styles/button.scss +0 -1
- package/lib/assets/styles/select.scss +2 -1
- package/lib/assets/styles/table.scss +10 -6
- package/lib/assets/styles/toolbar.scss +3 -0
- package/lib/assets/styles/wizard.scss +127 -0
- package/lib/avatar/index.js +8 -9
- package/lib/badge/index.js +4 -4
- package/lib/buttons/DangerButton.js +1 -1
- package/lib/buttons/DefaultButton.js +5 -17
- package/lib/buttons/InfoButton.js +1 -1
- package/lib/buttons/PrimaryButton.js +1 -1
- package/lib/buttons/SuccessButton.js +1 -1
- package/lib/buttons/WarningButton.js +1 -1
- package/lib/buttons/button_container/index.js +1 -1
- package/lib/buttons/split_button/index.js +1 -1
- package/lib/buttons/types.d.ts +0 -1
- package/lib/calendar/base/Day.js +1 -1
- package/lib/calendar/base/Month.js +1 -1
- package/lib/calendar/base/helpers.js +2 -2
- package/lib/calendar/base/index.js +1 -1
- package/lib/dialog/Custom.js +1 -1
- package/lib/dialog/base/Content.d.ts +1 -1
- package/lib/dialog/base/Content.js +3 -2
- package/lib/dialog/base/Header.js +2 -2
- package/lib/dialog/base/index.js +6 -4
- package/lib/dialog/form/index.js +8 -3
- package/lib/dialog/types.d.ts +36 -4
- package/lib/dialog/wizard/index.d.ts +13 -0
- package/lib/dialog/wizard/index.js +78 -0
- package/lib/dialog/wizard/progressbar.d.ts +13 -0
- package/lib/dialog/wizard/progressbar.js +36 -0
- package/lib/dialog/wizard/step.d.ts +9 -0
- package/lib/dialog/wizard/step.js +22 -0
- package/lib/dialog/wizard/useWizard.d.ts +9 -0
- package/lib/dialog/wizard/useWizard.js +48 -0
- package/lib/drawer/Drawer.js +3 -3
- package/lib/drawer/Header.js +1 -1
- package/lib/dropdown/Popup.d.ts +1 -1
- package/lib/dropdown/Popup.js +22 -43
- package/lib/dropdown/helper.js +1 -1
- package/lib/dropdown/types.d.ts +2 -6
- package/lib/dropdown/withDropdown.js +6 -7
- package/lib/fieldset/index.js +7 -7
- package/lib/form/Field.js +11 -24
- package/lib/form/FieldArray.js +10 -25
- package/lib/form/FieldNumber.js +9 -21
- package/lib/form/FieldPeriod.js +5 -5
- package/lib/form/index.js +9 -6
- package/lib/form/types.d.ts +10 -6
- package/lib/form/withFieldHOC.js +2 -2
- package/lib/gridlayout/GridCol.js +5 -5
- package/lib/gridlayout/GridRow.js +1 -4
- package/lib/gridlayout/types.d.ts +1 -1
- package/lib/hint/index.js +1 -7
- package/lib/icons/helper.d.ts +20 -0
- package/lib/icons/helper.js +20 -0
- package/lib/icons/index.js +27 -24
- package/lib/inputs/base/InputTextBase.js +9 -6
- package/lib/inputs/base/Label.js +1 -1
- package/lib/inputs/base/helpers.js +3 -7
- package/lib/inputs/date/helpers.js +1 -4
- package/lib/inputs/date/index.js +15 -9
- package/lib/inputs/errorMessage/index.js +1 -1
- package/lib/inputs/file/DefaultFile.js +6 -5
- package/lib/inputs/file/DragDropFile.js +17 -15
- package/lib/inputs/file/File.js +4 -3
- package/lib/inputs/mask/BaseMask.js +1 -1
- package/lib/inputs/multiSelect/Dropdown.js +10 -9
- package/lib/inputs/multiSelect/helper.js +2 -1
- package/lib/inputs/multiSelect/index.js +9 -7
- package/lib/inputs/number/BaseNumber.d.ts +1 -1
- package/lib/inputs/number/BaseNumber.js +2 -9
- package/lib/inputs/number/Currency.d.ts +1 -1
- package/lib/inputs/number/Currency.js +4 -11
- package/lib/inputs/number/index.js +1 -1
- package/lib/inputs/period/PeriodList.js +1 -1
- package/lib/inputs/period/helper.js +1 -3
- package/lib/inputs/period/index.js +14 -9
- package/lib/inputs/search/index.js +1 -1
- package/lib/inputs/select/Dropdown.js +1 -1
- package/lib/inputs/select/helper.js +13 -10
- package/lib/inputs/select/multiple/Selecteds.js +1 -1
- package/lib/inputs/select/multiple/index.js +19 -12
- package/lib/inputs/select/simple/index.js +22 -13
- package/lib/inputs/select/types.d.ts +1 -0
- package/lib/inputs/textarea/index.js +1 -1
- package/lib/internals/withTooltip.js +9 -9
- package/lib/labelMessages/index.js +3 -4
- package/lib/labels/DefaultLabel.js +1 -4
- package/lib/labels/label_container/index.js +1 -1
- package/lib/list/Header.js +1 -1
- package/lib/list/Item.js +7 -9
- package/lib/list/index.js +1 -1
- package/lib/menus/float/MenuItem.js +2 -2
- package/lib/menus/float/SubMenuContainer.js +1 -1
- package/lib/menus/float/index.js +1 -1
- package/lib/menus/sidenav/ExpandMenu.js +1 -1
- package/lib/menus/sidenav/NavMenuGroup.js +1 -1
- package/lib/menus/sidenav/NavMenuItem.js +9 -7
- package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
- package/lib/menus/sidenav/helpers.js +1 -1
- package/lib/menus/sidenav/index.js +5 -5
- package/lib/panel/Content.js +7 -5
- package/lib/panel/Default.js +2 -2
- package/lib/panel/Header.js +3 -3
- package/lib/permissionValidations.js +1 -1
- package/lib/popover/PopoverText.d.ts +2 -3
- package/lib/popover/PopoverText.js +8 -5
- package/lib/popover/PopoverTitle.d.ts +0 -1
- package/lib/popover/index.d.ts +5 -3
- package/lib/popover/index.js +14 -20
- package/lib/popover/types.d.ts +1 -12
- package/lib/progress/Bar.js +6 -6
- package/lib/radio/index.d.ts +1 -1
- package/lib/radio/index.js +4 -4
- package/lib/radio/types.d.ts +2 -1
- package/lib/shortcuts/index.js +1 -1
- package/lib/skeleton/SkeletonContainer.js +1 -2
- package/lib/skeleton/index.js +1 -4
- package/lib/spinner/index.js +2 -2
- package/lib/split/Split.js +1 -1
- package/lib/split/SplitSide.js +3 -3
- package/lib/table/Body.js +3 -3
- package/lib/table/Header.js +11 -8
- package/lib/table/HeaderColumn.d.ts +1 -1
- package/lib/table/HeaderColumn.js +7 -6
- package/lib/table/Row.js +3 -3
- package/lib/table/RowColumn.js +3 -2
- package/lib/table/index.js +1 -6
- package/lib/table/types.d.ts +4 -2
- package/lib/tabs/DropdownTabs.js +1 -1
- package/lib/tabs/Menu.js +1 -1
- package/lib/tabs/MenuTabs.js +2 -2
- package/lib/tabs/Panel.js +7 -5
- package/lib/tabs/context.js +6 -3
- package/lib/textContent/index.js +1 -1
- package/lib/toolbar/ButtonBar.js +1 -1
- package/lib/toolbar/index.js +1 -1
- package/lib/tooltip/index.js +7 -7
- package/lib/treetable/Body.js +1 -1
- package/lib/treetable/Header.js +2 -2
- package/lib/treetable/Row.js +10 -13
- package/lib/treeview/Header.js +1 -1
- package/lib/treeview/Node.js +15 -11
- package/lib/treeview/index.js +11 -7
- package/lib/treeview/types.d.ts +4 -0
- package/lib/uitour/index.js +8 -6
- package/package.json +2 -2
package/lib/form/FieldArray.js
CHANGED
|
@@ -10,7 +10,7 @@ var _withFieldHOC = _interopRequireDefault(require("./withFieldHOC"));
|
|
|
10
10
|
var _gridlayout = _interopRequireDefault(require("../gridlayout"));
|
|
11
11
|
var _fieldset = _interopRequireDefault(require("../fieldset"));
|
|
12
12
|
var _helpers = require("./helpers");
|
|
13
|
-
const _excluded = ["cols", "label", "bordered", "labelContainerStyle", "skipLabel", "data", "name", "handlerStoreValidators", "component", "handlerFieldChange", "
|
|
13
|
+
const _excluded = ["cols", "label", "bordered", "labelContainerStyle", "skipLabel", "data", "name", "handlerStoreValidators", "component", "handlerFieldChange", "handlerFieldValidate", "changePropName", "fieldErrors", "externalMessagesErrors", "handlerRemoveValidators", "validators", "valuePropName", "originalData", "handlerSelecionados"];
|
|
14
14
|
/* eslint-disable react-hooks/rules-of-hooks */
|
|
15
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
16
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -23,7 +23,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
23
23
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
24
24
|
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
25
25
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
26
|
-
const getDefaultProps =
|
|
26
|
+
const getDefaultProps = props => {
|
|
27
27
|
const {
|
|
28
28
|
valuePropName = 'value',
|
|
29
29
|
changePropName = 'onSelect',
|
|
@@ -35,9 +35,8 @@ const getDefaultProps = (props, handleShowValidateMessages) => {
|
|
|
35
35
|
} = props;
|
|
36
36
|
return {
|
|
37
37
|
onBlur: (0, _react.useCallback)(e => {
|
|
38
|
-
if (handleShowValidateMessages) handleShowValidateMessages(true);
|
|
39
38
|
if (onBlur) onBlur(e);
|
|
40
|
-
}, [
|
|
39
|
+
}, [onBlur]),
|
|
41
40
|
[valuePropName]: _lodash.default.get(data, name),
|
|
42
41
|
[changePropName]: (0, _react.useCallback)(ids => {
|
|
43
42
|
if (handlerFieldChange) handlerFieldChange({
|
|
@@ -47,8 +46,7 @@ const getDefaultProps = (props, handleShowValidateMessages) => {
|
|
|
47
46
|
}
|
|
48
47
|
});
|
|
49
48
|
if (handlerSelecionados) handlerSelecionados(ids);
|
|
50
|
-
|
|
51
|
-
}, [handlerFieldChange, handlerSelecionados, handleShowValidateMessages, changePropName])
|
|
49
|
+
}, [handlerFieldChange, handlerSelecionados, changePropName])
|
|
52
50
|
};
|
|
53
51
|
};
|
|
54
52
|
const FieldArray = props => {
|
|
@@ -63,7 +61,7 @@ const FieldArray = props => {
|
|
|
63
61
|
handlerStoreValidators,
|
|
64
62
|
component: Component,
|
|
65
63
|
handlerFieldChange,
|
|
66
|
-
|
|
64
|
+
handlerFieldValidate,
|
|
67
65
|
changePropName,
|
|
68
66
|
fieldErrors,
|
|
69
67
|
externalMessagesErrors,
|
|
@@ -74,40 +72,27 @@ const FieldArray = props => {
|
|
|
74
72
|
handlerSelecionados
|
|
75
73
|
} = props,
|
|
76
74
|
rest = _objectWithoutProperties(props, _excluded);
|
|
77
|
-
const [showValidateMessages, setShowValidateMessages] = (0, _react.useState)(false);
|
|
78
|
-
const currentValue = _lodash.default.get(data, name);
|
|
79
|
-
const originalValue = _lodash.default.get(originalData, name);
|
|
80
|
-
const handleShowValidateMessages = (0, _react.useCallback)(value => {
|
|
81
|
-
setShowValidateMessages(value);
|
|
82
|
-
}, []);
|
|
83
|
-
(0, _react.useEffect)(() => {
|
|
84
|
-
if (!_lodash.default.isEqual(currentValue, originalValue) && Array.isArray(currentValue) && currentValue.length > 0) {
|
|
85
|
-
setShowValidateMessages(true);
|
|
86
|
-
} else if (_lodash.default.isEmpty(data) || _lodash.default.every(data, _lodash.default.isEmpty) || _lodash.default.isEqual(currentValue, originalValue)) {
|
|
87
|
-
setShowValidateMessages(false);
|
|
88
|
-
}
|
|
89
|
-
}, [currentValue]);
|
|
90
75
|
let content = null;
|
|
91
76
|
if (Component) {
|
|
92
77
|
if (!skipLabel && label) {
|
|
93
78
|
content = /*#__PURE__*/_react.default.createElement(_fieldset.default, {
|
|
94
79
|
title: label,
|
|
95
|
-
customClass:
|
|
80
|
+
customClass: "arraycontainer ".concat(bordered && '-bordered'),
|
|
96
81
|
style: labelContainerStyle,
|
|
97
82
|
titleCustomClass: "label"
|
|
98
|
-
}, /*#__PURE__*/_react.default.createElement(Component, _extends({}, rest, getDefaultProps(props
|
|
83
|
+
}, /*#__PURE__*/_react.default.createElement(Component, _extends({}, rest, getDefaultProps(props), {
|
|
99
84
|
label: label,
|
|
100
85
|
name: name,
|
|
101
86
|
errorMessages: (0, _helpers.getErrorMessages)(_objectSpread(_objectSpread({}, props), {}, {
|
|
102
|
-
fieldErrors:
|
|
87
|
+
fieldErrors: props.fieldErrors
|
|
103
88
|
}))
|
|
104
89
|
})));
|
|
105
90
|
} else {
|
|
106
|
-
content = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(Component, _extends({}, rest, getDefaultProps(props
|
|
91
|
+
content = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(Component, _extends({}, rest, getDefaultProps(props), {
|
|
107
92
|
label: label,
|
|
108
93
|
name: name,
|
|
109
94
|
errorMessages: (0, _helpers.getErrorMessages)(_objectSpread(_objectSpread({}, props), {}, {
|
|
110
|
-
fieldErrors:
|
|
95
|
+
fieldErrors: props.fieldErrors
|
|
111
96
|
}))
|
|
112
97
|
})));
|
|
113
98
|
}
|
package/lib/form/FieldNumber.js
CHANGED
|
@@ -25,29 +25,26 @@ const getEventProps = _ref => {
|
|
|
25
25
|
onBlur,
|
|
26
26
|
onKeyDown,
|
|
27
27
|
onChange,
|
|
28
|
-
|
|
28
|
+
handlerFieldValidate,
|
|
29
29
|
handlerFieldChange,
|
|
30
|
-
handleShowValidateMessages,
|
|
31
30
|
component
|
|
32
31
|
} = _ref;
|
|
33
32
|
return {
|
|
34
33
|
onBlur: e => {
|
|
35
|
-
if (handlerFieldChange) handlerFieldChange(e);
|
|
36
|
-
if (validators &&
|
|
34
|
+
if ((component === null || component === void 0 ? void 0 : component.name) !== 'NumberField' && handlerFieldChange) handlerFieldChange(e);
|
|
35
|
+
if (validators && handlerFieldValidate) handlerFieldValidate(name, e.target.value, validators);
|
|
37
36
|
if (onBlur) onBlur(e);
|
|
38
|
-
handleShowValidateMessages(true);
|
|
39
37
|
},
|
|
40
38
|
onKeyDown: e => {
|
|
41
39
|
if ([constants.keyCodes.ENTER].includes(e.keyCode)) {
|
|
42
|
-
if (validators)
|
|
40
|
+
if (validators) handlerFieldValidate === null || handlerFieldValidate === void 0 ? void 0 : handlerFieldValidate(name, e.target.value, validators);
|
|
43
41
|
if (onKeyDown) onKeyDown(e);
|
|
44
|
-
handleShowValidateMessages(true);
|
|
45
42
|
}
|
|
46
43
|
},
|
|
47
44
|
onChange: e => {
|
|
48
|
-
if (component
|
|
49
|
-
if (validators && e.target &&
|
|
50
|
-
|
|
45
|
+
if ((component === null || component === void 0 ? void 0 : component.name) === 'NumberField') {
|
|
46
|
+
if (validators && e.target && handlerFieldValidate) {
|
|
47
|
+
handlerFieldValidate(name, e.target.value, validators);
|
|
51
48
|
}
|
|
52
49
|
if (handlerFieldChange) handlerFieldChange(e);
|
|
53
50
|
if (onChange) onChange(e);
|
|
@@ -64,18 +61,9 @@ const FieldMask = props => {
|
|
|
64
61
|
const currentValue = _lodash.default.get(data, name);
|
|
65
62
|
const [showValidateMessages, setShowValidateMessages] = (0, _react.useState)(false);
|
|
66
63
|
const originalValue = _lodash.default.get(originalData, name);
|
|
67
|
-
|
|
68
|
-
if (currentValue && currentValue !== originalValue && !!currentValue) {
|
|
69
|
-
setShowValidateMessages(true);
|
|
70
|
-
} else if (_lodash.default.isEmpty(data) || _lodash.default.every(data, _lodash.default.isEmpty) || currentValue === originalValue) {
|
|
71
|
-
setShowValidateMessages(false);
|
|
72
|
-
}
|
|
73
|
-
}, [currentValue, originalValue]);
|
|
74
|
-
return /*#__PURE__*/_react.default.createElement(props.component, _extends({}, props, getEventProps(_objectSpread(_objectSpread({}, props), {}, {
|
|
75
|
-
handleShowValidateMessages: value => setShowValidateMessages(value)
|
|
76
|
-
})), {
|
|
64
|
+
return /*#__PURE__*/_react.default.createElement(props.component, _extends({}, props, getEventProps(_objectSpread({}, props)), {
|
|
77
65
|
errorMessages: (0, _helpers.getErrorMessages)(_objectSpread(_objectSpread({}, props), {}, {
|
|
78
|
-
fieldErrors:
|
|
66
|
+
fieldErrors: props.fieldErrors
|
|
79
67
|
})),
|
|
80
68
|
value: currentValue
|
|
81
69
|
}));
|
package/lib/form/FieldPeriod.js
CHANGED
|
@@ -19,7 +19,7 @@ const FieldPeriod = props => {
|
|
|
19
19
|
nameDateInitial,
|
|
20
20
|
nameDateFinal,
|
|
21
21
|
handlerFieldChange,
|
|
22
|
-
|
|
22
|
+
handlerFieldValidate: handlerFieldValidate,
|
|
23
23
|
fieldErrors,
|
|
24
24
|
externalMessagesErrors,
|
|
25
25
|
onChange,
|
|
@@ -55,8 +55,8 @@ const FieldPeriod = props => {
|
|
|
55
55
|
initial,
|
|
56
56
|
final
|
|
57
57
|
} = _ref;
|
|
58
|
-
if (validators &&
|
|
59
|
-
|
|
58
|
+
if (validators && handlerFieldValidate) {
|
|
59
|
+
handlerFieldValidate(nameDateInitial, {
|
|
60
60
|
[nameDateInitial]: initial,
|
|
61
61
|
[nameDateFinal]: final
|
|
62
62
|
}, validators);
|
|
@@ -79,8 +79,8 @@ const FieldPeriod = props => {
|
|
|
79
79
|
});
|
|
80
80
|
},
|
|
81
81
|
value: {
|
|
82
|
-
initial: _lodash.default.get(data,
|
|
83
|
-
final: _lodash.default.get(data,
|
|
82
|
+
initial: _lodash.default.get(data, "".concat(name, ".").concat(nameDateInitial)),
|
|
83
|
+
final: _lodash.default.get(data, "".concat(name, ".").concat(nameDateFinal))
|
|
84
84
|
}
|
|
85
85
|
}));
|
|
86
86
|
}
|
package/lib/form/index.js
CHANGED
|
@@ -75,6 +75,7 @@ const Form = _ref => {
|
|
|
75
75
|
const [fieldErrors, setFieldErrors] = (0, _react.useState)({});
|
|
76
76
|
const fieldsValidators = (0, _react.useRef)({});
|
|
77
77
|
const [oldFieldsValidatorsQuantity, setOldFieldsValidatorsQuantity] = (0, _react.useState)(0);
|
|
78
|
+
const [isValid, setIsValid] = (0, _react.useState)(false);
|
|
78
79
|
const context = (0, _react.useContext)(_withFormSecurity.FormSecurityContext);
|
|
79
80
|
const usedData = useInternalState ? data : dataSource;
|
|
80
81
|
const getValidatesErrorMessages = (validators, fieldValue) => {
|
|
@@ -107,8 +108,9 @@ const Form = _ref => {
|
|
|
107
108
|
let updateState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
108
109
|
let currentValidators = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
109
110
|
const currentFieldErrors = getErrorMessages(currentData, currentValidators || fieldsValidators.current);
|
|
110
|
-
|
|
111
|
-
|
|
111
|
+
const isValidNow = Object.values(currentFieldErrors).every(value => value.length === 0);
|
|
112
|
+
if (updateState) setIsValid(isValidNow);
|
|
113
|
+
return isValidNow;
|
|
112
114
|
};
|
|
113
115
|
const onFieldChange = (0, _react.useCallback)(event => {
|
|
114
116
|
const {
|
|
@@ -235,7 +237,7 @@ const Form = _ref => {
|
|
|
235
237
|
}
|
|
236
238
|
}, [submitOnPressEnterKey]);
|
|
237
239
|
(0, _react.useEffect)(() => {
|
|
238
|
-
const validatorsQuantity = Object.values(fieldsValidators.current).reduce((acc, currentValue) => acc + (currentValue
|
|
240
|
+
const validatorsQuantity = Object.values(fieldsValidators.current).reduce((acc, currentValue) => acc + ((currentValue === null || currentValue === void 0 ? void 0 : currentValue.length) || 0), 0);
|
|
239
241
|
if (fieldsValidators.current && onValidateForm && oldFieldsValidatorsQuantity !== validatorsQuantity) {
|
|
240
242
|
setOldFieldsValidatorsQuantity(validatorsQuantity);
|
|
241
243
|
onValidateForm(checkIsValid(usedData, true, fieldsValidators.current));
|
|
@@ -244,7 +246,7 @@ const Form = _ref => {
|
|
|
244
246
|
const contextValues = {
|
|
245
247
|
skeletonize,
|
|
246
248
|
handlerFieldChange: onFieldChange,
|
|
247
|
-
|
|
249
|
+
handlerFieldValidate: onValidate,
|
|
248
250
|
handlerStoreValidators: (fieldName, fieldValidates) => {
|
|
249
251
|
fieldsValidators.current = _objectSpread(_objectSpread({}, fieldsValidators.current), {}, {
|
|
250
252
|
[fieldName]: fieldValidates
|
|
@@ -254,7 +256,8 @@ const Form = _ref => {
|
|
|
254
256
|
data: useInternalState ? data : dataSource,
|
|
255
257
|
originalData,
|
|
256
258
|
fieldErrors,
|
|
257
|
-
externalFieldErrors
|
|
259
|
+
externalFieldErrors,
|
|
260
|
+
isFormValid: isValid
|
|
258
261
|
};
|
|
259
262
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_helpers.FormContext.Provider, {
|
|
260
263
|
value: contextValues
|
|
@@ -262,7 +265,7 @@ const Form = _ref => {
|
|
|
262
265
|
style: style
|
|
263
266
|
}, formProps(), {
|
|
264
267
|
role: "presentation",
|
|
265
|
-
className:
|
|
268
|
+
className: "form-component ".concat(customClass)
|
|
266
269
|
}), children)), /*#__PURE__*/_react.default.createElement(_dialog.DialogQuestion, {
|
|
267
270
|
zIndex: "99999999",
|
|
268
271
|
title: securityTitle || 'Dados Alterados',
|
package/lib/form/types.d.ts
CHANGED
|
@@ -57,7 +57,7 @@ interface IFieldProps extends WithFieldProps {
|
|
|
57
57
|
value?: string;
|
|
58
58
|
label?: string;
|
|
59
59
|
handlerFieldChange?: (event: ChangeEvent<HTMLInputElement> | CustomKeyboardEvent) => ChangeEvent;
|
|
60
|
-
|
|
60
|
+
handlerFieldValidate?: (name: string, value: string, validatorsArray: Validator[] | Validator) => void;
|
|
61
61
|
component: ComponentType<any>;
|
|
62
62
|
componentType?: 'Radio' | 'Checkbox';
|
|
63
63
|
onChange?: (event: ChangeEvent) => ChangeEvent;
|
|
@@ -86,6 +86,10 @@ interface IFieldProps extends WithFieldProps {
|
|
|
86
86
|
autoCompleteMask?: 'left' | 'right';
|
|
87
87
|
mask?: string;
|
|
88
88
|
removeZeroLeft?: boolean;
|
|
89
|
+
textAlign?: 'left' | 'right';
|
|
90
|
+
disabled?: boolean;
|
|
91
|
+
displayCurrencySymbol?: boolean;
|
|
92
|
+
currencySymbol?: string;
|
|
89
93
|
}
|
|
90
94
|
interface CustomEvent {
|
|
91
95
|
target: {
|
|
@@ -120,7 +124,7 @@ interface IFieldArrayProps extends WithFieldProps {
|
|
|
120
124
|
multiple?: boolean;
|
|
121
125
|
disabled?: boolean;
|
|
122
126
|
onBlur?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
123
|
-
|
|
127
|
+
handlerFieldValidate?: (name: string, value: string, validatorsArray: Validator[] | Validator) => void;
|
|
124
128
|
required?: boolean;
|
|
125
129
|
}
|
|
126
130
|
type PeriodChangeEvent = {
|
|
@@ -152,20 +156,21 @@ interface IFieldPeriodProps extends WithFieldProps {
|
|
|
152
156
|
externalFieldErrors?: {
|
|
153
157
|
[name: string]: string[];
|
|
154
158
|
};
|
|
155
|
-
|
|
159
|
+
handlerFieldValidate?: (name: string, value: object, validatorsArray: PeriodValidator[] | PeriodValidator) => void;
|
|
156
160
|
onChange?: (event: PeriodChangeEvent) => PeriodChangeEvent;
|
|
157
161
|
gridLayout?: string;
|
|
158
162
|
}
|
|
159
163
|
interface FormContextProps {
|
|
160
164
|
skeletonize?: boolean;
|
|
161
165
|
handlerFieldChange: (event: OnFielChangeEvent) => void;
|
|
162
|
-
|
|
166
|
+
handlerFieldValidate: (name: string, value: string, validatorsArray: Validator[] | Validator) => void;
|
|
163
167
|
handlerStoreValidators: (fieldName: string, fieldValidates: Validator) => void;
|
|
164
168
|
handlerRemoveValidators: (fieldName: string) => void;
|
|
165
169
|
data: object;
|
|
166
170
|
originalData: object;
|
|
167
171
|
fieldErrors: object;
|
|
168
172
|
externalFieldErrors?: object;
|
|
173
|
+
isFormValid?: boolean;
|
|
169
174
|
}
|
|
170
175
|
interface WithFieldProps {
|
|
171
176
|
name: string;
|
|
@@ -200,10 +205,9 @@ interface IEventParams {
|
|
|
200
205
|
onBlur?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
201
206
|
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
202
207
|
onKeyDown?: (event: CustomKeyboardEvent) => void;
|
|
203
|
-
|
|
208
|
+
handlerFieldValidate?: (name: string, value: string, validatorsArray: Validator[] | Validator) => void;
|
|
204
209
|
handlerFieldChange?: (event: ChangeEvent<HTMLInputElement> | CustomKeyboardEvent) => void;
|
|
205
210
|
validatorFromComponent?: Validator | Validator[];
|
|
206
|
-
handleShowValidateMessages: (value: boolean) => void;
|
|
207
211
|
component?: ComponentType<any>;
|
|
208
212
|
}
|
|
209
213
|
interface IGetErrorMessagesParams {
|
package/lib/form/withFieldHOC.js
CHANGED
|
@@ -45,7 +45,7 @@ const withFieldHOC = WrappedComponent => {
|
|
|
45
45
|
return /*#__PURE__*/_react.default.createElement(_helpers.FormContext.Consumer, null, _ref => {
|
|
46
46
|
let {
|
|
47
47
|
handlerFieldChange,
|
|
48
|
-
|
|
48
|
+
handlerFieldValidate: handlerFieldValidate,
|
|
49
49
|
data,
|
|
50
50
|
fieldErrors,
|
|
51
51
|
externalFieldErrors,
|
|
@@ -56,7 +56,7 @@ const withFieldHOC = WrappedComponent => {
|
|
|
56
56
|
return /*#__PURE__*/_react.default.createElement(EnhancedComponent, _extends({}, props, {
|
|
57
57
|
skeletonize: skeletonize,
|
|
58
58
|
handlerFieldChange: handlerFieldChange,
|
|
59
|
-
|
|
59
|
+
handlerFieldValidate: handlerFieldValidate,
|
|
60
60
|
handlerStoreValidators: handlerStoreValidators,
|
|
61
61
|
handlerRemoveValidators: handlerRemoveValidators,
|
|
62
62
|
data: data,
|
|
@@ -10,10 +10,10 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
10
10
|
const getClass = col => {
|
|
11
11
|
const cols = col ? col.split(' ') : [];
|
|
12
12
|
let classes = 'grid-container ';
|
|
13
|
-
if (cols[0]) classes +=
|
|
14
|
-
if (cols[1]) classes +=
|
|
15
|
-
if (cols[2]) classes +=
|
|
16
|
-
if (cols[3]) classes +=
|
|
13
|
+
if (cols[0]) classes += "col-xs-".concat(cols[0]);
|
|
14
|
+
if (cols[1]) classes += " col-sm-".concat(cols[1]);
|
|
15
|
+
if (cols[2]) classes += " col-md-".concat(cols[2]);
|
|
16
|
+
if (cols[3]) classes += " col-lg-".concat(cols[3]);
|
|
17
17
|
return classes;
|
|
18
18
|
};
|
|
19
19
|
const GridCol = props => {
|
|
@@ -27,7 +27,7 @@ const GridCol = props => {
|
|
|
27
27
|
const gridClasses = getClass(cols || '');
|
|
28
28
|
if (!visible) return null;
|
|
29
29
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
-
className:
|
|
30
|
+
className: "".concat(customClass, " ").concat(gridClasses),
|
|
31
31
|
style: style
|
|
32
32
|
}, children);
|
|
33
33
|
};
|
|
@@ -12,10 +12,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
12
12
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
13
13
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
14
14
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
15
|
-
const getClass = props =>
|
|
16
|
-
${props.withTrim && ' -withtrim'}
|
|
17
|
-
${props.verticalAlign && ` align-items-${props.verticalAlign}`}
|
|
18
|
-
${props.horizontalAlign && ` justify-content-${props.horizontalAlign}`}`;
|
|
15
|
+
const getClass = props => "row ".concat(props.customClass, "\n ").concat(props.withTrim && ' -withtrim', "\n ").concat(props.verticalAlign && " align-items-".concat(props.verticalAlign), "\n ").concat(props.horizontalAlign && " justify-content-".concat(props.horizontalAlign));
|
|
19
16
|
const GridRow = props => {
|
|
20
17
|
const {
|
|
21
18
|
style,
|
|
@@ -8,7 +8,7 @@ interface IGridCol {
|
|
|
8
8
|
visible?: boolean;
|
|
9
9
|
}
|
|
10
10
|
interface IGridRow {
|
|
11
|
-
children
|
|
11
|
+
children?: ReactNode | ReactNode[];
|
|
12
12
|
verticalAlign?: 'start' | 'center' | 'end' | 'baseline' | 'stretch';
|
|
13
13
|
horizontalAlign?: string;
|
|
14
14
|
style?: CSSProperties;
|
package/lib/hint/index.js
CHANGED
|
@@ -22,13 +22,7 @@ const Hint = _ref => {
|
|
|
22
22
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
23
23
|
"aria-disabled": disabled,
|
|
24
24
|
style: style,
|
|
25
|
-
className:
|
|
26
|
-
hint-component
|
|
27
|
-
${customClass}
|
|
28
|
-
${skeletonize ? '-skeletonized' : ''}
|
|
29
|
-
${disabled ? '-disabled' : ''}
|
|
30
|
-
-${color}
|
|
31
|
-
`
|
|
25
|
+
className: "\n hint-component\n ".concat(customClass, "\n ").concat(skeletonize ? '-skeletonized' : '', "\n ").concat(disabled ? '-disabled' : '', "\n -").concat(color, "\n ")
|
|
32
26
|
}, Array.isArray(description) ? (0, _helpers.showHintList)(description) : /*#__PURE__*/_react.default.createElement("span", {
|
|
33
27
|
"aria-disabled": disabled
|
|
34
28
|
}, description));
|
package/lib/icons/helper.d.ts
CHANGED
|
@@ -19,6 +19,10 @@ declare const _default: {
|
|
|
19
19
|
viewbox: string;
|
|
20
20
|
paths: string[];
|
|
21
21
|
};
|
|
22
|
+
supplier: {
|
|
23
|
+
viewbox: string;
|
|
24
|
+
paths: string[];
|
|
25
|
+
};
|
|
22
26
|
mail: {
|
|
23
27
|
viewbox: string;
|
|
24
28
|
paths: string[];
|
|
@@ -607,6 +611,22 @@ declare const _default: {
|
|
|
607
611
|
viewbox: string;
|
|
608
612
|
paths: string[];
|
|
609
613
|
};
|
|
614
|
+
similarity: {
|
|
615
|
+
viewbox: string;
|
|
616
|
+
paths: string[];
|
|
617
|
+
};
|
|
618
|
+
fileStack: {
|
|
619
|
+
viewbox: string;
|
|
620
|
+
paths: string[];
|
|
621
|
+
};
|
|
622
|
+
tree: {
|
|
623
|
+
viewbox: string;
|
|
624
|
+
paths: string[];
|
|
625
|
+
};
|
|
626
|
+
bank: {
|
|
627
|
+
viewbox: string;
|
|
628
|
+
paths: string[];
|
|
629
|
+
};
|
|
610
630
|
};
|
|
611
631
|
|
|
612
632
|
export { _default as default };
|
package/lib/icons/helper.js
CHANGED
|
@@ -25,6 +25,10 @@ var _default = exports.default = {
|
|
|
25
25
|
viewbox: '0 0 16 16',
|
|
26
26
|
paths: ['M4 5c0-2.209 1.791-4 4-4s4 1.791 4 4c0 2.209-1.791 4-4 4s-4-1.791-4-4zM12 10h-8c-2.209 0-4 1.791-4 4v1h16v-1c0-2.209-1.791-4-4-4z']
|
|
27
27
|
},
|
|
28
|
+
supplier: {
|
|
29
|
+
viewbox: '0 0 16 16',
|
|
30
|
+
paths: ['M12 12.041v-0.825c1.101-0.621 2-2.168 2-3.716 0-2.485 0-4.5-3-4.5s-3 2.015-3 4.5c0 1.548 0.898 3.095 2 3.716v0.825c-3.392 0.277-6 1.944-6 3.959h14c0-2.015-2.608-3.682-6-3.959z', 'M3.242 9.625c-0.212 0.077-0.416 0.161-0.611 0.25h4.782c-0.038-0.083-0.075-0.166-0.109-0.25h-4.062z', 'M0.425 11.625c-0.053 0.082-0.101 0.165-0.144 0.25h5.834c0.192-0.089 0.389-0.172 0.593-0.25h-6.284z', 'M1.367 10.625c-0.105 0.081-0.204 0.164-0.299 0.25h6.933c-0.060-0.081-0.118-0.165-0.174-0.25h-6.461z', 'M5.261 9.125c-0.424 0.062-0.833 0.146-1.222 0.25h3.17c-0.030-0.083-0.057-0.166-0.083-0.25h-1.864z', 'M6 8.625v0.25h1.054c-0.022-0.083-0.041-0.166-0.059-0.25h-0.995z', 'M5.851 8.125c0.049 0.032 0.099 0.063 0.149 0.091v0.159h0.947c-0.014-0.083-0.025-0.167-0.035-0.25h-1.062z', 'M0.030 12.625c-0.013 0.083-0.022 0.166-0.027 0.25h4.501c0.102-0.085 0.209-0.169 0.321-0.25h-4.795z', 'M1.719 10.375h5.955c-0.024-0.042-0.048-0.084-0.072-0.127-0.022-0.041-0.044-0.082-0.066-0.123h-5.402c-0.145 0.080-0.283 0.163-0.415 0.25z', 'M4.005 3.625c-0.002 0.083-0.003 0.166-0.003 0.25h3.339c0.004-0.009 0.008-0.018 0.012-0.028 0.035-0.076 0.073-0.15 0.112-0.222h-3.46z', 'M0.168 12.125c-0.032 0.082-0.060 0.166-0.083 0.25h5.109c0.136-0.087 0.277-0.17 0.423-0.25h-5.449z', 'M4.643 0.875h4.713c-0.070-0.089-0.148-0.173-0.234-0.25h-4.245c-0.086 0.077-0.164 0.161-0.234 0.25z', 'M0.602 11.375h6.845c0.256-0.076 0.519-0.145 0.787-0.204-0.013-0.015-0.025-0.030-0.038-0.046h-7.381c-0.076 0.082-0.147 0.165-0.213 0.25z', 'M5.255 7.625c0.085 0.089 0.173 0.173 0.263 0.25h1.371c-0.006-0.083-0.010-0.167-0.012-0.25h-1.622z', 'M4.848 7.125c0.060 0.086 0.123 0.17 0.188 0.25h1.84c0-0.084 0-0.167 0-0.25h-2.027z', 'M4.255 1.625c-0.027 0.081-0.050 0.164-0.072 0.25h5.632c-0.021-0.086-0.045-0.169-0.072-0.25h-5.489z', 'M4.13 2.125c-0.015 0.082-0.029 0.165-0.041 0.25h4.625c0.179-0.098 0.372-0.181 0.578-0.25h-5.162z', 'M4.022 3.125c-0.004 0.082-0.008 0.166-0.010 0.25h3.605c0.058-0.087 0.12-0.17 0.185-0.25h-3.78z', 'M4.059 2.625c-0.008 0.082-0.016 0.165-0.022 0.25h3.995c0.092-0.089 0.189-0.173 0.292-0.25h-4.265z', 'M5.866 0.125c-0.243 0.062-0.455 0.146-0.638 0.25h3.544c-0.184-0.104-0.396-0.188-0.639-0.25h-2.266z', 'M4.544 6.625c0.045 0.085 0.092 0.169 0.141 0.25h2.192c0.001-0.084 0.002-0.167 0.003-0.25h-2.336z', 'M4.475 1.125c-0.046 0.080-0.088 0.163-0.125 0.25h5.3c-0.037-0.087-0.079-0.17-0.125-0.25h-5.050z', 'M4.152 5.625c0.022 0.084 0.048 0.167 0.074 0.25h2.683c0.005-0.084 0.012-0.167 0.019-0.25h-2.777z', 'M4.316 6.125c0.033 0.085 0.068 0.168 0.105 0.25h2.464c0.003-0.084 0.006-0.167 0.009-0.25h-2.579z', 'M4 4.125c-0 0.083-0 0.166-0 0.25h3.155c0.025-0.085 0.053-0.168 0.084-0.25h-3.238z', 'M4.002 4.625c0.003 0.083 0.008 0.167 0.016 0.25h3.014c0.016-0.084 0.035-0.168 0.055-0.25h-3.085z', 'M4.048 5.125c0.013 0.084 0.027 0.167 0.045 0.25h2.862c0.010-0.084 0.021-0.167 0.034-0.25h-2.941z']
|
|
31
|
+
},
|
|
28
32
|
mail: {
|
|
29
33
|
viewbox: '0 0 16 16',
|
|
30
34
|
paths: ['M13.333 0h-10.666c-1.467 0-2.667 1.2-2.667 2.667v10.666c0 1.468 1.2 2.667 2.667 2.667h10.666c1.467 0 2.667-1.199 2.667-2.667v-10.666c0-1.467-1.2-2.667-2.667-2.667zM2.854 13.854l-1.207-1.207 4-4 0.457 0.457-3.25 4.75zM2.396 3.104l0.457-0.457 5.146 4.146 5.146-4.146 0.457 0.457-5.604 6.604-5.604-6.604zM13.146 13.854l-3.25-4.75 0.457-0.457 4 4-1.207 1.207z']
|
|
@@ -612,5 +616,21 @@ var _default = exports.default = {
|
|
|
612
616
|
user_block: {
|
|
613
617
|
viewbox: '0 0 16 16',
|
|
614
618
|
paths: ['M7.5 16h-6.977c-0.14 0-0.274-0.059-0.369-0.163s-0.141-0.242-0.129-0.382c0.11-1.22 0.585-2.363 1.373-3.305 0.697-0.832 1.59-1.452 2.602-1.809l0-0.475c-0.562-0.385-1.037-0.926-1.385-1.582-0.402-0.758-0.615-1.634-0.615-2.535 0-1.251 0.405-2.431 1.139-3.323 0.758-0.92 1.774-1.427 2.861-1.427 2.119 0 3.874 1.966 3.993 4.476 0.013 0.276-0.2 0.51-0.476 0.523s-0.51-0.2-0.523-0.476c-0.094-1.976-1.41-3.524-2.995-3.524-1.654 0-3 1.682-3 3.75 0 1.457 0.687 2.795 1.75 3.408 0.155 0.089 0.25 0.254 0.25 0.433l-0 1.116c0 0.224-0.149 0.42-0.364 0.481-0.967 0.274-1.822 0.828-2.471 1.604-0.538 0.643-0.901 1.397-1.064 2.208h6.4c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z', 'M11.5 7c-2.481 0-4.5 2.019-4.5 4.5s2.019 4.5 4.5 4.5 4.5-2.019 4.5-4.5-2.019-4.5-4.5-4.5zM8 11.5c0-1.93 1.57-3.5 3.5-3.5 0.785 0 1.511 0.26 2.095 0.698l-4.897 4.897c-0.438-0.584-0.698-1.31-0.698-2.095zM11.5 15c-0.785 0-1.511-0.26-2.095-0.698l4.897-4.897c0.438 0.584 0.698 1.31 0.698 2.095 0 1.93-1.57 3.5-3.5 3.5z']
|
|
619
|
+
},
|
|
620
|
+
similarity: {
|
|
621
|
+
viewbox: '0 0 16 16',
|
|
622
|
+
paths: ['M13 4h-3v-1l-3-3h-7v12h6v4h10v-9l-3-3zM13 5.414l1.586 1.586h-1.586v-1.586zM7 1.414l1.586 1.586h-1.586v-1.586zM1 1h5v3h3v7h-8v-10zM15 15h-8v-3h3v-7h2v3h3v7z']
|
|
623
|
+
},
|
|
624
|
+
fileStack: {
|
|
625
|
+
viewbox: '0 0 16 16',
|
|
626
|
+
paths: ['M13.75 4h-0.75v-0.75c0-0.689-0.561-1.25-1.25-1.25h-0.75v-0.75c0-0.689-0.561-1.25-1.25-1.25h-7.5c-0.689 0-1.25 0.561-1.25 1.25v9.5c0 0.689 0.561 1.25 1.25 1.25h0.75v0.75c0 0.689 0.561 1.25 1.25 1.25h0.75v0.75c0 0.689 0.561 1.25 1.25 1.25h7.5c0.689 0 1.25-0.561 1.25-1.25v-9.5c0-0.689-0.561-1.25-1.25-1.25zM2.25 11c-0.138 0-0.25-0.113-0.25-0.25v-9.5c0-0.137 0.112-0.25 0.25-0.25h7.5c0.137 0 0.25 0.113 0.25 0.25v0.75h-5.75c-0.689 0-1.25 0.561-1.25 1.25v7.75h-0.75zM4.25 13c-0.138 0-0.25-0.113-0.25-0.25v-9.5c0-0.138 0.112-0.25 0.25-0.25h7.5c0.137 0 0.25 0.112 0.25 0.25v0.75h-5.75c-0.689 0-1.25 0.561-1.25 1.25v7.75h-0.75zM14 14.75c0 0.137-0.113 0.25-0.25 0.25h-7.5c-0.138 0-0.25-0.113-0.25-0.25v-9.5c0-0.138 0.112-0.25 0.25-0.25h7.5c0.137 0 0.25 0.112 0.25 0.25v9.5z']
|
|
627
|
+
},
|
|
628
|
+
tree: {
|
|
629
|
+
viewbox: '0 0 16 16',
|
|
630
|
+
paths: ['M15.25 12h-0.25v-3.25c0-0.965-0.785-1.75-1.75-1.75h-4.25v-2h0.25c0.412 0 0.75-0.338 0.75-0.75v-2.5c0-0.413-0.338-0.75-0.75-0.75h-2.5c-0.412 0-0.75 0.337-0.75 0.75v2.5c0 0.412 0.338 0.75 0.75 0.75h0.25v2h-4.25c-0.965 0-1.75 0.785-1.75 1.75v3.25h-0.25c-0.412 0-0.75 0.338-0.75 0.75v2.5c0 0.412 0.338 0.75 0.75 0.75h2.5c0.413 0 0.75-0.338 0.75-0.75v-2.5c0-0.412-0.337-0.75-0.75-0.75h-0.25v-3h4v3h-0.25c-0.412 0-0.75 0.338-0.75 0.75v2.5c0 0.412 0.338 0.75 0.75 0.75h2.5c0.412 0 0.75-0.338 0.75-0.75v-2.5c0-0.412-0.338-0.75-0.75-0.75h-0.25v-3h4v3h-0.25c-0.412 0-0.75 0.338-0.75 0.75v2.5c0 0.412 0.338 0.75 0.75 0.75h2.5c0.412 0 0.75-0.338 0.75-0.75v-2.5c0-0.412-0.338-0.75-0.75-0.75zM3 15h-2v-2h2v2zM9 15h-2v-2h2v2zM7 4v-2h2v2h-2zM15 15h-2v-2h2v2z']
|
|
631
|
+
},
|
|
632
|
+
bank: {
|
|
633
|
+
viewbox: '0 0 16 16',
|
|
634
|
+
paths: ['M16 15v-1h-1v-6h1v-1h-3v1h1v6h-3v-6h1v-1h-3v1h1v6h-3v-6h1v-1h-3v1h1v6h-3v-6h1v-1h-3v1h1v6h-1v1h-1v1h17v-1h-1z', 'M8 0h1l8 5v1h-17v-1l8-5z']
|
|
615
635
|
}
|
|
616
636
|
};
|
package/lib/icons/index.js
CHANGED
|
@@ -34,35 +34,38 @@ const Icon = _ref => {
|
|
|
34
34
|
const isUsingColorStyle = colorStyle !== 'default';
|
|
35
35
|
const colorFromProp = isUsingColorStyle || !color ? undefined : color;
|
|
36
36
|
const refSvg = (0, _react.useRef)(null);
|
|
37
|
-
const viewBoxFromIconOrSvgStrcut = name ? listIcon[name].viewbox : svgStruct
|
|
38
|
-
const getPaths = () => name ? listIcon[name].paths : svgStruct
|
|
39
|
-
const getSvg = () =>
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
37
|
+
const viewBoxFromIconOrSvgStrcut = name ? listIcon[name].viewbox : svgStruct === null || svgStruct === void 0 ? void 0 : svgStruct.viewbox;
|
|
38
|
+
const getPaths = () => name ? listIcon[name].paths : svgStruct === null || svgStruct === void 0 ? void 0 : svgStruct.paths;
|
|
39
|
+
const getSvg = () => {
|
|
40
|
+
var _getPaths;
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
42
|
+
"data-testid": "icon",
|
|
43
|
+
"data-color-style": colorStyle,
|
|
44
|
+
onClick: () => {
|
|
45
|
+
if (onClick && !disabled) onClick();
|
|
46
|
+
},
|
|
47
|
+
ref: r => {
|
|
48
|
+
refSvg.current = r;
|
|
49
|
+
},
|
|
50
|
+
width: "".concat(size, "px"),
|
|
51
|
+
height: "".concat(size, "px"),
|
|
52
|
+
fill: disabled ? disabledIconColor : colorFromProp,
|
|
53
|
+
viewBox: viewBox || viewBoxFromIconOrSvgStrcut,
|
|
54
|
+
className: "icon-component ".concat(customClass),
|
|
55
|
+
pointerEvents: pointerEvents,
|
|
56
|
+
style: style
|
|
57
|
+
}, (_getPaths = getPaths()) === null || _getPaths === void 0 ? void 0 : _getPaths.map(value => /*#__PURE__*/_react.default.createElement("path", {
|
|
58
|
+
"data-testid": "icon-path",
|
|
59
|
+
d: value,
|
|
60
|
+
key: value
|
|
61
|
+
})));
|
|
62
|
+
};
|
|
60
63
|
if (color && colorStyle !== 'default') throw new Error('Expected only one of the two properties: colorStyle or color');
|
|
61
64
|
if (!name && !svgStruct) throw new Error('One of the "name" and "svgStruct" props must be filled');
|
|
62
65
|
if (!visible) return null;
|
|
63
66
|
if (!tooltip) return getSvg();
|
|
64
67
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
65
|
-
className:
|
|
68
|
+
className: "icon-component-container ".concat(customClassForContainer),
|
|
66
69
|
ref: r => {
|
|
67
70
|
if (targetRef && r) targetRef(r);
|
|
68
71
|
}
|
|
@@ -118,11 +118,13 @@ const InputTextBase = props => {
|
|
|
118
118
|
if (!disableCallbacks) {
|
|
119
119
|
propsInput = _objectSpread(_objectSpread({}, propsInput), {}, {
|
|
120
120
|
onFocus: e => {
|
|
121
|
-
|
|
121
|
+
var _props$onInputReceive;
|
|
122
|
+
(_props$onInputReceive = props.onInputReceiveFocus) === null || _props$onInputReceive === void 0 ? void 0 : _props$onInputReceive.call(props);
|
|
122
123
|
if (props.onFocus) props.onFocus(e);
|
|
123
124
|
},
|
|
124
125
|
onBlur: e => {
|
|
125
|
-
|
|
126
|
+
var _props$onInputLostFoc;
|
|
127
|
+
(_props$onInputLostFoc = props.onInputLostFocus) === null || _props$onInputLostFoc === void 0 ? void 0 : _props$onInputLostFoc.call(props);
|
|
126
128
|
if (props.onBlur) props.onBlur(e);
|
|
127
129
|
},
|
|
128
130
|
onKeyDown: e => {
|
|
@@ -186,7 +188,7 @@ const InputTextBase = props => {
|
|
|
186
188
|
if (!visible || unvisible) return null;
|
|
187
189
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
188
190
|
style: style,
|
|
189
|
-
className:
|
|
191
|
+
className: "input-base-component ".concat(skeletonize ? '-skeletonized' : '', " ").concat(customClass),
|
|
190
192
|
ref: inputBaseRef
|
|
191
193
|
}, label && /*#__PURE__*/_react.default.createElement("div", {
|
|
192
194
|
className: "labelcontainer",
|
|
@@ -210,14 +212,15 @@ const InputTextBase = props => {
|
|
|
210
212
|
}))
|
|
211
213
|
}, leftElements && /*#__PURE__*/_react.default.createElement("div", {
|
|
212
214
|
style: styleForSideButtons,
|
|
213
|
-
className:
|
|
215
|
+
className: "sidebuttons ".concat(customClassForSideButtons)
|
|
214
216
|
}, leftElements), /*#__PURE__*/_react.default.createElement("div", {
|
|
215
217
|
"data-testid": "testInputContent",
|
|
216
218
|
style: styleForInputContent,
|
|
217
|
-
className:
|
|
219
|
+
className: "inputcontent ".concat(customClassForInputContent)
|
|
218
220
|
}, type === 'textarea' ? /*#__PURE__*/_react.default.createElement("textarea", _extends({
|
|
219
221
|
rows: props.rows,
|
|
220
|
-
cols: props.cols
|
|
222
|
+
cols: props.cols,
|
|
223
|
+
tabIndex: applyTabIndex()
|
|
221
224
|
}, inputProps())) : /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
222
225
|
autoComplete: autoComplete,
|
|
223
226
|
tabIndex: applyTabIndex(),
|
package/lib/inputs/base/Label.js
CHANGED
|
@@ -27,7 +27,7 @@ const Label = props => {
|
|
|
27
27
|
}
|
|
28
28
|
},
|
|
29
29
|
onMouseEnter: onHoverLabel,
|
|
30
|
-
className:
|
|
30
|
+
className: "label ".concat(customClassForLabel, " ").concat(labelUppercase && ' -uppercase')
|
|
31
31
|
}, label, required && /*#__PURE__*/_react.default.createElement("span", {
|
|
32
32
|
className: "-requiredlabel"
|
|
33
33
|
}, "*"));
|
|
@@ -13,7 +13,7 @@ const getInputClass = _ref => {
|
|
|
13
13
|
readOnly,
|
|
14
14
|
readOnlyClass
|
|
15
15
|
} = _ref;
|
|
16
|
-
return
|
|
16
|
+
return "textinput text-align-".concat(textAlign, " ").concat(readOnlyClass, " ").concat(readOnly ? ' -readonly' : '');
|
|
17
17
|
};
|
|
18
18
|
exports.getInputClass = getInputClass;
|
|
19
19
|
const getInputWrapperClass = props => {
|
|
@@ -24,11 +24,7 @@ const getInputWrapperClass = props => {
|
|
|
24
24
|
errorMessages,
|
|
25
25
|
disabled
|
|
26
26
|
} = props;
|
|
27
|
-
return
|
|
28
|
-
${customClassForWrapper}
|
|
29
|
-
${errorMessages && errorMessages.length > 0 && ' -requirederror'}
|
|
30
|
-
${rounded && ' -roundedborders'}
|
|
31
|
-
${disabled && ' -disabled'}`;
|
|
27
|
+
return "inputwrapper ".concat(inputHasFocus && ' -focusable', "\n ").concat(customClassForWrapper, "\n ").concat(errorMessages && errorMessages.length > 0 && ' -requirederror', "\n ").concat(rounded && ' -roundedborders', "\n ").concat(disabled && ' -disabled');
|
|
32
28
|
};
|
|
33
29
|
exports.getInputWrapperClass = getInputWrapperClass;
|
|
34
30
|
const getRightElements = (errorMessages, skeletonize, rightElements) => {
|
|
@@ -38,7 +34,7 @@ const getRightElements = (errorMessages, skeletonize, rightElements) => {
|
|
|
38
34
|
elements = [elements];
|
|
39
35
|
}
|
|
40
36
|
elements = elements.map((element, index) => element && /*#__PURE__*/_react.default.cloneElement(element, {
|
|
41
|
-
key:
|
|
37
|
+
key: "rightelement-".concat(index + 1)
|
|
42
38
|
}));
|
|
43
39
|
if (errorMessages) return elements;
|
|
44
40
|
return elements;
|
|
@@ -15,10 +15,7 @@ const getCalendarDropdownStyle = _ref => {
|
|
|
15
15
|
width,
|
|
16
16
|
minWidth
|
|
17
17
|
} = _ref;
|
|
18
|
-
return
|
|
19
|
-
left: ${leftPosition}px;
|
|
20
|
-
width: ${width}px;
|
|
21
|
-
min-width: ${minWidth}px;`;
|
|
18
|
+
return "top: ".concat(topPosition, "px;\n left: ").concat(leftPosition, "px;\n width: ").concat(width, "px;\n min-width: ").concat(minWidth, "px;");
|
|
22
19
|
};
|
|
23
20
|
exports.getCalendarDropdownStyle = getCalendarDropdownStyle;
|
|
24
21
|
const getMomentValue = value => {
|