linear-react-components-ui 1.1.24-beta.1 → 1.1.25-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 (259) hide show
  1. package/lib/@types/ColorStyles.d.ts +1 -2
  2. package/lib/@types/Position.d.ts +1 -2
  3. package/lib/assets/styles/calendar.scss +137 -32
  4. package/lib/assets/styles/colorpicker.scss +6 -1
  5. package/lib/assets/styles/colors.scss +12 -48
  6. package/lib/assets/styles/file.scss +8 -0
  7. package/lib/buttons/ActivateButton.d.ts +0 -1
  8. package/lib/buttons/AddButton.d.ts +0 -1
  9. package/lib/buttons/Button.d.ts +0 -1
  10. package/lib/buttons/CancelButton.d.ts +0 -1
  11. package/lib/buttons/DangerButton.d.ts +0 -1
  12. package/lib/buttons/DefaultButton.d.ts +0 -1
  13. package/lib/buttons/DefaultButton.js +17 -32
  14. package/lib/buttons/DestroyButton.d.ts +0 -1
  15. package/lib/buttons/EditButton.d.ts +0 -1
  16. package/lib/buttons/InactivateButton.d.ts +0 -1
  17. package/lib/buttons/InfoButton.d.ts +0 -1
  18. package/lib/buttons/PrimaryButton.d.ts +0 -1
  19. package/lib/buttons/RestoreButton.d.ts +0 -1
  20. package/lib/buttons/SaveButton.d.ts +0 -1
  21. package/lib/buttons/SuccessButton.d.ts +0 -1
  22. package/lib/buttons/WarningButton.d.ts +0 -1
  23. package/lib/buttons/index.d.ts +0 -1
  24. package/lib/buttons/split_button/index.d.ts +0 -1
  25. package/lib/buttons/types.d.ts +5 -2
  26. package/lib/calendar/base/index.js +113 -40
  27. package/lib/form/Field.d.ts +1 -1
  28. package/lib/form/FieldArray.d.ts +1 -1
  29. package/lib/form/FieldNumber.d.ts +1 -1
  30. package/lib/form/FieldPeriod.d.ts +1 -1
  31. package/lib/form/helpers.d.ts +1 -1
  32. package/lib/form/index.d.ts +1 -1
  33. package/lib/form/types.d.ts +1 -1
  34. package/lib/form/withFieldHOC.d.ts +1 -1
  35. package/lib/form/withFormSecurity.d.ts +1 -1
  36. package/lib/icons/helper.d.ts +0 -4
  37. package/lib/icons/helper.js +0 -4
  38. package/lib/icons/index.d.ts +6 -4
  39. package/lib/icons/index.js +9 -14
  40. package/lib/icons/types.d.ts +6 -3
  41. package/lib/index.d.ts +0 -1
  42. package/lib/inputs/base/InputTextBase.d.ts +1 -1
  43. package/lib/inputs/base/InputTextBase.js +8 -18
  44. package/lib/inputs/base/Label.d.ts +14 -0
  45. package/lib/inputs/base/Label.js +35 -0
  46. package/lib/inputs/base/helpers.d.ts +1 -1
  47. package/lib/inputs/base/types.d.ts +17 -6
  48. package/lib/inputs/color/index.js +1 -1
  49. package/lib/inputs/color/types.d.ts +1 -1
  50. package/lib/inputs/date/Dialog.d.ts +1 -1
  51. package/lib/inputs/date/Dropdown.d.ts +1 -1
  52. package/lib/inputs/date/index.d.ts +1 -1
  53. package/lib/inputs/date/types.d.ts +2 -2
  54. package/lib/inputs/errorMessage/index.d.ts +1 -1
  55. package/lib/inputs/file/DefaultFile.d.ts +1 -1
  56. package/lib/inputs/file/DefaultFile.js +27 -27
  57. package/lib/inputs/file/DragDropFile.d.ts +1 -1
  58. package/lib/inputs/file/File.d.ts +1 -1
  59. package/lib/inputs/file/File.js +1 -0
  60. package/lib/inputs/file/FileButtonSettings.d.ts +1 -1
  61. package/lib/inputs/file/FileButtonSettings.js +0 -1
  62. package/lib/inputs/file/helpers.d.ts +1 -1
  63. package/lib/inputs/file/index.d.ts +1 -1
  64. package/lib/inputs/file/types.d.ts +1 -1
  65. package/lib/inputs/inputHOC.d.ts +1 -1
  66. package/lib/inputs/mask/BaseMask.d.ts +1 -1
  67. package/lib/inputs/mask/Cnpj.d.ts +1 -1
  68. package/lib/inputs/mask/Cpf.d.ts +1 -1
  69. package/lib/inputs/mask/Phone.d.ts +1 -1
  70. package/lib/inputs/mask/ZipCode.d.ts +1 -1
  71. package/lib/inputs/mask/helpers.d.ts +1 -1
  72. package/lib/inputs/mask/index.d.ts +1 -1
  73. package/lib/inputs/mask/types.d.ts +2 -2
  74. package/lib/inputs/multiSelect/ActionButtons.d.ts +1 -1
  75. package/lib/inputs/multiSelect/Dropdown.d.ts +1 -1
  76. package/lib/inputs/multiSelect/helper.d.ts +1 -1
  77. package/lib/inputs/multiSelect/index.d.ts +1 -1
  78. package/lib/inputs/multiSelect/types.d.ts +2 -2
  79. package/lib/inputs/number/BaseNumber.d.ts +1 -1
  80. package/lib/inputs/number/Currency.d.ts +1 -1
  81. package/lib/inputs/number/Decimal.d.ts +1 -1
  82. package/lib/inputs/number/index.d.ts +1 -1
  83. package/lib/inputs/number/types.d.ts +3 -3
  84. package/lib/inputs/period/Dialog.d.ts +1 -1
  85. package/lib/inputs/period/Dropdown.d.ts +1 -1
  86. package/lib/inputs/period/PeriodList.d.ts +1 -1
  87. package/lib/inputs/period/helper.d.ts +1 -1
  88. package/lib/inputs/period/index.d.ts +1 -1
  89. package/lib/inputs/period/index.js +10 -8
  90. package/lib/inputs/period/types.d.ts +5 -2
  91. package/lib/inputs/search/index.d.ts +1 -1
  92. package/lib/inputs/select/ActionButtons.d.ts +1 -1
  93. package/lib/inputs/select/Dropdown.d.ts +1 -1
  94. package/lib/inputs/select/helper.d.ts +1 -1
  95. package/lib/inputs/select/index.d.ts +1 -1
  96. package/lib/inputs/select/multiple/Selecteds.d.ts +1 -1
  97. package/lib/inputs/select/multiple/index.d.ts +1 -1
  98. package/lib/inputs/select/simple/index.d.ts +1 -1
  99. package/lib/inputs/select/types.d.ts +1 -1
  100. package/lib/inputs/text/index.d.ts +1 -1
  101. package/lib/inputs/text/types.d.ts +3 -2
  102. package/lib/inputs/textarea/index.d.ts +1 -1
  103. package/lib/inputs/textarea/types.d.ts +1 -1
  104. package/lib/inputs/types.d.ts +1 -1
  105. package/lib/internals/types.d.ts +17 -1
  106. package/lib/internals/withTooltip.d.ts +12 -0
  107. package/lib/internals/withTooltip.js +172 -0
  108. package/lib/labels/DangerLabel.d.ts +0 -1
  109. package/lib/labels/DefaultLabel.d.ts +5 -3
  110. package/lib/labels/DefaultLabel.js +7 -15
  111. package/lib/labels/InfoLabel.d.ts +0 -1
  112. package/lib/labels/PrimaryLabel.d.ts +0 -1
  113. package/lib/labels/SuccessLabel.d.ts +0 -1
  114. package/lib/labels/WarningLabel.d.ts +0 -1
  115. package/lib/labels/index.d.ts +2 -3
  116. package/lib/labels/types.d.ts +5 -2
  117. package/lib/list/Header.d.ts +0 -1
  118. package/lib/list/Item.d.ts +5 -3
  119. package/lib/list/Item.js +12 -17
  120. package/lib/list/helpers.d.ts +0 -1
  121. package/lib/list/index.d.ts +0 -1
  122. package/lib/list/types.d.ts +6 -4
  123. package/lib/menus/sidenav/ExpandMenu.d.ts +2 -2
  124. package/lib/menus/sidenav/MenuLink.d.ts +7 -4
  125. package/lib/menus/sidenav/MenuLink.js +11 -20
  126. package/lib/menus/sidenav/NavMenuGroup.d.ts +2 -2
  127. package/lib/menus/sidenav/NavMenuItem.d.ts +7 -4
  128. package/lib/menus/sidenav/NavMenuItem.js +12 -16
  129. package/lib/menus/sidenav/NavSubMenuItem.d.ts +2 -2
  130. package/lib/menus/sidenav/helpers.d.ts +2 -2
  131. package/lib/menus/sidenav/index.d.ts +2 -2
  132. package/lib/menus/sidenav/popup_menu_search/EmptyList.d.ts +2 -2
  133. package/lib/menus/sidenav/popup_menu_search/index.d.ts +2 -2
  134. package/lib/menus/sidenav/types.d.ts +6 -6
  135. package/lib/popover/PopoverText.js +2 -11
  136. package/lib/popover/index.js +0 -1
  137. package/lib/popover/types.d.ts +0 -1
  138. package/lib/textContent/index.d.ts +11 -6
  139. package/lib/textContent/index.js +11 -20
  140. package/lib/tooltip/index.d.ts +3 -4
  141. package/lib/tooltip/index.js +53 -36
  142. package/lib/tooltip/types.d.ts +3 -25
  143. package/package.json +2 -3
  144. package/lib/BaseMask-04df8f20.d.ts +0 -24
  145. package/lib/BaseNumber-c609c5a0.d.ts +0 -23
  146. package/lib/Cnpj-5471cb1f.d.ts +0 -18
  147. package/lib/Cpf-71c4f0f4.d.ts +0 -18
  148. package/lib/Currency-38d14ff7.d.ts +0 -18
  149. package/lib/Decimal-85d45244.d.ts +0 -13
  150. package/lib/Number-db3c092d.d.ts +0 -20
  151. package/lib/Phone-4c4142e4.d.ts +0 -18
  152. package/lib/ZipCode-dc7dd4da.d.ts +0 -13
  153. package/lib/assets/styles/checkbox2.scss +0 -199
  154. package/lib/assets/styles/datepicker2.scss +0 -338
  155. package/lib/assets/styles/selectfield.scss +0 -409
  156. package/lib/assets/styles/slot.scss +0 -34
  157. package/lib/assets/styles/textfield.scss +0 -148
  158. package/lib/calendar/base/Day.d.ts +0 -8
  159. package/lib/calendar/base/Day.js +0 -36
  160. package/lib/calendar/base/Month.d.ts +0 -8
  161. package/lib/calendar/base/Month.js +0 -39
  162. package/lib/calendar/base/Week.d.ts +0 -8
  163. package/lib/calendar/base/Week.js +0 -35
  164. package/lib/form2/helpers.d.ts +0 -8
  165. package/lib/form2/helpers.js +0 -41
  166. package/lib/form2/index.d.ts +0 -9
  167. package/lib/form2/index.js +0 -36
  168. package/lib/form2/types.d.ts +0 -125
  169. package/lib/form2/types.js +0 -5
  170. package/lib/form2/useForm/index.d.ts +0 -5
  171. package/lib/form2/useForm/index.js +0 -203
  172. package/lib/index-368f781f.d.ts +0 -15
  173. package/lib/index-379b7504.d.ts +0 -44
  174. package/lib/index-7cb5e8b3.d.ts +0 -41
  175. package/lib/index-809a7899.d.ts +0 -23
  176. package/lib/index-c9247c1f.d.ts +0 -15
  177. package/lib/index-de21a05e.d.ts +0 -23
  178. package/lib/inputs2/checkboxfield/index.d.ts +0 -7
  179. package/lib/inputs2/checkboxfield/index.js +0 -146
  180. package/lib/inputs2/colorfield/index.d.ts +0 -9
  181. package/lib/inputs2/colorfield/index.js +0 -119
  182. package/lib/inputs2/date/base/constants.d.ts +0 -7
  183. package/lib/inputs2/date/base/constants.js +0 -43
  184. package/lib/inputs2/date/base/index.d.ts +0 -12
  185. package/lib/inputs2/date/base/index.js +0 -179
  186. package/lib/inputs2/date/datefield/calendarbox.d.ts +0 -7
  187. package/lib/inputs2/date/datefield/calendarbox.js +0 -115
  188. package/lib/inputs2/date/datefield/context.d.ts +0 -13
  189. package/lib/inputs2/date/datefield/context.js +0 -15
  190. package/lib/inputs2/date/datefield/index.d.ts +0 -9
  191. package/lib/inputs2/date/datefield/index.js +0 -334
  192. package/lib/inputs2/date/datefield/triggers.d.ts +0 -8
  193. package/lib/inputs2/date/datefield/triggers.js +0 -47
  194. package/lib/inputs2/date/datefield/types.d.ts +0 -61
  195. package/lib/inputs2/date/datefield/types.js +0 -5
  196. package/lib/inputs2/date/dateperiodfield/calendarbox.d.ts +0 -7
  197. package/lib/inputs2/date/dateperiodfield/calendarbox.js +0 -136
  198. package/lib/inputs2/date/dateperiodfield/context.d.ts +0 -13
  199. package/lib/inputs2/date/dateperiodfield/context.js +0 -17
  200. package/lib/inputs2/date/dateperiodfield/index.d.ts +0 -9
  201. package/lib/inputs2/date/dateperiodfield/index.js +0 -592
  202. package/lib/inputs2/date/dateperiodfield/triggers.d.ts +0 -6
  203. package/lib/inputs2/date/dateperiodfield/triggers.js +0 -120
  204. package/lib/inputs2/date/dateperiodfield/types.d.ts +0 -99
  205. package/lib/inputs2/date/dateperiodfield/types.js +0 -19
  206. package/lib/inputs2/date/helpers.d.ts +0 -20
  207. package/lib/inputs2/date/helpers.js +0 -62
  208. package/lib/inputs2/date/types.d.ts +0 -59
  209. package/lib/inputs2/date/types.js +0 -19
  210. package/lib/inputs2/index.d.ts +0 -29
  211. package/lib/inputs2/index.js +0 -38
  212. package/lib/inputs2/mask/BaseMask.d.ts +0 -10
  213. package/lib/inputs2/mask/BaseMask.js +0 -95
  214. package/lib/inputs2/mask/Cnpj.d.ts +0 -11
  215. package/lib/inputs2/mask/Cnpj.js +0 -57
  216. package/lib/inputs2/mask/Cpf.d.ts +0 -11
  217. package/lib/inputs2/mask/Cpf.js +0 -53
  218. package/lib/inputs2/mask/Phone.d.ts +0 -11
  219. package/lib/inputs2/mask/Phone.js +0 -26
  220. package/lib/inputs2/mask/ZipCode.d.ts +0 -11
  221. package/lib/inputs2/mask/ZipCode.js +0 -23
  222. package/lib/inputs2/mask/helpers.d.ts +0 -4
  223. package/lib/inputs2/mask/helpers.js +0 -57
  224. package/lib/inputs2/number/BaseNumber.d.ts +0 -10
  225. package/lib/inputs2/number/BaseNumber.js +0 -86
  226. package/lib/inputs2/number/Currency.d.ts +0 -11
  227. package/lib/inputs2/number/Currency.js +0 -47
  228. package/lib/inputs2/number/Decimal.d.ts +0 -11
  229. package/lib/inputs2/number/Decimal.js +0 -36
  230. package/lib/inputs2/number/Number.d.ts +0 -9
  231. package/lib/inputs2/number/Number.js +0 -49
  232. package/lib/inputs2/number/format_number.d.ts +0 -5
  233. package/lib/inputs2/number/format_number.js +0 -29
  234. package/lib/inputs2/selectfield/context.d.ts +0 -38
  235. package/lib/inputs2/selectfield/context.js +0 -15
  236. package/lib/inputs2/selectfield/helpers.d.ts +0 -6
  237. package/lib/inputs2/selectfield/helpers.js +0 -25
  238. package/lib/inputs2/selectfield/index.d.ts +0 -10
  239. package/lib/inputs2/selectfield/index.js +0 -491
  240. package/lib/inputs2/selectfield/item.d.ts +0 -11
  241. package/lib/inputs2/selectfield/item.js +0 -85
  242. package/lib/inputs2/selectfield/listbox.d.ts +0 -7
  243. package/lib/inputs2/selectfield/listbox.js +0 -103
  244. package/lib/inputs2/selectfield/search.d.ts +0 -7
  245. package/lib/inputs2/selectfield/search.js +0 -71
  246. package/lib/inputs2/selectfield/selections.d.ts +0 -10
  247. package/lib/inputs2/selectfield/selections.js +0 -86
  248. package/lib/inputs2/selectfield/triggers.d.ts +0 -8
  249. package/lib/inputs2/selectfield/triggers.js +0 -100
  250. package/lib/inputs2/selectfield/types.d.ts +0 -55
  251. package/lib/inputs2/selectfield/types.js +0 -21
  252. package/lib/inputs2/slot/index.d.ts +0 -14
  253. package/lib/inputs2/slot/index.js +0 -47
  254. package/lib/inputs2/textfield/index.d.ts +0 -8
  255. package/lib/inputs2/textfield/index.js +0 -159
  256. package/lib/tooltip/TooltipContent.d.ts +0 -7
  257. package/lib/tooltip/TooltipContent.js +0 -65
  258. package/lib/tooltip/useTooltip.d.ts +0 -30
  259. package/lib/tooltip/useTooltip.js +0 -128
@@ -5,7 +5,6 @@ import '../@types/Position.js';
5
5
  import '../@types/Size.js';
6
6
  import '../@types/Icon.js';
7
7
  import '../icons/helper.js';
8
- import '../tooltip/types.js';
9
8
 
10
9
  declare const PrimaryButton: ({ customClass, ...rest }: IButtonProps) => JSX.Element;
11
10
 
@@ -5,7 +5,6 @@ import '../@types/Position.js';
5
5
  import '../@types/Size.js';
6
6
  import '../@types/Icon.js';
7
7
  import '../icons/helper.js';
8
- import '../tooltip/types.js';
9
8
 
10
9
  declare const RestoreButton: (props: IButtonProps) => JSX.Element;
11
10
 
@@ -5,7 +5,6 @@ import '../@types/Position.js';
5
5
  import '../@types/Size.js';
6
6
  import '../@types/Icon.js';
7
7
  import '../icons/helper.js';
8
- import '../tooltip/types.js';
9
8
 
10
9
  declare const SaveButton: ({ customClass, ...rest }: IButtonProps) => JSX.Element;
11
10
 
@@ -5,7 +5,6 @@ import '../@types/Position.js';
5
5
  import '../@types/Size.js';
6
6
  import '../@types/Icon.js';
7
7
  import '../icons/helper.js';
8
- import '../tooltip/types.js';
9
8
 
10
9
  declare const SuccessButton: ({ customClass, ...rest }: IButtonProps) => JSX.Element;
11
10
 
@@ -5,7 +5,6 @@ import '../@types/Position.js';
5
5
  import '../@types/Size.js';
6
6
  import '../@types/Icon.js';
7
7
  import '../icons/helper.js';
8
- import '../tooltip/types.js';
9
8
 
10
9
  declare const WarningButton: ({ customClass, ...rest }: IButtonProps) => JSX.Element;
11
10
 
@@ -20,7 +20,6 @@ import '../@types/PermissionAttr.js';
20
20
  import '../@types/Size.js';
21
21
  import '../@types/Icon.js';
22
22
  import '../icons/helper.js';
23
- import '../tooltip/types.js';
24
23
 
25
24
 
26
25
 
@@ -5,7 +5,6 @@ import '../../@types/Position.js';
5
5
  import '../../@types/Size.js';
6
6
  import '../../@types/Icon.js';
7
7
  import '../../icons/helper.js';
8
- import '../../tooltip/types.js';
9
8
 
10
9
  declare const SplitButton: (props: ISplitButtonProps) => JSX.Element;
11
10
 
@@ -3,10 +3,9 @@ import { PermissionAttr } from '../@types/PermissionAttr.js';
3
3
  import { Position } from '../@types/Position.js';
4
4
  import { Size } from '../@types/Size.js';
5
5
  import { IconNames } from '../@types/Icon.js';
6
- import { ITooltipCommonProps } from '../tooltip/types.js';
7
6
  import '../icons/helper.js';
8
7
 
9
- interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, ITooltipCommonProps {
8
+ interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
10
9
  label?: string;
11
10
  activeIconColor?: string;
12
11
  toggleable?: boolean;
@@ -33,6 +32,10 @@ interface IButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, ITooltip
33
32
  permissionAttr?: PermissionAttr | PermissionAttr[];
34
33
  transparent?: boolean;
35
34
  skeletonize?: boolean;
35
+ tooltipPosition?: Exclude<Position, 'center'>;
36
+ tooltipWidth?: string | number;
37
+ space?: number;
38
+ tooltip?: string;
36
39
  split?: boolean;
37
40
  isFloatMenu?: boolean;
38
41
  customClassForDropdown?: string;
@@ -4,21 +4,20 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ require("../../assets/styles/calendar.scss");
7
8
  var _react = _interopRequireWildcard(require("react"));
8
- var _uuid = require("uuid");
9
9
  var _moment = _interopRequireDefault(require("moment"));
10
- var _Month = _interopRequireDefault(require("./Month"));
11
- var _buttons = _interopRequireDefault(require("../../buttons"));
10
+ var _uuid = require("uuid");
12
11
  var _gridlayout = _interopRequireDefault(require("../../gridlayout"));
12
+ var _buttons = _interopRequireDefault(require("../../buttons"));
13
13
  var _helpers = require("./helpers");
14
- require("../../assets/styles/calendar.scss");
15
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
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); }
17
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; }
18
17
  const arrowKeys = ['ArrowUp', 'ArrowRight', 'ArrowDown', 'ArrowLeft'];
19
18
  const Calendar = props => {
20
19
  const {
21
- currentDate = (0, _moment.default)(),
20
+ currentDate: currentDateProp = (0, _moment.default)(),
22
21
  onDateChange,
23
22
  drawGridLines = false,
24
23
  colorStyle,
@@ -28,46 +27,98 @@ const Calendar = props => {
28
27
  currentDateButton,
29
28
  calendarContainer
30
29
  } = props;
31
- const currentMonth = (0, _react.useRef)(null);
32
30
  const currentCalendarRef = (0, _react.useRef)(null);
33
- const [dataAtual, setDataAtual] = (0, _react.useState)((0, _helpers.validDate)(currentDate));
31
+ const calendarMonthsContainerRef = (0, _react.useRef)(null);
32
+ const currentDaySelectedContainerRef = (0, _react.useRef)(null);
33
+ const [currentDate, setCurrentDate] = (0, _react.useState)(currentDateProp);
34
+ const [currentMonth, setCurrentMonth] = (0, _react.useState)((0, _moment.default)(currentDateProp).format('MM-YYYY'));
34
35
  const onDateChangeFunction = date => {
36
+ setCurrentDate(date);
35
37
  if (onDateChange) onDateChange(date);
36
- setDataAtual(date);
37
38
  };
38
- const previousMonth = () => {
39
- const currentDateClone = dataAtual.clone();
40
- setDataAtual(currentDateClone.subtract(1, 'month'));
39
+ const createCalendarWithWeeksAndDays = () => {
40
+ const firstDayOfMonth = (0, _moment.default)(currentMonth, 'MM-YYYY').startOf('month');
41
+ const lastDayOfMonth = (0, _moment.default)(currentMonth, 'MM-YYYY').endOf('month');
42
+ const startDate = firstDayOfMonth.clone().startOf('week');
43
+ const endDate = lastDayOfMonth.clone().endOf('week');
44
+ const days = [];
45
+ const day = startDate.clone();
46
+ while (day.isBefore(endDate, 'day') || day.isSame(endDate, 'day')) {
47
+ days.push({
48
+ date: day.clone(),
49
+ isDaySelected: day.isSame(currentDate)
50
+ });
51
+ day.add(1, 'day');
52
+ }
53
+ return days;
41
54
  };
42
- const nextMonth = () => {
43
- const currentDateClone = dataAtual.clone();
44
- setDataAtual(currentDateClone.add(1, 'month'));
55
+ const changeMonth = amountMonthsToChange => {
56
+ const newDate = (0, _moment.default)(currentMonth, 'MM-YYYY').add(amountMonthsToChange, 'month').format('MM-YYYY');
57
+ setCurrentMonth(newDate);
58
+ };
59
+ const getFirstOrLastDayButtonOfCalendar = function () {
60
+ let firstOrLast = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'first';
61
+ const listOfButtons = currentCalendarRef.current?.getElementsByClassName('daybutton') || [];
62
+ if (firstOrLast === 'first') return listOfButtons[0];
63
+ if (firstOrLast === 'last') return listOfButtons[listOfButtons.length - 1];
45
64
  };
46
65
  const navigateWithArrows = event => {
47
- const sourceTarget = event.target;
48
- const daysOfMonth = currentMonth.current?.getElementsByClassName('daybutton');
49
66
  let indexCurrentDay = 0;
50
- if (daysOfMonth.length) {
51
- Array.from(daysOfMonth).find((dayButton, index) => {
52
- if (dayButton && dayButton.id === sourceTarget.id) indexCurrentDay = index;
53
- });
67
+ const eventTarget = event.target;
68
+ indexCurrentDay = Number(eventTarget.getAttribute('data-day-index') || 0);
69
+ const containerDaySelected = currentCalendarRef.current?.getElementsByClassName('-selectedday');
70
+ const buttonDaySelected = containerDaySelected?.[0]?.firstChild;
71
+ const daysOfMonth = currentCalendarRef.current?.getElementsByClassName('daybutton');
72
+ const lastDayButtonElement = getFirstOrLastDayButtonOfCalendar('last');
73
+ if (!currentCalendarRef.current?.contains(document.activeElement)) {
74
+ if (currentCalendarRef.current?.contains(buttonDaySelected)) {
75
+ buttonDaySelected.focus();
76
+ indexCurrentDay = Number(buttonDaySelected.getAttribute('data-day-index') || 0);
77
+ }
78
+ }
79
+ if (calendarMonthsContainerRef.current?.contains(document.activeElement)) {
80
+ const element = {
81
+ ArrowUp: daysOfMonth[indexCurrentDay - 7],
82
+ ArrowRight: daysOfMonth[indexCurrentDay + 1],
83
+ ArrowDown: daysOfMonth[indexCurrentDay + 7],
84
+ ArrowLeft: daysOfMonth[indexCurrentDay - 1]
85
+ }[event.code];
86
+ if (element) element.focus();
87
+ const lastButtonElementIndex = Number(lastDayButtonElement?.getAttribute('data-day-index') || 0);
88
+ if (indexCurrentDay === 0 && event.code === 'ArrowLeft') {
89
+ setCurrentMonth(prevState => {
90
+ return (0, _moment.default)(prevState, 'MM-YYYY').subtract(1, 'month').format('MM-YYYY');
91
+ });
92
+ setTimeout(() => {
93
+ getFirstOrLastDayButtonOfCalendar('last')?.focus();
94
+ }, 1);
95
+ }
96
+ if (indexCurrentDay === lastButtonElementIndex && event.code === 'ArrowRight') {
97
+ setCurrentMonth(prevState => {
98
+ return (0, _moment.default)(prevState, 'MM-YYYY').add(1, 'month').format('MM-YYYY');
99
+ });
100
+ setTimeout(() => {
101
+ getFirstOrLastDayButtonOfCalendar('first')?.focus();
102
+ }, 1);
103
+ }
104
+ } else {
105
+ if (calendarMonthsContainerRef.current?.contains(buttonDaySelected)) {
106
+ buttonDaySelected.focus();
107
+ } else {
108
+ getFirstOrLastDayButtonOfCalendar('first')?.focus();
109
+ }
54
110
  }
55
- const element = {
56
- ArrowUp: daysOfMonth[indexCurrentDay - 7],
57
- ArrowRight: daysOfMonth[indexCurrentDay + 1],
58
- ArrowDown: daysOfMonth[indexCurrentDay + 7],
59
- ArrowLeft: daysOfMonth[indexCurrentDay - 1]
60
- }[event.code];
61
- if (element) element.focus();
62
111
  };
63
112
  const contextValues = {
64
113
  handleDateChange: onDateChangeFunction
65
114
  };
66
115
  (0, _react.useEffect)(() => {
116
+ setCurrentDate((0, _helpers.validDate)(currentDateProp));
67
117
  calendarContainer?.(currentCalendarRef?.current);
68
- setDataAtual((0, _helpers.validDate)(currentDate));
118
+ }, []);
119
+ (0, _react.useEffect)(() => {
69
120
  document.addEventListener('keydown', event => {
70
- if (event && event.code && arrowKeys.includes(event.code) && currentCalendarRef.current && currentCalendarRef.current.contains(document.activeElement) && currentMonth.current && currentMonth.current.contains(document.activeElement)) {
121
+ if (event && event.code && arrowKeys.includes(event.code) && document.contains(currentCalendarRef.current)) {
71
122
  navigateWithArrows(event);
72
123
  event.stopPropagation();
73
124
  event.preventDefault();
@@ -77,12 +128,10 @@ const Calendar = props => {
77
128
  document.removeEventListener('keydown', () => {});
78
129
  };
79
130
  }, []);
80
- (0, _react.useEffect)(() => {
81
- const daysOfMonth = currentMonth.current?.getElementsByClassName('-selectedday')[0];
82
- currentDateButton?.(daysOfMonth.firstChild);
83
- }, [currentDate]);
84
131
  const component = /*#__PURE__*/_react.default.createElement("div", {
85
132
  ref: currentCalendarRef,
133
+ role: "grid",
134
+ "aria-label": String('calendar-container-').concat((0, _uuid.v1)()),
86
135
  className: (0, _helpers.getCalendarCssClass)({
87
136
  unpadding,
88
137
  drawGridLines,
@@ -93,30 +142,54 @@ const Calendar = props => {
93
142
  className: "calendarheader"
94
143
  }, /*#__PURE__*/_react.default.createElement(_buttons.default, {
95
144
  id: (0, _uuid.v1)(),
145
+ tabIndex: -1,
96
146
  boxShadow: false,
97
147
  iconName: "arrow_left",
98
148
  customClass: "navbutton nav-arrow-left",
99
149
  onClick: () => {
100
- previousMonth();
150
+ changeMonth(-1);
101
151
  }
102
152
  }), /*#__PURE__*/_react.default.createElement("span", {
103
153
  className: "monthname"
104
- }, dataAtual.format('MMMM YYYY')), /*#__PURE__*/_react.default.createElement(_buttons.default, {
154
+ }, (0, _moment.default)(currentMonth, 'MM-YYYY').format('MMMM YYYY')), /*#__PURE__*/_react.default.createElement(_buttons.default, {
105
155
  id: (0, _uuid.v1)(),
156
+ tabIndex: -1,
106
157
  boxShadow: false,
107
158
  iconName: "arrow_right",
108
159
  customClass: "navbutton nav-arrow-right",
109
160
  onClick: () => {
110
- nextMonth();
161
+ changeMonth(1);
111
162
  }
112
163
  })), /*#__PURE__*/_react.default.createElement("div", {
113
164
  className: "daynames"
114
165
  }, (0, _helpers.dayNames)().map(name => /*#__PURE__*/_react.default.createElement("div", {
115
166
  key: `day-${name}`
116
- }, name))), /*#__PURE__*/_react.default.createElement(_Month.default, {
117
- monthRef: currentMonth,
118
- currentDate: dataAtual
119
- }));
167
+ }, name))), /*#__PURE__*/_react.default.createElement("div", {
168
+ ref: calendarMonthsContainerRef,
169
+ className: "calendarmonth"
170
+ }, /*#__PURE__*/_react.default.createElement("div", {
171
+ className: "monthweek"
172
+ }, createCalendarWithWeeksAndDays().map((_ref, index) => {
173
+ let {
174
+ date,
175
+ isDaySelected
176
+ } = _ref;
177
+ return /*#__PURE__*/_react.default.createElement("div", {
178
+ key: date.format('YYYY-MM-DD'),
179
+ ref: isDaySelected ? currentDaySelectedContainerRef : undefined,
180
+ className: (0, _helpers.getDayContainerCssClass)(currentDate, date)
181
+ }, /*#__PURE__*/_react.default.createElement(_buttons.default, {
182
+ "data-day-index": index,
183
+ id: (0, _uuid.v1)(),
184
+ type: "button",
185
+ buttonRef: ref => isDaySelected && ref ? currentDateButton?.(ref) : undefined,
186
+ tabIndex: -1,
187
+ boxShadow: false,
188
+ label: date.date().toString(),
189
+ onClick: () => onDateChangeFunction(date),
190
+ customClass: ` ${(0, _helpers.getDayCssClass)(currentDate, date)} numberdaycalendar`
191
+ }));
192
+ }))));
120
193
  return /*#__PURE__*/_react.default.createElement(_helpers.CalendarContext.Provider, {
121
194
  value: contextValues
122
195
  }, !gridLayout ? component : /*#__PURE__*/_react.default.createElement(_gridlayout.default, {
@@ -6,7 +6,7 @@ import '../@types/DataCombo.js';
6
6
  import '../@types/PermissionAttr.js';
7
7
  import '../inputs/base/types.js';
8
8
  import '../@types/Period.js';
9
- import '../tooltip/types.js';
9
+ import '../internals/types.js';
10
10
  import '../@types/Position.js';
11
11
 
12
12
  declare const _default: React__default.ForwardRefExoticComponent<Pick<IFieldProps & React__default.RefAttributes<unknown>, "key" | keyof IFieldProps> & React__default.RefAttributes<HTMLElement>>;
@@ -6,7 +6,7 @@ import '../@types/DataCombo.js';
6
6
  import '../@types/PermissionAttr.js';
7
7
  import '../inputs/base/types.js';
8
8
  import '../@types/Period.js';
9
- import '../tooltip/types.js';
9
+ import '../internals/types.js';
10
10
  import '../@types/Position.js';
11
11
 
12
12
  declare const _default: React__default.ForwardRefExoticComponent<IFieldArrayProps & React__default.RefAttributes<HTMLElement>>;
@@ -6,7 +6,7 @@ import '../@types/DataCombo.js';
6
6
  import '../@types/PermissionAttr.js';
7
7
  import '../inputs/base/types.js';
8
8
  import '../@types/Period.js';
9
- import '../tooltip/types.js';
9
+ import '../internals/types.js';
10
10
  import '../@types/Position.js';
11
11
 
12
12
  declare const _default: React__default.ForwardRefExoticComponent<IFieldProps & React__default.RefAttributes<HTMLElement>>;
@@ -6,7 +6,7 @@ import '../@types/DataCombo.js';
6
6
  import '../@types/PermissionAttr.js';
7
7
  import '../inputs/base/types.js';
8
8
  import '../@types/Period.js';
9
- import '../tooltip/types.js';
9
+ import '../internals/types.js';
10
10
  import '../@types/Position.js';
11
11
 
12
12
  declare const _default: React__default.ForwardRefExoticComponent<IFieldPeriodProps & React__default.RefAttributes<HTMLElement>>;
@@ -6,7 +6,7 @@ import '../@types/DataCombo.js';
6
6
  import '../@types/PermissionAttr.js';
7
7
  import '../inputs/base/types.js';
8
8
  import '../@types/Period.js';
9
- import '../tooltip/types.js';
9
+ import '../internals/types.js';
10
10
  import '../@types/Position.js';
11
11
 
12
12
  declare const securityBeforeUnload = "securityBeforeUnload";
@@ -10,7 +10,7 @@ import '../@types/DataCombo.js';
10
10
  import '../@types/PermissionAttr.js';
11
11
  import '../inputs/base/types.js';
12
12
  import '../@types/Period.js';
13
- import '../tooltip/types.js';
13
+ import '../internals/types.js';
14
14
  import '../@types/Position.js';
15
15
 
16
16
  declare const Form: ({ submitOnPressEnterKey, dataSource, securityBeforeUnload, handlerReset, handlerSubmit, handlerValidates, style, customClass, securityTitle, securityText, securityData, onDataChange, onValidateForm, externalFieldErrors, onSubmit, skeletonize, disabled, children, useInternalState, onValidateErrorsOnTab, }: FormProps) => JSX.Element;
@@ -5,7 +5,7 @@ import '../@types/DataCombo.js';
5
5
  import '../@types/PermissionAttr.js';
6
6
  import '../inputs/base/types.js';
7
7
  import '../@types/Period.js';
8
- import '../tooltip/types.js';
8
+ import '../internals/types.js';
9
9
  import '../@types/Position.js';
10
10
 
11
11
  type Validator = (value: string) => string | undefined;
@@ -6,7 +6,7 @@ import '../@types/DataCombo.js';
6
6
  import '../@types/PermissionAttr.js';
7
7
  import '../inputs/base/types.js';
8
8
  import '../@types/Period.js';
9
- import '../tooltip/types.js';
9
+ import '../internals/types.js';
10
10
  import '../@types/Position.js';
11
11
 
12
12
  declare const withFieldHOC: <ComponentProps extends WithFieldProps>(WrappedComponent: React__default.ComponentType<ComponentProps>) => React__default.ForwardRefExoticComponent<React__default.PropsWithoutRef<ComponentProps> & React__default.RefAttributes<HTMLElement>>;
@@ -6,7 +6,7 @@ import '../@types/DataCombo.js';
6
6
  import '../@types/PermissionAttr.js';
7
7
  import '../inputs/base/types.js';
8
8
  import '../@types/Period.js';
9
- import '../tooltip/types.js';
9
+ import '../internals/types.js';
10
10
  import '../@types/Position.js';
11
11
 
12
12
  declare const FormSecurityContext: React__default.Context<IFormSecurityContext>;
@@ -631,10 +631,6 @@ declare const _default: {
631
631
  viewbox: string;
632
632
  paths: string[];
633
633
  };
634
- clipboard: {
635
- viewbox: string;
636
- paths: string[];
637
- };
638
634
  };
639
635
 
640
636
  export { _default as default };
@@ -636,9 +636,5 @@ var _default = exports.default = {
636
636
  earth: {
637
637
  viewbox: '0 0 16 16',
638
638
  paths: ['M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 15c-0.984 0-1.92-0.203-2.769-0.57l3.643-4.098c0.081-0.092 0.126-0.21 0.126-0.332v-1.5c0-0.276-0.224-0.5-0.5-0.5-1.765 0-3.628-1.835-3.646-1.854-0.094-0.094-0.221-0.146-0.354-0.146h-2c-0.276 0-0.5 0.224-0.5 0.5v3c0 0.189 0.107 0.363 0.276 0.447l1.724 0.862v2.936c-1.813-1.265-3-3.366-3-5.745 0-1.074 0.242-2.091 0.674-3h1.826c0.133 0 0.26-0.053 0.354-0.146l2-2c0.094-0.094 0.146-0.221 0.146-0.354v-1.21c0.634-0.189 1.305-0.29 2-0.29 1.1 0 2.141 0.254 3.067 0.706-0.065 0.055-0.128 0.112-0.188 0.172-0.567 0.567-0.879 1.32-0.879 2.121s0.312 1.555 0.879 2.121c0.569 0.569 1.332 0.879 2.119 0.879 0.049 0 0.099-0.001 0.149-0.004 0.216 0.809 0.605 2.917-0.131 5.818-0.007 0.027-0.011 0.055-0.013 0.082-1.271 1.298-3.042 2.104-5.002 2.104z']
639
- },
640
- clipboard: {
641
- viewbox: '0 0 16 16',
642
- paths: ['M14.5 2h-4.5c0-1.105-0.895-2-2-2s-2 0.895-2 2h-4.5c-0.276 0-0.5 0.224-0.5 0.5v13c0 0.276 0.224 0.5 0.5 0.5h13c0.276 0 0.5-0.224 0.5-0.5v-13c0-0.276-0.224-0.5-0.5-0.5zM8 1c0.552 0 1 0.448 1 1s-0.448 1-1 1c-0.552 0-1-0.448-1-1s0.448-1 1-1zM14 15h-12v-12h2v1.5c0 0.276 0.224 0.5 0.5 0.5h7c0.276 0 0.5-0.224 0.5-0.5v-1.5h2v12z', 'M11.5 9h-7c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h7c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z', 'M11.5 11h-7c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h7c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z', 'M11.5 13h-7c-0.276 0-0.5-0.224-0.5-0.5s0.224-0.5 0.5-0.5h7c0.276 0 0.5 0.224 0.5 0.5s-0.224 0.5-0.5 0.5z']
643
639
  }
644
640
  };
@@ -4,10 +4,12 @@ import '../@types/PointerEvents.js';
4
4
  import '../@types/SizePixels.js';
5
5
  import '../@types/Icon.js';
6
6
  import './helper.js';
7
- import '../@types/ColorStyles.js';
8
- import '../tooltip/types.js';
9
7
  import '../@types/Position.js';
8
+ import '../@types/ColorStyles.js';
10
9
 
11
- declare const Icon: ({ name, onClick, svgStruct, size, style, visible, disabled, customClass, customClassForContainer, colorStyle, color, viewBox, pointerEvents, tooltip, tooltipPosition, tooltipWidth, }: IconProps) => JSX.Element | null;
10
+ declare const _default: {
11
+ (props: IconProps): JSX.Element;
12
+ displayName: string;
13
+ };
12
14
 
13
- export { Icon as default };
15
+ export { _default as default };
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
8
  var _helper = _interopRequireDefault(require("./helper"));
9
+ var _withTooltip = _interopRequireDefault(require("../internals/withTooltip"));
9
10
  require("../assets/styles/icon.scss");
10
- var _tooltip = require("../tooltip");
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  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); }
13
13
  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; }
@@ -28,13 +28,11 @@ const Icon = _ref => {
28
28
  color,
29
29
  viewBox,
30
30
  pointerEvents = 'none',
31
- tooltip,
32
- tooltipPosition,
33
- tooltipWidth
31
+ targetRef,
32
+ tooltip
34
33
  } = _ref;
35
34
  const isUsingColorStyle = colorStyle !== 'default';
36
35
  const colorFromProp = isUsingColorStyle || !color ? undefined : color;
37
- const containerRef = (0, _react.useRef)(null);
38
36
  const refSvg = (0, _react.useRef)(null);
39
37
  const viewBoxFromIconOrSvgStrcut = name ? listIcon[name].viewbox : svgStruct?.viewbox;
40
38
  const getPaths = () => name ? listIcon[name].paths : svgStruct?.paths;
@@ -65,14 +63,11 @@ const Icon = _ref => {
65
63
  if (!name && !svgStruct) throw new Error('One of the "name" and "svgStruct" props must be filled');
66
64
  if (!visible) return null;
67
65
  if (!tooltip) return getSvg();
68
- return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
66
+ return /*#__PURE__*/_react.default.createElement("div", {
69
67
  className: `icon-component-container ${customClassForContainer}`,
70
- ref: containerRef
71
- }, getSvg()), /*#__PURE__*/_react.default.createElement(_tooltip.Tooltip, {
72
- targetRef: containerRef,
73
- text: tooltip,
74
- width: tooltipWidth,
75
- position: tooltipPosition
76
- }));
68
+ ref: r => {
69
+ if (targetRef && r) targetRef(r);
70
+ }
71
+ }, getSvg());
77
72
  };
78
- var _default = exports.default = Icon;
73
+ var _default = exports.default = (0, _withTooltip.default)(Icon);
@@ -2,10 +2,9 @@ import { CSSProperties } from 'react';
2
2
  import { PointerEvents } from '../@types/PointerEvents.js';
3
3
  import { SizePixels } from '../@types/SizePixels.js';
4
4
  import { IconNames } from '../@types/Icon.js';
5
+ import { Position } from '../@types/Position.js';
5
6
  import { ColorStyles } from '../@types/ColorStyles.js';
6
- import { ITooltipCommonProps } from '../tooltip/types.js';
7
7
  import './helper.js';
8
- import '../@types/Position.js';
9
8
 
10
9
  type ListIconType = {
11
10
  [name: string]: {
@@ -17,7 +16,7 @@ type SvgStruct = {
17
16
  viewbox: string;
18
17
  paths: Array<string>;
19
18
  };
20
- type BaseIconProps = ITooltipCommonProps & {
19
+ type BaseIconProps = {
21
20
  size?: SizePixels;
22
21
  customClass?: string;
23
22
  customClassForContainer?: string;
@@ -27,6 +26,10 @@ type BaseIconProps = ITooltipCommonProps & {
27
26
  pointerEvents?: PointerEvents;
28
27
  viewBox?: string;
29
28
  onClick?: () => void;
29
+ tooltipPosition?: Exclude<Position, 'center'>;
30
+ tooltipWidth?: string | number;
31
+ tooltip?: string;
32
+ targetRef?: (ref: HTMLDivElement) => void;
30
33
  };
31
34
  type ColorProps = ({
32
35
  colorStyle?: ColorStyles | 'default';
package/lib/index.d.ts CHANGED
@@ -23,7 +23,6 @@ import './toolbar/Separator.js';
23
23
  import './toolbar/ButtonBar.js';
24
24
  import './toolbar/LabelBar.js';
25
25
  import './buttons/types.js';
26
- import './tooltip/types.js';
27
26
  import './labels/types.js';
28
27
  import './icons/types.js';
29
28
  import './@types/PointerEvents.js';
@@ -3,7 +3,7 @@ import 'react';
3
3
  import '../../@types/Align.js';
4
4
  import '../../@types/Period.js';
5
5
  import '../../@types/PermissionAttr.js';
6
- import '../../tooltip/types.js';
6
+ import '../../internals/types.js';
7
7
  import '../../@types/Position.js';
8
8
 
9
9
  declare const _default: (props: IBaseProps) => JSX.Element;
@@ -9,12 +9,12 @@ var _lodash = _interopRequireDefault(require("lodash"));
9
9
  var _inputHOC = _interopRequireDefault(require("../inputHOC"));
10
10
  require("../../assets/styles/input.scss");
11
11
  var helpers = _interopRequireWildcard(require("./helpers"));
12
+ var _withTooltip = _interopRequireDefault(require("../../internals/withTooltip"));
12
13
  var _permissionValidations = require("../../permissionValidations");
13
14
  var _hint = _interopRequireDefault(require("../../hint"));
14
15
  var _errorMessage = require("../errorMessage");
15
16
  var _textContent = _interopRequireDefault(require("../../textContent"));
16
- var _popover = _interopRequireWildcard(require("../../popover"));
17
- var _tooltip = require("../../tooltip");
17
+ var _popover = _interopRequireDefault(require("../../popover"));
18
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
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); }
20
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; }
@@ -51,6 +51,7 @@ const InputTextBase = props => {
51
51
  permissionAttr,
52
52
  onDeniedActions,
53
53
  handlerSetOnDenied,
54
+ targetRef,
54
55
  skeletonize = false,
55
56
  style,
56
57
  styleForInputContent,
@@ -72,10 +73,7 @@ const InputTextBase = props => {
72
73
  autoComplete = 'on',
73
74
  themePopover = 'light',
74
75
  popoverAlign = 'left',
75
- tabIndex,
76
- tooltip,
77
- tooltipPosition,
78
- tooltipWidth
76
+ tabIndex
79
77
  } = props;
80
78
  let propsInput;
81
79
  const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible, _permissionValidations.OPTIONS_ON_DENIED.readOnly, _permissionValidations.OPTIONS_ON_DENIED.hideContent];
@@ -86,7 +84,6 @@ const InputTextBase = props => {
86
84
  unvisible
87
85
  } = onDenied;
88
86
  const [showTooltip, setShowTooltip] = (0, _react.useState)(false);
89
- const inputElementRef = (0, _react.useRef)(null);
90
87
  (0, _react.useEffect)(() => {
91
88
  if (handlerSetOnDenied) handlerSetOnDenied(onDenied);
92
89
  }, []);
@@ -125,7 +122,7 @@ const InputTextBase = props => {
125
122
  inputRef(r);
126
123
  }
127
124
  }
128
- inputElementRef.current = r;
125
+ if (targetRef) targetRef(r);
129
126
  }
130
127
  };
131
128
  if (!disableCallbacks) {
@@ -207,7 +204,7 @@ const InputTextBase = props => {
207
204
  textAlign: textAlign === 'center' ? 'left' : textAlign
208
205
  }
209
206
  }, /*#__PURE__*/_react.default.createElement(_textContent.default, {
210
- ref: labelRef,
207
+ labelRef: labelRef,
211
208
  required: required,
212
209
  label: label,
213
210
  onHoverLabel: onHoverLabel,
@@ -237,9 +234,7 @@ const InputTextBase = props => {
237
234
  height: 'auto',
238
235
  width: 20
239
236
  }
240
- }, /*#__PURE__*/_react.default.createElement(_popover.PopoverText, {
241
- text: hint
242
- })))), /*#__PURE__*/_react.default.createElement(_textContent.default, null)), /*#__PURE__*/_react.default.createElement("div", {
237
+ }, hint))), /*#__PURE__*/_react.default.createElement(_textContent.default, null)), /*#__PURE__*/_react.default.createElement("div", {
243
238
  "data-testid": "testInputWrapper",
244
239
  style: styleForWrapper,
245
240
  className: helpers.getInputWrapperClass(_objectSpread(_objectSpread({}, props), {}, {
@@ -267,11 +262,6 @@ const InputTextBase = props => {
267
262
  description: hint
268
263
  }), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
269
264
  messages: errorMessages
270
- }), /*#__PURE__*/_react.default.createElement(_tooltip.Tooltip, {
271
- targetRef: inputElementRef,
272
- text: tooltip,
273
- width: tooltipWidth,
274
- position: tooltipPosition
275
265
  }));
276
266
  };
277
- var _default = exports.default = (0, _inputHOC.default)(InputTextBase);
267
+ var _default = exports.default = (0, _inputHOC.default)((0, _withTooltip.default)(InputTextBase));