linear-react-components-ui 1.1.20-beta.2 → 1.1.20-beta.21

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 (157) 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 +125 -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 +13 -3
  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 +8 -9
  29. package/lib/dialog/form/index.js +8 -3
  30. package/lib/dialog/types.d.ts +38 -4
  31. package/lib/dialog/wizard/index.d.ts +13 -0
  32. package/lib/dialog/wizard/index.js +74 -0
  33. package/lib/dialog/wizard/progressbar.d.ts +13 -0
  34. package/lib/dialog/wizard/progressbar.js +36 -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 +4 -4
  47. package/lib/form/FieldPeriod.js +2 -2
  48. package/lib/form/index.js +2 -2
  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 +8 -0
  54. package/lib/icons/helper.js +8 -0
  55. package/lib/icons/index.js +24 -27
  56. package/lib/inputs/base/InputTextBase.js +41 -16
  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 +1 -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 +7 -3
  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 +24 -10
  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 +6 -0
  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 +7 -9
  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 +5 -5
  115. package/lib/panel/Content.js +5 -7
  116. package/lib/panel/Default.js +2 -2
  117. package/lib/panel/Header.js +3 -3
  118. package/lib/permissionValidations.js +1 -1
  119. package/lib/popover/index.js +4 -6
  120. package/lib/popover/types.d.ts +2 -1
  121. package/lib/progress/Bar.js +6 -6
  122. package/lib/radio/index.d.ts +1 -1
  123. package/lib/radio/index.js +36 -5
  124. package/lib/radio/types.d.ts +8 -1
  125. package/lib/shortcuts/index.js +1 -1
  126. package/lib/skeleton/SkeletonContainer.js +2 -1
  127. package/lib/skeleton/index.js +4 -1
  128. package/lib/spinner/index.js +2 -2
  129. package/lib/split/Split.js +1 -1
  130. package/lib/split/SplitSide.js +3 -3
  131. package/lib/table/Body.js +3 -3
  132. package/lib/table/Header.js +8 -11
  133. package/lib/table/HeaderColumn.js +7 -7
  134. package/lib/table/Row.js +3 -3
  135. package/lib/table/RowColumn.js +1 -1
  136. package/lib/table/index.js +6 -1
  137. package/lib/table/types.d.ts +0 -2
  138. package/lib/tabs/DropdownTabs.js +1 -1
  139. package/lib/tabs/Menu.js +1 -1
  140. package/lib/tabs/MenuTabs.js +2 -2
  141. package/lib/tabs/Panel.js +5 -7
  142. package/lib/tabs/context.js +3 -6
  143. package/lib/textContent/index.d.ts +18 -4
  144. package/lib/textContent/index.js +15 -5
  145. package/lib/toolbar/ButtonBar.js +1 -1
  146. package/lib/toolbar/index.js +1 -1
  147. package/lib/tooltip/index.js +7 -7
  148. package/lib/treetable/Body.js +1 -1
  149. package/lib/treetable/Header.js +2 -2
  150. package/lib/treetable/Row.js +10 -13
  151. package/lib/treeview/Header.js +1 -1
  152. package/lib/treeview/Node.js +5 -5
  153. package/lib/treeview/index.js +4 -4
  154. package/lib/uitour/index.js +6 -8
  155. package/package.json +1 -1
  156. package/lib/checkbox/Label.d.ts +0 -11
  157. package/lib/checkbox/Label.js +0 -31
@@ -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,7 @@ 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') setTypedValue(valueProp);else setValue(valueProp ?? '');
153
153
  }, [valueProp]);
154
154
  return /*#__PURE__*/_react.default.createElement(_InputTextBase.default, _extends({
155
155
  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?: "light" | "dark" | 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 => {
@@ -53,6 +55,8 @@ const NumberField = props => {
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 () {
@@ -17,6 +17,8 @@ var _hint = _interopRequireDefault(require("../../hint"));
17
17
  var helperBase = _interopRequireWildcard(require("../base/helpers"));
18
18
  require("../../assets/styles/periodpicker.scss");
19
19
  var _errorMessage = require("../errorMessage");
20
+ var _textContent = _interopRequireDefault(require("../../textContent"));
21
+ var _popover = _interopRequireDefault(require("../../popover"));
20
22
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
21
23
  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); }
22
24
  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; }
@@ -36,7 +38,10 @@ const PeriodPicker = props => {
36
38
  width: '350px',
37
39
  height: '350px'
38
40
  },
39
- hint
41
+ hint,
42
+ hintPosition = 'below',
43
+ themePopover = 'light',
44
+ popoverAlign = 'left'
40
45
  } = props;
41
46
  const [valueInitial, setValueInitial] = (0, _react.useState)(props.value && (0, _moment.default)(props.value.initial, 'DD/MM/YYYY'));
42
47
  const [valueFinal, setValueFinal] = (0, _react.useState)(props.value && (0, _moment.default)(props.value.final, 'DD/MM/YYYY'));
@@ -55,8 +60,7 @@ const PeriodPicker = props => {
55
60
  const dropdownPeriodContainer = (0, _react.useRef)(null);
56
61
  const inputFinalRef = (0, _react.useRef)(null);
57
62
  const onScreenResize = () => {
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();
63
+ const inputDimensionsAux = inputContainerRef?.current?.getBoundingClientRect();
60
64
  setInputDimensions(inputDimensionsAux);
61
65
  };
62
66
  const onClickOutside = event => {
@@ -159,12 +163,11 @@ const PeriodPicker = props => {
159
163
  }
160
164
  };
161
165
  const setValue = function (event, value) {
162
- var _inputInitialRef$curr, _inputFinalRef$curren;
163
166
  let shouldOpenDropdown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
164
167
  const valueDateName = event ? event.target.name : '';
165
168
  const dateObj = (0, _moment.default)(value, 'DD/MM/YYYY');
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();
169
+ if (showCalendarValueInitial) inputInitialRef.current?.focus();
170
+ if (showCalendarValueFinal) inputFinalRef.current?.focus();
168
171
  if (valueDateName === 'valueFinal' && valueInitial && dateObj.isBefore(valueInitial)) {
169
172
  setValueInitial(dateObj);
170
173
  setValueFinal(valueInitial);
@@ -193,8 +196,7 @@ const PeriodPicker = props => {
193
196
  });
194
197
  }
195
198
  if (valueDateName === 'valueInitial' && !valueFinal && shouldOpenDropdown) {
196
- var _inputFinalRef$curren2;
197
- (_inputFinalRef$curren2 = inputFinalRef.current) === null || _inputFinalRef$curren2 === void 0 ? void 0 : _inputFinalRef$curren2.focus();
199
+ inputFinalRef.current?.focus();
198
200
  setTimeout(() => setShowCalendarValueFinal(true), 100);
199
201
  }
200
202
  if (shouldCloseOnSelect) {
@@ -217,8 +219,7 @@ const PeriodPicker = props => {
217
219
  name: "calendar"
218
220
  }),
219
221
  onClick: () => {
220
- var _inputInitialRef$curr2;
221
- (_inputInitialRef$curr2 = inputInitialRef.current) === null || _inputInitialRef$curr2 === void 0 ? void 0 : _inputInitialRef$curr2.focus();
222
+ inputInitialRef.current?.focus();
222
223
  openCalendar('valueInitial');
223
224
  },
224
225
  customClass: "calendar-button",
@@ -269,8 +270,7 @@ const PeriodPicker = props => {
269
270
  });
270
271
  const setPeriodDates = (selected, dates) => {
271
272
  if (selected === 'custom') {
272
- var _inputInitialRef$curr3;
273
- (_inputInitialRef$curr3 = inputInitialRef.current) === null || _inputInitialRef$curr3 === void 0 ? void 0 : _inputInitialRef$curr3.focus();
273
+ inputInitialRef.current?.focus();
274
274
  setValuePeriodSelection(selected);
275
275
  setShowPeriodSelection(false);
276
276
  return;
@@ -343,15 +343,37 @@ const PeriodPicker = props => {
343
343
  className: "input-base-component"
344
344
  }, props.label && /*#__PURE__*/_react.default.createElement("div", {
345
345
  className: "labelcontainer"
346
- }, /*#__PURE__*/_react.default.createElement("span", {
347
- className: "label ".concat(props.customClassForLabel, " ").concat(props.labelUppercase && ' -uppercase')
346
+ }, /*#__PURE__*/_react.default.createElement(_textContent.default, {
347
+ required: props.required,
348
+ className: props.customClassForLabel,
349
+ labelUppercase: props.labelUppercase
350
+ }), /*#__PURE__*/_react.default.createElement("div", {
351
+ className: "text-content",
352
+ style: {
353
+ display: 'flex'
354
+ }
355
+ }, /*#__PURE__*/_react.default.createElement("div", {
356
+ className: `label ${props.customClassForLabel} ${props.labelUppercase && ' -uppercase'}`,
357
+ style: {
358
+ alignSelf: 'center'
359
+ }
348
360
  }, props.label, props.required && /*#__PURE__*/_react.default.createElement("span", {
349
361
  className: "-requiredlabel"
350
- }, "*"))), /*#__PURE__*/_react.default.createElement("div", {
351
- className: "periodpicker-component ".concat(helperBase.getInputWrapperClass(_objectSpread(_objectSpread({}, props), {}, {
362
+ }, "*"), !!hint && hintPosition === 'onLabelRight' && /*#__PURE__*/_react.default.createElement(_popover.default, {
363
+ theme: themePopover,
364
+ align: popoverAlign,
365
+ iconColor: "#03bde2",
366
+ customClass: "-hint",
367
+ style: {
368
+ margin: '0px 5px',
369
+ height: 'auto',
370
+ width: 20
371
+ }
372
+ }, hint))), /*#__PURE__*/_react.default.createElement(_textContent.default, null)), /*#__PURE__*/_react.default.createElement("div", {
373
+ className: `periodpicker-component ${helperBase.getInputWrapperClass(_objectSpread(_objectSpread({}, props), {}, {
352
374
  value: !valueInitial ? '' : (0, _moment.default)(valueInitial).format('DD/MM/YYYY'),
353
375
  disabled: shouldDisable()
354
- }))),
376
+ }))}`,
355
377
  ref: inputContainerRef
356
378
  }, /*#__PURE__*/_react.default.createElement(_BaseMask.default, {
357
379
  permissionAttr: props.permissionAttr,
@@ -391,7 +413,7 @@ const PeriodPicker = props => {
391
413
  handlerSetOnDenied: denied => setOnDenied(denied),
392
414
  required: props.required
393
415
  }), getButtonOpen(), getButtonSelectPeriod()), showCalendarValueInitial && getWrapperComponentCalendarValueInitial(), showCalendarValueFinal && getWrapperComponentCalendarValueFinal(), showPeriodSelection && getWrapperComponentPeriodSelection(), /*#__PURE__*/_react.default.createElement(_hint.default, {
394
- visible: !!hint,
416
+ visible: !!hint && hintPosition === 'below',
395
417
  customClass: "hint",
396
418
  description: hint
397
419
  }), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
@@ -59,8 +59,11 @@ interface IPeriodPickerProps {
59
59
  errorMessages?: string[];
60
60
  name?: string;
61
61
  hint?: string;
62
+ hintPosition?: 'below' | 'onLabelRight';
62
63
  onBlur?: (e: CustomInputEvent) => void;
63
64
  onFocus?: (e: CustomInputEvent) => void;
65
+ themePopover?: 'light' | 'dark';
66
+ popoverAlign?: 'right' | 'left';
64
67
  }
65
68
  interface IPeriodListProps {
66
69
  handleOnSelect: (value: DateTypes | 'custom', date: Moment[] | null) => void;
@@ -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 === null || onDenied === void 0 ? void 0 : onDenied.hideContent;
52
+ const hideContent = 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: "dropdowmIten ".concat(item[idKey], "}"),
83
+ key: `dropdowmIten ${item[idKey]}}`,
84
84
  className: helper.getDropdownItemCssClass(itemSelected, disabled, striped)
85
85
  }, /*#__PURE__*/_react.default.createElement("button", {
86
86
  className: "menubutton",