linear-react-components-ui 1.1.20-beta.35 → 1.1.20-beta.37

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 (134) hide show
  1. package/lib/alerts/BaseAlert.js +1 -1
  2. package/lib/alerts/Message.js +1 -1
  3. package/lib/assets/styles/wizard.scss +88 -2
  4. package/lib/avatar/index.js +9 -8
  5. package/lib/badge/index.js +4 -4
  6. package/lib/buttons/DangerButton.js +1 -1
  7. package/lib/buttons/DefaultButton.js +22 -3
  8. package/lib/buttons/InfoButton.js +1 -1
  9. package/lib/buttons/PrimaryButton.js +1 -1
  10. package/lib/buttons/SuccessButton.js +1 -1
  11. package/lib/buttons/WarningButton.js +1 -1
  12. package/lib/buttons/button_container/index.js +1 -1
  13. package/lib/buttons/split_button/index.js +1 -1
  14. package/lib/calendar/base/Day.js +1 -1
  15. package/lib/calendar/base/Month.js +1 -1
  16. package/lib/calendar/base/helpers.js +2 -2
  17. package/lib/calendar/base/index.js +1 -1
  18. package/lib/checkbox/index.js +1 -1
  19. package/lib/dialog/Custom.js +1 -1
  20. package/lib/dialog/Question.js +2 -4
  21. package/lib/dialog/base/Content.js +1 -1
  22. package/lib/dialog/base/Header.js +2 -2
  23. package/lib/dialog/base/index.js +8 -5
  24. package/lib/dialog/form/index.js +2 -2
  25. package/lib/dialog/types.d.ts +2 -0
  26. package/lib/dialog/wizard/index.d.ts +1 -1
  27. package/lib/dialog/wizard/index.js +5 -3
  28. package/lib/dialog/wizard/progressbar.d.ts +2 -1
  29. package/lib/dialog/wizard/progressbar.js +5 -3
  30. package/lib/dialog/wizard/step.js +1 -1
  31. package/lib/drawer/Drawer.js +3 -3
  32. package/lib/drawer/Header.js +1 -1
  33. package/lib/dropdown/Popup.js +6 -6
  34. package/lib/dropdown/helper.js +1 -1
  35. package/lib/dropdown/withDropdown.js +2 -2
  36. package/lib/fieldset/index.js +7 -7
  37. package/lib/form/Field.js +3 -14
  38. package/lib/form/FieldArray.js +1 -1
  39. package/lib/form/FieldNumber.js +7 -10
  40. package/lib/form/FieldPeriod.js +2 -2
  41. package/lib/form/index.js +20 -15
  42. package/lib/gridlayout/GridCol.js +5 -5
  43. package/lib/gridlayout/GridRow.js +4 -1
  44. package/lib/hint/index.js +7 -1
  45. package/lib/icons/helper.d.ts +4 -0
  46. package/lib/icons/helper.js +4 -0
  47. package/lib/icons/index.js +24 -27
  48. package/lib/inputs/base/InputTextBase.js +6 -8
  49. package/lib/inputs/base/Label.js +1 -1
  50. package/lib/inputs/base/helpers.js +7 -3
  51. package/lib/inputs/date/helpers.js +4 -1
  52. package/lib/inputs/date/index.js +9 -15
  53. package/lib/inputs/errorMessage/index.js +1 -1
  54. package/lib/inputs/file/DefaultFile.js +5 -6
  55. package/lib/inputs/file/DragDropFile.js +15 -17
  56. package/lib/inputs/file/File.js +3 -4
  57. package/lib/inputs/mask/BaseMask.js +4 -1
  58. package/lib/inputs/mask/helpers.d.ts +1 -1
  59. package/lib/inputs/multiSelect/Dropdown.js +9 -10
  60. package/lib/inputs/multiSelect/helper.js +1 -2
  61. package/lib/inputs/multiSelect/index.js +7 -9
  62. package/lib/inputs/number/index.js +1 -2
  63. package/lib/inputs/period/PeriodList.js +1 -1
  64. package/lib/inputs/period/helper.js +3 -1
  65. package/lib/inputs/period/index.js +9 -14
  66. package/lib/inputs/search/index.js +1 -1
  67. package/lib/inputs/select/Dropdown.js +1 -1
  68. package/lib/inputs/select/helper.js +10 -13
  69. package/lib/inputs/select/multiple/Selecteds.js +1 -1
  70. package/lib/inputs/select/multiple/index.js +9 -14
  71. package/lib/inputs/select/simple/index.js +10 -17
  72. package/lib/inputs/textarea/index.js +1 -1
  73. package/lib/internals/withTooltip.js +9 -9
  74. package/lib/labelMessages/index.js +4 -3
  75. package/lib/labels/DefaultLabel.js +4 -1
  76. package/lib/labels/label_container/index.js +1 -1
  77. package/lib/list/Header.js +1 -1
  78. package/lib/list/Item.js +21 -11
  79. package/lib/list/index.js +2 -1
  80. package/lib/list/types.d.ts +2 -1
  81. package/lib/menus/float/MenuItem.js +2 -2
  82. package/lib/menus/float/SubMenuContainer.js +1 -1
  83. package/lib/menus/float/index.js +1 -1
  84. package/lib/menus/sidenav/ExpandMenu.js +1 -1
  85. package/lib/menus/sidenav/NavMenuGroup.js +1 -1
  86. package/lib/menus/sidenav/NavMenuItem.js +27 -25
  87. package/lib/menus/sidenav/NavSubMenuItem.js +1 -1
  88. package/lib/menus/sidenav/helpers.js +1 -1
  89. package/lib/menus/sidenav/index.js +39 -31
  90. package/lib/menus/sidenav/types.d.ts +1 -0
  91. package/lib/panel/Content.js +5 -7
  92. package/lib/panel/Default.js +2 -2
  93. package/lib/panel/Header.js +3 -3
  94. package/lib/permissionValidations.js +1 -1
  95. package/lib/popover/index.js +1 -1
  96. package/lib/progress/Bar.js +6 -6
  97. package/lib/radio/index.js +2 -2
  98. package/lib/shortcuts/index.js +1 -1
  99. package/lib/skeleton/SkeletonContainer.js +2 -1
  100. package/lib/skeleton/index.js +4 -1
  101. package/lib/spinner/index.js +2 -2
  102. package/lib/split/Split.js +1 -1
  103. package/lib/split/SplitSide.js +3 -3
  104. package/lib/table/Body.js +3 -3
  105. package/lib/table/Header.js +8 -11
  106. package/lib/table/HeaderColumn.js +1 -1
  107. package/lib/table/Row.js +3 -3
  108. package/lib/table/RowColumn.js +1 -1
  109. package/lib/table/index.js +6 -1
  110. package/lib/tabs/DropdownTabs.js +1 -1
  111. package/lib/tabs/Menu.js +1 -1
  112. package/lib/tabs/MenuTabs.js +2 -2
  113. package/lib/tabs/Panel.js +5 -7
  114. package/lib/tabs/context.js +3 -6
  115. package/lib/textContent/index.js +4 -2
  116. package/lib/toolbar/ButtonBar.js +1 -1
  117. package/lib/toolbar/index.js +1 -1
  118. package/lib/tooltip/index.js +7 -7
  119. package/lib/treetable/Body.js +1 -1
  120. package/lib/treetable/Header.js +2 -2
  121. package/lib/treetable/Row.js +8 -8
  122. package/lib/treeview/Header.js +1 -1
  123. package/lib/treeview/Node.js +5 -5
  124. package/lib/treeview/index.js +4 -4
  125. package/lib/uitour/index.js +6 -8
  126. package/package.json +1 -1
  127. package/lib/checkbox/Label.js +0 -31
  128. package/lib/inputs/mask/imaskHOC.js +0 -203
  129. package/lib/menus/sidenav/popup_menu_help/index.js +0 -85
  130. package/lib/tabs/DropdownItems.js +0 -62
  131. package/lib/tabs/MenuItems.js +0 -70
  132. package/lib/treeview_old/Header.js +0 -29
  133. package/lib/treeview_old/Node.js +0 -68
  134. package/lib/treeview_old/index.js +0 -43
@@ -40,7 +40,7 @@ const MultipleSelect = props => {
40
40
  const [insideComponent, setInsideComponent] = (0, _react.useState)(false);
41
41
  const [onDenied, setOnDeniedSelect] = (0, _react.useState)();
42
42
  const [valueFromProps, setValueFromProps] = (0, _react.useState)([]);
43
- const componentId = "select-component".concat(uuid.v1());
43
+ const componentId = `select-component${uuid.v1()}`;
44
44
  const componentRef = (0, _react.useRef)(null);
45
45
  const dropdownRef = (0, _react.useRef)(null);
46
46
  const selectWrapper = (0, _react.useRef)();
@@ -60,11 +60,10 @@ const MultipleSelect = props => {
60
60
  }
61
61
  };
62
62
  const onMouseMove = event => {
63
- var _dropdownRef$current, _dropdownRef$current$;
64
63
  const target = event.target;
65
- const idDropdown = ((_dropdownRef$current = dropdownRef.current) === null || _dropdownRef$current === void 0 ? void 0 : (_dropdownRef$current$ = _dropdownRef$current.parentElement) === null || _dropdownRef$current$ === void 0 ? void 0 : _dropdownRef$current$.id) || '';
64
+ const idDropdown = dropdownRef.current?.parentElement?.id || '';
66
65
  const dropdownElement = document.getElementById(idDropdown);
67
- const keepDropdownOpen = Boolean(dropdownElement === null || dropdownElement === void 0 ? void 0 : dropdownElement.contains(target));
66
+ const keepDropdownOpen = Boolean(dropdownElement?.contains(target));
68
67
  setInsideComponent(keepDropdownOpen);
69
68
  };
70
69
  const onClearClick = () => {
@@ -101,7 +100,6 @@ const MultipleSelect = props => {
101
100
  setDropdownWidth(dropdownWidthFocus);
102
101
  };
103
102
  const onSelect = select => {
104
- var _dropdownRef$current2;
105
103
  if (select === null) return;
106
104
  const currentsSelect = [...currents, select];
107
105
  setCurrents(currentsSelect);
@@ -109,17 +107,16 @@ const MultipleSelect = props => {
109
107
  setInputValue([]);
110
108
  if (inputTextRef && inputTextRef.current) inputTextRef.current.focus();
111
109
  if (props.onSelect) setSelected(props.onSelect(currentsSelect.map(i => i[idKey])));
112
- (_dropdownRef$current2 = dropdownRef.current) === null || _dropdownRef$current2 === void 0 ? void 0 : _dropdownRef$current2.focus();
110
+ dropdownRef.current?.focus();
113
111
  };
114
112
  const onUnselect = id => {
115
113
  if (currents) {
116
- var _dropdownRef$current3;
117
114
  const result = currents.filter(item => item[idKey] !== id);
118
115
  setCurrents(result);
119
116
  if (inputTextRef && inputTextRef.current) inputTextRef.current.focus();
120
117
  setOpened(false);
121
118
  if (props.onSelect) setSelected(props.onSelect(result.map(i => i[idKey])));
122
- (_dropdownRef$current3 = dropdownRef.current) === null || _dropdownRef$current3 === void 0 ? void 0 : _dropdownRef$current3.focus();
119
+ dropdownRef.current?.focus();
123
120
  }
124
121
  };
125
122
  const onOpenClose = () => {
@@ -136,11 +133,9 @@ const MultipleSelect = props => {
136
133
  const onInputKeyDown = e => {
137
134
  if (e.keyCode) {
138
135
  if (e.keyCode === constants.keyCodes.ENTER && selected && opened) {
139
- var _e$preventDefault;
140
- (_e$preventDefault = e.preventDefault) === null || _e$preventDefault === void 0 ? void 0 : _e$preventDefault.call(e);
136
+ e.preventDefault?.();
141
137
  if (!currents.some(current => current[idKey] === selected[idKey])) {
142
- var _e$preventDefault2;
143
- (_e$preventDefault2 = e.preventDefault) === null || _e$preventDefault2 === void 0 ? void 0 : _e$preventDefault2.call(e);
138
+ e.preventDefault?.();
144
139
  onSelect(selected);
145
140
  }
146
141
  } else if ([constants.keyCodes.ARROW_UP, constants.keyCodes.ARROW_DOWN].includes(e.keyCode)) {
@@ -186,7 +181,7 @@ const MultipleSelect = props => {
186
181
  }, []);
187
182
  (0, _react.useEffect)(() => {
188
183
  if (props.gridLayout) {
189
- const gridEl = document.querySelector("#".concat(componentId, ">.-withinput.grid-container"));
184
+ const gridEl = document.querySelector(`#${componentId}>.-withinput.grid-container`);
190
185
  if (gridElRef.current !== gridEl && gridEl) gridElRef.current = gridEl;
191
186
  }
192
187
  }, []);
@@ -238,7 +233,7 @@ const MultipleSelect = props => {
238
233
  },
239
234
  onClick: onFocus,
240
235
  onKeyDown: onInputKeyDown,
241
- customClassForWrapper: "selectwrapper ".concat((props.readOnly || shouldDisable() || shouldBeReadOnly()) && ' -undigitable'),
236
+ customClassForWrapper: `selectwrapper ${(props.readOnly || shouldDisable() || shouldBeReadOnly()) && ' -undigitable'}`,
242
237
  customClassForInputContent: "multiselect",
243
238
  inputBaseRef: r => {
244
239
  selectWrapper.current = r;
@@ -51,7 +51,7 @@ const SimpleSelect = props => {
51
51
  const [onDenied, setOnDeniedSelect] = (0, _react.useState)();
52
52
  const [isTyping, setIsTyping] = (0, _react.useState)(false);
53
53
  const dropdownRef = (0, _react.useRef)(null);
54
- const componentId = "select-component-".concat(name, "-").concat(uuid.v1());
54
+ const componentId = `select-component-${name}-${uuid.v1()}`;
55
55
  const componentRef = (0, _react.useRef)(null);
56
56
  const selectWrapper = (0, _react.useRef)();
57
57
  const gridElement = (0, _react.useRef)();
@@ -60,20 +60,18 @@ const SimpleSelect = props => {
60
60
  if (selectWrapper.current) setDropdownWidth(selectWrapper.current.clientWidth);
61
61
  };
62
62
  const onClickOutside = event => {
63
- var _selectWrapper$curren, _dropdownRef$current;
64
63
  const {
65
64
  target
66
65
  } = event;
67
- if (target !== selectWrapper.current && !((_selectWrapper$curren = selectWrapper.current) !== null && _selectWrapper$curren !== void 0 && _selectWrapper$curren.contains(target)) && !((_dropdownRef$current = dropdownRef.current) !== null && _dropdownRef$current !== void 0 && _dropdownRef$current.contains(target))) {
66
+ if (target !== selectWrapper.current && !selectWrapper.current?.contains(target) && !dropdownRef.current?.contains(target)) {
68
67
  setOpened(false);
69
68
  }
70
69
  };
71
70
  const onMouseMove = event => {
72
- var _dropdownRef$current2, _dropdownRef$current3;
73
71
  const target = event.target;
74
- const idDropdown = ((_dropdownRef$current2 = dropdownRef.current) === null || _dropdownRef$current2 === void 0 ? void 0 : (_dropdownRef$current3 = _dropdownRef$current2.parentElement) === null || _dropdownRef$current3 === void 0 ? void 0 : _dropdownRef$current3.id) || '';
72
+ const idDropdown = dropdownRef.current?.parentElement?.id || '';
75
73
  const dropdownElement = document.getElementById(idDropdown);
76
- const keepDropdownOpen = Boolean(dropdownElement === null || dropdownElement === void 0 ? void 0 : dropdownElement.contains(target));
74
+ const keepDropdownOpen = Boolean(dropdownElement?.contains(target));
77
75
  setInsideComponent(keepDropdownOpen);
78
76
  };
79
77
  const getSelectEvent = selectedEvent => ({
@@ -113,7 +111,6 @@ const SimpleSelect = props => {
113
111
  }
114
112
  };
115
113
  const onSelect = selectedDropdown => {
116
- var _dropdownRef$current4;
117
114
  if (!selectedDropdown) return;
118
115
  setSelected(selectedDropdown);
119
116
  if (descriptionKeyIsString) setInputText(selectedDropdown[descriptionKey]);else setInputText(descriptionKey(selectedDropdown));
@@ -123,7 +120,7 @@ const SimpleSelect = props => {
123
120
  if (inputTextRef && inputTextRef.current) inputTextRef.current.focus();
124
121
  setOpened(false);
125
122
  });
126
- (_dropdownRef$current4 = dropdownRef.current) === null || _dropdownRef$current4 === void 0 ? void 0 : _dropdownRef$current4.focus();
123
+ dropdownRef.current?.focus();
127
124
  };
128
125
  const onOpenClose = () => {
129
126
  setOpened(prevState => !prevState);
@@ -159,8 +156,7 @@ const SimpleSelect = props => {
159
156
  const onInputKeyDown = e => {
160
157
  if (e.keyCode) {
161
158
  if (e.keyCode === constants.keyCodes.ENTER && selected && opened) {
162
- var _e$preventDefault;
163
- (_e$preventDefault = e.preventDefault) === null || _e$preventDefault === void 0 ? void 0 : _e$preventDefault.call(e);
159
+ e.preventDefault?.();
164
160
  onSelect(selected);
165
161
  } else if ([constants.keyCodes.ARROW_UP, constants.keyCodes.ARROW_DOWN].includes(e.keyCode)) {
166
162
  if (!opened) setOpened(true);
@@ -168,7 +164,7 @@ const SimpleSelect = props => {
168
164
  if (e.keyCode === constants.keyCodes.ARROW_DOWN) {
169
165
  index = dataCombo && index === dataCombo.length - 1 ? 0 : index + 1;
170
166
  } else {
171
- index = dataCombo && index === 0 ? (dataCombo === null || dataCombo === void 0 ? void 0 : dataCombo.length) - 1 : index - 1;
167
+ index = dataCombo && index === 0 ? dataCombo?.length - 1 : index - 1;
172
168
  }
173
169
  setSelected(dataCombo[index]);
174
170
  if (descriptionKeyIsString) setInputText(dataCombo[index][descriptionKey]);
@@ -205,7 +201,7 @@ const SimpleSelect = props => {
205
201
  }, []);
206
202
  (0, _react.useEffect)(() => {
207
203
  if (gridLayout) {
208
- const gridEl = document.querySelector("#".concat(componentId, ">.-withinput.grid-container"));
204
+ const gridEl = document.querySelector(`#${componentId}>.-withinput.grid-container`);
209
205
  if (gridElement.current !== gridEl && gridEl) gridElement.current = gridEl;
210
206
  }
211
207
  }, [gridLayout]);
@@ -213,10 +209,7 @@ const SimpleSelect = props => {
213
209
  if (dataSourceWithAllOptions.length > 0) {
214
210
  let newCurrent = null;
215
211
  if (value || value === 0) {
216
- newCurrent = dataSourceWithAllOptions.find(i => {
217
- var _i$idKey;
218
- return (value || value === 0) && ((_i$idKey = i[idKey]) === null || _i$idKey === void 0 ? void 0 : _i$idKey.toString().toLowerCase()) === (value === null || value === void 0 ? void 0 : value.toString().toLowerCase());
219
- });
212
+ newCurrent = dataSourceWithAllOptions.find(i => (value || value === 0) && i[idKey]?.toString().toLowerCase() === value?.toString().toLowerCase());
220
213
  } else if (dataSourceWithAllOptions.length > 0 && selectFirstOnEnter) {
221
214
  newCurrent = dataSourceWithAllOptions[0];
222
215
  }
@@ -269,7 +262,7 @@ const SimpleSelect = props => {
269
262
  },
270
263
  onClick: onFocus,
271
264
  onKeyDown: onInputKeyDown,
272
- customClassForWrapper: "selectwrapper ".concat((undigitable || searchOnDropdown || shouldBeReadOnly()) && ' -undigitable'),
265
+ customClassForWrapper: `selectwrapper ${(undigitable || searchOnDropdown || shouldBeReadOnly()) && ' -undigitable'}`,
273
266
  customClassForInputContent: "multiselect",
274
267
  inputBaseRef: r => {
275
268
  selectWrapper.current = r;
@@ -19,7 +19,7 @@ const TextArea = props => {
19
19
  rows: rows,
20
20
  type: type,
21
21
  cols: cols,
22
- customClass: "textarea-container ".concat(customClass)
22
+ customClass: `textarea-container ${customClass}`
23
23
  }));
24
24
  };
25
25
  var _default = exports.default = TextArea;
@@ -87,23 +87,23 @@ const withTooltip = WrappedComponent => {
87
87
  const targetDimensions = targetElement.current.getBoundingClientRect();
88
88
  const targetVerticalCenter = (targetDimensions.top + targetDimensions.bottom) / 2;
89
89
  const tooltipClientWidth = tooltipElement.current.clientWidth;
90
- let style = "width: ".concat(typeof width === 'string' ? width : "".concat(width, "px"));
90
+ let style = `width: ${typeof width === 'string' ? width : `${width}px`}`;
91
91
  let left = targetDimensions.left + targetDimensions.width / 2 - tooltipClientWidth / 2;
92
92
  left = Math.min(left, document.body.clientWidth - tooltipClientWidth - space);
93
- style += "; left: ".concat(Math.max(space, left), "px");
93
+ style += `; left: ${Math.max(space, left)}px`;
94
94
  switch (stateTooltipPosition) {
95
95
  case 'top':
96
96
  if (targetDimensions.top < height) {
97
97
  setStateTooltipPosition('bottom');
98
98
  } else {
99
- style += "; top: ".concat(targetDimensions.top + window.scrollY - height - 5, "px");
99
+ style += `; top: ${targetDimensions.top + window.scrollY - height - 5}px`;
100
100
  }
101
101
  break;
102
102
  case 'bottom':
103
103
  if (window.innerHeight - targetDimensions.bottom < height) {
104
104
  setStateTooltipPosition('top');
105
105
  } else {
106
- style += "; top: ".concat(targetDimensions.top + window.scrollY + targetDimensions.height + 5, "px");
106
+ style += `; top: ${targetDimensions.top + window.scrollY + targetDimensions.height + 5}px`;
107
107
  }
108
108
  break;
109
109
  case 'left':
@@ -114,16 +114,16 @@ const withTooltip = WrappedComponent => {
114
114
  setStateTooltipPosition('right');
115
115
  }
116
116
  } else {
117
- style += "; top: ".concat(targetVerticalCenter + window.scrollY - height / 2, "px");
118
- style += "; left: ".concat(targetDimensions.left - tooltipClientWidth - 6, "px");
117
+ style += `; top: ${targetVerticalCenter + window.scrollY - height / 2}px`;
118
+ style += `; left: ${targetDimensions.left - tooltipClientWidth - 6}px`;
119
119
  }
120
120
  break;
121
121
  case 'right':
122
122
  if (window.innerWidth - targetDimensions.right < tooltipClientWidth) {
123
123
  setStateTooltipPosition('left');
124
124
  } else {
125
- style += "; top: ".concat(targetVerticalCenter + window.scrollY - height / 2, "px");
126
- style += "; left: ".concat(targetDimensions.left + targetDimensions.width + 5, "px");
125
+ style += `; top: ${targetVerticalCenter + window.scrollY - height / 2}px`;
126
+ style += `; left: ${targetDimensions.left + targetDimensions.width + 5}px`;
127
127
  }
128
128
  break;
129
129
  default:
@@ -166,7 +166,7 @@ const withTooltip = WrappedComponent => {
166
166
  targetRef: getTarget
167
167
  })), showTooltip && getTooltip());
168
168
  };
169
- EnhancedComponent.displayName = "withTooltip(".concat(getDisplayName(WrappedComponent), ")");
169
+ EnhancedComponent.displayName = `withTooltip(${getDisplayName(WrappedComponent)})`;
170
170
  return EnhancedComponent;
171
171
  };
172
172
  var _default = exports.default = withTooltip;
@@ -25,7 +25,8 @@ const LabelMessages = _ref => {
25
25
  showCloseButton = false
26
26
  } = _ref;
27
27
  const [closed, setClosed] = (0, _react.useState)(false);
28
- const getClass = () => "labelmessages-component -".concat(type, " ").concat(customClass, "\n ").concat(square && '-square', " ").concat(flat && '-flat');
28
+ const getClass = () => `labelmessages-component -${type} ${customClass}
29
+ ${square && '-square'} ${flat && '-flat'}`;
29
30
  const getIcon = () => {
30
31
  if (icon) {
31
32
  return icon;
@@ -34,14 +35,14 @@ const LabelMessages = _ref => {
34
35
  name: iconName,
35
36
  size: 16,
36
37
  color: "#ffffff",
37
- customClass: "-".concat(type, "svg")
38
+ customClass: `-${type}svg`
38
39
  });
39
40
  }
40
41
  return null;
41
42
  };
42
43
  if (closed || !visible) return null;
43
44
  return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
44
- className: "".concat(getClass(), " ").concat(customClass),
45
+ className: `${getClass()} ${customClass}`,
45
46
  style: style
46
47
  }, /*#__PURE__*/_react.default.createElement("div", {
47
48
  className: "labelmessagesitem text"
@@ -30,7 +30,10 @@ const DefaultLabel = _ref => {
30
30
  } = _ref;
31
31
  const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
32
32
  const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr));
33
- const getClass = () => "label-component ".concat(className, " ").concat(customClass, " ").concat(bordered ? '-bordered' : '', " ").concat(disabled ? '-disabled' : '', "\n ").concat(skeletonize ? '-skeletonized' : '', "\n ").concat(size ? "-".concat(size) : '', "\n ").concat(iconAlign ? "icon-".concat(iconAlign) : '');
33
+ const getClass = () => `label-component ${className} ${customClass} ${bordered ? '-bordered' : ''} ${disabled ? '-disabled' : ''}
34
+ ${skeletonize ? '-skeletonized' : ''}
35
+ ${size ? `-${size}` : ''}
36
+ ${iconAlign ? `icon-${iconAlign}` : ''}`;
34
37
  const getIcon = () => {
35
38
  if (icon) {
36
39
  return icon;
@@ -13,7 +13,7 @@ const LabelContainer = _ref => {
13
13
  children
14
14
  } = _ref;
15
15
  return /*#__PURE__*/_react.default.createElement("div", {
16
- className: "lbl-container ".concat(customClass),
16
+ className: `lbl-container ${customClass}`,
17
17
  style: {
18
18
  float: position
19
19
  }
@@ -14,7 +14,7 @@ const Header = _ref => {
14
14
  customClass
15
15
  } = _ref;
16
16
  return /*#__PURE__*/_react.default.createElement("li", {
17
- className: "list-header ".concat(customClass),
17
+ className: `list-header ${customClass}`,
18
18
  style: style
19
19
  }, /*#__PURE__*/_react.default.createElement("h1", {
20
20
  className: "title"
package/lib/list/Item.js CHANGED
@@ -41,6 +41,7 @@ const Item = props => {
41
41
  permissionAttr,
42
42
  skeletonize,
43
43
  targetRef,
44
+ target,
44
45
  onDeniedText = 'Permissão Negada! Consulte o Administrador do sistema.'
45
46
  } = props;
46
47
  const {
@@ -60,7 +61,8 @@ const Item = props => {
60
61
  const disabledByPermission = onDenied.disabled;
61
62
  const shouldDisable = () => disabled || onDenied.disabled;
62
63
  const disabledIconColor = 'rgb(193, 193, 193)';
63
- const getClass = () => "item ".concat(customClass, " ").concat(separator && 'list-separator', " ").concat(shouldDisable() && 'disabled', "\n ").concat(displayCheckbox && 'list-checkbox');
64
+ const getClass = () => `item ${customClass} ${separator && 'list-separator'} ${shouldDisable() && 'disabled'}
65
+ ${displayCheckbox && 'list-checkbox'}`;
64
66
  const getIcon = (iconName, icon) => {
65
67
  const noIconDisabledByPermission = !icon && !displayCheckbox && !leftElement && !leftIconName && !leftIcon && onDenied.disabled;
66
68
  if (icon) {
@@ -89,7 +91,13 @@ const Item = props => {
89
91
  if ([constants.keyCodes.ENTER].includes(e.keyCode) && !skeletonize && itemId && selectedItemId === itemId) {
90
92
  e.preventDefault();
91
93
  handleOnSelectItem(e);
92
- if (url) navigate(url);
94
+ if (url) {
95
+ if (target === '_blank') {
96
+ window.open(url, '_blank')?.focus();
97
+ } else {
98
+ navigate(url);
99
+ }
100
+ }
93
101
  }
94
102
  }, [url, selectedItemId, itemId]);
95
103
  const getProps = () => {
@@ -131,22 +139,24 @@ const Item = props => {
131
139
  return itemId && selectedItemId === itemId ? selectedItemRef : null;
132
140
  },
133
141
  style: style,
134
- className: "item-container ".concat(hovered && 'hovered', "\n ").concat(itemId && selectedItemId === itemId ? '-activedlist' : '')
142
+ className: `item-container ${hovered && 'hovered'}
143
+ ${itemId && selectedItemId === itemId ? '-activedlist' : ''}`
135
144
  }, getProps(), {
136
145
  key: itemId
137
146
  }), url && !shouldDisable() && /*#__PURE__*/_react.default.createElement(_reactRouterDom.Link, {
138
147
  className: "linkitem",
139
- to: url
148
+ to: url,
149
+ target: target
140
150
  }), (displayCheckbox || leftElement || leftIconName || leftIcon) && /*#__PURE__*/_react.default.createElement("div", {
141
- className: "".concat(getClass(), " -icon-left")
151
+ className: `${getClass()} -icon-left`
142
152
  }, renderCheckBox, leftElement, getIcon(leftIconName, leftIcon)), (text || subText || children) && /*#__PURE__*/_react.default.createElement("div", {
143
- className: "".concat(getClass())
144
- }, /*#__PURE__*/_react.default.createElement("p", {
145
- className: "".concat(text && 'text')
146
- }, text), /*#__PURE__*/_react.default.createElement("p", {
147
- className: "".concat(subText && 'subtext')
153
+ className: `${getClass()}`
154
+ }, text && /*#__PURE__*/_react.default.createElement("p", {
155
+ className: `${text && 'text'}`
156
+ }, text), subText && /*#__PURE__*/_react.default.createElement("p", {
157
+ className: `${subText && 'subtext'}`
148
158
  }, subText), children), (rightIconName || rightIcon || rightElement || disabledByPermission) && /*#__PURE__*/_react.default.createElement("div", {
149
- className: "".concat(getClass(), " -icon-right")
159
+ className: `${getClass()} -icon-right`
150
160
  }, getIcon(rightIconName, rightIcon), rightElement));
151
161
  };
152
162
  var _default = exports.default = (0, _withTooltip.default)(Item);
package/lib/list/index.js CHANGED
@@ -175,7 +175,8 @@ const List = props => {
175
175
  "data-testid": "list-component",
176
176
  style: style,
177
177
  ref: listRef,
178
- className: "list-component ".concat(condensed && '-condensed', "\n ").concat(customClass, " ").concat(!transparent && '-listbackground')
178
+ className: `list-component ${condensed && '-condensed'}
179
+ ${customClass} ${!transparent && '-listbackground'}`
179
180
  }, newChildren));
180
181
  };
181
182
  var _default = exports.default = List;
@@ -1,4 +1,4 @@
1
- import { ReactNode, ReactElement, CSSProperties, Ref } from 'react';
1
+ import { ReactNode, ReactElement, CSSProperties, ComponentPropsWithoutRef, Ref } from 'react';
2
2
  import { PermissionAttr } from '../@types/PermissionAttr.js';
3
3
  import { IconNames } from '../@types/Icon.js';
4
4
  import { Position } from '../@types/Position.js';
@@ -47,6 +47,7 @@ interface IListItemProps {
47
47
  rightIconName?: IconNames;
48
48
  customClass?: string;
49
49
  url?: string;
50
+ target?: ComponentPropsWithoutRef<'a'>['target'];
50
51
  visible?: boolean;
51
52
  itemId?: string;
52
53
  children?: ReactNode;
@@ -29,7 +29,7 @@ const MenuItem = _ref => {
29
29
  const dropdownContext = (0, _react.useContext)(_withDropdown.WithDropdownContext);
30
30
  const handleOnClick = () => {
31
31
  if (onClick) {
32
- onClick(dropdownContext === null || dropdownContext === void 0 ? void 0 : dropdownContext.handleDropdownClose);
32
+ onClick(dropdownContext?.handleDropdownClose);
33
33
  return;
34
34
  }
35
35
  if (dropdownContext) dropdownContext.handleDropdownClose();
@@ -37,7 +37,7 @@ const MenuItem = _ref => {
37
37
  return /*#__PURE__*/_react.default.createElement("div", {
38
38
  className: "floatmenuitem"
39
39
  }, /*#__PURE__*/_react.default.createElement("div", {
40
- className: "".concat(customClassMenuItem, " -items")
40
+ className: `${customClassMenuItem} -items`
41
41
  }, !_lodash.default.isEmpty(dropdownMenu) && !onClick && /*#__PURE__*/_react.default.createElement(_buttons.default, {
42
42
  customClass: "floatmenudropdown",
43
43
  iconName: "more1",
@@ -46,7 +46,7 @@ const SubMenuContainer = _ref => {
46
46
  handlerGoBack();
47
47
  }, []);
48
48
  return /*#__PURE__*/_react.default.createElement("div", {
49
- className: "floatsubmenu ".concat(customClass)
49
+ className: `floatsubmenu ${customClass}`
50
50
  }, /*#__PURE__*/_react.default.createElement("div", {
51
51
  className: "submenuheader"
52
52
  }, /*#__PURE__*/_react.default.createElement(_icons.default, {
@@ -47,7 +47,7 @@ const FloatMenu = props => {
47
47
  return /*#__PURE__*/_react.default.createElement(_helpers.default.Provider, {
48
48
  value: contextValues
49
49
  }, /*#__PURE__*/_react.default.createElement("div", {
50
- className: "floatmenu-component ".concat(customClass)
50
+ className: `floatmenu-component ${customClass}`
51
51
  }, /*#__PURE__*/_react.default.createElement(_buttons.default, {
52
52
  transparent: true,
53
53
  key: "button-",
@@ -14,7 +14,7 @@ const ExpandMenu = _ref => {
14
14
  iconName
15
15
  } = _ref;
16
16
  return /*#__PURE__*/_react.default.createElement("div", {
17
- className: "openclosemenu ".concat(expandMenuCustomClass),
17
+ className: `openclosemenu ${expandMenuCustomClass}`,
18
18
  role: "button",
19
19
  tabIndex: 0,
20
20
  onClick: onExpandMenu,
@@ -20,7 +20,7 @@ const NavMenuGroup = _ref => {
20
20
  } = (0, _react.useContext)(_helpers.SideNavContext);
21
21
  return /*#__PURE__*/_react.default.createElement("ul", {
22
22
  style: style,
23
- className: "".concat(scrollable && 'customscroll', " ").concat((0, _helpers.default)(isExpanded, menuSize))
23
+ className: `${scrollable && 'customscroll'} ${(0, _helpers.default)(isExpanded, menuSize)}`
24
24
  }, children);
25
25
  };
26
26
  var _default = exports.default = NavMenuGroup;
@@ -10,28 +10,32 @@ var _icons = _interopRequireDefault(require("../../icons"));
10
10
  var _MenuLink = _interopRequireDefault(require("./MenuLink"));
11
11
  var _helpers = require("./helpers");
12
12
  var _permissionValidations = require("../../permissionValidations");
13
+ const _excluded = ["iconName", "title", "children", "childrenIsSubMenu", "url", "customClass", "permissionAttr", "maxWidth", "minWidth", "columnsQtty", "targetRef", "disableDefaultStyle", "showDropdownOnClick", "style", "customClassForDropdown"];
13
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
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); }
15
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; }
16
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
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
19
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
17
20
  const NavMenuItem = props => {
18
21
  const {
19
- iconName,
20
- title,
21
- children,
22
- childrenIsSubMenu = true,
23
- url,
24
- customClass,
25
- permissionAttr,
26
- maxWidth = '90%',
27
- minWidth = 500,
28
- columnsQtty,
29
- targetRef,
30
- disableDefaultStyle = false,
31
- showDropdownOnClick = false,
32
- style,
33
- customClassForDropdown
34
- } = props;
22
+ iconName,
23
+ title,
24
+ children,
25
+ childrenIsSubMenu = true,
26
+ url,
27
+ customClass,
28
+ permissionAttr,
29
+ maxWidth = '90%',
30
+ minWidth = 500,
31
+ columnsQtty,
32
+ targetRef,
33
+ disableDefaultStyle = false,
34
+ showDropdownOnClick = false,
35
+ style,
36
+ customClassForDropdown
37
+ } = props,
38
+ rest = _objectWithoutProperties(props, _excluded);
35
39
  const [showSubMenu, setShowSubMenu] = (0, _react.useState)(false);
36
40
  const [targetDimensions, setTargetDimensions] = (0, _react.useState)({});
37
41
  const [isOnEndWindow, setIsOnEndWindow] = (0, _react.useState)(false);
@@ -76,19 +80,17 @@ const NavMenuItem = props => {
76
80
  (0, _react.useEffect)(() => {
77
81
  if (showSubMenu && showDropdownOnClick) {
78
82
  document.addEventListener('click', e => {
79
- var _menuItemRef$current;
80
83
  const target = e.target;
81
- const insideMenu = (_menuItemRef$current = menuItemRef.current) === null || _menuItemRef$current === void 0 ? void 0 : _menuItemRef$current.contains(target);
84
+ const insideMenu = menuItemRef.current?.contains(target);
82
85
  if (!insideMenu) setShowSubMenu(false);
83
86
  });
84
87
  }
85
88
  }, [showSubMenu, showDropdownOnClick]);
86
89
  (0, _react.useEffect)(() => {
87
- var _submenuContainerRef$, _submenuContentRef$cu, _submenuContentRef$cu2;
88
- const heigthSubmenuContainer = ((_submenuContainerRef$ = submenuContainerRef.current) === null || _submenuContainerRef$ === void 0 ? void 0 : _submenuContainerRef$.clientHeight) || 0;
89
- const heigthSubmenuContent = ((_submenuContentRef$cu = submenuContentRef.current) === null || _submenuContentRef$cu === void 0 ? void 0 : _submenuContentRef$cu.clientHeight) || 0;
90
+ const heigthSubmenuContainer = submenuContainerRef.current?.clientHeight || 0;
91
+ const heigthSubmenuContent = submenuContentRef.current?.clientHeight || 0;
90
92
  const maxHeigthSubMenu = isOnEndWindow ? '100%' : (window.innerHeight - targetDimensions.top - (heigthSubmenuContainer - heigthSubmenuContent) - 1).toString().concat('px') || '0px';
91
- (_submenuContentRef$cu2 = submenuContentRef.current) === null || _submenuContentRef$cu2 === void 0 ? void 0 : _submenuContentRef$cu2.style.setProperty('max-height', maxHeigthSubMenu);
93
+ submenuContentRef.current?.style.setProperty('max-height', maxHeigthSubMenu);
92
94
  }, [showSubMenu]);
93
95
  if (unvisible) return null;
94
96
  return /*#__PURE__*/_react.default.createElement(_helpers.SubMenuContext.Provider, {
@@ -99,7 +101,7 @@ const NavMenuItem = props => {
99
101
  menuItemRef.current = r;
100
102
  if (targetRef) targetRef(r);
101
103
  },
102
- className: "item ".concat(url && !disabled && '-withlink', " ").concat(customClass, " ").concat(disabled && '-disabled'),
104
+ className: `item ${url && !disabled && '-withlink'} ${customClass} ${disabled && '-disabled'}`,
103
105
  onMouseEnter: onMouseEnter,
104
106
  onMouseLeave: () => {
105
107
  if (showDropdownOnClick) return;
@@ -123,7 +125,7 @@ const NavMenuItem = props => {
123
125
  className: "title"
124
126
  }, title), !childrenIsSubMenu && children)), showSubMenu && children && childrenIsSubMenu && !disabled && !openSearchMenuPopup && /*#__PURE__*/_react.default.createElement("div", {
125
127
  ref: submenuContainerRef,
126
- className: "".concat(customClassForDropdown, " ").concat(disableDefaultStyle ? '' : 'submenu-container'),
128
+ className: `${customClassForDropdown} ${disableDefaultStyle ? '' : 'submenu-container'}`,
127
129
  style: isOnEndWindow ? {
128
130
  marginLeft: targetDimensions.width,
129
131
  bottom: '0',
@@ -141,7 +143,7 @@ const NavMenuItem = props => {
141
143
  ref: submenuContentRef,
142
144
  className: "submenu",
143
145
  style: {
144
- gridTemplateColumns: "repeat(".concat(columnsQtty, ", 1fr)")
146
+ gridTemplateColumns: `repeat(${columnsQtty}, 1fr)`
145
147
  }
146
148
  }, children))));
147
149
  };
@@ -28,7 +28,7 @@ const NavSubMenuItem = _ref => {
28
28
  } = onDenied;
29
29
  if (unvisible) return null;
30
30
  return /*#__PURE__*/_react.default.createElement("div", {
31
- className: "item hvr-forward ".concat(disabled && '-disabled'),
31
+ className: `item hvr-forward ${disabled && '-disabled'}`,
32
32
  onKeyDown: () => {},
33
33
  role: "button",
34
34
  tabIndex: -1,
@@ -9,7 +9,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
9
9
  const getCssClassMenu = (isExpanded, size) => {
10
10
  let cssClass = 'expandedmenu';
11
11
  if (!isExpanded) {
12
- cssClass = "collapsedmenu -".concat(size);
12
+ cssClass = `collapsedmenu -${size}`;
13
13
  }
14
14
  return cssClass;
15
15
  };