linear-react-components-ui 1.1.2-beta.2 → 1.1.2-beta.20
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/.eslintcache +1 -0
- package/.gitlab-ci.yml +1 -0
- package/.vscode/settings.json +10 -1
- package/lib/@types/SizePixels.d.ts +1 -1
- package/lib/assets/styles/checkbox.scss +45 -38
- package/lib/assets/styles/colors.scss +3 -1
- package/lib/assets/styles/commons.scss +1 -0
- package/lib/assets/styles/dialog.scss +27 -10
- package/lib/assets/styles/error.scss +9 -0
- package/lib/assets/styles/fieldset.scss +3 -0
- package/lib/assets/styles/gridlayout.scss +9 -2
- package/lib/assets/styles/hint.scss +4 -0
- package/lib/assets/styles/input.scss +2 -7
- package/lib/assets/styles/multiSelect.scss +6 -1
- package/lib/assets/styles/radio.scss +37 -35
- package/lib/assets/styles/select.scss +13 -7
- package/lib/assets/styles/tabs.scss +3 -0
- package/lib/checkbox/Label.js +13 -4
- package/lib/checkbox/index.d.ts +2 -2
- package/lib/checkbox/index.js +21 -16
- package/lib/checkbox/types.d.ts +1 -0
- package/lib/dialog/base/Content.js +1 -0
- package/lib/dialog/base/Header.js +4 -4
- package/lib/dialog/base/index.js +6 -4
- package/lib/drawer/Drawer.js +5 -4
- package/lib/dropdown/Popup.d.ts +1 -1
- package/lib/dropdown/Popup.js +5 -2
- package/lib/dropdown/types.d.ts +1 -0
- package/lib/fieldset/index.js +4 -2
- package/lib/fieldset/types.d.ts +2 -0
- package/lib/gridlayout/GridRow.js +10 -2
- package/lib/gridlayout/types.d.ts +1 -0
- package/lib/hint/helpers.d.ts +3 -0
- package/lib/hint/helpers.js +21 -0
- package/lib/hint/index.d.ts +1 -1
- package/lib/hint/index.js +5 -15
- package/lib/hint/types.d.ts +1 -0
- package/lib/inputs/base/InputTextBase.js +8 -2
- package/lib/inputs/base/helpers.d.ts +1 -2
- package/lib/inputs/base/helpers.js +1 -8
- package/lib/inputs/base/types.d.ts +1 -0
- package/lib/inputs/errorMessage/index.d.ts +16 -0
- package/lib/inputs/errorMessage/index.js +26 -0
- package/lib/inputs/file/DefaultFile.js +4 -2
- package/lib/inputs/file/DragDropFile.js +4 -2
- package/lib/inputs/inputHOC.d.ts +1 -0
- package/lib/inputs/mask/BaseMask.d.ts +1 -0
- package/lib/inputs/mask/Cnpj.d.ts +1 -0
- package/lib/inputs/mask/Cpf.d.ts +1 -0
- package/lib/inputs/mask/Phone.d.ts +1 -0
- package/lib/inputs/mask/ZipCode.d.ts +1 -0
- package/lib/inputs/mask/imaskHOC.d.ts +1 -0
- package/lib/inputs/mask/index.d.ts +1 -0
- package/lib/inputs/mask/types.d.ts +3 -1
- package/lib/inputs/multiSelect/ActionButtons.js +10 -8
- package/lib/inputs/multiSelect/Dropdown.js +2 -6
- package/lib/inputs/number/BaseNumber.d.ts +1 -0
- package/lib/inputs/number/Currency.d.ts +1 -0
- package/lib/inputs/number/Decimal.d.ts +1 -0
- package/lib/inputs/number/index.d.ts +1 -0
- package/lib/inputs/number/types.d.ts +1 -0
- package/lib/inputs/period/index.js +4 -1
- package/lib/inputs/search/index.d.ts +1 -0
- package/lib/inputs/select/ActionButtons.d.ts +1 -0
- package/lib/inputs/select/ActionButtons.js +18 -27
- package/lib/inputs/select/Dropdown.d.ts +1 -0
- package/lib/inputs/select/Dropdown.js +2 -6
- package/lib/inputs/select/helper.d.ts +1 -0
- package/lib/inputs/select/multiple/Selecteds.d.ts +1 -1
- package/lib/inputs/select/multiple/Selecteds.js +3 -5
- package/lib/inputs/select/multiple/index.js +38 -19
- package/lib/inputs/select/simple/index.js +60 -31
- package/lib/inputs/select/types.d.ts +3 -2
- package/lib/inputs/types.d.ts +11 -5
- package/lib/menus/sidenav/popup_menu_search/index.js +4 -3
- package/lib/table/HeaderColumn.d.ts +1 -1
- package/lib/table/HeaderColumn.js +5 -1
- package/lib/table/types.d.ts +2 -0
- package/lib/tabs/context.js +1 -1
- package/lib/tabs/types.d.ts +3 -3
- package/package.json +4 -4
- package/.tool-versions +0 -1
package/lib/dialog/base/index.js
CHANGED
|
@@ -103,10 +103,10 @@ const BaseDialog = props => {
|
|
|
103
103
|
};
|
|
104
104
|
const createdModal = /*#__PURE__*/_react.default.createElement("div", {
|
|
105
105
|
className: "modalcontainer",
|
|
106
|
+
onMouseDown: handleClickOutside,
|
|
106
107
|
style: {
|
|
107
108
|
zIndex: 99999 + Number(zIndex)
|
|
108
|
-
}
|
|
109
|
-
onMouseDown: handleClickOutside
|
|
109
|
+
}
|
|
110
110
|
}, overlay && /*#__PURE__*/_react.default.createElement("div", {
|
|
111
111
|
className: "modal-overlay",
|
|
112
112
|
"data-testid": "modal-overlay"
|
|
@@ -120,8 +120,10 @@ const BaseDialog = props => {
|
|
|
120
120
|
ref: wrapperEl
|
|
121
121
|
}, children)));
|
|
122
122
|
(0, _react.useEffect)(() => {
|
|
123
|
-
if (open
|
|
124
|
-
|
|
123
|
+
if (open) {
|
|
124
|
+
if (closeOnEsc) {
|
|
125
|
+
document.addEventListener('keydown', handleCloseOnEsc);
|
|
126
|
+
}
|
|
125
127
|
}
|
|
126
128
|
return () => {
|
|
127
129
|
document.removeEventListener('keydown', handleCloseOnEsc);
|
package/lib/drawer/Drawer.js
CHANGED
|
@@ -82,8 +82,9 @@ const BaseDrawer = _ref => {
|
|
|
82
82
|
body.appendChild(drawerOverlay);
|
|
83
83
|
};
|
|
84
84
|
const closeDrawerOnEsc = e => {
|
|
85
|
-
if (closeOnEsc &&
|
|
85
|
+
if (closeOnEsc && e.key === 'Escape') {
|
|
86
86
|
handlerClose === null || handlerClose === void 0 ? void 0 : handlerClose();
|
|
87
|
+
e.stopPropagation();
|
|
87
88
|
}
|
|
88
89
|
};
|
|
89
90
|
(0, _react.useEffect)(() => {
|
|
@@ -98,7 +99,7 @@ const BaseDrawer = _ref => {
|
|
|
98
99
|
if (overlay && !targetId && body) setDrawerOverlay(body);
|
|
99
100
|
return () => {
|
|
100
101
|
const drawerOverlay = document.getElementsByClassName('drawer-overlay')[0];
|
|
101
|
-
if (closeOnEsc) document.body.removeEventListener('
|
|
102
|
+
if (closeOnEsc) document.body.removeEventListener('keydown', closeDrawerOnEsc);
|
|
102
103
|
if (targetId) {
|
|
103
104
|
const drawerComponentTarget = document.getElementById(targetId);
|
|
104
105
|
if (drawerComponentTarget && drawerComponentEl.current) {
|
|
@@ -110,9 +111,9 @@ const BaseDrawer = _ref => {
|
|
|
110
111
|
}, []);
|
|
111
112
|
(0, _react.useEffect)(() => {
|
|
112
113
|
if (closeOnEsc) {
|
|
113
|
-
document.body.addEventListener('
|
|
114
|
+
document.body.addEventListener('keydown', closeDrawerOnEsc);
|
|
114
115
|
}
|
|
115
|
-
return () => document.body.removeEventListener('
|
|
116
|
+
return () => document.body.removeEventListener('keydown', closeDrawerOnEsc);
|
|
116
117
|
}, [closeOnEsc]);
|
|
117
118
|
const contextValues = {
|
|
118
119
|
handlerClose,
|
package/lib/dropdown/Popup.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { IPopUpProps } from './types.js';
|
|
3
3
|
|
|
4
|
-
declare const DropdownPopup: ({ customClassForDropdown, align, isFloatMenu, topPosition, leftPosition, rightPosition, minWidth, ...props }: IPopUpProps) => React.ReactPortal;
|
|
4
|
+
declare const DropdownPopup: ({ id, customClassForDropdown, align, isFloatMenu, topPosition, leftPosition, rightPosition, minWidth, ...props }: IPopUpProps) => React.ReactPortal;
|
|
5
5
|
|
|
6
6
|
export { DropdownPopup as default };
|
package/lib/dropdown/Popup.js
CHANGED
|
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
9
|
-
|
|
9
|
+
var _uuid = require("uuid");
|
|
10
|
+
const _excluded = ["id", "customClassForDropdown", "align", "isFloatMenu", "topPosition", "leftPosition", "rightPosition", "minWidth"];
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
12
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
12
13
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
@@ -30,6 +31,7 @@ const getCalendarDropdownStyle = _ref => {
|
|
|
30
31
|
const body = document.getElementsByTagName('body')[0];
|
|
31
32
|
const DropdownPopup = _ref2 => {
|
|
32
33
|
let {
|
|
34
|
+
id,
|
|
33
35
|
customClassForDropdown = '',
|
|
34
36
|
align = 'left',
|
|
35
37
|
isFloatMenu = false,
|
|
@@ -53,10 +55,11 @@ const DropdownPopup = _ref2 => {
|
|
|
53
55
|
if (popup && popup.current) {
|
|
54
56
|
const modalContainers = document.body.getElementsByClassName('modalcontainer');
|
|
55
57
|
const lastModalContainer = modalContainers[modalContainers.length - 1];
|
|
56
|
-
popup.current.style.zIndex = "".concat(modalContainers.length ? lastModalContainer.style.zIndex : 99999);
|
|
58
|
+
popup.current.style.zIndex = "".concat(modalContainers.length ? Number(lastModalContainer.style.zIndex) + 1 : 99999);
|
|
57
59
|
}
|
|
58
60
|
(0, _react.useEffect)(() => {
|
|
59
61
|
body.appendChild(popup.current);
|
|
62
|
+
popup.current.id = id || "dropdown-component-".concat((0, _uuid.v1)());
|
|
60
63
|
return () => {
|
|
61
64
|
body.removeChild(popup.current);
|
|
62
65
|
};
|
package/lib/dropdown/types.d.ts
CHANGED
package/lib/fieldset/index.js
CHANGED
|
@@ -28,7 +28,9 @@ const Fieldset = props => {
|
|
|
28
28
|
styleTitle,
|
|
29
29
|
template = 'none',
|
|
30
30
|
titleCustomClass,
|
|
31
|
-
permissionAttr
|
|
31
|
+
permissionAttr,
|
|
32
|
+
leftElements = null,
|
|
33
|
+
rightElements = null
|
|
32
34
|
} = props;
|
|
33
35
|
const {
|
|
34
36
|
hideContent,
|
|
@@ -69,7 +71,7 @@ const Fieldset = props => {
|
|
|
69
71
|
style: styleTitle,
|
|
70
72
|
align: titleAlign,
|
|
71
73
|
className: "legend ".concat(titleCustomClass)
|
|
72
|
-
}, title), /*#__PURE__*/_react.default.createElement("div", {
|
|
74
|
+
}, leftElements, title, rightElements), /*#__PURE__*/_react.default.createElement("div", {
|
|
73
75
|
className: "contentfieldset -template".concat(template, " "),
|
|
74
76
|
style: Object.assign(getContentStyle(props), styleContent)
|
|
75
77
|
}, children)));
|
package/lib/fieldset/types.d.ts
CHANGED
|
@@ -7,17 +7,25 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
require("../assets/styles/gridlayout.scss");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
|
|
10
|
+
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; }
|
|
11
|
+
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; }
|
|
12
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
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 => "row ".concat(props.customClass, "\n ").concat(props.itemsAlign ? "-items-".concat(props.itemsAlign) : '', "\n ").concat(props.withTrim && ' -withtrim', "\n ").concat(props.verticalAlign && " align-".concat(props.verticalAlign), "\n ").concat(props.horizontalAlign && " justify-content-".concat(props.horizontalAlign));
|
|
11
16
|
const GridRow = props => {
|
|
12
17
|
const {
|
|
13
18
|
style,
|
|
14
19
|
children,
|
|
20
|
+
itemsAlign = 'start',
|
|
15
21
|
visible = true
|
|
16
22
|
} = props;
|
|
17
23
|
if (!visible) return null;
|
|
18
24
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
19
25
|
style: style,
|
|
20
|
-
className: getClass(props)
|
|
26
|
+
className: getClass(_objectSpread(_objectSpread({}, props), {}, {
|
|
27
|
+
itemsAlign
|
|
28
|
+
}))
|
|
21
29
|
}, children);
|
|
22
30
|
};
|
|
23
31
|
var _default = exports.default = GridRow;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.showHintList = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
+
const showHintList = arrayHint => /*#__PURE__*/_react.default.createElement("div", {
|
|
10
|
+
className: "rules-list",
|
|
11
|
+
style: {
|
|
12
|
+
padding: '15px 0px'
|
|
13
|
+
}
|
|
14
|
+
}, /*#__PURE__*/_react.default.createElement("ul", {
|
|
15
|
+
style: {
|
|
16
|
+
listStyleType: 'none'
|
|
17
|
+
}
|
|
18
|
+
}, arrayHint.map((hint, index) => /*#__PURE__*/_react.default.createElement("li", {
|
|
19
|
+
key: index.toString()
|
|
20
|
+
}, "- ", hint))));
|
|
21
|
+
exports.showHintList = showHintList;
|
package/lib/hint/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HintProps } from './types.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
|
|
4
|
-
declare const Hint: ({ visible, description, customClass, skeletonize, style, }: HintProps) => JSX.Element | null;
|
|
4
|
+
declare const Hint: ({ visible, description, customClass, skeletonize, style, disabled, }: HintProps) => JSX.Element | null;
|
|
5
5
|
|
|
6
6
|
export { Hint as default };
|
package/lib/hint/index.js
CHANGED
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _helpers = require("./helpers");
|
|
8
9
|
require("../assets/styles/hint.scss");
|
|
9
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
11
|
const Hint = _ref => {
|
|
@@ -13,24 +14,13 @@ const Hint = _ref => {
|
|
|
13
14
|
description,
|
|
14
15
|
customClass,
|
|
15
16
|
skeletonize = false,
|
|
16
|
-
style
|
|
17
|
+
style,
|
|
18
|
+
disabled = false
|
|
17
19
|
} = _ref;
|
|
18
20
|
if (!visible || !description) return null;
|
|
19
|
-
const showHintList = arrayHint => /*#__PURE__*/_react.default.createElement("div", {
|
|
20
|
-
className: "rules-list",
|
|
21
|
-
style: {
|
|
22
|
-
padding: '15px 0px'
|
|
23
|
-
}
|
|
24
|
-
}, /*#__PURE__*/_react.default.createElement("ul", {
|
|
25
|
-
style: {
|
|
26
|
-
listStyleType: 'none'
|
|
27
|
-
}
|
|
28
|
-
}, arrayHint.map((hint, index) => /*#__PURE__*/_react.default.createElement("li", {
|
|
29
|
-
key: index.toString()
|
|
30
|
-
}, "- ", hint))));
|
|
31
21
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
32
22
|
style: style,
|
|
33
|
-
className: "\n hint-component\n ".concat(customClass, "\n ").concat(skeletonize ? '-skeletonized' : '', "\n ")
|
|
34
|
-
}, Array.isArray(description) ? showHintList(description) : /*#__PURE__*/_react.default.createElement("span", null, description));
|
|
23
|
+
className: "\n hint-component\n ".concat(customClass, "\n ").concat(skeletonize ? '-skeletonized' : '', "\n ").concat(disabled ? '-disabled' : '', "\n ")
|
|
24
|
+
}, Array.isArray(description) ? (0, _helpers.showHintList)(description) : /*#__PURE__*/_react.default.createElement("span", null, description));
|
|
35
25
|
};
|
|
36
26
|
var _default = exports.default = Hint;
|
package/lib/hint/types.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ var helpers = _interopRequireWildcard(require("./helpers"));
|
|
|
12
12
|
var _withTooltip = _interopRequireDefault(require("../../internals/withTooltip"));
|
|
13
13
|
var _permissionValidations = require("../../permissionValidations");
|
|
14
14
|
var _hint = _interopRequireDefault(require("../../hint"));
|
|
15
|
+
var _errorMessage = require("../errorMessage");
|
|
15
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
17
|
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); }
|
|
17
18
|
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; }
|
|
@@ -64,7 +65,8 @@ const InputTextBase = props => {
|
|
|
64
65
|
onDragOver,
|
|
65
66
|
onDrop,
|
|
66
67
|
onDragLeave,
|
|
67
|
-
readOnlyClass
|
|
68
|
+
readOnlyClass,
|
|
69
|
+
autoComplete = 'on'
|
|
68
70
|
} = props;
|
|
69
71
|
let propsInput;
|
|
70
72
|
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
|
|
@@ -175,11 +177,15 @@ const InputTextBase = props => {
|
|
|
175
177
|
rows: props.rows,
|
|
176
178
|
cols: props.cols
|
|
177
179
|
}, inputProps())) : /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
180
|
+
autoComplete: autoComplete,
|
|
178
181
|
tabIndex: applyTabIndex()
|
|
179
182
|
}, inputProps())), children), helpers.getRightElements(errorMessages || [], skeletonize, rightElements)), /*#__PURE__*/_react.default.createElement(_hint.default, {
|
|
183
|
+
disabled: disabled,
|
|
180
184
|
visible: !!hint,
|
|
181
185
|
customClass: "hint",
|
|
182
186
|
description: hint
|
|
183
|
-
}),
|
|
187
|
+
}), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
|
|
188
|
+
messages: errorMessages
|
|
189
|
+
}));
|
|
184
190
|
};
|
|
185
191
|
var _default = exports.default = (0, _inputHOC.default)((0, _withTooltip.default)(InputTextBase));
|
|
@@ -10,7 +10,6 @@ declare const getInputClass: ({ textAlign, readOnly, readOnlyClass, }: {
|
|
|
10
10
|
readOnlyClass?: string | undefined;
|
|
11
11
|
}) => string;
|
|
12
12
|
declare const getInputWrapperClass: (props: IBaseProps) => string;
|
|
13
|
-
declare const getErrorMessages: (messages: string[]) => JSX.Element;
|
|
14
13
|
declare const getRightElements: (errorMessages: string[], skeletonize: boolean, rightElements?: JSX.Element | JSX.Element[]) => JSX.Element[] | null;
|
|
15
14
|
|
|
16
|
-
export {
|
|
15
|
+
export { getInputClass, getInputWrapperClass, getRightElements };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.getRightElements = exports.getInputWrapperClass = exports.getInputClass =
|
|
6
|
+
exports.getRightElements = exports.getInputWrapperClass = exports.getInputClass = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -27,13 +27,6 @@ const getInputWrapperClass = props => {
|
|
|
27
27
|
return "inputwrapper ".concat(inputHasFocus && ' -focusable', "\n ").concat(customClassForWrapper, "\n ").concat(errorMessages && errorMessages.length > 0 && ' -requirederror', "\n ").concat(rounded && ' -roundedborders', "\n ").concat(disabled && ' -disabled');
|
|
28
28
|
};
|
|
29
29
|
exports.getInputWrapperClass = getInputWrapperClass;
|
|
30
|
-
const getErrorMessages = messages => {
|
|
31
|
-
if (!messages || messages.length === 0) return /*#__PURE__*/_react.default.createElement("noscript", null);
|
|
32
|
-
return /*#__PURE__*/_react.default.createElement("p", {
|
|
33
|
-
className: "errormessages"
|
|
34
|
-
}, messages.join(', '));
|
|
35
|
-
};
|
|
36
|
-
exports.getErrorMessages = getErrorMessages;
|
|
37
30
|
const getRightElements = (errorMessages, skeletonize, rightElements) => {
|
|
38
31
|
let elements = rightElements || [];
|
|
39
32
|
if (skeletonize) return null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { ErrorProps } from '../types.js';
|
|
3
|
+
import 'imask';
|
|
4
|
+
import '../../@types/PermissionAttr.js';
|
|
5
|
+
import '../../@types/DataCombo.js';
|
|
6
|
+
import '../base/types.js';
|
|
7
|
+
import '../../@types/Align.js';
|
|
8
|
+
import '../../@types/Period.js';
|
|
9
|
+
import '../../drawer/types.js';
|
|
10
|
+
import '../../@types/Position.js';
|
|
11
|
+
import '../../@types/Icon.js';
|
|
12
|
+
import '../../icons/helper.js';
|
|
13
|
+
|
|
14
|
+
declare const ErrorMessage: React__default.ForwardRefExoticComponent<ErrorProps & React__default.RefAttributes<HTMLParagraphElement>>;
|
|
15
|
+
|
|
16
|
+
export { ErrorMessage, ErrorMessage as default };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.ErrorMessage = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
require("../../assets/styles/error.scss");
|
|
9
|
+
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); }
|
|
10
|
+
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; }
|
|
11
|
+
const ErrorMessage = exports.ErrorMessage = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
12
|
+
let {
|
|
13
|
+
customClass = '',
|
|
14
|
+
messages: messagesProp,
|
|
15
|
+
style
|
|
16
|
+
} = _ref;
|
|
17
|
+
if (!messagesProp || messagesProp.length === 0) return null;
|
|
18
|
+
const messages = Array.isArray(messagesProp) ? messagesProp : [messagesProp];
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement("p", {
|
|
20
|
+
ref: ref,
|
|
21
|
+
style: style,
|
|
22
|
+
className: "errormessages-component ".concat(customClass)
|
|
23
|
+
}, messages.join(', '));
|
|
24
|
+
});
|
|
25
|
+
ErrorMessage.displayName = 'ErrorMessage';
|
|
26
|
+
var _default = exports.default = ErrorMessage;
|
|
@@ -12,7 +12,7 @@ require("../../assets/styles/file.scss");
|
|
|
12
12
|
var _buttons = _interopRequireDefault(require("../../buttons"));
|
|
13
13
|
var _icons = _interopRequireDefault(require("../../icons"));
|
|
14
14
|
var _popover = _interopRequireWildcard(require("../../popover"));
|
|
15
|
-
var
|
|
15
|
+
var _errorMessage = require("../errorMessage");
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
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); }
|
|
18
18
|
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; }
|
|
@@ -78,6 +78,8 @@ const DefaultFile = props => {
|
|
|
78
78
|
id: id,
|
|
79
79
|
onBtnClickInsert: () => onBtnClickInsert()
|
|
80
80
|
})
|
|
81
|
-
}), popUpDescription(), buttonRemoveFile()),
|
|
81
|
+
}), popUpDescription(), buttonRemoveFile()), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
|
|
82
|
+
messages: errorMessages
|
|
83
|
+
}));
|
|
82
84
|
};
|
|
83
85
|
var _default = exports.default = DefaultFile;
|
|
@@ -9,8 +9,8 @@ var _lodash = _interopRequireDefault(require("lodash"));
|
|
|
9
9
|
var _buttons = require("../../buttons");
|
|
10
10
|
var _icons = _interopRequireDefault(require("../../icons"));
|
|
11
11
|
var _InputTextBase = _interopRequireDefault(require("../base/InputTextBase"));
|
|
12
|
-
var helperBase = _interopRequireWildcard(require("../base/helpers"));
|
|
13
12
|
var _hint = _interopRequireDefault(require("../../hint"));
|
|
13
|
+
var _errorMessage = require("../errorMessage");
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
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); }
|
|
16
16
|
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; }
|
|
@@ -262,7 +262,9 @@ const DragDropFile = props => {
|
|
|
262
262
|
onDragLeave: handleDragLeave,
|
|
263
263
|
onDragOver: handleDragOver,
|
|
264
264
|
onDrop: handleDrop
|
|
265
|
-
})),
|
|
265
|
+
})), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
|
|
266
|
+
messages: errorMessages
|
|
267
|
+
}), /*#__PURE__*/_react.default.createElement(_hint.default, {
|
|
266
268
|
visible: !!hint,
|
|
267
269
|
customClass: "hint",
|
|
268
270
|
description: hint
|
package/lib/inputs/inputHOC.d.ts
CHANGED
package/lib/inputs/mask/Cpf.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export { default as PhoneField } from './Phone.js';
|
|
|
5
5
|
export { default as ZipCodeField } from './ZipCode.js';
|
|
6
6
|
import './types.js';
|
|
7
7
|
import 'react';
|
|
8
|
+
import 'imask';
|
|
8
9
|
import '../../@types/Align.js';
|
|
9
10
|
import '../../@types/PermissionAttr.js';
|
|
10
11
|
import '../base/types.js';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { KeyboardEvent, MutableRefObject } from 'react';
|
|
2
|
+
import IMask from 'imask';
|
|
2
3
|
import { TextAlign } from '../../@types/Align.js';
|
|
3
4
|
import { OnDenied, PermissionAttr } from '../../@types/PermissionAttr.js';
|
|
4
5
|
import { CustomInputEvent } from '../base/types.js';
|
|
@@ -9,7 +10,7 @@ interface IBaseMaskProps {
|
|
|
9
10
|
onBlur?: (e: CustomInputEvent) => void;
|
|
10
11
|
onKeyDown?: (e: CustomInputEvent | KeyboardEvent<Element>) => void;
|
|
11
12
|
defaultValue?: string;
|
|
12
|
-
mask?:
|
|
13
|
+
mask?: IMask.AnyMask;
|
|
13
14
|
isNumeric?: boolean;
|
|
14
15
|
scale?: number;
|
|
15
16
|
radix?: string;
|
|
@@ -47,6 +48,7 @@ interface IBaseMaskProps {
|
|
|
47
48
|
returnFormattedValueOnKeyDown?: boolean;
|
|
48
49
|
isDateField?: boolean;
|
|
49
50
|
autoCompleteMask?: 'left' | 'right';
|
|
51
|
+
definitions?: IMask.AllMaskedOptions['definitions'];
|
|
50
52
|
}
|
|
51
53
|
interface ICnpjFieldProps extends IBaseMaskProps {
|
|
52
54
|
value?: string;
|
|
@@ -20,22 +20,24 @@ const ActionButtons = _ref => {
|
|
|
20
20
|
dropdownAlignButton = 'left'
|
|
21
21
|
} = _ref;
|
|
22
22
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
23
|
+
transparent: true,
|
|
24
|
+
tabIndex: -1,
|
|
23
25
|
disabled: disabled,
|
|
26
|
+
boxShadow: false,
|
|
24
27
|
size: "small",
|
|
25
|
-
iconName: dropdownOpened ? 'up' : 'down',
|
|
26
28
|
onClick: handleOpenClose,
|
|
27
29
|
customClass: "actionbutton",
|
|
28
|
-
|
|
29
|
-
boxShadow: false
|
|
30
|
+
iconName: dropdownOpened ? 'up' : 'down'
|
|
30
31
|
}), /*#__PURE__*/_react.default.createElement(_buttons.default, {
|
|
31
|
-
|
|
32
|
-
iconName: "more1",
|
|
32
|
+
dropdown: true,
|
|
33
33
|
transparent: true,
|
|
34
|
+
disabled: disabled,
|
|
35
|
+
tabIndex: -1,
|
|
34
36
|
boxShadow: false,
|
|
37
|
+
showIconDropdown: false,
|
|
38
|
+
iconName: "more1",
|
|
35
39
|
customClass: "actionbutton",
|
|
36
|
-
|
|
37
|
-
dropdownAlign: dropdownAlignButton,
|
|
38
|
-
showIconDropdown: false
|
|
40
|
+
dropdownAlign: dropdownAlignButton
|
|
39
41
|
}, /*#__PURE__*/_react.default.createElement(_list.default, null, /*#__PURE__*/_react.default.createElement(_list.ListItem, {
|
|
40
42
|
itemId: "1",
|
|
41
43
|
text: "Marcar Todos",
|
|
@@ -94,11 +94,9 @@ const Dropdown = props => {
|
|
|
94
94
|
className: "listcontainer"
|
|
95
95
|
}, dataCombo && dataCombo.length > 0 && /*#__PURE__*/_react.default.createElement("div", {
|
|
96
96
|
className: "item selectall"
|
|
97
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
98
|
-
role: "button",
|
|
97
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
99
98
|
className: "menubutton",
|
|
100
99
|
tabIndex: -1,
|
|
101
|
-
onKeyPress: () => {},
|
|
102
100
|
onClick: () => isAllChecked ? onUncheckAll(true) : onCheckAll(true)
|
|
103
101
|
}, /*#__PURE__*/_react.default.createElement(_icons.default, {
|
|
104
102
|
name: isAllChecked && dataCombo.length > 0 ? 'checkboxChecked2' : 'checkboxUnchecked2',
|
|
@@ -110,11 +108,9 @@ const Dropdown = props => {
|
|
|
110
108
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
111
109
|
key: "dropdowmItem ".concat(item[idKey], "}"),
|
|
112
110
|
className: "item ".concat(isChecked && '-selected')
|
|
113
|
-
}, /*#__PURE__*/_react.default.createElement("
|
|
114
|
-
role: "button",
|
|
111
|
+
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
115
112
|
className: "menubutton",
|
|
116
113
|
tabIndex: -1,
|
|
117
|
-
onKeyPress: () => {},
|
|
118
114
|
onClick: () => {
|
|
119
115
|
onSelect(item);
|
|
120
116
|
}
|