linear-react-components-ui 1.1.2-beta.9 → 1.1.2

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 (183) hide show
  1. package/.eslintcache +1 -0
  2. package/.gitlab-ci.yml +1 -0
  3. package/.vscode/settings.json +10 -1
  4. package/lib/@types/Align.d.ts +1 -1
  5. package/lib/@types/ButtonTypes.d.ts +1 -1
  6. package/lib/@types/ColorStyles.d.ts +1 -1
  7. package/lib/@types/DataCombo.d.ts +1 -1
  8. package/lib/@types/Icon.d.ts +1 -1
  9. package/lib/@types/LabelStyles.d.ts +1 -1
  10. package/lib/@types/Period.d.ts +1 -1
  11. package/lib/@types/PermissionAttr.d.ts +1 -1
  12. package/lib/@types/PointerEvents.d.ts +1 -1
  13. package/lib/@types/Position.d.ts +1 -1
  14. package/lib/@types/PositionAlert.d.ts +1 -1
  15. package/lib/@types/Size.d.ts +1 -1
  16. package/lib/@types/SizePixels.d.ts +2 -2
  17. package/lib/@types/StorageMock.d.ts +1 -1
  18. package/lib/alerts/types.d.ts +1 -1
  19. package/lib/assets/styles/checkbox.scss +45 -38
  20. package/lib/assets/styles/colors.scss +3 -1
  21. package/lib/assets/styles/commons.scss +1 -0
  22. package/lib/assets/styles/dialog.scss +27 -10
  23. package/lib/assets/styles/error.scss +9 -0
  24. package/lib/assets/styles/fieldset.scss +3 -0
  25. package/lib/assets/styles/gridlayout.scss +0 -2
  26. package/lib/assets/styles/hint.scss +21 -0
  27. package/lib/assets/styles/icon.scss +4 -31
  28. package/lib/assets/styles/input.scss +7 -7
  29. package/lib/assets/styles/multiSelect.scss +6 -1
  30. package/lib/assets/styles/radio.scss +37 -35
  31. package/lib/assets/styles/select.scss +13 -7
  32. package/lib/assets/styles/tabs.scss +3 -0
  33. package/lib/avatar/types.d.ts +1 -1
  34. package/lib/badge/types.d.ts +1 -1
  35. package/lib/buttons/types.d.ts +1 -1
  36. package/lib/calendar/types.d.ts +1 -1
  37. package/lib/checkbox/Label.js +13 -4
  38. package/lib/checkbox/index.d.ts +2 -2
  39. package/lib/checkbox/index.js +22 -17
  40. package/lib/checkbox/types.d.ts +3 -2
  41. package/lib/dialog/base/Content.js +1 -0
  42. package/lib/dialog/base/Header.js +4 -4
  43. package/lib/dialog/base/index.js +9 -6
  44. package/lib/dialog/types.d.ts +1 -1
  45. package/lib/drawer/Drawer.js +5 -4
  46. package/lib/drawer/Header.js +1 -1
  47. package/lib/drawer/types.d.ts +1 -1
  48. package/lib/dropdown/Popup.d.ts +1 -1
  49. package/lib/dropdown/Popup.js +5 -2
  50. package/lib/dropdown/types.d.ts +2 -1
  51. package/lib/fieldset/index.js +4 -2
  52. package/lib/fieldset/types.d.ts +3 -1
  53. package/lib/form/Field.d.ts +3 -1
  54. package/lib/form/FieldArray.d.ts +2 -0
  55. package/lib/form/FieldNumber.d.ts +2 -0
  56. package/lib/form/FieldPeriod.d.ts +2 -0
  57. package/lib/form/helpers.d.ts +2 -0
  58. package/lib/form/index.d.ts +2 -0
  59. package/lib/form/types.d.ts +3 -1
  60. package/lib/form/withFieldHOC.d.ts +2 -0
  61. package/lib/form/withFormSecurity.d.ts +2 -0
  62. package/lib/gridlayout/GridRow.js +10 -2
  63. package/lib/gridlayout/types.d.ts +2 -2
  64. package/lib/hint/helpers.d.ts +3 -0
  65. package/lib/hint/helpers.js +21 -0
  66. package/lib/hint/index.d.ts +2 -1
  67. package/lib/hint/index.js +9 -15
  68. package/lib/hint/types.d.ts +4 -1
  69. package/lib/icons/helper.d.ts +4 -0
  70. package/lib/icons/helper.js +5 -1
  71. package/lib/icons/index.d.ts +2 -3
  72. package/lib/icons/index.js +3 -10
  73. package/lib/icons/types.d.ts +9 -22
  74. package/lib/index.d.ts +0 -1
  75. package/lib/inputs/base/InputTextBase.d.ts +2 -0
  76. package/lib/inputs/base/InputTextBase.js +54 -8
  77. package/lib/inputs/base/Label.d.ts +14 -0
  78. package/lib/inputs/base/Label.js +35 -0
  79. package/lib/inputs/base/helpers.d.ts +3 -2
  80. package/lib/inputs/base/helpers.js +1 -8
  81. package/lib/inputs/base/types.d.ts +15 -2
  82. package/lib/inputs/color/types.d.ts +1 -1
  83. package/lib/inputs/date/Dialog.d.ts +2 -0
  84. package/lib/inputs/date/Dropdown.d.ts +2 -0
  85. package/lib/inputs/date/helpers.d.ts +2 -0
  86. package/lib/inputs/date/index.d.ts +2 -0
  87. package/lib/inputs/date/index.js +2 -0
  88. package/lib/inputs/date/types.d.ts +4 -1
  89. package/lib/inputs/errorMessage/index.d.ts +17 -0
  90. package/lib/inputs/errorMessage/index.js +26 -0
  91. package/lib/inputs/file/DefaultFile.d.ts +2 -0
  92. package/lib/inputs/file/DefaultFile.js +4 -2
  93. package/lib/inputs/file/DragDropFile.d.ts +2 -0
  94. package/lib/inputs/file/DragDropFile.js +4 -2
  95. package/lib/inputs/file/File.d.ts +2 -0
  96. package/lib/inputs/file/FileButtonSettings.d.ts +2 -0
  97. package/lib/inputs/file/helpers.d.ts +2 -0
  98. package/lib/inputs/file/index.d.ts +2 -0
  99. package/lib/inputs/file/types.d.ts +3 -1
  100. package/lib/inputs/inputHOC.d.ts +3 -1
  101. package/lib/inputs/mask/BaseMask.d.ts +3 -0
  102. package/lib/inputs/mask/Cnpj.d.ts +3 -0
  103. package/lib/inputs/mask/Cpf.d.ts +3 -0
  104. package/lib/inputs/mask/Phone.d.ts +3 -0
  105. package/lib/inputs/mask/ZipCode.d.ts +3 -0
  106. package/lib/inputs/mask/helpers.d.ts +2 -1
  107. package/lib/inputs/mask/imaskHOC.d.ts +3 -1
  108. package/lib/inputs/mask/index.d.ts +3 -0
  109. package/lib/inputs/mask/types.d.ts +6 -2
  110. package/lib/inputs/multiSelect/ActionButtons.d.ts +2 -0
  111. package/lib/inputs/multiSelect/ActionButtons.js +10 -8
  112. package/lib/inputs/multiSelect/Dropdown.d.ts +2 -0
  113. package/lib/inputs/multiSelect/Dropdown.js +2 -6
  114. package/lib/inputs/multiSelect/helper.d.ts +2 -0
  115. package/lib/inputs/multiSelect/index.d.ts +2 -0
  116. package/lib/inputs/multiSelect/types.d.ts +3 -1
  117. package/lib/inputs/number/BaseNumber.d.ts +3 -1
  118. package/lib/inputs/number/Currency.d.ts +3 -1
  119. package/lib/inputs/number/Decimal.d.ts +3 -1
  120. package/lib/inputs/number/index.d.ts +3 -1
  121. package/lib/inputs/number/types.d.ts +4 -2
  122. package/lib/inputs/period/Dialog.d.ts +2 -0
  123. package/lib/inputs/period/Dropdown.d.ts +2 -0
  124. package/lib/inputs/period/PeriodList.d.ts +2 -0
  125. package/lib/inputs/period/helper.d.ts +2 -0
  126. package/lib/inputs/period/index.d.ts +2 -0
  127. package/lib/inputs/period/index.js +4 -1
  128. package/lib/inputs/period/types.d.ts +3 -1
  129. package/lib/inputs/search/index.d.ts +3 -1
  130. package/lib/inputs/select/ActionButtons.d.ts +3 -1
  131. package/lib/inputs/select/ActionButtons.js +18 -27
  132. package/lib/inputs/select/Dropdown.d.ts +3 -1
  133. package/lib/inputs/select/Dropdown.js +2 -6
  134. package/lib/inputs/select/helper.d.ts +3 -1
  135. package/lib/inputs/select/index.d.ts +2 -0
  136. package/lib/inputs/select/multiple/Selecteds.d.ts +3 -1
  137. package/lib/inputs/select/multiple/Selecteds.js +3 -5
  138. package/lib/inputs/select/multiple/index.d.ts +2 -0
  139. package/lib/inputs/select/multiple/index.js +38 -19
  140. package/lib/inputs/select/simple/index.d.ts +2 -0
  141. package/lib/inputs/select/simple/index.js +60 -31
  142. package/lib/inputs/select/types.d.ts +6 -3
  143. package/lib/inputs/text/types.d.ts +1 -1
  144. package/lib/inputs/textarea/index.d.ts +2 -0
  145. package/lib/inputs/textarea/types.d.ts +3 -1
  146. package/lib/inputs/types.d.ts +12 -5
  147. package/lib/internals/types.d.ts +1 -1
  148. package/lib/internals/withTooltip.js +7 -3
  149. package/lib/labelMessages/types.d.ts +1 -1
  150. package/lib/labels/types.d.ts +1 -1
  151. package/lib/list/types.d.ts +1 -1
  152. package/lib/menus/float/index.d.ts +10 -10
  153. package/lib/menus/float/types.d.ts +2 -2
  154. package/lib/menus/sidenav/popup_menu_search/index.js +4 -3
  155. package/lib/menus/sidenav/types.d.ts +2 -2
  156. package/lib/panel/types.d.ts +1 -1
  157. package/lib/popover/types.d.ts +1 -1
  158. package/lib/progress/types.d.ts +1 -1
  159. package/lib/radio/types.d.ts +1 -1
  160. package/lib/shortcuts/types.d.ts +1 -1
  161. package/lib/skeleton/types.d.ts +1 -1
  162. package/lib/spinner/types.d.ts +1 -1
  163. package/lib/split/helpers.d.ts +1 -1
  164. package/lib/split/types.d.ts +1 -1
  165. package/lib/table/HeaderColumn.d.ts +1 -1
  166. package/lib/table/HeaderColumn.js +5 -1
  167. package/lib/table/types.d.ts +3 -1
  168. package/lib/tabs/context.js +1 -1
  169. package/lib/tabs/types.d.ts +4 -4
  170. package/lib/toolbar/types.d.ts +1 -1
  171. package/lib/tooltip/types.d.ts +1 -1
  172. package/lib/treetable/Row.d.ts +1 -1
  173. package/lib/treetable/helpers.d.ts +1 -1
  174. package/lib/treetable/index.d.ts +2 -2
  175. package/lib/treeview/types.d.ts +1 -1
  176. package/lib/{types.d-DvJcBS8L.d.ts → types.d-73cece43.d.ts} +1 -1
  177. package/lib/uitour/types.d.ts +1 -1
  178. package/package.json +7 -7
  179. package/.tool-versions +0 -1
  180. package/lib/assets/styles/textContent.scss +0 -9
  181. package/lib/menus/sidenav/popup_menu_help/index.js +0 -78
  182. package/lib/textContent/index.d.ts +0 -8
  183. package/lib/textContent/index.js +0 -30
@@ -22,4 +22,4 @@ interface IMonthProps {
22
22
  currentDate: Moment;
23
23
  }
24
24
 
25
- export type { ICalendarProps, IDayProps, IMonthProps, IWeekProps };
25
+ export { ICalendarProps, IDayProps, IMonthProps, IWeekProps };
@@ -6,17 +6,26 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  var _withTooltip = _interopRequireDefault(require("../internals/withTooltip"));
9
+ var _hint = _interopRequireDefault(require("../hint"));
9
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
11
  const Label = _ref => {
11
12
  let {
12
13
  label,
13
- targetSpanRef
14
+ targetSpanRef,
15
+ disabled,
16
+ hint
14
17
  } = _ref;
15
- return /*#__PURE__*/_react.default.createElement("span", {
16
- className: "description",
18
+ return /*#__PURE__*/_react.default.createElement("div", {
19
+ className: "description"
20
+ }, /*#__PURE__*/_react.default.createElement("span", {
17
21
  ref: r => {
18
22
  if (targetSpanRef) targetSpanRef(r);
19
23
  }
20
- }, label);
24
+ }, label), /*#__PURE__*/_react.default.createElement(_hint.default, {
25
+ disabled: disabled,
26
+ visible: !!hint,
27
+ description: hint,
28
+ customClass: "hint"
29
+ }));
21
30
  };
22
31
  var _default = exports.default = (0, _withTooltip.default)(Label);
@@ -1,5 +1,5 @@
1
- import React__default from 'react';
2
1
  import { ICheckBoxProps } from './types.js';
2
+ import 'react';
3
3
  import '../@types/PermissionAttr.js';
4
4
  import '../@types/Position.js';
5
5
 
@@ -8,6 +8,6 @@ import '../@types/Position.js';
8
8
  * o componente Field dentro do componente Form, pois o mesmo leva em consideração o tipo do
9
9
  * componente para gerar propriedades customizadas.
10
10
  */
11
- declare const CheckBox: React__default.ForwardRefExoticComponent<ICheckBoxProps & React__default.RefAttributes<HTMLInputElement>>;
11
+ declare const CheckBox: ({ name, required, value, label, onChange, autofocus, hint, id, gridLayout, checked, disabled, permissionAttr, tooltip, tooltipPosition, tooltipWidth, skeletonize, targetRef, errorMessages, }: ICheckBoxProps) => JSX.Element | null;
12
12
 
13
13
  export { CheckBox as default };
@@ -5,11 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireWildcard(require("react"));
8
- var _gridlayout = _interopRequireDefault(require("../gridlayout"));
9
8
  var _Label = _interopRequireDefault(require("./Label"));
10
- require("../assets/styles/checkbox.scss");
9
+ var _gridlayout = _interopRequireDefault(require("../gridlayout"));
11
10
  var _permissionValidations = require("../permissionValidations");
12
- var _hint = _interopRequireDefault(require("../hint"));
11
+ require("../assets/styles/checkbox.scss");
12
+ var _errorMessage = require("../inputs/errorMessage");
13
+ var _ = require("..");
13
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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; }
@@ -20,7 +21,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
20
21
  * componente para gerar propriedades customizadas.
21
22
  */
22
23
 
23
- const CheckBox = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
24
+ const CheckBox = _ref => {
24
25
  let {
25
26
  name,
26
27
  required,
@@ -29,7 +30,7 @@ const CheckBox = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
29
30
  onChange,
30
31
  autofocus,
31
32
  hint,
32
- id = undefined,
33
+ id = '',
33
34
  gridLayout,
34
35
  checked = false,
35
36
  disabled,
@@ -38,13 +39,13 @@ const CheckBox = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
38
39
  tooltipPosition = 'top',
39
40
  tooltipWidth = 'auto',
40
41
  skeletonize,
41
- targetRef
42
+ targetRef,
43
+ errorMessages
42
44
  } = _ref;
43
45
  const [isChecked, setIsChecked] = (0, _react.useState)(checked);
44
46
  const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
45
47
  const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr));
46
48
  const inputRef = (0, _react.useRef)(null);
47
- (0, _react.useImperativeHandle)(ref, () => inputRef.current, [inputRef.current]);
48
49
  (0, _react.useEffect)(() => {
49
50
  setIsChecked(checked);
50
51
  }, [checked]);
@@ -69,14 +70,16 @@ const CheckBox = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
69
70
  };
70
71
  };
71
72
  const renderInput = () => /*#__PURE__*/_react.default.createElement("div", _extends({}, getProps(), {
72
- className: "checkbox-component ".concat(skeletonize ? '-skeletonized' : '')
73
+ className: "checkbox-component",
74
+ "data-skeletonized": skeletonize
73
75
  }), /*#__PURE__*/_react.default.createElement("span", {
74
76
  "data-testid": "checkbox-container",
75
77
  className: "inputcontent",
76
78
  onClick: !shouldDisable() && !skeletonize ? () => setIsChecked(!isChecked) : undefined,
77
79
  tabIndex: -1,
78
80
  role: "checkbox",
79
- "aria-checked": "false"
81
+ "aria-checked": "false",
82
+ onKeyPress: undefined
80
83
  }, /*#__PURE__*/_react.default.createElement("input", {
81
84
  ref: r => {
82
85
  if (targetRef) targetRef(r);
@@ -92,21 +95,23 @@ const CheckBox = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
92
95
  value: value,
93
96
  id: id,
94
97
  onChange: () => {}
95
- }), /*#__PURE__*/_react.default.createElement("span", null), label && /*#__PURE__*/_react.default.createElement(_Label.default, {
98
+ }), /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement(_.Icon, {
99
+ size: 12,
100
+ name: "checkmark"
101
+ })), label && /*#__PURE__*/_react.default.createElement(_Label.default, {
96
102
  label: label,
97
103
  tooltip: tooltip,
98
104
  tooltipWidth: tooltipWidth,
99
- tooltipPosition: tooltipPosition
100
- })), /*#__PURE__*/_react.default.createElement(_hint.default, {
101
- visible: !!hint,
102
- description: hint,
103
- customClass: "hint"
105
+ tooltipPosition: tooltipPosition,
106
+ disabled: disabled,
107
+ hint: hint
108
+ })), /*#__PURE__*/_react.default.createElement(_errorMessage.ErrorMessage, {
109
+ messages: errorMessages
104
110
  }));
105
111
  if (onDenied.unvisible) return null;
106
112
  return gridLayout ? /*#__PURE__*/_react.default.createElement(_gridlayout.default, {
107
113
  customClass: "-withinput",
108
114
  cols: gridLayout
109
115
  }, renderInput()) : renderInput();
110
- });
111
- CheckBox.displayName = 'CheckBox';
116
+ };
112
117
  var _default = exports.default = CheckBox;
@@ -4,7 +4,7 @@ import { Position } from '../@types/Position.js';
4
4
 
5
5
  type ChangeEvent = {
6
6
  checked: boolean;
7
- id?: string;
7
+ id: string;
8
8
  name?: string;
9
9
  value: boolean;
10
10
  };
@@ -37,6 +37,7 @@ interface ICheckBoxProps {
37
37
  skeletonize?: boolean;
38
38
  targetRef?: (ref: HTMLInputElement | null) => void;
39
39
  targetSpanRef?: (ref: HTMLSpanElement | null) => void;
40
+ errorMessages?: string[] | undefined;
40
41
  }
41
42
 
42
- export type { ChangeEvent, ICheckBoxProps };
43
+ export { ChangeEvent, ICheckBoxProps };
@@ -13,6 +13,7 @@ const Content = _ref => {
13
13
  styleForContent
14
14
  } = _ref;
15
15
  return /*#__PURE__*/_react.default.createElement("div", {
16
+ id: "modal-dialog-content",
16
17
  className: "dialog-content",
17
18
  style: styleForContent
18
19
  }, children);
@@ -11,11 +11,11 @@ var _base = require("../base");
11
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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; }
14
- const getCloseButton = handleClose => /*#__PURE__*/_react.default.createElement("span", {
14
+ const getCloseButton = handleClose => /*#__PURE__*/_react.default.createElement("button", {
15
+ id: "botao-fechar-modal-cabecalho",
15
16
  className: "close-button",
16
- onClick: handleClose,
17
- role: "button",
18
- tabIndex: 0
17
+ tabIndex: 0,
18
+ onClick: handleClose
19
19
  }, /*#__PURE__*/_react.default.createElement(_icons.default, {
20
20
  name: "cancel2"
21
21
  }));
@@ -42,8 +42,9 @@ const BaseDialog = props => {
42
42
  onOpenChange(false);
43
43
  } else {
44
44
  if (handlerClose) handlerClose();
45
- onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(false);
46
- setOpen(false);
45
+ if (onOpenChange) {
46
+ onOpenChange(false);
47
+ }
47
48
  }
48
49
  };
49
50
  const handleClickOutside = event => {
@@ -103,10 +104,10 @@ const BaseDialog = props => {
103
104
  };
104
105
  const createdModal = /*#__PURE__*/_react.default.createElement("div", {
105
106
  className: "modalcontainer",
107
+ onMouseDown: handleClickOutside,
106
108
  style: {
107
109
  zIndex: 99999 + Number(zIndex)
108
- },
109
- onMouseDown: handleClickOutside
110
+ }
110
111
  }, overlay && /*#__PURE__*/_react.default.createElement("div", {
111
112
  className: "modal-overlay",
112
113
  "data-testid": "modal-overlay"
@@ -120,8 +121,10 @@ const BaseDialog = props => {
120
121
  ref: wrapperEl
121
122
  }, children)));
122
123
  (0, _react.useEffect)(() => {
123
- if (open && closeOnEsc) {
124
- document.addEventListener('keydown', handleCloseOnEsc);
124
+ if (open) {
125
+ if (closeOnEsc) {
126
+ document.addEventListener('keydown', handleCloseOnEsc);
127
+ }
125
128
  }
126
129
  return () => {
127
130
  document.removeEventListener('keydown', handleCloseOnEsc);
@@ -67,4 +67,4 @@ interface IFormDialogContext {
67
67
  headerRef?: React.RefObject<HTMLDivElement>;
68
68
  }
69
69
 
70
- export type { IBaseProps, ICommonDialogProps, IContentProps, ICustomProps, IFooterProps, IFormDialogContext, IFormProps, IHeaderProps, IQuestionProps };
70
+ export { IBaseProps, ICommonDialogProps, IContentProps, ICustomProps, IFooterProps, IFormDialogContext, IFormProps, IHeaderProps, IQuestionProps };
@@ -82,8 +82,9 @@ const BaseDrawer = _ref => {
82
82
  body.appendChild(drawerOverlay);
83
83
  };
84
84
  const closeDrawerOnEsc = e => {
85
- if (closeOnEsc && (e.keyCode === 27 || e.key === 'ESC')) {
85
+ if (closeOnEsc && e.key === 'Escape') {
86
86
  handlerClose === null || handlerClose === void 0 ? void 0 : handlerClose();
87
+ e.stopPropagation();
87
88
  }
88
89
  };
89
90
  (0, _react.useEffect)(() => {
@@ -98,7 +99,7 @@ const BaseDrawer = _ref => {
98
99
  if (overlay && !targetId && body) setDrawerOverlay(body);
99
100
  return () => {
100
101
  const drawerOverlay = document.getElementsByClassName('drawer-overlay')[0];
101
- if (closeOnEsc) document.body.removeEventListener('keyup', closeDrawerOnEsc);
102
+ if (closeOnEsc) document.body.removeEventListener('keydown', closeDrawerOnEsc);
102
103
  if (targetId) {
103
104
  const drawerComponentTarget = document.getElementById(targetId);
104
105
  if (drawerComponentTarget && drawerComponentEl.current) {
@@ -110,9 +111,9 @@ const BaseDrawer = _ref => {
110
111
  }, []);
111
112
  (0, _react.useEffect)(() => {
112
113
  if (closeOnEsc) {
113
- document.body.addEventListener('keyup', closeDrawerOnEsc);
114
+ document.body.addEventListener('keydown', closeDrawerOnEsc);
114
115
  }
115
- return () => document.body.removeEventListener('keyup', closeDrawerOnEsc);
116
+ return () => document.body.removeEventListener('keydown', closeDrawerOnEsc);
116
117
  }, [closeOnEsc]);
117
118
  const contextValues = {
118
119
  handlerClose,
@@ -24,7 +24,7 @@ const getIcon = (titleIcon, icon) => {
24
24
  return /*#__PURE__*/_react.default.createElement("span", {
25
25
  "data-testid": "icon-header",
26
26
  className: "icon-header"
27
- }, icon || titleIcon && /*#__PURE__*/_react.default.createElement(_icons.default, {
27
+ }, icon || /*#__PURE__*/_react.default.createElement(_icons.default, {
28
28
  name: titleIcon,
29
29
  color: "#000",
30
30
  size: 24
@@ -38,4 +38,4 @@ interface IDrawerContext {
38
38
  skeletonize?: boolean;
39
39
  }
40
40
 
41
- export type { IDrawerContext, IDrawerHeaderProps, IDrawerProps };
41
+ export { IDrawerContext, IDrawerHeaderProps, IDrawerProps };
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import { IPopUpProps } from './types.js';
3
3
 
4
- declare const DropdownPopup: ({ customClassForDropdown, align, isFloatMenu, topPosition, leftPosition, rightPosition, minWidth, ...props }: IPopUpProps) => React.ReactPortal;
4
+ declare const DropdownPopup: ({ id, customClassForDropdown, align, isFloatMenu, topPosition, leftPosition, rightPosition, minWidth, ...props }: IPopUpProps) => React.ReactPortal;
5
5
 
6
6
  export { DropdownPopup as default };
@@ -6,7 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _react = require("react");
8
8
  var _reactDom = _interopRequireDefault(require("react-dom"));
9
- const _excluded = ["customClassForDropdown", "align", "isFloatMenu", "topPosition", "leftPosition", "rightPosition", "minWidth"];
9
+ var _uuid = require("uuid");
10
+ const _excluded = ["id", "customClassForDropdown", "align", "isFloatMenu", "topPosition", "leftPosition", "rightPosition", "minWidth"];
10
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
12
13
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -30,6 +31,7 @@ const getCalendarDropdownStyle = _ref => {
30
31
  const body = document.getElementsByTagName('body')[0];
31
32
  const DropdownPopup = _ref2 => {
32
33
  let {
34
+ id,
33
35
  customClassForDropdown = '',
34
36
  align = 'left',
35
37
  isFloatMenu = false,
@@ -53,10 +55,11 @@ const DropdownPopup = _ref2 => {
53
55
  if (popup && popup.current) {
54
56
  const modalContainers = document.body.getElementsByClassName('modalcontainer');
55
57
  const lastModalContainer = modalContainers[modalContainers.length - 1];
56
- popup.current.style.zIndex = "".concat(modalContainers.length ? lastModalContainer.style.zIndex : 99999);
58
+ popup.current.style.zIndex = "".concat(modalContainers.length ? Number(lastModalContainer.style.zIndex) + 1 : 99999);
57
59
  }
58
60
  (0, _react.useEffect)(() => {
59
61
  body.appendChild(popup.current);
62
+ popup.current.id = id || "dropdown-component-".concat((0, _uuid.v1)());
60
63
  return () => {
61
64
  body.removeChild(popup.current);
62
65
  };
@@ -22,6 +22,7 @@ interface WithDropdownContextProps {
22
22
  handleDropdownClose: () => void;
23
23
  }
24
24
  interface IPopUpProps {
25
+ id?: string;
25
26
  children?: ReactNode;
26
27
  customClassForDropdown?: string;
27
28
  align: 'left' | 'right';
@@ -40,4 +41,4 @@ interface GetCalendarDropdownStyleParams {
40
41
  rightPosition: number;
41
42
  }
42
43
 
43
- export type { GetCalendarDropdownStyleParams, GetDisplayNameParams, IPopUpProps, WithDropdownContextProps, WithDropdownProps, WrappedComponentProps };
44
+ export { GetCalendarDropdownStyleParams, GetDisplayNameParams, IPopUpProps, WithDropdownContextProps, WithDropdownProps, WrappedComponentProps };
@@ -28,7 +28,9 @@ const Fieldset = props => {
28
28
  styleTitle,
29
29
  template = 'none',
30
30
  titleCustomClass,
31
- permissionAttr
31
+ permissionAttr,
32
+ leftElements = null,
33
+ rightElements = null
32
34
  } = props;
33
35
  const {
34
36
  hideContent,
@@ -69,7 +71,7 @@ const Fieldset = props => {
69
71
  style: styleTitle,
70
72
  align: titleAlign,
71
73
  className: "legend ".concat(titleCustomClass)
72
- }, title), /*#__PURE__*/_react.default.createElement("div", {
74
+ }, leftElements, title, rightElements), /*#__PURE__*/_react.default.createElement("div", {
73
75
  className: "contentfieldset -template".concat(template, " "),
74
76
  style: Object.assign(getContentStyle(props), styleContent)
75
77
  }, children)));
@@ -18,6 +18,8 @@ interface IFieldsetProps {
18
18
  hasError?: boolean;
19
19
  gridCols?: string;
20
20
  permissionAttr?: PermissionAttr | PermissionAttr[];
21
+ leftElements?: ReactNode;
22
+ rightElements?: ReactNode;
21
23
  }
22
24
  interface ExpandedElement extends Element {
23
25
  name?: string;
@@ -25,4 +27,4 @@ interface ExpandedElement extends Element {
25
27
  align?: string;
26
28
  }
27
29
 
28
- export type { ExpandedElement, IFieldsetProps };
30
+ export { ExpandedElement, IFieldsetProps };
@@ -6,7 +6,9 @@ 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 '../internals/types.js';
10
+ import '../@types/Position.js';
9
11
 
10
- declare const _default: React__default.ForwardRefExoticComponent<Pick<IFieldProps & React__default.RefAttributes<unknown>, keyof IFieldProps | "key"> & React__default.RefAttributes<HTMLElement>>;
12
+ declare const _default: React__default.ForwardRefExoticComponent<Pick<IFieldProps & React__default.RefAttributes<unknown>, "key" | keyof IFieldProps> & React__default.RefAttributes<HTMLElement>>;
11
13
 
12
14
  export { _default as default };
@@ -6,6 +6,8 @@ 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 '../internals/types.js';
10
+ import '../@types/Position.js';
9
11
 
10
12
  declare const _default: React__default.ForwardRefExoticComponent<IFieldArrayProps & React__default.RefAttributes<HTMLElement>>;
11
13
 
@@ -6,6 +6,8 @@ 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 '../internals/types.js';
10
+ import '../@types/Position.js';
9
11
 
10
12
  declare const _default: React__default.ForwardRefExoticComponent<IFieldProps & React__default.RefAttributes<HTMLElement>>;
11
13
 
@@ -6,6 +6,8 @@ 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 '../internals/types.js';
10
+ import '../@types/Position.js';
9
11
 
10
12
  declare const _default: React__default.ForwardRefExoticComponent<IFieldPeriodProps & React__default.RefAttributes<HTMLElement>>;
11
13
 
@@ -6,6 +6,8 @@ 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 '../internals/types.js';
10
+ import '../@types/Position.js';
9
11
 
10
12
  declare const securityBeforeUnload = "securityBeforeUnload";
11
13
  declare const FormContext: React__default.Context<FormContextProps>;
@@ -10,6 +10,8 @@ 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 '../internals/types.js';
14
+ import '../@types/Position.js';
13
15
 
14
16
  declare const Form: ({ submitOnPressEnterKey, dataSource, securityBeforeUnload, handlerReset, handlerSubmit, handlerValidates, style, customClass, securityTitle, securityText, securityData, onDataChange, onValidateForm, externalFieldErrors, onSubmit, skeletonize, disabled, children, useInternalState, }: FormProps) => JSX.Element;
15
17
 
@@ -5,6 +5,8 @@ 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 '../internals/types.js';
9
+ import '../@types/Position.js';
8
10
 
9
11
  type Validator = (value: string) => string | undefined;
10
12
  type PeriodValidator = (value: {
@@ -217,4 +219,4 @@ type FieldValidator = {
217
219
  [name: string]: Validator | Validator[];
218
220
  };
219
221
 
220
- export type { CustomEvent, CustomKeyboardEvent, FieldErrors, FieldValidator, FormContextProps, FormProps, IEventParams, IFieldArrayProps, IFieldPeriodProps, IFieldProps, IFormSecurityContext, IGetErrorMessagesParams, IWithFieldContext, IWithFormSecurity, OnFielChangeEvent, PeriodChangeEvent, PeriodValidator, Validator, WithFieldProps };
222
+ export { CustomEvent, CustomKeyboardEvent, FieldErrors, FieldValidator, FormContextProps, FormProps, IEventParams, IFieldArrayProps, IFieldPeriodProps, IFieldProps, IFormSecurityContext, IGetErrorMessagesParams, IWithFieldContext, IWithFormSecurity, OnFielChangeEvent, PeriodChangeEvent, PeriodValidator, Validator, WithFieldProps };
@@ -6,6 +6,8 @@ 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 '../internals/types.js';
10
+ import '../@types/Position.js';
9
11
 
10
12
  declare const withFieldHOC: <ComponentProps extends WithFieldProps>(WrappedComponent: React__default.ComponentType<ComponentProps>) => React__default.ForwardRefExoticComponent<React__default.PropsWithoutRef<ComponentProps> & React__default.RefAttributes<HTMLElement>>;
11
13
 
@@ -6,6 +6,8 @@ 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 '../internals/types.js';
10
+ import '../@types/Position.js';
9
11
 
10
12
  declare const FormSecurityContext: React__default.Context<IFormSecurityContext>;
11
13
  declare const withFormSecurity: <ComponentProps extends IWithFormSecurity>(WrappedComponent: React__default.ComponentType<ComponentProps>) => (props: ComponentProps) => JSX.Element;
@@ -7,17 +7,25 @@ exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  require("../assets/styles/gridlayout.scss");
9
9
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- const getClass = props => "row ".concat(props.customClass, "\n ").concat(props.withTrim && ' -withtrim', "\n ").concat(props.verticalAlign && " align-".concat(props.verticalAlign), "\n ").concat(props.horizontalAlign && " justify-content-".concat(props.horizontalAlign));
10
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
14
+ 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); }
15
+ const getClass = props => "row ".concat(props.customClass, "\n ").concat(props.withTrim && ' -withtrim', "\n ").concat(props.verticalAlign && " align-items-".concat(props.verticalAlign), "\n ").concat(props.horizontalAlign && " justify-content-".concat(props.horizontalAlign));
11
16
  const GridRow = props => {
12
17
  const {
13
18
  style,
14
19
  children,
20
+ verticalAlign = 'start',
15
21
  visible = true
16
22
  } = props;
17
23
  if (!visible) return null;
18
24
  return /*#__PURE__*/_react.default.createElement("div", {
19
25
  style: style,
20
- className: getClass(props)
26
+ className: getClass(_objectSpread(_objectSpread({}, props), {}, {
27
+ verticalAlign
28
+ }))
21
29
  }, children);
22
30
  };
23
31
  var _default = exports.default = GridRow;
@@ -9,7 +9,7 @@ interface IGridCol {
9
9
  }
10
10
  interface IGridRow {
11
11
  children: ReactNode | ReactNode[];
12
- verticalAlign?: string;
12
+ verticalAlign?: 'start' | 'center' | 'end' | 'baseline' | 'stretch';
13
13
  horizontalAlign?: string;
14
14
  style?: CSSProperties;
15
15
  withTrim?: boolean;
@@ -17,4 +17,4 @@ interface IGridRow {
17
17
  customClass?: string;
18
18
  }
19
19
 
20
- export type { IGridCol, IGridRow };
20
+ export { IGridCol, IGridRow };
@@ -0,0 +1,3 @@
1
+ declare const showHintList: (arrayHint: string[]) => JSX.Element;
2
+
3
+ export { showHintList };
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.showHintList = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const showHintList = arrayHint => /*#__PURE__*/_react.default.createElement("div", {
10
+ className: "rules-list",
11
+ style: {
12
+ padding: '15px 0px'
13
+ }
14
+ }, /*#__PURE__*/_react.default.createElement("ul", {
15
+ style: {
16
+ listStyleType: 'none'
17
+ }
18
+ }, arrayHint.map((hint, index) => /*#__PURE__*/_react.default.createElement("li", {
19
+ key: index.toString()
20
+ }, "- ", hint))));
21
+ exports.showHintList = showHintList;
@@ -1,6 +1,7 @@
1
1
  import { HintProps } from './types.js';
2
2
  import 'react';
3
+ import '../@types/ColorStyles.js';
3
4
 
4
- declare const Hint: ({ visible, description, customClass, skeletonize, style, }: HintProps) => JSX.Element | null;
5
+ declare const Hint: ({ visible, description, customClass, skeletonize, style, disabled, color, }: HintProps) => JSX.Element | null;
5
6
 
6
7
  export { Hint as default };
package/lib/hint/index.js CHANGED
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
+ var _helpers = require("./helpers");
8
9
  require("../assets/styles/hint.scss");
9
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
11
  const Hint = _ref => {
@@ -13,24 +14,17 @@ const Hint = _ref => {
13
14
  description,
14
15
  customClass,
15
16
  skeletonize = false,
16
- style
17
+ style,
18
+ disabled = false,
19
+ color
17
20
  } = _ref;
18
21
  if (!visible || !description) return null;
19
- const showHintList = arrayHint => /*#__PURE__*/_react.default.createElement("div", {
20
- className: "rules-list",
21
- style: {
22
- padding: '15px 0px'
23
- }
24
- }, /*#__PURE__*/_react.default.createElement("ul", {
25
- style: {
26
- listStyleType: 'none'
27
- }
28
- }, arrayHint.map((hint, index) => /*#__PURE__*/_react.default.createElement("li", {
29
- key: index.toString()
30
- }, "- ", hint))));
31
22
  return /*#__PURE__*/_react.default.createElement("div", {
23
+ "aria-disabled": disabled,
32
24
  style: style,
33
- className: "\n hint-component\n ".concat(customClass, "\n ").concat(skeletonize ? '-skeletonized' : '', "\n ")
34
- }, Array.isArray(description) ? showHintList(description) : /*#__PURE__*/_react.default.createElement("span", null, description));
25
+ className: "\n hint-component\n ".concat(customClass, "\n ").concat(skeletonize ? '-skeletonized' : '', "\n ").concat(disabled ? '-disabled' : '', "\n -").concat(color, "\n ")
26
+ }, Array.isArray(description) ? (0, _helpers.showHintList)(description) : /*#__PURE__*/_react.default.createElement("span", {
27
+ "aria-disabled": disabled
28
+ }, description));
35
29
  };
36
30
  var _default = exports.default = Hint;
@@ -1,11 +1,14 @@
1
1
  import { CSSProperties } from 'react';
2
+ import { ColorStyles } from '../@types/ColorStyles.js';
2
3
 
3
4
  interface HintProps {
4
5
  description?: string | string[];
5
6
  visible?: boolean;
6
7
  customClass?: string;
7
8
  skeletonize?: boolean;
9
+ disabled?: boolean;
8
10
  style?: CSSProperties;
11
+ color?: ColorStyles;
9
12
  }
10
13
 
11
- export type { HintProps };
14
+ export { HintProps };