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/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"
|
|
@@ -15,7 +15,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
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; }
|
|
17
17
|
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); }
|
|
18
|
-
const getFilesList = files => !files
|
|
18
|
+
const getFilesList = files => !(files !== null && files !== void 0 && files.length) ? [] : _lodash.default.map(files, file => file);
|
|
19
19
|
const getAcceptFilesLabel = valueAccept => valueAccept.split(',').map(value => value.includes('.') ? value.split('.')[1] : value.split('/')[1]).join(', ');
|
|
20
20
|
const getAcceptFilesWithoutRemoveText = value => value.split(', ');
|
|
21
21
|
const DragDropFile = props => {
|
|
@@ -48,8 +48,9 @@ const DragDropFile = props => {
|
|
|
48
48
|
error: false
|
|
49
49
|
});
|
|
50
50
|
const handleDrag = e => {
|
|
51
|
-
|
|
52
|
-
e.
|
|
51
|
+
var _e$preventDefault, _e$stopPropagation;
|
|
52
|
+
(_e$preventDefault = e.preventDefault) === null || _e$preventDefault === void 0 ? void 0 : _e$preventDefault.call(e);
|
|
53
|
+
(_e$stopPropagation = e.stopPropagation) === null || _e$stopPropagation === void 0 ? void 0 : _e$stopPropagation.call(e);
|
|
53
54
|
};
|
|
54
55
|
const checkTypeNotAccept = (types, getTypesArray, e) => {
|
|
55
56
|
setTypeNotAccept(false);
|
|
@@ -70,7 +71,7 @@ const DragDropFile = props => {
|
|
|
70
71
|
setMessage({
|
|
71
72
|
class: 'disapprovedFile',
|
|
72
73
|
text: 'Por favor, verifique a extensão do(s) arquivo(s) inserido(s).',
|
|
73
|
-
subtitle:
|
|
74
|
+
subtitle: "Apenas as extens\xF5es ".concat(getAcceptFilesLabel(accept), " s\xE3o permitidas."),
|
|
74
75
|
error: true
|
|
75
76
|
});
|
|
76
77
|
} else {
|
|
@@ -100,7 +101,7 @@ const DragDropFile = props => {
|
|
|
100
101
|
checkTypeNotAccept(arrayTypes, getTypesArray, e);
|
|
101
102
|
handleDrag(e);
|
|
102
103
|
setDragActive(true);
|
|
103
|
-
onDragEnter
|
|
104
|
+
onDragEnter === null || onDragEnter === void 0 ? void 0 : onDragEnter(e);
|
|
104
105
|
};
|
|
105
106
|
const handleDragLeave = e => {
|
|
106
107
|
setMessage({
|
|
@@ -111,11 +112,11 @@ const DragDropFile = props => {
|
|
|
111
112
|
});
|
|
112
113
|
handleDrag(e);
|
|
113
114
|
setDragActive(false);
|
|
114
|
-
onDragLeave
|
|
115
|
+
onDragLeave === null || onDragLeave === void 0 ? void 0 : onDragLeave(e);
|
|
115
116
|
};
|
|
116
117
|
const handleDragOver = e => {
|
|
117
118
|
handleDrag(e);
|
|
118
|
-
onDragOver
|
|
119
|
+
onDragOver === null || onDragOver === void 0 ? void 0 : onDragOver(e);
|
|
119
120
|
};
|
|
120
121
|
const handleDrop = e => {
|
|
121
122
|
handleDrag(e);
|
|
@@ -133,8 +134,8 @@ const DragDropFile = props => {
|
|
|
133
134
|
return !ids.includes(name, index + 1);
|
|
134
135
|
});
|
|
135
136
|
setFileList(filtered);
|
|
136
|
-
onChange
|
|
137
|
-
onDrop
|
|
137
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(files, e);
|
|
138
|
+
onDrop === null || onDrop === void 0 ? void 0 : onDrop(e);
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
141
|
setMessage({
|
|
@@ -145,7 +146,8 @@ const DragDropFile = props => {
|
|
|
145
146
|
});
|
|
146
147
|
};
|
|
147
148
|
const handleChange = e => {
|
|
148
|
-
|
|
149
|
+
var _e$preventDefault2;
|
|
150
|
+
(_e$preventDefault2 = e.preventDefault) === null || _e$preventDefault2 === void 0 ? void 0 : _e$preventDefault2.call(e);
|
|
149
151
|
const files = getFilesList(e.target.files);
|
|
150
152
|
if (files.length > 0 && !typeNotAccept) {
|
|
151
153
|
const fileNoRepeat = fileList.concat(files);
|
|
@@ -157,7 +159,7 @@ const DragDropFile = props => {
|
|
|
157
159
|
return !ids.includes(name, index + 1);
|
|
158
160
|
});
|
|
159
161
|
setFileList(filesFiltered);
|
|
160
|
-
onChange
|
|
162
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(files, e);
|
|
161
163
|
}
|
|
162
164
|
};
|
|
163
165
|
const onButtonClickRemoveAll = () => setFileList([]);
|
|
@@ -165,7 +167,7 @@ const DragDropFile = props => {
|
|
|
165
167
|
setFileList(prevState => prevState.filter(file => file.name !== fileName));
|
|
166
168
|
};
|
|
167
169
|
const generateListArray = () => {
|
|
168
|
-
if (fileList
|
|
170
|
+
if ((fileList === null || fileList === void 0 ? void 0 : fileList.length) === 1) {
|
|
169
171
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, fileList[0].type === 'image/jpeg' || fileList[0].type === 'image/png' ? /*#__PURE__*/_react.default.createElement("img", {
|
|
170
172
|
alt: fileList[0].name,
|
|
171
173
|
src: URL.createObjectURL(fileList[0])
|
|
@@ -183,7 +185,7 @@ const DragDropFile = props => {
|
|
|
183
185
|
return /*#__PURE__*/_react.default.createElement("ul", {
|
|
184
186
|
className: "file-list"
|
|
185
187
|
}, fileList.length > 0 && fileList.map(file => /*#__PURE__*/_react.default.createElement("li", {
|
|
186
|
-
key:
|
|
188
|
+
key: "".concat(file.name).concat(file.size),
|
|
187
189
|
className: "file-card"
|
|
188
190
|
}, /*#__PURE__*/_react.default.createElement(_buttons.DangerButton, {
|
|
189
191
|
transparent: true,
|
|
@@ -211,9 +213,9 @@ const DragDropFile = props => {
|
|
|
211
213
|
onDragEnter: handleDragEnter,
|
|
212
214
|
onSubmit: e => e.preventDefault()
|
|
213
215
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
214
|
-
className:
|
|
216
|
+
className: "drag-content ".concat(skeletonize ? '-skeletonized' : '')
|
|
215
217
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
216
|
-
className:
|
|
218
|
+
className: "".concat(message.class, " ").concat(!skeletonize ? 'content' : '')
|
|
217
219
|
}, message.error || fileList.length === 0 ? /*#__PURE__*/_react.default.createElement("label", {
|
|
218
220
|
htmlFor: id
|
|
219
221
|
}, /*#__PURE__*/_react.default.createElement("h1", {
|
package/lib/inputs/file/File.js
CHANGED
|
@@ -26,7 +26,8 @@ const File = _ref => {
|
|
|
26
26
|
rest = _objectWithoutProperties(_ref, _excluded);
|
|
27
27
|
const inputFileRef = (0, _react.useRef)(null);
|
|
28
28
|
const onBtnClickInsert = () => {
|
|
29
|
-
|
|
29
|
+
var _inputFileRef$current;
|
|
30
|
+
(_inputFileRef$current = inputFileRef.current) === null || _inputFileRef$current === void 0 ? void 0 : _inputFileRef$current.click();
|
|
30
31
|
};
|
|
31
32
|
const onBtnClickRemove = () => {
|
|
32
33
|
if (inputFileRef.current) {
|
|
@@ -35,10 +36,10 @@ const File = _ref => {
|
|
|
35
36
|
if (onBtnClickRemoveProp) onBtnClickRemoveProp();
|
|
36
37
|
};
|
|
37
38
|
(0, _react.useEffect)(() => {
|
|
38
|
-
if (inputFileRef
|
|
39
|
+
if (inputFileRef !== null && inputFileRef !== void 0 && inputFileRef.current && defaultFiles) {
|
|
39
40
|
inputFileRef.current.files = (0, _helpers.transformFilesToFileList)(defaultFiles);
|
|
40
41
|
}
|
|
41
|
-
}, [inputFileRef
|
|
42
|
+
}, [inputFileRef === null || inputFileRef === void 0 ? void 0 : inputFileRef.current]);
|
|
42
43
|
const component = applyDragDrop ? /*#__PURE__*/_react.default.createElement(_DragDropFile.default, _extends({}, rest, {
|
|
43
44
|
defaultFiles: defaultFiles,
|
|
44
45
|
inputRef: inputFileRef,
|
|
@@ -149,7 +149,7 @@ const BaseMask = _ref => {
|
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
151
|
(0, _react.useEffect)(() => {
|
|
152
|
-
if (typeof valueProp === 'number') setTypedValue(valueProp);else setValue(valueProp
|
|
152
|
+
if (typeof valueProp === 'number') setTypedValue(valueProp);else setValue(valueProp !== null && valueProp !== void 0 ? valueProp : '');
|
|
153
153
|
}, [valueProp]);
|
|
154
154
|
return /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({
|
|
155
155
|
inputRef: r => {
|
|
@@ -16,16 +16,17 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
|
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
17
17
|
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); }
|
|
18
18
|
const returnDropdownDynamicStyles = (selectFieldRef, dropdownMaxHeight) => {
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const
|
|
19
|
+
var _selectFieldRef$curre, _selectFieldRef$curre2, _selectFieldRef$curre3;
|
|
20
|
+
const selectFieldRects = selectFieldRef === null || selectFieldRef === void 0 ? void 0 : (_selectFieldRef$curre = selectFieldRef.current) === null || _selectFieldRef$curre === void 0 ? void 0 : _selectFieldRef$curre.getBoundingClientRect();
|
|
21
|
+
const bottom = selectFieldRects !== null && selectFieldRects !== void 0 && selectFieldRects.bottom ? selectFieldRects === null || selectFieldRects === void 0 ? void 0 : selectFieldRects.bottom : 0;
|
|
22
|
+
const offsetTop = selectFieldRef !== null && selectFieldRef !== void 0 && (_selectFieldRef$curre2 = selectFieldRef.current) !== null && _selectFieldRef$curre2 !== void 0 && _selectFieldRef$curre2.offsetTop ? selectFieldRef === null || selectFieldRef === void 0 ? void 0 : (_selectFieldRef$curre3 = selectFieldRef.current) === null || _selectFieldRef$curre3 === void 0 ? void 0 : _selectFieldRef$curre3.offsetTop : 0;
|
|
22
23
|
const dropdownBottomDistance = window.innerHeight - bottom;
|
|
23
24
|
let maxDropdownBottomDistance = 200;
|
|
24
25
|
let height = dropdownMaxHeight;
|
|
25
26
|
let dropdownPosition;
|
|
26
27
|
if (!height || height <= 0) {
|
|
27
28
|
if (dropdownBottomDistance < maxDropdownBottomDistance) {
|
|
28
|
-
height = selectFieldRects
|
|
29
|
+
height = selectFieldRects !== null && selectFieldRects !== void 0 && selectFieldRects.top ? selectFieldRects.top : 0;
|
|
29
30
|
dropdownPosition = window.innerHeight - offsetTop + 10;
|
|
30
31
|
} else {
|
|
31
32
|
height = dropdownBottomDistance;
|
|
@@ -37,8 +38,8 @@ const returnDropdownDynamicStyles = (selectFieldRef, dropdownMaxHeight) => {
|
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
return {
|
|
40
|
-
maxHeight:
|
|
41
|
-
bottom:
|
|
41
|
+
maxHeight: "".concat(height - 30, "px"),
|
|
42
|
+
bottom: "".concat(dropdownPosition, "px")
|
|
42
43
|
};
|
|
43
44
|
};
|
|
44
45
|
const Dropdown = props => {
|
|
@@ -102,11 +103,11 @@ const Dropdown = props => {
|
|
|
102
103
|
customClass: "checkboxicon"
|
|
103
104
|
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
104
105
|
className: "label"
|
|
105
|
-
}, inputValue !== '' ? 'Selecionar todos pesquisados' : 'Selecionar Todos'))), dataCombo
|
|
106
|
+
}, inputValue !== '' ? 'Selecionar todos pesquisados' : 'Selecionar Todos'))), dataCombo === null || dataCombo === void 0 ? void 0 : dataCombo.map(item => {
|
|
106
107
|
const isChecked = selecteds ? selecteds.find(selected => selected[idKey] === item[idKey]) : undefined;
|
|
107
108
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
108
|
-
key:
|
|
109
|
-
className:
|
|
109
|
+
key: "dropdowmItem ".concat(item[idKey], "}"),
|
|
110
|
+
className: "item ".concat(isChecked && '-selected')
|
|
110
111
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
111
112
|
className: "menubutton",
|
|
112
113
|
tabIndex: -1,
|
|
@@ -11,10 +11,11 @@ const getFilteredDataCombo = _ref => {
|
|
|
11
11
|
inputText
|
|
12
12
|
} = _ref;
|
|
13
13
|
return dataSource.filter(item => {
|
|
14
|
+
var _descriptionKey;
|
|
14
15
|
if (typeof descriptionKey === 'string') {
|
|
15
16
|
return item[descriptionKey].toLowerCase().indexOf(inputText.toLowerCase()) > -1;
|
|
16
17
|
}
|
|
17
|
-
return descriptionKey(item)
|
|
18
|
+
return ((_descriptionKey = descriptionKey(item)) === null || _descriptionKey === void 0 ? void 0 : _descriptionKey.toLowerCase().indexOf(inputText.toLowerCase())) > -1;
|
|
18
19
|
});
|
|
19
20
|
};
|
|
20
21
|
var _default = exports.default = getFilteredDataCombo;
|
|
@@ -33,7 +33,7 @@ const MultiSelectField = props => {
|
|
|
33
33
|
gridLayout,
|
|
34
34
|
dropdownAlignButton = 'left'
|
|
35
35
|
} = props;
|
|
36
|
-
const componentId =
|
|
36
|
+
const componentId = "multiSelect-component".concat(uuid.v1());
|
|
37
37
|
const [dataCombo, setDataCombo] = (0, _react.useState)(dataSource);
|
|
38
38
|
const [selecteds, setSelecteds] = (0, _react.useState)();
|
|
39
39
|
const [inputValue, setInputValue] = (0, _react.useState)('');
|
|
@@ -68,8 +68,8 @@ const MultiSelectField = props => {
|
|
|
68
68
|
};
|
|
69
69
|
const onMouseMove = event => {
|
|
70
70
|
const target = event.target;
|
|
71
|
-
if (target
|
|
72
|
-
const newInsideComponent = ['item', 'menubutton', 'filterinput', 'filtercontainer', 'label'].includes(target
|
|
71
|
+
if ((target === null || target === void 0 ? void 0 : target.className) === '') return;
|
|
72
|
+
const newInsideComponent = ['item', 'menubutton', 'filterinput', 'filtercontainer', 'label'].includes(target === null || target === void 0 ? void 0 : target.className);
|
|
73
73
|
setInsideComponent(newInsideComponent);
|
|
74
74
|
};
|
|
75
75
|
const onBlurComponent = e => {
|
|
@@ -109,10 +109,11 @@ const MultiSelectField = props => {
|
|
|
109
109
|
if (selectWrapper.current) setDropdownWidth(selectWrapper.current.clientWidth);
|
|
110
110
|
};
|
|
111
111
|
const onClickOutSide = event => {
|
|
112
|
+
var _componentRef$current;
|
|
112
113
|
const {
|
|
113
114
|
target
|
|
114
115
|
} = event;
|
|
115
|
-
if (target !== componentRef.current && !componentRef.current
|
|
116
|
+
if (target !== componentRef.current && !((_componentRef$current = componentRef.current) !== null && _componentRef$current !== void 0 && _componentRef$current.contains(target))) {
|
|
116
117
|
setOpened(false);
|
|
117
118
|
setDataCombo(dataSource);
|
|
118
119
|
setInputValue('');
|
|
@@ -138,7 +139,8 @@ const MultiSelectField = props => {
|
|
|
138
139
|
};
|
|
139
140
|
(0, _react.useEffect)(() => {
|
|
140
141
|
if (gridLayout) {
|
|
141
|
-
|
|
142
|
+
var _selectWrapper$curren;
|
|
143
|
+
const currentGridEl = (_selectWrapper$curren = selectWrapper.current) === null || _selectWrapper$curren === void 0 ? void 0 : _selectWrapper$curren.parentElement;
|
|
142
144
|
if (currentGridEl) setElementStyles(window.getComputedStyle(currentGridEl));
|
|
143
145
|
}
|
|
144
146
|
window.addEventListener('resize', onScreenResize);
|
|
@@ -152,10 +154,10 @@ const MultiSelectField = props => {
|
|
|
152
154
|
}, []);
|
|
153
155
|
(0, _react.useEffect)(() => {
|
|
154
156
|
if (dataSource && dataSource.length > 0) {
|
|
155
|
-
const newSelecteds = dataSource.filter(item => value
|
|
157
|
+
const newSelecteds = dataSource.filter(item => value === null || value === void 0 ? void 0 : value.includes(item[idKey]));
|
|
156
158
|
setSelecteds(newSelecteds);
|
|
157
159
|
}
|
|
158
|
-
}, [value
|
|
160
|
+
}, [value === null || value === void 0 ? void 0 : value.length, dataSource === null || dataSource === void 0 ? void 0 : dataSource.length]);
|
|
159
161
|
(0, _react.useEffect)(() => {
|
|
160
162
|
if (dataSource && dataCombo && !_lodash.default.isEqual(dataSource, dataCombo)) {
|
|
161
163
|
const newDataCombo = (0, _helper.default)(_objectSpread(_objectSpread({}, props), {}, {
|
|
@@ -12,6 +12,6 @@ import '../../drawer/types.js';
|
|
|
12
12
|
import '../../@types/Icon.js';
|
|
13
13
|
import '../../icons/helper.js';
|
|
14
14
|
|
|
15
|
-
declare const BaseNumber: (
|
|
15
|
+
declare const BaseNumber: (props: IBaseNumberProps) => JSX.Element;
|
|
16
16
|
|
|
17
17
|
export { BaseNumber as default };
|
|
@@ -7,11 +7,8 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _BaseMask = _interopRequireDefault(require("../mask/BaseMask"));
|
|
9
9
|
var _format_number = require("./format_number");
|
|
10
|
-
const _excluded = ["value"];
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
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); }
|
|
13
|
-
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; }
|
|
14
|
-
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; }
|
|
15
12
|
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; }
|
|
16
13
|
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; }
|
|
17
14
|
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; }
|
|
@@ -57,17 +54,13 @@ const getEventProps = props => {
|
|
|
57
54
|
}
|
|
58
55
|
};
|
|
59
56
|
};
|
|
60
|
-
const BaseNumber =
|
|
61
|
-
let {
|
|
62
|
-
value
|
|
63
|
-
} = _ref,
|
|
64
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
57
|
+
const BaseNumber = props => {
|
|
65
58
|
const eventProps = _objectSpread(_objectSpread({}, props), {}, {
|
|
66
59
|
returnFormattedValueOnBlur: true,
|
|
67
60
|
returnFormattedValueOnKeyDown: true
|
|
68
61
|
});
|
|
69
62
|
return /*#__PURE__*/_react.default.createElement(_BaseMask.default, _extends({
|
|
70
|
-
value: (0, _format_number.numberToPtBR)(value
|
|
63
|
+
value: (0, _format_number.numberToPtBR)(props.value),
|
|
71
64
|
thousandsSeparator: ".",
|
|
72
65
|
radix: ",",
|
|
73
66
|
mask: Number,
|
|
@@ -12,6 +12,6 @@ import '../../drawer/types.js';
|
|
|
12
12
|
import '../../@types/Icon.js';
|
|
13
13
|
import '../../icons/helper.js';
|
|
14
14
|
|
|
15
|
-
declare const CurrencyField: (
|
|
15
|
+
declare const CurrencyField: (props: ICurrencyProps) => JSX.Element;
|
|
16
16
|
|
|
17
17
|
export { CurrencyField as default };
|
|
@@ -6,24 +6,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _BaseNumber = _interopRequireDefault(require("./BaseNumber"));
|
|
9
|
-
const _excluded = ["displayCurrencySymbol"];
|
|
10
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
10
|
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); }
|
|
12
|
-
|
|
13
|
-
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; }
|
|
14
|
-
const CurrencyField = _ref => {
|
|
15
|
-
let {
|
|
16
|
-
displayCurrencySymbol
|
|
17
|
-
} = _ref,
|
|
18
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
11
|
+
const CurrencyField = props => {
|
|
19
12
|
const {
|
|
20
13
|
currencySymbol = 'R$'
|
|
21
14
|
} = props;
|
|
22
|
-
const leftElements = displayCurrencySymbol ? /*#__PURE__*/_react.default.createElement("span", {
|
|
15
|
+
const leftElements = props.displayCurrencySymbol ? /*#__PURE__*/_react.default.createElement("span", {
|
|
23
16
|
className: "currency-symbol"
|
|
24
17
|
}, currencySymbol) : [];
|
|
25
|
-
return /*#__PURE__*/_react.default.createElement(_BaseNumber.default, _extends({
|
|
18
|
+
return /*#__PURE__*/_react.default.createElement(_BaseNumber.default, _extends({}, props, {
|
|
26
19
|
leftElements: leftElements
|
|
27
|
-
}
|
|
20
|
+
}));
|
|
28
21
|
};
|
|
29
22
|
var _default = exports.default = CurrencyField;
|
|
@@ -48,7 +48,7 @@ const NumberField = props => {
|
|
|
48
48
|
if (props.onChange) props.onChange(event);
|
|
49
49
|
};
|
|
50
50
|
(0, _react.useEffect)(() => {
|
|
51
|
-
setNumberValue(value
|
|
51
|
+
setNumberValue(value.toString());
|
|
52
52
|
}, [value]);
|
|
53
53
|
return /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({}, props, {
|
|
54
54
|
value: numberValue,
|
|
@@ -42,7 +42,7 @@ const PeriodList = _ref => {
|
|
|
42
42
|
role: "button",
|
|
43
43
|
tabIndex: -1,
|
|
44
44
|
onKeyDown: () => {},
|
|
45
|
-
key:
|
|
45
|
+
key: "item-".concat(item.id),
|
|
46
46
|
className: (0, _helper.getDropdownItemCssClass)(itemSelected),
|
|
47
47
|
onClick: () => {
|
|
48
48
|
const dates = item.id !== 'custom' ? (0, _helper.CalcDatesByPeriod)(item.id) : null;
|
|
@@ -12,9 +12,7 @@ const getCalendarDropdownStyle = _ref => {
|
|
|
12
12
|
leftPosition,
|
|
13
13
|
width
|
|
14
14
|
} = _ref;
|
|
15
|
-
return
|
|
16
|
-
left: ${leftPosition}px;
|
|
17
|
-
width:${width}px`;
|
|
15
|
+
return "top: ".concat(topPosition, "px;\n left: ").concat(leftPosition, "px;\n width:").concat(width, "px");
|
|
18
16
|
};
|
|
19
17
|
var _default = exports.default = getCalendarDropdownStyle;
|
|
20
18
|
const getDropdownItemCssClass = function () {
|
|
@@ -55,7 +55,8 @@ const PeriodPicker = props => {
|
|
|
55
55
|
const dropdownPeriodContainer = (0, _react.useRef)(null);
|
|
56
56
|
const inputFinalRef = (0, _react.useRef)(null);
|
|
57
57
|
const onScreenResize = () => {
|
|
58
|
-
|
|
58
|
+
var _inputContainerRef$cu;
|
|
59
|
+
const inputDimensionsAux = inputContainerRef === null || inputContainerRef === void 0 ? void 0 : (_inputContainerRef$cu = inputContainerRef.current) === null || _inputContainerRef$cu === void 0 ? void 0 : _inputContainerRef$cu.getBoundingClientRect();
|
|
59
60
|
setInputDimensions(inputDimensionsAux);
|
|
60
61
|
};
|
|
61
62
|
const onClickOutside = event => {
|
|
@@ -158,11 +159,12 @@ const PeriodPicker = props => {
|
|
|
158
159
|
}
|
|
159
160
|
};
|
|
160
161
|
const setValue = function (event, value) {
|
|
162
|
+
var _inputInitialRef$curr, _inputFinalRef$curren;
|
|
161
163
|
let shouldOpenDropdown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
162
164
|
const valueDateName = event ? event.target.name : '';
|
|
163
165
|
const dateObj = (0, _moment.default)(value, 'DD/MM/YYYY');
|
|
164
|
-
if (showCalendarValueInitial) inputInitialRef.current
|
|
165
|
-
if (showCalendarValueFinal) inputFinalRef.current
|
|
166
|
+
if (showCalendarValueInitial) (_inputInitialRef$curr = inputInitialRef.current) === null || _inputInitialRef$curr === void 0 ? void 0 : _inputInitialRef$curr.focus();
|
|
167
|
+
if (showCalendarValueFinal) (_inputFinalRef$curren = inputFinalRef.current) === null || _inputFinalRef$curren === void 0 ? void 0 : _inputFinalRef$curren.focus();
|
|
166
168
|
if (valueDateName === 'valueFinal' && valueInitial && dateObj.isBefore(valueInitial)) {
|
|
167
169
|
setValueInitial(dateObj);
|
|
168
170
|
setValueFinal(valueInitial);
|
|
@@ -191,7 +193,8 @@ const PeriodPicker = props => {
|
|
|
191
193
|
});
|
|
192
194
|
}
|
|
193
195
|
if (valueDateName === 'valueInitial' && !valueFinal && shouldOpenDropdown) {
|
|
194
|
-
|
|
196
|
+
var _inputFinalRef$curren2;
|
|
197
|
+
(_inputFinalRef$curren2 = inputFinalRef.current) === null || _inputFinalRef$curren2 === void 0 ? void 0 : _inputFinalRef$curren2.focus();
|
|
195
198
|
setTimeout(() => setShowCalendarValueFinal(true), 100);
|
|
196
199
|
}
|
|
197
200
|
if (shouldCloseOnSelect) {
|
|
@@ -214,7 +217,8 @@ const PeriodPicker = props => {
|
|
|
214
217
|
name: "calendar"
|
|
215
218
|
}),
|
|
216
219
|
onClick: () => {
|
|
217
|
-
|
|
220
|
+
var _inputInitialRef$curr2;
|
|
221
|
+
(_inputInitialRef$curr2 = inputInitialRef.current) === null || _inputInitialRef$curr2 === void 0 ? void 0 : _inputInitialRef$curr2.focus();
|
|
218
222
|
openCalendar('valueInitial');
|
|
219
223
|
},
|
|
220
224
|
customClass: "calendar-button",
|
|
@@ -265,7 +269,8 @@ const PeriodPicker = props => {
|
|
|
265
269
|
});
|
|
266
270
|
const setPeriodDates = (selected, dates) => {
|
|
267
271
|
if (selected === 'custom') {
|
|
268
|
-
|
|
272
|
+
var _inputInitialRef$curr3;
|
|
273
|
+
(_inputInitialRef$curr3 = inputInitialRef.current) === null || _inputInitialRef$curr3 === void 0 ? void 0 : _inputInitialRef$curr3.focus();
|
|
269
274
|
setValuePeriodSelection(selected);
|
|
270
275
|
setShowPeriodSelection(false);
|
|
271
276
|
return;
|
|
@@ -339,14 +344,14 @@ const PeriodPicker = props => {
|
|
|
339
344
|
}, props.label && /*#__PURE__*/_react.default.createElement("div", {
|
|
340
345
|
className: "labelcontainer"
|
|
341
346
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
342
|
-
className:
|
|
347
|
+
className: "label ".concat(props.customClassForLabel, " ").concat(props.labelUppercase && ' -uppercase')
|
|
343
348
|
}, props.label, props.required && /*#__PURE__*/_react.default.createElement("span", {
|
|
344
349
|
className: "-requiredlabel"
|
|
345
350
|
}, "*"))), /*#__PURE__*/_react.default.createElement("div", {
|
|
346
|
-
className:
|
|
351
|
+
className: "periodpicker-component ".concat(helperBase.getInputWrapperClass(_objectSpread(_objectSpread({}, props), {}, {
|
|
347
352
|
value: !valueInitial ? '' : (0, _moment.default)(valueInitial).format('DD/MM/YYYY'),
|
|
348
353
|
disabled: shouldDisable()
|
|
349
|
-
}))
|
|
354
|
+
}))),
|
|
350
355
|
ref: inputContainerRef
|
|
351
356
|
}, /*#__PURE__*/_react.default.createElement(_BaseMask.default, {
|
|
352
357
|
permissionAttr: props.permissionAttr,
|
|
@@ -49,7 +49,7 @@ const SearchField = props => {
|
|
|
49
49
|
};
|
|
50
50
|
const shouldDisable = () => props.disabled || onDenied && (onDenied.disabled || onDenied.hideContent);
|
|
51
51
|
const shouldBeReadOnly = () => props.readOnly || onDenied && onDenied.readOnly;
|
|
52
|
-
const hideContent = onDenied
|
|
52
|
+
const hideContent = onDenied === null || onDenied === void 0 ? void 0 : onDenied.hideContent;
|
|
53
53
|
const buttonProps = () => {
|
|
54
54
|
const disableCallbacks = shouldBeReadOnly() || shouldDisable() || hideContent;
|
|
55
55
|
let propsButton = {
|
|
@@ -80,7 +80,7 @@ const Dropdown = props => {
|
|
|
80
80
|
const disabled = currents && currents.length > 0 ? currents.some(s => s[idKey] === item[idKey]) : false;
|
|
81
81
|
const itemSelected = Boolean(selected && selected[idKey] === item[idKey]);
|
|
82
82
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
83
|
-
key:
|
|
83
|
+
key: "dropdowmIten ".concat(item[idKey], "}"),
|
|
84
84
|
className: helper.getDropdownItemCssClass(itemSelected, disabled, striped)
|
|
85
85
|
}, /*#__PURE__*/_react.default.createElement("button", {
|
|
86
86
|
className: "menubutton",
|