linear-react-components-ui 1.1.20-beta.4 → 1.1.20-beta.40

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.
Files changed (165) hide show
  1. package/lib/alerts/BaseAlert.js +1 -1
  2. package/lib/alerts/Message.js +1 -1
  3. package/lib/assets/styles/input.scss +2 -2
  4. package/lib/assets/styles/popover.scss +3 -0
  5. package/lib/assets/styles/select.scss +2 -1
  6. package/lib/assets/styles/wizard.scss +212 -0
  7. package/lib/avatar/index.js +9 -8
  8. package/lib/badge/index.js +4 -4
  9. package/lib/buttons/DangerButton.js +1 -1
  10. package/lib/buttons/DefaultButton.js +24 -4
  11. package/lib/buttons/InfoButton.js +1 -1
  12. package/lib/buttons/PrimaryButton.js +1 -1
  13. package/lib/buttons/SuccessButton.js +1 -1
  14. package/lib/buttons/WarningButton.js +1 -1
  15. package/lib/buttons/button_container/index.js +1 -1
  16. package/lib/buttons/split_button/index.js +1 -1
  17. package/lib/calendar/base/Day.js +1 -1
  18. package/lib/calendar/base/Month.js +1 -1
  19. package/lib/calendar/base/helpers.js +2 -2
  20. package/lib/calendar/base/index.js +1 -1
  21. package/lib/checkbox/index.js +46 -19
  22. package/lib/checkbox/types.d.ts +4 -0
  23. package/lib/dialog/Custom.js +4 -2
  24. package/lib/dialog/Question.js +18 -2
  25. package/lib/dialog/base/Content.d.ts +1 -1
  26. package/lib/dialog/base/Content.js +3 -2
  27. package/lib/dialog/base/Header.js +2 -2
  28. package/lib/dialog/base/index.js +12 -9
  29. package/lib/dialog/form/index.js +8 -3
  30. package/lib/dialog/types.d.ts +42 -4
  31. package/lib/dialog/wizard/index.d.ts +13 -0
  32. package/lib/dialog/wizard/index.js +80 -0
  33. package/lib/dialog/wizard/progressbar.d.ts +14 -0
  34. package/lib/dialog/wizard/progressbar.js +38 -0
  35. package/lib/dialog/wizard/step.d.ts +9 -0
  36. package/lib/dialog/wizard/step.js +22 -0
  37. package/lib/dialog/wizard/useWizard.d.ts +9 -0
  38. package/lib/dialog/wizard/useWizard.js +48 -0
  39. package/lib/drawer/Drawer.js +3 -3
  40. package/lib/drawer/Header.js +1 -1
  41. package/lib/dropdown/Popup.js +6 -6
  42. package/lib/dropdown/helper.js +1 -1
  43. package/lib/dropdown/withDropdown.js +2 -2
  44. package/lib/fieldset/index.js +7 -7
  45. package/lib/form/FieldArray.js +1 -1
  46. package/lib/form/FieldNumber.js +7 -10
  47. package/lib/form/FieldPeriod.js +2 -2
  48. package/lib/form/index.js +20 -15
  49. package/lib/form/types.d.ts +14 -1
  50. package/lib/gridlayout/GridCol.js +5 -5
  51. package/lib/gridlayout/GridRow.js +4 -1
  52. package/lib/hint/index.js +7 -1
  53. package/lib/icons/helper.d.ts +20 -0
  54. package/lib/icons/helper.js +20 -0
  55. package/lib/icons/index.js +24 -27
  56. package/lib/inputs/base/InputTextBase.js +39 -15
  57. package/lib/inputs/base/Label.js +1 -1
  58. package/lib/inputs/base/helpers.js +7 -3
  59. package/lib/inputs/base/types.d.ts +3 -0
  60. package/lib/inputs/color/types.d.ts +5 -0
  61. package/lib/inputs/date/helpers.js +4 -1
  62. package/lib/inputs/date/index.js +9 -15
  63. package/lib/inputs/date/types.d.ts +4 -0
  64. package/lib/inputs/errorMessage/index.js +1 -1
  65. package/lib/inputs/file/DefaultFile.js +5 -6
  66. package/lib/inputs/file/DragDropFile.js +17 -18
  67. package/lib/inputs/file/File.js +3 -4
  68. package/lib/inputs/file/types.d.ts +3 -0
  69. package/lib/inputs/mask/BaseMask.js +4 -1
  70. package/lib/inputs/mask/helpers.d.ts +4 -0
  71. package/lib/inputs/mask/types.d.ts +4 -0
  72. package/lib/inputs/multiSelect/Dropdown.js +9 -10
  73. package/lib/inputs/multiSelect/helper.js +1 -2
  74. package/lib/inputs/multiSelect/index.js +7 -9
  75. package/lib/inputs/multiSelect/types.d.ts +4 -0
  76. package/lib/inputs/number/BaseNumber.d.ts +1 -1
  77. package/lib/inputs/number/Currency.d.ts +1 -1
  78. package/lib/inputs/number/Decimal.d.ts +1 -1
  79. package/lib/inputs/number/index.d.ts +1 -1
  80. package/lib/inputs/number/index.js +8 -4
  81. package/lib/inputs/number/types.d.ts +14 -2
  82. package/lib/inputs/period/PeriodList.js +1 -1
  83. package/lib/inputs/period/helper.js +3 -1
  84. package/lib/inputs/period/index.js +40 -18
  85. package/lib/inputs/period/types.d.ts +3 -0
  86. package/lib/inputs/search/index.js +1 -1
  87. package/lib/inputs/select/Dropdown.js +1 -1
  88. package/lib/inputs/select/helper.js +10 -13
  89. package/lib/inputs/select/multiple/Selecteds.js +1 -1
  90. package/lib/inputs/select/multiple/index.js +22 -18
  91. package/lib/inputs/select/simple/index.js +15 -20
  92. package/lib/inputs/select/types.d.ts +7 -0
  93. package/lib/inputs/textarea/index.js +1 -1
  94. package/lib/internals/withTooltip.js +9 -9
  95. package/lib/labelMessages/index.js +4 -3
  96. package/lib/labels/DefaultLabel.js +4 -1
  97. package/lib/labels/label_container/index.js +1 -1
  98. package/lib/list/Header.d.ts +1 -0
  99. package/lib/list/Header.js +1 -1
  100. package/lib/list/Item.d.ts +6 -2
  101. package/lib/list/Item.js +36 -14
  102. package/lib/list/helpers.d.ts +1 -0
  103. package/lib/list/index.d.ts +1 -0
  104. package/lib/list/index.js +3 -2
  105. package/lib/list/types.d.ts +8 -1
  106. package/lib/menus/float/MenuItem.js +2 -2
  107. package/lib/menus/float/SubMenuContainer.js +1 -1
  108. package/lib/menus/float/index.js +1 -1
  109. package/lib/menus/sidenav/ExpandMenu.js +1 -1
  110. package/lib/menus/sidenav/NavMenuGroup.js +1 -1
  111. package/lib/menus/sidenav/NavMenuItem.js +27 -25
  112. package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
  113. package/lib/menus/sidenav/helpers.js +1 -1
  114. package/lib/menus/sidenav/index.js +39 -31
  115. package/lib/menus/sidenav/types.d.ts +1 -0
  116. package/lib/panel/Content.js +5 -7
  117. package/lib/panel/Default.js +2 -2
  118. package/lib/panel/Header.js +3 -3
  119. package/lib/permissionValidations.js +1 -1
  120. package/lib/popover/index.js +4 -6
  121. package/lib/popover/types.d.ts +2 -1
  122. package/lib/progress/Bar.js +6 -6
  123. package/lib/radio/index.d.ts +1 -1
  124. package/lib/radio/index.js +36 -5
  125. package/lib/radio/types.d.ts +8 -1
  126. package/lib/shortcuts/index.js +1 -1
  127. package/lib/skeleton/SkeletonContainer.js +2 -1
  128. package/lib/skeleton/index.js +4 -1
  129. package/lib/spinner/index.js +2 -2
  130. package/lib/split/Split.js +1 -1
  131. package/lib/split/SplitSide.js +3 -3
  132. package/lib/table/Body.js +3 -3
  133. package/lib/table/Header.js +8 -11
  134. package/lib/table/HeaderColumn.js +7 -7
  135. package/lib/table/Row.js +3 -3
  136. package/lib/table/RowColumn.js +1 -1
  137. package/lib/table/index.js +6 -1
  138. package/lib/table/types.d.ts +0 -2
  139. package/lib/tabs/DropdownTabs.js +1 -1
  140. package/lib/tabs/Menu.js +1 -1
  141. package/lib/tabs/MenuTabs.js +2 -2
  142. package/lib/tabs/Panel.js +5 -7
  143. package/lib/tabs/context.js +3 -6
  144. package/lib/textContent/index.d.ts +18 -4
  145. package/lib/textContent/index.js +18 -6
  146. package/lib/toolbar/ButtonBar.js +1 -1
  147. package/lib/toolbar/index.js +1 -1
  148. package/lib/tooltip/index.js +7 -7
  149. package/lib/treetable/Body.js +1 -1
  150. package/lib/treetable/Header.js +2 -2
  151. package/lib/treetable/Row.js +10 -13
  152. package/lib/treeview/Header.js +1 -1
  153. package/lib/treeview/Node.js +5 -5
  154. package/lib/treeview/index.js +4 -4
  155. package/lib/uitour/index.js +6 -8
  156. package/package.json +1 -1
  157. package/lib/checkbox/Label.d.ts +0 -11
  158. package/lib/checkbox/Label.js +0 -31
  159. package/lib/inputs/mask/imaskHOC.js +0 -203
  160. package/lib/menus/sidenav/popup_menu_help/index.js +0 -85
  161. package/lib/tabs/DropdownItems.js +0 -62
  162. package/lib/tabs/MenuItems.js +0 -70
  163. package/lib/treeview_old/Header.js +0 -29
  164. package/lib/treeview_old/Node.js +0 -68
  165. package/lib/treeview_old/index.js +0 -43
@@ -22,7 +22,6 @@ 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;
26
25
  const {
27
26
  showButtonOpen = true,
28
27
  openOnFocus = true,
@@ -54,16 +53,14 @@ const DatePicker = props => {
54
53
  const dropdownContainer = (0, _react.useRef)();
55
54
  const [insideDropdown, setInsideDropdown] = (0, _react.useState)(false);
56
55
  const onScreenResize = () => {
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());
56
+ setInputDimensions(inputRef?.current?.getBoundingClientRect());
59
57
  };
60
58
  const onClickOutside = event => {
61
- var _buttonOpenRef$curren;
62
59
  const {
63
60
  target
64
61
  } = event;
65
62
  if (!dropdownContainer || target === inputRef.current || target === buttonOpenRef.current) return;
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))) {
63
+ if (target !== dropdownContainer.current && dropdownContainer && dropdownContainer.current && !dropdownContainer.current.contains(target) && buttonOpenRef && !buttonOpenRef?.current?.contains(target)) {
67
64
  setShowCalendar(false);
68
65
  }
69
66
  };
@@ -109,8 +106,7 @@ const DatePicker = props => {
109
106
  const onInputChange = function (event) {
110
107
  let valueInput = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
111
108
  if (typeof valueInput === 'string') {
112
- var _event$target$value;
113
- const date = (_event$target$value = event.target.value) !== null && _event$target$value !== void 0 ? _event$target$value : '';
109
+ const date = event.target.value ?? '';
114
110
  if (props.onChange) {
115
111
  if (isValidDate(date)) {
116
112
  const newValue = (0, _moment.default)(date, _helpers.PT_BR_FORMAT).format(_helpers.EN_US_FORMAT);
@@ -136,10 +132,9 @@ const DatePicker = props => {
136
132
  }
137
133
  };
138
134
  const setValue = function () {
139
- var _inputRef$current2;
140
135
  let valueParam = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
141
136
  let e = arguments.length > 1 ? arguments[1] : undefined;
142
- if (showCalendar && setFocusOnSelect) (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
137
+ if (showCalendar && setFocusOnSelect) inputRef.current?.focus();
143
138
  if (props.onComplete) props.onComplete(e, valueParam);
144
139
  if (props.onChange) onInputChange({
145
140
  target: {
@@ -184,7 +179,7 @@ const DatePicker = props => {
184
179
  return /*#__PURE__*/_react.default.createElement(_Dialog.default, {
185
180
  dialogSize: dialogSize,
186
181
  handlerClose: setShowCalendar
187
- }, getCalendar(valueState, props === null || props === void 0 ? void 0 : props.calendarColorStyle));
182
+ }, getCalendar(valueState, props?.calendarColorStyle));
188
183
  }
189
184
  return /*#__PURE__*/_react.default.createElement(_Dropdown.default, {
190
185
  topPosition: inputDimensions ? inputDimensions.top + inputDimensions.height + 5 : '',
@@ -194,16 +189,16 @@ const DatePicker = props => {
194
189
  dropdownRef: el => {
195
190
  dropdownContainer.current = el;
196
191
  }
197
- }, getCalendar(valueState, props === null || props === void 0 ? void 0 : props.calendarColorStyle));
192
+ }, getCalendar(valueState, props?.calendarColorStyle));
198
193
  };
199
194
  (0, _react.useEffect)(() => {
200
195
  const screenWidth = window.innerWidth;
201
196
  if (inputDimensions && screenWidth < inputDimensions.left + CALENDAR_MIN_WIDTH) {
202
197
  setFormatedLeftPosition(inputDimensions.left - (CALENDAR_MIN_WIDTH - inputDimensions.width - CALENDAR_BUTTON_WIDTH));
203
198
  } else {
204
- setFormatedLeftPosition(inputDimensions === null || inputDimensions === void 0 ? void 0 : inputDimensions.left);
199
+ setFormatedLeftPosition(inputDimensions?.left);
205
200
  }
206
- }, [(_window = window) === null || _window === void 0 ? void 0 : _window.innerWidth, inputDimensions]);
201
+ }, [window?.innerWidth, inputDimensions]);
207
202
  (0, _react.useEffect)(() => {
208
203
  window.addEventListener('resize', onScreenResize);
209
204
  document.addEventListener('click', onClickOutside);
@@ -233,8 +228,7 @@ const DatePicker = props => {
233
228
  mask: "00/00/0000",
234
229
  onComplete: e => {
235
230
  if (e) {
236
- var _e$target;
237
- setValue((_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.maskedValue, e);
231
+ setValue(e.target?.maskedValue, e);
238
232
  }
239
233
  },
240
234
  onBlur: onInputBlur,
@@ -37,6 +37,10 @@ interface IDatePickerProps {
37
37
  disabled?: boolean;
38
38
  permissionAttr?: PermissionAttr;
39
39
  label?: string;
40
+ hint?: string | string[];
41
+ hintPosition?: 'below' | 'onLabelRight';
42
+ themePopover?: 'light' | 'dark';
43
+ popoverAlign?: 'right' | 'left';
40
44
  }
41
45
  interface IDateDropdownProps {
42
46
  children: ReactNode | ReactNode[];
@@ -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: "errormessages-component ".concat(customClass)
22
+ className: `errormessages-component ${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 !== null && files !== void 0 && files.length) ? [] : _lodash.default.map(files, file => file);
30
+ const getFilesList = files => !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: "size-position-icon ".concat(!ifExistFiles ? '-disabled-popover' : '')
34
+ className: `size-position-icon ${!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: "".concat(file.name).concat(file.size)
39
+ key: `${file.name}${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,11 +55,10 @@ const DefaultFile = props => {
55
55
  })
56
56
  });
57
57
  const handleChange = e => {
58
- var _e$preventDefault;
59
- (_e$preventDefault = e.preventDefault) === null || _e$preventDefault === void 0 ? void 0 : _e$preventDefault.call(e);
58
+ e.preventDefault?.();
60
59
  const files = getFilesList(e.target.files);
61
60
  setFileList(files);
62
- onChange === null || onChange === void 0 ? void 0 : onChange(files, e);
61
+ onChange?.(files, e);
63
62
  };
64
63
  return /*#__PURE__*/_react.default.createElement("div", {
65
64
  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 !== null && files !== void 0 && files.length) ? [] : _lodash.default.map(files, file => file);
18
+ const getFilesList = files => !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 => {
@@ -35,6 +35,7 @@ const DragDropFile = props => {
35
35
  showSubtitle = true,
36
36
  multiple = false,
37
37
  hint = [],
38
+ hintPosition = 'below',
38
39
  errorMessages = [],
39
40
  skeletonize = false
40
41
  } = props;
@@ -48,9 +49,8 @@ const DragDropFile = props => {
48
49
  error: false
49
50
  });
50
51
  const handleDrag = 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);
52
+ e.preventDefault?.();
53
+ e.stopPropagation?.();
54
54
  };
55
55
  const checkTypeNotAccept = (types, getTypesArray, e) => {
56
56
  setTypeNotAccept(false);
@@ -71,7 +71,7 @@ const DragDropFile = props => {
71
71
  setMessage({
72
72
  class: 'disapprovedFile',
73
73
  text: 'Por favor, verifique a extensão do(s) arquivo(s) inserido(s).',
74
- subtitle: "Apenas as extens\xF5es ".concat(getAcceptFilesLabel(accept), " s\xE3o permitidas."),
74
+ subtitle: `Apenas as extensões ${getAcceptFilesLabel(accept)} são permitidas.`,
75
75
  error: true
76
76
  });
77
77
  } else {
@@ -101,7 +101,7 @@ const DragDropFile = props => {
101
101
  checkTypeNotAccept(arrayTypes, getTypesArray, e);
102
102
  handleDrag(e);
103
103
  setDragActive(true);
104
- onDragEnter === null || onDragEnter === void 0 ? void 0 : onDragEnter(e);
104
+ onDragEnter?.(e);
105
105
  };
106
106
  const handleDragLeave = e => {
107
107
  setMessage({
@@ -112,11 +112,11 @@ const DragDropFile = props => {
112
112
  });
113
113
  handleDrag(e);
114
114
  setDragActive(false);
115
- onDragLeave === null || onDragLeave === void 0 ? void 0 : onDragLeave(e);
115
+ onDragLeave?.(e);
116
116
  };
117
117
  const handleDragOver = e => {
118
118
  handleDrag(e);
119
- onDragOver === null || onDragOver === void 0 ? void 0 : onDragOver(e);
119
+ onDragOver?.(e);
120
120
  };
121
121
  const handleDrop = e => {
122
122
  handleDrag(e);
@@ -134,8 +134,8 @@ const DragDropFile = props => {
134
134
  return !ids.includes(name, index + 1);
135
135
  });
136
136
  setFileList(filtered);
137
- onChange === null || onChange === void 0 ? void 0 : onChange(files, e);
138
- onDrop === null || onDrop === void 0 ? void 0 : onDrop(e);
137
+ onChange?.(files, e);
138
+ onDrop?.(e);
139
139
  }
140
140
  }
141
141
  setMessage({
@@ -146,8 +146,7 @@ const DragDropFile = props => {
146
146
  });
147
147
  };
148
148
  const handleChange = e => {
149
- var _e$preventDefault2;
150
- (_e$preventDefault2 = e.preventDefault) === null || _e$preventDefault2 === void 0 ? void 0 : _e$preventDefault2.call(e);
149
+ e.preventDefault?.();
151
150
  const files = getFilesList(e.target.files);
152
151
  if (files.length > 0 && !typeNotAccept) {
153
152
  const fileNoRepeat = fileList.concat(files);
@@ -159,7 +158,7 @@ const DragDropFile = props => {
159
158
  return !ids.includes(name, index + 1);
160
159
  });
161
160
  setFileList(filesFiltered);
162
- onChange === null || onChange === void 0 ? void 0 : onChange(files, e);
161
+ onChange?.(files, e);
163
162
  }
164
163
  };
165
164
  const onButtonClickRemoveAll = () => setFileList([]);
@@ -167,7 +166,7 @@ const DragDropFile = props => {
167
166
  setFileList(prevState => prevState.filter(file => file.name !== fileName));
168
167
  };
169
168
  const generateListArray = () => {
170
- if ((fileList === null || fileList === void 0 ? void 0 : fileList.length) === 1) {
169
+ if (fileList?.length === 1) {
171
170
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, fileList[0].type === 'image/jpeg' || fileList[0].type === 'image/png' ? /*#__PURE__*/_react.default.createElement("img", {
172
171
  alt: fileList[0].name,
173
172
  src: URL.createObjectURL(fileList[0])
@@ -185,7 +184,7 @@ const DragDropFile = props => {
185
184
  return /*#__PURE__*/_react.default.createElement("ul", {
186
185
  className: "file-list"
187
186
  }, fileList.length > 0 && fileList.map(file => /*#__PURE__*/_react.default.createElement("li", {
188
- key: "".concat(file.name).concat(file.size),
187
+ key: `${file.name}${file.size}`,
189
188
  className: "file-card"
190
189
  }, /*#__PURE__*/_react.default.createElement(_buttons.DangerButton, {
191
190
  transparent: true,
@@ -213,9 +212,9 @@ const DragDropFile = props => {
213
212
  onDragEnter: handleDragEnter,
214
213
  onSubmit: e => e.preventDefault()
215
214
  }, /*#__PURE__*/_react.default.createElement("div", {
216
- className: "drag-content ".concat(skeletonize ? '-skeletonized' : '')
215
+ className: `drag-content ${skeletonize ? '-skeletonized' : ''}`
217
216
  }, /*#__PURE__*/_react.default.createElement("div", {
218
- className: "".concat(message.class, " ").concat(!skeletonize ? 'content' : '')
217
+ className: `${message.class} ${!skeletonize ? 'content' : ''}`
219
218
  }, message.error || fileList.length === 0 ? /*#__PURE__*/_react.default.createElement("label", {
220
219
  htmlFor: id
221
220
  }, /*#__PURE__*/_react.default.createElement("h1", {
@@ -265,7 +264,7 @@ const DragDropFile = props => {
265
264
  })), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
266
265
  messages: errorMessages
267
266
  }), /*#__PURE__*/_react.default.createElement(_hint.default, {
268
- visible: !!hint,
267
+ visible: !!hint && hintPosition === 'below',
269
268
  customClass: "hint",
270
269
  description: hint
271
270
  }));
@@ -26,8 +26,7 @@ const File = _ref => {
26
26
  rest = _objectWithoutProperties(_ref, _excluded);
27
27
  const inputFileRef = (0, _react.useRef)(null);
28
28
  const onBtnClickInsert = () => {
29
- var _inputFileRef$current;
30
- (_inputFileRef$current = inputFileRef.current) === null || _inputFileRef$current === void 0 ? void 0 : _inputFileRef$current.click();
29
+ inputFileRef.current?.click();
31
30
  };
32
31
  const onBtnClickRemove = () => {
33
32
  if (inputFileRef.current) {
@@ -36,10 +35,10 @@ const File = _ref => {
36
35
  if (onBtnClickRemoveProp) onBtnClickRemoveProp();
37
36
  };
38
37
  (0, _react.useEffect)(() => {
39
- if (inputFileRef !== null && inputFileRef !== void 0 && inputFileRef.current && defaultFiles) {
38
+ if (inputFileRef?.current && defaultFiles) {
40
39
  inputFileRef.current.files = (0, _helpers.transformFilesToFileList)(defaultFiles);
41
40
  }
42
- }, [inputFileRef === null || inputFileRef === void 0 ? void 0 : inputFileRef.current]);
41
+ }, [inputFileRef?.current]);
43
42
  const component = applyDragDrop ? /*#__PURE__*/_react.default.createElement(_DragDropFile.default, _extends({}, rest, {
44
43
  defaultFiles: defaultFiles,
45
44
  inputRef: inputFileRef,
@@ -18,6 +18,7 @@ interface IFileProps {
18
18
  label?: string;
19
19
  defaultFiles?: CustomFile;
20
20
  hint?: string;
21
+ hintPosition?: 'below' | 'onLabelRight';
21
22
  required?: boolean;
22
23
  readOnly?: boolean;
23
24
  name?: string;
@@ -34,6 +35,8 @@ interface IFileProps {
34
35
  errorMessages?: string[];
35
36
  skeletonize?: boolean;
36
37
  showSubtitle?: boolean;
38
+ themePopover?: 'light' | 'dark';
39
+ popoverAlign?: 'right' | 'left';
37
40
  }
38
41
  interface IDefaultFileProps extends IFileProps {
39
42
  onBtnClickInsert: () => void;
@@ -149,7 +149,10 @@ const BaseMask = _ref => {
149
149
  }
150
150
  });
151
151
  (0, _react.useEffect)(() => {
152
- if (typeof valueProp === 'number') setTypedValue(valueProp);else setValue(valueProp !== null && valueProp !== void 0 ? valueProp : '');
152
+ if (typeof valueProp === 'number') {
153
+ if (String(valueProp).trim().length > 0) setTypedValue(valueProp);else setTypedValue(0);
154
+ }
155
+ setValue((0, _format_number.numberToPtBR)(valueProp) ?? '');
153
156
  }, [valueProp]);
154
157
  return /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({
155
158
  inputRef: r => {
@@ -40,6 +40,10 @@ declare const getMaskOptions: ({ isDateField, placeholderChar, min, max, lazy, p
40
40
  autoCompleteMask?: "left" | "right" | undefined;
41
41
  definitions?: any;
42
42
  mask?: any;
43
+ hint?: string | string[] | undefined;
44
+ hintPosition?: "below" | "onLabelRight" | undefined;
45
+ themePopover?: "dark" | "light" | undefined;
46
+ popoverAlign?: "left" | "right" | undefined;
43
47
  placeholderChar: string;
44
48
  min: any;
45
49
  max: any;
@@ -50,6 +50,10 @@ type IBaseMaskProps = {
50
50
  mask?: any;
51
51
  min?: any;
52
52
  max?: any;
53
+ hint?: string | string[];
54
+ hintPosition?: 'below' | 'onLabelRight';
55
+ themePopover?: 'light' | 'dark';
56
+ popoverAlign?: 'right' | 'left';
53
57
  pattern?: string;
54
58
  mapToRadix?: string[];
55
59
  normalizeZeros?: boolean;
@@ -16,17 +16,16 @@ 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
- 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;
19
+ const selectFieldRects = selectFieldRef?.current?.getBoundingClientRect();
20
+ const bottom = selectFieldRects?.bottom ? selectFieldRects?.bottom : 0;
21
+ const offsetTop = selectFieldRef?.current?.offsetTop ? selectFieldRef?.current?.offsetTop : 0;
23
22
  const dropdownBottomDistance = window.innerHeight - bottom;
24
23
  let maxDropdownBottomDistance = 200;
25
24
  let height = dropdownMaxHeight;
26
25
  let dropdownPosition;
27
26
  if (!height || height <= 0) {
28
27
  if (dropdownBottomDistance < maxDropdownBottomDistance) {
29
- height = selectFieldRects !== null && selectFieldRects !== void 0 && selectFieldRects.top ? selectFieldRects.top : 0;
28
+ height = selectFieldRects?.top ? selectFieldRects.top : 0;
30
29
  dropdownPosition = window.innerHeight - offsetTop + 10;
31
30
  } else {
32
31
  height = dropdownBottomDistance;
@@ -38,8 +37,8 @@ const returnDropdownDynamicStyles = (selectFieldRef, dropdownMaxHeight) => {
38
37
  }
39
38
  }
40
39
  return {
41
- maxHeight: "".concat(height - 30, "px"),
42
- bottom: "".concat(dropdownPosition, "px")
40
+ maxHeight: `${height - 30}px`,
41
+ bottom: `${dropdownPosition}px`
43
42
  };
44
43
  };
45
44
  const Dropdown = props => {
@@ -103,11 +102,11 @@ const Dropdown = props => {
103
102
  customClass: "checkboxicon"
104
103
  }), /*#__PURE__*/_react.default.createElement("span", {
105
104
  className: "label"
106
- }, inputValue !== '' ? 'Selecionar todos pesquisados' : 'Selecionar Todos'))), dataCombo === null || dataCombo === void 0 ? void 0 : dataCombo.map(item => {
105
+ }, inputValue !== '' ? 'Selecionar todos pesquisados' : 'Selecionar Todos'))), dataCombo?.map(item => {
107
106
  const isChecked = selecteds ? selecteds.find(selected => selected[idKey] === item[idKey]) : undefined;
108
107
  return /*#__PURE__*/_react.default.createElement("div", {
109
- key: "dropdowmItem ".concat(item[idKey], "}"),
110
- className: "item ".concat(isChecked && '-selected')
108
+ key: `dropdowmItem ${item[idKey]}}`,
109
+ className: `item ${isChecked && '-selected'}`
111
110
  }, /*#__PURE__*/_react.default.createElement("button", {
112
111
  className: "menubutton",
113
112
  tabIndex: -1,
@@ -11,11 +11,10 @@ const getFilteredDataCombo = _ref => {
11
11
  inputText
12
12
  } = _ref;
13
13
  return dataSource.filter(item => {
14
- var _descriptionKey;
15
14
  if (typeof descriptionKey === 'string') {
16
15
  return item[descriptionKey].toLowerCase().indexOf(inputText.toLowerCase()) > -1;
17
16
  }
18
- return ((_descriptionKey = descriptionKey(item)) === null || _descriptionKey === void 0 ? void 0 : _descriptionKey.toLowerCase().indexOf(inputText.toLowerCase())) > -1;
17
+ return descriptionKey(item)?.toLowerCase().indexOf(inputText.toLowerCase()) > -1;
19
18
  });
20
19
  };
21
20
  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 = "multiSelect-component".concat(uuid.v1());
36
+ const componentId = `multiSelect-component${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 === 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);
71
+ if (target?.className === '') return;
72
+ const newInsideComponent = ['item', 'menubutton', 'filterinput', 'filtercontainer', 'label'].includes(target?.className);
73
73
  setInsideComponent(newInsideComponent);
74
74
  };
75
75
  const onBlurComponent = e => {
@@ -109,11 +109,10 @@ const MultiSelectField = props => {
109
109
  if (selectWrapper.current) setDropdownWidth(selectWrapper.current.clientWidth);
110
110
  };
111
111
  const onClickOutSide = event => {
112
- var _componentRef$current;
113
112
  const {
114
113
  target
115
114
  } = event;
116
- if (target !== componentRef.current && !((_componentRef$current = componentRef.current) !== null && _componentRef$current !== void 0 && _componentRef$current.contains(target))) {
115
+ if (target !== componentRef.current && !componentRef.current?.contains(target)) {
117
116
  setOpened(false);
118
117
  setDataCombo(dataSource);
119
118
  setInputValue('');
@@ -139,8 +138,7 @@ const MultiSelectField = props => {
139
138
  };
140
139
  (0, _react.useEffect)(() => {
141
140
  if (gridLayout) {
142
- var _selectWrapper$curren;
143
- const currentGridEl = (_selectWrapper$curren = selectWrapper.current) === null || _selectWrapper$curren === void 0 ? void 0 : _selectWrapper$curren.parentElement;
141
+ const currentGridEl = selectWrapper.current?.parentElement;
144
142
  if (currentGridEl) setElementStyles(window.getComputedStyle(currentGridEl));
145
143
  }
146
144
  window.addEventListener('resize', onScreenResize);
@@ -154,10 +152,10 @@ const MultiSelectField = props => {
154
152
  }, []);
155
153
  (0, _react.useEffect)(() => {
156
154
  if (dataSource && dataSource.length > 0) {
157
- const newSelecteds = dataSource.filter(item => value === null || value === void 0 ? void 0 : value.includes(item[idKey]));
155
+ const newSelecteds = dataSource.filter(item => value?.includes(item[idKey]));
158
156
  setSelecteds(newSelecteds);
159
157
  }
160
- }, [value === null || value === void 0 ? void 0 : value.length, dataSource === null || dataSource === void 0 ? void 0 : dataSource.length]);
158
+ }, [value?.length, dataSource?.length]);
161
159
  (0, _react.useEffect)(() => {
162
160
  if (dataSource && dataCombo && !_lodash.default.isEqual(dataSource, dataCombo)) {
163
161
  const newDataCombo = (0, _helper.default)(_objectSpread(_objectSpread({}, props), {}, {
@@ -56,6 +56,10 @@ interface IMultiSelectProps {
56
56
  disabled?: boolean;
57
57
  dropdownAlignButton?: 'left' | 'right';
58
58
  label?: string;
59
+ hint?: string | string[];
60
+ hintPosition?: 'below' | 'onLabelRight';
61
+ themePopover?: 'light' | 'dark';
62
+ popoverAlign?: 'right' | 'left';
59
63
  }
60
64
 
61
65
  export { DescriptionKey, GetFilteredParams, IActionButtonsProps, IDropdownMultiSelectProps, IMultiSelectProps };
@@ -1,9 +1,9 @@
1
1
  import { IBaseNumberProps } from './types.js';
2
+ import '../../@types/PermissionAttr.js';
2
3
  import '../base/types.js';
3
4
  import 'react';
4
5
  import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
- import '../../@types/PermissionAttr.js';
7
7
  import '../../internals/types.js';
8
8
  import '../../@types/Position.js';
9
9
  import '../types.js';
@@ -1,9 +1,9 @@
1
1
  import { ICurrencyProps } from './types.js';
2
+ import '../../@types/PermissionAttr.js';
2
3
  import '../base/types.js';
3
4
  import 'react';
4
5
  import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
- import '../../@types/PermissionAttr.js';
7
7
  import '../../internals/types.js';
8
8
  import '../../@types/Position.js';
9
9
  import '../types.js';
@@ -1,9 +1,9 @@
1
1
  import { IBaseNumberProps } from './types.js';
2
+ import '../../@types/PermissionAttr.js';
2
3
  import '../base/types.js';
3
4
  import 'react';
4
5
  import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
- import '../../@types/PermissionAttr.js';
7
7
  import '../../internals/types.js';
8
8
  import '../../@types/Position.js';
9
9
  import '../types.js';
@@ -1,11 +1,11 @@
1
1
  export { default as CurrencyField } from './Currency.js';
2
2
  export { default as DecimalField } from './Decimal.js';
3
3
  import { INumberFieldProps } from './types.js';
4
+ import '../../@types/PermissionAttr.js';
4
5
  import '../base/types.js';
5
6
  import 'react';
6
7
  import '../../@types/Align.js';
7
8
  import '../../@types/Period.js';
8
- import '../../@types/PermissionAttr.js';
9
9
  import '../../internals/types.js';
10
10
  import '../../@types/Position.js';
11
11
  import '../types.js';
@@ -28,10 +28,12 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
28
28
  const NumberField = props => {
29
29
  const {
30
30
  textAlign = 'left',
31
- min,
32
- max,
33
31
  value = '',
34
- removeZeroLeft = true
32
+ themePopover = 'light',
33
+ popoverAlign = 'left',
34
+ removeZeroLeft = true,
35
+ min,
36
+ max
35
37
  } = props;
36
38
  const [numberValue, setNumberValue] = (0, _react.useState)();
37
39
  const onChange = event => {
@@ -48,11 +50,13 @@ const NumberField = props => {
48
50
  if (props.onChange) props.onChange(event);
49
51
  };
50
52
  (0, _react.useEffect)(() => {
51
- setNumberValue(value.toString());
53
+ setNumberValue(value?.toString() ?? '');
52
54
  }, [value]);
53
55
  return /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({}, props, {
54
56
  value: numberValue,
55
57
  textAlign: textAlign,
58
+ themePopover: themePopover,
59
+ popoverAlign: popoverAlign,
56
60
  onChange: onChange,
57
61
  type: "number"
58
62
  }));
@@ -1,9 +1,9 @@
1
+ import { PermissionAttr } from '../../@types/PermissionAttr.js';
1
2
  import { CustomInputEvent } from '../base/types.js';
2
3
  import { IMaskHOCProps } from '../types.js';
4
+ import { TextAlign } from '../../@types/Align.js';
3
5
  import 'react';
4
- import '../../@types/Align.js';
5
6
  import '../../@types/Period.js';
6
- import '../../@types/PermissionAttr.js';
7
7
  import '../../internals/types.js';
8
8
  import '../../@types/Position.js';
9
9
  import '../../@types/DataCombo.js';
@@ -12,8 +12,16 @@ import '../../@types/Icon.js';
12
12
  import '../../icons/helper.js';
13
13
 
14
14
  interface INumberFieldProps extends IMaskHOCProps {
15
+ value?: string;
16
+ permissionAttr?: PermissionAttr;
17
+ disabled?: boolean;
18
+ hint?: string | string[];
19
+ hintPosition?: 'below' | 'onLabelRight';
20
+ themePopover?: 'light' | 'dark';
21
+ popoverAlign?: 'right' | 'left';
15
22
  onChange?: (e?: CustomInputEvent) => void;
16
23
  removeZeroLeft?: boolean;
24
+ textAlign?: TextAlign;
17
25
  }
18
26
  interface IBaseNumberProps extends IMaskHOCProps {
19
27
  returnFormattedValueOnBlur?: boolean;
@@ -22,6 +30,10 @@ interface IBaseNumberProps extends IMaskHOCProps {
22
30
  interface ICurrencyProps extends IMaskHOCProps {
23
31
  currencySymbol?: string;
24
32
  displayCurrencySymbol?: boolean;
33
+ hint?: string | string[];
34
+ hintPosition?: 'below' | 'onLabelRight';
35
+ themePopover?: 'light' | 'dark';
36
+ popoverAlign?: 'right' | 'left';
25
37
  }
26
38
 
27
39
  export { IBaseNumberProps, ICurrencyProps, INumberFieldProps };
@@ -42,7 +42,7 @@ const PeriodList = _ref => {
42
42
  role: "button",
43
43
  tabIndex: -1,
44
44
  onKeyDown: () => {},
45
- key: "item-".concat(item.id),
45
+ key: `item-${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,7 +12,9 @@ const getCalendarDropdownStyle = _ref => {
12
12
  leftPosition,
13
13
  width
14
14
  } = _ref;
15
- return "top: ".concat(topPosition, "px;\n left: ").concat(leftPosition, "px;\n width:").concat(width, "px");
15
+ return `top: ${topPosition}px;
16
+ left: ${leftPosition}px;
17
+ width:${width}px`;
16
18
  };
17
19
  var _default = exports.default = getCalendarDropdownStyle;
18
20
  const getDropdownItemCssClass = function () {