linear-react-components-ui 1.1.20-beta.34 → 1.1.20-beta.35
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/avatar/index.js +8 -9
- package/lib/badge/index.js +4 -4
- package/lib/buttons/DangerButton.js +1 -1
- package/lib/buttons/DefaultButton.js +3 -22
- 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/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/checkbox/Label.js +31 -0
- package/lib/checkbox/index.js +1 -1
- package/lib/dialog/Custom.js +1 -1
- package/lib/dialog/Question.js +4 -2
- package/lib/dialog/base/Content.js +1 -1
- package/lib/dialog/base/Header.js +2 -2
- package/lib/dialog/base/index.js +5 -8
- package/lib/dialog/form/index.js +2 -2
- package/lib/dialog/types.d.ts +0 -1
- package/lib/dialog/wizard/progressbar.js +1 -1
- package/lib/dialog/wizard/step.js +1 -1
- package/lib/drawer/Drawer.js +3 -3
- package/lib/drawer/Header.js +1 -1
- package/lib/dropdown/Popup.js +6 -6
- package/lib/dropdown/helper.js +1 -1
- package/lib/dropdown/withDropdown.js +2 -2
- package/lib/fieldset/index.js +7 -7
- package/lib/form/Field.js +14 -3
- package/lib/form/FieldArray.js +1 -1
- package/lib/form/FieldNumber.js +10 -7
- package/lib/form/FieldPeriod.js +2 -2
- package/lib/form/index.js +15 -20
- package/lib/gridlayout/GridCol.js +5 -5
- package/lib/gridlayout/GridRow.js +1 -4
- package/lib/hint/index.js +1 -7
- package/lib/icons/helper.d.ts +0 -4
- package/lib/icons/helper.js +0 -4
- package/lib/icons/index.js +27 -24
- package/lib/inputs/base/InputTextBase.js +8 -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 -4
- package/lib/inputs/mask/helpers.d.ts +1 -1
- package/lib/inputs/mask/imaskHOC.js +203 -0
- 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/index.js +2 -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 +14 -9
- package/lib/inputs/select/simple/index.js +17 -10
- 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 +11 -21
- package/lib/list/index.js +1 -2
- package/lib/list/types.d.ts +1 -2
- 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 +25 -27
- package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
- package/lib/menus/sidenav/helpers.js +1 -1
- package/lib/menus/sidenav/index.js +31 -39
- package/lib/menus/sidenav/popup_menu_help/index.js +85 -0
- package/lib/menus/sidenav/types.d.ts +0 -1
- 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/index.js +1 -1
- package/lib/progress/Bar.js +6 -6
- package/lib/radio/index.js +2 -2
- 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.js +1 -1
- package/lib/table/Row.js +3 -3
- package/lib/table/RowColumn.js +1 -1
- package/lib/table/index.js +1 -6
- package/lib/tabs/DropdownItems.js +62 -0
- package/lib/tabs/DropdownTabs.js +1 -1
- package/lib/tabs/Menu.js +1 -1
- package/lib/tabs/MenuItems.js +70 -0
- 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 +2 -4
- 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 +8 -8
- package/lib/treeview/Header.js +1 -1
- package/lib/treeview/Node.js +5 -5
- package/lib/treeview/index.js +4 -4
- package/lib/treeview_old/Header.js +29 -0
- package/lib/treeview_old/Node.js +68 -0
- package/lib/treeview_old/index.js +43 -0
- package/lib/uitour/index.js +8 -6
- package/package.json +1 -1
package/lib/form/FieldArray.js
CHANGED
|
@@ -77,7 +77,7 @@ const FieldArray = props => {
|
|
|
77
77
|
if (!skipLabel && label) {
|
|
78
78
|
content = /*#__PURE__*/_react.default.createElement(_fieldset.default, {
|
|
79
79
|
title: label,
|
|
80
|
-
customClass:
|
|
80
|
+
customClass: "arraycontainer ".concat(bordered && '-bordered'),
|
|
81
81
|
style: labelContainerStyle,
|
|
82
82
|
titleCustomClass: "label"
|
|
83
83
|
}, /*#__PURE__*/_react.default.createElement(Component, _extends({}, rest, getDefaultProps(props), {
|
package/lib/form/FieldNumber.js
CHANGED
|
@@ -4,14 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
9
|
var _withFieldHOC = _interopRequireDefault(require("./withFieldHOC"));
|
|
10
10
|
var _helpers = require("./helpers");
|
|
11
11
|
var constants = _interopRequireWildcard(require("../internals/constants"));
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
13
|
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); }
|
|
13
14
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
15
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -31,33 +31,36 @@ const getEventProps = _ref => {
|
|
|
31
31
|
} = _ref;
|
|
32
32
|
return {
|
|
33
33
|
onBlur: e => {
|
|
34
|
-
if (component
|
|
34
|
+
if ((component === null || component === void 0 ? void 0 : component.name) !== 'NumberField' && handlerFieldChange) handlerFieldChange(e);
|
|
35
35
|
if (validators && handlerFieldValidate) handlerFieldValidate(name, e.target.value, validators);
|
|
36
36
|
if (onBlur) onBlur(e);
|
|
37
37
|
},
|
|
38
38
|
onKeyDown: e => {
|
|
39
39
|
if ([constants.keyCodes.ENTER].includes(e.keyCode)) {
|
|
40
|
-
if (validators) handlerFieldValidate
|
|
40
|
+
if (validators) handlerFieldValidate === null || handlerFieldValidate === void 0 ? void 0 : handlerFieldValidate(name, e.target.value, validators);
|
|
41
41
|
if (onKeyDown) onKeyDown(e);
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
onChange: e => {
|
|
45
|
-
if (component
|
|
45
|
+
if ((component === null || component === void 0 ? void 0 : component.name) === 'NumberField') {
|
|
46
46
|
if (validators && e.target && handlerFieldValidate) {
|
|
47
47
|
handlerFieldValidate(name, e.target.value, validators);
|
|
48
48
|
}
|
|
49
49
|
if (handlerFieldChange) handlerFieldChange(e);
|
|
50
|
+
if (onChange) onChange(e);
|
|
50
51
|
}
|
|
51
|
-
if (onChange) onChange(e);
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
55
|
const FieldMask = props => {
|
|
56
56
|
const {
|
|
57
57
|
data,
|
|
58
|
-
name
|
|
58
|
+
name,
|
|
59
|
+
originalData
|
|
59
60
|
} = props;
|
|
60
61
|
const currentValue = _lodash.default.get(data, name);
|
|
62
|
+
const [showValidateMessages, setShowValidateMessages] = (0, _react.useState)(false);
|
|
63
|
+
const originalValue = _lodash.default.get(originalData, name);
|
|
61
64
|
return /*#__PURE__*/_react.default.createElement(props.component, _extends({}, props, getEventProps(_objectSpread({}, props)), {
|
|
62
65
|
errorMessages: (0, _helpers.getErrorMessages)(_objectSpread(_objectSpread({}, props), {}, {
|
|
63
66
|
fieldErrors: props.fieldErrors
|
package/lib/form/FieldPeriod.js
CHANGED
|
@@ -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
|
@@ -29,7 +29,6 @@ Object.defineProperty(exports, "FieldPeriod", {
|
|
|
29
29
|
});
|
|
30
30
|
exports.default = void 0;
|
|
31
31
|
var _react = _interopRequireWildcard(require("react"));
|
|
32
|
-
var _uuid = require("uuid");
|
|
33
32
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
34
33
|
var _helpers = require("./helpers");
|
|
35
34
|
var _Field = _interopRequireDefault(require("./Field"));
|
|
@@ -70,16 +69,14 @@ const Form = _ref => {
|
|
|
70
69
|
children,
|
|
71
70
|
useInternalState = false
|
|
72
71
|
} = _ref;
|
|
73
|
-
const formId = (0, _uuid.v1)();
|
|
74
72
|
const [data, setData] = (0, _react.useState)(dataSource);
|
|
75
73
|
const [originalData, setOriginalData] = (0, _react.useState)(dataSource);
|
|
76
74
|
const [submitFormOnEnter, setSubmitFormOnEnter] = (0, _react.useState)(submitOnPressEnterKey);
|
|
77
75
|
const [fieldErrors, setFieldErrors] = (0, _react.useState)({});
|
|
76
|
+
const fieldsValidators = (0, _react.useRef)({});
|
|
78
77
|
const [oldFieldsValidatorsQuantity, setOldFieldsValidatorsQuantity] = (0, _react.useState)(0);
|
|
79
78
|
const [isValid, setIsValid] = (0, _react.useState)(false);
|
|
80
79
|
const context = (0, _react.useContext)(_withFormSecurity.FormSecurityContext);
|
|
81
|
-
const formRef = (0, _react.useRef)(null);
|
|
82
|
-
const fieldsValidators = (0, _react.useRef)({});
|
|
83
80
|
const usedData = useInternalState ? data : dataSource;
|
|
84
81
|
const getValidatesErrorMessages = (validators, fieldValue) => {
|
|
85
82
|
const validatorsArray = !(validators instanceof Array) ? [validators] : validators;
|
|
@@ -140,10 +137,7 @@ const Form = _ref => {
|
|
|
140
137
|
}
|
|
141
138
|
};
|
|
142
139
|
const onFormSubmit = (0, _react.useCallback)(event => {
|
|
143
|
-
if (event)
|
|
144
|
-
event.preventDefault();
|
|
145
|
-
event.stopPropagation();
|
|
146
|
-
}
|
|
140
|
+
if (event) event.preventDefault();
|
|
147
141
|
if (checkIsValid(usedData)) onSubmit(usedData);
|
|
148
142
|
}, [usedData]);
|
|
149
143
|
const onResetField = (cb, fields) => {
|
|
@@ -181,20 +175,23 @@ const Form = _ref => {
|
|
|
181
175
|
const onBeforeUnload = e => {
|
|
182
176
|
const event = e;
|
|
183
177
|
event.preventDefault();
|
|
184
|
-
if (_lodash.default.isEqual(usedData, originalData))
|
|
178
|
+
if (_lodash.default.isEqual(usedData, originalData)) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
event.returnValue = true;
|
|
182
|
+
};
|
|
183
|
+
const submitOnEnter = event => {
|
|
184
|
+
if (event.key === 'Enter') {
|
|
185
|
+
event.preventDefault();
|
|
186
|
+
if (submitFormOnEnter) onFormSubmit();
|
|
187
|
+
}
|
|
185
188
|
};
|
|
186
189
|
const formProps = () => {
|
|
187
190
|
let propsForm = null;
|
|
188
191
|
if (!disabled) {
|
|
189
192
|
propsForm = {
|
|
190
193
|
onSubmit: event => event.preventDefault(),
|
|
191
|
-
onKeyPress: event =>
|
|
192
|
-
if (event && event.key === 'Enter') {
|
|
193
|
-
event.preventDefault();
|
|
194
|
-
event.stopPropagation();
|
|
195
|
-
if (submitFormOnEnter) onFormSubmit();
|
|
196
|
-
}
|
|
197
|
-
}
|
|
194
|
+
onKeyPress: event => submitOnEnter(event)
|
|
198
195
|
};
|
|
199
196
|
}
|
|
200
197
|
return propsForm;
|
|
@@ -240,7 +237,7 @@ const Form = _ref => {
|
|
|
240
237
|
}
|
|
241
238
|
}, [submitOnPressEnterKey]);
|
|
242
239
|
(0, _react.useEffect)(() => {
|
|
243
|
-
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);
|
|
244
241
|
if (fieldsValidators.current && onValidateForm && oldFieldsValidatorsQuantity !== validatorsQuantity) {
|
|
245
242
|
setOldFieldsValidatorsQuantity(validatorsQuantity);
|
|
246
243
|
onValidateForm(checkIsValid(usedData, true, fieldsValidators.current));
|
|
@@ -265,12 +262,10 @@ const Form = _ref => {
|
|
|
265
262
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_helpers.FormContext.Provider, {
|
|
266
263
|
value: contextValues
|
|
267
264
|
}, /*#__PURE__*/_react.default.createElement("form", _extends({
|
|
268
|
-
id: formId,
|
|
269
|
-
ref: formRef,
|
|
270
265
|
style: style
|
|
271
266
|
}, formProps(), {
|
|
272
267
|
role: "presentation",
|
|
273
|
-
className:
|
|
268
|
+
className: "form-component ".concat(customClass)
|
|
274
269
|
}), children)), /*#__PURE__*/_react.default.createElement(_dialog.DialogQuestion, {
|
|
275
270
|
zIndex: "99999999",
|
|
276
271
|
title: securityTitle || 'Dados Alterados',
|
|
@@ -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,
|
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
package/lib/icons/helper.js
CHANGED
|
@@ -632,9 +632,5 @@ var _default = exports.default = {
|
|
|
632
632
|
bank: {
|
|
633
633
|
viewbox: '0 0 16 16',
|
|
634
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']
|
|
635
|
-
},
|
|
636
|
-
earth: {
|
|
637
|
-
viewbox: '0 0 16 16',
|
|
638
|
-
paths: ['M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 15c-0.984 0-1.92-0.203-2.769-0.57l3.643-4.098c0.081-0.092 0.126-0.21 0.126-0.332v-1.5c0-0.276-0.224-0.5-0.5-0.5-1.765 0-3.628-1.835-3.646-1.854-0.094-0.094-0.221-0.146-0.354-0.146h-2c-0.276 0-0.5 0.224-0.5 0.5v3c0 0.189 0.107 0.363 0.276 0.447l1.724 0.862v2.936c-1.813-1.265-3-3.366-3-5.745 0-1.074 0.242-2.091 0.674-3h1.826c0.133 0 0.26-0.053 0.354-0.146l2-2c0.094-0.094 0.146-0.221 0.146-0.354v-1.21c0.634-0.189 1.305-0.29 2-0.29 1.1 0 2.141 0.254 3.067 0.706-0.065 0.055-0.128 0.112-0.188 0.172-0.567 0.567-0.879 1.32-0.879 2.121s0.312 1.555 0.879 2.121c0.569 0.569 1.332 0.879 2.119 0.879 0.049 0 0.099-0.001 0.149-0.004 0.216 0.809 0.605 2.917-0.131 5.818-0.007 0.027-0.011 0.055-0.013 0.082-1.271 1.298-3.042 2.104-5.002 2.104z']
|
|
639
635
|
}
|
|
640
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
|
}
|
|
@@ -122,11 +122,13 @@ const InputTextBase = props => {
|
|
|
122
122
|
if (!disableCallbacks) {
|
|
123
123
|
propsInput = _objectSpread(_objectSpread({}, propsInput), {}, {
|
|
124
124
|
onFocus: e => {
|
|
125
|
-
|
|
125
|
+
var _props$onInputReceive;
|
|
126
|
+
(_props$onInputReceive = props.onInputReceiveFocus) === null || _props$onInputReceive === void 0 ? void 0 : _props$onInputReceive.call(props);
|
|
126
127
|
if (props.onFocus) props.onFocus(e);
|
|
127
128
|
},
|
|
128
129
|
onBlur: e => {
|
|
129
|
-
|
|
130
|
+
var _props$onInputLostFoc;
|
|
131
|
+
(_props$onInputLostFoc = props.onInputLostFocus) === null || _props$onInputLostFoc === void 0 ? void 0 : _props$onInputLostFoc.call(props);
|
|
130
132
|
if (props.onBlur) props.onBlur(e);
|
|
131
133
|
},
|
|
132
134
|
onKeyDown: e => {
|
|
@@ -190,7 +192,7 @@ const InputTextBase = props => {
|
|
|
190
192
|
if (!visible || unvisible) return null;
|
|
191
193
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
192
194
|
style: style,
|
|
193
|
-
className:
|
|
195
|
+
className: "input-base-component ".concat(skeletonize ? '-skeletonized' : '', " ").concat(customClass),
|
|
194
196
|
ref: inputBaseRef
|
|
195
197
|
}, label && /*#__PURE__*/_react.default.createElement("div", {
|
|
196
198
|
className: "labelcontainer",
|
|
@@ -212,7 +214,7 @@ const InputTextBase = props => {
|
|
|
212
214
|
display: 'flex'
|
|
213
215
|
}
|
|
214
216
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
215
|
-
className:
|
|
217
|
+
className: "label ".concat(customClassForLabel, " ").concat(labelUppercase && ' -uppercase'),
|
|
216
218
|
style: {
|
|
217
219
|
alignSelf: 'center'
|
|
218
220
|
}
|
|
@@ -236,11 +238,11 @@ const InputTextBase = props => {
|
|
|
236
238
|
}))
|
|
237
239
|
}, leftElements && /*#__PURE__*/_react.default.createElement("div", {
|
|
238
240
|
style: styleForSideButtons,
|
|
239
|
-
className:
|
|
241
|
+
className: "sidebuttons ".concat(customClassForSideButtons)
|
|
240
242
|
}, leftElements), /*#__PURE__*/_react.default.createElement("div", {
|
|
241
243
|
"data-testid": "testInputContent",
|
|
242
244
|
style: styleForInputContent,
|
|
243
|
-
className:
|
|
245
|
+
className: "inputcontent ".concat(customClassForInputContent)
|
|
244
246
|
}, type === 'textarea' ? /*#__PURE__*/_react.default.createElement("textarea", _extends({
|
|
245
247
|
rows: props.rows,
|
|
246
248
|
cols: props.cols,
|
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 => {
|
package/lib/inputs/date/index.js
CHANGED
|
@@ -22,6 +22,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
22
22
|
const CALENDAR_BUTTON_WIDTH = 24;
|
|
23
23
|
const CALENDAR_MIN_WIDTH = 250;
|
|
24
24
|
const DatePicker = props => {
|
|
25
|
+
var _window;
|
|
25
26
|
const {
|
|
26
27
|
showButtonOpen = true,
|
|
27
28
|
openOnFocus = true,
|
|
@@ -53,14 +54,16 @@ const DatePicker = props => {
|
|
|
53
54
|
const dropdownContainer = (0, _react.useRef)();
|
|
54
55
|
const [insideDropdown, setInsideDropdown] = (0, _react.useState)(false);
|
|
55
56
|
const onScreenResize = () => {
|
|
56
|
-
|
|
57
|
+
var _inputRef$current;
|
|
58
|
+
setInputDimensions(inputRef === null || inputRef === void 0 ? void 0 : (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.getBoundingClientRect());
|
|
57
59
|
};
|
|
58
60
|
const onClickOutside = event => {
|
|
61
|
+
var _buttonOpenRef$curren;
|
|
59
62
|
const {
|
|
60
63
|
target
|
|
61
64
|
} = event;
|
|
62
65
|
if (!dropdownContainer || target === inputRef.current || target === buttonOpenRef.current) return;
|
|
63
|
-
if (target !== dropdownContainer.current && dropdownContainer && dropdownContainer.current && !dropdownContainer.current.contains(target) && buttonOpenRef && !buttonOpenRef
|
|
66
|
+
if (target !== dropdownContainer.current && dropdownContainer && dropdownContainer.current && !dropdownContainer.current.contains(target) && buttonOpenRef && !(buttonOpenRef !== null && buttonOpenRef !== void 0 && (_buttonOpenRef$curren = buttonOpenRef.current) !== null && _buttonOpenRef$curren !== void 0 && _buttonOpenRef$curren.contains(target))) {
|
|
64
67
|
setShowCalendar(false);
|
|
65
68
|
}
|
|
66
69
|
};
|
|
@@ -106,7 +109,8 @@ const DatePicker = props => {
|
|
|
106
109
|
const onInputChange = function (event) {
|
|
107
110
|
let valueInput = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
108
111
|
if (typeof valueInput === 'string') {
|
|
109
|
-
|
|
112
|
+
var _event$target$value;
|
|
113
|
+
const date = (_event$target$value = event.target.value) !== null && _event$target$value !== void 0 ? _event$target$value : '';
|
|
110
114
|
if (props.onChange) {
|
|
111
115
|
if (isValidDate(date)) {
|
|
112
116
|
const newValue = (0, _moment.default)(date, _helpers.PT_BR_FORMAT).format(_helpers.EN_US_FORMAT);
|
|
@@ -132,9 +136,10 @@ const DatePicker = props => {
|
|
|
132
136
|
}
|
|
133
137
|
};
|
|
134
138
|
const setValue = function () {
|
|
139
|
+
var _inputRef$current2;
|
|
135
140
|
let valueParam = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
136
141
|
let e = arguments.length > 1 ? arguments[1] : undefined;
|
|
137
|
-
if (showCalendar && setFocusOnSelect) inputRef.current
|
|
142
|
+
if (showCalendar && setFocusOnSelect) (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
|
|
138
143
|
if (props.onComplete) props.onComplete(e, valueParam);
|
|
139
144
|
if (props.onChange) onInputChange({
|
|
140
145
|
target: {
|
|
@@ -179,7 +184,7 @@ const DatePicker = props => {
|
|
|
179
184
|
return /*#__PURE__*/_react.default.createElement(_Dialog.default, {
|
|
180
185
|
dialogSize: dialogSize,
|
|
181
186
|
handlerClose: setShowCalendar
|
|
182
|
-
}, getCalendar(valueState, props
|
|
187
|
+
}, getCalendar(valueState, props === null || props === void 0 ? void 0 : props.calendarColorStyle));
|
|
183
188
|
}
|
|
184
189
|
return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
|
|
185
190
|
topPosition: inputDimensions ? inputDimensions.top + inputDimensions.height + 5 : '',
|
|
@@ -189,16 +194,16 @@ const DatePicker = props => {
|
|
|
189
194
|
dropdownRef: el => {
|
|
190
195
|
dropdownContainer.current = el;
|
|
191
196
|
}
|
|
192
|
-
}, getCalendar(valueState, props
|
|
197
|
+
}, getCalendar(valueState, props === null || props === void 0 ? void 0 : props.calendarColorStyle));
|
|
193
198
|
};
|
|
194
199
|
(0, _react.useEffect)(() => {
|
|
195
200
|
const screenWidth = window.innerWidth;
|
|
196
201
|
if (inputDimensions && screenWidth < inputDimensions.left + CALENDAR_MIN_WIDTH) {
|
|
197
202
|
setFormatedLeftPosition(inputDimensions.left - (CALENDAR_MIN_WIDTH - inputDimensions.width - CALENDAR_BUTTON_WIDTH));
|
|
198
203
|
} else {
|
|
199
|
-
setFormatedLeftPosition(inputDimensions
|
|
204
|
+
setFormatedLeftPosition(inputDimensions === null || inputDimensions === void 0 ? void 0 : inputDimensions.left);
|
|
200
205
|
}
|
|
201
|
-
}, [window
|
|
206
|
+
}, [(_window = window) === null || _window === void 0 ? void 0 : _window.innerWidth, inputDimensions]);
|
|
202
207
|
(0, _react.useEffect)(() => {
|
|
203
208
|
window.addEventListener('resize', onScreenResize);
|
|
204
209
|
document.addEventListener('click', onClickOutside);
|
|
@@ -228,7 +233,8 @@ const DatePicker = props => {
|
|
|
228
233
|
mask: "00/00/0000",
|
|
229
234
|
onComplete: e => {
|
|
230
235
|
if (e) {
|
|
231
|
-
|
|
236
|
+
var _e$target;
|
|
237
|
+
setValue((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.maskedValue, e);
|
|
232
238
|
}
|
|
233
239
|
},
|
|
234
240
|
onBlur: onInputBlur,
|
|
@@ -19,7 +19,7 @@ const ErrorMessage = exports.ErrorMessage = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
19
19
|
return /*#__PURE__*/_react.default.createElement("p", {
|
|
20
20
|
ref: ref,
|
|
21
21
|
style: style,
|
|
22
|
-
className:
|
|
22
|
+
className: "errormessages-component ".concat(customClass)
|
|
23
23
|
}, messages.join(', '));
|
|
24
24
|
});
|
|
25
25
|
ErrorMessage.displayName = 'ErrorMessage';
|
|
@@ -27,16 +27,16 @@ const DefaultFile = props => {
|
|
|
27
27
|
hint = [],
|
|
28
28
|
onChange
|
|
29
29
|
} = props;
|
|
30
|
-
const getFilesList = files => !files
|
|
30
|
+
const getFilesList = files => !(files !== null && files !== void 0 && files.length) ? [] : _lodash.default.map(files, file => file);
|
|
31
31
|
const [fileList, setFileList] = (0, _react.useState)(defaultFiles);
|
|
32
32
|
const ifExistFiles = fileList instanceof Array && fileList.length > 0;
|
|
33
33
|
const popUpDescription = () => /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
-
className:
|
|
34
|
+
className: "size-position-icon ".concat(!ifExistFiles ? '-disabled-popover' : '')
|
|
35
35
|
}, /*#__PURE__*/_react.default.createElement(_popover.default, {
|
|
36
36
|
iconSize: 16
|
|
37
37
|
}, /*#__PURE__*/_react.default.createElement(_popover.PopoverText, null, /*#__PURE__*/_react.default.createElement("strong", null, "Arquivos"), /*#__PURE__*/_react.default.createElement("br", null), ifExistFiles && fileList.map(file => /*#__PURE__*/_react.default.createElement("div", {
|
|
38
38
|
className: "list-simple-file",
|
|
39
|
-
key:
|
|
39
|
+
key: "".concat(file.name).concat(file.size)
|
|
40
40
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
41
41
|
className: "file-name"
|
|
42
42
|
}, /*#__PURE__*/_react.default.createElement("span", null, file.name)))))));
|
|
@@ -55,10 +55,11 @@ const DefaultFile = props => {
|
|
|
55
55
|
})
|
|
56
56
|
});
|
|
57
57
|
const handleChange = e => {
|
|
58
|
-
|
|
58
|
+
var _e$preventDefault;
|
|
59
|
+
(_e$preventDefault = e.preventDefault) === null || _e$preventDefault === void 0 ? void 0 : _e$preventDefault.call(e);
|
|
59
60
|
const files = getFilesList(e.target.files);
|
|
60
61
|
setFileList(files);
|
|
61
|
-
onChange
|
|
62
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(files, e);
|
|
62
63
|
};
|
|
63
64
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
64
65
|
className: "input-simple-file-container"
|