linear-react-components-ui 1.1.20-beta.8 → 1.1.20-rc.0

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 (176) hide show
  1. package/lib/alerts/BaseAlert.js +1 -1
  2. package/lib/alerts/Message.js +1 -1
  3. package/lib/assets/styles/effects.scss +0 -2
  4. package/lib/assets/styles/input.scss +2 -2
  5. package/lib/assets/styles/popover.scss +3 -0
  6. package/lib/assets/styles/select.scss +2 -1
  7. package/lib/assets/styles/treetable.scss +2 -2
  8. package/lib/assets/styles/treeview.scss +24 -8
  9. package/lib/assets/styles/wizard.scss +127 -0
  10. package/lib/avatar/index.js +9 -8
  11. package/lib/badge/index.js +4 -4
  12. package/lib/buttons/DangerButton.js +1 -1
  13. package/lib/buttons/DefaultButton.js +24 -4
  14. package/lib/buttons/InfoButton.js +1 -1
  15. package/lib/buttons/PrimaryButton.js +1 -1
  16. package/lib/buttons/SuccessButton.js +1 -1
  17. package/lib/buttons/WarningButton.js +1 -1
  18. package/lib/buttons/button_container/index.js +1 -1
  19. package/lib/buttons/split_button/index.js +1 -1
  20. package/lib/calendar/base/Day.js +1 -1
  21. package/lib/calendar/base/Month.js +1 -1
  22. package/lib/calendar/base/helpers.js +2 -2
  23. package/lib/calendar/base/index.js +1 -1
  24. package/lib/checkbox/index.js +46 -19
  25. package/lib/checkbox/types.d.ts +4 -0
  26. package/lib/dialog/Alert.js +6 -2
  27. package/lib/dialog/Custom.js +4 -2
  28. package/lib/dialog/Error.js +6 -2
  29. package/lib/dialog/Information.js +6 -2
  30. package/lib/dialog/Question.js +23 -5
  31. package/lib/dialog/Warning.js +6 -2
  32. package/lib/dialog/base/Content.d.ts +1 -1
  33. package/lib/dialog/base/Content.js +3 -2
  34. package/lib/dialog/base/Header.js +2 -2
  35. package/lib/dialog/base/index.js +12 -9
  36. package/lib/dialog/form/index.js +8 -3
  37. package/lib/dialog/types.d.ts +44 -4
  38. package/lib/dialog/wizard/index.d.ts +13 -0
  39. package/lib/dialog/wizard/index.js +78 -0
  40. package/lib/dialog/wizard/progressbar.d.ts +13 -0
  41. package/lib/dialog/wizard/progressbar.js +36 -0
  42. package/lib/dialog/wizard/step.d.ts +9 -0
  43. package/lib/dialog/wizard/step.js +22 -0
  44. package/lib/dialog/wizard/useWizard.d.ts +9 -0
  45. package/lib/dialog/wizard/useWizard.js +48 -0
  46. package/lib/drawer/Drawer.js +3 -3
  47. package/lib/drawer/Header.js +1 -1
  48. package/lib/dropdown/Popup.js +6 -6
  49. package/lib/dropdown/helper.js +1 -1
  50. package/lib/dropdown/withDropdown.js +2 -2
  51. package/lib/fieldset/index.js +7 -7
  52. package/lib/form/FieldArray.js +1 -1
  53. package/lib/form/FieldNumber.js +7 -10
  54. package/lib/form/FieldPeriod.js +2 -2
  55. package/lib/form/index.js +20 -15
  56. package/lib/form/types.d.ts +14 -1
  57. package/lib/gridlayout/GridCol.js +5 -5
  58. package/lib/gridlayout/GridRow.js +4 -1
  59. package/lib/hint/index.js +7 -1
  60. package/lib/icons/helper.d.ts +20 -0
  61. package/lib/icons/helper.js +20 -0
  62. package/lib/icons/index.js +24 -27
  63. package/lib/inputs/base/InputTextBase.js +39 -15
  64. package/lib/inputs/base/Label.js +1 -1
  65. package/lib/inputs/base/helpers.js +7 -3
  66. package/lib/inputs/base/types.d.ts +3 -0
  67. package/lib/inputs/color/types.d.ts +5 -0
  68. package/lib/inputs/date/helpers.js +4 -1
  69. package/lib/inputs/date/index.js +9 -15
  70. package/lib/inputs/date/types.d.ts +4 -0
  71. package/lib/inputs/errorMessage/index.js +1 -1
  72. package/lib/inputs/file/DefaultFile.js +5 -6
  73. package/lib/inputs/file/DragDropFile.js +17 -18
  74. package/lib/inputs/file/File.js +3 -4
  75. package/lib/inputs/file/types.d.ts +3 -0
  76. package/lib/inputs/mask/BaseMask.js +4 -1
  77. package/lib/inputs/mask/helpers.d.ts +4 -0
  78. package/lib/inputs/mask/types.d.ts +4 -0
  79. package/lib/inputs/multiSelect/Dropdown.js +9 -10
  80. package/lib/inputs/multiSelect/helper.js +1 -2
  81. package/lib/inputs/multiSelect/index.js +7 -9
  82. package/lib/inputs/multiSelect/types.d.ts +4 -0
  83. package/lib/inputs/number/BaseNumber.d.ts +1 -1
  84. package/lib/inputs/number/Currency.d.ts +1 -1
  85. package/lib/inputs/number/Decimal.d.ts +1 -1
  86. package/lib/inputs/number/index.d.ts +1 -1
  87. package/lib/inputs/number/index.js +8 -4
  88. package/lib/inputs/number/types.d.ts +14 -2
  89. package/lib/inputs/period/PeriodList.js +1 -1
  90. package/lib/inputs/period/helper.js +3 -1
  91. package/lib/inputs/period/index.js +40 -18
  92. package/lib/inputs/period/types.d.ts +3 -0
  93. package/lib/inputs/search/index.js +1 -1
  94. package/lib/inputs/select/Dropdown.js +1 -1
  95. package/lib/inputs/select/helper.js +10 -13
  96. package/lib/inputs/select/multiple/Selecteds.js +1 -1
  97. package/lib/inputs/select/multiple/index.js +22 -18
  98. package/lib/inputs/select/simple/index.js +15 -20
  99. package/lib/inputs/select/types.d.ts +7 -0
  100. package/lib/inputs/textarea/index.js +1 -1
  101. package/lib/internals/withTooltip.js +9 -9
  102. package/lib/labelMessages/index.js +4 -3
  103. package/lib/labels/DefaultLabel.js +4 -1
  104. package/lib/labels/label_container/index.js +1 -1
  105. package/lib/list/Header.d.ts +1 -0
  106. package/lib/list/Header.js +1 -1
  107. package/lib/list/Item.d.ts +6 -2
  108. package/lib/list/Item.js +36 -14
  109. package/lib/list/helpers.d.ts +1 -0
  110. package/lib/list/index.d.ts +1 -0
  111. package/lib/list/index.js +3 -2
  112. package/lib/list/types.d.ts +8 -1
  113. package/lib/menus/float/MenuItem.js +2 -2
  114. package/lib/menus/float/SubMenuContainer.js +1 -1
  115. package/lib/menus/float/index.js +1 -1
  116. package/lib/menus/sidenav/ExpandMenu.js +1 -1
  117. package/lib/menus/sidenav/NavMenuGroup.js +1 -1
  118. package/lib/menus/sidenav/NavMenuItem.js +27 -25
  119. package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
  120. package/lib/menus/sidenav/helpers.js +1 -1
  121. package/lib/menus/sidenav/index.js +39 -31
  122. package/lib/menus/sidenav/types.d.ts +1 -0
  123. package/lib/panel/Content.js +5 -7
  124. package/lib/panel/Default.js +2 -2
  125. package/lib/panel/Header.js +3 -3
  126. package/lib/permissionValidations.js +1 -1
  127. package/lib/popover/index.js +4 -6
  128. package/lib/popover/types.d.ts +2 -1
  129. package/lib/progress/Bar.js +6 -6
  130. package/lib/radio/index.d.ts +1 -1
  131. package/lib/radio/index.js +36 -5
  132. package/lib/radio/types.d.ts +8 -1
  133. package/lib/shortcuts/index.js +1 -1
  134. package/lib/skeleton/SkeletonContainer.js +2 -1
  135. package/lib/skeleton/index.js +4 -1
  136. package/lib/spinner/index.js +2 -2
  137. package/lib/split/Split.js +1 -1
  138. package/lib/split/SplitSide.js +3 -3
  139. package/lib/table/Body.js +3 -3
  140. package/lib/table/Header.js +8 -11
  141. package/lib/table/HeaderColumn.js +7 -7
  142. package/lib/table/Row.js +3 -3
  143. package/lib/table/RowColumn.js +1 -1
  144. package/lib/table/index.js +6 -1
  145. package/lib/table/types.d.ts +0 -2
  146. package/lib/tabs/DropdownTabs.js +1 -1
  147. package/lib/tabs/Menu.js +1 -1
  148. package/lib/tabs/MenuTabs.js +2 -2
  149. package/lib/tabs/Panel.js +5 -7
  150. package/lib/tabs/context.js +3 -6
  151. package/lib/textContent/index.d.ts +18 -4
  152. package/lib/textContent/index.js +18 -6
  153. package/lib/toolbar/ButtonBar.js +1 -1
  154. package/lib/toolbar/index.js +1 -1
  155. package/lib/tooltip/index.js +7 -7
  156. package/lib/treetable/Body.js +1 -1
  157. package/lib/treetable/Header.js +2 -2
  158. package/lib/treetable/Row.d.ts +1 -1
  159. package/lib/treetable/Row.js +50 -25
  160. package/lib/treetable/helpers.d.ts +1 -1
  161. package/lib/treetable/index.d.ts +2 -2
  162. package/lib/treeview/Header.js +1 -1
  163. package/lib/treeview/Node.js +5 -5
  164. package/lib/treeview/index.js +4 -4
  165. package/lib/{types.d-73cece43.d.ts → types.d-b477e076.d.ts} +1 -0
  166. package/lib/uitour/index.js +6 -8
  167. package/package.json +2 -2
  168. package/lib/checkbox/Label.d.ts +0 -11
  169. package/lib/checkbox/Label.js +0 -31
  170. package/lib/inputs/mask/imaskHOC.js +0 -203
  171. package/lib/menus/sidenav/popup_menu_help/index.js +0 -85
  172. package/lib/tabs/DropdownItems.js +0 -62
  173. package/lib/tabs/MenuItems.js +0 -70
  174. package/lib/treeview_old/Header.js +0 -29
  175. package/lib/treeview_old/Node.js +0 -68
  176. package/lib/treeview_old/index.js +0 -43
@@ -13,7 +13,8 @@ var _withTooltip = _interopRequireDefault(require("../../internals/withTooltip")
13
13
  var _permissionValidations = require("../../permissionValidations");
14
14
  var _hint = _interopRequireDefault(require("../../hint"));
15
15
  var _errorMessage = require("../errorMessage");
16
- var _Label = _interopRequireDefault(require("./Label"));
16
+ var _textContent = _interopRequireDefault(require("../../textContent"));
17
+ var _popover = _interopRequireDefault(require("../../popover"));
17
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
18
19
  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); }
19
20
  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; }
@@ -43,6 +44,7 @@ const InputTextBase = props => {
43
44
  label,
44
45
  labelUppercase,
45
46
  hint,
47
+ hintPosition = 'below',
46
48
  errorMessages,
47
49
  visible = true,
48
50
  permissionAttr,
@@ -68,7 +70,9 @@ const InputTextBase = props => {
68
70
  onDragLeave,
69
71
  onClick,
70
72
  readOnlyClass,
71
- autoComplete = 'on'
73
+ autoComplete = 'on',
74
+ themePopover = 'light',
75
+ popoverAlign = 'left'
72
76
  } = props;
73
77
  let propsInput;
74
78
  const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
@@ -118,13 +122,11 @@ const InputTextBase = props => {
118
122
  if (!disableCallbacks) {
119
123
  propsInput = _objectSpread(_objectSpread({}, propsInput), {}, {
120
124
  onFocus: e => {
121
- var _props$onInputReceive;
122
- (_props$onInputReceive = props.onInputReceiveFocus) === null || _props$onInputReceive === void 0 ? void 0 : _props$onInputReceive.call(props);
125
+ props.onInputReceiveFocus?.();
123
126
  if (props.onFocus) props.onFocus(e);
124
127
  },
125
128
  onBlur: e => {
126
- var _props$onInputLostFoc;
127
- (_props$onInputLostFoc = props.onInputLostFocus) === null || _props$onInputLostFoc === void 0 ? void 0 : _props$onInputLostFoc.call(props);
129
+ props.onInputLostFocus?.();
128
130
  if (props.onBlur) props.onBlur(e);
129
131
  },
130
132
  onKeyDown: e => {
@@ -188,23 +190,45 @@ const InputTextBase = props => {
188
190
  if (!visible || unvisible) return null;
189
191
  return /*#__PURE__*/_react.default.createElement("div", {
190
192
  style: style,
191
- className: "input-base-component ".concat(skeletonize ? '-skeletonized' : '', " ").concat(customClass),
193
+ className: `input-base-component ${skeletonize ? '-skeletonized' : ''} ${customClass}`,
192
194
  ref: inputBaseRef
193
195
  }, label && /*#__PURE__*/_react.default.createElement("div", {
194
196
  className: "labelcontainer",
195
197
  style: {
196
198
  textAlign: textAlign === 'center' ? 'left' : textAlign
197
199
  }
198
- }, /*#__PURE__*/_react.default.createElement(_Label.default, {
200
+ }, /*#__PURE__*/_react.default.createElement(_textContent.default, {
199
201
  labelRef: labelRef,
200
- label: label,
201
202
  required: required,
203
+ label: label,
202
204
  onHoverLabel: onHoverLabel,
203
- customClassForLabel: customClassForLabel,
205
+ className: customClassForLabel,
204
206
  labelUppercase: labelUppercase,
205
- tooltip: showTooltip ? label.toString() : undefined,
207
+ tooltip: label.toString(),
206
208
  tooltipPosition: "top"
207
- })), /*#__PURE__*/_react.default.createElement("div", {
209
+ }), /*#__PURE__*/_react.default.createElement("div", {
210
+ className: "text-content",
211
+ style: {
212
+ display: 'flex'
213
+ }
214
+ }, /*#__PURE__*/_react.default.createElement("div", {
215
+ className: `label ${customClassForLabel} ${labelUppercase && ' -uppercase'}`,
216
+ style: {
217
+ alignSelf: 'center'
218
+ }
219
+ }, label, required && /*#__PURE__*/_react.default.createElement("span", {
220
+ className: "-requiredlabel"
221
+ }, "*"), !!hint && hintPosition === 'onLabelRight' && !skeletonize && /*#__PURE__*/_react.default.createElement(_popover.default, {
222
+ theme: themePopover,
223
+ align: popoverAlign,
224
+ customClass: "-hint",
225
+ iconColor: "#03bde2",
226
+ style: {
227
+ margin: '0px 5px',
228
+ height: 'auto',
229
+ width: 20
230
+ }
231
+ }, hint))), /*#__PURE__*/_react.default.createElement(_textContent.default, null)), /*#__PURE__*/_react.default.createElement("div", {
208
232
  "data-testid": "testInputWrapper",
209
233
  style: styleForWrapper,
210
234
  className: helpers.getInputWrapperClass(_objectSpread(_objectSpread({}, props), {}, {
@@ -212,11 +236,11 @@ const InputTextBase = props => {
212
236
  }))
213
237
  }, leftElements && /*#__PURE__*/_react.default.createElement("div", {
214
238
  style: styleForSideButtons,
215
- className: "sidebuttons ".concat(customClassForSideButtons)
239
+ className: `sidebuttons ${customClassForSideButtons}`
216
240
  }, leftElements), /*#__PURE__*/_react.default.createElement("div", {
217
241
  "data-testid": "testInputContent",
218
242
  style: styleForInputContent,
219
- className: "inputcontent ".concat(customClassForInputContent)
243
+ className: `inputcontent ${customClassForInputContent}`
220
244
  }, type === 'textarea' ? /*#__PURE__*/_react.default.createElement("textarea", _extends({
221
245
  rows: props.rows,
222
246
  cols: props.cols,
@@ -227,7 +251,7 @@ const InputTextBase = props => {
227
251
  "data-testid": "teste-123"
228
252
  }, inputProps())), children), helpers.getRightElements(errorMessages || [], skeletonize, rightElements)), /*#__PURE__*/_react.default.createElement(_hint.default, {
229
253
  disabled: disabled,
230
- visible: !!hint,
254
+ visible: !!hint && hintPosition === 'below',
231
255
  customClass: "hint",
232
256
  description: hint
233
257
  }), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
@@ -27,7 +27,7 @@ const Label = props => {
27
27
  }
28
28
  },
29
29
  onMouseEnter: onHoverLabel,
30
- className: "label ".concat(customClassForLabel, " ").concat(labelUppercase && ' -uppercase')
30
+ className: `label ${customClassForLabel} ${labelUppercase && ' -uppercase'}`
31
31
  }, label, required && /*#__PURE__*/_react.default.createElement("span", {
32
32
  className: "-requiredlabel"
33
33
  }, "*"));
@@ -13,7 +13,7 @@ const getInputClass = _ref => {
13
13
  readOnly,
14
14
  readOnlyClass
15
15
  } = _ref;
16
- return "textinput text-align-".concat(textAlign, " ").concat(readOnlyClass, " ").concat(readOnly ? ' -readonly' : '');
16
+ return `textinput text-align-${textAlign} ${readOnlyClass} ${readOnly ? ' -readonly' : ''}`;
17
17
  };
18
18
  exports.getInputClass = getInputClass;
19
19
  const getInputWrapperClass = props => {
@@ -24,7 +24,11 @@ const getInputWrapperClass = props => {
24
24
  errorMessages,
25
25
  disabled
26
26
  } = props;
27
- return "inputwrapper ".concat(inputHasFocus && ' -focusable', "\n ").concat(customClassForWrapper, "\n ").concat(errorMessages && errorMessages.length > 0 && ' -requirederror', "\n ").concat(rounded && ' -roundedborders', "\n ").concat(disabled && ' -disabled');
27
+ return `inputwrapper ${inputHasFocus && ' -focusable'}
28
+ ${customClassForWrapper}
29
+ ${errorMessages && errorMessages.length > 0 && ' -requirederror'}
30
+ ${rounded && ' -roundedborders'}
31
+ ${disabled && ' -disabled'}`;
28
32
  };
29
33
  exports.getInputWrapperClass = getInputWrapperClass;
30
34
  const getRightElements = (errorMessages, skeletonize, rightElements) => {
@@ -34,7 +38,7 @@ const getRightElements = (errorMessages, skeletonize, rightElements) => {
34
38
  elements = [elements];
35
39
  }
36
40
  elements = elements.map((element, index) => element && /*#__PURE__*/_react.default.cloneElement(element, {
37
- key: "rightelement-".concat(index + 1)
41
+ key: `rightelement-${index + 1}`
38
42
  }));
39
43
  if (errorMessages) return elements;
40
44
  return elements;
@@ -73,6 +73,7 @@ interface IBaseProps {
73
73
  inputRef?: MutableRefObject<HTMLInputElement | HTMLTextAreaElement | null> | ((ref: HTMLInputElement | HTMLTextAreaElement | null) => void);
74
74
  inputBaseRef?: RefObject<HTMLDivElement> | ((ref: HTMLDivElement) => void);
75
75
  hint?: string | string[];
76
+ hintPosition?: 'below' | 'onLabelRight';
76
77
  textAlign?: TextAlign;
77
78
  rounded?: boolean;
78
79
  errorMessages?: string[] | undefined;
@@ -92,6 +93,8 @@ interface IBaseProps {
92
93
  multiple?: boolean;
93
94
  readOnlyClass?: string;
94
95
  autoComplete?: 'on' | 'off';
96
+ themePopover?: 'light' | 'dark';
97
+ popoverAlign?: 'right' | 'left';
95
98
  }
96
99
 
97
100
  export { CustomInputEvent, IBaseProps, InputLabelProps };
@@ -9,6 +9,11 @@ interface IColorProps {
9
9
  name?: string;
10
10
  permissionAttr?: PermissionAttr;
11
11
  visible?: boolean;
12
+ label?: string;
13
+ hint?: string | string[];
14
+ hintPosition?: 'below' | 'onLabelRight';
15
+ themePopover?: 'light' | 'dark';
16
+ popoverAlign?: 'right' | 'left';
12
17
  }
13
18
 
14
19
  export { IColorProps };
@@ -15,7 +15,10 @@ const getCalendarDropdownStyle = _ref => {
15
15
  width,
16
16
  minWidth
17
17
  } = _ref;
18
- return "top: ".concat(topPosition, "px;\n left: ").concat(leftPosition, "px;\n width: ").concat(width, "px;\n min-width: ").concat(minWidth, "px;");
18
+ return `top: ${topPosition}px;
19
+ left: ${leftPosition}px;
20
+ width: ${width}px;
21
+ min-width: ${minWidth}px;`;
19
22
  };
20
23
  exports.getCalendarDropdownStyle = getCalendarDropdownStyle;
21
24
  const getMomentValue = value => {
@@ -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;